@fluentui/react-tabs 9.0.10 → 9.1.1

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 (66) hide show
  1. package/CHANGELOG.json +103 -1
  2. package/CHANGELOG.md +32 -2
  3. package/dist/index.d.ts +18 -5
  4. package/lib/components/Tab/Tab.types.js.map +1 -1
  5. package/lib/components/Tab/renderTab.js +2 -0
  6. package/lib/components/Tab/renderTab.js.map +1 -1
  7. package/lib/components/Tab/useTab.js +2 -0
  8. package/lib/components/Tab/useTab.js.map +1 -1
  9. package/lib/components/Tab/useTabStyles.js +125 -37
  10. package/lib/components/Tab/useTabStyles.js.map +1 -1
  11. package/lib/components/TabList/TabList.types.js.map +1 -1
  12. package/lib/components/TabList/TabListContext.js +1 -0
  13. package/lib/components/TabList/TabListContext.js.map +1 -1
  14. package/lib/components/TabList/useTabList.js +2 -0
  15. package/lib/components/TabList/useTabList.js.map +1 -1
  16. package/lib/components/TabList/useTabListContextValues.js +2 -0
  17. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  18. package/lib-amd/Tab.js +6 -0
  19. package/lib-amd/Tab.js.map +1 -0
  20. package/lib-amd/TabList.js +6 -0
  21. package/lib-amd/TabList.js.map +1 -0
  22. package/lib-amd/components/Tab/Tab.js +15 -0
  23. package/lib-amd/components/Tab/Tab.js.map +1 -0
  24. package/lib-amd/components/Tab/Tab.types.js +5 -0
  25. package/lib-amd/components/Tab/Tab.types.js.map +1 -0
  26. package/lib-amd/components/Tab/index.js +11 -0
  27. package/lib-amd/components/Tab/index.js.map +1 -0
  28. package/lib-amd/components/Tab/renderTab.js +17 -0
  29. package/lib-amd/components/Tab/renderTab.js.map +1 -0
  30. package/lib-amd/components/Tab/useTab.js +63 -0
  31. package/lib-amd/components/Tab/useTab.js.map +1 -0
  32. package/lib-amd/components/Tab/useTabAnimatedIndicator.js +112 -0
  33. package/lib-amd/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  34. package/lib-amd/components/Tab/useTabStyles.js +380 -0
  35. package/lib-amd/components/Tab/useTabStyles.js.map +1 -0
  36. package/lib-amd/components/TabList/TabList.js +16 -0
  37. package/lib-amd/components/TabList/TabList.js.map +1 -0
  38. package/lib-amd/components/TabList/TabList.types.js +5 -0
  39. package/lib-amd/components/TabList/TabList.types.js.map +1 -0
  40. package/lib-amd/components/TabList/TabListContext.js +29 -0
  41. package/lib-amd/components/TabList/TabListContext.js.map +1 -0
  42. package/lib-amd/components/TabList/index.js +10 -0
  43. package/lib-amd/components/TabList/index.js.map +1 -0
  44. package/lib-amd/components/TabList/renderTabList.js +15 -0
  45. package/lib-amd/components/TabList/renderTabList.js.map +1 -0
  46. package/lib-amd/components/TabList/useTabList.js +74 -0
  47. package/lib-amd/components/TabList/useTabList.js.map +1 -0
  48. package/lib-amd/components/TabList/useTabListContextValues.js +23 -0
  49. package/lib-amd/components/TabList/useTabListContextValues.js.map +1 -0
  50. package/lib-amd/components/TabList/useTabListStyles.js +39 -0
  51. package/lib-amd/components/TabList/useTabListStyles.js.map +1 -0
  52. package/lib-amd/index.js +16 -0
  53. package/lib-amd/index.js.map +1 -0
  54. package/lib-commonjs/components/Tab/renderTab.js +2 -0
  55. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  56. package/lib-commonjs/components/Tab/useTab.js +2 -0
  57. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  58. package/lib-commonjs/components/Tab/useTabStyles.js +125 -37
  59. package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
  60. package/lib-commonjs/components/TabList/TabListContext.js +1 -0
  61. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  62. package/lib-commonjs/components/TabList/useTabList.js +2 -0
  63. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  64. package/lib-commonjs/components/TabList/useTabListContextValues.js +2 -0
  65. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  66. package/package.json +6 -6
