Skip to content

Sync rnui to Claude Design (+ fix invisible Slider/Progress stories) - #8

Closed
aloks98 wants to merge 3 commits into
mainfrom
design-sync-setup
Closed

Sync rnui to Claude Design (+ fix invisible Slider/Progress stories)#8
aloks98 wants to merge 3 commits into
mainfrom
design-sync-setup

Conversation

@aloks98

@aloks98 aloks98 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Adds the sync state that publishes this design system to claude.ai/design, so its design agent builds UIs with the real compiled @e412/rnui-react components instead of generic ones — plus a fix for five Storybook stories that were rendering invisible.

Verification

All 72 components were checked against this repo's own Storybook render, screenshot vs screenshot: 246 stories graded, 246 match, 0 close, 0 mismatch. The closing receipt came back ok: true with nothing pending, validate exited clean, and the render check was 72/72 with 0 broken, 0 thin, 0 identical-variant cards.

No component needed a hand-written preview to match — the generated ones were faithful on first capture across the whole library.

The Storybook fix (apps/storybook, +8/−0)

Both slider.stories.tsx and progress.stories.tsx size their root with a percentage width (w-[60%]) while .storybook/preview.tsx applies a global layout: 'centered'. A centered story root is shrink-to-fit, so the percentage resolved against a 0px parent — the components mounted with full Base UI DOM but measured 0px wide and rendered nothing. Base UI computed --start-position: NaN% / Infinity% for the slider indicator.

Five stories were invisible in Storybook: slider (Default, Range) and progress (Default, Empty, Full).

The fix is parameters: { layout: 'padded' } on both metas — the same thing date-selector.stories.tsx already does, which is why its w-full max-w-xl stories always rendered.

Verified: all 6 stories across the two components now capture with 0 factual failures (previously 5 were sb-error) and grade match. This also let three sync workarounds be deleted — the two skip entries and the owned previews/Slider.tsx stopgap.

What's in .design-sync/

File Why
config.json Converter config — titleMap, docsMap, card-mode overrides, extraEntries, extraFonts
conventions.md Usage guide prepended to the generated README, read by the design agent
fonts/ + fetch-fonts.mjs Self-hosted brand fonts for the theme presets (0.55 MB)
NOTES.md Config rationale, triaged warnings, re-sync risks

Other notable bits

The conventions file's key content is a constraint, not style advice. Tailwind v4 compiles at build time and there's no compiler in Claude Design, so only utilities already in the shipped CSS resolve — an invented class like mt-8 silently does nothing. The file enumerates the actual available vocabulary and directs the agent to var(--token) inline styles for anything outside it. Every class, token, preset, and component name in it is validated against the built artifacts.

Brand fonts are now self-hosted. The presets name 10 web fonts but @e412/rnui-themes deliberately doesn't load them, so every preset rendered with a substitute stack. fetch-fonts.mjs pulls the variable woff2 from Google Fonts (all 10 families are SIL OFL 1.1) and cfg.extraFonts wires them into styles.css. Verified in chromium: 20 faces registered, 0 failed requests, every preset resolving to its real face.

One echarts fix. EChart's gauge story rendered blank because import { GaugeChart } from 'echarts/charts' was bundled as a second copy of echarts, whose use() overwrote the working registration with a foreign class. Fixed via extraEntries. This was preview-only — the shipped bundle always had it registered correctly.

One thing left for you

Only oxide and forest define --font-heading. The other six presets brand the body font but inherit the system stack for h1h6. Shipped faithfully rather than "fixed" — if that's unintended, the change belongs in packages/themes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NAmWWJ2twyebZgPLMc1cg1

aloks98 and others added 3 commits August 6, 2026 18:04
Syncs the design system to claude.ai/design so its design agent builds
with the real compiled @e412/rnui-react components. All 72 components
verified against this repo's own Storybook render.

- config.json: converter config (titleMap, docsMap, cardMode overrides,
  extraEntries, story skips). Paths are PKG_DIR-relative except
  readmeHeader, which resolves from the config home.
- conventions.md: usage guide prepended to the generated README. Its key
  point is that Tailwind v4 has no runtime compiler in Claude Design, so
  only pre-compiled utilities resolve; it enumerates the real vocabulary.
- previews/Slider.tsx: owned preview restoring Slider's card (its stories
  are unrenderable in Storybook — see NOTES.md).
- NOTES.md: config rationale, triaged warnings, and re-sync risks.

Also documents a repo bug: 5 stories in slider/progress use a percentage
width under the global layout:'centered', so they collapse to 0px and are
invisible in Storybook itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NAmWWJ2twyebZgPLMc1cg1
Claude Design reported "Missing brand fonts ... rendering with
substitutes": the 8 presets name 10 web fonts, but @e412/rnui-themes
deliberately doesn't load them, so every preset fell back to a system
stack in rendered designs.

Self-hosts them instead: fetch-fonts.mjs pulls the variable woff2 from
Google Fonts (all 10 families are SIL OFL 1.1) into .design-sync/fonts/,
and cfg.extraFonts makes the build copy them into ds-bundle/fonts/ and
@import the sheet from styles.css — the closure designs receive.
20 faces (latin + latin-ext), 0.55 MB.

Verified in chromium: 20 faces registered, 0 failed requests, all 10
families pass document.fonts.check(), and every preset resolves to its
real body face (oxide/DM Sans ... crimson/Instrument Sans).

extraFonts is outside the grade key, so no component grades were
invalidated — the driver receipt stayed 72 carried forward, 0 cleared.

conventions.md previously told the design agent these fonts were NOT
bundled; corrected, with a per-theme typography table.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NAmWWJ2twyebZgPLMc1cg1
Both story files size their root with a percentage width (`w-[60%]`)
while .storybook/preview.tsx applies a global `layout: 'centered'`.
A centered story root is shrink-to-fit, so the percentage resolved
against a 0px parent: the components mounted with full Base UI DOM but
measured 0px wide and rendered nothing. Base UI computed
`--start-position: NaN%` / `Infinity%` for the slider indicator.

Five stories were affected and invisible in Storybook:
slider (Default, Range) and progress (Default, Empty, Full).

Adds `parameters: { layout: 'padded' }` to both metas — the same thing
date-selector.stories.tsx already does, which is why its `w-full
max-w-xl` stories always rendered. A padded root spans the canvas, so
the percentage resolves normally.

Verified: all 6 stories across the two components now capture with 0
factual failures (previously 5 were sb-error) and grade match against
their previews.

Removes the sync workarounds these stories forced:
- overrides.{Slider,Progress}.skip — both sets capture now
- .design-sync/previews/Slider.tsx — the owned stopgap that stood in
  for Slider's unphotographable card
- Progress keeps cardMode "single" (its grid-cell overflow is a card
  layout concern, unrelated to the story bug)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NAmWWJ2twyebZgPLMc1cg1
@aloks98 aloks98 changed the title Sync rnui to Claude Design Sync rnui to Claude Design (+ fix invisible Slider/Progress stories) Aug 10, 2026
@aloks98

aloks98 commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #9 — same commits, re-opened from a conventionally-named branch (feat/design-sync) with a conventional-commit title. No content change.

@aloks98 aloks98 closed this Aug 10, 2026
@aloks98
aloks98 deleted the design-sync-setup branch August 10, 2026 13:46
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