@fluentui/react-tabs 9.0.0-beta.8 → 9.0.0-beta.9

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 (70) hide show
  1. package/CHANGELOG.json +108 -1
  2. package/CHANGELOG.md +24 -2
  3. package/dist/react-tabs.d.ts +48 -36
  4. package/lib/components/Tab/Tab.types.d.ts +14 -5
  5. package/lib/components/Tab/Tab.types.js.map +1 -1
  6. package/lib/components/Tab/index.d.ts +1 -0
  7. package/lib/components/Tab/index.js +1 -0
  8. package/lib/components/Tab/index.js.map +1 -1
  9. package/lib/components/Tab/renderTab.js +1 -2
  10. package/lib/components/Tab/renderTab.js.map +1 -1
  11. package/lib/components/Tab/useTab.js +25 -29
  12. package/lib/components/Tab/useTab.js.map +1 -1
  13. package/lib/components/Tab/useTabAnimatedIndicator.d.ts +5 -0
  14. package/lib/components/Tab/useTabAnimatedIndicator.js +134 -0
  15. package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  16. package/lib/components/Tab/useTabStyles.d.ts +4 -2
  17. package/lib/components/Tab/useTabStyles.js +280 -84
  18. package/lib/components/Tab/useTabStyles.js.map +1 -1
  19. package/lib/components/TabList/TabList.types.d.ts +21 -16
  20. package/lib/components/TabList/TabList.types.js.map +1 -1
  21. package/lib/components/TabList/TabListContext.js +6 -0
  22. package/lib/components/TabList/TabListContext.js.map +1 -1
  23. package/lib/components/TabList/renderTabList.js +0 -1
  24. package/lib/components/TabList/renderTabList.js.map +1 -1
  25. package/lib/components/TabList/useTabList.js +26 -51
  26. package/lib/components/TabList/useTabList.js.map +1 -1
  27. package/lib/components/TabList/useTabListContextValues.js +4 -0
  28. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  29. package/lib/components/TabList/useTabListStyles.d.ts +4 -5
  30. package/lib/components/TabList/useTabListStyles.js +8 -90
  31. package/lib/components/TabList/useTabListStyles.js.map +1 -1
  32. package/lib/index.d.ts +4 -2
  33. package/lib/index.js +2 -2
  34. package/lib/index.js.map +1 -1
  35. package/lib/tab.constants.d.ts +59 -12
  36. package/lib/tab.constants.js +64 -13
  37. package/lib/tab.constants.js.map +1 -1
  38. package/lib-commonjs/components/Tab/Tab.types.d.ts +14 -5
  39. package/lib-commonjs/components/Tab/index.d.ts +1 -0
  40. package/lib-commonjs/components/Tab/index.js +2 -0
  41. package/lib-commonjs/components/Tab/index.js.map +1 -1
  42. package/lib-commonjs/components/Tab/renderTab.js +1 -2
  43. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  44. package/lib-commonjs/components/Tab/useTab.js +25 -29
  45. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  46. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.d.ts +5 -0
  47. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +148 -0
  48. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  49. package/lib-commonjs/components/Tab/useTabStyles.d.ts +4 -2
  50. package/lib-commonjs/components/Tab/useTabStyles.js +281 -84
  51. package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
  52. package/lib-commonjs/components/TabList/TabList.types.d.ts +21 -16
  53. package/lib-commonjs/components/TabList/TabListContext.js +6 -0
  54. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  55. package/lib-commonjs/components/TabList/renderTabList.js +0 -1
  56. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
  57. package/lib-commonjs/components/TabList/useTabList.js +25 -50
  58. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  59. package/lib-commonjs/components/TabList/useTabListContextValues.js +4 -0
  60. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  61. package/lib-commonjs/components/TabList/useTabListStyles.d.ts +4 -5
  62. package/lib-commonjs/components/TabList/useTabListStyles.js +7 -92
  63. package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
  64. package/lib-commonjs/index.d.ts +4 -2
  65. package/lib-commonjs/index.js +76 -3
  66. package/lib-commonjs/index.js.map +1 -1
  67. package/lib-commonjs/tab.constants.d.ts +59 -12
  68. package/lib-commonjs/tab.constants.js +66 -14
  69. package/lib-commonjs/tab.constants.js.map +1 -1
  70. package/package.json +9 -18
@@ -1,15 +1,24 @@
1
1
  import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
2
  import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
3
3
  import { tokens } from '@fluentui/react-theme';
4
- import { tabPendingDesignTokens } from '../../tab.constants';
5
- export const tabClassName = 'fui-Tab';
4
+ import { pendingContentSizeTokens, pendingSpacingTokens, tabIndicatorPadding, tabIndicatorStrokeWidths } from '../../tab.constants';
5
+ import { useTabAnimatedIndicatorStyles_unstable } from './useTabAnimatedIndicator';
6
+ export const tabClassNames = {
7
+ root: 'fui-Tab',
8
+ icon: 'fui-Tab__icon',
9
+ content: 'fui-Tab__content'
10
+ }; // TODO temporary export to pass conformance test.
11
+
12
+ export const tabClassName = tabClassNames.root;
6
13
  /**
7
14
  * Styles for the root slot
8
15
  */
9
16
 
17
+ /* eslint-disable @typescript-eslint/naming-convention */
18
+
10
19
  const useRootStyles = /*#__PURE__*/__styles({
11
20
  "base": {
12
- "De3pzq": "flu3bqm",
21
+ "Bt984gj": "f122n59",
13
22
  "g2u3we": "fwhevhj",
14
23
  "h3c5rm": ["f61n433", "f1q8l70w"],
15
24
  "B9xav0g": "fv1dfc8",
@@ -18,47 +27,95 @@ const useRootStyles = /*#__PURE__*/__styles({
18
27
  "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
19
28
  "B7oj6ja": ["f1jar5jt", "fyu767a"],
20
29
  "Btl43ni": ["fyu767a", "f1jar5jt"],
21
- "B4j52fo": "f192inf7",
22
- "Bekrc4i": ["f5tn483", "f1ojsxk5"],
23
- "Bn0qgzm": "f1vxd6vx",
24
- "ibv6hh": ["f1ojsxk5", "f5tn483"],
25
- "i8kkvl": "fgfbwa2",
30
+ "B4j52fo": "fre7gi1",
31
+ "Bekrc4i": ["f1358rze", "f1rvrf73"],
32
+ "Bn0qgzm": "fqdk4by",
33
+ "ibv6hh": ["f1rvrf73", "f1358rze"],
26
34
  "Bceei9c": "f1k6fduh",
27
35
  "mc9l5x": "f22iagw",
28
36
  "Beiy3e4": "f1063pyq",
29
37
  "Bahqtrf": "fk6fouc",
30
- "Be2twd7": "fkhj508",
31
38
  "Bg96gwp": "f1i3iumi",
32
- "z8tnut": "f1809wu7",
33
- "z189sj": ["f81rol6", "frdkuqy"],
34
- "Byoj8tv": "f1fow5ox",
35
- "uwmqm3": ["frdkuqy", "f81rol6"],
39
+ "oeaueh": "f1s6fcnf",
36
40
  "qhf8xq": "f10pi13n",
37
41
  "B68tc82": "f1p9o1ba",
38
- "Bmxbyg5": "f1sil6mw"
42
+ "Bmxbyg5": "f1sil6mw",
43
+ "B9bfxx9": "f1cxpek8"
39
44
  },
40
- "horizontal": {
41
- "Bt984gj": "f122n59",
42
- "Brf1p80": "f4d9j23"
45
+ "mediumHorizontal": {
46
+ "i8kkvl": "fgfbwa2",
47
+ "Brf1p80": "f4d9j23",
48
+ "z8tnut": "f1kcqot9",
49
+ "z189sj": ["f81rol6", "frdkuqy"],
50
+ "Byoj8tv": "fpe6lb7",
51
+ "uwmqm3": ["frdkuqy", "f81rol6"]
43
52
  },
44
- "vertical": {
45
- "Bt984gj": "f122n59",
46
- "Brf1p80": "fbhxue7"
53
+ "mediumVertical": {
54
+ "i8kkvl": "fgfbwa2",
55
+ "Brf1p80": "fbhxue7",
56
+ "Bf4jedk": "fyvtabn",
57
+ "z8tnut": "f1xp5gbu",
58
+ "z189sj": ["f81rol6", "frdkuqy"],
59
+ "Byoj8tv": "f1d7kygh",
60
+ "uwmqm3": ["frdkuqy", "f81rol6"]
47
61
  },
48
- "small": {
62
+ "smallHorizontal": {
63
+ "i8kkvl": "f16mnhsx",
49
64
  "z8tnut": "f1xp5gbu",
50
65
  "z189sj": ["f1sgzk6v", "f1bg5zqg"],
51
66
  "Byoj8tv": "f1d7kygh",
52
- "uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
53
- "i8kkvl": "f16mnhsx"
67
+ "uwmqm3": ["f1bg5zqg", "f1sgzk6v"]
68
+ },
69
+ "smallVertical": {
70
+ "i8kkvl": "f16mnhsx",
71
+ "z8tnut": "fq1loh5",
72
+ "z189sj": ["f1sgzk6v", "f1bg5zqg"],
73
+ "Byoj8tv": "futqtb8",
74
+ "uwmqm3": ["f1bg5zqg", "f1sgzk6v"]
75
+ },
76
+ "transparent": {
77
+ "De3pzq": "f1c21dwh",
78
+ "Jwef8y": "fjxutwb",
79
+ "ecr2s2": "fophhak",
80
+ "Bptxc3x": "fmmjozx",
81
+ "B076xvk": "f1mfqf41",
82
+ "q9r9w5": "f10aiid4",
83
+ "cl4aha": "fpkze5g",
84
+ "Bk452zc": "f149wc3x",
85
+ "a4hkcw": "fjioou7"
54
86
  },
55
87
  "subtle": {
56
- "Jwef8y": "f1knas48"
88
+ "De3pzq": "fhovq9v",
89
+ "Jwef8y": "f1t94bn6",
90
+ "ecr2s2": "f1wfn5kd",
91
+ "Bptxc3x": "fmmjozx",
92
+ "B076xvk": "f1mfqf41",
93
+ "q9r9w5": "f10aiid4",
94
+ "cl4aha": "fpkze5g",
95
+ "Bk452zc": "f149wc3x",
96
+ "a4hkcw": "fjioou7"
97
+ },
98
+ "disabled": {
99
+ "De3pzq": "f1c21dwh",
100
+ "Bptxc3x": "fato7r6",
101
+ "cl4aha": "fao1bnu",
102
+ "Bceei9c": "fdrzuqr"
103
+ },
104
+ "selected": {
105
+ "Bptxc3x": "f1cadz5z",
106
+ "B076xvk": "f1ck17l",
107
+ "q9r9w5": "f42ak0g",
108
+ "cl4aha": "ffplhdr",
109
+ "Bk452zc": "ffth601",
110
+ "a4hkcw": "fhklyu5"
57
111
  }
58
112
  }, {
59
- "d": [".flu3bqm{background-color:none;}", ".fwhevhj{border-top-color:none;}", ".f61n433{border-right-color:none;}", ".f1q8l70w{border-left-color:none;}", ".fv1dfc8{border-bottom-color:none;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fgfbwa2{-webkit-column-gap:6px;column-gap:6px;}", ".f1k6fduh{cursor:pointer;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1809wu7{padding-top:10px;}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".f1fow5ox{padding-bottom:10px;}", ".f10pi13n{position:relative;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fbhxue7{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".f16mnhsx{-webkit-column-gap:2px;column-gap:2px;}"],
60
- "h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}"]
113
+ "d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fwhevhj{border-top-color:none;}", ".f61n433{border-right-color:none;}", ".f1q8l70w{border-left-color:none;}", ".fv1dfc8{border-bottom-color:none;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".fre7gi1{border-top-width:0;}", ".f1358rze{border-right-width:0;}", ".f1rvrf73{border-left-width:0;}", ".fqdk4by{border-bottom-width:0;}", ".f1k6fduh{cursor:pointer;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1s6fcnf{outline-style:none;}", ".f10pi13n{position:relative;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1cxpek8{text-transform:none;}", ".fgfbwa2{-webkit-column-gap:6px;column-gap:6px;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1kcqot9{padding-top:12px;}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".fpe6lb7{padding-bottom:12px;}", ".fbhxue7{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}", ".fyvtabn{min-width:120px;}", ".f1xp5gbu{padding-top:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".f16mnhsx{-webkit-column-gap:2px;column-gap:2px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".fq1loh5{padding-top:2px;}", ".futqtb8{padding-bottom:2px;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fmmjozx .fui-Tab__icon{color:var(--colorNeutralForeground2);}", ".fpkze5g .fui-Tab__content{color:var(--colorNeutralForeground2);}", ".fhovq9v{background-color:var(--colorSubtleBackground);}", ".fato7r6 .fui-Tab__icon{color:var(--colorNeutralForegroundDisabled);}", ".fao1bnu .fui-Tab__content{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".f1cadz5z .fui-Tab__icon{color:var(--colorCompoundBrandForeground1);}", ".ffplhdr .fui-Tab__content{color:var(--colorNeutralForeground1);}"],
114
+ "h": [".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f1mfqf41:hover .fui-Tab__icon{color:var(--colorNeutralForeground2Hover);}", ".f149wc3x:hover .fui-Tab__content{color:var(--colorNeutralForeground2Hover);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".f1ck17l:hover .fui-Tab__icon{color:var(--colorCompoundBrandForeground1Hover);}", ".ffth601:hover .fui-Tab__content{color:var(--colorNeutralForeground1Hover);}"],
115
+ "a": [".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f10aiid4:active .fui-Tab__icon{color:var(--colorNeutralForeground2Pressed);}", ".fjioou7:active .fui-Tab__content{color:var(--colorNeutralForeground2Pressed);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}", ".f42ak0g:active .fui-Tab__icon{color:var(--colorCompoundBrandForeground1Pressed);}", ".fhklyu5:active .fui-Tab__content{color:var(--colorNeutralForeground1Pressed);}"]
61
116
  });
117
+ /* eslint-enable @typescript-eslint/naming-convention */
118
+
62
119
  /**
63
120
  * Focus styles for the root slot
64
121
  */
@@ -81,63 +138,183 @@ const useFocusStyles = /*#__PURE__*/__styles({
81
138
  "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
82
139
  "d": ["[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f19j8a82:focus{outline-color:transparent;}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", "[data-keyboard-nav] .f1gkya50:focus{box-shadow:var(--shadow4),0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fpt6wn7:focus{z-index:1;}"]
83
140
  });
84
- /**
85
- * Indicator styles for the root slot when horizontal.
86
- */
141
+ /** Indicator styles for when pending selection */
87
142
 
88
143
 
89
- const useHorizontalIndicatorStyles = /*#__PURE__*/__styles({
144
+ const usePendingIndicatorStyles = /*#__PURE__*/__styles({
90
145
  "base": {
91
- "Bkbwdz4": "f1mif8u4",
92
- "frdscb": ["fvxed1z", "f1j2a01o"],
93
- "B9nohqn": ["f1j2a01o", "fvxed1z"],
94
- "B1dhsta": ["fsamouo", "f1aazreq"],
95
- "Bjdmjzx": ["f1aazreq", "fsamouo"],
146
+ "Cgij5x": "f19tg446",
147
+ "z7qlni": "f1mav41w",
148
+ "Bdipjll": ["f1suiu43", "f1kv3e19"],
149
+ "B37a91": "f1hmukci",
150
+ "Buig1va": ["f1kv3e19", "f1suiu43"],
151
+ "Bdyfc3e": "f1lqhc19",
152
+ "Bpjys6e": ["fgp1lrp", "f14he6sl"],
153
+ "pnx8oc": "f1c4qkgw",
154
+ "Btzsvkb": ["f14he6sl", "fgp1lrp"],
155
+ "d7kyl9": ["f1cj3r78", "f1xncuur"],
156
+ "Bisz106": ["f1xncuur", "f1cj3r78"],
157
+ "Bllnwrd": ["fi30ndc", "f19d7f88"],
158
+ "B3dpmnz": ["f19d7f88", "fi30ndc"],
159
+ "Fs9z49": "f56rwnc",
160
+ "Baevmrh": "f1lqcl48",
161
+ "ri70ih": "f1ego73q",
162
+ "Br1f9q3": "f1ppf73u",
163
+ "Bh9m8uq": "fkgvshs",
164
+ "f79n2v": ["f9ce8dc", "f1m8imsn"],
165
+ "zvkrb6": "fxkorn8",
166
+ "y3supe": ["f1m8imsn", "f9ce8dc"],
167
+ "Bcbdomo": "f1bb2bd5",
168
+ "gg7wqr": ["fyhhhxy", "flt5dqy"],
169
+ "Ixc8c": "fw019zk",
170
+ "B1ltu2w": ["flt5dqy", "fyhhhxy"],
171
+ "B2yjemk": ["f7c36j8", "f1tzhx6f"],
172
+ "Bph9bk4": ["f1tzhx6f", "f7c36j8"],
173
+ "utwc0c": ["f15ne2sm", "f18vik6r"],
174
+ "B5rxhlh": ["f18vik6r", "f15ne2sm"],
175
+ "Bseepjv": "f2sk4z1",
176
+ "Iy3360": "frq4ova",
177
+ "Dlf1w5": "f416fxa"
178
+ },
179
+ "disabled": {
180
+ "Bdyfc3e": "ft6wof",
181
+ "Bpjys6e": ["f1ojwtdc", "fgjfpko"],
182
+ "pnx8oc": "f5s0kyi",
183
+ "Btzsvkb": ["fgjfpko", "f1ojwtdc"],
184
+ "Bcbdomo": "f1dodv9r",
185
+ "gg7wqr": ["f1shuycv", "f19t3g6y"],
186
+ "Ixc8c": "f6psttw",
187
+ "B1ltu2w": ["f19t3g6y", "f1shuycv"]
188
+ },
189
+ "mediumHorizontal": {
190
+ "Bj2wrql": "flqennz",
191
+ "dj0dih": "fyg4ez2",
192
+ "D4ky5z": ["f1cquro8", "f1ro2kyx"],
193
+ "k1i1uq": "ffvjagy",
194
+ "Bcasopp": ["f1ro2kyx", "f1cquro8"],
195
+ "Bbc2r3f": "fvqq5f6",
196
+ "Byque4d": ["frssmbg", "fxzecjq"],
197
+ "qd6xl9": ["fxzecjq", "frssmbg"]
198
+ },
199
+ "mediumVertical": {
200
+ "Bj2wrql": "fa48u8l",
201
+ "dj0dih": "fyg4ez2",
202
+ "D4ky5z": ["f1cquro8", "f1ro2kyx"],
203
+ "k1i1uq": "ffvjagy",
204
+ "Bcasopp": ["f1ro2kyx", "f1cquro8"],
205
+ "Byque4d": ["f1t0u0az", "fmlx6bj"],
206
+ "Bf8kmfk": "f1itw4t3",
207
+ "Bdn98qo": "f1382oex"
208
+ },
209
+ "smallHorizontal": {
210
+ "Bj2wrql": "flqennz",
211
+ "dj0dih": "f1kkj9j",
212
+ "D4ky5z": ["f14ip387", "f1uj4yfi"],
213
+ "k1i1uq": "f7vsd80",
214
+ "Bcasopp": ["f1uj4yfi", "f14ip387"],
215
+ "Bbc2r3f": "f1y1nr8p",
216
+ "Byque4d": ["f1i98inn", "fadekk3"],
217
+ "qd6xl9": ["fadekk3", "f1i98inn"]
218
+ },
219
+ "smallVertical": {
220
+ "Bj2wrql": "f7efb1c",
221
+ "dj0dih": "fyg4ez2",
222
+ "D4ky5z": ["f1cquro8", "f1ro2kyx"],
223
+ "k1i1uq": "ffvjagy",
224
+ "Bcasopp": ["f1ro2kyx", "f1cquro8"],
225
+ "Byque4d": ["f1t0u0az", "fmlx6bj"],
226
+ "Bf8kmfk": "f1q0qvio",
227
+ "Bdn98qo": "f1382oex"
228
+ }
229
+ }, {
230
+ "h": [".f19tg446:hover:before{background-color:none;}", ".f1mav41w:hover:before{border-top-style:solid;}", ".f1suiu43:hover:before{border-right-style:solid;}", ".f1kv3e19:hover:before{border-left-style:solid;}", ".f1hmukci:hover:before{border-bottom-style:solid;}", ".f1lqhc19:hover:before{border-top-color:var(--colorNeutralStroke1Hover);}", ".fgp1lrp:hover:before{border-right-color:var(--colorNeutralStroke1Hover);}", ".f14he6sl:hover:before{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1c4qkgw:hover:before{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".f1cj3r78:hover:before{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1xncuur:hover:before{border-bottom-left-radius:var(--borderRadiusCircular);}", ".fi30ndc:hover:before{border-top-right-radius:var(--borderRadiusCircular);}", ".f19d7f88:hover:before{border-top-left-radius:var(--borderRadiusCircular);}", ".f56rwnc:hover:before{box-sizing:border-box;}", ".f1lqcl48:hover:before{content:\"\";}", ".f1ego73q:hover:before{position:absolute;}", ".ft6wof:hover:before{border-top-color:var(--colorTransparentStroke);}", ".f1ojwtdc:hover:before{border-right-color:var(--colorTransparentStroke);}", ".fgjfpko:hover:before{border-left-color:var(--colorTransparentStroke);}", ".f5s0kyi:hover:before{border-bottom-color:var(--colorTransparentStroke);}"],
231
+ "a": [".f1ppf73u:active:before{background-color:none;}", ".fkgvshs:active:before{border-top-style:solid;}", ".f9ce8dc:active:before{border-right-style:solid;}", ".f1m8imsn:active:before{border-left-style:solid;}", ".fxkorn8:active:before{border-bottom-style:solid;}", ".f1bb2bd5:active:before{border-top-color:var(--colorNeutralStroke1Pressed);}", ".fyhhhxy:active:before{border-right-color:var(--colorNeutralStroke1Pressed);}", ".flt5dqy:active:before{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fw019zk:active:before{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f7c36j8:active:before{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1tzhx6f:active:before{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f15ne2sm:active:before{border-top-right-radius:var(--borderRadiusCircular);}", ".f18vik6r:active:before{border-top-left-radius:var(--borderRadiusCircular);}", ".f2sk4z1:active:before{box-sizing:border-box;}", ".frq4ova:active:before{content:\"\";}", ".f416fxa:active:before{position:absolute;}", ".f1dodv9r:active:before{border-top-color:var(--colorTransparentStroke);}", ".f1shuycv:active:before{border-right-color:var(--colorTransparentStroke);}", ".f19t3g6y:active:before{border-left-color:var(--colorTransparentStroke);}", ".f6psttw:active:before{border-bottom-color:var(--colorTransparentStroke);}"],
232
+ "d": [".flqennz:before{bottom:0;}", ".fyg4ez2:before{border-top-width:calc(var(--strokeWidthThicker) / 2.0);}", ".f1cquro8:before{border-right-width:calc(var(--strokeWidthThicker) / 2.0);}", ".f1ro2kyx:before{border-left-width:calc(var(--strokeWidthThicker) / 2.0);}", ".ffvjagy:before{border-bottom-width:calc(var(--strokeWidthThicker) / 2.0);}", ".fvqq5f6:before{height:var(--strokeWidthThicker);}", ".frssmbg:before{left:12px;}", ".fxzecjq:before{right:12px;}", ".fa48u8l:before{bottom:8px;}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".f1itw4t3:before{top:8px;}", ".f1382oex:before{width:var(--strokeWidthThicker);}", ".f1kkj9j:before{border-top-width:calc(var(--strokeWidthThick) / 2.0);}", ".f14ip387:before{border-right-width:calc(var(--strokeWidthThick) / 2.0);}", ".f1uj4yfi:before{border-left-width:calc(var(--strokeWidthThick) / 2.0);}", ".f7vsd80:before{border-bottom-width:calc(var(--strokeWidthThick) / 2.0);}", ".f1y1nr8p:before{height:var(--strokeWidthThick);}", ".f1i98inn:before{left:6px;}", ".fadekk3:before{right:6px;}", ".f7efb1c:before{bottom:4px;}", ".f1q0qvio:before{top:4px;}"]
233
+ });
234
+
235
+ const useActiveIndicatorStyles = /*#__PURE__*/__styles({
236
+ "base": {
237
+ "F7kzw7": "f1vw7pcs",
238
+ "B13j16c": ["fi41b8y", "f1jbgs3z"],
239
+ "Bk8j60v": "f1p43pof",
240
+ "Bpbi4o9": ["f1jbgs3z", "fi41b8y"],
241
+ "rskduk": "f1iq3fds",
242
+ "Dctjco": ["f1r2jemi", "f11olovk"],
243
+ "J4s2b0": "fd0py6g",
244
+ "svcy3r": ["f11olovk", "f1r2jemi"],
245
+ "frdscb": ["fc4gh2t", "flndy84"],
246
+ "B9nohqn": ["flndy84", "fc4gh2t"],
247
+ "B1dhsta": ["fxgx2h0", "fh20ihy"],
248
+ "Bjdmjzx": ["fh20ihy", "fxgx2h0"],
96
249
  "oqd9ik": "ffdc0f3",
97
250
  "Bs6t6z0": "fqc6z8f",
98
251
  "Hdbjpj": "f11ef69",
99
- "mpb1vu": "f119hevp",
252
+ "Bunff0j": "fs357bs"
253
+ },
254
+ "selected": {
255
+ "F7kzw7": "f27ds8h",
256
+ "B13j16c": ["f2f2y1h", "fvkrelc"],
257
+ "Bk8j60v": "f1ta67ae",
258
+ "Bpbi4o9": ["fvkrelc", "f2f2y1h"],
259
+ "xay6vd": "f155wmea",
260
+ "F7whla": ["fz4itc5", "f10rdlzq"],
261
+ "Bkmnrzr": "f16a8na0",
262
+ "jjqiyg": ["f10rdlzq", "fz4itc5"],
263
+ "wo4o56": "fn9ghnu",
264
+ "Bm7x6ru": ["faeqx0n", "fyxlcfc"],
265
+ "id6p2d": "f1i10yqr",
266
+ "obzwb3": ["fyxlcfc", "faeqx0n"]
267
+ },
268
+ "disabled": {
269
+ "F7kzw7": "f8fvnjs",
270
+ "B13j16c": ["f1sie595", "f68ecio"],
271
+ "Bk8j60v": "f17l895u",
272
+ "Bpbi4o9": ["f68ecio", "f1sie595"]
273
+ },
274
+ "mediumHorizontal": {
100
275
  "Bj55yzk": "fw2wsqs",
101
- "jc51t6": ["f1l9humg", "f3c5rjh"],
102
- "cnmfks": ["f3c5rjh", "f1l9humg"],
103
- "Bt86n75": "fg6xmog"
276
+ "Bouo9z4": "f1dqk8ca",
277
+ "Bjz4wo8": ["f6x7jdz", "f18ezp6p"],
278
+ "B3zxwmv": "fvhr22v",
279
+ "exdlgl": ["f18ezp6p", "f6x7jdz"],
280
+ "mpb1vu": "f11eg72r",
281
+ "jc51t6": ["fohqjvh", "f3if56i"],
282
+ "cnmfks": ["f3if56i", "fohqjvh"]
104
283
  },
105
- "small": {
284
+ "mediumVertical": {
285
+ "Bj55yzk": "f1wxxv1q",
286
+ "Bouo9z4": "f1dqk8ca",
287
+ "Bjz4wo8": ["f6x7jdz", "f18ezp6p"],
288
+ "B3zxwmv": "fvhr22v",
289
+ "exdlgl": ["f18ezp6p", "f6x7jdz"],
290
+ "jc51t6": ["f1cvlmu2", "f15lyva8"],
291
+ "u6d25": "f1lbpgiz",
292
+ "Biobvvw": "fqauqbq"
293
+ },
294
+ "smallHorizontal": {
295
+ "Bj55yzk": "fw2wsqs",
296
+ "Bouo9z4": "fz0tshs",
297
+ "Bjz4wo8": ["fyhqs13", "f11og0us"],
298
+ "B3zxwmv": "f1qq4lft",
299
+ "exdlgl": ["f11og0us", "fyhqs13"],
300
+ "mpb1vu": "f4hj4m7",
106
301
  "jc51t6": ["f1i8k3s6", "fy447wy"],
107
302
  "cnmfks": ["fy447wy", "f1i8k3s6"]
108
- }
109
- }, {
110
- "d": [".f1mif8u4:after{background-color:none;}", ".fvxed1z:after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1j2a01o:after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fsamouo:after{border-top-right-radius:var(--borderRadiusMedium);}", ".f1aazreq:after{border-top-left-radius:var(--borderRadiusMedium);}", ".ffdc0f3:after{box-sizing:border-box;}", ".fqc6z8f:after{content:\"\";}", ".f11ef69:after{position:absolute;}", ".f119hevp:after{height:2px;}", ".fw2wsqs:after{bottom:0;}", ".f1l9humg:after{left:10px;}", ".f3c5rjh:after{right:10px;}", ".f1i8k3s6:after{left:6px;}", ".fy447wy:after{right:6px;}"],
111
- "h": [".fg6xmog:hover:after{background-color:var(--colorNeutralStroke1);}"]
112
- });
113
- /**
114
- * Indicator styles for the root slot when vertical.
115
- */
116
-
117
-
118
- const useVerticalIndicatorStyles = /*#__PURE__*/__styles({
119
- "base": {
120
- "B1dvbpk": "ffgj6zs",
121
- "px8gyy": ["f16to4m4", "f1ceoihi"],
122
- "B5c9fhp": ["f1ceoihi", "f16to4m4"],
123
- "Bhe99jt": ["fkibbow", "fnlo9u7"],
124
- "B2r1szc": ["fnlo9u7", "fkibbow"],
125
- "Bmqnesq": "f170vdtw",
126
- "rurcny": "fuzzvh5",
127
- "xx9plb": "fxf9f1y",
128
- "Bdn98qo": "f15bpuwh",
129
- "Byque4d": ["f1t0u0az", "fmlx6bj"],
130
- "Bf8kmfk": "f1bwym7p",
131
- "Bj2wrql": "fk3f4e0",
132
- "Cgij5x": "fl6lm7t"
133
303
  },
134
- "small": {
135
- "Bf8kmfk": "fp6nmmp",
136
- "Bj2wrql": "f14i0ki9"
304
+ "smallVertical": {
305
+ "Bj55yzk": "fu7gapb",
306
+ "Bouo9z4": "f1dqk8ca",
307
+ "Bjz4wo8": ["f6x7jdz", "f18ezp6p"],
308
+ "B3zxwmv": "fvhr22v",
309
+ "exdlgl": ["f18ezp6p", "f6x7jdz"],
310
+ "jc51t6": ["f1cvlmu2", "f15lyva8"],
311
+ "u6d25": "f1vmyuyf",
312
+ "Biobvvw": "fqauqbq"
137
313
  }
138
314
  }, {
139
- "d": [".ffgj6zs:before{background-color:none;}", ".f16to4m4:before{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1ceoihi:before{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fkibbow:before{border-top-right-radius:var(--borderRadiusMedium);}", ".fnlo9u7:before{border-top-left-radius:var(--borderRadiusMedium);}", ".f170vdtw:before{box-sizing:border-box;}", ".fuzzvh5:before{content:\"\";}", ".fxf9f1y:before{position:absolute;}", ".f15bpuwh:before{width:2px;}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".f1bwym7p:before{top:10px;}", ".fk3f4e0:before{bottom:10px;}", ".fp6nmmp:before{top:6px;}", ".f14i0ki9:before{bottom:6px;}"],
140
- "h": [".fl6lm7t:hover:before{background-color:var(--colorNeutralStroke1);}"]
315
+ "d": [".f1vw7pcs:after{border-top-color:var(--colorTransparentStroke);}", ".fi41b8y:after{border-right-color:var(--colorTransparentStroke);}", ".f1jbgs3z:after{border-left-color:var(--colorTransparentStroke);}", ".f1p43pof:after{border-bottom-color:var(--colorTransparentStroke);}", ".f1iq3fds:after{border-top-style:solid;}", ".f1r2jemi:after{border-right-style:solid;}", ".f11olovk:after{border-left-style:solid;}", ".fd0py6g:after{border-bottom-style:solid;}", ".fc4gh2t:after{border-bottom-right-radius:var(--borderRadiusCircular);}", ".flndy84:after{border-bottom-left-radius:var(--borderRadiusCircular);}", ".fxgx2h0:after{border-top-right-radius:var(--borderRadiusCircular);}", ".fh20ihy:after{border-top-left-radius:var(--borderRadiusCircular);}", ".ffdc0f3:after{box-sizing:border-box;}", ".fqc6z8f:after{content:\"\";}", ".f11ef69:after{position:absolute;}", ".fs357bs:after{z-index:1;}", ".f27ds8h:after{border-top-color:var(--colorCompoundBrandStroke);}", ".f2f2y1h:after{border-right-color:var(--colorCompoundBrandStroke);}", ".fvkrelc:after{border-left-color:var(--colorCompoundBrandStroke);}", ".f1ta67ae:after{border-bottom-color:var(--colorCompoundBrandStroke);}", ".f8fvnjs:after{border-top-color:var(--colorNeutralForegroundDisabled);}", ".f1sie595:after{border-right-color:var(--colorNeutralForegroundDisabled);}", ".f68ecio:after{border-left-color:var(--colorNeutralForegroundDisabled);}", ".f17l895u:after{border-bottom-color:var(--colorNeutralForegroundDisabled);}", ".fw2wsqs:after{bottom:0;}", ".f1dqk8ca:after{border-top-width:calc(var(--strokeWidthThicker) / 2.0);}", ".f6x7jdz:after{border-right-width:calc(var(--strokeWidthThicker) / 2.0);}", ".f18ezp6p:after{border-left-width:calc(var(--strokeWidthThicker) / 2.0);}", ".fvhr22v:after{border-bottom-width:calc(var(--strokeWidthThicker) / 2.0);}", ".f11eg72r:after{height:var(--strokeWidthThicker);}", ".fohqjvh:after{left:12px;}", ".f3if56i:after{right:12px;}", ".f1wxxv1q:after{bottom:8px;}", ".f1cvlmu2:after{left:0;}", ".f15lyva8:after{right:0;}", ".f1lbpgiz:after{top:8px;}", ".fqauqbq:after{width:var(--strokeWidthThicker);}", ".fz0tshs:after{border-top-width:calc(var(--strokeWidthThick) / 2.0);}", ".fyhqs13:after{border-right-width:calc(var(--strokeWidthThick) / 2.0);}", ".f11og0us:after{border-left-width:calc(var(--strokeWidthThick) / 2.0);}", ".f1qq4lft:after{border-bottom-width:calc(var(--strokeWidthThick) / 2.0);}", ".f4hj4m7:after{height:var(--strokeWidthThick);}", ".f1i8k3s6:after{left:6px;}", ".fy447wy:after{right:6px;}", ".fu7gapb:after{bottom:4px;}", ".f1vmyuyf:after{top:4px;}"],
316
+ "h": [".f155wmea:hover:after{border-top-color:var(--colorCompoundBrandStrokeHover);}", ".fz4itc5:hover:after{border-right-color:var(--colorCompoundBrandStrokeHover);}", ".f10rdlzq:hover:after{border-left-color:var(--colorCompoundBrandStrokeHover);}", ".f16a8na0:hover:after{border-bottom-color:var(--colorCompoundBrandStrokeHover);}"],
317
+ "a": [".fn9ghnu:active:after{border-top-color:var(--colorCompoundBrandStrokePressed);}", ".faeqx0n:active:after{border-right-color:var(--colorCompoundBrandStrokePressed);}", ".fyxlcfc:active:after{border-left-color:var(--colorCompoundBrandStrokePressed);}", ".f1i10yqr:active:after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}"]
141
318
  });
142
319
  /**
143
320
  * Styles for the icon slot.
@@ -148,7 +325,9 @@ const useIconStyles = /*#__PURE__*/__styles({
148
325
  "base": {
149
326
  "Bt984gj": "f122n59",
150
327
  "mc9l5x": "ftuwxu6",
151
- "Brf1p80": "f4d9j23"
328
+ "Brf1p80": "f4d9j23",
329
+ "B68tc82": "f1p9o1ba",
330
+ "Bmxbyg5": "f1sil6mw"
152
331
  },
153
332
  "small": {
154
333
  "Be2twd7": "fe5j1ua",
@@ -161,7 +340,7 @@ const useIconStyles = /*#__PURE__*/__styles({
161
340
  "a9b677": "f64fuq3"
162
341
  }
163
342
  }, {
164
- "d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}"]
343
+ "d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}"]
165
344
  });
166
345
  /**
167
346
  * Styles for the content slot (children)
@@ -170,36 +349,53 @@ const useIconStyles = /*#__PURE__*/__styles({
170
349
 
171
350
  const useContentStyles = /*#__PURE__*/__styles({
172
351
  "base": {
173
- "uwmqm3": ["f161knb0", "f12huiiw"],
174
- "z189sj": ["f12huiiw", "f161knb0"]
352
+ "Be2twd7": "fkhj508",
353
+ "Bhrd7zp": "figsok6",
354
+ "Bg96gwp": "f1i3iumi",
355
+ "B68tc82": "f1p9o1ba",
356
+ "Bmxbyg5": "f1sil6mw",
357
+ "z8tnut": "f1g0x7ka",
358
+ "z189sj": ["f12huiiw", "f161knb0"],
359
+ "Byoj8tv": "f1qch9an",
360
+ "uwmqm3": ["f161knb0", "f12huiiw"]
175
361
  },
176
- "small": {
177
- "uwmqm3": ["f161knb0", "f12huiiw"],
178
- "z189sj": ["f12huiiw", "f161knb0"]
362
+ "selected": {
363
+ "Be2twd7": "fkhj508",
364
+ "Bhrd7zp": "fl43uef",
365
+ "Bg96gwp": "f1i3iumi"
179
366
  }
180
367
  }, {
181
- "d": [".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}"]
368
+ "d": [".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1g0x7ka{padding-top:0;}", ".f12huiiw{padding-right:2px;}", ".f161knb0{padding-left:2px;}", ".f1qch9an{padding-bottom:0;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}"]
182
369
  });
183
370
  /**
184
371
  * Apply styling to the Tab slots based on the state
185
372
  */
186
- // eslint-disable-next-line @typescript-eslint/naming-convention
187
373
 
188
374
 
189
375
  export const useTabStyles_unstable = state => {
190
376
  const rootStyles = useRootStyles();
191
377
  const focusStyles = useFocusStyles();
192
- const horizontalIndicatorStyles = useHorizontalIndicatorStyles();
193
- const verticalIndicatorStyles = useVerticalIndicatorStyles();
378
+ const pendingIndicatorStyles = usePendingIndicatorStyles();
379
+ const activeIndicatorStyles = useActiveIndicatorStyles();
194
380
  const iconStyles = useIconStyles();
195
381
  const contentStyles = useContentStyles();
196
- state.root.className = mergeClasses(tabClassName, rootStyles.base, focusStyles.base, state.size === 'small' && rootStyles.small, state.appearance === 'subtle' && rootStyles.subtle, state.vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base, state.size === 'small' && (state.vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small), state.root.className);
382
+ const {
383
+ appearance,
384
+ disabled,
385
+ selected,
386
+ size,
387
+ vertical
388
+ } = state;
389
+ state.root.className = mergeClasses(tabClassNames.root, rootStyles.base, size !== 'small' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal), size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal), focusStyles.base, !disabled && appearance === 'subtle' && rootStyles.subtle, !disabled && appearance === 'transparent' && rootStyles.transparent, !disabled && selected && rootStyles.selected, disabled && rootStyles.disabled, // pending indicator (before pseudo element)
390
+ pendingIndicatorStyles.base, size !== 'small' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal), size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal), disabled && pendingIndicatorStyles.disabled, // active indicator (after pseudo element)
391
+ selected && activeIndicatorStyles.base, selected && !disabled && activeIndicatorStyles.selected, selected && size !== 'small' && (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal), selected && size === 'small' && (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal), selected && disabled && activeIndicatorStyles.disabled, state.root.className);
197
392
 
198
393
  if (state.icon) {
199
- state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);
394
+ state.icon.className = mergeClasses(tabClassNames.icon, iconStyles.base, iconStyles[size], state.icon.className);
200
395
  }
201
396
 
202
- state.content.className = mergeClasses(contentStyles.base, state.size === 'small' && contentStyles.small, state.content.className);
397
+ state.content.className = mergeClasses(tabClassNames.content, contentStyles.base, selected && contentStyles.selected, state.content.className);
398
+ useTabAnimatedIndicatorStyles_unstable(state);
203
399
  return state;
204
400
  };
205
401
  //# sourceMappingURL=useTabStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Tab/useTabStyles.ts"],"names":[],"mappings":"AAEA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,sBAAT,QAAuC,qBAAvC;AAEA,OAAO,MAAM,YAAY,GAAG,SAArB;AAEP;;AAEG;;AACH,MAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;AAoCA;;AAEG;;;AACH,MAAM,cAAc,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAvB;AAiBA;;AAEG;;;AACH,MAAM,4BAA4B,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAArC;AA2BA;;AAEG;;;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,CAAnC;;AAWA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,KAAK,CAAC,IAAP,CAA5B,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAnC;AACD;;AAED,EAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CACpC,aAAa,CAAC,IADsB,EAEpC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,aAAa,CAAC,KAFJ,EAGpC,KAAK,CAAC,OAAN,CAAc,SAHsB,CAAtC;AAMA,SAAO,KAAP;AACD,CA9BM","sourcesContent":["import type { TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { tabPendingDesignTokens } from '../../tab.constants';\n\nexport const tabClassName = 'fui-Tab';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n backgroundColor: 'none',\n ...shorthands.borderColor('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n columnGap: tabPendingDesignTokens.gap.medium,\n cursor: 'pointer',\n display: 'flex',\n flexDirection: 'row',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n ...shorthands.padding(tabPendingDesignTokens.tabPadding.medium),\n position: 'relative',\n ...shorthands.overflow('hidden'),\n },\n horizontal: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n vertical: {\n alignItems: 'center',\n justifyContent: 'flex-start',\n },\n small: {\n ...shorthands.padding(tabPendingDesignTokens.tabPadding.small),\n columnGap: tabPendingDesignTokens.gap.small,\n },\n subtle: {\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n },\n },\n});\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/**\n * Indicator styles for the root slot when horizontal.\n */\nconst useHorizontalIndicatorStyles = makeStyles({\n base: {\n ':after': {\n backgroundColor: 'none',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n height: tabPendingDesignTokens.indicatorThickness,\n bottom: '0',\n left: tabPendingDesignTokens.tabPadding.medium,\n right: tabPendingDesignTokens.tabPadding.medium,\n },\n ':hover': {\n ':after': {\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n small: {\n ':after': {\n left: tabPendingDesignTokens.tabPadding.small,\n right: tabPendingDesignTokens.tabPadding.small,\n },\n },\n});\n\n/**\n * Indicator styles for the root slot when vertical.\n */\nconst useVerticalIndicatorStyles = makeStyles({\n base: {\n ':before': {\n backgroundColor: 'none',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n width: tabPendingDesignTokens.indicatorThickness,\n left: '0',\n top: tabPendingDesignTokens.tabPadding.medium,\n bottom: tabPendingDesignTokens.tabPadding.medium,\n },\n ':hover': {\n ':before': {\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n small: {\n ':before': {\n top: tabPendingDesignTokens.tabPadding.small,\n bottom: tabPendingDesignTokens.tabPadding.small,\n },\n },\n});\n\n/**\n * Styles for the icon slot.\n */\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\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});\n\n/**\n * Styles for the content slot (children)\n */\nconst useContentStyles = makeStyles({\n base: {\n paddingLeft: tabPendingDesignTokens.contentPadding.medium,\n paddingRight: tabPendingDesignTokens.contentPadding.medium,\n },\n small: {\n paddingLeft: tabPendingDesignTokens.contentPadding.small,\n paddingRight: tabPendingDesignTokens.contentPadding.small,\n },\n});\n\n/**\n * Apply styling to the Tab slots based on the state\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const useTabStyles_unstable = (state: TabState): TabState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const horizontalIndicatorStyles = useHorizontalIndicatorStyles();\n const verticalIndicatorStyles = useVerticalIndicatorStyles();\n const iconStyles = useIconStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n tabClassName,\n rootStyles.base,\n focusStyles.base,\n state.size === 'small' && rootStyles.small,\n state.appearance === 'subtle' && rootStyles.subtle,\n state.vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base,\n state.size === 'small' && (state.vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small),\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n }\n\n state.content.className = mergeClasses(\n contentStyles.base,\n state.size === 'small' && contentStyles.small,\n state.content.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Tab/useTabStyles.ts"],"names":[],"mappings":"AAEA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SACE,wBADF,EAEE,oBAFF,EAGE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AC,eAA9F,CAdiC,EAejC,QAAQ,IAAI,sBAAsB,CAAC,QAfF,EAiBjC;AACA,EAAA,QAAQ,IAAI,qBAAqB,CAAC,IAlBD,EAmBjC,QAAQ,IAAI,CAAC,QAAb,IAAyB,qBAAqB,CAAC,QAnBd,EAoBjC,QAAQ,IACN,IAAI,KAAK,OADX,KAEG,QAAQ,GAAG,qBAAqB,CAAC,cAAzB,GAA0C,qBAAqB,CAAC,gBAF3E,CApBiC,EAuBjC,QAAQ,IACN,IAAI,KAAK,OADX,KAEG,QAAQ,GAAG,qBAAqB,CAAC,aAAzB,GAAyC,qBAAqB,CAAC,eAF1E,CAvBiC,EA0BjC,QAAQ,IAAI,QAAZ,IAAwB,qBAAqB,CAAC,QA1Bb,EA2BjC,KAAK,CAAC,IAAN,CAAW,SA3BsB,CAAnC;;AA8BA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,aAAa,CAAC,IAAf,EAAqB,UAAU,CAAC,IAAhC,EAAsC,UAAU,CAAC,IAAD,CAAhD,EAAwD,KAAK,CAAC,IAAN,CAAW,SAAnE,CAAnC;AACD;;AAED,EAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CACpC,aAAa,CAAC,OADsB,EAEpC,aAAa,CAAC,IAFsB,EAGpC,QAAQ,IAAI,aAAa,CAAC,QAHU,EAIpC,KAAK,CAAC,OAAN,CAAc,SAJsB,CAAtC;AAOA,EAAA,sCAAsC,CAAC,KAAD,CAAtC;AAEA,SAAO,KAAP;AACD,CAtDM","sourcesContent":["import type { TabSlots, TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n pendingContentSizeTokens,\n pendingSpacingTokens,\n tabIndicatorPadding,\n tabIndicatorStrokeWidths,\n} from '../../tab.constants';\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\n// TODO temporary export to pass conformance test.\nexport const tabClassName = tabClassNames.root;\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: 'flex',\n flexDirection: 'row',\n fontFamily: tokens.fontFamilyBase,\n lineHeight: tokens.lineHeightBase300,\n outlineStyle: 'none',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n textTransform: 'none',\n },\n mediumHorizontal: {\n columnGap: pendingSpacingTokens.sNudge,\n justifyContent: 'center',\n ...shorthands.padding(pendingSpacingTokens.m, pendingSpacingTokens.mNudge),\n },\n mediumVertical: {\n columnGap: pendingSpacingTokens.sNudge,\n justifyContent: 'flex-start',\n minWidth: '120px',\n ...shorthands.padding(pendingSpacingTokens.sNudge, pendingSpacingTokens.mNudge),\n },\n smallHorizontal: {\n columnGap: pendingSpacingTokens.xxs,\n ...shorthands.padding(pendingSpacingTokens.sNudge, pendingSpacingTokens.sNudge),\n },\n smallVertical: {\n columnGap: pendingSpacingTokens.xxs,\n ...shorthands.padding(pendingSpacingTokens.xxs, pendingSpacingTokens.sNudge),\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: 'none',\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n },\n ':active:before': {\n backgroundColor: 'none',\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n },\n },\n disabled: {\n ':hover:before': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n ':active:before': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n mediumHorizontal: {\n ':before': {\n bottom: 0,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.mediumHorizontal} / 2.0)`),\n height: tabIndicatorStrokeWidths.mediumHorizontal,\n left: tabIndicatorPadding.mediumHorizontal,\n right: tabIndicatorPadding.mediumHorizontal,\n },\n },\n mediumVertical: {\n ':before': {\n bottom: tabIndicatorPadding.mediumVertical,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.mediumVertical} / 2.0)`),\n left: 0,\n top: tabIndicatorPadding.mediumVertical,\n width: tabIndicatorStrokeWidths.mediumVertical,\n },\n },\n smallHorizontal: {\n ':before': {\n bottom: 0,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.smallHorizontal} / 2.0)`),\n height: tabIndicatorStrokeWidths.smallHorizontal,\n left: tabIndicatorPadding.smallHorizontal,\n right: tabIndicatorPadding.smallHorizontal,\n },\n },\n smallVertical: {\n ':before': {\n bottom: tabIndicatorPadding.smallVertical,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.smallVertical} / 2.0)`),\n left: 0,\n top: tabIndicatorPadding.smallVertical,\n width: tabIndicatorStrokeWidths.smallVertical,\n },\n },\n});\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n ':after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n zIndex: 1,\n },\n },\n selected: {\n ':after': {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke),\n },\n ':hover:after': {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokeHover),\n },\n ':active:after': {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokePressed),\n },\n },\n disabled: {\n ':after': {\n ...shorthands.borderColor(tokens.colorNeutralForegroundDisabled),\n },\n },\n mediumHorizontal: {\n ':after': {\n bottom: '0',\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.mediumHorizontal} / 2.0)`),\n height: tabIndicatorStrokeWidths.mediumHorizontal,\n left: tabIndicatorPadding.mediumHorizontal,\n right: tabIndicatorPadding.mediumHorizontal,\n },\n },\n mediumVertical: {\n ':after': {\n bottom: tabIndicatorPadding.mediumVertical,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.mediumVertical} / 2.0)`),\n left: 0,\n top: tabIndicatorPadding.mediumVertical,\n width: tabIndicatorStrokeWidths.mediumVertical,\n },\n },\n smallHorizontal: {\n ':after': {\n bottom: 0,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.smallHorizontal} / 2.0)`),\n height: tabIndicatorStrokeWidths.smallHorizontal,\n left: tabIndicatorPadding.smallHorizontal,\n right: tabIndicatorPadding.smallHorizontal,\n },\n },\n smallVertical: {\n ':after': {\n bottom: tabIndicatorPadding.smallVertical,\n ...shorthands.borderWidth(`calc(${tabIndicatorStrokeWidths.smallVertical} / 2.0)`),\n left: '0',\n top: tabIndicatorPadding.smallVertical,\n width: tabIndicatorStrokeWidths.smallVertical,\n },\n },\n});\n\n/**\n * Styles for the icon slot.\n */\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n ...shorthands.overflow('hidden'),\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});\n\n/**\n * Styles for the content slot (children)\n */\nconst useContentStyles = makeStyles({\n base: {\n ...pendingContentSizeTokens.body1,\n ...shorthands.overflow('hidden'),\n // content padding is the same for medium & small, horiztonal & vertical\n ...shorthands.padding(0, pendingSpacingTokens.xxs),\n },\n selected: {\n ...pendingContentSizeTokens.body1Strong,\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 size !== 'small' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal),\n size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal),\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.mediumVertical : pendingIndicatorStyles.mediumHorizontal),\n size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal),\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.mediumVertical : activeIndicatorStyles.mediumHorizontal),\n selected &&\n size === 'small' &&\n (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal),\n selected && disabled && activeIndicatorStyles.disabled,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(tabClassNames.icon, iconStyles.base, iconStyles[size], state.icon.className);\n }\n\n state.content.className = mergeClasses(\n tabClassNames.content,\n contentStyles.base,\n selected && contentStyles.selected,\n state.content.className,\n );\n\n useTabAnimatedIndicatorStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,14 +1,17 @@
1
1
  import * as React from 'react';
2
2
  import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
3
  import { TabValue } from '../Tab/Tab.types';
4
- export declare type RegisterTabData = {
4
+ export declare type TabRegisterData = {
5
5
  /**
6
- * The value of the selected tab.
6
+ * The value of the tab.
7
7
  */
8
8
  value: TabValue;
9
+ /**
10
+ * The reference to the tab HTML element.
11
+ */
9
12
  ref: React.RefObject<HTMLElement>;
10
13
  };
11
- export declare type RegisterTabEventHandler = (data: RegisterTabData) => void;
14
+ export declare type RegisterTabEventHandler = (data: TabRegisterData) => void;
12
15
  export declare type SelectTabData = {
13
16
  /**
14
17
  * The value of the selected tab.
@@ -32,6 +35,11 @@ declare type TabListCommons = {
32
35
  * @default 'transparent'
33
36
  */
34
37
  appearance?: 'transparent' | 'subtle';
38
+ /**
39
+ * A tab list can be set to disable interaction.
40
+ * @default false
41
+ */
42
+ disabled?: boolean;
35
43
  /**
36
44
  * Raised when a tab is selected.
37
45
  */
@@ -62,7 +70,7 @@ export declare type TabListProps = ComponentProps<TabListSlots> & TabListCommons
62
70
  */
63
71
  defaultSelectedValue?: TabValue;
64
72
  };
65
- export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'size' | 'vertical'>> & {
73
+ export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {
66
74
  /** A callback to allow a tab to register itself with the tab list. */
67
75
  onRegister: RegisterTabEventHandler;
68
76
  /** A callback to allow a tab to unregister itself with the tab list. */
@@ -71,6 +79,14 @@ export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | '
71
79
  * A callback to allow a tab to select itself when pressed.
72
80
  */
73
81
  onSelect: SelectTabEventHandler;
82
+ /**
83
+ * Gets the registered tab data along with current and previous selected values.
84
+ */
85
+ getRegisteredTabs: () => {
86
+ selectedValue?: TabValue;
87
+ previousSelectedValue?: TabValue;
88
+ registeredTabs: Record<string, TabRegisterData>;
89
+ };
74
90
  };
75
91
  /**
76
92
  * Context values used in rendering TabList.
@@ -81,19 +97,8 @@ export declare type TabListContextValues = {
81
97
  */
82
98
  tabList: TabListContextValue;
83
99
  };
84
- /**
85
- * A bounding rectangle of a tab
86
- */
87
- export declare type TabContentRect = {
88
- x: number;
89
- y: number;
90
- width: number;
91
- height: number;
92
- };
93
100
  /**
94
101
  * State used in rendering TabList.
95
102
  */
96
- export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue & {
97
- selectedTabRect?: TabContentRect;
98
- };
103
+ export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue;
99
104
  export {};