Modernize Storybook component docs - #3043
Draft
fredvisser wants to merge 7 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request modernizes the Storybook documentation experience in packages/storybook by introducing a repository-owned responsive docs layout (page wrapper, table of contents, previews/showcases/guidance blocks) and aligning docs styling with Nimble design tokens (light/dark), while removing reliance on Storybook’s private syntax-highlighter API and its dependency chain.
Changes:
- Add new Storybook docs layout utilities (
StoryPage,StoryTableOfContents,StoryPreview,StoryShowcase, guidance blocks, etc.) with token-backed styling. - Update Button and Select MDX docs to use the new layout conventions, including stable section metadata and a theme-aware inline anatomy SVG for Button.
- Remove SyntaxHighlighter registration and the
react-syntax-highlighterdependency; convert certaincsfences totextto avoid relying on custom highlighting.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/storybook/src/vite-env.d.ts | Adds TS module typing for *.svg?raw imports used by Vite. |
| packages/storybook/src/utilities/story-layout.tsx | Introduces the new token-styled Storybook docs layout components and ToC behavior. |
| packages/storybook/src/ok/ts/icon-dynamic/ts-icon-dynamic.mdx | Switches a Blazor snippet fence from cs to text. |
| packages/storybook/src/nimble/table/table.mdx | Switches a C# snippet fence from cs to text. |
| packages/storybook/src/nimble/select/select.stories.ts | Disables Storybook’s built-in docs ToC for Select to avoid duplication with custom ToC. |
| packages/storybook/src/nimble/select/select.mdx | Refactors Select docs to use StoryPage + section metadata + previews/API wrappers. |
| packages/storybook/src/nimble/patterns/button/button-styling-docs.mdx | Updates Button styling docs to use StoryShowcase and shared section metadata. |
| packages/storybook/src/nimble/dialog/dialog.mdx | Switches a C# snippet fence from cs to text. |
| packages/storybook/src/nimble/button/images/button-anatomy.svg | Adds the anatomy SVG asset used for inline themed docs rendering. |
| packages/storybook/src/nimble/button/button.stories.ts | Disables Storybook’s built-in docs ToC for Button to avoid duplication with custom ToC. |
| packages/storybook/src/nimble/button/button.mdx | Rebuilds Button docs around the new layout primitives, ToC, and guidance blocks. |
| packages/storybook/src/nimble/button/button-sections.ts | Adds reusable, stable section metadata for Button docs + ToC items. |
| packages/storybook/src/nimble/button/button-anatomy.tsx | Adds a component that renders the anatomy SVG inline and theme-aware via tokens. |
| packages/storybook/package.json | Removes react-syntax-highlighter dependency. |
| packages/storybook/.storybook/theme.js | Aligns Storybook theme base font to Nimble’s token font family. |
| packages/storybook/.storybook/preview.js | Removes private SyntaxHighlighter registration usage. |
| package-lock.json | Updates lockfile to reflect dependency removal and resulting tree changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernize the Nimble Storybook component documentation pages with a repository-owned responsive layout, explicit table of contents, reusable previews/showcases/guidance blocks, and token-backed light/dark styling.
The Button docs now include the cropped, inline theme-aware anatomy SVG and stable section metadata. Select and related docs use the same layout conventions. Storybook's public Docs blocks remain responsible for
Canvas,Controls,Title, andMeta; custom table-descendant styling was removed to keep the API surface on stock Storybook behavior. The private syntax-highlighter API and unused dependency were removed, and generated Storybook selector workarounds were not expanded.Validation
npm run lint -w @ni-private/storybooknpm run build -w @ni-private/storybookgit diff --cached --checkThe existing generated-selector loading-skeleton workaround in
packages/storybook/.storybook/preview.cssis unchanged and remains outside this PR's staged payload.