Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/docsite-publish-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: 'Docsite publish to Github Pages'
on:
push:
branches:
- master
- chore/add-docsite-for-headless-components-app
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -49,11 +49,12 @@ jobs:
if: steps.affected_storybooks_count.outputs.value > 0
run: |
rm -rf _pages
mkdir -p _pages/react _pages/charts _pages/web-components
mkdir -p _pages/react _pages/charts _pages/web-components _pages/headless

cp -R apps/public-docsite-v9/dist/react/* _pages/react/
cp -R apps/chart-docsite/dist/storybook/* _pages/charts/
cp -R packages/web-components/dist/storybook/* _pages/web-components
cp -R apps/public-docsite-v9-headless/dist/storybook/* _pages/headless/

- name: Upload Pages Artifact
if: steps.affected_storybooks_count.outputs.value > 0
Expand Down
8 changes: 8 additions & 0 deletions apps/chart-docsite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"target": "build"
}
]
},
"build-storybook:docsite": {
"dependsOn": [
{
"projects": ["react-storybook-addon", "react-storybook-addon-export-to-sandbox", "storybook-llms-extractor"],
"target": "build"
}
]
}
}
}
2 changes: 1 addition & 1 deletion apps/pr-deploy-site/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const dependencies = [
'@fluentui/public-docsite-v9',
'@fluentui/perf-test-react-components',
'@fluentui/theme-designer',
'@fluentui/react-headless-components-preview-stories',
'@fluentui/public-docsite-v9-headless',
// web-components
'@fluentui/web-components',
// charting
Expand Down
6 changes: 3 additions & 3 deletions apps/pr-deploy-site/pr-deploy-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function main() {
title: 'Theme Designer v9',
},
{
package: '@fluentui/react-headless-components-preview-stories',
link: './react-headless-components-preview-stories/storybook/index.html',
package: '@fluentui/public-docsite-v9-headless',
link: './public-docsite-v9-headless/storybook/index.html',
icon: 'Code',
title: '@fluentui/react-headless-components-preview Storybook',
title: 'Headless Components',
},
{
package: '@fluentui/perf-test',
Expand Down
23 changes: 23 additions & 0 deletions apps/public-docsite-v9-headless/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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)',
],
staticDirs: ['../public'],
addons: [...rootMain.addons],
build: {
previewUrl: process.env.DEPLOY_PATH,
},
webpackFinal: (config, options) => {
const localConfig = /** @type config */ ({ ...rootMain.webpackFinal(config, options) });

return localConfig;
},
});
10 changes: 10 additions & 0 deletions apps/public-docsite-v9-headless/.storybook/manager.js
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,
});
6 changes: 6 additions & 0 deletions apps/public-docsite-v9-headless/.storybook/preview-head.html
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>
20 changes: 20 additions & 0 deletions apps/public-docsite-v9-headless/.storybook/preview.js
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'];
43 changes: 43 additions & 0 deletions apps/public-docsite-v9-headless/.storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { create } from 'storybook/theming';

import logo from '../public/fluentui-logo.svg';

/**
* 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',
brandImage: logo,
});

export default theme;
16 changes: 16 additions & 0 deletions apps/public-docsite-v9-headless/eslint.config.js
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: ['.', '../..'] }],
},
},
];
5 changes: 5 additions & 0 deletions apps/public-docsite-v9-headless/just.config.ts
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!();
26 changes: 26 additions & 0 deletions apps/public-docsite-v9-headless/package.json
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"
}
}
17 changes: 17 additions & 0 deletions apps/public-docsite-v9-headless/project.json
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": [],
"tags": ["platform:web", "vNext"],
"targets": {
"build-storybook": {
"dependsOn": [
{
"projects": ["react-storybook-addon", "react-storybook-addon-export-to-sandbox"],
"target": "build"
}
]
}
}
}
4 changes: 4 additions & 0 deletions apps/public-docsite-v9-headless/public/fluentui-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions apps/public-docsite-v9-headless/src/Introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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';
```

## Available Components

| Component | Status |
| --------- | ------- |
| Accordion | Preview |
| Button | Preview |
| Divider | Preview |

## Contributing

Refer to the main FluentUI [wiki](https://github.com/microsoft/fluentui/wiki) for detailed instructions on setup and contributing to the package.
14 changes: 14 additions & 0 deletions apps/public-docsite-v9-headless/tsconfig.app.json
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"]
}
19 changes: 19 additions & 0 deletions apps/public-docsite-v9-headless/tsconfig.json
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"
}
]
}
2 changes: 1 addition & 1 deletion apps/public-docsite-v9/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build-storybook",
"build-storybook:react",
{
"projects": ["chart-docsite", "web-components"],
"projects": ["chart-docsite", "web-components", "public-docsite-v9-headless"],
"target": "build-storybook:docsite"
}
]
Expand Down
Loading