Skip to content

Add design-sync inputs for Wonder Blocks → claude.ai/design - #3181

Open
caitlynmayers wants to merge 3 commits into
mainfrom
design-sync/wonder-blocks-claude-design
Open

Add design-sync inputs for Wonder Blocks → claude.ai/design#3181
caitlynmayers wants to merge 3 commits into
mainfrom
design-sync/wonder-blocks-claude-design

Conversation

@caitlynmayers

Copy link
Copy Markdown

Adds the reproducible design-sync configuration that syncs Wonder Blocks to Claude Design, so future re-syncs replay every decision deterministically.

What this enables

The Claude Design agent builds UIs from Wonder Blocks' real compiled bundle — every design it produces uses your actual components, props, tokens, and the Shape Your Learning / Thunderblocks theme by default.

Synced project: https://claude.ai/design/p/e9e1c66b-5427-486a-a468-5d90bc569ba9 (70 components, latest main).

Files (all under .design-sync/)

  • config.json — pkg/globalName, storybook shape, extraEntries (all WB packages), titleMap, grid-overflow/portal overrides, Tooltip skip, provider (Thunderblocks theme default), extraFonts (brand fonts).
  • overrides/source-storybook.mjs — filter to WB manifest-tagged canonical stories (drops Testing/Snapshots/Playtesting + deprecated).
  • overrides/story-imports.mjs — map each package's default export to its component name on the global; base64-encode story-imported SVGs so Aphrodite icon masks aren't dropped.
  • fix-bundle-svgs.mjs — post-build pass base64-encoding bundle-baked SVG data URLs (repairs icons) and refreshing the anchor bundleSha.
  • bundle-entry.mjs — barrel exposing default-export components by name.
  • conventions.md — design-agent usage guide (theme wrapper, token + Aphrodite styling idiom).
  • previews/ — owned preview fixes (Tabs RTL, CircularSpinner light-on-dark).
  • NOTES.md / FANOUT.md — repo gotchas, re-sync risks, fan-out grading process.

Re-syncing later

build:types + pnpm build + rebuild .design-sync/sb-reference, then run the design-sync driver; re-apply the compare theme-global patch and run fix-bundle-svgs.mjs after the build (see NOTES.md). Deterministic — carried-forward grades make it fast.

🤖 Generated with Claude Code

Reproducible configuration for syncing Wonder Blocks to Claude Design
(claude.ai/design), so re-syncs replay every decision deterministically.

- config.json: pkg/globalName, storybook shape, extraEntries (all WB packages),
  bundle-entry barrel, titleMap, grid-overflow/portal overrides, Tooltip skip,
  provider (Shape Your Learning / Thunderblocks theme default), extraFonts.
- overrides/source-storybook.mjs: filter to WB "manifest"-tagged canonical stories.
- overrides/story-imports.mjs: map each package's default export to its component
  name on the global; base64-encode story-imported SVGs (CSS-safe icon masks).
- fix-bundle-svgs.mjs: post-build pass base64-encoding bundle-baked SVG data URLs
  (icons) and refreshing the anchor's bundleSha.
- bundle-entry.mjs: barrel exposing default-export components by name.
- conventions.md: design-agent usage guide (theme wrapper, token/Aphrodite idiom).
- previews/: owned preview fixes (Tabs RTL, CircularSpinner light backdrop).
- NOTES.md / FANOUT.md: repo gotchas, re-sync risks, and fan-out grading process.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: af3e2c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@khan-actions-bot
khan-actions-bot requested a review from a team August 22, 2026 15:29
@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 131 kB