@@ -0,0 +1,380 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-tabster", "@fluentui/react-theme", "./useTabAnimatedIndicator"], function (require, exports, tslib_1, react_1, react_tabster_1, react_theme_1, useTabAnimatedIndicator_1) {
2
+ "use strict";
3
+ var _a, _b;
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.useTabStyles_unstable = exports.tabClassNames = void 0;
6
+ exports.tabClassNames = {
7
+ root: 'fui-Tab',
8
+ icon: 'fui-Tab__icon',
9
+ content: 'fui-Tab__content',
10
+ };
11
+ var reservedSpaceClassNames = {
12
+ content: 'fui-Tab__content--reserved-space',
13
+ };
14
+ // These should match the constants defined in @fluentui/react-icons
15
+ // This package avoids taking a dependency on the icons package for only the constants.
16
+ var iconClassNames = {
17
+ filled: 'fui-Icon-filled',
18
+ regular: 'fui-Icon-regular',
19
+ };
20
+ /**
21
+ * Styles for the root slot
22
+ */
23
+ /* eslint-disable @typescript-eslint/naming-convention */
24
+ var useRootStyles = react_1.makeStyles({
25
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ alignItems: 'center' }, react_1.shorthands.borderColor('none')), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)), react_1.shorthands.borderWidth(0)), { cursor: 'pointer', display: 'grid', flexShrink: 0, gridAutoFlow: 'column', gridTemplateColumns: 'auto', gridTemplateRows: 'auto', fontFamily: react_theme_1.tokens.fontFamilyBase, lineHeight: react_theme_1.tokens.lineHeightBase300, outlineStyle: 'none', position: 'relative' }), react_1.shorthands.overflow('hidden')), { textTransform: 'none' }),
26
+ horizontal: {
27
+ justifyContent: 'center',
28
+ },
29
+ vertical: {
30
+ justifyContent: 'start',
31
+ },
32
+ smallHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalXXS }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalSNudge, react_theme_1.tokens.spacingHorizontalSNudge)),
33
+ smallVertical: tslib_1.__assign({
34
+ // horizontal spacing is deliberate. This is the gap between icon and content.
35
+ columnGap: react_theme_1.tokens.spacingHorizontalXXS }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalXXS, react_theme_1.tokens.spacingHorizontalSNudge)),
36
+ mediumHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalM, react_theme_1.tokens.spacingHorizontalMNudge)),
37
+ mediumVertical: tslib_1.__assign({
38
+ // horizontal spacing is deliberate. This is the gap between icon and content.
39
+ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalSNudge, react_theme_1.tokens.spacingHorizontalMNudge)),
40
+ largeHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalL, react_theme_1.tokens.spacingHorizontalMNudge)),
41
+ largeVertical: tslib_1.__assign({
42
+ // horizontal spacing is deliberate. This is the gap between icon and content.
43
+ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalMNudge)),
44
+ transparent: {
45
+ backgroundColor: react_theme_1.tokens.colorTransparentBackground,
46
+ ':hover': {
47
+ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundHover,
48
+ },
49
+ ':active': {
50
+ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundPressed,
51
+ },
52
+ '& .fui-Tab__icon': {
53
+ color: react_theme_1.tokens.colorNeutralForeground2,
54
+ },
55
+ ':hover .fui-Tab__icon': {
56
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
57
+ },
58
+ ':active .fui-Tab__icon': {
59
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
60
+ },
61
+ '& .fui-Tab__content': {
62
+ color: react_theme_1.tokens.colorNeutralForeground2,
63
+ },
64
+ ':hover .fui-Tab__content': {
65
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
66
+ },
67
+ ':active .fui-Tab__content': {
68
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
69
+ },
70
+ },
71
+ subtle: {
72
+ backgroundColor: react_theme_1.tokens.colorSubtleBackground,
73
+ ':hover': {
74
+ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundHover,
75
+ },
76
+ ':active': {
77
+ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundPressed,
78
+ },
79
+ '& .fui-Tab__icon': {
80
+ color: react_theme_1.tokens.colorNeutralForeground2,
81
+ },
82
+ ':hover .fui-Tab__icon': {
83
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
84
+ },
85
+ ':active .fui-Tab__icon': {
86
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
87
+ },
88
+ '& .fui-Tab__content': {
89
+ color: react_theme_1.tokens.colorNeutralForeground2,
90
+ },
91
+ ':hover .fui-Tab__content': {
92
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
93
+ },
94
+ ':active .fui-Tab__content': {
95
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
96
+ },
97
+ },
98
+ disabled: {
99
+ backgroundColor: react_theme_1.tokens.colorTransparentBackground,
100
+ '& .fui-Tab__icon': {
101
+ color: react_theme_1.tokens.colorNeutralForegroundDisabled,
102
+ },
103
+ '& .fui-Tab__content': {
104
+ color: react_theme_1.tokens.colorNeutralForegroundDisabled,
105
+ },
106
+ cursor: 'not-allowed',
107
+ },
108
+ selected: {
109
+ '& .fui-Tab__icon': {
110
+ color: react_theme_1.tokens.colorCompoundBrandForeground1,
111
+ },
112
+ ':hover .fui-Tab__icon': {
113
+ color: react_theme_1.tokens.colorCompoundBrandForeground1Hover,
114
+ },
115
+ ':active .fui-Tab__icon': {
116
+ color: react_theme_1.tokens.colorCompoundBrandForeground1Pressed,
117
+ },
118
+ '& .fui-Tab__content': {
119
+ color: react_theme_1.tokens.colorNeutralForeground1,
120
+ },
121
+ ':hover .fui-Tab__content': {
122
+ color: react_theme_1.tokens.colorNeutralForeground1Hover,
123
+ },
124
+ ':active .fui-Tab__content': {
125
+ color: react_theme_1.tokens.colorNeutralForeground1Pressed,
126
+ },
127
+ },
128
+ });
129
+ /* eslint-enable @typescript-eslint/naming-convention */
130
+ /**
131
+ * Focus styles for the root slot
132
+ */
133
+ var useFocusStyles = react_1.makeStyles({
134
+ // Tab creates a custom focus indicator because the default focus indicator
135
+ // is applied using an ::after pseudo-element on the root. Since the selection
136
+ // indicator uses an ::after pseudo-element on the root, there is a conflict.
137
+ base: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor('transparent')), { outlineWidth: react_theme_1.tokens.strokeWidthThick, outlineColor: 'transparent', outlineStyle: 'solid', boxShadow: "\n " + react_theme_1.tokens.shadow4 + ",\n 0 0 0 " + react_theme_1.tokens.strokeWidthThick + " " + react_theme_1.tokens.colorStrokeFocus2 + "\n ", zIndex: 1 })),
138
+ });
139
+ /** Indicator styles for when pending selection */
140
+ var usePendingIndicatorStyles = react_1.makeStyles({
141
+ base: {
142
+ ':hover::before': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralStroke1Hover }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute' }),
143
+ ':active::before': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralStroke1Pressed }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute' }),
144
+ '@media (forced-colors: active)': {
145
+ ':hover::before': {
146
+ backgroundColor: 'Highlight',
147
+ },
148
+ ':active::before': {
149
+ backgroundColor: 'Highlight',
150
+ },
151
+ },
152
+ },
153
+ disabled: {
154
+ ':hover::before': {
155
+ backgroundColor: react_theme_1.tokens.colorTransparentStroke,
156
+ },
157
+ ':active::before': {
158
+ backgroundColor: react_theme_1.tokens.colorTransparentStroke,
159
+ },
160
+ },
161
+ smallHorizontal: {
162
+ '::before': {
163
+ bottom: 0,
164
+ height: react_theme_1.tokens.strokeWidthThick,
165
+ left: react_theme_1.tokens.spacingHorizontalSNudge,
166
+ right: react_theme_1.tokens.spacingHorizontalSNudge,
167
+ },
168
+ },
169
+ smallVertical: {
170
+ '::before': {
171
+ bottom: react_theme_1.tokens.spacingVerticalXS,
172
+ left: 0,
173
+ top: react_theme_1.tokens.spacingVerticalXS,
174
+ width: react_theme_1.tokens.strokeWidthThicker,
175
+ },
176
+ },
177
+ mediumHorizontal: {
178
+ '::before': {
179
+ bottom: 0,
180
+ height: react_theme_1.tokens.strokeWidthThicker,
181
+ left: react_theme_1.tokens.spacingHorizontalM,
182
+ right: react_theme_1.tokens.spacingHorizontalM,
183
+ },
184
+ },
185
+ mediumVertical: {
186
+ '::before': {
187
+ bottom: react_theme_1.tokens.spacingVerticalS,
188
+ left: 0,
189
+ top: react_theme_1.tokens.spacingVerticalS,
190
+ width: react_theme_1.tokens.strokeWidthThicker,
191
+ },
192
+ },
193
+ largeHorizontal: {
194
+ '::before': {
195
+ bottom: 0,
196
+ height: react_theme_1.tokens.strokeWidthThicker,
197
+ left: react_theme_1.tokens.spacingHorizontalM,
198
+ right: react_theme_1.tokens.spacingHorizontalM,
199
+ },
200
+ },
201
+ largeVertical: {
202
+ '::before': {
203
+ bottom: react_theme_1.tokens.spacingVerticalMNudge,
204
+ left: 0,
205
+ top: react_theme_1.tokens.spacingVerticalMNudge,
206
+ width: react_theme_1.tokens.strokeWidthThicker,
207
+ },
208
+ },
209
+ });
210
+ var useActiveIndicatorStyles = react_1.makeStyles({
211
+ base: {
212
+ '::after': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentStroke }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute', zIndex: 1 }),
213
+ },
214
+ selected: {
215
+ '::after': {
216
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStroke,
217
+ },
218
+ ':hover::after': {
219
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStrokeHover,
220
+ },
221
+ ':active::after': {
222
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
223
+ },
224
+ '@media (forced-colors: active)': {
225
+ '::after': {
226
+ backgroundColor: 'ButtonText',
227
+ },
228
+ ':hover::after': {
229
+ backgroundColor: 'ButtonText',
230
+ },
231
+ ':active::after': {
232
+ backgroundColor: 'ButtonText',
233
+ },
234
+ },
235
+ },
236
+ disabled: {
237
+ '::after': {
238
+ backgroundColor: react_theme_1.tokens.colorNeutralForegroundDisabled,
239
+ },
240
+ },
241
+ smallHorizontal: {
242
+ '::after': {
243
+ bottom: 0,
244
+ height: react_theme_1.tokens.strokeWidthThick,
245
+ left: react_theme_1.tokens.spacingHorizontalSNudge,
246
+ right: react_theme_1.tokens.spacingHorizontalSNudge,
247
+ },
248
+ },
249
+ smallVertical: {
250
+ '::after': {
251
+ bottom: react_theme_1.tokens.spacingVerticalXS,
252
+ left: '0',
253
+ top: react_theme_1.tokens.spacingVerticalXS,
254
+ width: react_theme_1.tokens.strokeWidthThicker,
255
+ },
256
+ },
257
+ mediumHorizontal: {
258
+ '::after': {
259
+ bottom: '0',
260
+ height: react_theme_1.tokens.strokeWidthThicker,
261
+ left: react_theme_1.tokens.spacingHorizontalM,
262
+ right: react_theme_1.tokens.spacingHorizontalM,
263
+ },
264
+ },
265
+ mediumVertical: {
266
+ '::after': {
267
+ bottom: react_theme_1.tokens.spacingVerticalS,
268
+ left: 0,
269
+ top: react_theme_1.tokens.spacingVerticalS,
270
+ width: react_theme_1.tokens.strokeWidthThicker,
271
+ },
272
+ },
273
+ largeHorizontal: {
274
+ '::after': {
275
+ bottom: 0,
276
+ height: react_theme_1.tokens.strokeWidthThicker,
277
+ left: react_theme_1.tokens.spacingHorizontalM,
278
+ right: react_theme_1.tokens.spacingHorizontalM,
279
+ },
280
+ },
281
+ largeVertical: {
282
+ '::after': {
283
+ bottom: react_theme_1.tokens.spacingVerticalMNudge,
284
+ left: 0,
285
+ top: react_theme_1.tokens.spacingVerticalMNudge,
286
+ width: react_theme_1.tokens.strokeWidthThicker,
287
+ },
288
+ },
289
+ });
290
+ /**
291
+ * Styles for the icon slot.
292
+ */
293
+ var useIconStyles = react_1.makeStyles({
294
+ base: tslib_1.__assign(tslib_1.__assign({ gridColumnStart: 1, gridRowStart: 1, alignItems: 'center', display: 'inline-flex', justifyContent: 'center' }, react_1.shorthands.overflow('hidden')), (_a = {}, _a["& ." + iconClassNames.filled] = {
295
+ display: 'none',
296
+ }, _a["& ." + iconClassNames.regular] = {
297
+ display: 'inline',
298
+ }, _a)),
299
+ // per design, the small and medium font sizes are the same.
300
+ // the size prop only affects spacing.
301
+ small: {
302
+ fontSize: '20px',
303
+ height: '20px',
304
+ width: '20px',
305
+ },
306
+ medium: {
307
+ fontSize: '20px',
308
+ height: '20px',
309
+ width: '20px',
310
+ },
311
+ large: {
312
+ fontSize: '24px',
313
+ height: '24px',
314
+ width: '24px',
315
+ },
316
+ selected: (_b = {},
317
+ _b["& ." + iconClassNames.filled] = {
318
+ display: 'inline',
319
+ },
320
+ _b["& ." + iconClassNames.regular] = {
321
+ display: 'none',
322
+ },
323
+ _b),
324
+ });
325
+ /**
326
+ * Styles for the content slot (children)
327
+ */
328
+ var useContentStyles = react_1.makeStyles({
329
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, react_theme_1.typographyStyles.body1), react_1.shorthands.overflow('hidden')), react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalNone, react_theme_1.tokens.spacingHorizontalXXS)),
330
+ selected: tslib_1.__assign({}, react_theme_1.typographyStyles.body1Strong),
331
+ large: tslib_1.__assign({}, react_theme_1.typographyStyles.body2),
332
+ largeSelected: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle2),
333
+ noIconBefore: {
334
+ gridColumnStart: 1,
335
+ gridRowStart: 1,
336
+ },
337
+ iconBefore: {
338
+ gridColumnStart: 2,
339
+ gridRowStart: 1,
340
+ },
341
+ placeholder: {
342
+ visibility: 'hidden',
343
+ },
344
+ });
345
+ /**
346
+ * Apply styling to the Tab slots based on the state
347
+ */
348
+ var useTabStyles_unstable = function (state) {
349
+ var rootStyles = useRootStyles();
350
+ var focusStyles = useFocusStyles();
351
+ var pendingIndicatorStyles = usePendingIndicatorStyles();
352
+ var activeIndicatorStyles = useActiveIndicatorStyles();
353
+ var iconStyles = useIconStyles();
354
+ var contentStyles = useContentStyles();
355
+ var appearance = state.appearance, disabled = state.disabled, selected = state.selected, size = state.size, vertical = state.vertical;
356
+ state.root.className = react_1.mergeClasses(exports.tabClassNames.root, rootStyles.base, vertical ? rootStyles.vertical : rootStyles.horizontal, size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal), size === 'medium' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal), size === 'large' && (vertical ? rootStyles.largeVertical : rootStyles.largeHorizontal), focusStyles.base, !disabled && appearance === 'subtle' && rootStyles.subtle, !disabled && appearance === 'transparent' && rootStyles.transparent, !disabled && selected && rootStyles.selected, disabled && rootStyles.disabled,
357
+ // pending indicator (before pseudo element)
358
+ pendingIndicatorStyles.base, size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal), size === 'medium' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal), size === 'large' && (vertical ? pendingIndicatorStyles.largeVertical : pendingIndicatorStyles.largeHorizontal), disabled && pendingIndicatorStyles.disabled,
359
+ // active indicator (after pseudo element)
360
+ selected && activeIndicatorStyles.base, selected && !disabled && activeIndicatorStyles.selected, selected &&
361
+ size === 'small' &&
362
+ (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal), selected &&
363
+ size === 'medium' &&
364
+ (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal), selected &&
365
+ size === 'large' &&
366
+ (vertical ? activeIndicatorStyles.largeVertical : activeIndicatorStyles.largeHorizontal), selected && disabled && activeIndicatorStyles.disabled, state.root.className);
367
+ if (state.icon) {
368
+ state.icon.className = react_1.mergeClasses(exports.tabClassNames.icon, iconStyles.base, iconStyles[size], selected && iconStyles.selected, state.icon.className);
369
+ }
370
+ // This needs to be before state.content.className is updated
371
+ if (state.contentReservedSpaceClassName !== undefined) {
372
+ state.contentReservedSpaceClassName = react_1.mergeClasses(reservedSpaceClassNames.content, contentStyles.base, size === 'large' ? contentStyles.largeSelected : contentStyles.selected, state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, contentStyles.placeholder, state.content.className);
373
+ }
374
+ state.content.className = react_1.mergeClasses(exports.tabClassNames.content, contentStyles.base, size === 'large' && contentStyles.large, selected && (size === 'large' ? contentStyles.largeSelected : contentStyles.selected), state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, state.content.className);
375
+ useTabAnimatedIndicator_1.useTabAnimatedIndicatorStyles_unstable(state);
376
+ return state;
377
+ };
378
+ exports.useTabStyles_unstable = useTabStyles_unstable;
379
+ });
380
+ //# sourceMappingURL=useTabStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/useTabStyles.ts"],"names":[],"mappings":";;;;;IAQa,QAAA,aAAa,GAA6B;QACrD,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IAEF,IAAM,uBAAuB,GAAG;QAC9B,OAAO,EAAE,kCAAkC;KAC5C,CAAC;IAEF,oEAAoE;IACpE,uFAAuF;IACvF,IAAM,cAAc,GAAG;QACrB,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IAEF;;OAEG;IACH,yDAAyD;IACzD,IAAM,aAAa,GAAG,kBAAU,CAAC;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Aa,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,EACrF,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,EAClE,KAAK,CAAC,OAAO,CAAC,SAAS,CACxB,CAAC;QAEF,gEAAsC,CAAC,KAAK,CAAC,CAAC;QAE9C,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjFW,QAAA,qBAAqB,yBAiFhC","sourcesContent":["import type { TabSlots, TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTabAnimatedIndicatorStyles_unstable } from './useTabAnimatedIndicator';\n\nexport const tabClassNames: SlotClassNames<TabSlots> = {\n root: 'fui-Tab',\n icon: 'fui-Tab__icon',\n content: 'fui-Tab__content',\n};\n\nconst reservedSpaceClassNames = {\n content: 'fui-Tab__content--reserved-space',\n};\n\n// These should match the constants defined in @fluentui/react-icons\n// This package avoids taking a dependency on the icons package for only the constants.\nconst iconClassNames = {\n filled: 'fui-Icon-filled',\n regular: 'fui-Icon-regular',\n};\n\n/**\n * Styles for the root slot\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n ...shorthands.borderColor('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderWidth(0),\n cursor: 'pointer',\n display: 'grid',\n flexShrink: 0,\n gridAutoFlow: 'column',\n gridTemplateColumns: 'auto',\n gridTemplateRows: 'auto',\n fontFamily: tokens.fontFamilyBase,\n lineHeight: tokens.lineHeightBase300,\n outlineStyle: 'none',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n textTransform: 'none',\n },\n horizontal: {\n justifyContent: 'center',\n },\n vertical: {\n justifyContent: 'start',\n },\n smallHorizontal: {\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalSNudge),\n },\n smallVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalXXS, tokens.spacingHorizontalSNudge),\n },\n mediumHorizontal: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalM, tokens.spacingHorizontalMNudge),\n },\n mediumVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalMNudge),\n },\n largeHorizontal: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalL, tokens.spacingHorizontalMNudge),\n },\n largeVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalMNudge),\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n cursor: 'not-allowed',\n },\n selected: {\n '& .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground1,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n});\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Focus styles for the root slot\n */\nconst useFocusStyles = makeStyles({\n // Tab creates a custom focus indicator because the default focus indicator\n // is applied using an ::after pseudo-element on the root. Since the selection\n // indicator uses an ::after pseudo-element on the root, there is a conflict.\n base: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineWidth: tokens.strokeWidthThick,\n outlineColor: 'transparent',\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n});\n\n/** Indicator styles for when pending selection */\nconst usePendingIndicatorStyles = makeStyles({\n base: {\n ':hover::before': {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n ':active::before': {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n '@media (forced-colors: active)': {\n ':hover::before': {\n backgroundColor: 'Highlight',\n },\n ':active::before': {\n backgroundColor: 'Highlight',\n },\n },\n },\n disabled: {\n ':hover::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n ':active::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n },\n smallHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::before': {\n bottom: tokens.spacingVerticalXS,\n left: 0,\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n mediumHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::before': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n largeHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n largeVertical: {\n '::before': {\n bottom: tokens.spacingVerticalMNudge,\n left: 0,\n top: tokens.spacingVerticalMNudge,\n width: tokens.strokeWidthThicker,\n },\n },\n});\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n '::after': {\n backgroundColor: tokens.colorTransparentStroke,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n zIndex: 1,\n },\n },\n selected: {\n '::after': {\n backgroundColor: tokens.colorCompoundBrandStroke,\n },\n ':hover::after': {\n backgroundColor: tokens.colorCompoundBrandStrokeHover,\n },\n ':active::after': {\n backgroundColor: tokens.colorCompoundBrandStrokePressed,\n },\n '@media (forced-colors: active)': {\n '::after': {\n backgroundColor: 'ButtonText',\n },\n ':hover::after': {\n backgroundColor: 'ButtonText',\n },\n ':active::after': {\n backgroundColor: 'ButtonText',\n },\n },\n },\n disabled: {\n '::after': {\n backgroundColor: tokens.colorNeutralForegroundDisabled,\n },\n },\n smallHorizontal: {\n '::after': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::after': {\n bottom: tokens.spacingVerticalXS,\n left: '0',\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n mediumHorizontal: {\n '::after': {\n bottom: '0',\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::after': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n largeHorizontal: {\n '::after': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n largeVertical: {\n '::after': {\n bottom: tokens.spacingVerticalMNudge,\n left: 0,\n top: tokens.spacingVerticalMNudge,\n width: tokens.strokeWidthThicker,\n },\n },\n});\n\n/**\n * Styles for the icon slot.\n */\nconst useIconStyles = makeStyles({\n base: {\n gridColumnStart: 1,\n gridRowStart: 1,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n ...shorthands.overflow('hidden'),\n [`& .${iconClassNames.filled}`]: {\n display: 'none',\n },\n [`& .${iconClassNames.regular}`]: {\n display: 'inline',\n },\n },\n // per design, the small and medium font sizes are the same.\n // the size prop only affects spacing.\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n selected: {\n [`& .${iconClassNames.filled}`]: {\n display: 'inline',\n },\n [`& .${iconClassNames.regular}`]: {\n display: 'none',\n },\n },\n});\n\n/**\n * Styles for the content slot (children)\n */\nconst useContentStyles = makeStyles({\n base: {\n ...typographyStyles.body1,\n ...shorthands.overflow('hidden'),\n // content padding is the same for medium & small, horiztonal & vertical\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalXXS),\n },\n selected: {\n ...typographyStyles.body1Strong,\n },\n large: {\n ...typographyStyles.body2,\n },\n largeSelected: {\n ...typographyStyles.subtitle2,\n },\n noIconBefore: {\n gridColumnStart: 1,\n gridRowStart: 1,\n },\n iconBefore: {\n gridColumnStart: 2,\n gridRowStart: 1,\n },\n placeholder: {\n visibility: 'hidden',\n },\n});\n\n/**\n * Apply styling to the Tab slots based on the state\n */\nexport const useTabStyles_unstable = (state: TabState): TabState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const pendingIndicatorStyles = usePendingIndicatorStyles();\n const activeIndicatorStyles = useActiveIndicatorStyles();\n const iconStyles = useIconStyles();\n const contentStyles = useContentStyles();\n\n const { appearance, disabled, selected, size, vertical } = state;\n\n state.root.className = mergeClasses(\n tabClassNames.root,\n rootStyles.base,\n vertical ? rootStyles.vertical : rootStyles.horizontal,\n size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal),\n size === 'medium' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal),\n size === 'large' && (vertical ? rootStyles.largeVertical : rootStyles.largeHorizontal),\n focusStyles.base,\n !disabled && appearance === 'subtle' && rootStyles.subtle,\n !disabled && appearance === 'transparent' && rootStyles.transparent,\n !disabled && selected && rootStyles.selected,\n disabled && rootStyles.disabled,\n\n // pending indicator (before pseudo element)\n pendingIndicatorStyles.base,\n size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal),\n size === 'medium' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal),\n size === 'large' && (vertical ? pendingIndicatorStyles.largeVertical : pendingIndicatorStyles.largeHorizontal),\n disabled && pendingIndicatorStyles.disabled,\n\n // active indicator (after pseudo element)\n selected && activeIndicatorStyles.base,\n selected && !disabled && activeIndicatorStyles.selected,\n selected &&\n size === 'small' &&\n (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal),\n selected &&\n size === 'medium' &&\n (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal),\n selected &&\n size === 'large' &&\n (vertical ? activeIndicatorStyles.largeVertical : activeIndicatorStyles.largeHorizontal),\n selected && disabled && activeIndicatorStyles.disabled,\n\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n tabClassNames.icon,\n iconStyles.base,\n iconStyles[size],\n selected && iconStyles.selected,\n state.icon.className,\n );\n }\n\n // This needs to be before state.content.className is updated\n if (state.contentReservedSpaceClassName !== undefined) {\n state.contentReservedSpaceClassName = mergeClasses(\n reservedSpaceClassNames.content,\n contentStyles.base,\n size === 'large' ? contentStyles.largeSelected : contentStyles.selected,\n state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore,\n contentStyles.placeholder,\n state.content.className,\n );\n }\n\n state.content.className = mergeClasses(\n tabClassNames.content,\n contentStyles.base,\n size === 'large' && contentStyles.large,\n selected && (size === 'large' ? contentStyles.largeSelected : contentStyles.selected),\n state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore,\n state.content.className,\n );\n\n useTabAnimatedIndicatorStyles_unstable(state);\n\n return state;\n};\n"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "react", "./useTabList", "./renderTabList", "./useTabListStyles", "./useTabListContextValues"], function (require, exports, React, useTabList_1, renderTabList_1, useTabListStyles_1, useTabListContextValues_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TabList = void 0;
5
+ /**
6
+ * A tab list provides single selection from a set of tabs.
7
+ */
8
+ exports.TabList = React.forwardRef(function (props, ref) {
9
+ var state = useTabList_1.useTabList_unstable(props, ref);
10
+ var contextValues = useTabListContextValues_1.useTabListContextValues(state);
11
+ useTabListStyles_1.useTabListStyles_unstable(state);
12
+ return renderTabList_1.renderTabList_unstable(state, contextValues);
13
+ });
14
+ exports.TabList.displayName = 'TabList';
15
+ });
16
+ //# sourceMappingURL=TabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabList.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,OAAO,GAAsC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACpF,IAAM,KAAK,GAAG,gCAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAM,aAAa,GAAG,iDAAuB,CAAC,KAAK,CAAC,CAAC;QAErD,4CAAyB,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,sCAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,eAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import * as React from 'react';\nimport { useTabList_unstable } from './useTabList';\nimport { renderTabList_unstable } from './renderTabList';\nimport { useTabListStyles_unstable } from './useTabListStyles';\nimport type { TabListProps } from './TabList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTabListContextValues } from './useTabListContextValues';\n\n/**\n * A tab list provides single selection from a set of tabs.\n */\nexport const TabList: ForwardRefComponent<TabListProps> = React.forwardRef((props, ref) => {\n const state = useTabList_unstable(props, ref);\n const contextValues = useTabListContextValues(state);\n\n useTabListStyles_unstable(state);\n return renderTabList_unstable(state, contextValues);\n});\n\nTabList.displayName = 'TabList';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=TabList.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabList.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TabValue } from '../Tab/Tab.types';\n\nexport type TabRegisterData = {\n /**\n * The value of the tab.\n */\n value: TabValue;\n\n /**\n * The reference to the tab HTML element.\n */\n ref: React.RefObject<HTMLElement>;\n};\n\nexport type RegisterTabEventHandler = (data: TabRegisterData) => void;\n\nexport type SelectTabData = {\n /**\n * The value of the selected tab.\n */\n value: TabValue;\n};\n\nexport type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;\n\nexport type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;\n\nexport type TabListSlots = {\n /**\n * The slot associated with the root element of this tab list.\n */\n root: Slot<'div'>;\n};\n\n/**\n * TabList Props\n */\nexport type TabListProps = ComponentProps<TabListSlots> & {\n /**\n * A tab list can supports 'transparent' and 'subtle' appearance.\n *- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n *- 'transparent': No background and border styling\n * The appearance affects each of the contained tabs.\n * @default 'transparent'\n */\n appearance?: 'transparent' | 'subtle';\n\n /**\n * Tab size may change between unselected and selected states.\n * The default scenario is a selected tab has bold text.\n *\n * When true, this property requests tabs be the same size whether unselected or selected.\n * @default true\n */\n reserveSelectedTabSpace?: boolean;\n\n /**\n * The value of the tab to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n */\n defaultSelectedValue?: TabValue;\n /**\n * A tab list can be set to disable interaction.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Raised when a tab is selected.\n */\n onTabSelect?: SelectTabEventHandler;\n\n /**\n * The value of the currently selected tab.\n */\n selectedValue?: TabValue;\n\n /**\n * A tab list can be either 'small', 'medium', or 'large' size.\n * The size affects each of the contained tabs.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A tab list can arrange its tabs vertically.\n * @default false\n */\n vertical?: boolean;\n};\n\nexport type TabListContextValue = Pick<TabListProps, 'onTabSelect' | 'selectedValue' | 'reserveSelectedTabSpace'> &\n Required<Pick<TabListProps, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {\n /** A callback to allow a tab to register itself with the tab list. */\n onRegister: RegisterTabEventHandler;\n\n /** A callback to allow a tab to unregister itself with the tab list. */\n onUnregister: RegisterTabEventHandler;\n /**\n * A callback to allow a tab to select itself when pressed.\n */\n onSelect: SelectTabEventHandler;\n /**\n * Gets the registered tab data along with current and previous selected values.\n */\n getRegisteredTabs: () => {\n selectedValue?: TabValue;\n previousSelectedValue?: TabValue;\n registeredTabs: Record<string, TabRegisterData>;\n };\n };\n\n/**\n * Context values used in rendering TabList.\n */\nexport type TabListContextValues = {\n /**\n * The context of the tab list available to each tab.\n */\n tabList: TabListContextValue;\n};\n\n/**\n * State used in rendering TabList.\n */\nexport type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue;\n"]}
@@ -0,0 +1,29 @@
1
+ define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TabListContext = void 0;
5
+ // eslint-disable-next-line @fluentui/no-context-default-value
6
+ exports.TabListContext = react_context_selector_1.createContext({
7
+ appearance: 'transparent',
8
+ reserveSelectedTabSpace: true,
9
+ disabled: false,
10
+ selectedValue: undefined,
11
+ onRegister: function () {
12
+ /* noop */
13
+ },
14
+ onUnregister: function () {
15
+ /* noop */
16
+ },
17
+ onSelect: function () {
18
+ /* noop */
19
+ },
20
+ getRegisteredTabs: function () {
21
+ return {
22
+ registeredTabs: {},
23
+ };
24
+ },
25
+ size: 'medium',
26
+ vertical: false,
27
+ });
28
+ });
29
+ //# sourceMappingURL=TabListContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabListContext.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabListContext.ts"],"names":[],"mappings":";;;;IAIA,8DAA8D;IACjD,QAAA,cAAc,GAAiC,sCAAa,CAAsB;QAC7F,UAAU,EAAE,aAAa;QACzB,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,SAAS;QACxB,UAAU,EAAE;YACV,UAAU;QACZ,CAAC;QACD,YAAY,EAAE;YACZ,UAAU;QACZ,CAAC;QACD,QAAQ,EAAE;YACR,UAAU;QACZ,CAAC;QACD,iBAAiB,EAAE;YACjB,OAAO;gBACL,cAAc,EAAE,EAAE;aACnB,CAAC;QACJ,CAAC;QACD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC","sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\n// eslint-disable-next-line @fluentui/no-context-default-value\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue>({\n appearance: 'transparent',\n reserveSelectedTabSpace: true,\n disabled: false,\n selectedValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n getRegisteredTabs: () => {\n return {\n registeredTabs: {},\n };\n },\n size: 'medium',\n vertical: false,\n});\n"]}
@@ -0,0 +1,10 @@
1
+ define(["require", "exports", "tslib", "./TabList", "./TabList.types", "./renderTabList", "./useTabList", "./useTabListStyles"], function (require, exports, tslib_1, TabList_1, TabList_types_1, renderTabList_1, useTabList_1, useTabListStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(TabList_1, exports);
5
+ tslib_1.__exportStar(TabList_types_1, exports);
6
+ tslib_1.__exportStar(renderTabList_1, exports);
7
+ tslib_1.__exportStar(useTabList_1, exports);
8
+ tslib_1.__exportStar(useTabListStyles_1, exports);
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/index.ts"],"names":[],"mappings":";;;IAAA,yCAA0B;IAC1B,+CAAgC;IAChC,+CAAgC;IAChC,4CAA6B;IAC7B,kDAAmC","sourcesContent":["export * from './TabList';\nexport * from './TabList.types';\nexport * from './renderTabList';\nexport * from './useTabList';\nexport * from './useTabListStyles';\n"]}
@@ -0,0 +1,15 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./TabListContext"], function (require, exports, tslib_1, React, react_utilities_1, TabListContext_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderTabList_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of TabList
7
+ */
8
+ var renderTabList_unstable = function (state, contextValues) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ React.createElement(TabListContext_1.TabListContext.Provider, { value: contextValues.tabList }, state.root.children)));
12
+ };
13
+ exports.renderTabList_unstable = renderTabList_unstable;
14
+ });
15
+ //# sourceMappingURL=renderTabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTabList.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/renderTabList.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAmB,EAAE,aAAmC;QACvF,IAAA,KAAuB,0BAAQ,CAAe,KAAK,CAAC,EAAlD,KAAK,WAAA,EAAE,SAAS,eAAkC,CAAC;QAE3D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,+BAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,CAAC,OAAO,IAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAA2B,CAC3F,CACd,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,sBAAsB,0BAQjC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListContext } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlots<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListContext.Provider value={contextValues.tabList}>{state.root.children}</TabListContext.Provider>\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,74 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-tabster", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_tabster_1, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTabList_unstable = void 0;
5
+ /**
6
+ * Create the state required to render TabList.
7
+ *
8
+ * The returned state can be modified with hooks such as useTabListStyles_unstable,
9
+ * before being passed to renderTabList_unstable.
10
+ *
11
+ * @param props - props from this instance of TabList
12
+ * @param ref - reference to root HTMLElement of TabList
13
+ */
14
+ var useTabList_unstable = function (props, ref) {
15
+ var _a = props.appearance, appearance = _a === void 0 ? 'transparent' : _a, _b = props.reserveSelectedTabSpace, reserveSelectedTabSpace = _b === void 0 ? true : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, onTabSelect = props.onTabSelect, _d = props.size, size = _d === void 0 ? 'medium' : _d, _e = props.vertical, vertical = _e === void 0 ? false : _e;
16
+ var innerRef = React.useRef(null);
17
+ var focusAttributes = react_tabster_1.useArrowNavigationGroup({
18
+ circular: true,
19
+ axis: vertical ? 'vertical' : 'horizontal',
20
+ memorizeCurrent: true,
21
+ });
22
+ var _f = react_utilities_1.useControllableState({
23
+ state: props.selectedValue,
24
+ defaultState: props.defaultSelectedValue,
25
+ initialState: undefined,
26
+ }), selectedValue = _f[0], setSelectedValue = _f[1];
27
+ // considered usePrevious, but it is sensitive to re-renders
28
+ // this could cause the previous to move to current in the case where the tab list re-renders.
29
+ // these refs avoid getRegisteredTabs changing when selectedValue changes and causing
30
+ // renders for tabs that have not changed.
31
+ var currentSelectedValue = React.useRef(undefined);
32
+ var previousSelectedValue = React.useRef(undefined);
33
+ React.useEffect(function () {
34
+ previousSelectedValue.current = currentSelectedValue.current;
35
+ currentSelectedValue.current = selectedValue;
36
+ }, [selectedValue]);
37
+ var onSelect = react_utilities_1.useEventCallback(function (event, data) {
38
+ setSelectedValue(data.value);
39
+ onTabSelect === null || onTabSelect === void 0 ? void 0 : onTabSelect(event, data);
40
+ });
41
+ var registeredTabs = React.useRef({});
42
+ var onRegister = react_utilities_1.useEventCallback(function (data) {
43
+ registeredTabs.current[JSON.stringify(data.value)] = data;
44
+ });
45
+ var onUnregister = react_utilities_1.useEventCallback(function (data) {
46
+ delete registeredTabs.current[JSON.stringify(data.value)];
47
+ });
48
+ var getRegisteredTabs = React.useCallback(function () {
49
+ return {
50
+ selectedValue: currentSelectedValue.current,
51
+ previousSelectedValue: previousSelectedValue.current,
52
+ registeredTabs: registeredTabs.current,
53
+ };
54
+ }, []);
55
+ return {
56
+ components: {
57
+ root: 'div',
58
+ },
59
+ root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({ ref: react_utilities_1.useMergedRefs(ref, innerRef), role: 'tablist' }, focusAttributes), props)),
60
+ appearance: appearance,
61
+ reserveSelectedTabSpace: reserveSelectedTabSpace,
62
+ disabled: disabled,
63
+ selectedValue: selectedValue,
64
+ size: size,
65
+ vertical: vertical,
66
+ onRegister: onRegister,
67
+ onUnregister: onUnregister,
68
+ onSelect: onSelect,
69
+ getRegisteredTabs: getRegisteredTabs,
70
+ };
71
+ };
72
+ exports.useTabList_unstable = useTabList_unstable;
73
+ });
74
+ //# sourceMappingURL=useTabList.js.map