@fluentui/react-storybook-addon 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/dist/index.d.ts +100 -0
- package/lib/components/DirectionSwitch.js +26 -0
- package/lib/components/DirectionSwitch.js.map +1 -0
- package/lib/components/ReactStrictMode.js +22 -0
- package/lib/components/ReactStrictMode.js.map +1 -0
- package/lib/components/ThemePicker.js +60 -0
- package/lib/components/ThemePicker.js.map +1 -0
- package/lib/constants.js +4 -0
- package/lib/constants.js.map +1 -0
- package/lib/decorators/withAriaLive.js +18 -0
- package/lib/decorators/withAriaLive.js.map +1 -0
- package/lib/decorators/withFluentProvider.js +48 -0
- package/lib/decorators/withFluentProvider.js.map +1 -0
- package/lib/decorators/withReactStrictMode.js +16 -0
- package/lib/decorators/withReactStrictMode.js.map +1 -0
- package/lib/docs/CopyAsMarkdownButton.js +177 -0
- package/lib/docs/CopyAsMarkdownButton.js.map +1 -0
- package/lib/docs/DirSwitch.js +51 -0
- package/lib/docs/DirSwitch.js.map +1 -0
- package/lib/docs/FluentCanvas.js +21 -0
- package/lib/docs/FluentCanvas.js.map +1 -0
- package/lib/docs/FluentDocsContainer.js +24 -0
- package/lib/docs/FluentDocsContainer.js.map +1 -0
- package/lib/docs/FluentDocsPage.js +308 -0
- package/lib/docs/FluentDocsPage.js.map +1 -0
- package/lib/docs/FluentStory.js +18 -0
- package/lib/docs/FluentStory.js.map +1 -0
- package/lib/docs/ThemePicker.js +61 -0
- package/lib/docs/ThemePicker.js.map +1 -0
- package/lib/docs/Toc.js +130 -0
- package/lib/docs/Toc.js.map +1 -0
- package/lib/docs/index.js +4 -0
- package/lib/docs/index.js.map +1 -0
- package/lib/docs/utils.js +74 -0
- package/lib/docs/utils.js.map +1 -0
- package/lib/hooks.js +16 -0
- package/lib/hooks.js.map +1 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/preset/manager.js +25 -0
- package/lib/preset/manager.js.map +1 -0
- package/lib/preset/preview.js +26 -0
- package/lib/preset/preview.js.map +1 -0
- package/lib/theme.js +31 -0
- package/lib/theme.js.map +1 -0
- package/lib/utils/isDecoratorDisabled.js +6 -0
- package/lib/utils/isDecoratorDisabled.js.map +1 -0
- package/lib-commonjs/components/DirectionSwitch.js +37 -0
- package/lib-commonjs/components/DirectionSwitch.js.map +1 -0
- package/lib-commonjs/components/ReactStrictMode.js +33 -0
- package/lib-commonjs/components/ReactStrictMode.js.map +1 -0
- package/lib-commonjs/components/ThemePicker.js +71 -0
- package/lib-commonjs/components/ThemePicker.js.map +1 -0
- package/lib-commonjs/constants.js +28 -0
- package/lib-commonjs/constants.js.map +1 -0
- package/lib-commonjs/decorators/withAriaLive.js +29 -0
- package/lib-commonjs/decorators/withAriaLive.js.map +1 -0
- package/lib-commonjs/decorators/withFluentProvider.js +59 -0
- package/lib-commonjs/decorators/withFluentProvider.js.map +1 -0
- package/lib-commonjs/decorators/withReactStrictMode.js +27 -0
- package/lib-commonjs/decorators/withReactStrictMode.js.map +1 -0
- package/lib-commonjs/docs/CopyAsMarkdownButton.js +185 -0
- package/lib-commonjs/docs/CopyAsMarkdownButton.js.map +1 -0
- package/lib-commonjs/docs/DirSwitch.js +60 -0
- package/lib-commonjs/docs/DirSwitch.js.map +1 -0
- package/lib-commonjs/docs/FluentCanvas.js +29 -0
- package/lib-commonjs/docs/FluentCanvas.js.map +1 -0
- package/lib-commonjs/docs/FluentDocsContainer.js +33 -0
- package/lib-commonjs/docs/FluentDocsContainer.js.map +1 -0
- package/lib-commonjs/docs/FluentDocsPage.js +319 -0
- package/lib-commonjs/docs/FluentDocsPage.js.map +1 -0
- package/lib-commonjs/docs/FluentStory.js +26 -0
- package/lib-commonjs/docs/FluentStory.js.map +1 -0
- package/lib-commonjs/docs/ThemePicker.js +70 -0
- package/lib-commonjs/docs/ThemePicker.js.map +1 -0
- package/lib-commonjs/docs/Toc.js +149 -0
- package/lib-commonjs/docs/Toc.js.map +1 -0
- package/lib-commonjs/docs/index.js +28 -0
- package/lib-commonjs/docs/index.js.map +1 -0
- package/lib-commonjs/docs/utils.js +88 -0
- package/lib-commonjs/docs/utils.js.map +1 -0
- package/lib-commonjs/hooks.js +37 -0
- package/lib-commonjs/hooks.js.map +1 -0
- package/lib-commonjs/index.js +34 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/preset/manager.js +29 -0
- package/lib-commonjs/preset/manager.js.map +1 -0
- package/lib-commonjs/preset/preview.js +47 -0
- package/lib-commonjs/preset/preview.js.map +1 -0
- package/lib-commonjs/theme.js +49 -0
- package/lib-commonjs/theme.js.map +1 -0
- package/lib-commonjs/utils/isDecoratorDisabled.js +16 -0
- package/lib-commonjs/utils/isDecoratorDisabled.js.map +1 -0
- package/package.json +20 -27
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs/Toc.tsx"],"sourcesContent":["import * as React from 'react';\nimport { addons } from 'storybook/manager-api';\nimport { NAVIGATE_URL } from 'storybook/internal/core-events';\n\nimport { makeStyles } from '@griffel/react';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nconst useTocStyles = makeStyles({\n root: {\n top: '64px',\n position: 'sticky',\n marginLeft: '40px',\n },\n heading: {\n fontSize: '11px',\n fontWeight: 'bold',\n textTransform: 'uppercase',\n marginBottom: '20px',\n },\n ol: {\n position: 'relative',\n listStyleType: 'none',\n marginLeft: 0,\n marginTop: 0,\n paddingInlineStart: '20px',\n '& li': {\n marginBottom: '15px',\n lineHeight: '16px',\n },\n '& a': {\n textDecorationLine: 'none',\n color: '#201F1E',\n fontSize: '14px',\n ':hover': {\n color: '#201F1E',\n },\n },\n '&:before': {\n content: '\"\"',\n position: 'absolute',\n left: 0,\n height: '100%',\n width: '3px',\n backgroundColor: '#EDEBE9',\n borderRadius: '4px',\n },\n },\n selected: {\n position: 'relative',\n '&:after': {\n content: '\"\"',\n position: 'absolute',\n left: '-20px',\n top: 0,\n bottom: 0,\n width: '3px',\n backgroundColor: '#436DCD',\n borderRadius: '4px',\n },\n },\n});\n\ntype TocItem = { name: string; id: string; selected?: boolean };\n\n// // Alternative approach to navigate - rerenders the iframe\n// // Usage: selectStory({ story: s.name, kind: s.kind });\n// const selectStory = (story: { kind: string; story: string }) => {\n// console.log('Select Story', story);\n// addons.getChannel().emit(SELECT_STORY, story);\n// };\n\nconst navigate = (url: string) => {\n addons.getChannel().emit(NAVIGATE_URL, url);\n};\n\nexport const nameToHash = (id: string): string => id.toLowerCase().replace(/[^a-z0-9]/gi, '-');\n\nexport const Toc = ({ stories }: { stories: TocItem[] }): JSXElement => {\n const [selected, setSelected] = React.useState('');\n const isNavigating = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n const observer = new IntersectionObserver(\n (entries: IntersectionObserverEntry[]) => {\n if (isNavigating.current) {\n isNavigating.current = false;\n return;\n }\n for (const entry of entries) {\n const { intersectionRatio, target } = entry;\n if (intersectionRatio > 0.5) {\n setSelected(target.id);\n return;\n }\n }\n },\n {\n threshold: [0.5],\n },\n );\n\n stories.forEach(link => {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n const element = document.getElementById(nameToHash(link.name));\n if (element) {\n observer.observe(element);\n }\n });\n\n return () => observer.disconnect();\n }, [stories]);\n\n const tocItems = stories.map(item => {\n return { ...item, selected: nameToHash(item.name) === selected };\n });\n const tocClasses = useTocStyles();\n return (\n <nav className={tocClasses.root}>\n <h3 className={tocClasses.heading}>On this page</h3>\n <ol className={tocClasses.ol}>\n {tocItems.map(s => {\n const name = nameToHash(s.name);\n return (\n <li className={s.selected ? tocClasses.selected : ''} key={s.id}>\n <a\n href={`#${name}`}\n target=\"_self\"\n onClick={e => {\n isNavigating.current = true;\n navigate(`#${name}`);\n setSelected(name);\n }}\n >\n {s.name}\n </a>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"names":["Toc","nameToHash","useTocStyles","makeStyles","root","top","position","marginLeft","heading","fontSize","fontWeight","textTransform","marginBottom","ol","listStyleType","marginTop","paddingInlineStart","lineHeight","textDecorationLine","color","content","left","height","width","backgroundColor","borderRadius","selected","bottom","navigate","url","addons","getChannel","emit","NAVIGATE_URL","id","toLowerCase","replace","stories","setSelected","React","useState","isNavigating","useRef","useEffect","observer","IntersectionObserver","entries","current","entry","intersectionRatio","target","threshold","forEach","link","element","document","getElementById","name","observe","disconnect","tocItems","map","item","tocClasses","nav","className","h3","s","li","key","a","href","onClick","e"],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
FluentCanvas: function() {
|
|
13
|
+
return _FluentCanvas.FluentCanvas;
|
|
14
|
+
},
|
|
15
|
+
FluentDocsContainer: function() {
|
|
16
|
+
return _FluentDocsContainer.FluentDocsContainer;
|
|
17
|
+
},
|
|
18
|
+
FluentDocsPage: function() {
|
|
19
|
+
return _FluentDocsPage.FluentDocsPage;
|
|
20
|
+
},
|
|
21
|
+
FluentStory: function() {
|
|
22
|
+
return _FluentStory.FluentStory;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _FluentCanvas = require("./FluentCanvas");
|
|
26
|
+
const _FluentDocsContainer = require("./FluentDocsContainer");
|
|
27
|
+
const _FluentDocsPage = require("./FluentDocsPage");
|
|
28
|
+
const _FluentStory = require("./FluentStory");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs/index.ts"],"sourcesContent":["export { FluentCanvas } from './FluentCanvas';\nexport { FluentDocsContainer } from './FluentDocsContainer';\nexport { FluentDocsPage } from './FluentDocsPage';\nexport { FluentStory } from './FluentStory';\n"],"names":["FluentCanvas","FluentDocsContainer","FluentDocsPage","FluentStory"],"mappings":";;;;;;;;;;;IAASA,YAAY;eAAZA,0BAAY;;IACZC,mBAAmB;eAAnBA,wCAAmB;;IACnBC,cAAc;eAAdA,8BAAc;;IACdC,WAAW;eAAXA,wBAAW;;;8BAHS;qCACO;gCACL;6BACH"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
getDocsPageConfig: function() {
|
|
13
|
+
return getDocsPageConfig;
|
|
14
|
+
},
|
|
15
|
+
isDocsEnabled: function() {
|
|
16
|
+
return isDocsEnabled;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const docsDefaults = {
|
|
20
|
+
copyAsMarkdown: true,
|
|
21
|
+
tableOfContents: true,
|
|
22
|
+
dirSwitcher: true,
|
|
23
|
+
themePicker: true,
|
|
24
|
+
argTable: {
|
|
25
|
+
slotsApi: true,
|
|
26
|
+
nativePropsApi: true
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function getDocsParametersConfig(context) {
|
|
30
|
+
var _context_projectAnnotations_parameters_reactStorybookAddon, _context_projectAnnotations_parameters, _context_projectAnnotations;
|
|
31
|
+
return context === null || context === void 0 ? void 0 : (_context_projectAnnotations = context.projectAnnotations) === null || _context_projectAnnotations === void 0 ? void 0 : (_context_projectAnnotations_parameters = _context_projectAnnotations.parameters) === null || _context_projectAnnotations_parameters === void 0 ? void 0 : (_context_projectAnnotations_parameters_reactStorybookAddon = _context_projectAnnotations_parameters.reactStorybookAddon) === null || _context_projectAnnotations_parameters_reactStorybookAddon === void 0 ? void 0 : _context_projectAnnotations_parameters_reactStorybookAddon.docs;
|
|
32
|
+
}
|
|
33
|
+
function isDocsEnabled(context) {
|
|
34
|
+
const docsConfig = getDocsParametersConfig(context);
|
|
35
|
+
// If docs is true, enable page
|
|
36
|
+
if (docsConfig === true) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
// If docs is an object, page is enabled
|
|
40
|
+
if (typeof docsConfig === 'object' && docsConfig !== null) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
// Default: disabled
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
function getDocsPageConfig(context) {
|
|
47
|
+
const docsConfig = getDocsParametersConfig(context);
|
|
48
|
+
// If docs is true, return default config (all enabled)
|
|
49
|
+
if (docsConfig === true) {
|
|
50
|
+
return docsDefaults;
|
|
51
|
+
}
|
|
52
|
+
// If docs is an object, extract the configuration directly
|
|
53
|
+
if (typeof docsConfig === 'object' && docsConfig !== null) {
|
|
54
|
+
return {
|
|
55
|
+
copyAsMarkdown: docsConfig.copyAsMarkdown !== false,
|
|
56
|
+
tableOfContents: docsConfig.tableOfContents !== false,
|
|
57
|
+
dirSwitcher: docsConfig.dirSwitcher !== false,
|
|
58
|
+
themePicker: docsConfig.themePicker !== false,
|
|
59
|
+
argTable: getArgTableConfig(docsConfig.argTable)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Fallback
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the argTable configuration with early exit pattern
|
|
67
|
+
*/ function getArgTableConfig(argTableConfig) {
|
|
68
|
+
if (argTableConfig === false) {
|
|
69
|
+
return {
|
|
70
|
+
slotsApi: false,
|
|
71
|
+
nativePropsApi: false
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (argTableConfig === true || argTableConfig === undefined) {
|
|
75
|
+
return {
|
|
76
|
+
slotsApi: true,
|
|
77
|
+
nativePropsApi: true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (typeof argTableConfig === 'object' && argTableConfig !== null) {
|
|
81
|
+
return {
|
|
82
|
+
slotsApi: argTableConfig.slotsApi !== false,
|
|
83
|
+
nativePropsApi: argTableConfig.nativePropsApi !== false
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// Fallback to default
|
|
87
|
+
return docsDefaults.argTable;
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs/utils.ts"],"sourcesContent":["import { type DocsContextProps } from '@storybook/addon-docs/blocks';\n\nimport { type FluentParameters } from '../hooks';\n\nconst docsDefaults = {\n copyAsMarkdown: true,\n tableOfContents: true,\n dirSwitcher: true,\n themePicker: true,\n argTable: {\n slotsApi: true,\n nativePropsApi: true,\n },\n};\n\nfunction getDocsParametersConfig(\n context: DocsContextProps,\n): NonNullable<FluentParameters['reactStorybookAddon']>['docs'] {\n return context?.projectAnnotations?.parameters?.reactStorybookAddon?.docs;\n}\n\n/**\n * Checks if the docs page is enabled\n */\nexport function isDocsEnabled(context: DocsContextProps): boolean {\n const docsConfig = getDocsParametersConfig(context);\n\n // If docs is true, enable page\n if (docsConfig === true) {\n return true;\n }\n\n // If docs is an object, page is enabled\n if (typeof docsConfig === 'object' && docsConfig !== null) {\n return true;\n }\n\n // Default: disabled\n return false;\n}\n\n/**\n * Gets the docs page configuration from context\n */\nexport function getDocsPageConfig(context: DocsContextProps): {\n tableOfContents: boolean;\n dirSwitcher: boolean;\n themePicker: boolean;\n copyAsMarkdown: boolean;\n argTable: {\n slotsApi: boolean;\n nativePropsApi: boolean;\n };\n} | null {\n const docsConfig = getDocsParametersConfig(context);\n\n // If docs is true, return default config (all enabled)\n if (docsConfig === true) {\n return docsDefaults;\n }\n\n // If docs is an object, extract the configuration directly\n if (typeof docsConfig === 'object' && docsConfig !== null) {\n return {\n copyAsMarkdown: docsConfig.copyAsMarkdown !== false,\n tableOfContents: docsConfig.tableOfContents !== false,\n dirSwitcher: docsConfig.dirSwitcher !== false,\n themePicker: docsConfig.themePicker !== false,\n argTable: getArgTableConfig(docsConfig.argTable),\n };\n }\n\n // Fallback\n return null;\n}\n\n/**\n * Gets the argTable configuration with early exit pattern\n */\nfunction getArgTableConfig(argTableConfig: boolean | { slotsApi?: boolean; nativePropsApi?: boolean } | undefined) {\n if (argTableConfig === false) {\n return {\n slotsApi: false,\n nativePropsApi: false,\n };\n }\n\n if (argTableConfig === true || argTableConfig === undefined) {\n return {\n slotsApi: true,\n nativePropsApi: true,\n };\n }\n\n if (typeof argTableConfig === 'object' && argTableConfig !== null) {\n return {\n slotsApi: argTableConfig.slotsApi !== false,\n nativePropsApi: argTableConfig.nativePropsApi !== false,\n };\n }\n\n // Fallback to default\n return docsDefaults.argTable;\n}\n"],"names":["getDocsPageConfig","isDocsEnabled","docsDefaults","copyAsMarkdown","tableOfContents","dirSwitcher","themePicker","argTable","slotsApi","nativePropsApi","getDocsParametersConfig","context","projectAnnotations","parameters","reactStorybookAddon","docs","docsConfig","getArgTableConfig","argTableConfig","undefined"],"mappings":";;;;;;;;;;;IA4CgBA,iBAAiB;eAAjBA;;IApBAC,aAAa;eAAbA;;;AApBhB,MAAMC,eAAe;IACnBC,gBAAgB;IAChBC,iBAAiB;IACjBC,aAAa;IACbC,aAAa;IACbC,UAAU;QACRC,UAAU;QACVC,gBAAgB;IAClB;AACF;AAEA,SAASC,wBACPC,OAAyB;QAElBA,4DAAAA,wCAAAA;IAAP,OAAOA,oBAAAA,+BAAAA,8BAAAA,QAASC,kBAAkB,cAA3BD,mDAAAA,yCAAAA,4BAA6BE,UAAU,cAAvCF,8DAAAA,6DAAAA,uCAAyCG,mBAAmB,cAA5DH,iFAAAA,2DAA8DI,IAAI;AAC3E;AAKO,SAASd,cAAcU,OAAyB;IACrD,MAAMK,aAAaN,wBAAwBC;IAE3C,+BAA+B;IAC/B,IAAIK,eAAe,MAAM;QACvB,OAAO;IACT;IAEA,wCAAwC;IACxC,IAAI,OAAOA,eAAe,YAAYA,eAAe,MAAM;QACzD,OAAO;IACT;IAEA,oBAAoB;IACpB,OAAO;AACT;AAKO,SAAShB,kBAAkBW,OAAyB;IAUzD,MAAMK,aAAaN,wBAAwBC;IAE3C,uDAAuD;IACvD,IAAIK,eAAe,MAAM;QACvB,OAAOd;IACT;IAEA,2DAA2D;IAC3D,IAAI,OAAOc,eAAe,YAAYA,eAAe,MAAM;QACzD,OAAO;YACLb,gBAAgBa,WAAWb,cAAc,KAAK;YAC9CC,iBAAiBY,WAAWZ,eAAe,KAAK;YAChDC,aAAaW,WAAWX,WAAW,KAAK;YACxCC,aAAaU,WAAWV,WAAW,KAAK;YACxCC,UAAUU,kBAAkBD,WAAWT,QAAQ;QACjD;IACF;IAEA,WAAW;IACX,OAAO;AACT;AAEA;;CAEC,GACD,SAASU,kBAAkBC,cAAsF;IAC/G,IAAIA,mBAAmB,OAAO;QAC5B,OAAO;YACLV,UAAU;YACVC,gBAAgB;QAClB;IACF;IAEA,IAAIS,mBAAmB,QAAQA,mBAAmBC,WAAW;QAC3D,OAAO;YACLX,UAAU;YACVC,gBAAgB;QAClB;IACF;IAEA,IAAI,OAAOS,mBAAmB,YAAYA,mBAAmB,MAAM;QACjE,OAAO;YACLV,UAAUU,eAAeV,QAAQ,KAAK;YACtCC,gBAAgBS,eAAeT,cAAc,KAAK;QACpD;IACF;IAEA,sBAAsB;IACtB,OAAOP,aAAaK,QAAQ;AAC9B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
getParametersConfig: function() {
|
|
13
|
+
return getParametersConfig;
|
|
14
|
+
},
|
|
15
|
+
parameters: function() {
|
|
16
|
+
return parameters;
|
|
17
|
+
},
|
|
18
|
+
useGlobals: function() {
|
|
19
|
+
return useGlobals;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _managerapi = require("storybook/manager-api");
|
|
23
|
+
function useGlobals() {
|
|
24
|
+
return (0, _managerapi.useGlobals)();
|
|
25
|
+
}
|
|
26
|
+
function parameters(options) {
|
|
27
|
+
return {
|
|
28
|
+
dir: 'ltr',
|
|
29
|
+
fluentTheme: 'web-light',
|
|
30
|
+
mode: 'default',
|
|
31
|
+
...options
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function getParametersConfig(context) {
|
|
35
|
+
var _context_parameters;
|
|
36
|
+
return context === null || context === void 0 ? void 0 : (_context_parameters = context.parameters) === null || _context_parameters === void 0 ? void 0 : _context_parameters.reactStorybookAddon;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks.ts"],"sourcesContent":["import { useGlobals as useStorybookGlobals } from 'storybook/manager-api';\nimport { Args as StorybookArgs, StoryContext as StorybookContext, Parameters } from '@storybook/react-webpack5';\n\nimport { DIR_ID, STRICT_MODE_ID, THEME_ID } from './constants';\nimport type { ThemeIds } from './theme';\n\nexport interface FluentStoryContext extends StorybookContext {\n globals: FluentGlobals;\n parameters: FluentParameters;\n}\n\n/**\n * Extends the storybook globals object to include fluent specific properties\n */\nexport interface FluentGlobals extends StorybookArgs {\n [DIR_ID]?: 'ltr' | 'rtl';\n [THEME_ID]?: ThemeIds;\n [STRICT_MODE_ID]?: boolean;\n}\n\n/**\n * Extends the storybook parameters object to include fluent specific properties\n */\nexport interface FluentParameters extends Parameters {\n dir?: 'ltr' | 'rtl';\n fluentTheme?: ThemeIds;\n mode?: 'default' | 'vr-test';\n reactStorybookAddon?: {\n disabledDecorators?: ['AriaLive' | 'FluentProvider' | 'ReactStrictMode'];\n docs?: FluentDocsConfig;\n };\n}\n\n/**\n * Configuration for docs components\n */\ntype FluentDocsConfig =\n | boolean\n | {\n tableOfContents?: boolean;\n dirSwitcher?: boolean;\n themePicker?: boolean;\n copyAsMarkdown?: boolean;\n argTable?:\n | boolean\n | {\n slotsApi?: boolean;\n nativePropsApi?: boolean;\n };\n };\n\nexport function useGlobals(): [FluentGlobals, (newGlobals: FluentGlobals) => void, FluentGlobals, FluentGlobals] {\n return useStorybookGlobals();\n}\n\nexport function parameters(options?: FluentParameters): FluentParameters {\n return { dir: 'ltr', fluentTheme: 'web-light', mode: 'default', ...options };\n}\nexport function getParametersConfig(context: FluentStoryContext): FluentParameters['reactStorybookAddon'] {\n return context?.parameters?.reactStorybookAddon;\n}\n"],"names":["getParametersConfig","parameters","useGlobals","useStorybookGlobals","options","dir","fluentTheme","mode","context","reactStorybookAddon"],"mappings":";;;;;;;;;;;IA0DgBA,mBAAmB;eAAnBA;;IAHAC,UAAU;eAAVA;;IAJAC,UAAU;eAAVA;;;4BAnDkC;AAmD3C,SAASA;IACd,OAAOC,IAAAA,sBAAmB;AAC5B;AAEO,SAASF,WAAWG,OAA0B;IACnD,OAAO;QAAEC,KAAK;QAAOC,aAAa;QAAaC,MAAM;QAAW,GAAGH,OAAO;IAAC;AAC7E;AACO,SAASJ,oBAAoBQ,OAA2B;QACtDA;IAAP,OAAOA,oBAAAA,+BAAAA,sBAAAA,QAASP,UAAU,cAAnBO,0CAAAA,oBAAqBC,mBAAmB;AACjD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
DIR_ID: function() {
|
|
13
|
+
return _constants.DIR_ID;
|
|
14
|
+
},
|
|
15
|
+
FluentCanvas: function() {
|
|
16
|
+
return _docs.FluentCanvas;
|
|
17
|
+
},
|
|
18
|
+
FluentStory: function() {
|
|
19
|
+
return _docs.FluentStory;
|
|
20
|
+
},
|
|
21
|
+
THEME_ID: function() {
|
|
22
|
+
return _constants.THEME_ID;
|
|
23
|
+
},
|
|
24
|
+
parameters: function() {
|
|
25
|
+
return _hooks.parameters;
|
|
26
|
+
},
|
|
27
|
+
themes: function() {
|
|
28
|
+
return _theme.themes;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _theme = require("./theme");
|
|
32
|
+
const _constants = require("./constants");
|
|
33
|
+
const _hooks = require("./hooks");
|
|
34
|
+
const _docs = require("./docs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type { FluentGlobals, FluentParameters, FluentStoryContext } from './hooks';\nexport type { ThemeIds } from './theme';\nexport { themes } from './theme';\nexport { DIR_ID, THEME_ID } from './constants';\nexport { parameters } from './hooks';\nexport { FluentCanvas, FluentStory } from './docs';\n"],"names":["DIR_ID","FluentCanvas","FluentStory","THEME_ID","parameters","themes"],"mappings":";;;;;;;;;;;IAGSA,MAAM;eAANA,iBAAM;;IAENC,YAAY;eAAZA,kBAAY;;IAAEC,WAAW;eAAXA,iBAAW;;IAFjBC,QAAQ;eAARA,mBAAQ;;IAChBC,UAAU;eAAVA,iBAAU;;IAFVC,MAAM;eAANA,aAAM;;;uBAAQ;2BACU;uBACN;sBACe"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _managerapi = require("storybook/manager-api");
|
|
6
|
+
const _constants = require("../constants");
|
|
7
|
+
const _ThemePicker = require("../components/ThemePicker");
|
|
8
|
+
const _ReactStrictMode = require("../components/ReactStrictMode");
|
|
9
|
+
const _DirectionSwitch = require("../components/DirectionSwitch");
|
|
10
|
+
_managerapi.addons.register(_constants.ADDON_ID, ()=>{
|
|
11
|
+
_managerapi.addons.add(_constants.THEME_ID, {
|
|
12
|
+
title: 'Fluent Theme Picker',
|
|
13
|
+
type: _managerapi.types.TOOL,
|
|
14
|
+
match: ({ viewMode })=>!!(viewMode && viewMode.match(/^(story|docs)$/)),
|
|
15
|
+
render: _ThemePicker.ThemePicker
|
|
16
|
+
});
|
|
17
|
+
_managerapi.addons.add(_constants.DIR_ID, {
|
|
18
|
+
title: 'Direction Switch',
|
|
19
|
+
type: _managerapi.types.TOOL,
|
|
20
|
+
match: ({ viewMode })=>!!(viewMode && viewMode.match(/^(story|docs)$/)),
|
|
21
|
+
render: _DirectionSwitch.DirectionSwitch
|
|
22
|
+
});
|
|
23
|
+
_managerapi.addons.add(_constants.STRICT_MODE_ID, {
|
|
24
|
+
type: _managerapi.types.TOOL,
|
|
25
|
+
title: 'React Strict Mode',
|
|
26
|
+
match: ({ viewMode })=>!!(viewMode && viewMode.match(/^(story|docs)$/)),
|
|
27
|
+
render: _ReactStrictMode.ReactStrictMode
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/preset/manager.ts"],"sourcesContent":["import { addons, types } from 'storybook/manager-api';\n\nimport { ADDON_ID, DIR_ID, STRICT_MODE_ID, THEME_ID } from '../constants';\nimport { ThemePicker } from '../components/ThemePicker';\nimport { ReactStrictMode } from '../components/ReactStrictMode';\nimport { DirectionSwitch } from '../components/DirectionSwitch';\n\naddons.register(ADDON_ID, () => {\n addons.add(THEME_ID, {\n title: 'Fluent Theme Picker',\n\n type: types.TOOL,\n match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),\n render: ThemePicker,\n });\n addons.add(DIR_ID, {\n title: 'Direction Switch',\n\n type: types.TOOL,\n match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),\n render: DirectionSwitch,\n });\n addons.add(STRICT_MODE_ID, {\n type: types.TOOL,\n title: 'React Strict Mode',\n match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),\n render: ReactStrictMode,\n });\n});\n"],"names":["addons","register","ADDON_ID","add","THEME_ID","title","type","types","TOOL","match","viewMode","render","ThemePicker","DIR_ID","DirectionSwitch","STRICT_MODE_ID","ReactStrictMode"],"mappings":";;;;4BAA8B;2BAE6B;6BAC/B;iCACI;iCACA;AAEhCA,kBAAM,CAACC,QAAQ,CAACC,mBAAQ,EAAE;IACxBF,kBAAM,CAACG,GAAG,CAACC,mBAAQ,EAAE;QACnBC,OAAO;QAEPC,MAAMC,iBAAK,CAACC,IAAI;QAChBC,OAAO,CAAC,EAAEC,QAAQ,EAAE,GAAK,CAAC,CAAEA,CAAAA,YAAYA,SAASD,KAAK,CAAC,iBAAgB;QACvEE,QAAQC,wBAAW;IACrB;IACAZ,kBAAM,CAACG,GAAG,CAACU,iBAAM,EAAE;QACjBR,OAAO;QAEPC,MAAMC,iBAAK,CAACC,IAAI;QAChBC,OAAO,CAAC,EAAEC,QAAQ,EAAE,GAAK,CAAC,CAAEA,CAAAA,YAAYA,SAASD,KAAK,CAAC,iBAAgB;QACvEE,QAAQG,gCAAe;IACzB;IACAd,kBAAM,CAACG,GAAG,CAACY,yBAAc,EAAE;QACzBT,MAAMC,iBAAK,CAACC,IAAI;QAChBH,OAAO;QACPI,OAAO,CAAC,EAAEC,QAAQ,EAAE,GAAK,CAAC,CAAEA,CAAAA,YAAYA,SAASD,KAAK,CAAC,iBAAgB;QACvEE,QAAQK,gCAAe;IACzB;AACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
decorators: function() {
|
|
13
|
+
return decorators;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
},
|
|
18
|
+
initialGlobals: function() {
|
|
19
|
+
return initialGlobals;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _withFluentProvider = require("../decorators/withFluentProvider");
|
|
23
|
+
const _withReactStrictMode = require("../decorators/withReactStrictMode");
|
|
24
|
+
const _withAriaLive = require("../decorators/withAriaLive");
|
|
25
|
+
const _docs = require("../docs");
|
|
26
|
+
const _constants = require("../constants");
|
|
27
|
+
const decorators = [
|
|
28
|
+
_withFluentProvider.withFluentProvider,
|
|
29
|
+
_withAriaLive.withAriaLive,
|
|
30
|
+
_withReactStrictMode.withReactStrictMode
|
|
31
|
+
];
|
|
32
|
+
const initialGlobals = {
|
|
33
|
+
[_constants.THEME_ID]: undefined,
|
|
34
|
+
[_constants.DIR_ID]: undefined,
|
|
35
|
+
[_constants.STRICT_MODE_ID]: undefined
|
|
36
|
+
}; // allow theme to be set by URL query param
|
|
37
|
+
const preview = {
|
|
38
|
+
decorators,
|
|
39
|
+
initialGlobals,
|
|
40
|
+
parameters: {
|
|
41
|
+
docs: {
|
|
42
|
+
container: _docs.FluentDocsContainer,
|
|
43
|
+
page: _docs.FluentDocsPage
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const _default = preview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/preset/preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react-webpack5';\n\nimport { withFluentProvider } from '../decorators/withFluentProvider';\nimport { withReactStrictMode } from '../decorators/withReactStrictMode';\nimport { withAriaLive } from '../decorators/withAriaLive';\nimport { FluentDocsContainer, FluentDocsPage } from '../docs';\n\nimport { DIR_ID, STRICT_MODE_ID, THEME_ID } from '../constants';\n\nexport const decorators = [withFluentProvider, withAriaLive, withReactStrictMode] as Preview['decorators'];\n\nexport const initialGlobals = { [THEME_ID]: undefined, [DIR_ID]: undefined, [STRICT_MODE_ID]: undefined }; // allow theme to be set by URL query param\n\nconst preview: Preview = {\n decorators,\n initialGlobals,\n parameters: {\n docs: {\n container: FluentDocsContainer,\n page: FluentDocsPage,\n },\n },\n};\n\nexport default preview;\n"],"names":["decorators","initialGlobals","withFluentProvider","withAriaLive","withReactStrictMode","THEME_ID","undefined","DIR_ID","STRICT_MODE_ID","preview","parameters","docs","container","FluentDocsContainer","page","FluentDocsPage"],"mappings":";;;;;;;;;;;IASaA,UAAU;eAAVA;;IAeb,OAAuB;eAAvB;;IAbaC,cAAc;eAAdA;;;oCATsB;qCACC;8BACP;sBACuB;2BAEH;AAE1C,MAAMD,aAAa;IAACE,sCAAkB;IAAEC,0BAAY;IAAEC,wCAAmB;CAAC;AAE1E,MAAMH,iBAAiB;IAAE,CAACI,mBAAQ,CAAC,EAAEC;IAAW,CAACC,iBAAM,CAAC,EAAED;IAAW,CAACE,yBAAc,CAAC,EAAEF;AAAU,GAAG,2CAA2C;AAEtJ,MAAMG,UAAmB;IACvBT;IACAC;IACAS,YAAY;QACVC,MAAM;YACJC,WAAWC,yBAAmB;YAC9BC,MAAMC,oBAAc;QACtB;IACF;AACF;MAEA,WAAeN"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
defaultTheme: function() {
|
|
13
|
+
return defaultTheme;
|
|
14
|
+
},
|
|
15
|
+
themes: function() {
|
|
16
|
+
return themes;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const themes = [
|
|
20
|
+
{
|
|
21
|
+
id: 'web-light',
|
|
22
|
+
label: 'Web Light'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'web-dark',
|
|
26
|
+
label: 'Web Dark'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'teams-light',
|
|
30
|
+
label: 'Teams Light'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'teams-dark',
|
|
34
|
+
label: 'Teams Dark'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'teams-light-v21',
|
|
38
|
+
label: 'Teams Light V2.1'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'teams-dark-v21',
|
|
42
|
+
label: 'Teams Dark V2.1'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'teams-high-contrast',
|
|
46
|
+
label: 'Teams High Contrast'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
const defaultTheme = themes[0];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme.ts"],"sourcesContent":["export const themes = [\n { id: 'web-light', label: 'Web Light' },\n { id: 'web-dark', label: 'Web Dark' },\n { id: 'teams-light', label: 'Teams Light' },\n { id: 'teams-dark', label: 'Teams Dark' },\n { id: 'teams-light-v21', label: 'Teams Light V2.1' },\n { id: 'teams-dark-v21', label: 'Teams Dark V2.1' },\n { id: 'teams-high-contrast', label: 'Teams High Contrast' },\n] as const;\n\nexport const defaultTheme = themes[0];\n\nexport type ThemeIds = (typeof themes)[number]['id'];\nexport type ThemeLabels = (typeof themes)[number]['label'];\n"],"names":["defaultTheme","themes","id","label"],"mappings":";;;;;;;;;;;IAUaA,YAAY;eAAZA;;IAVAC,MAAM;eAANA;;;AAAN,MAAMA,SAAS;IACpB;QAAEC,IAAI;QAAaC,OAAO;IAAY;IACtC;QAAED,IAAI;QAAYC,OAAO;IAAW;IACpC;QAAED,IAAI;QAAeC,OAAO;IAAc;IAC1C;QAAED,IAAI;QAAcC,OAAO;IAAa;IACxC;QAAED,IAAI;QAAmBC,OAAO;IAAmB;IACnD;QAAED,IAAI;QAAkBC,OAAO;IAAkB;IACjD;QAAED,IAAI;QAAuBC,OAAO;IAAsB;CAC3D;AAEM,MAAMH,eAAeC,MAAM,CAAC,EAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "isDecoratorDisabled", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return isDecoratorDisabled;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _hooks = require("../hooks");
|
|
12
|
+
function isDecoratorDisabled(context, decoratorName) {
|
|
13
|
+
var _getParametersConfig_disabledDecorators, _getParametersConfig;
|
|
14
|
+
var _getParametersConfig_disabledDecorators_includes;
|
|
15
|
+
return (_getParametersConfig_disabledDecorators_includes = (_getParametersConfig = (0, _hooks.getParametersConfig)(context)) === null || _getParametersConfig === void 0 ? void 0 : (_getParametersConfig_disabledDecorators = _getParametersConfig.disabledDecorators) === null || _getParametersConfig_disabledDecorators === void 0 ? void 0 : _getParametersConfig_disabledDecorators.includes(decoratorName)) !== null && _getParametersConfig_disabledDecorators_includes !== void 0 ? _getParametersConfig_disabledDecorators_includes : false;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/isDecoratorDisabled.ts"],"sourcesContent":["import { getParametersConfig, type FluentParameters, type FluentStoryContext } from '../hooks';\n\ntype DecoratorName = NonNullable<NonNullable<FluentParameters['reactStorybookAddon']>['disabledDecorators']>[number];\n\nexport function isDecoratorDisabled(context: FluentStoryContext, decoratorName: DecoratorName): boolean {\n return getParametersConfig(context)?.disabledDecorators?.includes(decoratorName) ?? false;\n}\n"],"names":["isDecoratorDisabled","context","decoratorName","getParametersConfig","disabledDecorators","includes"],"mappings":";;;;+BAIgBA;;;eAAAA;;;uBAJoE;AAI7E,SAASA,oBAAoBC,OAA2B,EAAEC,aAA4B;QACpFC,yCAAAA;QAAAA;IAAP,OAAOA,CAAAA,oDAAAA,uBAAAA,IAAAA,0BAAmB,EAACF,sBAApBE,4CAAAA,0CAAAA,qBAA8BC,kBAAkB,cAAhDD,8DAAAA,wCAAkDE,QAAQ,CAACH,4BAA3DC,8DAAAA,mDAA6E;AACtF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-storybook-addon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "fluentui react storybook addon",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -11,40 +11,33 @@
|
|
|
11
11
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@fluentui/eslint-plugin": "*",
|
|
16
|
-
"@fluentui/scripts-api-extractor": "*"
|
|
17
|
-
},
|
|
18
14
|
"dependencies": {
|
|
19
|
-
"@fluentui/react-aria": "^9.17.
|
|
20
|
-
"@fluentui/react-button": "^9.
|
|
21
|
-
"@fluentui/react-menu": "^9.
|
|
22
|
-
"@fluentui/react-label": "^9.3.
|
|
23
|
-
"@fluentui/react-switch": "^9.
|
|
24
|
-
"@fluentui/react-text": "^9.6.
|
|
25
|
-
"@fluentui/react-link": "^9.
|
|
26
|
-
"@fluentui/react-provider": "^9.22.
|
|
27
|
-
"@fluentui/react-utilities": "^9.
|
|
28
|
-
"@fluentui/react-theme": "^9.2.
|
|
15
|
+
"@fluentui/react-aria": "^9.17.10",
|
|
16
|
+
"@fluentui/react-button": "^9.8.2",
|
|
17
|
+
"@fluentui/react-menu": "^9.22.0",
|
|
18
|
+
"@fluentui/react-label": "^9.3.15",
|
|
19
|
+
"@fluentui/react-switch": "^9.6.0",
|
|
20
|
+
"@fluentui/react-text": "^9.6.15",
|
|
21
|
+
"@fluentui/react-link": "^9.7.4",
|
|
22
|
+
"@fluentui/react-provider": "^9.22.15",
|
|
23
|
+
"@fluentui/react-utilities": "^9.26.2",
|
|
24
|
+
"@fluentui/react-theme": "^9.2.1",
|
|
29
25
|
"@fluentui/react-icons": "^2.0.245",
|
|
30
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
31
|
-
"@fluentui/react-spinner": "^9.7.
|
|
32
|
-
"@fluentui/react-toast": "^9.7.
|
|
33
|
-
"@griffel/react": "^1.5.
|
|
26
|
+
"@fluentui/react-shared-contexts": "^9.26.2",
|
|
27
|
+
"@fluentui/react-spinner": "^9.7.15",
|
|
28
|
+
"@fluentui/react-toast": "^9.7.14",
|
|
29
|
+
"@griffel/react": "^1.5.32",
|
|
34
30
|
"@swc/helpers": "^0.5.1"
|
|
35
31
|
},
|
|
36
32
|
"peerDependencies": {
|
|
37
|
-
"@storybook/addon-docs": "^
|
|
38
|
-
"@storybook/
|
|
39
|
-
"@storybook/
|
|
40
|
-
"@storybook/preview-api": "^7.6.20",
|
|
41
|
-
"@storybook/manager-api": "^7.6.20",
|
|
42
|
-
"@storybook/react": "^7.6.20",
|
|
43
|
-
"@storybook/theming": "^7.6.20",
|
|
33
|
+
"@storybook/addon-docs": "^9.1.17",
|
|
34
|
+
"@storybook/icons": "^1.3.2",
|
|
35
|
+
"@storybook/react-webpack5": "^9.1.17",
|
|
44
36
|
"@types/react-dom": ">=16.9.0 <20.0.0",
|
|
45
37
|
"@types/react": ">=16.14.0 <20.0.0",
|
|
46
38
|
"react-dom": ">=16.14.0 <20.0.0",
|
|
47
|
-
"react": ">=16.14.0 <20.0.0"
|
|
39
|
+
"react": ">=16.14.0 <20.0.0",
|
|
40
|
+
"storybook": "^9.1.17"
|
|
48
41
|
},
|
|
49
42
|
"beachball": {
|
|
50
43
|
"disallowedChangeTypes": [
|