@fluentui/react-tabs 9.0.0-beta.7 → 9.0.0-rc.2

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 (91) hide show
  1. package/CHANGELOG.json +377 -1
  2. package/CHANGELOG.md +101 -3
  3. package/dist/{react-tabs.d.ts → index.d.ts} +77 -70
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/components/Tab/Tab.types.js.map +1 -1
  6. package/lib/components/Tab/index.js +1 -0
  7. package/lib/components/Tab/index.js.map +1 -1
  8. package/lib/components/Tab/renderTab.js +1 -2
  9. package/lib/components/Tab/renderTab.js.map +1 -1
  10. package/lib/components/Tab/useTab.js +28 -29
  11. package/lib/components/Tab/useTab.js.map +1 -1
  12. package/lib/components/Tab/useTabAnimatedIndicator.js +134 -0
  13. package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  14. package/lib/components/Tab/useTabStyles.js +222 -88
  15. package/lib/components/Tab/useTabStyles.js.map +1 -1
  16. package/lib/components/TabList/TabList.types.js.map +1 -1
  17. package/lib/components/TabList/TabListContext.js +6 -0
  18. package/lib/components/TabList/TabListContext.js.map +1 -1
  19. package/lib/components/TabList/renderTabList.js +0 -1
  20. package/lib/components/TabList/renderTabList.js.map +1 -1
  21. package/lib/components/TabList/useTabList.js +28 -52
  22. package/lib/components/TabList/useTabList.js.map +1 -1
  23. package/lib/components/TabList/useTabListContextValues.js +4 -0
  24. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  25. package/lib/components/TabList/useTabListStyles.js +16 -91
  26. package/lib/components/TabList/useTabListStyles.js.map +1 -1
  27. package/lib/index.js +2 -2
  28. package/lib/index.js.map +1 -1
  29. package/lib-commonjs/components/Tab/index.js +2 -0
  30. package/lib-commonjs/components/Tab/index.js.map +1 -1
  31. package/lib-commonjs/components/Tab/renderTab.js +1 -2
  32. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  33. package/lib-commonjs/components/Tab/useTab.js +28 -29
  34. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  35. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +148 -0
  36. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  37. package/lib-commonjs/components/Tab/useTabStyles.js +222 -88
  38. package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
  39. package/lib-commonjs/components/TabList/TabListContext.js +6 -0
  40. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  41. package/lib-commonjs/components/TabList/renderTabList.js +0 -1
  42. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
  43. package/lib-commonjs/components/TabList/useTabList.js +27 -51
  44. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  45. package/lib-commonjs/components/TabList/useTabListContextValues.js +4 -0
  46. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  47. package/lib-commonjs/components/TabList/useTabListStyles.js +15 -93
  48. package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
  49. package/lib-commonjs/index.js +76 -3
  50. package/lib-commonjs/index.js.map +1 -1
  51. package/package.json +19 -21
  52. package/lib/Tab.d.ts +0 -1
  53. package/lib/TabList.d.ts +0 -1
  54. package/lib/components/Tab/Tab.d.ts +0 -6
  55. package/lib/components/Tab/Tab.types.d.ts +0 -52
  56. package/lib/components/Tab/index.d.ts +0 -5
  57. package/lib/components/Tab/renderTab.d.ts +0 -5
  58. package/lib/components/Tab/useTab.d.ts +0 -12
  59. package/lib/components/Tab/useTabStyles.d.ts +0 -6
  60. package/lib/components/TabList/TabList.d.ts +0 -6
  61. package/lib/components/TabList/TabList.types.d.ts +0 -99
  62. package/lib/components/TabList/TabListContext.d.ts +0 -3
  63. package/lib/components/TabList/index.d.ts +0 -5
  64. package/lib/components/TabList/renderTabList.d.ts +0 -5
  65. package/lib/components/TabList/useTabList.d.ts +0 -12
  66. package/lib/components/TabList/useTabListContextValues.d.ts +0 -2
  67. package/lib/components/TabList/useTabListStyles.d.ts +0 -9
  68. package/lib/index.d.ts +0 -2
  69. package/lib/tab.constants.d.ts +0 -15
  70. package/lib/tab.constants.js +0 -17
  71. package/lib/tab.constants.js.map +0 -1
  72. package/lib-commonjs/Tab.d.ts +0 -1
  73. package/lib-commonjs/TabList.d.ts +0 -1
  74. package/lib-commonjs/components/Tab/Tab.d.ts +0 -6
  75. package/lib-commonjs/components/Tab/Tab.types.d.ts +0 -52
  76. package/lib-commonjs/components/Tab/index.d.ts +0 -5
  77. package/lib-commonjs/components/Tab/renderTab.d.ts +0 -5
  78. package/lib-commonjs/components/Tab/useTab.d.ts +0 -12
  79. package/lib-commonjs/components/Tab/useTabStyles.d.ts +0 -6
  80. package/lib-commonjs/components/TabList/TabList.d.ts +0 -6
  81. package/lib-commonjs/components/TabList/TabList.types.d.ts +0 -99
  82. package/lib-commonjs/components/TabList/TabListContext.d.ts +0 -3
  83. package/lib-commonjs/components/TabList/index.d.ts +0 -5
  84. package/lib-commonjs/components/TabList/renderTabList.d.ts +0 -5
  85. package/lib-commonjs/components/TabList/useTabList.d.ts +0 -12
  86. package/lib-commonjs/components/TabList/useTabListContextValues.d.ts +0 -2
  87. package/lib-commonjs/components/TabList/useTabListStyles.d.ts +0 -9
  88. package/lib-commonjs/index.d.ts +0 -2
  89. package/lib-commonjs/tab.constants.d.ts +0 -15
  90. package/lib-commonjs/tab.constants.js +0 -23
  91. package/lib-commonjs/tab.constants.js.map +0 -1
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTabAnimatedIndicatorStyles_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_1 = /*#__PURE__*/require("@griffel/react");
11
+
12
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
13
+
14
+ const TabListContext_1 = /*#__PURE__*/require("../TabList/TabListContext");
15
+
16
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme"); // eslint-disable-next-line @typescript-eslint/naming-convention
17
+
18
+
19
+ const tabIndicatorCssVars_unstable = {
20
+ offsetVar: '--fui-Tab__indicator--offset',
21
+ scaleVar: '--fui-Tab__indicator--scale'
22
+ };
23
+
24
+ const useActiveIndicatorStyles = /*#__PURE__*/react_1.__styles({
25
+ "base": {
26
+ "B68tc82": "f1mtd64y",
27
+ "Bmxbyg5": "f1y7q3j9"
28
+ },
29
+ "animated": {
30
+ "wbfbqe": "fopw4to",
31
+ "mafdb0": "f1gswng4",
32
+ "Jgwf15": "fjw9r1k",
33
+ "Bh4j9q1": "f1cif4e6",
34
+ "Gk6w4d": "fa42t5a"
35
+ },
36
+ "horizontal": {
37
+ "Blx6ldh": ["f1g89gis", "fcjnwxz"],
38
+ "xn0juu": "f7m34ad"
39
+ },
40
+ "vertical": {
41
+ "Blx6ldh": "fqfgdei",
42
+ "xn0juu": "fwvsziq"
43
+ }
44
+ }, {
45
+ "d": [".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".fopw4to:after{transition-property:transform;}", ".f1gswng4:after{transition-duration:var(--durationSlow);}", ".fjw9r1k:after{transition-timing-function:var(--curveDecelerateMax);}", ".f1g89gis:after{transform-origin:left;}", ".fcjnwxz:after{transform-origin:right;}", ".f7m34ad:after{-webkit-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-moz-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-ms-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));}", ".fqfgdei:after{transform-origin:top;}", ".fwvsziq:after{-webkit-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-moz-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-ms-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));}"],
46
+ "t": ["@media (prefers-reduced-motion: reduce){.f1cif4e6:after{transition-property:none;}}", "@media (prefers-reduced-motion: reduce){.fa42t5a:after{transition-duration:0.01ms;}}"]
47
+ });
48
+
49
+ const calculateTabRect = element => {
50
+ var _a;
51
+
52
+ if (element) {
53
+ const parentRect = ((_a = element.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || {
54
+ x: 0,
55
+ y: 0,
56
+ width: 0,
57
+ height: 0
58
+ };
59
+ const tabRect = element.getBoundingClientRect();
60
+ return {
61
+ x: tabRect.x - parentRect.x,
62
+ y: tabRect.y - parentRect.y,
63
+ width: tabRect.width,
64
+ height: tabRect.height
65
+ };
66
+ }
67
+
68
+ return undefined;
69
+ };
70
+
71
+ const getRegisteredTabRect = (registeredTabs, value) => {
72
+ var _a;
73
+
74
+ const element = value !== undefined && value !== null ? (_a = registeredTabs[JSON.stringify(value)]) === null || _a === void 0 ? void 0 : _a.ref.current : undefined;
75
+ return element ? calculateTabRect(element) : undefined;
76
+ };
77
+ /**
78
+ * Adds additional styling to the active tab selection indicator to create a sliding animation.
79
+ */
80
+
81
+
82
+ const useTabAnimatedIndicatorStyles_unstable = state => {
83
+ const {
84
+ disabled,
85
+ selected,
86
+ vertical
87
+ } = state;
88
+ const activeIndicatorStyles = useActiveIndicatorStyles();
89
+ const [lastAnimatedFrom, setLastAnimatedFrom] = React.useState();
90
+ const [animationValues, setAnimationValues] = React.useState({
91
+ offset: 0,
92
+ scale: 1
93
+ });
94
+ const getRegisteredTabs = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, ctx => ctx.getRegisteredTabs);
95
+ React.useEffect(() => {
96
+ if (lastAnimatedFrom) {
97
+ setAnimationValues({
98
+ offset: 0,
99
+ scale: 1
100
+ });
101
+ }
102
+ }, [lastAnimatedFrom]);
103
+
104
+ if (selected) {
105
+ const {
106
+ previousSelectedValue,
107
+ selectedValue,
108
+ registeredTabs
109
+ } = getRegisteredTabs();
110
+ const previousSelectedTabRect = getRegisteredTabRect(registeredTabs, previousSelectedValue);
111
+ const selectedTabRect = getRegisteredTabRect(registeredTabs, selectedValue);
112
+
113
+ if (selectedTabRect && previousSelectedTabRect && previousSelectedValue && lastAnimatedFrom !== previousSelectedValue) {
114
+ const offset = vertical ? previousSelectedTabRect.y - selectedTabRect.y : previousSelectedTabRect.x - selectedTabRect.x;
115
+ const scale = vertical ? previousSelectedTabRect.height / selectedTabRect.height : previousSelectedTabRect.width / selectedTabRect.width;
116
+ setAnimationValues({
117
+ offset,
118
+ scale
119
+ });
120
+ setLastAnimatedFrom(previousSelectedValue);
121
+ }
122
+ } else if (lastAnimatedFrom) {
123
+ // need to clear the last animated from so that if this tab is selected again
124
+ // from the same previous tab as last time, that animation still happens.
125
+ setLastAnimatedFrom(undefined);
126
+ } // do not apply any animation if the tab is disabled
127
+
128
+
129
+ if (disabled) {
130
+ return state;
131
+ } // the animation should only happen as the selection indicator returns to its
132
+ // original position and not when set at the previous tabs position.
133
+
134
+
135
+ const animating = animationValues.offset === 0 && animationValues.scale === 1;
136
+ state.root.className = react_1.mergeClasses(state.root.className, selected && activeIndicatorStyles.base, selected && animating && activeIndicatorStyles.animated, selected && (vertical ? activeIndicatorStyles.vertical : activeIndicatorStyles.horizontal));
137
+ const rootCssVars = {
138
+ [tabIndicatorCssVars_unstable.offsetVar]: `${animationValues.offset}px`,
139
+ [tabIndicatorCssVars_unstable.scaleVar]: `${animationValues.scale}`
140
+ };
141
+ state.root.style = { ...rootCssVars,
142
+ ...state.root.style
143
+ };
144
+ return state;
145
+ };
146
+
147
+ exports.useTabAnimatedIndicatorStyles_unstable = useTabAnimatedIndicatorStyles_unstable;
148
+ //# sourceMappingURL=useTabAnimatedIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Tab/useTabAnimat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,CAJa,CAAvB;AAOA,QAAM,WAAW,GAAG;AAClB,KAAC,4BAA4B,CAAC,SAA9B,GAA0C,GAAG,eAAe,CAAC,MAAM,IADjD;AAElB,KAAC,4BAA4B,CAAC,QAA9B,GAAyC,GAAG,eAAe,CAAC,KAAK;AAF/C,GAApB;AAKA,EAAA,KAAK,CAAC,IAAN,CAAW,KAAX,GAAmB,EACjB,GAAG,WADc;AAEjB,OAAG,KAAK,CAAC,IAAN,CAAW;AAFG,GAAnB;AAKA,SAAO,KAAP;AACD,CArEM;;AAAM,OAAA,CAAA,sCAAA,GAAsC,sCAAtC","sourcesContent":["import * as React from 'react';\nimport type { TabState, TabValue } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport { TabListContext } from '../TabList/TabListContext';\nimport { TabRegisterData } from '../TabList/TabList.types';\nimport { tokens } from '@fluentui/react-theme';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst tabIndicatorCssVars_unstable = {\n offsetVar: '--fui-Tab__indicator--offset',\n scaleVar: '--fui-Tab__indicator--scale',\n};\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n // overflow is required to allow the selection indicator to animate outside the tab area.\n ...shorthands.overflow('visible'),\n },\n animated: {\n ':after': {\n transitionProperty: 'transform',\n transitionDuration: `${tokens.durationSlow}`,\n transitionTimingFunction: `${tokens.curveDecelerateMax}`,\n },\n '@media (prefers-reduced-motion: reduce)': {\n ':after': {\n transitionProperty: 'none',\n transitionDuration: '0.01ms',\n },\n },\n },\n horizontal: {\n ':after': {\n transformOrigin: 'left',\n transform: `translateX(var(${tabIndicatorCssVars_unstable.offsetVar}))\n scaleX(var(${tabIndicatorCssVars_unstable.scaleVar}))`,\n },\n },\n vertical: {\n ':after': {\n transformOrigin: 'top',\n transform: `translateY(var(${tabIndicatorCssVars_unstable.offsetVar}))\n scaleY(var(${tabIndicatorCssVars_unstable.scaleVar}))`,\n },\n },\n});\n\nconst calculateTabRect = (element: HTMLElement) => {\n if (element) {\n const parentRect = element.parentElement?.getBoundingClientRect() || { x: 0, y: 0, width: 0, height: 0 };\n const tabRect = element.getBoundingClientRect();\n\n return {\n x: tabRect.x - parentRect.x,\n y: tabRect.y - parentRect.y,\n width: tabRect.width,\n height: tabRect.height,\n };\n }\n return undefined;\n};\n\nconst getRegisteredTabRect = (registeredTabs: Record<string, TabRegisterData>, value?: TabValue) => {\n const element =\n value !== undefined && value !== null ? registeredTabs[JSON.stringify(value)]?.ref.current : undefined;\n return element ? calculateTabRect(element) : undefined;\n};\n\n/**\n * Adds additional styling to the active tab selection indicator to create a sliding animation.\n */\nexport const useTabAnimatedIndicatorStyles_unstable = (state: TabState): TabState => {\n const { disabled, selected, vertical } = state;\n\n const activeIndicatorStyles = useActiveIndicatorStyles();\n const [lastAnimatedFrom, setLastAnimatedFrom] = React.useState<TabValue>();\n const [animationValues, setAnimationValues] = React.useState({ offset: 0, scale: 1 });\n const getRegisteredTabs = useContextSelector(TabListContext, ctx => ctx.getRegisteredTabs);\n\n React.useEffect(() => {\n if (lastAnimatedFrom) {\n setAnimationValues({ offset: 0, scale: 1 });\n }\n }, [lastAnimatedFrom]);\n\n if (selected) {\n const { previousSelectedValue, selectedValue, registeredTabs } = getRegisteredTabs();\n const previousSelectedTabRect = getRegisteredTabRect(registeredTabs, previousSelectedValue);\n const selectedTabRect = getRegisteredTabRect(registeredTabs, selectedValue);\n\n if (\n selectedTabRect &&\n previousSelectedTabRect &&\n previousSelectedValue &&\n lastAnimatedFrom !== previousSelectedValue\n ) {\n const offset = vertical\n ? previousSelectedTabRect.y - selectedTabRect.y\n : previousSelectedTabRect.x - selectedTabRect.x;\n\n const scale = vertical\n ? previousSelectedTabRect.height / selectedTabRect.height\n : previousSelectedTabRect.width / selectedTabRect.width;\n\n setAnimationValues({ offset, scale });\n setLastAnimatedFrom(previousSelectedValue);\n }\n } else if (lastAnimatedFrom) {\n // need to clear the last animated from so that if this tab is selected again\n // from the same previous tab as last time, that animation still happens.\n setLastAnimatedFrom(undefined);\n }\n\n // do not apply any animation if the tab is disabled\n if (disabled) {\n return state;\n }\n\n // the animation should only happen as the selection indicator returns to its\n // original position and not when set at the previous tabs position.\n const animating = animationValues.offset === 0 && animationValues.scale === 1;\n\n state.root.className = mergeClasses(\n state.root.className,\n selected && activeIndicatorStyles.base,\n selected && animating && activeIndicatorStyles.animated,\n selected && (vertical ? activeIndicatorStyles.vertical : activeIndicatorStyles.horizontal),\n );\n\n const rootCssVars = {\n [tabIndicatorCssVars_unstable.offsetVar]: `${animationValues.offset}px`,\n [tabIndicatorCssVars_unstable.scaleVar]: `${animationValues.scale}`,\n };\n\n state.root.style = {\n ...rootCssVars,\n ...state.root.style,\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useTabStyles_unstable = exports.tabClassName = void 0;
6
+ exports.useTabStyles_unstable = exports.tabClassName = exports.tabClassNames = void 0;
7
7
 
8
8
  const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
@@ -11,16 +11,24 @@ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
11
 
12
12
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
13
13
 
14
- const tab_constants_1 = /*#__PURE__*/require("../../tab.constants");
14
+ const useTabAnimatedIndicator_1 = /*#__PURE__*/require("./useTabAnimatedIndicator");
15
15
 
16
- exports.tabClassName = 'fui-Tab';
16
+ exports.tabClassNames = {
17
+ root: 'fui-Tab',
18
+ icon: 'fui-Tab__icon',
19
+ content: 'fui-Tab__content'
20
+ }; // TODO temporary export to pass conformance test.
21
+
22
+ exports.tabClassName = exports.tabClassNames.root;
17
23
  /**
18
24
  * Styles for the root slot
19
25
  */
20
26
 
27
+ /* eslint-disable @typescript-eslint/naming-convention */
28
+
21
29
  const useRootStyles = /*#__PURE__*/react_1.__styles({
22
30
  "base": {
23
- "De3pzq": "flu3bqm",
31
+ "Bt984gj": "f122n59",
24
32
  "g2u3we": "fwhevhj",
25
33
  "h3c5rm": ["f61n433", "f1q8l70w"],
26
34
  "B9xav0g": "fv1dfc8",
@@ -29,47 +37,101 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
29
37
  "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
30
38
  "B7oj6ja": ["f1jar5jt", "fyu767a"],
31
39
  "Btl43ni": ["fyu767a", "f1jar5jt"],
32
- "B4j52fo": "f192inf7",
33
- "Bekrc4i": ["f5tn483", "f1ojsxk5"],
34
- "Bn0qgzm": "f1vxd6vx",
35
- "ibv6hh": ["f1ojsxk5", "f5tn483"],
36
- "i8kkvl": "fgfbwa2",
40
+ "B4j52fo": "fre7gi1",
41
+ "Bekrc4i": ["f1358rze", "f1rvrf73"],
42
+ "Bn0qgzm": "fqdk4by",
43
+ "ibv6hh": ["f1rvrf73", "f1358rze"],
37
44
  "Bceei9c": "f1k6fduh",
38
- "mc9l5x": "f22iagw",
39
- "Beiy3e4": "f1063pyq",
45
+ "mc9l5x": "f13qh94s",
46
+ "Bnnss6s": "fi64zpg",
47
+ "Bxotwcr": "f1u07yai",
48
+ "Budl1dq": "frn2hmy",
49
+ "wkccdc": "f1olsevy",
40
50
  "Bahqtrf": "fk6fouc",
41
- "Be2twd7": "fkhj508",
42
51
  "Bg96gwp": "f1i3iumi",
43
- "z8tnut": "f1809wu7",
44
- "z189sj": ["f81rol6", "frdkuqy"],
45
- "Byoj8tv": "f1fow5ox",
46
- "uwmqm3": ["frdkuqy", "f81rol6"],
52
+ "oeaueh": "f1s6fcnf",
47
53
  "qhf8xq": "f10pi13n",
48
54
  "B68tc82": "f1p9o1ba",
49
- "Bmxbyg5": "f1sil6mw"
55
+ "Bmxbyg5": "f1sil6mw",
56
+ "B9bfxx9": "f1cxpek8"
50
57
  },
51
58
  "horizontal": {
52
- "Bt984gj": "f122n59",
53
59
  "Brf1p80": "f4d9j23"
54
60
  },
55
61
  "vertical": {
56
- "Bt984gj": "f122n59",
57
- "Brf1p80": "fbhxue7"
62
+ "Brf1p80": "f1s9ku6b"
58
63
  },
59
- "small": {
60
- "z8tnut": "f1xp5gbu",
61
- "z189sj": ["f1sgzk6v", "f1bg5zqg"],
62
- "Byoj8tv": "f1d7kygh",
63
- "uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
64
- "i8kkvl": "f16mnhsx"
64
+ "mediumHorizontal": {
65
+ "i8kkvl": "f1rjii52",
66
+ "z8tnut": "f5yzyt",
67
+ "z189sj": ["f11gcy0p", "f1ng84yb"],
68
+ "Byoj8tv": "fx3omr",
69
+ "uwmqm3": ["f1ng84yb", "f11gcy0p"]
70
+ },
71
+ "mediumVertical": {
72
+ "i8kkvl": "f1rjii52",
73
+ "z8tnut": "fp2oml8",
74
+ "z189sj": ["f11gcy0p", "f1ng84yb"],
75
+ "Byoj8tv": "f1tdddsa",
76
+ "uwmqm3": ["f1ng84yb", "f11gcy0p"]
77
+ },
78
+ "smallHorizontal": {
79
+ "i8kkvl": "f14mj54c",
80
+ "z8tnut": "fp2oml8",
81
+ "z189sj": ["fdw0yi8", "fk8j09s"],
82
+ "Byoj8tv": "f1tdddsa",
83
+ "uwmqm3": ["fk8j09s", "fdw0yi8"]
84
+ },
85
+ "smallVertical": {
86
+ "i8kkvl": "f14mj54c",
87
+ "z8tnut": "fclwglc",
88
+ "z189sj": ["fdw0yi8", "fk8j09s"],
89
+ "Byoj8tv": "fywfov9",
90
+ "uwmqm3": ["fk8j09s", "fdw0yi8"]
91
+ },
92
+ "transparent": {
93
+ "De3pzq": "f1c21dwh",
94
+ "Jwef8y": "fjxutwb",
95
+ "ecr2s2": "fophhak",
96
+ "Bptxc3x": "fmmjozx",
97
+ "B076xvk": "f1mfqf41",
98
+ "q9r9w5": "f10aiid4",
99
+ "cl4aha": "fpkze5g",
100
+ "Bk452zc": "f149wc3x",
101
+ "a4hkcw": "fjioou7"
65
102
  },
66
103
  "subtle": {
67
- "Jwef8y": "f1knas48"
104
+ "De3pzq": "fhovq9v",
105
+ "Jwef8y": "f1t94bn6",
106
+ "ecr2s2": "f1wfn5kd",
107
+ "Bptxc3x": "fmmjozx",
108
+ "B076xvk": "f1mfqf41",
109
+ "q9r9w5": "f10aiid4",
110
+ "cl4aha": "fpkze5g",
111
+ "Bk452zc": "f149wc3x",
112
+ "a4hkcw": "fjioou7"
113
+ },
114
+ "disabled": {
115
+ "De3pzq": "f1c21dwh",
116
+ "Bptxc3x": "fato7r6",
117
+ "cl4aha": "fao1bnu",
118
+ "Bceei9c": "fdrzuqr"
119
+ },
120
+ "selected": {
121
+ "Bptxc3x": "f1cadz5z",
122
+ "B076xvk": "f1ck17l",
123
+ "q9r9w5": "f42ak0g",
124
+ "cl4aha": "ffplhdr",
125
+ "Bk452zc": "ffth601",
126
+ "a4hkcw": "fhklyu5"
68
127
  }
69
128
  }, {
70
- "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;}"],
71
- "h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}"]
129
+ "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;}", ".f13qh94s{display:grid;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f1u07yai{grid-auto-flow:column;}", ".frn2hmy{grid-template-columns:auto;}", ".f1olsevy{grid-template-rows:auto;}", ".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;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1s9ku6b{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:start;justify-content:start;}", ".f1rjii52{-webkit-column-gap:var(--spacingHorizontalSNudge);column-gap:var(--spacingHorizontalSNudge);}", ".f5yzyt{padding-top:var(--spacingVerticalM);}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}", ".fx3omr{padding-bottom:var(--spacingVerticalM);}", ".fp2oml8{padding-top:var(--spacingVerticalSNudge);}", ".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}", ".f14mj54c{-webkit-column-gap:var(--spacingHorizontalXXS);column-gap:var(--spacingHorizontalXXS);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fclwglc{padding-top:var(--spacingVerticalXXS);}", ".fywfov9{padding-bottom:var(--spacingVerticalXXS);}", ".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);}"],
130
+ "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);}"],
131
+ "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);}"]
72
132
  });
133
+ /* eslint-enable @typescript-eslint/naming-convention */
134
+
73
135
  /**
74
136
  * Focus styles for the root slot
75
137
  */
@@ -92,63 +154,114 @@ const useFocusStyles = /*#__PURE__*/react_1.__styles({
92
154
  "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
93
155
  "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;}"]
94
156
  });
95
- /**
96
- * Indicator styles for the root slot when horizontal.
97
- */
157
+ /** Indicator styles for when pending selection */
98
158
 
99
159
 
100
- const useHorizontalIndicatorStyles = /*#__PURE__*/react_1.__styles({
160
+ const usePendingIndicatorStyles = /*#__PURE__*/react_1.__styles({
101
161
  "base": {
102
- "Bkbwdz4": "f1mif8u4",
103
- "frdscb": ["fvxed1z", "f1j2a01o"],
104
- "B9nohqn": ["f1j2a01o", "fvxed1z"],
105
- "B1dhsta": ["fsamouo", "f1aazreq"],
106
- "Bjdmjzx": ["f1aazreq", "fsamouo"],
107
- "oqd9ik": "ffdc0f3",
108
- "Bs6t6z0": "fqc6z8f",
109
- "Hdbjpj": "f11ef69",
110
- "mpb1vu": "f119hevp",
111
- "Bj55yzk": "fw2wsqs",
112
- "jc51t6": ["f1l9humg", "f3c5rjh"],
113
- "cnmfks": ["f3c5rjh", "f1l9humg"],
114
- "Bt86n75": "fg6xmog"
162
+ "az7l2e": "fhw179n",
163
+ "Bv4n3vi": ["f10y1uxy", "f6aiuy0"],
164
+ "vqofr": ["f6aiuy0", "f10y1uxy"],
165
+ "B0uxbk8": ["f1kfpfnu", "f1dx5wco"],
166
+ "Bgqb9hq": ["f1dx5wco", "f1kfpfnu"],
167
+ "amg5m6": "f1kmhr4c",
168
+ "zkfqfm": "fl1ydde",
169
+ "Bkydozb": "f1y7maxz",
170
+ "vzq8l0": ["f105swax", "fscdmel"],
171
+ "Bka2azo": ["fscdmel", "f105swax"],
172
+ "Br4ovkg": ["f1tkcw1w", "f1u11x8o"],
173
+ "csmgbd": ["f1u11x8o", "f1tkcw1w"],
174
+ "y36c18": "f16cxu0",
175
+ "B1ctymy": "f1nwgacf",
176
+ "Bgvrrv0": "f15ovonk",
177
+ "ddr6p5": "fvje46l"
115
178
  },
116
- "small": {
117
- "jc51t6": ["f1i8k3s6", "fy447wy"],
118
- "cnmfks": ["fy447wy", "f1i8k3s6"]
179
+ "disabled": {
180
+ "az7l2e": "f1ut20fw",
181
+ "Bkydozb": "fhrzcfn"
182
+ },
183
+ "mediumHorizontal": {
184
+ "lawp4y": "fchca7p",
185
+ "Baz25je": "f1s2r9ax",
186
+ "Fbdkly": ["f1o0nnkk", "fxb7rol"],
187
+ "mdwyqc": ["fxb7rol", "f1o0nnkk"]
188
+ },
189
+ "mediumVertical": {
190
+ "lawp4y": "f17jracn",
191
+ "Fbdkly": ["f1fzr1x6", "f1f351id"],
192
+ "Bciustq": "f117lcb2",
193
+ "Ccq8qp": "f1aij3q"
194
+ },
195
+ "smallHorizontal": {
196
+ "lawp4y": "fchca7p",
197
+ "Baz25je": "f1r53b5e",
198
+ "Fbdkly": ["f1s6rxz5", "fo35v8s"],
199
+ "mdwyqc": ["fo35v8s", "f1s6rxz5"]
200
+ },
201
+ "smallVertical": {
202
+ "lawp4y": "fze4zud",
203
+ "Fbdkly": ["f1fzr1x6", "f1f351id"],
204
+ "Bciustq": "fdp32p8",
205
+ "Ccq8qp": "f1aij3q"
119
206
  }
120
207
  }, {
121
- "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;}"],
122
- "h": [".fg6xmog:hover:after{background-color:var(--colorNeutralStroke1);}"]
208
+ "h": [".fhw179n:hover::before{background-color:var(--colorNeutralStroke1Hover);}", ".f10y1uxy:hover::before{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f6aiuy0:hover::before{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1kfpfnu:hover::before{border-top-right-radius:var(--borderRadiusCircular);}", ".f1dx5wco:hover::before{border-top-left-radius:var(--borderRadiusCircular);}", ".f1kmhr4c:hover::before{content:\"\";}", ".fl1ydde:hover::before{position:absolute;}", ".f1ut20fw:hover::before{background-color:var(--colorTransparentStroke);}"],
209
+ "a": [".f1y7maxz:active::before{background-color:var(--colorNeutralStroke1Pressed);}", ".f105swax:active::before{border-bottom-right-radius:var(--borderRadiusCircular);}", ".fscdmel:active::before{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1tkcw1w:active::before{border-top-right-radius:var(--borderRadiusCircular);}", ".f1u11x8o:active::before{border-top-left-radius:var(--borderRadiusCircular);}", ".f16cxu0:active::before{content:\"\";}", ".f1nwgacf:active::before{position:absolute;}", ".fhrzcfn:active::before{background-color:var(--colorTransparentStroke);}"],
210
+ "t": ["@media (forced-colors: active){.f15ovonk:hover::before{background-color:Highlight;}}", "@media (forced-colors: active){.fvje46l:active::before{background-color:Highlight;}}"],
211
+ "d": [".fchca7p::before{bottom:0;}", ".f1s2r9ax::before{height:var(--strokeWidthThicker);}", ".f1o0nnkk::before{left:var(--spacingHorizontalM);}", ".fxb7rol::before{right:var(--spacingHorizontalM);}", ".f17jracn::before{bottom:var(--spacingVerticalS);}", ".f1fzr1x6::before{left:0;}", ".f1f351id::before{right:0;}", ".f117lcb2::before{top:var(--spacingVerticalS);}", ".f1aij3q::before{width:var(--strokeWidthThicker);}", ".f1r53b5e::before{height:var(--strokeWidthThick);}", ".f1s6rxz5::before{left:var(--spacingHorizontalSNudge);}", ".fo35v8s::before{right:var(--spacingHorizontalSNudge);}", ".fze4zud::before{bottom:var(--spacingVerticalXS);}", ".fdp32p8::before{top:var(--spacingVerticalXS);}"]
123
212
  });
124
- /**
125
- * Indicator styles for the root slot when vertical.
126
- */
127
213
 
128
-
129
- const useVerticalIndicatorStyles = /*#__PURE__*/react_1.__styles({
214
+ const useActiveIndicatorStyles = /*#__PURE__*/react_1.__styles({
130
215
  "base": {
131
- "B1dvbpk": "ffgj6zs",
132
- "px8gyy": ["f16to4m4", "f1ceoihi"],
133
- "B5c9fhp": ["f1ceoihi", "f16to4m4"],
134
- "Bhe99jt": ["fkibbow", "fnlo9u7"],
135
- "B2r1szc": ["fnlo9u7", "fkibbow"],
136
- "Bmqnesq": "f170vdtw",
137
- "rurcny": "fuzzvh5",
138
- "xx9plb": "fxf9f1y",
139
- "Bdn98qo": "f15bpuwh",
140
- "Byque4d": ["f1t0u0az", "fmlx6bj"],
141
- "Bf8kmfk": "f1bwym7p",
142
- "Bj2wrql": "fk3f4e0",
143
- "Cgij5x": "fl6lm7t"
216
+ "Bjyk6c5": "f1rp0jgh",
217
+ "B3778ie": ["fprarqb", "f14vs0nd"],
218
+ "d9w3h3": ["f14vs0nd", "fprarqb"],
219
+ "Bl18szs": ["f1gtfqs9", "f18zvfd9"],
220
+ "B4j8arr": ["f18zvfd9", "f1gtfqs9"],
221
+ "Bsft5z2": "f13zj6fq",
222
+ "E3zdtr": "f1mdlcz9",
223
+ "t2ki1e": "ffmd2fr"
144
224
  },
145
- "small": {
146
- "Bf8kmfk": "fp6nmmp",
147
- "Bj2wrql": "f14i0ki9"
225
+ "selected": {
226
+ "Bjyk6c5": "f1ksivud",
227
+ "Glksuk": "f1eytvvh",
228
+ "Blzl0y7": "fuaa9s",
229
+ "f7digc": "fy7ktjt",
230
+ "Biqphg1": "f16tp0gf",
231
+ "Bntoloa": "fj0yp7j"
232
+ },
233
+ "disabled": {
234
+ "Bjyk6c5": "f13lkzet"
235
+ },
236
+ "mediumHorizontal": {
237
+ "By385i5": "fo72kxq",
238
+ "Dlnsje": "f1vx7lu8",
239
+ "Eqx8gd": ["fna7m5n", "f1oxpfwv"],
240
+ "B1piin3": ["f1oxpfwv", "fna7m5n"]
241
+ },
242
+ "mediumVertical": {
243
+ "By385i5": "fipylg0",
244
+ "Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
245
+ "bn5sak": "fqchiol",
246
+ "a2br6o": "f1o25lip"
247
+ },
248
+ "smallHorizontal": {
249
+ "By385i5": "fo72kxq",
250
+ "Dlnsje": "f9bb2ob",
251
+ "Eqx8gd": ["f1q70ajw", "f18rbzdx"],
252
+ "B1piin3": ["f18rbzdx", "f1q70ajw"]
253
+ },
254
+ "smallVertical": {
255
+ "By385i5": "fqbue9b",
256
+ "Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
257
+ "bn5sak": "fk1klkt",
258
+ "a2br6o": "f1o25lip"
148
259
  }
149
260
  }, {
150
- "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;}"],
151
- "h": [".fl6lm7t:hover:before{background-color:var(--colorNeutralStroke1);}"]
261
+ "d": [".f1rp0jgh::after{background-color:var(--colorTransparentStroke);}", ".fprarqb::after{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f14vs0nd::after{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1gtfqs9::after{border-top-right-radius:var(--borderRadiusCircular);}", ".f18zvfd9::after{border-top-left-radius:var(--borderRadiusCircular);}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".ffmd2fr::after{z-index:1;}", ".f1ksivud::after{background-color:var(--colorCompoundBrandStroke);}", ".f13lkzet::after{background-color:var(--colorNeutralForegroundDisabled);}", ".fo72kxq::after{bottom:0;}", ".f1vx7lu8::after{height:var(--strokeWidthThicker);}", ".fna7m5n::after{left:var(--spacingHorizontalM);}", ".f1oxpfwv::after{right:var(--spacingHorizontalM);}", ".fipylg0::after{bottom:var(--spacingVerticalS);}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right:0;}", ".fqchiol::after{top:var(--spacingVerticalS);}", ".f1o25lip::after{width:var(--strokeWidthThicker);}", ".f9bb2ob::after{height:var(--strokeWidthThick);}", ".f1q70ajw::after{left:var(--spacingHorizontalSNudge);}", ".f18rbzdx::after{right:var(--spacingHorizontalSNudge);}", ".fqbue9b::after{bottom:var(--spacingVerticalXS);}", ".fk1klkt::after{top:var(--spacingVerticalXS);}"],
262
+ "h": [".f1eytvvh:hover::after{background-color:var(--colorCompoundBrandStrokeHover);}"],
263
+ "a": [".fuaa9s:active::after{background-color:var(--colorCompoundBrandStrokePressed);}"],
264
+ "t": ["@media (forced-colors: active){.fy7ktjt::after{background-color:ButtonText;}}", "@media (forced-colors: active){.f16tp0gf:hover::after{background-color:ButtonText;}}", "@media (forced-colors: active){.fj0yp7j:active::after{background-color:ButtonText;}}"]
152
265
  });
153
266
  /**
154
267
  * Styles for the icon slot.
@@ -159,7 +272,9 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
159
272
  "base": {
160
273
  "Bt984gj": "f122n59",
161
274
  "mc9l5x": "ftuwxu6",
162
- "Brf1p80": "f4d9j23"
275
+ "Brf1p80": "f4d9j23",
276
+ "B68tc82": "f1p9o1ba",
277
+ "Bmxbyg5": "f1sil6mw"
163
278
  },
164
279
  "small": {
165
280
  "Be2twd7": "fe5j1ua",
@@ -172,7 +287,7 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
172
287
  "a9b677": "f64fuq3"
173
288
  }
174
289
  }, {
175
- "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;}"]
290
+ "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;}"]
176
291
  });
177
292
  /**
178
293
  * Styles for the content slot (children)
@@ -181,36 +296,55 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
181
296
 
182
297
  const useContentStyles = /*#__PURE__*/react_1.__styles({
183
298
  "base": {
184
- "uwmqm3": ["f161knb0", "f12huiiw"],
185
- "z189sj": ["f12huiiw", "f161knb0"]
299
+ "Bahqtrf": "fk6fouc",
300
+ "Be2twd7": "fkhj508",
301
+ "Bhrd7zp": "figsok6",
302
+ "Bg96gwp": "f1i3iumi",
303
+ "B68tc82": "f1p9o1ba",
304
+ "Bmxbyg5": "f1sil6mw",
305
+ "z8tnut": "fztplxc",
306
+ "z189sj": ["ffczdla", "fgiv446"],
307
+ "Byoj8tv": "f9g1xly",
308
+ "uwmqm3": ["fgiv446", "ffczdla"]
186
309
  },
187
- "small": {
188
- "uwmqm3": ["f161knb0", "f12huiiw"],
189
- "z189sj": ["f12huiiw", "f161knb0"]
310
+ "selected": {
311
+ "Bahqtrf": "fk6fouc",
312
+ "Be2twd7": "fkhj508",
313
+ "Bhrd7zp": "fl43uef",
314
+ "Bg96gwp": "f1i3iumi"
190
315
  }
191
316
  }, {
192
- "d": [".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}"]
317
+ "d": [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".fztplxc{padding-top:var(--spacingVerticalNone);}", ".ffczdla{padding-right:var(--spacingHorizontalXXS);}", ".fgiv446{padding-left:var(--spacingHorizontalXXS);}", ".f9g1xly{padding-bottom:var(--spacingVerticalNone);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}"]
193
318
  });
194
319
  /**
195
320
  * Apply styling to the Tab slots based on the state
196
321
  */
197
- // eslint-disable-next-line @typescript-eslint/naming-convention
198
322
 
199
323
 
200
324
  const useTabStyles_unstable = state => {
201
325
  const rootStyles = useRootStyles();
202
326
  const focusStyles = useFocusStyles();
203
- const horizontalIndicatorStyles = useHorizontalIndicatorStyles();
204
- const verticalIndicatorStyles = useVerticalIndicatorStyles();
327
+ const pendingIndicatorStyles = usePendingIndicatorStyles();
328
+ const activeIndicatorStyles = useActiveIndicatorStyles();
205
329
  const iconStyles = useIconStyles();
206
330
  const contentStyles = useContentStyles();
207
- state.root.className = react_1.mergeClasses(exports.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);
331
+ const {
332
+ appearance,
333
+ disabled,
334
+ selected,
335
+ size,
336
+ vertical
337
+ } = state;
338
+ state.root.className = react_1.mergeClasses(exports.tabClassNames.root, rootStyles.base, vertical ? rootStyles.vertical : rootStyles.horizontal, 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)
339
+ pendingIndicatorStyles.base, size !== 'small' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal), size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal), disabled && pendingIndicatorStyles.disabled, // active indicator (after pseudo element)
340
+ 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);
208
341
 
209
342
  if (state.icon) {
210
- state.icon.className = react_1.mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);
343
+ state.icon.className = react_1.mergeClasses(exports.tabClassNames.icon, iconStyles.base, iconStyles[size], state.icon.className);
211
344
  }
212
345
 
213
- state.content.className = react_1.mergeClasses(contentStyles.base, state.size === 'small' && contentStyles.small, state.content.className);
346
+ state.content.className = react_1.mergeClasses(exports.tabClassNames.content, contentStyles.base, selected && contentStyles.selected, state.content.className);
347
+ useTabAnimatedIndicator_1.useTabAnimatedIndicatorStyles_unstable(state);
214
348
  return state;
215
349
  };
216
350