@fluentui/react-tabs 9.8.3 → 9.9.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 (50) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/lib/Tab.js.map +1 -1
  3. package/lib/TabList.js.map +1 -1
  4. package/lib/components/Tab/Tab.js.map +1 -1
  5. package/lib/components/Tab/Tab.types.js.map +1 -1
  6. package/lib/components/Tab/index.js.map +1 -1
  7. package/lib/components/Tab/renderTab.js.map +1 -1
  8. package/lib/components/Tab/useTab.js.map +1 -1
  9. package/lib/components/Tab/useTabAnimatedIndicator.styles.raw.js +124 -0
  10. package/lib/components/Tab/useTabAnimatedIndicator.styles.raw.js.map +1 -0
  11. package/lib/components/Tab/useTabStyles.styles.js +17 -3
  12. package/lib/components/Tab/useTabStyles.styles.js.map +1 -1
  13. package/lib/components/Tab/useTabStyles.styles.raw.js +684 -0
  14. package/lib/components/Tab/useTabStyles.styles.raw.js.map +1 -0
  15. package/lib/components/TabList/TabList.js.map +1 -1
  16. package/lib/components/TabList/TabList.types.js.map +1 -1
  17. package/lib/components/TabList/TabListContext.js.map +1 -1
  18. package/lib/components/TabList/index.js.map +1 -1
  19. package/lib/components/TabList/renderTabList.js.map +1 -1
  20. package/lib/components/TabList/useTabList.js.map +1 -1
  21. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  22. package/lib/components/TabList/useTabListStyles.styles.raw.js +40 -0
  23. package/lib/components/TabList/useTabListStyles.styles.raw.js.map +1 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib-commonjs/Tab.js.map +1 -1
  26. package/lib-commonjs/TabList.js.map +1 -1
  27. package/lib-commonjs/components/Tab/Tab.js.map +1 -1
  28. package/lib-commonjs/components/Tab/Tab.types.js.map +1 -1
  29. package/lib-commonjs/components/Tab/index.js.map +1 -1
  30. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  31. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  32. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.styles.js.map +1 -1
  33. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.styles.raw.js +133 -0
  34. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.styles.raw.js.map +1 -0
  35. package/lib-commonjs/components/Tab/useTabStyles.styles.js +26 -2
  36. package/lib-commonjs/components/Tab/useTabStyles.styles.js.map +1 -1
  37. package/lib-commonjs/components/Tab/useTabStyles.styles.raw.js +680 -0
  38. package/lib-commonjs/components/Tab/useTabStyles.styles.raw.js.map +1 -0
  39. package/lib-commonjs/components/TabList/TabList.js.map +1 -1
  40. package/lib-commonjs/components/TabList/TabList.types.js.map +1 -1
  41. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  42. package/lib-commonjs/components/TabList/index.js.map +1 -1
  43. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
  44. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  45. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  46. package/lib-commonjs/components/TabList/useTabListStyles.styles.js.map +1 -1
  47. package/lib-commonjs/components/TabList/useTabListStyles.styles.raw.js +56 -0
  48. package/lib-commonjs/components/TabList/useTabListStyles.styles.raw.js.map +1 -0
  49. package/lib-commonjs/index.js.map +1 -1
  50. package/package.json +5 -5
@@ -0,0 +1,680 @@
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
+ tabClassNames: function() {
13
+ return tabClassNames;
14
+ },
15
+ useTabButtonStyles_unstable: function() {
16
+ return useTabButtonStyles_unstable;
17
+ },
18
+ useTabContentStyles_unstable: function() {
19
+ return useTabContentStyles_unstable;
20
+ },
21
+ useTabIndicatorStyles_unstable: function() {
22
+ return useTabIndicatorStyles_unstable;
23
+ },
24
+ useTabStyles_unstable: function() {
25
+ return useTabStyles_unstable;
26
+ }
27
+ });
28
+ const _react = require("@griffel/react");
29
+ const _reacttabster = require("@fluentui/react-tabster");
30
+ const _reacttheme = require("@fluentui/react-theme");
31
+ const _useTabAnimatedIndicatorstyles = require("./useTabAnimatedIndicator.styles");
32
+ const tabClassNames = {
33
+ root: 'fui-Tab',
34
+ icon: 'fui-Tab__icon',
35
+ content: 'fui-Tab__content'
36
+ };
37
+ const reservedSpaceClassNames = {
38
+ content: 'fui-Tab__content--reserved-space'
39
+ };
40
+ // These should match the constants defined in @fluentui/react-icons
41
+ // This package avoids taking a dependency on the icons package for only the constants.
42
+ const iconClassNames = {
43
+ filled: 'fui-Icon-filled',
44
+ regular: 'fui-Icon-regular'
45
+ };
46
+ /**
47
+ * Styles for the root slot
48
+ */ const useRootStyles = (0, _react.makeStyles)({
49
+ root: {
50
+ alignItems: 'center',
51
+ display: 'grid',
52
+ flexShrink: 0,
53
+ gridAutoFlow: 'column',
54
+ gridTemplateColumns: 'auto',
55
+ gridTemplateRows: 'auto',
56
+ outlineStyle: 'none',
57
+ position: 'relative'
58
+ },
59
+ button: {
60
+ alignItems: 'center',
61
+ border: 'none',
62
+ borderRadius: _reacttheme.tokens.borderRadiusMedium,
63
+ cursor: 'pointer',
64
+ display: 'grid',
65
+ flexShrink: 0,
66
+ gridAutoFlow: 'column',
67
+ gridTemplateColumns: 'auto',
68
+ gridTemplateRows: 'auto',
69
+ fontFamily: _reacttheme.tokens.fontFamilyBase,
70
+ lineHeight: _reacttheme.tokens.lineHeightBase300,
71
+ outlineStyle: 'none',
72
+ position: 'relative',
73
+ overflow: 'hidden',
74
+ textTransform: 'none'
75
+ },
76
+ horizontal: {
77
+ justifyContent: 'center'
78
+ },
79
+ vertical: {
80
+ justifyContent: 'start'
81
+ },
82
+ smallHorizontal: {
83
+ columnGap: _reacttheme.tokens.spacingHorizontalXXS,
84
+ padding: `${_reacttheme.tokens.spacingVerticalSNudge} ${_reacttheme.tokens.spacingHorizontalSNudge}`
85
+ },
86
+ smallVertical: {
87
+ // horizontal spacing is deliberate. This is the gap between icon and content.
88
+ columnGap: _reacttheme.tokens.spacingHorizontalXXS,
89
+ padding: `${_reacttheme.tokens.spacingVerticalXXS} ${_reacttheme.tokens.spacingHorizontalSNudge}`
90
+ },
91
+ mediumHorizontal: {
92
+ columnGap: _reacttheme.tokens.spacingHorizontalSNudge,
93
+ padding: `${_reacttheme.tokens.spacingVerticalM} ${_reacttheme.tokens.spacingHorizontalMNudge}`
94
+ },
95
+ mediumVertical: {
96
+ // horizontal spacing is deliberate. This is the gap between icon and content.
97
+ columnGap: _reacttheme.tokens.spacingHorizontalSNudge,
98
+ padding: `${_reacttheme.tokens.spacingVerticalSNudge} ${_reacttheme.tokens.spacingHorizontalMNudge}`
99
+ },
100
+ largeHorizontal: {
101
+ columnGap: _reacttheme.tokens.spacingHorizontalSNudge,
102
+ padding: `${_reacttheme.tokens.spacingVerticalL} ${_reacttheme.tokens.spacingHorizontalMNudge}`
103
+ },
104
+ largeVertical: {
105
+ // horizontal spacing is deliberate. This is the gap between icon and content.
106
+ columnGap: _reacttheme.tokens.spacingHorizontalSNudge,
107
+ padding: `${_reacttheme.tokens.spacingVerticalS} ${_reacttheme.tokens.spacingHorizontalMNudge}`
108
+ },
109
+ transparent: {
110
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
111
+ ':enabled:hover': {
112
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover
113
+ },
114
+ ':enabled:active': {
115
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed
116
+ },
117
+ [`& .${tabClassNames.icon}`]: {
118
+ color: _reacttheme.tokens.colorNeutralForeground2
119
+ },
120
+ [`:enabled:hover .${tabClassNames.icon}`]: {
121
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
122
+ },
123
+ [`:enabled:active .${tabClassNames.icon}`]: {
124
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
125
+ },
126
+ [`& .${tabClassNames.content}`]: {
127
+ color: _reacttheme.tokens.colorNeutralForeground2
128
+ },
129
+ [`:enabled:hover .${tabClassNames.content}`]: {
130
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
131
+ },
132
+ [`:enabled:active .${tabClassNames.content}`]: {
133
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
134
+ }
135
+ },
136
+ subtle: {
137
+ backgroundColor: _reacttheme.tokens.colorSubtleBackground,
138
+ ':enabled:hover': {
139
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundHover
140
+ },
141
+ ':enabled:active': {
142
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundPressed
143
+ },
144
+ [`& .${tabClassNames.icon}`]: {
145
+ color: _reacttheme.tokens.colorNeutralForeground2
146
+ },
147
+ [`:enabled:hover .${tabClassNames.icon}`]: {
148
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
149
+ },
150
+ [`:enabled:active .${tabClassNames.icon}`]: {
151
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
152
+ },
153
+ [`& .${tabClassNames.content}`]: {
154
+ color: _reacttheme.tokens.colorNeutralForeground2
155
+ },
156
+ [`:enabled:hover .${tabClassNames.content}`]: {
157
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
158
+ },
159
+ [`:enabled:active .${tabClassNames.content}`]: {
160
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
161
+ }
162
+ },
163
+ disabledCursor: {
164
+ cursor: 'not-allowed'
165
+ },
166
+ disabled: {
167
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
168
+ [`& .${tabClassNames.icon}`]: {
169
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
170
+ },
171
+ [`& .${tabClassNames.content}`]: {
172
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
173
+ }
174
+ },
175
+ selected: {
176
+ [`& .${tabClassNames.icon}`]: {
177
+ color: _reacttheme.tokens.colorCompoundBrandForeground1
178
+ },
179
+ [`:enabled:hover .${tabClassNames.icon}`]: {
180
+ color: _reacttheme.tokens.colorCompoundBrandForeground1Hover
181
+ },
182
+ [`:enabled:active .${tabClassNames.icon}`]: {
183
+ color: _reacttheme.tokens.colorCompoundBrandForeground1Pressed
184
+ },
185
+ [`& .${tabClassNames.content}`]: {
186
+ color: _reacttheme.tokens.colorNeutralForeground1
187
+ },
188
+ [`:enabled:hover .${tabClassNames.content}`]: {
189
+ color: _reacttheme.tokens.colorNeutralForeground1Hover
190
+ },
191
+ [`:enabled:active .${tabClassNames.content}`]: {
192
+ color: _reacttheme.tokens.colorNeutralForeground1Pressed
193
+ }
194
+ }
195
+ });
196
+ const useCircularAppearanceStyles = (0, _react.makeStyles)({
197
+ base: {
198
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
199
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorTransparentStroke}`,
200
+ [`& .${tabClassNames.icon}`]: {
201
+ color: 'inherit'
202
+ },
203
+ [`& .${tabClassNames.content}`]: {
204
+ color: 'inherit'
205
+ }
206
+ },
207
+ small: {
208
+ paddingBlock: `calc(${_reacttheme.tokens.spacingVerticalXXS} - ${_reacttheme.tokens.strokeWidthThin})`
209
+ },
210
+ medium: {
211
+ paddingBlock: `calc(${_reacttheme.tokens.spacingVerticalSNudge} - ${_reacttheme.tokens.strokeWidthThin})`
212
+ },
213
+ large: {
214
+ paddingBlock: `calc(${_reacttheme.tokens.spacingVerticalS} - ${_reacttheme.tokens.strokeWidthThin})`
215
+ },
216
+ subtle: {
217
+ backgroundColor: _reacttheme.tokens.colorSubtleBackground,
218
+ color: _reacttheme.tokens.colorNeutralForeground2,
219
+ ':enabled:hover': {
220
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundHover,
221
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorNeutralStroke1Hover}`,
222
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
223
+ },
224
+ ':enabled:active': {
225
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundPressed,
226
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorNeutralStroke1Pressed}`,
227
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
228
+ },
229
+ '@media (forced-colors: active)': {
230
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} Canvas`
231
+ }
232
+ },
233
+ subtleSelected: {
234
+ backgroundColor: _reacttheme.tokens.colorBrandBackground2,
235
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorCompoundBrandStroke}`,
236
+ color: _reacttheme.tokens.colorBrandForeground2,
237
+ ':enabled:hover': {
238
+ backgroundColor: _reacttheme.tokens.colorBrandBackground2Hover,
239
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorCompoundBrandStrokeHover}`,
240
+ color: _reacttheme.tokens.colorBrandForeground2Hover
241
+ },
242
+ ':enabled:active': {
243
+ backgroundColor: _reacttheme.tokens.colorBrandBackground2Pressed,
244
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorCompoundBrandStrokePressed}`,
245
+ color: _reacttheme.tokens.colorBrandForeground2Pressed
246
+ },
247
+ '@media (forced-colors: active)': {
248
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} Highlight`
249
+ }
250
+ },
251
+ subtleDisabled: {
252
+ backgroundColor: _reacttheme.tokens.colorSubtleBackground,
253
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
254
+ },
255
+ subtleDisabledSelected: {
256
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
257
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorNeutralStrokeDisabled}`,
258
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
259
+ },
260
+ filled: {
261
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
262
+ color: _reacttheme.tokens.colorNeutralForeground2,
263
+ ':enabled:hover': {
264
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3Hover,
265
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
266
+ },
267
+ ':enabled:active': {
268
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3Pressed,
269
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
270
+ },
271
+ '@media (forced-colors: active)': {
272
+ ':enabled:hover': {
273
+ backgroundColor: 'Highlight',
274
+ forcedColorAdjust: 'none',
275
+ [`& .${tabClassNames.content}`]: {
276
+ color: 'HighlightText'
277
+ },
278
+ [`& .${iconClassNames.filled}`]: {
279
+ color: 'HighlightText'
280
+ },
281
+ [`& .${iconClassNames.regular}`]: {
282
+ color: 'HighlightText'
283
+ }
284
+ }
285
+ }
286
+ },
287
+ filledSelected: {
288
+ backgroundColor: _reacttheme.tokens.colorBrandBackground,
289
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand,
290
+ ':enabled:hover': {
291
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundHover,
292
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
293
+ },
294
+ ':enabled:active': {
295
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundPressed,
296
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
297
+ },
298
+ '@media (forced-colors: active)': {
299
+ ':enabled': {
300
+ backgroundColor: 'ButtonText',
301
+ [`& .${tabClassNames.content}`]: {
302
+ color: 'ButtonFace',
303
+ forcedColorAdjust: 'none'
304
+ }
305
+ },
306
+ [`:enabled .${tabClassNames.icon}`]: {
307
+ color: 'ButtonFace'
308
+ }
309
+ }
310
+ },
311
+ filledDisabled: {
312
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
313
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
314
+ },
315
+ filledDisabledSelected: {
316
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
317
+ border: `solid ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorNeutralStrokeDisabled}`,
318
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
319
+ }
320
+ });
321
+ /**
322
+ * Focus styles for the root slot
323
+ */ const useFocusStyles = (0, _react.makeStyles)({
324
+ // Tab creates a custom focus indicator because the default focus indicator
325
+ // is applied using an ::after pseudo-element on the root. Since the selection
326
+ // indicator uses an ::after pseudo-element on the root, there is a conflict.
327
+ base: (0, _reacttabster.createCustomFocusIndicatorStyle)({
328
+ ..._react.shorthands.borderColor('transparent'),
329
+ outlineWidth: _reacttheme.tokens.strokeWidthThick,
330
+ outlineColor: 'transparent',
331
+ outlineStyle: 'solid',
332
+ boxShadow: `
333
+ ${_reacttheme.tokens.shadow4},
334
+ 0 0 0 ${_reacttheme.tokens.strokeWidthThick} ${_reacttheme.tokens.colorStrokeFocus2}
335
+ `,
336
+ zIndex: 1
337
+ }, {
338
+ enableOutline: true
339
+ }),
340
+ circular: (0, _reacttabster.createCustomFocusIndicatorStyle)({
341
+ ..._react.shorthands.borderColor('transparent'),
342
+ outlineWidth: _reacttheme.tokens.strokeWidthThick,
343
+ outlineColor: 'transparent',
344
+ outlineStyle: 'solid',
345
+ boxShadow: `
346
+ ${_reacttheme.tokens.shadow4},
347
+ 0 0 0 ${_reacttheme.tokens.strokeWidthThick} ${_reacttheme.tokens.colorStrokeFocus2},
348
+ 0 0 0 ${_reacttheme.tokens.strokeWidthThin} ${_reacttheme.tokens.colorNeutralStrokeOnBrand} inset
349
+ `,
350
+ zIndex: 1
351
+ }, {
352
+ enableOutline: true
353
+ })
354
+ });
355
+ /** Indicator styles for when pending selection */ const usePendingIndicatorStyles = (0, _react.makeStyles)({
356
+ base: {
357
+ ':hover::before': {
358
+ backgroundColor: _reacttheme.tokens.colorNeutralStroke1Hover,
359
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
360
+ content: '""',
361
+ position: 'absolute'
362
+ },
363
+ ':active::before': {
364
+ backgroundColor: _reacttheme.tokens.colorNeutralStroke1Pressed,
365
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
366
+ content: '""',
367
+ position: 'absolute'
368
+ },
369
+ '@media (forced-colors: active)': {
370
+ ':hover::before': {
371
+ backgroundColor: 'Highlight'
372
+ },
373
+ ':active::before': {
374
+ backgroundColor: 'Highlight'
375
+ }
376
+ }
377
+ },
378
+ disabled: {
379
+ ':hover::before': {
380
+ backgroundColor: _reacttheme.tokens.colorTransparentStroke
381
+ },
382
+ ':active::before': {
383
+ backgroundColor: _reacttheme.tokens.colorTransparentStroke
384
+ },
385
+ '@media (forced-colors: active)': {
386
+ ':hover::before': {
387
+ backgroundColor: 'transparent'
388
+ },
389
+ ':active::before': {
390
+ backgroundColor: 'transparent'
391
+ }
392
+ }
393
+ },
394
+ smallHorizontal: {
395
+ '::before': {
396
+ bottom: 0,
397
+ height: _reacttheme.tokens.strokeWidthThick,
398
+ left: _reacttheme.tokens.spacingHorizontalSNudge,
399
+ right: _reacttheme.tokens.spacingHorizontalSNudge
400
+ }
401
+ },
402
+ smallVertical: {
403
+ '::before': {
404
+ bottom: _reacttheme.tokens.spacingVerticalXS,
405
+ left: 0,
406
+ top: _reacttheme.tokens.spacingVerticalXS,
407
+ width: _reacttheme.tokens.strokeWidthThicker
408
+ }
409
+ },
410
+ mediumHorizontal: {
411
+ '::before': {
412
+ bottom: 0,
413
+ height: _reacttheme.tokens.strokeWidthThicker,
414
+ left: _reacttheme.tokens.spacingHorizontalM,
415
+ right: _reacttheme.tokens.spacingHorizontalM
416
+ }
417
+ },
418
+ mediumVertical: {
419
+ '::before': {
420
+ bottom: _reacttheme.tokens.spacingVerticalS,
421
+ left: 0,
422
+ top: _reacttheme.tokens.spacingVerticalS,
423
+ width: _reacttheme.tokens.strokeWidthThicker
424
+ }
425
+ },
426
+ largeHorizontal: {
427
+ '::before': {
428
+ bottom: 0,
429
+ height: _reacttheme.tokens.strokeWidthThicker,
430
+ left: _reacttheme.tokens.spacingHorizontalM,
431
+ right: _reacttheme.tokens.spacingHorizontalM
432
+ }
433
+ },
434
+ largeVertical: {
435
+ '::before': {
436
+ bottom: _reacttheme.tokens.spacingVerticalMNudge,
437
+ left: 0,
438
+ top: _reacttheme.tokens.spacingVerticalMNudge,
439
+ width: _reacttheme.tokens.strokeWidthThicker
440
+ }
441
+ }
442
+ });
443
+ const useActiveIndicatorStyles = (0, _react.makeStyles)({
444
+ base: {
445
+ '::after': {
446
+ backgroundColor: _reacttheme.tokens.colorTransparentStroke,
447
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
448
+ content: '""',
449
+ position: 'absolute'
450
+ }
451
+ },
452
+ selected: {
453
+ '::after': {
454
+ backgroundColor: _reacttheme.tokens.colorCompoundBrandStroke
455
+ },
456
+ ':enabled:hover::after': {
457
+ backgroundColor: _reacttheme.tokens.colorCompoundBrandStrokeHover
458
+ },
459
+ ':enabled:active::after': {
460
+ backgroundColor: _reacttheme.tokens.colorCompoundBrandStrokePressed
461
+ },
462
+ '@media (forced-colors: active)': {
463
+ '::after': {
464
+ backgroundColor: 'ButtonText'
465
+ },
466
+ ':enabled:hover::after': {
467
+ backgroundColor: 'ButtonText'
468
+ },
469
+ ':enabled:active::after': {
470
+ backgroundColor: 'ButtonText'
471
+ }
472
+ }
473
+ },
474
+ disabled: {
475
+ '::after': {
476
+ backgroundColor: _reacttheme.tokens.colorNeutralForegroundDisabled
477
+ }
478
+ },
479
+ smallHorizontal: {
480
+ '::after': {
481
+ bottom: 0,
482
+ height: _reacttheme.tokens.strokeWidthThick,
483
+ left: _reacttheme.tokens.spacingHorizontalSNudge,
484
+ right: _reacttheme.tokens.spacingHorizontalSNudge
485
+ }
486
+ },
487
+ smallVertical: {
488
+ '::after': {
489
+ bottom: _reacttheme.tokens.spacingVerticalXS,
490
+ left: '0',
491
+ top: _reacttheme.tokens.spacingVerticalXS,
492
+ width: _reacttheme.tokens.strokeWidthThicker
493
+ }
494
+ },
495
+ mediumHorizontal: {
496
+ '::after': {
497
+ bottom: '0',
498
+ height: _reacttheme.tokens.strokeWidthThicker,
499
+ left: _reacttheme.tokens.spacingHorizontalM,
500
+ right: _reacttheme.tokens.spacingHorizontalM
501
+ }
502
+ },
503
+ mediumVertical: {
504
+ '::after': {
505
+ bottom: _reacttheme.tokens.spacingVerticalS,
506
+ left: 0,
507
+ top: _reacttheme.tokens.spacingVerticalS,
508
+ width: _reacttheme.tokens.strokeWidthThicker
509
+ }
510
+ },
511
+ largeHorizontal: {
512
+ '::after': {
513
+ bottom: 0,
514
+ height: _reacttheme.tokens.strokeWidthThicker,
515
+ left: _reacttheme.tokens.spacingHorizontalM,
516
+ right: _reacttheme.tokens.spacingHorizontalM
517
+ }
518
+ },
519
+ largeVertical: {
520
+ '::after': {
521
+ bottom: _reacttheme.tokens.spacingVerticalMNudge,
522
+ left: 0,
523
+ top: _reacttheme.tokens.spacingVerticalMNudge,
524
+ width: _reacttheme.tokens.strokeWidthThicker
525
+ }
526
+ }
527
+ });
528
+ /**
529
+ * Styles for the icon slot.
530
+ */ const useIconStyles = (0, _react.makeStyles)({
531
+ base: {
532
+ gridColumnStart: 1,
533
+ gridRowStart: 1,
534
+ alignItems: 'center',
535
+ display: 'inline-flex',
536
+ justifyContent: 'center',
537
+ overflow: 'hidden',
538
+ [`& .${iconClassNames.filled}`]: {
539
+ display: 'none'
540
+ },
541
+ [`& .${iconClassNames.regular}`]: {
542
+ display: 'inline'
543
+ }
544
+ },
545
+ // per design, the small and medium font sizes are the same.
546
+ // the size prop only affects spacing.
547
+ small: {
548
+ fontSize: '20px',
549
+ height: '20px',
550
+ width: '20px'
551
+ },
552
+ medium: {
553
+ fontSize: '20px',
554
+ height: '20px',
555
+ width: '20px'
556
+ },
557
+ large: {
558
+ fontSize: '24px',
559
+ height: '24px',
560
+ width: '24px'
561
+ },
562
+ selected: {
563
+ [`& .${iconClassNames.filled}`]: {
564
+ display: 'inline'
565
+ },
566
+ [`& .${iconClassNames.regular}`]: {
567
+ display: 'none'
568
+ }
569
+ }
570
+ });
571
+ /**
572
+ * Styles for the content slot (children)
573
+ */ const useContentStyles = (0, _react.makeStyles)({
574
+ base: {
575
+ ..._reacttheme.typographyStyles.body1,
576
+ overflow: 'hidden',
577
+ // content padding is the same for medium & small, horizontal & vertical
578
+ padding: `${_reacttheme.tokens.spacingVerticalNone} ${_reacttheme.tokens.spacingHorizontalXXS}`
579
+ },
580
+ selected: {
581
+ ..._reacttheme.typographyStyles.body1Strong
582
+ },
583
+ large: {
584
+ ..._reacttheme.typographyStyles.body2
585
+ },
586
+ largeSelected: {
587
+ ..._reacttheme.typographyStyles.subtitle2
588
+ },
589
+ noIconBefore: {
590
+ gridColumnStart: 1,
591
+ gridRowStart: 1
592
+ },
593
+ iconBefore: {
594
+ gridColumnStart: 2,
595
+ gridRowStart: 1
596
+ },
597
+ placeholder: {
598
+ visibility: 'hidden'
599
+ }
600
+ });
601
+ const useTabStyles_unstable = (state)=>{
602
+ 'use no memo';
603
+ useTabIndicatorStyles_unstable(state);
604
+ useTabButtonStyles_unstable(state, state.root);
605
+ useTabContentStyles_unstable(state);
606
+ return state;
607
+ };
608
+ const useTabIndicatorStyles_unstable = (state)=>{
609
+ 'use no memo';
610
+ const rootStyles = useRootStyles();
611
+ const pendingIndicatorStyles = usePendingIndicatorStyles();
612
+ const activeIndicatorStyles = useActiveIndicatorStyles();
613
+ const { appearance, disabled, selected, size, vertical } = state;
614
+ const classes = [
615
+ tabClassNames.root,
616
+ rootStyles.root
617
+ ];
618
+ if (appearance !== 'subtle-circular' && appearance !== 'filled-circular') {
619
+ classes.push(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, selected && activeIndicatorStyles.base, selected && !disabled && activeIndicatorStyles.selected, selected && size === 'small' && (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal), selected && size === 'medium' && (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal), selected && size === 'large' && (vertical ? activeIndicatorStyles.largeVertical : activeIndicatorStyles.largeHorizontal), selected && disabled && activeIndicatorStyles.disabled);
620
+ }
621
+ state.root.className = (0, _react.mergeClasses)(...classes, state.root.className);
622
+ (0, _useTabAnimatedIndicatorstyles.useTabAnimatedIndicatorStyles_unstable)(state);
623
+ return state;
624
+ };
625
+ const useTabButtonStyles_unstable = (state, slot)=>{
626
+ 'use no memo';
627
+ const rootStyles = useRootStyles();
628
+ const focusStyles = useFocusStyles();
629
+ const circularStyles = useCircularAppearanceStyles();
630
+ const { appearance, disabled, selected, size, vertical } = state;
631
+ const isSubtleCircular = appearance === 'subtle-circular';
632
+ const isFilledCircular = appearance === 'filled-circular';
633
+ const isCircular = isSubtleCircular || isFilledCircular;
634
+ const circularAppearance = [
635
+ circularStyles.base,
636
+ focusStyles.circular,
637
+ // sizes
638
+ size === 'small' && circularStyles.small,
639
+ size === 'medium' && circularStyles.medium,
640
+ size === 'large' && circularStyles.large,
641
+ // subtle-circular appearance
642
+ isSubtleCircular && circularStyles.subtle,
643
+ selected && isSubtleCircular && circularStyles.subtleSelected,
644
+ disabled && isSubtleCircular && circularStyles.subtleDisabled,
645
+ selected && disabled && isSubtleCircular && circularStyles.subtleDisabledSelected,
646
+ // filled-circular appearance
647
+ isFilledCircular && circularStyles.filled,
648
+ selected && isFilledCircular && circularStyles.filledSelected,
649
+ disabled && isFilledCircular && circularStyles.filledDisabled,
650
+ selected && disabled && isFilledCircular && circularStyles.filledDisabledSelected
651
+ ];
652
+ const regularAppearance = [
653
+ focusStyles.base,
654
+ !disabled && appearance === 'subtle' && rootStyles.subtle,
655
+ !disabled && appearance === 'transparent' && rootStyles.transparent,
656
+ !disabled && selected && rootStyles.selected,
657
+ disabled && rootStyles.disabled
658
+ ];
659
+ slot.className = (0, _react.mergeClasses)(rootStyles.button, 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), ...isCircular ? circularAppearance : regularAppearance, disabled && rootStyles.disabledCursor, slot.className);
660
+ return state;
661
+ };
662
+ const useTabContentStyles_unstable = (state)=>{
663
+ 'use no memo';
664
+ const iconStyles = useIconStyles();
665
+ const contentStyles = useContentStyles();
666
+ const { selected, size } = state;
667
+ if (state.icon) {
668
+ state.icon.className = (0, _react.mergeClasses)(tabClassNames.icon, iconStyles.base, iconStyles[size], selected && iconStyles.selected, state.icon.className);
669
+ }
670
+ // This needs to be before state.content.className is updated
671
+ if (state.contentReservedSpace) {
672
+ state.contentReservedSpace.className = (0, _react.mergeClasses)(reservedSpaceClassNames.content, contentStyles.base, size === 'large' ? contentStyles.largeSelected : contentStyles.selected, state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, contentStyles.placeholder, state.content.className);
673
+ // FIXME: this is a deprecated API
674
+ // should be removed in the next major version
675
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
676
+ state.contentReservedSpaceClassName = state.contentReservedSpace.className;
677
+ }
678
+ state.content.className = (0, _react.mergeClasses)(tabClassNames.content, contentStyles.base, size === 'large' && contentStyles.large, selected && (size === 'large' ? contentStyles.largeSelected : contentStyles.selected), state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, state.content.className);
679
+ return state;
680
+ };