Skip to content

Commit e367467

Browse files
authored
feat(public-docsite-v9-headless): boot and setup docsite for headless components (#35986)
1 parent 8ad0bbc commit e367467

16 files changed

Lines changed: 236 additions & 6 deletions

File tree

.github/workflows/docsite-publish-ghpages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ jobs:
4949
if: steps.affected_storybooks_count.outputs.value > 0
5050
run: |
5151
rm -rf _pages
52-
mkdir -p _pages/react _pages/charts _pages/web-components
52+
mkdir -p _pages/react _pages/charts _pages/web-components _pages/headless
5353
5454
cp -R apps/public-docsite-v9/dist/react/* _pages/react/
5555
cp -R apps/chart-docsite/dist/storybook/* _pages/charts/
5656
cp -R packages/web-components/dist/storybook/* _pages/web-components
57+
cp -R apps/public-docsite-v9-headless/dist/storybook/* _pages/headless/
5758
5859
- name: Upload Pages Artifact
5960
if: steps.affected_storybooks_count.outputs.value > 0

apps/pr-deploy-site/just.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const dependencies = [
3333
'@fluentui/public-docsite-v9',
3434
'@fluentui/perf-test-react-components',
3535
'@fluentui/theme-designer',
36-
'@fluentui/react-headless-components-preview-stories',
36+
'@fluentui/public-docsite-v9-headless',
3737
// web-components
3838
'@fluentui/web-components',
3939
// charting

apps/pr-deploy-site/pr-deploy-site.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ function main() {
8585
title: 'Theme Designer v9',
8686
},
8787
{
88-
package: '@fluentui/react-headless-components-preview-stories',
89-
link: './react-headless-components-preview-stories/storybook/index.html',
88+
package: '@fluentui/public-docsite-v9-headless',
89+
link: './public-docsite-v9-headless/storybook/index.html',
9090
icon: 'Code',
91-
title: '@fluentui/react-headless-components-preview Storybook',
91+
title: 'Headless Components',
9292
},
9393
{
9494
package: '@fluentui/perf-test',
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const rootMain = require('../../../.storybook/main');
2+
3+
module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript'|'babel'>} */ ({
4+
...rootMain,
5+
stories: [
6+
...rootMain.stories,
7+
// docsite stories
8+
'../src/**/*.mdx',
9+
'../src/**/index.stories.@(ts|tsx)',
10+
// headless package stories
11+
'../../../packages/react-components/react-headless-components-preview/stories/src/**/index.stories.@(ts|tsx)',
12+
],
13+
addons: [...rootMain.addons],
14+
build: {
15+
previewUrl: process.env.DEPLOY_PATH,
16+
},
17+
webpackFinal: (config, options) => {
18+
const localConfig = /** @type config */ ({ ...rootMain.webpackFinal(config, options) });
19+
20+
return localConfig;
21+
},
22+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { addons } from 'storybook/manager-api';
2+
3+
import fluentStorybookTheme from './theme';
4+
5+
addons.setConfig({
6+
enableShortcuts: false,
7+
theme: fluentStorybookTheme,
8+
showPanel: false,
9+
showToolbar: false,
10+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
2+
<style type="text/tailwindcss">
3+
:root {
4+
interpolate-size: allow-keywords;
5+
}
6+
</style>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as rootPreview from '../../../.storybook/preview';
2+
3+
/** @type {typeof rootPreview.decorators} */
4+
export const decorators = [...rootPreview.decorators];
5+
6+
/** @type {typeof rootPreview.parameters} */
7+
export const parameters = {
8+
...rootPreview.parameters,
9+
docs: {
10+
...rootPreview.parameters.docs,
11+
},
12+
options: {
13+
storySort: {
14+
method: 'alphabetical',
15+
order: ['Introduction', 'Headless Components'],
16+
},
17+
},
18+
};
19+
20+
export const tags = ['autodocs'];
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { create } from 'storybook/theming';
2+
3+
/**
4+
* Theming and branding the storybook to fluent. Taken from https://storybook.js.org/docs/react/configure/theming
5+
*/
6+
const theme = create({
7+
base: 'light',
8+
9+
// Storybook-specific color palette
10+
colorPrimary: 'rgba(255, 255, 255, .4)',
11+
colorSecondary: '#0078d4',
12+
13+
// UI
14+
appBg: '#ffffff',
15+
appContentBg: '#ffffff',
16+
appBorderColor: '#e0e0e0', // use msft gray
17+
appBorderRadius: 4,
18+
19+
// Fonts
20+
fontBase:
21+
'"Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;',
22+
fontCode: 'monospace',
23+
24+
// Text colors
25+
textColor: '#11100f',
26+
textInverseColor: '#0078d4', // use msft primary blue default
27+
28+
// Toolbar default and active colors
29+
barSelectedColor: '#0078d4', // use msft primary blue default
30+
31+
// Form colors
32+
inputBorderRadius: 4,
33+
34+
// Use the fluent branding for the upper left image
35+
brandTitle: 'Fluent UI Headless Components',
36+
brandUrl:
37+
'https://github.com/microsoft/fluentui/tree/master/packages/react-components/react-headless-components-preview',
38+
});
39+
40+
export default theme;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// @ts-check
2+
const fluentPlugin = require('@fluentui/eslint-plugin');
3+
4+
/** @type {import("eslint").Linter.Config[]} */
5+
module.exports = [
6+
...fluentPlugin.configs['flat/react'],
7+
{
8+
rules: {
9+
'@typescript-eslint/no-explicit-any': 'off',
10+
'@typescript-eslint/jsx-no-bind': 'off',
11+
'@typescript-eslint/no-deprecated': 'off',
12+
'@typescript-eslint/explicit-module-boundary-types': 'off',
13+
'import/no-extraneous-dependencies': ['error', { packageDir: ['.', '../..'] }],
14+
},
15+
},
16+
];
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { preset, task } from '@fluentui/scripts-tasks';
2+
3+
preset();
4+
5+
task('build', 'build:node-lib').cached!();

0 commit comments

Comments
 (0)