Skip to content

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

Open
samuelgja wants to merge 3 commits into
clientIO:masterfrom
samuelgja:chore/joint-react-storybook-polish
Open

refactor(joint-react): unify Storybook design system, remove embedded docs#3428
samuelgja wants to merge 3 commits into
clientIO:masterfrom
samuelgja:chore/joint-react-storybook-polish

Conversation

@samuelgja

Copy link
Copy Markdown
Contributor

Description

Refactors the @joint/react Storybook into a single unified design system and removes the documentation that now lives in the docs site.

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 are gone (docs live at docs.jointjs.com). introduction.mdx is now a small landing page. API links point at the real docs.jointjs.com/api-react/{Category}/{Name} instead of a placeholder domain.

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), so what readers copy is what runs.

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 rather than one. It also duplicated documentation that now lives on the docs site, which meant the same content was maintained twice and went stale — several docs.mdx pages described APIs the demos no longer used.

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.

Verification

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

Screenshots (if appropriate):

…e display

- Implemented CodeBlock component with collapsible and copyable functionality.
- Integrated Prism.js for syntax highlighting with a custom theme.
- Added demo styles for unified controls and nodes in Storybook.
- Created Showcase component to unify story presentation with code display.
- Introduced design tokens for consistent styling across the Storybook.
- Updated API documentation links to point to the new JointJS documentation.
- Removed unused makeStory utility to streamline codebase.
- Updated dependencies in yarn.lock for improved package management.
@samuelgja
samuelgja requested a review from kumilingus July 17, 2026 12:50
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