@fluentui/react-storybook-addon 0.5.0 → 0.6.0-experimental.fluent-cli.20260409-f92690ecf6.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +36 -2
  2. package/README.md +9 -0
  3. package/dist/index.d.ts +100 -0
  4. package/dist/styles.css +470 -0
  5. package/lib/components/DirectionSwitch.js +26 -0
  6. package/lib/components/DirectionSwitch.js.map +1 -0
  7. package/lib/components/ReactStrictMode.js +22 -0
  8. package/lib/components/ReactStrictMode.js.map +1 -0
  9. package/lib/components/ThemePicker.js +60 -0
  10. package/lib/components/ThemePicker.js.map +1 -0
  11. package/lib/constants.js +4 -0
  12. package/lib/constants.js.map +1 -0
  13. package/lib/decorators/withAriaLive.js +18 -0
  14. package/lib/decorators/withAriaLive.js.map +1 -0
  15. package/lib/decorators/withFluentProvider.js +48 -0
  16. package/lib/decorators/withFluentProvider.js.map +1 -0
  17. package/lib/decorators/withReactStrictMode.js +16 -0
  18. package/lib/decorators/withReactStrictMode.js.map +1 -0
  19. package/lib/docs/CopyAsMarkdownButton.js +177 -0
  20. package/lib/docs/CopyAsMarkdownButton.js.map +1 -0
  21. package/lib/docs/DirSwitch.js +51 -0
  22. package/lib/docs/DirSwitch.js.map +1 -0
  23. package/lib/docs/FluentCanvas.js +21 -0
  24. package/lib/docs/FluentCanvas.js.map +1 -0
  25. package/lib/docs/FluentDocsContainer.js +24 -0
  26. package/lib/docs/FluentDocsContainer.js.map +1 -0
  27. package/lib/docs/FluentDocsPage.js +308 -0
  28. package/lib/docs/FluentDocsPage.js.map +1 -0
  29. package/lib/docs/FluentStory.js +18 -0
  30. package/lib/docs/FluentStory.js.map +1 -0
  31. package/lib/docs/ThemePicker.js +61 -0
  32. package/lib/docs/ThemePicker.js.map +1 -0
  33. package/lib/docs/Toc.js +130 -0
  34. package/lib/docs/Toc.js.map +1 -0
  35. package/lib/docs/index.js +4 -0
  36. package/lib/docs/index.js.map +1 -0
  37. package/lib/docs/utils.js +74 -0
  38. package/lib/docs/utils.js.map +1 -0
  39. package/lib/hooks.js +16 -0
  40. package/lib/hooks.js.map +1 -0
  41. package/lib/index.js +4 -0
  42. package/lib/index.js.map +1 -0
  43. package/lib/preset/manager.js +25 -0
  44. package/lib/preset/manager.js.map +1 -0
  45. package/lib/preset/preview.js +26 -0
  46. package/lib/preset/preview.js.map +1 -0
  47. package/lib/theme.js +31 -0
  48. package/lib/theme.js.map +1 -0
  49. package/lib/utils/isDecoratorDisabled.js +6 -0
  50. package/lib/utils/isDecoratorDisabled.js.map +1 -0
  51. package/lib-commonjs/components/DirectionSwitch.js +37 -0
  52. package/lib-commonjs/components/DirectionSwitch.js.map +1 -0
  53. package/lib-commonjs/components/ReactStrictMode.js +33 -0
  54. package/lib-commonjs/components/ReactStrictMode.js.map +1 -0
  55. package/lib-commonjs/components/ThemePicker.js +71 -0
  56. package/lib-commonjs/components/ThemePicker.js.map +1 -0
  57. package/lib-commonjs/constants.js +28 -0
  58. package/lib-commonjs/constants.js.map +1 -0
  59. package/lib-commonjs/decorators/withAriaLive.js +29 -0
  60. package/lib-commonjs/decorators/withAriaLive.js.map +1 -0
  61. package/lib-commonjs/decorators/withFluentProvider.js +59 -0
  62. package/lib-commonjs/decorators/withFluentProvider.js.map +1 -0
  63. package/lib-commonjs/decorators/withReactStrictMode.js +27 -0
  64. package/lib-commonjs/decorators/withReactStrictMode.js.map +1 -0
  65. package/lib-commonjs/docs/CopyAsMarkdownButton.js +185 -0
  66. package/lib-commonjs/docs/CopyAsMarkdownButton.js.map +1 -0
  67. package/lib-commonjs/docs/DirSwitch.js +60 -0
  68. package/lib-commonjs/docs/DirSwitch.js.map +1 -0
  69. package/lib-commonjs/docs/FluentCanvas.js +29 -0
  70. package/lib-commonjs/docs/FluentCanvas.js.map +1 -0
  71. package/lib-commonjs/docs/FluentDocsContainer.js +33 -0
  72. package/lib-commonjs/docs/FluentDocsContainer.js.map +1 -0
  73. package/lib-commonjs/docs/FluentDocsPage.js +319 -0
  74. package/lib-commonjs/docs/FluentDocsPage.js.map +1 -0
  75. package/lib-commonjs/docs/FluentStory.js +26 -0
  76. package/lib-commonjs/docs/FluentStory.js.map +1 -0
  77. package/lib-commonjs/docs/ThemePicker.js +70 -0
  78. package/lib-commonjs/docs/ThemePicker.js.map +1 -0
  79. package/lib-commonjs/docs/Toc.js +149 -0
  80. package/lib-commonjs/docs/Toc.js.map +1 -0
  81. package/lib-commonjs/docs/index.js +28 -0
  82. package/lib-commonjs/docs/index.js.map +1 -0
  83. package/lib-commonjs/docs/utils.js +88 -0
  84. package/lib-commonjs/docs/utils.js.map +1 -0
  85. package/lib-commonjs/hooks.js +37 -0
  86. package/lib-commonjs/hooks.js.map +1 -0
  87. package/lib-commonjs/index.js +34 -0
  88. package/lib-commonjs/index.js.map +1 -0
  89. package/lib-commonjs/preset/manager.js +29 -0
  90. package/lib-commonjs/preset/manager.js.map +1 -0
  91. package/lib-commonjs/preset/preview.js +47 -0
  92. package/lib-commonjs/preset/preview.js.map +1 -0
  93. package/lib-commonjs/theme.js +49 -0
  94. package/lib-commonjs/theme.js.map +1 -0
  95. package/lib-commonjs/utils/isDecoratorDisabled.js +16 -0
  96. package/lib-commonjs/utils/isDecoratorDisabled.js.map +1 -0
  97. package/package.json +26 -34
