Skip to content

refactor(joint-react): unify Storybook design system, remove embedded docs#3431

Open
samuelgja wants to merge 1 commit into
clientIO:masterfrom
samuelgja:refactor/joint-react-storybook
Open

refactor(joint-react): unify Storybook design system, remove embedded docs#3431
samuelgja wants to merge 1 commit into
clientIO:masterfrom
samuelgja:refactor/joint-react-storybook

Conversation

@samuelgja

@samuelgja samuelgja commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Refactors the @joint/react Storybook into a single unified design system and removes documentation that now lives on the docs site. Storybook only — no src changes.

Unified design system (stories/ui/) — a global decorator wraps every story in one branded frame, so all 60 stories read as one product:

  • Showcase — category eyebrow, title, one-line description, API reference link, variant badge
  • Canvas — shared graph-paper dot-grid drawing surface
  • CodeBlock — syntax-highlighted (prism-react-renderer), collapsible "Show code" with line numbers, copy button and multi-file tabs
  • tokens.css / demo.css — JointJS brand tokens plus reusable .jj-btn / .jj-input / .jj-node / .jj-controls classes so demo internals match

Docs removed — all 26 docs.mdx / story.mdx pages and the Step-by-step tutorial (docs live on the docs site). introduction.mdx is now a small landing page. API links point at docs.jointjs.com/api-react/{Category}/{Name}.

Source is auto-injected — every story shows its real demo file via a ?raw import; no hand-maintained code strings. Demo code is self-contained (no storybook-config/theme imports).

Diagram theming.jj-paper ships an opaque light background, which every story used to override with an inline dark PAPER_STYLE. It is now transparent in the storybook so the shared dark canvas shows through, and incidental light element colors were remapped to one dark palette. Colors that carry meaning (theming demos, status colors, charts) are untouched.

Cleanup — removed make-story, stories-utils, with-simple-data, unused UI components, and 4 unused devDependencies; refreshed a stale knip.json whose entry patterns did not match this package's story.tsx convention.

Motivation and Context

The Storybook had drifted — every story styled its own paper, buttons and nodes, so the gallery looked like a dozen different products. It also duplicated documentation that now lives on the docs site, so the same content was maintained twice and went stale. Storybook is now purely a visual, interactive gallery of runnable examples with a consistent look, which also makes it embeddable in the docs site later.

This replaces a previous PR that accidentally bundled unrelated src changes with the storybook work; this branch contains only the storybook refactor, based directly on master.

Verification

  • yarn test passes: typecheck, lint (0 errors), knip, jest 93 suites / 1026 tests (React 19) and 92 / 1022 (React 18)
  • yarn build-storybook succeeds
  • All 66 story entries rendered headlessly and measured against their canvas: none clipped, none broken

Screenshots (if appropriate):

Screenshot 2569-07-22 at 15 48 13

… docs

Rebuilds the @joint/react Storybook around one Showcase frame applied via a
global decorator: a shared graph-paper canvas, syntax-highlighted collapsible
Show-code, and reusable brand tokens / .jj-* classes so every story reads as
one product.

- Removes all docs.mdx/story.mdx pages and the step-by-step tutorial (docs now
  live on the docs site); introduction.mdx becomes a small landing page.
- Auto-injects each story's source via ?raw imports instead of hand-written
  strings; demo code is self-contained.
- Makes .jj-paper transparent in the storybook so the dark canvas shows through
  (removing the per-story PAPER_STYLE workaround).
- Points API links at docs.jointjs.com/api-react/{Category}/{Name}.
- Drops dead utils (make-story, stories-utils, with-simple-data), unused UI
  components and 4 unused devDependencies; refreshes a stale knip config.

Storybook only - no src changes.
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