Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
831d0d4
feat(headless-docsite): embed code panel in canvas, Bebop magenta the…
tudorpopams Apr 28, 2026
12ace04
chore(headless-docsite): rename bebop -> theme and add styling discla…
tudorpopams Apr 28, 2026
01fd2c2
refactor(headless-docsite): colocate CSS modules with their stories
tudorpopams Apr 28, 2026
aa9ac09
refactor(headless-docsite): move theme/ into public-docsite-v9-headless
tudorpopams Apr 28, 2026
3dc45fa
refactor(headless-docsite): move theme/ into the stories package
tudorpopams Apr 28, 2026
70325a3
docs(headless-docsite): rephrase styling disclaimer
tudorpopams Apr 28, 2026
d5e2759
fix(headless-docsite): correct tokens.css path in stories storybook p…
tudorpopams Apr 28, 2026
c4e0ac2
fix(headless-docsite): exclude stories from test-ssr and fix RIT type…
tudorpopams Apr 28, 2026
f3f4ee8
fix(headless-docsite): bigger disclaimer + preview note + magenta but…
tudorpopams Apr 29, 2026
94e8c37
fix(headless-docsite): enlarge disclaimer text, match preview note size
tudorpopams Apr 29, 2026
694e404
fix(headless-docsite): annotate stories storybook main.js for type-check
tudorpopams Apr 29, 2026
8d36053
fix(headless-stories): repair mangled CSS module class names
tudorpopams Apr 29, 2026
6f982cf
fix(headless-stories): match deployed Skeleton story layout
tudorpopams Apr 29, 2026
941f3dc
fix(headless-stories): re-enable SSR tests, teach esbuild ?raw + modu…
tudorpopams Apr 30, 2026
12a3e1b
fix(headless-stories): scope ?raw module declaration to this package
tudorpopams Apr 30, 2026
a754d28
fix(babel-preset-storybook-full-source): drop relative-import allowlist
tudorpopams Apr 30, 2026
2f859dd
refactor(headless-stories): extract shared CSS-modules webpack rule
tudorpopams Apr 30, 2026
47151ab
refactor(headless-docsite): move docs page + source panel into docsit…
tudorpopams Apr 30, 2026
dc11b17
fix(headless-docsite): load Segoe UI from c.s-microsoft.com
tudorpopams Apr 30, 2026
d624206
feat(babel-preset-storybook-full-source): auto-inject docs source params
tudorpopams Apr 30, 2026
0cc060f
fix(headless-stories): convert Card to CSS modules + design tokens
tudorpopams Apr 30, 2026
d74e592
docs: refresh READMEs after PR #36073 review changes
tudorpopams Apr 30, 2026
78c296a
fix(headless-docsite): override SB chrome painting code panel black
tudorpopams Apr 30, 2026
825da93
fix(headless-stories): clip Card children to its rounded corners
tudorpopams May 4, 2026
94b1716
fix(headless-stories): convert Drawer + Popover to CSS modules
tudorpopams May 4, 2026
c56b5d1
feat: modulerize and make css module support for storybook pluggable
Hotell May 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions apps/public-docsite-v9-headless/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
const rootMain = require('../../../.storybook/main');
const headlessMain = require('../../../packages/react-components/react-headless-components-preview/stories/.storybook/main');

module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript'|'babel'>} */ ({
...rootMain,
...headlessMain,
stories: [
...rootMain.stories,
// docsite stories
'../src/**/*.mdx',
'../src/**/index.stories.@(ts|tsx)',
...headlessMain.stories,
// headless package stories
'../../../packages/react-components/react-headless-components-preview/stories/src/**/index.stories.@(ts|tsx)',
],
staticDirs: ['../public'],
addons: [...rootMain.addons],
build: {
previewUrl: process.env.DEPLOY_PATH,
},
webpackFinal: (config, options) => {
const localConfig = /** @type config */ ({ ...rootMain.webpackFinal(config, options) });

return localConfig;
},
});
113 changes: 53 additions & 60 deletions apps/public-docsite-v9-headless/.storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,33 @@
<link href="/shell.css" rel="stylesheet" />

<!--
Override the default styles used in the Storybook svg icons for the left tree panel.

@see https://storybook.js.org/docs/react/configure/theming#css-escape-hatches

> 💡 NOTE:
>
> This is brittle way for providing custom non thenable styles for manager UI
>
> Those selectors might change on any storybook version bump.
Segoe UI from Microsoft's static font CDN. The fallbacks in `font-family`
below cover users on networks blocking the CDN, but on a healthy connection
the docsite renders Segoe UI on every platform — not just Windows.
-->
<link rel="preconnect" href="https://c.s-microsoft.com" crossorigin />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.css" />

<style>
@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI Light'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format('woff2'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format('woff'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format('truetype');
font-weight: 100;
}

@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI Semilight'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2) format('woff2'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff) format('woff'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf) format('truetype');
font-weight: 200;
}
<!--
Headless docsite chrome overrides for the Storybook manager UI.

@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2) format('woff2'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff) format('woff'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf) format('truetype');
font-weight: 400;
}
The sidebar selectors are brittle — they depend on Storybook's manager DOM
structure and may need updating on Storybook version bumps. Color values
mirror {@link ../../../packages/react-components/react-headless-components-preview/stories/.storybook/tokens.css} (light mode).

@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI Semibold'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2) format('woff2'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff) format('woff'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf) format('truetype');
font-weight: 600;
}
@see https://storybook.js.org/docs/react/configure/theming#css-escape-hatches
-->

@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI Bold'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2) format('woff2'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff) format('woff'),
url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf) format('truetype');
font-weight: 700;
<style>
:root {
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
--hl-text: #0a0a0a;
--hl-text-muted: #52525b;
--hl-accent: #9b1f5a;
--hl-accent-contrast: #ffffff;
}

#storybook-preview-iframe {
Expand All @@ -75,12 +47,12 @@

.sidebar-item svg,
.sidebar-svg-icon {
color: #11100f !important;
color: var(--hl-text) !important;
}

.sidebar-item[data-selected='true'] svg,
.sidebar-item[data-selected='true'] .sidebar-svg-icon {
color: #ffffff !important;
color: var(--hl-accent-contrast) !important;
}

/**
Expand All @@ -91,11 +63,11 @@
.sidebar-subheading,
button[data-action='collapse-ref'] {
font-weight: 600 !important;
font-size: 16px !important;
letter-spacing: 0px !important;
line-height: 24px !important;
font-size: 13px !important;
letter-spacing: -0.01em !important;
line-height: 20px !important;
text-transform: none !important;
color: #11100f !important;
color: var(--hl-text) !important;
}

.sidebar-subheading button,
Expand All @@ -107,10 +79,30 @@
.sidebar-item {
align-items: center !important;
font-weight: 400 !important;
font-size: 14px !important;
font-size: 13px !important;
letter-spacing: -0.01em !important;
line-height: 24px !important;
color: #11100f !important;
color: var(--hl-text) !important;
border-radius: 999px !important;
}

/*
Override Storybook's default hover (a saturated pink derived from
`colorSecondary`) with a subtle neutral surface tone. Matches the
`--surface-muted` token from {@link ../../../packages/react-components/react-headless-components-preview/stories/.storybook/tokens.css}.
*/
.sidebar-item:hover,
.sidebar-item:hover svg,
.sidebar-item:hover .sidebar-svg-icon {
background: #f2f2f4 !important;
color: var(--hl-text) !important;
}

.sidebar-item[data-selected='true']:hover,
.sidebar-item[data-selected='true']:hover svg,
.sidebar-item[data-selected='true']:hover .sidebar-svg-icon {
background: var(--hl-accent) !important;
color: var(--hl-accent-contrast) !important;
}

.sidebar-item a {
Expand All @@ -119,10 +111,11 @@

.sidebar-item[data-selected='true'] {
font-weight: 600 !important;
font-size: 14px !important;
font-size: 13px !important;
letter-spacing: -0.01em !important;
line-height: 24px !important;
color: #ffffff !important;
color: var(--hl-accent-contrast) !important;
background: var(--hl-accent) !important;
}

.sidebar-item > span:first-child,
Expand Down
111 changes: 18 additions & 93 deletions apps/public-docsite-v9-headless/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,99 +1,24 @@
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<style type="text/tailwindcss">
@layer theme, base, utilities;
@import 'tailwindcss/theme' layer(theme);
@import 'tailwindcss/utilities' layer(utilities);
:root {
interpolate-size: allow-keywords;
}
</style>
<!--
Tailwind's Preflight is omitted above because it resets h1/h2/p/a in
MDX docs (which rely on typography from react-storybook-addon/src/styles.css).
Re-apply the essential resets here inside `@layer base`, scoped to
`.docs-story` so rendered Canvas examples get border/box-sizing/form-element
normalization without affecting the surrounding MDX page. -->
<style>
@layer base {
@scope (.docs-story) {
*,
::before,
::after,
::backdrop,
::file-selector-button {
box-sizing: border-box;
border: 0 solid currentColor;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
vertical-align: middle;
}

img,
video {
max-width: 100%;
height: auto;
}

button,
input,
optgroup,
select,
textarea,
::file-selector-button {
font-family: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
font-size: 100%;
font-weight: inherit;
line-height: inherit;
letter-spacing: inherit;
color: inherit;
}
Story canvas head.

button,
select {
text-transform: none;
}
Design tokens ({@link ../../../packages/react-components/react-headless-components-preview/stories/.storybook/tokens.css}) are imported from `preview.js` so they
reach the iframe via webpack. This file holds raw <link> / <style> tags that
must be present in the iframe document head before any story renders.
-->

button,
input:where([type='button'], [type='reset'], [type='submit']),
::file-selector-button {
appearance: button;
background-color: transparent;
background-image: none;
}

:-moz-focusring {
outline: auto;
}

::placeholder {
opacity: 1;
color: color-mix(in oklab, currentColor 50%, transparent);
}

textarea {
resize: vertical;
}

ol,
ul,
menu {
list-style: none;
}
<!--
Segoe UI from Microsoft's static font CDN — same set as `manager-head.html`.
Story canvases declare `font-family: 'Segoe UI', system-ui` via the design
tokens, so loading the webfont here makes them render Segoe on every OS.
-->
<link rel="preconnect" href="https://c.s-microsoft.com" crossorigin />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.css" />
<link rel="stylesheet" href="https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.css" />

[hidden]:where(:not([hidden='until-found'])) {
display: none !important;
}
}
<style>
:root {
interpolate-size: allow-keywords;
}
</style>
21 changes: 4 additions & 17 deletions apps/public-docsite-v9-headless/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
import { polyfillBodyAndObserve } from '@microsoft/focusgroup-polyfill/shadowless';
import * as headlessPreview from '../../../packages/react-components/react-headless-components-preview/stories/.storybook/preview';

import * as rootPreview from '../../../.storybook/preview';
import { tailwindSandboxTemplate } from './tailwind-sandbox-template';
export const decorators = [...headlessPreview.decorators];

polyfillBodyAndObserve();

/** @type {typeof rootPreview.decorators} */
export const decorators = [...rootPreview.decorators];

/** @type {typeof rootPreview.parameters} */
/** @type {typeof headlessPreview.parameters} */
export const parameters = {
...rootPreview.parameters,
docs: {
...rootPreview.parameters.docs,
},
...headlessPreview.parameters,
options: {
storySort: {
method: 'alphabetical',
order: ['Introduction', 'Headless Components'],
},
},
exportToSandbox: {
...rootPreview.parameters.exportToSandbox,
...tailwindSandboxTemplate,
},
reactStorybookAddon: {
docs: {
argTable: {
Expand Down
41 changes: 1 addition & 40 deletions apps/public-docsite-v9-headless/.storybook/theme.js
Original file line number Diff line number Diff line change
@@ -1,40 +1 @@
import { create } from 'storybook/theming';

/**
* Theming and branding the storybook to fluent. Taken from https://storybook.js.org/docs/react/configure/theming
*/
const theme = create({
base: 'light',

// Storybook-specific color palette
colorPrimary: 'rgba(255, 255, 255, .4)',
colorSecondary: '#0078d4',

// UI
appBg: '#ffffff',
appContentBg: '#ffffff',
appBorderColor: '#e0e0e0', // use msft gray
appBorderRadius: 4,

// Fonts
fontBase:
'"Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;',
fontCode: 'monospace',

// Text colors
textColor: '#11100f',
textInverseColor: '#0078d4', // use msft primary blue default

// Toolbar default and active colors
barSelectedColor: '#0078d4', // use msft primary blue default

// Form colors
inputBorderRadius: 4,

// Use the fluent branding for the upper left image
brandTitle: 'Fluent UI Headless Components',
brandUrl:
'https://github.com/microsoft/fluentui/tree/master/packages/react-components/react-headless-components-preview',
});

export default theme;
export { default } from '../../../packages/react-components/react-headless-components-preview/stories/.storybook/theme';
3 changes: 2 additions & 1 deletion apps/public-docsite-v9-headless/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"projects": ["react-storybook-addon", "react-storybook-addon-export-to-sandbox", "storybook-llms-extractor"],
"target": "build"
}
]
],
"inputs": ["default", "{workspaceRoot}/.storybook/**", "{projectRoot}/.storybook/**"]
}
}
}
Loading
Loading