package/CHANGELOG.md CHANGED
@@ -1,12 +1,46 @@
1
1
  # Change Log - @fluentui/react-storybook-addon
2
2
 
3
- This log was last generated on Fri, 31 Oct 2025 16:17:32 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Apr 2026 08:01:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.6.0-experimental.fluent-cli.20260409-f92690ecf6.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-storybook-addon_v0.6.0-experimental.fluent-cli.20260409-f92690ecf6.0)
8
+
9
+ Thu, 09 Apr 2026 08:01:26 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-storybook-addon_v0.6.0..@fluentui/react-storybook-addon_v0.6.0-experimental.fluent-cli.20260409-f92690ecf6.0)
11
+
12
+ ### Changes
13
+
14
+ - Release experimental tools experimental.fluent-cli.20260409-f92690ecf6 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+
16
+ ## [0.6.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-storybook-addon_v0.6.0)
17
+
18
+ Tue, 03 Mar 2026 13:16:24 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-storybook-addon_v0.5.1..@fluentui/react-storybook-addon_v0.6.0)
20
+
21
+ ### Minor changes
22
+
23
+ - feat: upgrade to storybook 9 ([PR #35459](https://github.com/microsoft/fluentui/pull/35459) by dmytrokirpa@microsoft.com)
24
+ - BREAKING: upgrade storybook to v8 ([PR #35279](https://github.com/microsoft/fluentui/pull/35279) by dmytrokirpa@microsoft.com)
25
+
26
+ ### Patches
27
+
28
+ - chore: migrate source to react 19 ([PR #35434](https://github.com/microsoft/fluentui/pull/35434) by martinhochel@microsoft.com)
29
+ - chore: bump storybook to mitigate CVE ([PR #35748](https://github.com/microsoft/fluentui/pull/35748) by martinhochel@microsoft.com)
30
+ - chore: Bump @griffel/react package. ([PR #35469](https://github.com/microsoft/fluentui/pull/35469) by estebanmu@microsoft.com)
31
+
32
+ ## [0.5.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-storybook-addon_v0.5.1)
33
+
34
+ Tue, 04 Nov 2025 14:47:00 GMT
35
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-storybook-addon_v0.5.0..@fluentui/react-storybook-addon_v0.5.1)
36
+
37
+ ### Patches
38
+
39
+ - fix: force release ([PR #35445](https://github.com/microsoft/fluentui/pull/35445) by dmytrokirpa@microsoft.com)
40
+
7
41
  ## [0.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-storybook-addon_v0.5.0)
8
42
 
9
- Fri, 31 Oct 2025 16:17:32 GMT
43
+ Fri, 31 Oct 2025 16:22:00 GMT
10
44
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-storybook-addon_v0.4.6..@fluentui/react-storybook-addon_v0.5.0)
11
45
 
12
46
  ### Minor changes
package/README.md CHANGED
@@ -38,6 +38,15 @@ export const ThemePicker: React.FC<{ context: FluentStoryContext }> = ({ context
38
38
  };
39
39
  ```
40
40
 
41
+ ### Shared Storybook Preview Styles
42
+
43
+ The package ships a `styles.css` file with shared Storybook preview styles (docs layout, table formatting, theme-aware backgrounds, etc.). Import it once in your Storybook `preview.js`/`preview.ts`:
44
+
45
+ ```js
46
+ // .storybook/preview.js
47
+ import '@fluentui/react-storybook-addon/styles.css';
48
+ ```
49
+
41
50
  ### Augmented Docs Blocks
42
51
 
43
52
  This presets uses [custom docs container and page](https://storybook.js.org/docs/7/writing-docs/autodocs#customize-the-docs-container) for unified FluentUI experience including:
@@ -0,0 +1,100 @@
1
+ import { Args } from '@storybook/react-webpack5';
2
+ import type { JSXElement } from '@fluentui/react-utilities';
3
+ import { Parameters as Parameters_2 } from '@storybook/react-webpack5';
4
+ import * as React_2 from 'react';
5
+ import { StoryContext } from '@storybook/react-webpack5';
6
+
7
+ export declare const DIR_ID: "storybook_fluentui-react-addon_dir";
8
+
9
+ /**
10
+ * Canvas component to wrap stories in a styled container.
11
+ * Provides a similar experience to Storybook's v7 `Canvas` component.
12
+ */
13
+ export declare const FluentCanvas: (props: React_2.ComponentProps<"div">) => JSXElement;
14
+
15
+ /**
16
+ * Configuration for docs components
17
+ */
18
+ declare type FluentDocsConfig = boolean | {
19
+ tableOfContents?: boolean;
20
+ dirSwitcher?: boolean;
21
+ themePicker?: boolean;
22
+ copyAsMarkdown?: boolean;
23
+ argTable?: boolean | {
24
+ slotsApi?: boolean;
25
+ nativePropsApi?: boolean;
26
+ };
27
+ };
28
+
29
+ /**
30
+ * Extends the storybook globals object to include fluent specific properties
31
+ */
32
+ export declare interface FluentGlobals extends Args {
33
+ [DIR_ID]?: 'ltr' | 'rtl';
34
+ [THEME_ID]?: ThemeIds;
35
+ [STRICT_MODE_ID]?: boolean;
36
+ }
37
+
38
+ /**
39
+ * Extends the storybook parameters object to include fluent specific properties
40
+ */
41
+ export declare interface FluentParameters extends Parameters_2 {
42
+ dir?: 'ltr' | 'rtl';
43
+ fluentTheme?: ThemeIds;
44
+ mode?: 'default' | 'vr-test';
45
+ reactStorybookAddon?: {
46
+ disabledDecorators?: ['AriaLive' | 'FluentProvider' | 'ReactStrictMode'];
47
+ docs?: FluentDocsConfig;
48
+ };
49
+ }
50
+
51
+ /**
52
+ * Story component to render stories in an iframe.
53
+ * Provides a similar experience to Storybook's v7 `Story` component.
54
+ */
55
+ export declare const FluentStory: ({ id, height }: FluentStoryProps) => JSXElement;
56
+
57
+ export declare interface FluentStoryContext extends StoryContext {
58
+ globals: FluentGlobals;
59
+ parameters: FluentParameters;
60
+ }
61
+
62
+ declare type FluentStoryProps = {
63
+ /** The unique identifier for the story */
64
+ id: string;
65
+ /** The height of the iframe */
66
+ height?: string | number;
67
+ };
68
+
69
+ export declare function parameters(options?: FluentParameters): FluentParameters;
70
+
71
+ declare const STRICT_MODE_ID: "storybook_fluentui-react-addon_strict-mode";
72
+
73
+ export declare const THEME_ID: "storybook_fluentui-react-addon_theme";
74
+
75
+ export declare type ThemeIds = (typeof themes)[number]['id'];
76
+
77
+ export declare const themes: readonly [{
78
+ readonly id: "web-light";
79
+ readonly label: "Web Light";
80
+ }, {
81
+ readonly id: "web-dark";
82
+ readonly label: "Web Dark";
83
+ }, {
84
+ readonly id: "teams-light";
85
+ readonly label: "Teams Light";
86
+ }, {
87
+ readonly id: "teams-dark";
88
+ readonly label: "Teams Dark";
89
+ }, {
90
+ readonly id: "teams-light-v21";
91
+ readonly label: "Teams Light V2.1";
92
+ }, {
93
+ readonly id: "teams-dark-v21";
94
+ readonly label: "Teams Dark V2.1";
95
+ }, {
96
+ readonly id: "teams-high-contrast";
97
+ readonly label: "Teams High Contrast";
98
+ }];
99
+
100
+ export { }
@@ -0,0 +1,470 @@
1
+ #storybook-docs .sbdocs-content {
2
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
3
+ sans-serif;
4
+ max-width: 1200px;
5
+ }
6
+
7
+ #storybook-docs h1.sbdocs-title {
8
+ font-family: inherit;
9
+ font-size: 44px;
10
+ line-height: 60px;
11
+ /* identical to box height, or 143% */
12
+ font-weight: 900;
13
+ letter-spacing: -0.04em;
14
+ color: #000000;
15
+ margin-top: 49px;
16
+ }
17
+
18
+ #storybook-docs details:not(.sbdocs-preview details) {
19
+ position: relative;
20
+ z-index: 99;
21
+ }
22
+
23
+ #storybook-docs .sbdocs p:not(.sbdocs-preview p) {
24
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
25
+ sans-serif;
26
+ font-size: 18px;
27
+ line-height: 27px;
28
+ letter-spacing: -0.01em;
29
+ color: #000000;
30
+ margin-top: 24px;
31
+ }
32
+
33
+ #storybook-docs .sbdocs-wrapper {
34
+ background: white;
35
+ min-height: auto;
36
+ }
37
+
38
+ #storybook-docs .sbdocs-img.featured-image {
39
+ margin: 48px 0;
40
+ display: block;
41
+ border-radius: 24px;
42
+ }
43
+
44
+ #storybook-docs .sbdocs-img {
45
+ max-width: 100%;
46
+ }
47
+
48
+ #storybook-docs .sbdocs hr:not(.sbdocs-preview hr) {
49
+ margin: 48px 0;
50
+ height: 0;
51
+ border-top: 1px solid #ebebeb;
52
+ }
53
+
54
+ #storybook-docs .sbdocs h2:not(.sbdocs-preview h2) {
55
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
56
+ sans-serif;
57
+ font-size: 24px;
58
+ line-height: 28px;
59
+ letter-spacing: -0.04em;
60
+ color: black;
61
+ border-top: 1px solid #ebebeb;
62
+ border-bottom: none;
63
+ margin: 48px 0 15px 0;
64
+ padding: 48px 0 0 0;
65
+ }
66
+
67
+ #storybook-docs .sbdocs h2 code:not(.sbdocs-preview h2 code) {
68
+ border-radius: 4px;
69
+ font-size: 20px;
70
+ }
71
+
72
+ #storybook-docs .sbdocs-h3 {
73
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
74
+ sans-serif;
75
+ font-size: 18px;
76
+ line-height: 24px;
77
+ margin: 25px 0 0 0 !important;
78
+ letter-spacing: -0.01em;
79
+ color: #000000;
80
+ }
81
+
82
+ #storybook-docs .sbdocs-h3 code {
83
+ border-radius: 3px;
84
+ font-size: 16px;
85
+ }
86
+
87
+ /* Only apply to H3s inside of stories which have a parent with an ID */
88
+ #storybook-docs [id] > .sbdocs-h3:before {
89
+ content: '';
90
+ display: block;
91
+ height: 40px;
92
+ margin: -40px 0 0;
93
+ }
94
+
95
+ #storybook-docs .sbdocs li:not(.sbdocs-preview li) {
96
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
97
+ sans-serif;
98
+ font-size: 16px;
99
+ line-height: 150%;
100
+ letter-spacing: -0.01em;
101
+
102
+ /* Neutrals / Web / Gray 200 #1B1A19 */
103
+ color: #1b1a19;
104
+ margin-top: 8px;
105
+ }
106
+
107
+ #storybook-docs .sbdocs ul:not(.sbdocs-preview ul) {
108
+ margin: 12px 0;
109
+ }
110
+
111
+ #storybook-docs .sbdocs-ul li:not(.sbdocs-preview .sbdocs-ul li) {
112
+ list-style: none;
113
+ position: relative;
114
+ }
115
+
116
+ #storybook-docs .sbdocs-ul .sbdocs-li::before {
117
+ position: absolute;
118
+ content: '•';
119
+ color: #8d8d8d;
120
+ top: 0;
121
+ left: -15px;
122
+ }
123
+
124
+ #storybook-docs .sbdocs-ol .sbdocs-li::marker {
125
+ color: #8d8d8d;
126
+ }
127
+
128
+ #storybook-docs .sbdocs-preview {
129
+ border-radius: 16px;
130
+ background: var(--colorBrandBackgroundInverted, #fff);
131
+ padding: 0;
132
+ box-shadow: none;
133
+ border: 1px solid var(--colorNeutralStroke1, #e1dfdd);
134
+ }
135
+
136
+ #storybook-docs .sbdocs .docs-story div[scale] {
137
+ height: auto !important;
138
+ }
139
+
140
+ #storybook-docs .innerZoomElementWrapper {
141
+ padding: 30px;
142
+ }
143
+
144
+ #storybook-docs .sbdocs-preview > .os-host {
145
+ display: none;
146
+ }
147
+
148
+ #storybook-docs span + .sbdocs .docblock-argstable tbody tr td button {
149
+ color: #0078d4;
150
+ color: red;
151
+ }
152
+
153
+ #storybook-docs .docs-story + div {
154
+ background: #11100f;
155
+ }
156
+
157
+ #storybook-docs .sbdocs-content > div:last-child {
158
+ margin-bottom: 96px;
159
+ }
160
+
161
+ #storybook-docs .docs-story > div {
162
+ padding: 0;
163
+ background: none;
164
+ }
165
+
166
+ #storybook-docs .docs-story > div:last-child {
167
+ right: 31px;
168
+ border-radius: 24px;
169
+ }
170
+
171
+ .docs-story + div > div:last-child {
172
+ background: #000000;
173
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
174
+ border-radius: 5px 5px 0px 0px;
175
+ right: 31px;
176
+ }
177
+
178
+ .docs-story + div > div:last-child > button {
179
+ color: white;
180
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
181
+ sans-serif;
182
+ font-size: 14px;
183
+ line-height: 150%;
184
+ text-align: center;
185
+ letter-spacing: -0.01em;
186
+ }
187
+
188
+ #storybook-docs a.sbdocs-a {
189
+ color: #0078d4;
190
+ text-decoration: underline;
191
+ }
192
+
193
+ /* Styles for Github-flavored Markdown tables */
194
+ #storybook-docs table:not(.docblock-argstable, .sbdocs-preview table) {
195
+ margin: 16px 0px;
196
+ font-size: 14px;
197
+ line-height: 24px;
198
+ padding: 0;
199
+ border-collapse: collapse;
200
+ }
201
+
202
+ #storybook-docs table:not(.docblock-argstable, .sbdocs-preview table) tr {
203
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
204
+ }
205
+
206
+ #storybook-docs table:not(.docblock-argstable, .sbdocs-preview table) th {
207
+ font-weight: bold;
208
+ color: rgb(51, 51, 51);
209
+ border: 1px solid rgba(0, 0, 0, 0.1);
210
+ padding: 6px 13px;
211
+ }
212
+
213
+ #storybook-docs table:not(.docblock-argstable, .sbdocs-preview table) td {
214
+ border: 1px solid rgba(0, 0, 0, 0.1);
215
+ padding: 6px 13px;
216
+ }
217
+
218
+ /* */
219
+ /* Args Table */
220
+ /* */
221
+
222
+ #storybook-docs .docblock-argstable tbody {
223
+ box-shadow: none;
224
+ border-left: none;
225
+ border-right: none;
226
+ }
227
+
228
+ #storybook-docs .docblock-argstable-head th {
229
+ letter-spacing: -0.01em;
230
+ color: black;
231
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
232
+ sans-serif;
233
+ font-size: 16px;
234
+ line-height: 150%;
235
+ font-weight: 600;
236
+ }
237
+
238
+ #storybook-docs thead.docblock-argstable-head {
239
+ border-bottom: 1px solid #edebe9;
240
+ }
241
+
242
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(4) {
243
+ display: none;
244
+ }
245
+
246
+ #storybook-docs .docblock-argstable-head > tr > th:nth-child(4) {
247
+ display: none;
248
+ }
249
+
250
+ #storybook-docs .docblock-argstable tbody tr {
251
+ border: none;
252
+ }
253
+
254
+ #storybook-docs table.docblock-argstable tbody.docblock-argstable-body td,
255
+ #storybook-docs .docblock-argstable th {
256
+ padding-top: 12px;
257
+ padding-bottom: 12px;
258
+ padding-left: 16px;
259
+ }
260
+
261
+ #storybook-docs .docblock-argstable tbody tr td:nth-child(1) span {
262
+ font-weight: normal;
263
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
264
+ sans-serif;
265
+ font-size: 16px;
266
+ line-height: 130%;
267
+ letter-spacing: -0.01em;
268
+ color: #616161;
269
+ }
270
+
271
+ #storybook-docs .docblock-argstable tbody tr td {
272
+ vertical-align: top;
273
+ }
274
+
275
+ #storybook-docs .docblock-argstable-body > tr > td > div > div > button {
276
+ color: #0078d4;
277
+ line-height: 21px;
278
+ }
279
+
280
+ #storybook-docs code:not(.sbdocs-preview code),
281
+ #storybook-docs .docblock-argstable tbody tr td:nth-child(3) > div > span,
282
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) > div:nth-child(2) span,
283
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) > div:nth-child(1) > div > span,
284
+ #storybook-docs .css-16d4d7t {
285
+ font-family: 'Cascadia Code', Menlo, 'Courier New', Courier, monospace;
286
+ font-style: normal;
287
+ font-weight: normal;
288
+ font-size: 14px;
289
+ line-height: 130%;
290
+ letter-spacing: -0.2px;
291
+ box-decoration-break: clone;
292
+ -webkit-box-decoration-break: clone;
293
+ }
294
+
295
+ #storybook-docs code.sbdocs-code,
296
+ #storybook-docs .sbdocs-p code,
297
+ #storybook-docs .sbdocs-li code,
298
+ #storybook-docs .docblock-argstable code,
299
+ #storybook-docs .docblock-argstable tbody tr td:nth-child(3) > div > span,
300
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) > div:nth-child(2) span,
301
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) > div:nth-child(1) > div > span,
302
+ #storybook-docs .css-16d4d7t {
303
+ font-size: 14px;
304
+ background: #f0f0f0;
305
+ border-radius: 4px;
306
+ padding: 1px 4px;
307
+ margin: 0 3px 0 3px;
308
+ color: black;
309
+ border: none;
310
+ line-height: 1.5;
311
+ }
312
+
313
+ #storybook-docs .docblock-argstable code {
314
+ white-space: normal;
315
+ }
316
+
317
+ #storybook-docs code:not(.sbdocs-preview code) {
318
+ padding: 0.1em 0.2em;
319
+ display: inline-block;
320
+ background-color: rgba(17, 16, 15, 0.1);
321
+ border-radius: 2px;
322
+ }
323
+
324
+ .os-content-glue {
325
+ width: auto !important;
326
+ }
327
+
328
+ #storybook-docs .sbdocs-preview .prismjs {
329
+ overflow: hidden;
330
+ }
331
+
332
+ #storybook-docs .os-content .prismjs * {
333
+ font-family: 'Cascadia Code', Menlo, 'Courier New', Courier, monospace;
334
+ font-size: 14px;
335
+ line-height: 1.4em;
336
+ }
337
+
338
+ #storybook-docs .sbdocs-preview .prismjs code {
339
+ color: white;
340
+ background: #11100f;
341
+ margin: 0;
342
+ overflow-x: auto;
343
+ }
344
+
345
+ #storybook-docs .docblock-argstable-body td > div > p,
346
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) p,
347
+ #storybook-docs .docblock-argstable-body > tr > td:nth-child(2) > div:nth-child(1) > span {
348
+ font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue',
349
+ sans-serif;
350
+ font-size: 16px;
351
+ line-height: 130%;
352
+ color: black;
353
+ letter-spacing: -0.01em;
354
+ }
355
+
356
+ #storybook-docs .docblock-argstable tr > :nth-child(1) {
357
+ width: 4%;
358
+ }
359
+
360
+ #storybook-docs .docblock-argstable tr > :nth-child(2) {
361
+ width: 100%;
362
+ }
363
+
364
+ #storybook-docs .os-padding {
365
+ z-index: 0;
366
+ }
367
+
368
+ @font-face {
369
+ font-family: 'Segoe UI';
370
+ src: local('Segoe UI Light'),
371
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format('woff2'),
372
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format('woff'),
373
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format('truetype');
374
+ font-weight: 100;
375
+ }
376
+
377
+ @font-face {
378
+ font-family: 'Segoe UI';
379
+ src: local('Segoe UI Semilight'),
380
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2) format('woff2'),
381
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff) format('woff'),
382
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf) format('truetype');
383
+ font-weight: 200;
384
+ }
385
+
386
+ @font-face {
387
+ font-family: 'Segoe UI';
388
+ src: local('Segoe UI'),
389
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2) format('woff2'),
390
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff) format('woff'),
391
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf) format('truetype');
392
+ font-weight: 400;
393
+ }
394
+
395
+ @font-face {
396
+ font-family: 'Segoe UI';
397
+ src: local('Segoe UI Semibold'),
398
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2) format('woff2'),
399
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff) format('woff'),
400
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf) format('truetype');
401
+ font-weight: 600;
402
+ }
403
+
404
+ @font-face {
405
+ font-family: 'Segoe UI';
406
+ src: local('Segoe UI Bold'),
407
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2) format('woff2'),
408
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff) format('woff'),
409
+ url(https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf) format('truetype');
410
+ font-weight: 700;
411
+ }
412
+
413
+ body,
414
+ body h1,
415
+ body h2,
416
+ body p,
417
+ body ul,
418
+ body ul li {
419
+ font-family: 'Segoe UI' !important;
420
+ }
421
+
422
+ h1.fluent {
423
+ font-weight: 700;
424
+ font-size: 40px;
425
+ font-family: 'Segoe UI';
426
+ line-height: 60px;
427
+ letter-spacing: -0.16px;
428
+ }
429
+
430
+ h1.fluent .fluent-version {
431
+ display: block;
432
+ font-size: 24px;
433
+ /* --font-size-base-600 */
434
+ line-height: 32px;
435
+ color: #707070;
436
+ /* --color-neutral-foreground-3 */
437
+ }
438
+
439
+ h2.fluent {
440
+ font-weight: 600;
441
+ font-size: 24px;
442
+ font-family: 'Segoe UI';
443
+ line-height: 36px;
444
+ letter-spacing: -0.16px;
445
+ }
446
+
447
+ /* remove the docs wrapper bg to let page bg show through */
448
+ /* remove unnecessary padding now that theme switcher is not taking up space */
449
+ #storybook-docs .sbdocs-wrapper {
450
+ background: transparent !important;
451
+ padding: 0 48px;
452
+ }
453
+
454
+ /* sb-show-main is missing during page transitions causing a page shift */
455
+ /* todo: cleanup once we no longer inherit docs-root */
456
+ .sb-show-main.sb-main-fullscreen,
457
+ .sb-main-fullscreen {
458
+ margin: 0;
459
+ padding: 0;
460
+ display: block;
461
+ }
462
+
463
+ /* remove loading overlay */
464
+ .sb-preparing-story,
465
+ .sb-preparing-docs,
466
+ .sb-nopreview,
467
+ .sb-errordisplay,
468
+ .sidebar-container .search-field + div {
469
+ display: none !important;
470
+ }
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { IconButton } from 'storybook/internal/components';
3
+ import { styled } from 'storybook/theming';
4
+ import { DIR_ID } from '../constants';
5
+ import { useGlobals } from '../hooks';
6
+ const Monospace = styled.span({
7
+ fontFamily: "'Cascadia Code', Menlo, 'Courier New', Courier, monospace",
8
+ letterSpacing: '-0.05em'
9
+ });
10
+ export const DirectionSwitch = ()=>{
11
+ const [globals, updateGlobals] = useGlobals();
12
+ var _globals_DIR_ID;
13
+ const direction = (_globals_DIR_ID = globals[DIR_ID]) !== null && _globals_DIR_ID !== void 0 ? _globals_DIR_ID : 'ltr';
14
+ const isLTR = direction === 'ltr';
15
+ const toggleDirection = React.useCallback(()=>updateGlobals({
16
+ [DIR_ID]: isLTR ? 'rtl' : 'ltr'
17
+ }), [
18
+ isLTR,
19
+ updateGlobals
20
+ ]);
21
+ return /*#__PURE__*/ React.createElement(IconButton, {
22
+ key: DIR_ID,
23
+ title: "Change Direction",
24
+ onClick: toggleDirection
25
+ }, /*#__PURE__*/ React.createElement("div", null, "Direction: ", /*#__PURE__*/ React.createElement(Monospace, null, direction.toUpperCase())));
26
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DirectionSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconButton } from 'storybook/internal/components';\nimport { styled } from 'storybook/theming';\n\nimport { JSXElement } from '@fluentui/react-utilities';\nimport { DIR_ID } from '../constants';\nimport { useGlobals } from '../hooks';\n\nconst Monospace = styled.span({\n fontFamily: \"'Cascadia Code', Menlo, 'Courier New', Courier, monospace\",\n letterSpacing: '-0.05em',\n});\n\nexport const DirectionSwitch = (): JSXElement => {\n const [globals, updateGlobals] = useGlobals();\n\n const direction = globals[DIR_ID] ?? 'ltr';\n const isLTR = direction === 'ltr';\n\n const toggleDirection = React.useCallback(\n () =>\n updateGlobals({\n [DIR_ID]: isLTR ? 'rtl' : 'ltr',\n }),\n [isLTR, updateGlobals],\n );\n\n return (\n <IconButton key={DIR_ID} title=\"Change Direction\" onClick={toggleDirection}>\n <div>\n Direction: <Monospace>{direction.toUpperCase()}</Monospace>\n </div>\n </IconButton>\n );\n};\n"],"names":["React","IconButton","styled","DIR_ID","useGlobals","Monospace","span","fontFamily","letterSpacing","DirectionSwitch","globals","updateGlobals","direction","isLTR","toggleDirection","useCallback","key","title","onClick","div","toUpperCase"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,MAAM,QAAQ,oBAAoB;AAG3C,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,UAAU,QAAQ,WAAW;AAEtC,MAAMC,YAAYH,OAAOI,IAAI,CAAC;IAC5BC,YAAY;IACZC,eAAe;AACjB;AAEA,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,CAACC,SAASC,cAAc,GAAGP;QAEfM;IAAlB,MAAME,YAAYF,CAAAA,kBAAAA,OAAO,CAACP,OAAO,cAAfO,6BAAAA,kBAAmB;IACrC,MAAMG,QAAQD,cAAc;IAE5B,MAAME,kBAAkBd,MAAMe,WAAW,CACvC,IACEJ,cAAc;YACZ,CAACR,OAAO,EAAEU,QAAQ,QAAQ;QAC5B,IACF;QAACA;QAAOF;KAAc;IAGxB,qBACE,oBAACV;QAAWe,KAAKb;QAAQc,OAAM;QAAmBC,SAASJ;qBACzD,oBAACK,aAAI,6BACQ,oBAACd,iBAAWO,UAAUQ,WAAW;AAIpD,EAAE"}
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { IconButton } from 'storybook/internal/components';
3
+ import { LockIcon } from '@storybook/icons';
4
+ import { STRICT_MODE_ID } from '../constants';
5
+ import { useGlobals } from '../hooks';
6
+ export const ReactStrictMode = ()=>{
7
+ const [globals, updateGlobals] = useGlobals();
8
+ var _globals_STRICT_MODE_ID;
9
+ const isActive = (_globals_STRICT_MODE_ID = globals[STRICT_MODE_ID]) !== null && _globals_STRICT_MODE_ID !== void 0 ? _globals_STRICT_MODE_ID : false;
10
+ const toggleStrictMode = React.useCallback(()=>updateGlobals({
11
+ [STRICT_MODE_ID]: !isActive
12
+ }), [
13
+ isActive,
14
+ updateGlobals
15
+ ]);
16
+ return /*#__PURE__*/ React.createElement(IconButton, {
17
+ key: STRICT_MODE_ID,
18
+ active: isActive,
19
+ title: "Toggle React Strict mode",
20
+ onClick: toggleStrictMode
21
+ }, /*#__PURE__*/ React.createElement(LockIcon, null));
22
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ReactStrictMode.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconButton } from 'storybook/internal/components';\nimport { LockIcon } from '@storybook/icons';\n\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { STRICT_MODE_ID } from '../constants';\nimport { useGlobals } from '../hooks';\n\nexport const ReactStrictMode = (): JSXElement => {\n const [globals, updateGlobals] = useGlobals();\n\n const isActive = globals[STRICT_MODE_ID] ?? false;\n\n const toggleStrictMode = React.useCallback(\n () =>\n updateGlobals({\n [STRICT_MODE_ID]: !isActive,\n }),\n [isActive, updateGlobals],\n );\n\n return (\n <IconButton key={STRICT_MODE_ID} active={isActive} title=\"Toggle React Strict mode\" onClick={toggleStrictMode}>\n <LockIcon />\n </IconButton>\n );\n};\n"],"names":["React","IconButton","LockIcon","STRICT_MODE_ID","useGlobals","ReactStrictMode","globals","updateGlobals","isActive","toggleStrictMode","useCallback","key","active","title","onClick"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,QAAQ,QAAQ,mBAAmB;AAG5C,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,UAAU,QAAQ,WAAW;AAEtC,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,CAACC,SAASC,cAAc,GAAGH;QAEhBE;IAAjB,MAAME,WAAWF,CAAAA,0BAAAA,OAAO,CAACH,eAAe,cAAvBG,qCAAAA,0BAA2B;IAE5C,MAAMG,mBAAmBT,MAAMU,WAAW,CACxC,IACEH,cAAc;YACZ,CAACJ,eAAe,EAAE,CAACK;QACrB,IACF;QAACA;QAAUD;KAAc;IAG3B,qBACE,oBAACN;QAAWU,KAAKR;QAAgBS,QAAQJ;QAAUK,OAAM;QAA2BC,SAASL;qBAC3F,oBAACP;AAGP,EAAE"}