Skip to content

feat(headless-docsite): embed code panel in canvas, magenta theme, refine sandbox & tabs#36071

Closed
tudorpopams wants to merge 2 commits intomicrosoft:masterfrom
tudorpopams:feat/headless-bebop-theme
Closed

feat(headless-docsite): embed code panel in canvas, magenta theme, refine sandbox & tabs#36071
tudorpopams wants to merge 2 commits intomicrosoft:masterfrom
tudorpopams:feat/headless-bebop-theme

Conversation

@tudorpopams
Copy link
Copy Markdown
Contributor

@tudorpopams tudorpopams commented Apr 28, 2026

Summary

Polishes the headless components docsite: embeds the "Show code" panel directly into the canvas card, swaps the accent to a magenta theme, and refines the Stackblitz sandbox + tab strip so users only see the files actually referenced by the displayed story.

Changes

Docsite (apps/public-docsite-v9-headless)

  • Custom docs page replaces autodocs: title / description / primary canvas / ArgTypes / remaining stories — matching the deployed Fluent docs layout.
  • Tabbed source panel (Story.tsx + each referenced *.module.css) is portaled into the same .sbdocs-preview canvas card, listening to Storybook's native "Show code" toggle so it sits next to "Open in Stackblitz".
  • Per-story tab strip is filtered to CSS modules actually referenced in the displayed TSX (the meta still lists the full set so the sandbox can bundle what's needed).
  • Sidebar / toolbar accent + tab indicator + selected nav now use magenta #9b1f5a (Figma --prmt-color-red ramp); replaces the prior near-black #4a0a2c. Sidebar hover bg switched to neutral grey.
  • Drop the rsms.me Inter import — everything inherits Segoe UI.

Stories (react-headless-components-preview/stories)

  • New README.md replaces CLAUDE.md, merging package metadata with the full authoring guide (pattern, boilerplate, token tiers, gotchas, PR checklist, file map).
  • withStorySource pins each story's own raw source as parameters.docs.source.code/originalSource and overrides fullSource via a non-writable getter so the babel preset's empty post-strip overwrite is swallowed; rewrites long ../../<theme>/components/*.module.css paths to a colocated ./styles/*.module.css for paste-ready snippets.
  • withCssModuleSource bundles tokens.css + only the CSS modules referenced from src/example.tsx into the Stackblitz sandbox under src/styles/, and prepends an import of tokens.css to App.tsx.
  • Remove the broken Copy Page button.

Babel preset (babel-preset-storybook-full-source)

  • modifyImportsPlugin no longer warns for known-safe relative patterns (*.module.css, ?raw queries, with{Story,CssModule}Source helpers, *.stories?raw). Strip behaviour and tests are unchanged (15/15 passing).

Theme source

  • Recovered design system source (tokens.css + 27 component CSS modules) that drives the docsite preview and Stackblitz sandboxes.

Verification

  • yarn nx run public-docsite-v9-headless:build-storybook — clean build, 0 babel warnings.
  • yarn nx run babel-preset-storybook-full-source:test — 15/15 passing.
  • Visual: tested across Button / Dialog / Accordion stories; "Show code" expands the tabbed panel inside the canvas card; Stackblitz sandbox includes only tokens.css + the modules referenced by the example.

…me, refine sandbox & tabs

Bebop docsite (apps/public-docsite-v9-headless):
- Custom BebopDocsPage replaces autodocs: title/description/primary canvas/
  ArgTypes/remaining stories layout matching deployed Fluent docs.
- BebopSource portals a tabbed Story.tsx + .module.css source panel into the
  same .sbdocs-preview canvas card the user already sees, listening to
  Storybook's native 'Show code' toggle so it sits next to 'Open in Stackblitz'.
- Per-story tab strip is filtered to CSS modules actually referenced in the
  displayed TSX (the meta still lists the full set so the sandbox can bundle
  what's needed).
- Sidebar/toolbar accent + tab indicator + selected nav now use Bebop
  magenta #9b1f5a (Figma --prmt-color-red ramp); replaces the prior near-black
  #4a0a2c. Sidebar hover bg switched to neutral grey.
- Drop the rsms.me Inter import; everything inherits Segoe UI.

Stories (react-headless-components-preview/stories):
- New README.md replaces CLAUDE.md, merging the package metadata header with
  the full authoring guide (pattern, boilerplate, token tiers, gotchas,
  PR checklist, file map).
- withStorySource pins each story's own raw source as
  parameters.docs.source.code+originalSource and overrides fullSource via a
  non-writable getter so the babel preset's empty post-strip overwrite is
  swallowed; rewrites long ../../bebop/components/*.module.css paths to a
  colocated ./styles/*.module.css for paste-ready snippets.
- withCssModuleSource bundles tokens.css + only the CSS modules referenced
  from src/example.tsx into the Stackblitz sandbox under src/styles/, and
  prepends an import of tokens.css to App.tsx.
- Remove the broken Copy Page button.

Babel preset (babel-preset-storybook-full-source):
- modifyImportsPlugin no longer warns for known-safe relative patterns
  (*.module.css, ?raw queries, with{Story,CssModule}Source helpers,
  *.stories?raw). Strip behaviour and tests are unchanged.

Recovered bebop/ design system source (tokens.css + 27 component CSS modules)
that drives the docsite preview and Stackblitz sandboxes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tudorpopams tudorpopams requested review from a team as code owners April 28, 2026 17:35
@tudorpopams tudorpopams changed the title feat(headless-docsite): embed code panel in canvas, Bebop magenta theme, refine sandbox & tabs feat(headless-docsite): embed code panel in canvas, magenta theme, refine sandbox & tabs Apr 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

…imer

- Rename bebop/ folder to theme/ (tokens.css + 27 component CSS modules)
- Rename BebopDocsPage -> HeadlessDocsPage and BebopSource -> HeadlessSourcePanel
- Scrub all bebop identifiers, paths, classes, and comments across stories,
  helpers, .storybook config, and project.json files
- Add a disclaimer banner on the docs page explaining that headless components
  ship without default styles and that the demo CSS is illustrative only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tudorpopams tudorpopams deleted the feat/headless-bebop-theme branch April 28, 2026 19:19
@tudorpopams
Copy link
Copy Markdown
Contributor Author

Superseded by #36073 (branch renamed to drop internal codename).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant