-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(public-docsite-v9-headless): boot and setup docsite for headless components #35986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mainframev
merged 4 commits into
microsoft:master
from
mainframev:chore/add-docsite-for-headless-components-core
Apr 15, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| const rootMain = require('../../../.storybook/main'); | ||
|
|
||
| module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript'|'babel'>} */ ({ | ||
| ...rootMain, | ||
| stories: [ | ||
| ...rootMain.stories, | ||
| // docsite stories | ||
| '../src/**/*.mdx', | ||
| '../src/**/index.stories.@(ts|tsx)', | ||
| // headless package stories | ||
| '../../../packages/react-components/react-headless-components-preview/stories/src/**/index.stories.@(ts|tsx)', | ||
| ], | ||
| addons: [...rootMain.addons], | ||
| build: { | ||
| previewUrl: process.env.DEPLOY_PATH, | ||
| }, | ||
| webpackFinal: (config, options) => { | ||
| const localConfig = /** @type config */ ({ ...rootMain.webpackFinal(config, options) }); | ||
|
|
||
| return localConfig; | ||
| }, | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { addons } from 'storybook/manager-api'; | ||
|
|
||
| import fluentStorybookTheme from './theme'; | ||
|
|
||
| addons.setConfig({ | ||
| enableShortcuts: false, | ||
| theme: fluentStorybookTheme, | ||
| showPanel: false, | ||
| showToolbar: false, | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> | ||
| <style type="text/tailwindcss"> | ||
| :root { | ||
| interpolate-size: allow-keywords; | ||
| } | ||
| </style> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import * as rootPreview from '../../../.storybook/preview'; | ||
|
|
||
| /** @type {typeof rootPreview.decorators} */ | ||
| export const decorators = [...rootPreview.decorators]; | ||
|
|
||
| /** @type {typeof rootPreview.parameters} */ | ||
| export const parameters = { | ||
| ...rootPreview.parameters, | ||
| docs: { | ||
| ...rootPreview.parameters.docs, | ||
| }, | ||
| options: { | ||
| storySort: { | ||
| method: 'alphabetical', | ||
| order: ['Introduction', 'Headless Components'], | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export const tags = ['autodocs']; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| 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; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // @ts-check | ||
| const fluentPlugin = require('@fluentui/eslint-plugin'); | ||
|
|
||
| /** @type {import("eslint").Linter.Config[]} */ | ||
| module.exports = [ | ||
| ...fluentPlugin.configs['flat/react'], | ||
| { | ||
| rules: { | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/jsx-no-bind': 'off', | ||
| '@typescript-eslint/no-deprecated': 'off', | ||
| '@typescript-eslint/explicit-module-boundary-types': 'off', | ||
| 'import/no-extraneous-dependencies': ['error', { packageDir: ['.', '../..'] }], | ||
| }, | ||
| }, | ||
| ]; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { preset, task } from '@fluentui/scripts-tasks'; | ||
|
|
||
| preset(); | ||
|
|
||
| task('build', 'build:node-lib').cached!(); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "name": "@fluentui/public-docsite-v9-headless", | ||
| "version": "1.0.0", | ||
| "private": true, | ||
| "description": "Fluent UI React Headless Components Preview documentation", | ||
| "scripts": { | ||
| "build-storybook": "storybook build -o ./dist/storybook --docs", | ||
| "build-storybook:docsite": "cross-env DEPLOY_PATH=/headless/ storybook build -o ./dist/storybook --docs", | ||
| "clean": "just-scripts clean", | ||
| "code-style": "just-scripts code-style", | ||
| "just": "just-scripts", | ||
| "type-check": "just-scripts type-check", | ||
| "start": "yarn storybook:docs", | ||
| "storybook": "storybook dev --port 3000", | ||
| "storybook:docs": "yarn storybook --docs", | ||
| "test": "jest --passWithNoTests" | ||
| }, | ||
| "dependencies": { | ||
| "@fluentui/react-headless-components-preview": "*", | ||
| "@fluentui/react-storybook-addon": "*", | ||
| "@fluentui/react-storybook-addon-export-to-sandbox": "*", | ||
| "react": "19.2.0", | ||
| "react-dom": "19.2.0", | ||
| "tslib": "^2.1.0" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "name": "public-docsite-v9-headless", | ||
| "$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
| "projectType": "application", | ||
| "implicitDependencies": ["react-headless-components-preview-stories"], | ||
| "tags": ["platform:web", "vNext"], | ||
| "targets": { | ||
| "build-storybook": { | ||
| "dependsOn": [ | ||
| { | ||
| "projects": ["react-storybook-addon", "react-storybook-addon-export-to-sandbox"], | ||
| "target": "build" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { Meta } from '@storybook/addon-docs/blocks'; | ||
|
|
||
| <Meta title="Introduction" /> | ||
|
|
||
| ## Overview | ||
|
|
||
| Fluent UI React Headless Components is a set of unstyled, accessible, and composable React components that implement the Fluent UI design patterns without prescribing any specific styling solution. | ||
|
|
||
| These components provide the behavior, accessibility, and state management while giving you full control over the visual presentation using your preferred styling approach (e.g., Tailwind CSS, CSS Modules, or any other solution). | ||
|
|
||
| ## Getting Started | ||
|
|
||
| To get started with the headless components package in your project: | ||
|
|
||
| 1. Install the package using `npm` or `yarn`: | ||
|
|
||
| ``` | ||
| npm install @fluentui/react-headless-components-preview | ||
| ``` | ||
|
|
||
| 2. Import and use the components: | ||
|
|
||
| ```tsx | ||
| import { | ||
| Accordion, | ||
| AccordionItem, | ||
| AccordionHeader, | ||
| AccordionPanel, | ||
| } from '@fluentui/react-headless-components-preview'; | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| Refer to the main FluentUI [wiki](https://github.com/microsoft/fluentui/wiki) for detailed instructions on setup and contributing to the package. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "module": "ESNext", | ||
| "target": "ES2019", | ||
| "noEmit": false, | ||
| "outDir": "lib", | ||
| "jsx": "react", | ||
| "sourceMap": true, | ||
| "types": ["static-assets", "webpack-env"] | ||
| }, | ||
| "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], | ||
| "include": ["src"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "extends": "../../tsconfig.base.all.json", | ||
| "compilerOptions": { | ||
| "module": "ESNext", | ||
| "target": "ES2019", | ||
| "noEmit": true, | ||
| "experimentalDecorators": true, | ||
| "noUnusedLocals": true, | ||
| "strictNullChecks": true, | ||
| "noImplicitAny": true | ||
| }, | ||
| "include": [], | ||
| "files": [], | ||
| "references": [ | ||
| { | ||
| "path": "./tsconfig.app.json" | ||
| } | ||
| ] | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.