ℹ️ View Unchanged
Filename Size
packages/eslint-plugin-wonder-blocks/dist/es/index.js 7.11 kB
packages/wonder-blocks-accordion/dist/es/index.js 3.02 kB
packages/wonder-blocks-announcer/dist/es/index.js 2.43 kB
packages/wonder-blocks-badge/dist/es/index.js 2.03 kB
packages/wonder-blocks-banner/dist/es/index.js 2.01 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.93 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 798 B
packages/wonder-blocks-button/dist/es/index.js 4.28 kB
packages/wonder-blocks-card/dist/es/index.js 1.09 kB
packages/wonder-blocks-cell/dist/es/index.js 2.19 kB
packages/wonder-blocks-clickable/dist/es/index.js 2.61 kB
packages/wonder-blocks-core/dist/es/index.js 2.6 kB
packages/wonder-blocks-data/dist/es/index.js 5.51 kB
packages/wonder-blocks-date-picker/dist/es/index.js 8.06 kB
packages/wonder-blocks-dropdown/dist/es/index.js 20.4 kB
packages/wonder-blocks-form/dist/es/index.js 6.39 kB
packages/wonder-blocks-grid/dist/es/index.js 1.25 kB
packages/wonder-blocks-icon-button/dist/es/index.js 4.06 kB
packages/wonder-blocks-icon/dist/es/index.js 1.89 kB
packages/wonder-blocks-labeled-field/dist/es/index.js 3.47 kB
packages/wonder-blocks-layout/dist/es/index.js 1.69 kB
packages/wonder-blocks-link/dist/es/index.js 1.54 kB
packages/wonder-blocks-modal/dist/es/index.js 7.36 kB
packages/wonder-blocks-pill/dist/es/index.js 1.32 kB
packages/wonder-blocks-popover/dist/es/index.js 4.41 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.49 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.12 kB
packages/wonder-blocks-styles/dist/es/index.js 464 B
packages/wonder-blocks-switch/dist/es/index.js 1.6 kB
packages/wonder-blocks-tabs/dist/es/index.js 5.62 kB
packages/wonder-blocks-testing-core/dist/es/index.js 4.09 kB
packages/wonder-blocks-testing/dist/es/index.js 978 B
packages/wonder-blocks-theming/dist/es/index.js 384 B
packages/wonder-blocks-timing/dist/es/index.js 1.53 kB
packages/wonder-blocks-tokens/dist/es/index.js 6.5 kB
packages/wonder-blocks-toolbar/dist/es/index.js 906 B
packages/wonder-blocks-tooltip/dist/es/index.js 6.19 kB
packages/wonder-blocks-typography/dist/es/index.js 1.04 kB

compressed-size-action

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (052b9be) and published all packages with changesets to npm.

You can install the packages in frontend by running:

./dev/tools/deploy_wonder_blocks.js --tag="PR3181"

Packages can also be installed manually by running:

pnpm add @khanacademy/wonder-blocks-<package-name>@PR3181

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-loegrwndyr.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 0
Tests with visual changes 0
Total stories 867
Inherited (not captured) snapshots [TurboSnap] 541
Tests on the build 541

caitlynmayers and others added 2 commits August 22, 2026 12:17
WB typography/spacing tokens are rem-based against a 10px root
(html { font-size: 62.5% }), which WB's Storybook applies via
static/sb-styles/preview.css. The converter only scraped component CSS, so the
shipped styles.css closure lacked it — making all type render 1.6x too large in
claude.ai/design (16px root vs the expected 10px), with px radii looking small
by comparison.

- base-reset.css: html 62.5% + body 1.6rem + default themed text color + dark color-scheme.
- inject-base-css.mjs: post-build pass that copies base-reset.css → ds-bundle/base.css,
  prepends `@import "./base.css"` to styles.css, and refreshes the anchor styleSha.
  Run after package-build (with fix-bundle-svgs), before validate/upload.
- conventions.md / NOTES.md: document the 10px-root requirement and the post-build step.

Verified: html computes to 10px, Button ~13.3px / radius 8px, and typography
previews now match the Storybook scale exactly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wonder-blocks-pill is deprecated and nothing in the synced DS uses it (no card,
no preview references it), so remove it from extraEntries + the barrel entry so
Pill is no longer reachable on window.WonderBlocks.

Layout (Strut/Spring/MediaLayout) is kept: WB's own stories use Strut/Spring for
layout spacing in ~11 components' previews, so it must stay bundled for those to
render. It's reachable but unsurfaced (no cards/docs; conventions steer to View).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant