@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.
- package/CHANGELOG.json +377 -1
- package/CHANGELOG.md +101 -3
- package/dist/{react-tabs.d.ts → index.d.ts} +77 -70
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Tab/Tab.types.js.map +1 -1
- package/lib/components/Tab/index.js +1 -0
- package/lib/components/Tab/index.js.map +1 -1
- package/lib/components/Tab/renderTab.js +1 -2
- package/lib/components/Tab/renderTab.js.map +1 -1
- package/lib/components/Tab/useTab.js +28 -29
- package/lib/components/Tab/useTab.js.map +1 -1
- package/lib/components/Tab/useTabAnimatedIndicator.js +134 -0
- package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib/components/Tab/useTabStyles.js +222 -88
- package/lib/components/Tab/useTabStyles.js.map +1 -1
- package/lib/components/TabList/TabList.types.js.map +1 -1
- package/lib/components/TabList/TabListContext.js +6 -0
- package/lib/components/TabList/TabListContext.js.map +1 -1
- package/lib/components/TabList/renderTabList.js +0 -1
- package/lib/components/TabList/renderTabList.js.map +1 -1
- package/lib/components/TabList/useTabList.js +28 -52
- package/lib/components/TabList/useTabList.js.map +1 -1
- package/lib/components/TabList/useTabListContextValues.js +4 -0
- package/lib/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib/components/TabList/useTabListStyles.js +16 -91
- package/lib/components/TabList/useTabListStyles.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Tab/index.js +2 -0
- package/lib-commonjs/components/Tab/index.js.map +1 -1
- package/lib-commonjs/components/Tab/renderTab.js +1 -2
- package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTab.js +28 -29
- package/lib-commonjs/components/Tab/useTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +148 -0
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib-commonjs/components/Tab/useTabStyles.js +222 -88
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
- package/lib-commonjs/components/TabList/TabListContext.js +6 -0
- package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
- package/lib-commonjs/components/TabList/renderTabList.js +0 -1
- package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabList.js +27 -51
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListContextValues.js +4 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListStyles.js +15 -93
- package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
- package/lib-commonjs/index.js +76 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +19 -21
- package/lib/Tab.d.ts +0 -1
- package/lib/TabList.d.ts +0 -1
- package/lib/components/Tab/Tab.d.ts +0 -6
- package/lib/components/Tab/Tab.types.d.ts +0 -52
- package/lib/components/Tab/index.d.ts +0 -5
- package/lib/components/Tab/renderTab.d.ts +0 -5
- package/lib/components/Tab/useTab.d.ts +0 -12
- package/lib/components/Tab/useTabStyles.d.ts +0 -6
- package/lib/components/TabList/TabList.d.ts +0 -6
- package/lib/components/TabList/TabList.types.d.ts +0 -99
- package/lib/components/TabList/TabListContext.d.ts +0 -3
- package/lib/components/TabList/index.d.ts +0 -5
- package/lib/components/TabList/renderTabList.d.ts +0 -5
- package/lib/components/TabList/useTabList.d.ts +0 -12
- package/lib/components/TabList/useTabListContextValues.d.ts +0 -2
- package/lib/components/TabList/useTabListStyles.d.ts +0 -9
- package/lib/index.d.ts +0 -2
- package/lib/tab.constants.d.ts +0 -15
- package/lib/tab.constants.js +0 -17
- package/lib/tab.constants.js.map +0 -1
- package/lib-commonjs/Tab.d.ts +0 -1
- package/lib-commonjs/TabList.d.ts +0 -1
- package/lib-commonjs/components/Tab/Tab.d.ts +0 -6
- package/lib-commonjs/components/Tab/Tab.types.d.ts +0 -52
- package/lib-commonjs/components/Tab/index.d.ts +0 -5
- package/lib-commonjs/components/Tab/renderTab.d.ts +0 -5
- package/lib-commonjs/components/Tab/useTab.d.ts +0 -12
- package/lib-commonjs/components/Tab/useTabStyles.d.ts +0 -6
- package/lib-commonjs/components/TabList/TabList.d.ts +0 -6
- package/lib-commonjs/components/TabList/TabList.types.d.ts +0 -99
- package/lib-commonjs/components/TabList/TabListContext.d.ts +0 -3
- package/lib-commonjs/components/TabList/index.d.ts +0 -5
- package/lib-commonjs/components/TabList/renderTabList.d.ts +0 -5
- package/lib-commonjs/components/TabList/useTabList.d.ts +0 -12
- package/lib-commonjs/components/TabList/useTabListContextValues.d.ts +0 -2
- package/lib-commonjs/components/TabList/useTabListStyles.d.ts +0 -9
- package/lib-commonjs/index.d.ts +0 -2
- package/lib-commonjs/tab.constants.d.ts +0 -15
- package/lib-commonjs/tab.constants.js +0 -23
- package/lib-commonjs/tab.constants.js.map +0 -1
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
2
|
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
|
3
|
-
import { tokens } from '@fluentui/react-theme';
|
|
4
|
-
import {
|
|
5
|
-
export const
|
|
3
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
4
|
+
import { useTabAnimatedIndicatorStyles_unstable } from './useTabAnimatedIndicator';
|
|
5
|
+
export const tabClassNames = {
|
|
6
|
+
root: 'fui-Tab',
|
|
7
|
+
icon: 'fui-Tab__icon',
|
|
8
|
+
content: 'fui-Tab__content'
|
|
9
|
+
}; // TODO temporary export to pass conformance test.
|
|
10
|
+
|
|
11
|
+
export const tabClassName = tabClassNames.root;
|
|
6
12
|
/**
|
|
7
13
|
* Styles for the root slot
|
|
8
14
|
*/
|
|
9
15
|
|
|
16
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
17
|
+
|
|
10
18
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
11
19
|
"base": {
|
|
12
|
-
"
|
|
20
|
+
"Bt984gj": "f122n59",
|
|
13
21
|
"g2u3we": "fwhevhj",
|
|
14
22
|
"h3c5rm": ["f61n433", "f1q8l70w"],
|
|
15
23
|
"B9xav0g": "fv1dfc8",
|
|
@@ -18,47 +26,101 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
18
26
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
19
27
|
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
|
20
28
|
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
|
21
|
-
"B4j52fo": "
|
|
22
|
-
"Bekrc4i": ["
|
|
23
|
-
"Bn0qgzm": "
|
|
24
|
-
"ibv6hh": ["
|
|
25
|
-
"i8kkvl": "fgfbwa2",
|
|
29
|
+
"B4j52fo": "fre7gi1",
|
|
30
|
+
"Bekrc4i": ["f1358rze", "f1rvrf73"],
|
|
31
|
+
"Bn0qgzm": "fqdk4by",
|
|
32
|
+
"ibv6hh": ["f1rvrf73", "f1358rze"],
|
|
26
33
|
"Bceei9c": "f1k6fduh",
|
|
27
|
-
"mc9l5x": "
|
|
28
|
-
"
|
|
34
|
+
"mc9l5x": "f13qh94s",
|
|
35
|
+
"Bnnss6s": "fi64zpg",
|
|
36
|
+
"Bxotwcr": "f1u07yai",
|
|
37
|
+
"Budl1dq": "frn2hmy",
|
|
38
|
+
"wkccdc": "f1olsevy",
|
|
29
39
|
"Bahqtrf": "fk6fouc",
|
|
30
|
-
"Be2twd7": "fkhj508",
|
|
31
40
|
"Bg96gwp": "f1i3iumi",
|
|
32
|
-
"
|
|
33
|
-
"z189sj": ["f81rol6", "frdkuqy"],
|
|
34
|
-
"Byoj8tv": "f1fow5ox",
|
|
35
|
-
"uwmqm3": ["frdkuqy", "f81rol6"],
|
|
41
|
+
"oeaueh": "f1s6fcnf",
|
|
36
42
|
"qhf8xq": "f10pi13n",
|
|
37
43
|
"B68tc82": "f1p9o1ba",
|
|
38
|
-
"Bmxbyg5": "f1sil6mw"
|
|
44
|
+
"Bmxbyg5": "f1sil6mw",
|
|
45
|
+
"B9bfxx9": "f1cxpek8"
|
|
39
46
|
},
|
|
40
47
|
"horizontal": {
|
|
41
|
-
"Bt984gj": "f122n59",
|
|
42
48
|
"Brf1p80": "f4d9j23"
|
|
43
49
|
},
|
|
44
50
|
"vertical": {
|
|
45
|
-
"
|
|
46
|
-
"Brf1p80": "fbhxue7"
|
|
51
|
+
"Brf1p80": "f1s9ku6b"
|
|
47
52
|
},
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
53
|
+
"mediumHorizontal": {
|
|
54
|
+
"i8kkvl": "f1rjii52",
|
|
55
|
+
"z8tnut": "f5yzyt",
|
|
56
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
57
|
+
"Byoj8tv": "fx3omr",
|
|
58
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"]
|
|
59
|
+
},
|
|
60
|
+
"mediumVertical": {
|
|
61
|
+
"i8kkvl": "f1rjii52",
|
|
62
|
+
"z8tnut": "fp2oml8",
|
|
63
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
64
|
+
"Byoj8tv": "f1tdddsa",
|
|
65
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"]
|
|
66
|
+
},
|
|
67
|
+
"smallHorizontal": {
|
|
68
|
+
"i8kkvl": "f14mj54c",
|
|
69
|
+
"z8tnut": "fp2oml8",
|
|
70
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
71
|
+
"Byoj8tv": "f1tdddsa",
|
|
72
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"]
|
|
73
|
+
},
|
|
74
|
+
"smallVertical": {
|
|
75
|
+
"i8kkvl": "f14mj54c",
|
|
76
|
+
"z8tnut": "fclwglc",
|
|
77
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
78
|
+
"Byoj8tv": "fywfov9",
|
|
79
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"]
|
|
80
|
+
},
|
|
81
|
+
"transparent": {
|
|
82
|
+
"De3pzq": "f1c21dwh",
|
|
83
|
+
"Jwef8y": "fjxutwb",
|
|
84
|
+
"ecr2s2": "fophhak",
|
|
85
|
+
"Bptxc3x": "fmmjozx",
|
|
86
|
+
"B076xvk": "f1mfqf41",
|
|
87
|
+
"q9r9w5": "f10aiid4",
|
|
88
|
+
"cl4aha": "fpkze5g",
|
|
89
|
+
"Bk452zc": "f149wc3x",
|
|
90
|
+
"a4hkcw": "fjioou7"
|
|
54
91
|
},
|
|
55
92
|
"subtle": {
|
|
56
|
-
"
|
|
93
|
+
"De3pzq": "fhovq9v",
|
|
94
|
+
"Jwef8y": "f1t94bn6",
|
|
95
|
+
"ecr2s2": "f1wfn5kd",
|
|
96
|
+
"Bptxc3x": "fmmjozx",
|
|
97
|
+
"B076xvk": "f1mfqf41",
|
|
98
|
+
"q9r9w5": "f10aiid4",
|
|
99
|
+
"cl4aha": "fpkze5g",
|
|
100
|
+
"Bk452zc": "f149wc3x",
|
|
101
|
+
"a4hkcw": "fjioou7"
|
|
102
|
+
},
|
|
103
|
+
"disabled": {
|
|
104
|
+
"De3pzq": "f1c21dwh",
|
|
105
|
+
"Bptxc3x": "fato7r6",
|
|
106
|
+
"cl4aha": "fao1bnu",
|
|
107
|
+
"Bceei9c": "fdrzuqr"
|
|
108
|
+
},
|
|
109
|
+
"selected": {
|
|
110
|
+
"Bptxc3x": "f1cadz5z",
|
|
111
|
+
"B076xvk": "f1ck17l",
|
|
112
|
+
"q9r9w5": "f42ak0g",
|
|
113
|
+
"cl4aha": "ffplhdr",
|
|
114
|
+
"Bk452zc": "ffth601",
|
|
115
|
+
"a4hkcw": "fhklyu5"
|
|
57
116
|
}
|
|
58
117
|
}, {
|
|
59
|
-
"d": [".
|
|
60
|
-
"h": [".
|
|
118
|
+
"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);}"],
|
|
119
|
+
"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);}"],
|
|
120
|
+
"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
121
|
});
|
|
122
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
123
|
+
|
|
62
124
|
/**
|
|
63
125
|
* Focus styles for the root slot
|
|
64
126
|
*/
|
|
@@ -81,63 +143,114 @@ const useFocusStyles = /*#__PURE__*/__styles({
|
|
|
81
143
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"],
|
|
82
144
|
"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
145
|
});
|
|
84
|
-
/**
|
|
85
|
-
* Indicator styles for the root slot when horizontal.
|
|
86
|
-
*/
|
|
146
|
+
/** Indicator styles for when pending selection */
|
|
87
147
|
|
|
88
148
|
|
|
89
|
-
const
|
|
149
|
+
const usePendingIndicatorStyles = /*#__PURE__*/__styles({
|
|
90
150
|
"base": {
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
151
|
+
"az7l2e": "fhw179n",
|
|
152
|
+
"Bv4n3vi": ["f10y1uxy", "f6aiuy0"],
|
|
153
|
+
"vqofr": ["f6aiuy0", "f10y1uxy"],
|
|
154
|
+
"B0uxbk8": ["f1kfpfnu", "f1dx5wco"],
|
|
155
|
+
"Bgqb9hq": ["f1dx5wco", "f1kfpfnu"],
|
|
156
|
+
"amg5m6": "f1kmhr4c",
|
|
157
|
+
"zkfqfm": "fl1ydde",
|
|
158
|
+
"Bkydozb": "f1y7maxz",
|
|
159
|
+
"vzq8l0": ["f105swax", "fscdmel"],
|
|
160
|
+
"Bka2azo": ["fscdmel", "f105swax"],
|
|
161
|
+
"Br4ovkg": ["f1tkcw1w", "f1u11x8o"],
|
|
162
|
+
"csmgbd": ["f1u11x8o", "f1tkcw1w"],
|
|
163
|
+
"y36c18": "f16cxu0",
|
|
164
|
+
"B1ctymy": "f1nwgacf",
|
|
165
|
+
"Bgvrrv0": "f15ovonk",
|
|
166
|
+
"ddr6p5": "fvje46l"
|
|
104
167
|
},
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
168
|
+
"disabled": {
|
|
169
|
+
"az7l2e": "f1ut20fw",
|
|
170
|
+
"Bkydozb": "fhrzcfn"
|
|
171
|
+
},
|
|
172
|
+
"mediumHorizontal": {
|
|
173
|
+
"lawp4y": "fchca7p",
|
|
174
|
+
"Baz25je": "f1s2r9ax",
|
|
175
|
+
"Fbdkly": ["f1o0nnkk", "fxb7rol"],
|
|
176
|
+
"mdwyqc": ["fxb7rol", "f1o0nnkk"]
|
|
177
|
+
},
|
|
178
|
+
"mediumVertical": {
|
|
179
|
+
"lawp4y": "f17jracn",
|
|
180
|
+
"Fbdkly": ["f1fzr1x6", "f1f351id"],
|
|
181
|
+
"Bciustq": "f117lcb2",
|
|
182
|
+
"Ccq8qp": "f1aij3q"
|
|
183
|
+
},
|
|
184
|
+
"smallHorizontal": {
|
|
185
|
+
"lawp4y": "fchca7p",
|
|
186
|
+
"Baz25je": "f1r53b5e",
|
|
187
|
+
"Fbdkly": ["f1s6rxz5", "fo35v8s"],
|
|
188
|
+
"mdwyqc": ["fo35v8s", "f1s6rxz5"]
|
|
189
|
+
},
|
|
190
|
+
"smallVertical": {
|
|
191
|
+
"lawp4y": "fze4zud",
|
|
192
|
+
"Fbdkly": ["f1fzr1x6", "f1f351id"],
|
|
193
|
+
"Bciustq": "fdp32p8",
|
|
194
|
+
"Ccq8qp": "f1aij3q"
|
|
108
195
|
}
|
|
109
196
|
}, {
|
|
110
|
-
"
|
|
111
|
-
"
|
|
197
|
+
"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);}"],
|
|
198
|
+
"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);}"],
|
|
199
|
+
"t": ["@media (forced-colors: active){.f15ovonk:hover::before{background-color:Highlight;}}", "@media (forced-colors: active){.fvje46l:active::before{background-color:Highlight;}}"],
|
|
200
|
+
"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);}"]
|
|
112
201
|
});
|
|
113
|
-
/**
|
|
114
|
-
* Indicator styles for the root slot when vertical.
|
|
115
|
-
*/
|
|
116
202
|
|
|
117
|
-
|
|
118
|
-
const useVerticalIndicatorStyles = /*#__PURE__*/__styles({
|
|
203
|
+
const useActiveIndicatorStyles = /*#__PURE__*/__styles({
|
|
119
204
|
"base": {
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"Bdn98qo": "f15bpuwh",
|
|
129
|
-
"Byque4d": ["f1t0u0az", "fmlx6bj"],
|
|
130
|
-
"Bf8kmfk": "f1bwym7p",
|
|
131
|
-
"Bj2wrql": "fk3f4e0",
|
|
132
|
-
"Cgij5x": "fl6lm7t"
|
|
205
|
+
"Bjyk6c5": "f1rp0jgh",
|
|
206
|
+
"B3778ie": ["fprarqb", "f14vs0nd"],
|
|
207
|
+
"d9w3h3": ["f14vs0nd", "fprarqb"],
|
|
208
|
+
"Bl18szs": ["f1gtfqs9", "f18zvfd9"],
|
|
209
|
+
"B4j8arr": ["f18zvfd9", "f1gtfqs9"],
|
|
210
|
+
"Bsft5z2": "f13zj6fq",
|
|
211
|
+
"E3zdtr": "f1mdlcz9",
|
|
212
|
+
"t2ki1e": "ffmd2fr"
|
|
133
213
|
},
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
214
|
+
"selected": {
|
|
215
|
+
"Bjyk6c5": "f1ksivud",
|
|
216
|
+
"Glksuk": "f1eytvvh",
|
|
217
|
+
"Blzl0y7": "fuaa9s",
|
|
218
|
+
"f7digc": "fy7ktjt",
|
|
219
|
+
"Biqphg1": "f16tp0gf",
|
|
220
|
+
"Bntoloa": "fj0yp7j"
|
|
221
|
+
},
|
|
222
|
+
"disabled": {
|
|
223
|
+
"Bjyk6c5": "f13lkzet"
|
|
224
|
+
},
|
|
225
|
+
"mediumHorizontal": {
|
|
226
|
+
"By385i5": "fo72kxq",
|
|
227
|
+
"Dlnsje": "f1vx7lu8",
|
|
228
|
+
"Eqx8gd": ["fna7m5n", "f1oxpfwv"],
|
|
229
|
+
"B1piin3": ["f1oxpfwv", "fna7m5n"]
|
|
230
|
+
},
|
|
231
|
+
"mediumVertical": {
|
|
232
|
+
"By385i5": "fipylg0",
|
|
233
|
+
"Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
|
|
234
|
+
"bn5sak": "fqchiol",
|
|
235
|
+
"a2br6o": "f1o25lip"
|
|
236
|
+
},
|
|
237
|
+
"smallHorizontal": {
|
|
238
|
+
"By385i5": "fo72kxq",
|
|
239
|
+
"Dlnsje": "f9bb2ob",
|
|
240
|
+
"Eqx8gd": ["f1q70ajw", "f18rbzdx"],
|
|
241
|
+
"B1piin3": ["f18rbzdx", "f1q70ajw"]
|
|
242
|
+
},
|
|
243
|
+
"smallVertical": {
|
|
244
|
+
"By385i5": "fqbue9b",
|
|
245
|
+
"Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
|
|
246
|
+
"bn5sak": "fk1klkt",
|
|
247
|
+
"a2br6o": "f1o25lip"
|
|
137
248
|
}
|
|
138
249
|
}, {
|
|
139
|
-
"d": [".
|
|
140
|
-
"h": [".
|
|
250
|
+
"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);}"],
|
|
251
|
+
"h": [".f1eytvvh:hover::after{background-color:var(--colorCompoundBrandStrokeHover);}"],
|
|
252
|
+
"a": [".fuaa9s:active::after{background-color:var(--colorCompoundBrandStrokePressed);}"],
|
|
253
|
+
"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;}}"]
|
|
141
254
|
});
|
|
142
255
|
/**
|
|
143
256
|
* Styles for the icon slot.
|
|
@@ -148,7 +261,9 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
|
148
261
|
"base": {
|
|
149
262
|
"Bt984gj": "f122n59",
|
|
150
263
|
"mc9l5x": "ftuwxu6",
|
|
151
|
-
"Brf1p80": "f4d9j23"
|
|
264
|
+
"Brf1p80": "f4d9j23",
|
|
265
|
+
"B68tc82": "f1p9o1ba",
|
|
266
|
+
"Bmxbyg5": "f1sil6mw"
|
|
152
267
|
},
|
|
153
268
|
"small": {
|
|
154
269
|
"Be2twd7": "fe5j1ua",
|
|
@@ -161,7 +276,7 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
|
161
276
|
"a9b677": "f64fuq3"
|
|
162
277
|
}
|
|
163
278
|
}, {
|
|
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;}"]
|
|
279
|
+
"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
280
|
});
|
|
166
281
|
/**
|
|
167
282
|
* Styles for the content slot (children)
|
|
@@ -170,36 +285,55 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
|
170
285
|
|
|
171
286
|
const useContentStyles = /*#__PURE__*/__styles({
|
|
172
287
|
"base": {
|
|
173
|
-
"
|
|
174
|
-
"
|
|
288
|
+
"Bahqtrf": "fk6fouc",
|
|
289
|
+
"Be2twd7": "fkhj508",
|
|
290
|
+
"Bhrd7zp": "figsok6",
|
|
291
|
+
"Bg96gwp": "f1i3iumi",
|
|
292
|
+
"B68tc82": "f1p9o1ba",
|
|
293
|
+
"Bmxbyg5": "f1sil6mw",
|
|
294
|
+
"z8tnut": "fztplxc",
|
|
295
|
+
"z189sj": ["ffczdla", "fgiv446"],
|
|
296
|
+
"Byoj8tv": "f9g1xly",
|
|
297
|
+
"uwmqm3": ["fgiv446", "ffczdla"]
|
|
175
298
|
},
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
299
|
+
"selected": {
|
|
300
|
+
"Bahqtrf": "fk6fouc",
|
|
301
|
+
"Be2twd7": "fkhj508",
|
|
302
|
+
"Bhrd7zp": "fl43uef",
|
|
303
|
+
"Bg96gwp": "f1i3iumi"
|
|
179
304
|
}
|
|
180
305
|
}, {
|
|
181
|
-
"d": [".
|
|
306
|
+
"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);}"]
|
|
182
307
|
});
|
|
183
308
|
/**
|
|
184
309
|
* Apply styling to the Tab slots based on the state
|
|
185
310
|
*/
|
|
186
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
187
311
|
|
|
188
312
|
|
|
189
313
|
export const useTabStyles_unstable = state => {
|
|
190
314
|
const rootStyles = useRootStyles();
|
|
191
315
|
const focusStyles = useFocusStyles();
|
|
192
|
-
const
|
|
193
|
-
const
|
|
316
|
+
const pendingIndicatorStyles = usePendingIndicatorStyles();
|
|
317
|
+
const activeIndicatorStyles = useActiveIndicatorStyles();
|
|
194
318
|
const iconStyles = useIconStyles();
|
|
195
319
|
const contentStyles = useContentStyles();
|
|
196
|
-
|
|
320
|
+
const {
|
|
321
|
+
appearance,
|
|
322
|
+
disabled,
|
|
323
|
+
selected,
|
|
324
|
+
size,
|
|
325
|
+
vertical
|
|
326
|
+
} = state;
|
|
327
|
+
state.root.className = mergeClasses(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)
|
|
328
|
+
pendingIndicatorStyles.base, size !== 'small' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal), size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal), disabled && pendingIndicatorStyles.disabled, // active indicator (after pseudo element)
|
|
329
|
+
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
330
|
|
|
198
331
|
if (state.icon) {
|
|
199
|
-
state.icon.className = mergeClasses(iconStyles.base, iconStyles[
|
|
332
|
+
state.icon.className = mergeClasses(tabClassNames.icon, iconStyles.base, iconStyles[size], state.icon.className);
|
|
200
333
|
}
|
|
201
334
|
|
|
202
|
-
state.content.className = mergeClasses(contentStyles.base,
|
|
335
|
+
state.content.className = mergeClasses(tabClassNames.content, contentStyles.base, selected && contentStyles.selected, state.content.className);
|
|
336
|
+
useTabAnimatedIndicatorStyles_unstable(state);
|
|
203
337
|
return state;
|
|
204
338
|
};
|
|
205
339
|
//# sourceMappingURL=useTabStyles.js.map
|
|
@@ -1 +1 @@
|
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,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,EAAiB,gBAAjB,QAAyC,uBAAzC;AAEA,SAAS,sCAAT,QAAuD,2BAAvD;AAEA,OAAO,MAAM,aAAa,GAA6B;AACrD,EAAA,IAAI,EAAE,SAD+C;AAErD,EAAA,IAAI,EAAE,eAF+C;AAGrD,EAAA,OAAO,EAAE;AAH4C,CAAhD,C,CAMP;;AACA,OAAO,MAAM,YAAY,GAAG,aAAa,CAAC,IAAnC;AAEP;;AAEG;;AACH;;AACA,MAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AA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AAqB,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,CAvDM","sourcesContent":["import type { TabSlots, TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTabAnimatedIndicatorStyles_unstable } from './useTabAnimatedIndicator';\n\nexport const tabClassNames: SlotClassNames<TabSlots> = {\n root: 'fui-Tab',\n icon: 'fui-Tab__icon',\n content: 'fui-Tab__content',\n};\n\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: 'grid',\n flexShrink: 0,\n gridAutoFlow: 'column',\n gridTemplateColumns: 'auto',\n gridTemplateRows: 'auto',\n fontFamily: tokens.fontFamilyBase,\n lineHeight: tokens.lineHeightBase300,\n outlineStyle: 'none',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n textTransform: 'none',\n },\n horizontal: {\n justifyContent: 'center',\n },\n vertical: {\n justifyContent: 'start',\n },\n mediumHorizontal: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalM, tokens.spacingHorizontalMNudge),\n },\n mediumVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalMNudge),\n },\n smallHorizontal: {\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalSNudge),\n },\n smallVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalXXS, tokens.spacingHorizontalSNudge),\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n cursor: 'not-allowed',\n },\n selected: {\n '& .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground1,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n});\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Focus styles for the root slot\n */\nconst useFocusStyles = makeStyles({\n // Tab creates a custom focus indicator because the default focus indicator\n // is applied using an ::after pseudo-element on the root. Since the selection\n // indicator uses an ::after pseudo-element on the root, there is a conflict.\n base: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineWidth: tokens.strokeWidthThick,\n outlineColor: 'transparent',\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n});\n\n/** Indicator styles for when pending selection */\nconst usePendingIndicatorStyles = makeStyles({\n base: {\n ':hover::before': {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n ':active::before': {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n '@media (forced-colors: active)': {\n ':hover::before': {\n backgroundColor: 'Highlight',\n },\n ':active::before': {\n backgroundColor: 'Highlight',\n },\n },\n },\n disabled: {\n ':hover::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n ':active::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n },\n mediumHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::before': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n smallHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::before': {\n bottom: tokens.spacingVerticalXS,\n left: 0,\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n});\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n '::after': {\n backgroundColor: tokens.colorTransparentStroke,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n zIndex: 1,\n },\n },\n selected: {\n '::after': {\n backgroundColor: tokens.colorCompoundBrandStroke,\n },\n ':hover::after': {\n backgroundColor: tokens.colorCompoundBrandStrokeHover,\n },\n ':active::after': {\n backgroundColor: tokens.colorCompoundBrandStrokePressed,\n },\n '@media (forced-colors: active)': {\n '::after': {\n backgroundColor: 'ButtonText',\n },\n ':hover::after': {\n backgroundColor: 'ButtonText',\n },\n ':active::after': {\n backgroundColor: 'ButtonText',\n },\n },\n },\n disabled: {\n '::after': {\n backgroundColor: tokens.colorNeutralForegroundDisabled,\n },\n },\n mediumHorizontal: {\n '::after': {\n bottom: '0',\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::after': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n smallHorizontal: {\n '::after': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::after': {\n bottom: tokens.spacingVerticalXS,\n left: '0',\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n});\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 ...typographyStyles.body1,\n ...shorthands.overflow('hidden'),\n // content padding is the same for medium & small, horiztonal & vertical\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalXXS),\n },\n selected: {\n ...typographyStyles.body1Strong,\n },\n});\n\n/**\n * Apply styling to the Tab slots based on the state\n */\nexport const useTabStyles_unstable = (state: TabState): TabState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const pendingIndicatorStyles = usePendingIndicatorStyles();\n const activeIndicatorStyles = useActiveIndicatorStyles();\n const iconStyles = useIconStyles();\n const contentStyles = useContentStyles();\n\n const { appearance, disabled, selected, size, vertical } = state;\n\n state.root.className = mergeClasses(\n tabClassNames.root,\n rootStyles.base,\n vertical ? rootStyles.vertical : rootStyles.horizontal,\n size !== 'small' && (vertical ? rootStyles.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabList.types.js","sourceRoot":"../src/","sources":["components/TabList/TabList.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TabValue } from '../Tab/Tab.types';\n\nexport type
|
|
1
|
+
{"version":3,"file":"TabList.types.js","sourceRoot":"../src/","sources":["components/TabList/TabList.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TabValue } from '../Tab/Tab.types';\n\nexport type TabRegisterData = {\n /**\n * The value of the tab.\n */\n value: TabValue;\n\n /**\n * The reference to the tab HTML element.\n */\n ref: React.RefObject<HTMLElement>;\n};\n\nexport type RegisterTabEventHandler = (data: TabRegisterData) => void;\n\nexport type SelectTabData = {\n /**\n * The value of the selected tab.\n */\n value: TabValue;\n};\n\nexport type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;\n\nexport type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;\n\nexport type TabListSlots = {\n /**\n * The slot associated with the root element of this tab list.\n */\n root: Slot<'div'>;\n};\n\n/**\n * TabList Props\n */\nexport type TabListProps = ComponentProps<TabListSlots> & {\n /**\n * A tab list can supports 'transparent' and 'subtle' appearance.\n *- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n *- 'transparent': No background and border styling\n * The appearance affects each of the contained tabs.\n * @default 'transparent'\n */\n appearance?: 'transparent' | 'subtle';\n\n /**\n * The value of the tab to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n */\n defaultSelectedValue?: TabValue;\n /**\n * A tab list can be set to disable interaction.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Raised when a tab is selected.\n */\n onTabSelect?: SelectTabEventHandler;\n\n /**\n * The value of the currently selected tab.\n */\n selectedValue?: TabValue;\n\n /**\n * A tab list can be either 'small' or 'medium' size.\n * The size affects each of the contained tabs.\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * A tab list can arrange its tabs vertically.\n * @default false\n */\n vertical?: boolean;\n};\n\nexport type TabListContextValue = Pick<TabListProps, 'onTabSelect' | 'selectedValue'> &\n Required<Pick<TabListProps, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {\n /** A callback to allow a tab to register itself with the tab list. */\n onRegister: RegisterTabEventHandler;\n\n /** A callback to allow a tab to unregister itself with the tab list. */\n onUnregister: RegisterTabEventHandler;\n /**\n * A callback to allow a tab to select itself when pressed.\n */\n onSelect: SelectTabEventHandler;\n /**\n * Gets the registered tab data along with current and previous selected values.\n */\n getRegisteredTabs: () => {\n selectedValue?: TabValue;\n previousSelectedValue?: TabValue;\n registeredTabs: Record<string, TabRegisterData>;\n };\n };\n\n/**\n * Context values used in rendering TabList.\n */\nexport type TabListContextValues = {\n /**\n * The context of the tab list available to each tab.\n */\n tabList: TabListContextValue;\n};\n\n/**\n * State used in rendering TabList.\n */\nexport type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue;\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createContext } from '@fluentui/react-context-selector';
|
|
2
2
|
export const TabListContext = /*#__PURE__*/createContext({
|
|
3
3
|
appearance: 'transparent',
|
|
4
|
+
disabled: false,
|
|
4
5
|
selectedValue: undefined,
|
|
5
6
|
onRegister: () => {
|
|
6
7
|
/* noop */
|
|
@@ -11,6 +12,11 @@ export const TabListContext = /*#__PURE__*/createContext({
|
|
|
11
12
|
onSelect: () => {
|
|
12
13
|
/* noop */
|
|
13
14
|
},
|
|
15
|
+
getRegisteredTabs: () => {
|
|
16
|
+
return {
|
|
17
|
+
registeredTabs: {}
|
|
18
|
+
};
|
|
19
|
+
},
|
|
14
20
|
size: 'medium',
|
|
15
21
|
vertical: false
|
|
16
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TabList/TabListContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,QAA8B,kCAA9B;AAIA,OAAO,MAAM,cAAc,gBAAiC,aAAa,CAAsB;AAC7F,EAAA,UAAU,EAAE,aADiF;AAE7F,EAAA,
|
|
1
|
+
{"version":3,"sources":["components/TabList/TabListContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,QAA8B,kCAA9B;AAIA,OAAO,MAAM,cAAc,gBAAiC,aAAa,CAAsB;AAC7F,EAAA,UAAU,EAAE,aADiF;AAE7F,EAAA,QAAQ,EAAE,KAFmF;AAG7F,EAAA,aAAa,EAAE,SAH8E;AAI7F,EAAA,UAAU,EAAE,MAAK;AACf;AACD,GAN4F;AAO7F,EAAA,YAAY,EAAE,MAAK;AACjB;AACD,GAT4F;AAU7F,EAAA,QAAQ,EAAE,MAAK;AACb;AACD,GAZ4F;AAa7F,EAAA,iBAAiB,EAAE,MAAK;AACtB,WAAO;AACL,MAAA,cAAc,EAAE;AADX,KAAP;AAGD,GAjB4F;AAkB7F,EAAA,IAAI,EAAE,QAlBuF;AAmB7F,EAAA,QAAQ,EAAE;AAnBmF,CAAtB,CAAlE","sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue>({\n appearance: 'transparent',\n disabled: false,\n selectedValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n getRegisteredTabs: () => {\n return {\n registeredTabs: {},\n };\n },\n size: 'medium',\n vertical: false,\n});\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TabList/renderTabList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,cAAT,QAA+B,kBAA/B;AAEA;;AAEG
|
|
1
|
+
{"version":3,"sources":["components/TabList/renderTabList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,cAAT,QAA+B,kBAA/B;AAEA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAsB,aAAtB,KAA6D;AACjG,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAe,KAAf,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,eACE,KAAA,CAAA,aAAA,CAAC,cAAc,CAAC,QAAhB,EAAwB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAxB,EAAwD,KAAK,CAAC,IAAN,CAAW,QAAnE,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListContext } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlots<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListContext.Provider value={contextValues.tabList}>{state.root.children}</TabListContext.Provider>\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|