@fluentui/react-button 9.6.12 → 9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/lib/components/Button/useButtonStyles.styles.headless.js +36 -0
- package/lib/components/Button/useButtonStyles.styles.headless.js.map +1 -0
- package/lib/components/Button/useButtonStyles.styles.js +84 -84
- package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib/components/Button/useButtonStyles.styles.raw.headless.js +36 -0
- package/lib/components/Button/useButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib/components/Button/useButtonStyles.styles.raw.js +15 -15
- package/lib/components/Button/useButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.headless.js +49 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.headless.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js +12 -12
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.headless.js +49 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js +8 -8
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.styles.headless.js +44 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.headless.js.map +1 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.headless.js +44 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.headless.js +39 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.headless.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.js +9 -9
- package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.headless.js +39 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js +6 -6
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.headless.js +36 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.headless.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.js +58 -58
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.headless.js +36 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js +10 -10
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.headless.js +52 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.headless.js.map +1 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.js +163 -163
- package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.headless.js +52 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.js +15 -15
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.headless.js +64 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.headless.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js +15 -15
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.headless.js +64 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.js +8 -8
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.headless.js +60 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.headless.js.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.headless.js +60 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.headless.js +55 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.headless.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js +26 -26
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.headless.js +55 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.js +6 -6
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.headless.js +52 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.headless.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js +131 -131
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.headless.js +52 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.headless.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.js +10 -10
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -1
- package/package.json +5 -5
|
@@ -30,31 +30,31 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
30
30
|
Bqenvij: "f11ysow2",
|
|
31
31
|
J657lq: "f1um431h",
|
|
32
32
|
Jlnjib: "fte7hqw",
|
|
33
|
-
|
|
33
|
+
Bo7webf: "frw79jk"
|
|
34
34
|
},
|
|
35
35
|
highContrast: {
|
|
36
36
|
m3fafd: "ffcivv0",
|
|
37
|
-
|
|
37
|
+
pus4l6: "f1wchxtt"
|
|
38
38
|
},
|
|
39
39
|
outline: {},
|
|
40
40
|
primary: {
|
|
41
41
|
J657lq: "foe7gw6",
|
|
42
42
|
Jlnjib: "fvxlz81",
|
|
43
|
-
|
|
43
|
+
Bo7webf: "f16twlsn",
|
|
44
44
|
D126e9: "fsglouz"
|
|
45
45
|
},
|
|
46
46
|
secondary: {},
|
|
47
47
|
subtle: {
|
|
48
48
|
J657lq: "f1um431h",
|
|
49
49
|
Jlnjib: "fte7hqw",
|
|
50
|
-
|
|
50
|
+
Bo7webf: "frw79jk",
|
|
51
51
|
m3fafd: "f13lnigs",
|
|
52
|
-
|
|
52
|
+
pus4l6: "f1ba77l5"
|
|
53
53
|
},
|
|
54
54
|
transparent: {
|
|
55
55
|
J657lq: "f1um431h",
|
|
56
56
|
Jlnjib: "f1wn9xqz",
|
|
57
|
-
|
|
57
|
+
Bo7webf: "f1juxwb4"
|
|
58
58
|
},
|
|
59
59
|
small: {
|
|
60
60
|
Byoj8tv: 0,
|
|
@@ -86,12 +86,12 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
86
86
|
disabled: {
|
|
87
87
|
J657lq: "f1rlv8bf",
|
|
88
88
|
Jlnjib: "fd1dbtm",
|
|
89
|
-
|
|
89
|
+
Bo7webf: "f1x3eb98"
|
|
90
90
|
},
|
|
91
91
|
disabledHighContrast: {
|
|
92
92
|
D126e9: "fbqh1p7",
|
|
93
93
|
m3fafd: "fu2tbix",
|
|
94
|
-
|
|
94
|
+
pus4l6: "f1g2tosm"
|
|
95
95
|
}
|
|
96
96
|
}, {
|
|
97
97
|
d: [
|
|
@@ -124,13 +124,13 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
124
124
|
],
|
|
125
125
|
h: [
|
|
126
126
|
".fte7hqw:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Hover);}",
|
|
127
|
-
".
|
|
127
|
+
".frw79jk:hover:active .fui-CompoundButton__secondaryContent,.frw79jk:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Pressed);}",
|
|
128
128
|
".fvxlz81:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}",
|
|
129
|
-
".
|
|
129
|
+
".f16twlsn:hover:active .fui-CompoundButton__secondaryContent,.f16twlsn:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}",
|
|
130
130
|
".f1wn9xqz:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandHover);}",
|
|
131
|
-
".
|
|
131
|
+
".f1juxwb4:hover:active .fui-CompoundButton__secondaryContent,.f1juxwb4:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}",
|
|
132
132
|
".fd1dbtm:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}",
|
|
133
|
-
".
|
|
133
|
+
".f1x3eb98:hover:active .fui-CompoundButton__secondaryContent,.f1x3eb98:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}"
|
|
134
134
|
],
|
|
135
135
|
m: [
|
|
136
136
|
[
|
|
@@ -140,7 +140,7 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
142
|
[
|
|
143
|
-
"@media (forced-colors: active){.
|
|
143
|
+
"@media (forced-colors: active){.f1wchxtt:hover:active .fui-CompoundButton__secondaryContent,.f1wchxtt:active:focus-visible .fui-CompoundButton__secondaryContent{color:Highlight;}}",
|
|
144
144
|
{
|
|
145
145
|
m: "(forced-colors: active)"
|
|
146
146
|
}
|
|
@@ -158,7 +158,7 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
160
|
[
|
|
161
|
-
"@media (forced-colors: active){.
|
|
161
|
+
"@media (forced-colors: active){.f1ba77l5:hover:active .fui-CompoundButton__secondaryContent,.f1ba77l5:active:focus-visible .fui-CompoundButton__secondaryContent{color:Canvas;}}",
|
|
162
162
|
{
|
|
163
163
|
m: "(forced-colors: active)"
|
|
164
164
|
}
|
|
@@ -176,7 +176,7 @@ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
176
176
|
}
|
|
177
177
|
],
|
|
178
178
|
[
|
|
179
|
-
"@media (forced-colors: active){.
|
|
179
|
+
"@media (forced-colors: active){.f1g2tosm:hover:active .fui-CompoundButton__secondaryContent,.f1g2tosm:active:focus-visible .fui-CompoundButton__secondaryContent{color:GrayText;}}",
|
|
180
180
|
{
|
|
181
181
|
m: "(forced-colors: active)"
|
|
182
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCompoundButtonStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nexport const compoundButtonClassNames = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent'\n};\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed\n }\n }\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight'\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight'\n }\n }\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'HighlightText'\n }\n }\n },\n secondary: {\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed\n }\n },\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas'\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas'\n }\n }\n }\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed\n }\n }\n },\n // Size variations\n small: {\n padding: `${tokens.spacingHorizontalS} ${tokens.spacingHorizontalS} ${tokens.spacingHorizontalMNudge} ${tokens.spacingHorizontalS}`,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n medium: {\n padding: `14px ${tokens.spacingHorizontalM} ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalM}`,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n large: {\n padding: `18px ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalXL} ${tokens.spacingHorizontalL}`,\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400\n },\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n }\n }\n },\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n }\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n }\n }\n }\n }\n});\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n padding: tokens.spacingHorizontalXS,\n maxWidth: '48px',\n minWidth: '48px'\n },\n medium: {\n padding: tokens.spacingHorizontalSNudge,\n maxWidth: '52px',\n minWidth: '52px'\n },\n large: {\n padding: tokens.spacingHorizontalS,\n maxWidth: '56px',\n minWidth: '56px'\n }\n});\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px'\n },\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM\n },\n after: {\n marginLeft: tokens.spacingHorizontalM\n }\n});\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left'\n }\n});\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular\n },\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200\n },\n medium: {\n fontSize: tokens.fontSizeBase200\n },\n large: {\n fontSize: tokens.fontSizeBase300\n }\n});\nexport const useCompoundButtonStyles_unstable = (state)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n state.root.className = mergeClasses(compoundButtonClassNames.root, // Root styles\n rootStyles.base, rootStyles.highContrast, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, // Icon-only styles\n iconOnly && rootIconOnlyStyles[size], // User provided class name\n state.root.className);\n state.contentContainer.className = mergeClasses(compoundButtonClassNames.contentContainer, contentContainerStyles.base, state.contentContainer.className);\n if (state.icon) {\n state.icon.className = mergeClasses(compoundButtonClassNames.icon, iconStyles.base, state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition], state.icon.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(compoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);\n }\n useButtonStyles_unstable(state);\n return state;\n};\n"],"names":["tokens","mergeClasses","__styles","useButtonStyles_unstable","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useRootStyles","base","Bqenvij","J657lq","Jlnjib","Bc29nj9","highContrast","m3fafd","qt6rog","outline","primary","D126e9","secondary","subtle","transparent","small","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Be2twd7","Bg96gwp","medium","large","disabled","disabledHighContrast","d","p","h","m","useRootIconOnlyStyles","B2u0y6b","Bf4jedk","useIconStyles","a9b677","before","t21cq0","after","Frg6f3","useContentContainerStyles","mc9l5x","Beiy3e4","fsow6f","useSecondaryContentStyles","Bhrd7zp","useCompoundButtonStyles_unstable","state","rootStyles","rootIconOnlyStyles","iconStyles","contentContainerStyles","secondaryContentStyles","appearance","disabledFocusable","iconOnly","iconPosition","size","className","children","undefined"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICI,wBAAwB;;;IAuNxBmD,gCAAgC;;;;uBAzNJ,gBAAgB;uCAChB,kCAAkC;AACpE,iCAAiC;IACpClD,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,0BAA0B;IAChCC,gBAAgB,EAAE,sCAAsC;IACxDC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,aAAa,GAAA,WAAA,OAAGP,eAAA,EAAA;IAAAQ,IAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,YAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,OAAA,EAAA,CAAA;IAAAC,OAAA,EAAA;QAAAP,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAM,MAAA,EAAA;IAAA;IAAAC,SAAA,EAAA,CAAA;IAAAC,MAAA,EAAA;QAAAV,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAE,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAM,WAAA,EAAA;QAAAX,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAU,KAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAA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react-theme';\nimport { mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nexport const compoundButtonClassNames = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent'\n};\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed\n }\n }\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight'\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight'\n }\n }\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'HighlightText'\n }\n }\n },\n secondary: {\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed\n }\n },\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas'\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas'\n }\n }\n }\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed\n }\n }\n },\n // Size variations\n small: {\n padding: `${tokens.spacingHorizontalS} ${tokens.spacingHorizontalS} ${tokens.spacingHorizontalMNudge} ${tokens.spacingHorizontalS}`,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n medium: {\n padding: `14px ${tokens.spacingHorizontalM} ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalM}`,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n large: {\n padding: `18px ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalXL} ${tokens.spacingHorizontalL}`,\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400\n },\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled\n }\n }\n },\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n },\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n }\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText'\n }\n }\n }\n }\n});\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n padding: tokens.spacingHorizontalXS,\n maxWidth: '48px',\n minWidth: '48px'\n },\n medium: {\n padding: tokens.spacingHorizontalSNudge,\n maxWidth: '52px',\n minWidth: '52px'\n },\n large: {\n padding: tokens.spacingHorizontalS,\n maxWidth: '56px',\n minWidth: '56px'\n }\n});\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px'\n },\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM\n },\n after: {\n marginLeft: tokens.spacingHorizontalM\n }\n});\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left'\n }\n});\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular\n },\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200\n },\n medium: {\n fontSize: tokens.fontSizeBase200\n },\n large: {\n fontSize: tokens.fontSizeBase300\n }\n});\nexport const useCompoundButtonStyles_unstable = (state)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n state.root.className = mergeClasses(compoundButtonClassNames.root, // Root styles\n rootStyles.base, rootStyles.highContrast, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, // Icon-only styles\n iconOnly && rootIconOnlyStyles[size], // User provided class name\n state.root.className);\n state.contentContainer.className = mergeClasses(compoundButtonClassNames.contentContainer, contentContainerStyles.base, state.contentContainer.className);\n if (state.icon) {\n state.icon.className = mergeClasses(compoundButtonClassNames.icon, iconStyles.base, state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition], state.icon.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(compoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);\n }\n useButtonStyles_unstable(state);\n return state;\n};\n"],"names":["tokens","mergeClasses","__styles","useButtonStyles_unstable","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useRootStyles","base","Bqenvij","J657lq","Jlnjib","Bo7webf","highContrast","m3fafd","pus4l6","outline","primary","D126e9","secondary","subtle","transparent","small","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Be2twd7","Bg96gwp","medium","large","disabled","disabledHighContrast","d","p","h","m","useRootIconOnlyStyles","B2u0y6b","Bf4jedk","useIconStyles","a9b677","before","t21cq0","after","Frg6f3","useContentContainerStyles","mc9l5x","Beiy3e4","fsow6f","useSecondaryContentStyles","Bhrd7zp","useCompoundButtonStyles_unstable","state","rootStyles","rootIconOnlyStyles","iconStyles","contentContainerStyles","secondaryContentStyles","appearance","disabledFocusable","iconOnly","iconPosition","size","className","children","undefined"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICI,wBAAwB;;;IAuNxBmD,gCAAgC;;;;uBAzNJ,gBAAgB;uCAChB,kCAAkC;AACpE,iCAAiC;IACpClD,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,0BAA0B;IAChCC,gBAAgB,EAAE,sCAAsC;IACxDC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,aAAa,GAAA,WAAA,OAAGP,eAAA,EAAA;IAAAQ,IAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAA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UAAU,CAACM,YAAY,CAAC,EAAET,KAAK,CAAClD,IAAI,CAAC6D,SAAS,CAAC;IAC5M;IACA,IAAIX,KAAK,CAAChD,gBAAgB,EAAE;QACxBgD,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,OAAGlE,mBAAY,EAACG,wBAAwB,CAACI,gBAAgB,EAAEqD,sBAAsB,CAACnD,IAAI,EAAEmD,sBAAsB,CAACK,IAAI,CAAC,EAAEV,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,CAAC;IAC3L;QACAhE,+CAAwB,EAACqD,KAAK,CAAC;IAC/B,OAAOA,KAAK;AAChB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
compoundButtonClassNames: function() {
|
|
14
|
+
return compoundButtonClassNames;
|
|
15
|
+
},
|
|
16
|
+
useCompoundButtonStyles_unstable: function() {
|
|
17
|
+
return useCompoundButtonStyles_unstable;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const compoundButtonClassNames = {
|
|
21
|
+
root: 'fui-CompoundButton',
|
|
22
|
+
icon: 'fui-CompoundButton__icon',
|
|
23
|
+
contentContainer: 'fui-CompoundButton__contentContainer',
|
|
24
|
+
secondaryContent: 'fui-CompoundButton__secondaryContent'
|
|
25
|
+
};
|
|
26
|
+
const useCompoundButtonStyles_unstable = (state)=>{
|
|
27
|
+
'use no memo';
|
|
28
|
+
const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
|
|
29
|
+
state.root.className = [
|
|
30
|
+
compoundButtonClassNames.root,
|
|
31
|
+
// Appearance
|
|
32
|
+
appearance && `${compoundButtonClassNames.root}--${appearance}`,
|
|
33
|
+
// Size
|
|
34
|
+
size && `${compoundButtonClassNames.root}--${size}`,
|
|
35
|
+
// Shape
|
|
36
|
+
shape && `${compoundButtonClassNames.root}--${shape}`,
|
|
37
|
+
// Disabled styles
|
|
38
|
+
disabled && `${compoundButtonClassNames.root}--disabled`,
|
|
39
|
+
disabledFocusable && `${compoundButtonClassNames.root}--disabledFocusable`,
|
|
40
|
+
// Icon styles
|
|
41
|
+
icon && iconPosition === 'before' && `${compoundButtonClassNames.root}--iconBefore`,
|
|
42
|
+
icon && iconPosition === 'after' && `${compoundButtonClassNames.root}--iconAfter`,
|
|
43
|
+
icon && iconOnly && `${compoundButtonClassNames.root}--iconOnly`,
|
|
44
|
+
// User provided class name
|
|
45
|
+
state.root.className
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
47
|
+
if (state.icon) {
|
|
48
|
+
state.icon.className = [
|
|
49
|
+
compoundButtonClassNames.icon,
|
|
50
|
+
state.icon.className
|
|
51
|
+
].filter(Boolean).join(' ');
|
|
52
|
+
}
|
|
53
|
+
state.contentContainer.className = [
|
|
54
|
+
compoundButtonClassNames.contentContainer,
|
|
55
|
+
state.contentContainer.className
|
|
56
|
+
].filter(Boolean).join(' ');
|
|
57
|
+
if (state.secondaryContent) {
|
|
58
|
+
state.secondaryContent.className = [
|
|
59
|
+
compoundButtonClassNames.secondaryContent,
|
|
60
|
+
state.secondaryContent.className
|
|
61
|
+
].filter(Boolean).join(' ');
|
|
62
|
+
}
|
|
63
|
+
return state;
|
|
64
|
+
};
|
package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.headless.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonStyles.styles.headless.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\n// Re-export the same slot class names mapping used by the griffel styles file\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\n/**\n * Attaches only semantic slot class names and state modifiers\n */\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n 'use no memo';\n\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = [\n compoundButtonClassNames.root,\n\n // Appearance\n appearance && `${compoundButtonClassNames.root}--${appearance}`,\n\n // Size\n size && `${compoundButtonClassNames.root}--${size}`,\n\n // Shape\n shape && `${compoundButtonClassNames.root}--${shape}`,\n\n // Disabled styles\n disabled && `${compoundButtonClassNames.root}--disabled`,\n disabledFocusable && `${compoundButtonClassNames.root}--disabledFocusable`,\n\n // Icon styles\n icon && iconPosition === 'before' && `${compoundButtonClassNames.root}--iconBefore`,\n icon && iconPosition === 'after' && `${compoundButtonClassNames.root}--iconAfter`,\n icon && iconOnly && `${compoundButtonClassNames.root}--iconOnly`,\n\n // User provided class name\n state.root.className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (state.icon) {\n state.icon.className = [compoundButtonClassNames.icon, state.icon.className].filter(Boolean).join(' ');\n }\n\n state.contentContainer.className = [compoundButtonClassNames.contentContainer, state.contentContainer.className]\n .filter(Boolean)\n .join(' ');\n\n if (state.secondaryContent) {\n state.secondaryContent.className = [compoundButtonClassNames.secondaryContent, state.secondaryContent.className]\n .filter(Boolean)\n .join(' ');\n }\n\n return state;\n};\n"],"names":["compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useCompoundButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","shape","size","className","filter","Boolean","join"],"mappings":"AAAA;;;;;;;;;;;;IAMaA,wBAAAA;;;oCAUAK;;;;AAVN,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CAACW,SAAS;KAAC,CAC7GC,MAAM,CAACC,SACPC,IAAI,CAAC;IAER,IAAIX,MAAMF,gBAAgB,EAAE;QAC1BE,MAAMF,gBAAgB,CAACU,SAAS,GAAG;YAACd,yBAAyBI,gBAAgB;YAAEE,MAAMF,gBAAgB,CAACU,SAAS;SAAC,CAC7GC,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IAEA,OAAOX;AACT,EAAE"}
|
|
@@ -38,7 +38,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
38
38
|
color: _reacttheme.tokens.colorNeutralForeground2Hover
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
':hover:active': {
|
|
41
|
+
':hover:active,:active:focus-visible': {
|
|
42
42
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
43
43
|
color: _reacttheme.tokens.colorNeutralForeground2Pressed
|
|
44
44
|
}
|
|
@@ -52,7 +52,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
52
52
|
color: 'Highlight'
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
':hover:active': {
|
|
55
|
+
':hover:active,:active:focus-visible': {
|
|
56
56
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
57
57
|
color: 'Highlight'
|
|
58
58
|
}
|
|
@@ -70,7 +70,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
70
70
|
color: _reacttheme.tokens.colorNeutralForegroundOnBrand
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
':hover:active': {
|
|
73
|
+
':hover:active,:active:focus-visible': {
|
|
74
74
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
75
75
|
color: _reacttheme.tokens.colorNeutralForegroundOnBrand
|
|
76
76
|
}
|
|
@@ -91,7 +91,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
91
91
|
color: _reacttheme.tokens.colorNeutralForeground2Hover
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
':hover:active': {
|
|
94
|
+
':hover:active,:active:focus-visible': {
|
|
95
95
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
96
96
|
color: _reacttheme.tokens.colorNeutralForeground2Pressed
|
|
97
97
|
}
|
|
@@ -102,7 +102,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
102
102
|
color: 'Canvas'
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
':hover:active': {
|
|
105
|
+
':hover:active,:active:focus-visible': {
|
|
106
106
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
107
107
|
color: 'Canvas'
|
|
108
108
|
}
|
|
@@ -118,7 +118,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
118
118
|
color: _reacttheme.tokens.colorNeutralForeground2BrandHover
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
|
-
':hover:active': {
|
|
121
|
+
':hover:active,:active:focus-visible': {
|
|
122
122
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
123
123
|
color: _reacttheme.tokens.colorNeutralForeground2BrandPressed
|
|
124
124
|
}
|
|
@@ -150,7 +150,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
150
150
|
color: _reacttheme.tokens.colorNeutralForegroundDisabled
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
':hover:active': {
|
|
153
|
+
':hover:active,:active:focus-visible': {
|
|
154
154
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
155
155
|
color: _reacttheme.tokens.colorNeutralForegroundDisabled
|
|
156
156
|
}
|
|
@@ -167,7 +167,7 @@ const useRootStyles = (0, _react.makeStyles)({
|
|
|
167
167
|
color: 'GrayText'
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
':hover:active': {
|
|
170
|
+
':hover:active,:active:focus-visible': {
|
|
171
171
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
172
172
|
color: 'GrayText'
|
|
173
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'HighlightText',\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas',\n },\n },\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas',\n },\n },\n },\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n padding: `${tokens.spacingHorizontalS} ${tokens.spacingHorizontalS} ${tokens.spacingHorizontalMNudge} ${tokens.spacingHorizontalS}`,\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n padding: `14px ${tokens.spacingHorizontalM} ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalM}`,\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n padding: `18px ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalXL} ${tokens.spacingHorizontalL}`,\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n padding: tokens.spacingHorizontalXS,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: tokens.spacingHorizontalSNudge,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: tokens.spacingHorizontalS,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM,\n },\n after: {\n marginLeft: tokens.spacingHorizontalM,\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n state.contentContainer.className = mergeClasses(\n compoundButtonClassNames.contentContainer,\n contentContainerStyles.base,\n state.contentContainer.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n compoundButtonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n state.icon.className,\n );\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n compoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["tokens","mergeClasses","makeStyles","useButtonStyles_unstable","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useRootStyles","base","height","color","colorNeutralForeground2","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","highContrast","outline","primary","colorNeutralForegroundOnBrand","secondary","subtle","transparent","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","small","padding","spacingHorizontalS","spacingHorizontalMNudge","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","medium","spacingHorizontalM","spacingHorizontalL","large","spacingHorizontalXL","fontSizeBase400","lineHeightBase400","disabled","colorNeutralForegroundDisabled","disabledHighContrast","useRootIconOnlyStyles","spacingHorizontalXS","maxWidth","minWidth","spacingHorizontalSNudge","useIconStyles","width","before","marginRight","after","marginLeft","useContentContainerStyles","display","flexDirection","textAlign","useSecondaryContentStyles","fontWeight","fontWeightRegular","fontSizeBase200","useCompoundButtonStyles_unstable","state","rootStyles","rootIconOnlyStyles","iconStyles","contentContainerStyles","secondaryContentStyles","appearance","disabledFocusable","iconOnly","iconPosition","size","className","children","undefined"],"mappings":"AAAA;;;;;;;;;;;;IAQaI,wBAAAA;;;oCA4PA0D;eAAAA;;;4BAlQU,wBAAwB;uBACN,iBAAiB;uCACjB,mCAAmC;AAIrE,iCAAsE;IAC3EzD,MAAM;IACNC,MAAM;IACNC,kBAAkB;IAClBC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,oBAAgBP,iBAAAA,EAAW;IAC/B,cAAc;IACdQ,MAAM;QACJC,QAAQ;QAER,CAAC,CAAC,GAAG,EAAEP,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;YACnDI,OAAOZ,kBAAAA,CAAOa,uBAAuB;QACvC;QAEA,UAAU;YACR,CAAC,CAAC,GAAG,EAAET,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,kBAAAA,CAAOc,4BAA4B;YAC5C;QACF;QAEA,iBAAiB;YACf,CAAC,CAAC,GAAG,EAAEV,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,kBAAAA,CAAOe,8BAA8B;YAC9C;QACF;IACF;IAEA,uBAAuB;IACvBC,cAAc;QACZ,kCAAkC;YAChC,UAAU;gBACR,CAAC,CAAC,GAAG,EAAEZ,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;oBACnDI,OAAO;gBACT;YACF;YAEA,iBAAiB;gBACf,CAAC,CAAC,GAAG,EAAER,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;oBACnDI,OAAO;gBACT;YACF;QACF;IACF;IAEA,wBAAwB;IACxBK,SAAS,CAET;IACAC,SAAS;QACP,CAAC,CAAC,GAAG,EAAEd,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;YACnDI,OAAOZ,kBAAAA,CAAOmB,6BAA6B;QAC7C;QAEA,UAAU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AI,EACfqD,MAAM1D,IAAI,CAACsE,QAAQ,KAAKC,aAAab,MAAM1D,IAAI,CAACsE,QAAQ,KAAK,QAAQT,UAAU,CAACM,aAAa,EAC7FT,MAAMzD,IAAI,CAACoE,SAAS;IAExB;IAEA,IAAIX,MAAMvD,gBAAgB,EAAE;QAC1BuD,MAAMvD,gBAAgB,CAACkE,SAAS,OAAGzE,mBAAAA,EACjCG,yBAAyBI,gBAAgB,EACzC4D,uBAAuB1D,IAAI,EAC3B0D,sBAAsB,CAACK,KAAK,EAC5BV,MAAMvD,gBAAgB,CAACkE,SAAS;IAEpC;QAEAvE,+CAAAA,EAAyB4D;IAEzB,OAAOA;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'HighlightText',\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas',\n },\n },\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Canvas',\n },\n },\n },\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n padding: `${tokens.spacingHorizontalS} ${tokens.spacingHorizontalS} ${tokens.spacingHorizontalMNudge} ${tokens.spacingHorizontalS}`,\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n padding: `14px ${tokens.spacingHorizontalM} ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalM}`,\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n padding: `18px ${tokens.spacingHorizontalL} ${tokens.spacingHorizontalXL} ${tokens.spacingHorizontalL}`,\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n\n ':hover:active,:active:focus-visible': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n padding: tokens.spacingHorizontalXS,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: tokens.spacingHorizontalSNudge,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: tokens.spacingHorizontalS,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM,\n },\n after: {\n marginLeft: tokens.spacingHorizontalM,\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n state.contentContainer.className = mergeClasses(\n compoundButtonClassNames.contentContainer,\n contentContainerStyles.base,\n state.contentContainer.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n compoundButtonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n state.icon.className,\n );\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n compoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["tokens","mergeClasses","makeStyles","useButtonStyles_unstable","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useRootStyles","base","height","color","colorNeutralForeground2","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","highContrast","outline","primary","colorNeutralForegroundOnBrand","secondary","subtle","transparent","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","small","padding","spacingHorizontalS","spacingHorizontalMNudge","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","medium","spacingHorizontalM","spacingHorizontalL","large","spacingHorizontalXL","fontSizeBase400","lineHeightBase400","disabled","colorNeutralForegroundDisabled","disabledHighContrast","useRootIconOnlyStyles","spacingHorizontalXS","maxWidth","minWidth","spacingHorizontalSNudge","useIconStyles","width","before","marginRight","after","marginLeft","useContentContainerStyles","display","flexDirection","textAlign","useSecondaryContentStyles","fontWeight","fontWeightRegular","fontSizeBase200","useCompoundButtonStyles_unstable","state","rootStyles","rootIconOnlyStyles","iconStyles","contentContainerStyles","secondaryContentStyles","appearance","disabledFocusable","iconOnly","iconPosition","size","className","children","undefined"],"mappings":"AAAA;;;;;;;;;;;;IAQaI,wBAAAA;;;oCA4PA0D;eAAAA;;;4BAlQU,wBAAwB;uBACN,iBAAiB;uCACjB,mCAAmC;AAIrE,iCAAsE;IAC3EzD,MAAM;IACNC,MAAM;IACNC,kBAAkB;IAClBC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,oBAAgBP,iBAAAA,EAAW;IAC/B,cAAc;IACdQ,MAAM;QACJC,QAAQ;QAER,CAAC,CAAC,GAAG,EAAEP,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;YACnDI,OAAOZ,kBAAAA,CAAOa,uBAAuB;QACvC;QAEA,UAAU;YACR,CAAC,CAAC,GAAG,EAAET,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,kBAAAA,CAAOc,4BAA4B;YAC5C;QACF;QAEA,uCAAuC;YACrC,CAAC,CAAC,GAAG,EAAEV,yBAAyBI,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ACpCL,UAAU,CAACS,KAAK,EAGfjC,AAAD,AADA,CACCA,YAAY8B,KADK,YACLA,CAAgB,IAAMN,WAAWxB,QAAQ,EACrDA,CAAAA,YAAY8B,iBAAAA,CAAgB,IAAMN,WAAWtB,oBAAoB,EAElE,AACA6B,YAAYN,OADO,WACW,CAACQ,KAAK,EAEpC,AACAV,MAAM1D,IAAI,CAACqE,SAAS,OADO;IAI7BX,MAAMxD,gBAAgB,CAACmE,SAAS,OAAGzE,mBAAAA,EACjCG,yBAAyBG,gBAAgB,EACzC4D,uBAAuBzD,IAAI,EAC3BqD,MAAMxD,gBAAgB,CAACmE,SAAS;IAGlC,IAAIX,MAAMzD,IAAI,EAAE;QACdyD,MAAMzD,IAAI,CAACoE,SAAS,OAAGzE,mBAAAA,EACrBG,yBAAyBE,IAAI,EAC7B4D,WAAWxD,IAAI,EACfqD,MAAM1D,IAAI,CAACsE,QAAQ,KAAKC,aAAab,MAAM1D,IAAI,CAACsE,QAAQ,KAAK,QAAQT,UAAU,CAACM,aAAa,EAC7FT,MAAMzD,IAAI,CAACoE,SAAS;IAExB;IAEA,IAAIX,MAAMvD,gBAAgB,EAAE;QAC1BuD,MAAMvD,gBAAgB,CAACkE,SAAS,OAAGzE,mBAAAA,EACjCG,yBAAyBI,gBAAgB,EACzC4D,uBAAuB1D,IAAI,EAC3B0D,sBAAsB,CAACK,KAAK,EAC5BV,MAAMvD,gBAAgB,CAACkE,SAAS;IAEpC;QAEAvE,+CAAAA,EAAyB4D;IAEzB,OAAOA;AACT,EAAE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
menuButtonClassNames: function() {
|
|
14
|
+
return menuButtonClassNames;
|
|
15
|
+
},
|
|
16
|
+
useMenuButtonStyles_unstable: function() {
|
|
17
|
+
return useMenuButtonStyles_unstable;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const menuButtonClassNames = {
|
|
21
|
+
root: 'fui-MenuButton',
|
|
22
|
+
icon: 'fui-MenuButton__icon',
|
|
23
|
+
menuIcon: 'fui-MenuButton__menuIcon'
|
|
24
|
+
};
|
|
25
|
+
const useMenuButtonStyles_unstable = (state)=>{
|
|
26
|
+
'use no memo';
|
|
27
|
+
const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;
|
|
28
|
+
const expanded = !!state.root['aria-expanded'];
|
|
29
|
+
state.root.className = [
|
|
30
|
+
menuButtonClassNames.root,
|
|
31
|
+
// Appearance
|
|
32
|
+
appearance && `${menuButtonClassNames.root}--${appearance}`,
|
|
33
|
+
// Size
|
|
34
|
+
size && `${menuButtonClassNames.root}--${size}`,
|
|
35
|
+
// Shape
|
|
36
|
+
shape && `${menuButtonClassNames.root}--${shape}`,
|
|
37
|
+
// Disabled styles
|
|
38
|
+
disabled && `${menuButtonClassNames.root}--disabled`,
|
|
39
|
+
disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,
|
|
40
|
+
// Expanded
|
|
41
|
+
expanded && `${menuButtonClassNames.root}--expanded`,
|
|
42
|
+
// Icons
|
|
43
|
+
icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,
|
|
44
|
+
// User provided class name
|
|
45
|
+
state.root.className
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
47
|
+
if (state.icon) {
|
|
48
|
+
state.icon.className = [
|
|
49
|
+
menuButtonClassNames.icon,
|
|
50
|
+
state.icon.className
|
|
51
|
+
].filter(Boolean).join(' ');
|
|
52
|
+
}
|
|
53
|
+
if (state.menuIcon) {
|
|
54
|
+
state.menuIcon.className = [
|
|
55
|
+
menuButtonClassNames.menuIcon,
|
|
56
|
+
state.menuIcon.className
|
|
57
|
+
].filter(Boolean).join(' ');
|
|
58
|
+
}
|
|
59
|
+
return state;
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/MenuButton/useMenuButtonStyles.styles.headless.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\nexport const menuButtonClassNames: SlotClassNames<MenuButtonSlots> = {\n root: 'fui-MenuButton',\n icon: 'fui-MenuButton__icon',\n menuIcon: 'fui-MenuButton__menuIcon',\n};\n\n/**\n * Attaches only semantic slot class names and state modifiers\n */\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n 'use no memo';\n\n const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;\n const expanded = !!state.root['aria-expanded'];\n\n state.root.className = [\n menuButtonClassNames.root,\n\n // Appearance\n appearance && `${menuButtonClassNames.root}--${appearance}`,\n\n // Size\n size && `${menuButtonClassNames.root}--${size}`,\n\n // Shape\n shape && `${menuButtonClassNames.root}--${shape}`,\n\n // Disabled styles\n disabled && `${menuButtonClassNames.root}--disabled`,\n disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,\n\n // Expanded\n expanded && `${menuButtonClassNames.root}--expanded`,\n\n // Icons\n icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,\n\n // User provided class name\n state.root.className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (state.icon) {\n state.icon.className = [menuButtonClassNames.icon, state.icon.className].filter(Boolean).join(' ');\n }\n\n if (state.menuIcon) {\n state.menuIcon.className = [menuButtonClassNames.menuIcon, state.menuIcon.className].filter(Boolean).join(' ');\n }\n\n return state;\n};\n"],"names":["menuButtonClassNames","root","icon","menuIcon","useMenuButtonStyles_unstable","state","appearance","disabled","disabledFocusable","shape","size","iconOnly","expanded","className","filter","Boolean","join"],"m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BAAqBG,QAAQ;YAAEE,MAAMF,QAAQ,CAACU,SAAS;SAAC,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC;IAC5G;IAEA,OAAOX;AACT,EAAE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
menuButtonClassNames: function() {
|
|
14
|
+
return menuButtonClassNames;
|
|
15
|
+
},
|
|
16
|
+
useMenuButtonStyles_unstable: function() {
|
|
17
|
+
return useMenuButtonStyles_unstable;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const menuButtonClassNames = {
|
|
21
|
+
root: 'fui-MenuButton',
|
|
22
|
+
icon: 'fui-MenuButton__icon',
|
|
23
|
+
menuIcon: 'fui-MenuButton__menuIcon'
|
|
24
|
+
};
|
|
25
|
+
const useMenuButtonStyles_unstable = (state)=>{
|
|
26
|
+
'use no memo';
|
|
27
|
+
const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;
|
|
28
|
+
const expanded = !!state.root['aria-expanded'];
|
|
29
|
+
state.root.className = [
|
|
30
|
+
menuButtonClassNames.root,
|
|
31
|
+
// Appearance
|
|
32
|
+
appearance && `${menuButtonClassNames.root}--${appearance}`,
|
|
33
|
+
// Size
|
|
34
|
+
size && `${menuButtonClassNames.root}--${size}`,
|
|
35
|
+
// Shape
|
|
36
|
+
shape && `${menuButtonClassNames.root}--${shape}`,
|
|
37
|
+
// Disabled styles
|
|
38
|
+
disabled && `${menuButtonClassNames.root}--disabled`,
|
|
39
|
+
disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,
|
|
40
|
+
// Expanded
|
|
41
|
+
expanded && `${menuButtonClassNames.root}--expanded`,
|
|
42
|
+
// Icons
|
|
43
|
+
icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,
|
|
44
|
+
// User provided class name
|
|
45
|
+
state.root.className
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
47
|
+
if (state.icon) {
|
|
48
|
+
state.icon.className = [
|
|
49
|
+
menuButtonClassNames.icon,
|
|
50
|
+
state.icon.className
|
|
51
|
+
].filter(Boolean).join(' ');
|
|
52
|
+
}
|
|
53
|
+
if (state.menuIcon) {
|
|
54
|
+
state.menuIcon.className = [
|
|
55
|
+
menuButtonClassNames.menuIcon,
|
|
56
|
+
state.menuIcon.className
|
|
57
|
+
].filter(Boolean).join(' ');
|
|
58
|
+
}
|
|
59
|
+
return state;
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/MenuButton/useMenuButtonStyles.styles.headless.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\nexport const menuButtonClassNames: SlotClassNames<MenuButtonSlots> = {\n root: 'fui-MenuButton',\n icon: 'fui-MenuButton__icon',\n menuIcon: 'fui-MenuButton__menuIcon',\n};\n\n/**\n * Attaches only semantic slot class names and state modifiers\n */\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n 'use no memo';\n\n const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;\n const expanded = !!state.root['aria-expanded'];\n\n state.root.className = [\n menuButtonClassNames.root,\n\n // Appearance\n appearance && `${menuButtonClassNames.root}--${appearance}`,\n\n // Size\n size && `${menuButtonClassNames.root}--${size}`,\n\n // Shape\n shape && `${menuButtonClassNames.root}--${shape}`,\n\n // Disabled styles\n disabled && `${menuButtonClassNames.root}--disabled`,\n disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,\n\n // Expanded\n expanded && `${menuButtonClassNames.root}--expanded`,\n\n // Icons\n icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,\n\n // User provided class name\n state.root.className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (state.icon) {\n state.icon.className = [menuButtonClassNames.icon, state.icon.className].filter(Boolean).join(' ');\n }\n\n if (state.menuIcon) {\n state.menuIcon.className = [menuButtonClassNames.menuIcon, state.menuIcon.className].filter(Boolean).join(' ');\n }\n\n return state;\n};\n"],"names":["menuButtonClassNames","root","icon","menuIcon","useMenuButtonStyles_unstable","state","appearance","disabled","disabledFocusable","shape","size","iconOnly","expanded","className","filter","Boolean","join"],"mappings":"AAAA;;;;;;;;;;;;IAKaA,oBAAAA;;;gCASAI;;;;AATN,6BAA8D;IACnEH,MAAM;IACNC,MAAM;IACNC,UAAU;AACZ,EAAE;AAKK,MAAMC,+BAA+B,CAACC;IAC3C;IAEA,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,KAAK,EAAEC,IAAI,EAAER,IAAI,EAAES,QAAQ,EAAE,GAAGN;IACjF,MAAMO,WAAW,CAAC,CAACP,MAAMJ,IAAI,CAAC,gBAAgB;IAE9CI,MAAMJ,IAAI,CAACY,SAAS,GAAG;QACrBb,qBAAqBC,IAAI;QAEzB,aAAa;QACbK,cAAc,GAAGN,qBAAqBC,IAAI,CAAC,EAAE,EAAEK,YAAY;QAE3D,OAAO;QACPI,QAAQ,GAAGV,qBAAqBC,IAAI,CAAC,EAAE,EAAES,MAAM;QAE/C,QAAQ;QACRD,SAAS,GAAGT,qBAAqBC,IAAI,CAAC,EAAE,EAAEQ,OAAO;QAEjD,kBAAkB;QAClBF,YAAY,GAAGP,qBAAqBC,IAAI,CAAC,UAAU,CAAC;QACpDO,qBAAqB,GAAGR,qBAAqBC,IAAI,CAAC,mBAAmB,CAAC;QAEtE,WAAW;QACXW,YAAY,GAAGZ,qBAAqBC,IAAI,CAAC,UAAU,CAAC;QAEpD,QAAQ;QACRC,QAAQS,YAAY,GAAGX,qBAAqBC,IAAI,CAAC,UAAU,CAAC;QAE5D,2BAA2B;QAC3BI,MAAMJ,IAAI,CAACY,SAAS;KACrB,CACEC,MAAM,CAACC,SACPC,IAAI,CAAC;IAER,IAAIX,MAAMH,IAAI,EAAE;QACdG,MAAMH,IAAI,CAACW,SAAS,GAAG;YAACb,qBAAqBE,IAAI;YAAEG,MAAMH,IAAI,CAACW,SAAS;SAAC,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC;IAChG;IAEA,IAAIX,MAAMF,QAAQ,EAAE;QAClBE,MAAMF,QAAQ,CAACU,SAAS,GAAG;YAACb,qBAAqBG,QAAQ;YAAEE,MAAMF,QAAQ,CAACU,SAAS;SAAC,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC;IAC5G;IAEA,OAAOX;AACT,EAAE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
splitButtonClassNames: function() {
|
|
14
|
+
return splitButtonClassNames;
|
|
15
|
+
},
|
|
16
|
+
useSplitButtonStyles_unstable: function() {
|
|
17
|
+
return useSplitButtonStyles_unstable;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const splitButtonClassNames = {
|
|
21
|
+
root: 'fui-SplitButton',
|
|
22
|
+
menuButton: 'fui-SplitButton__menuButton',
|
|
23
|
+
primaryActionButton: 'fui-SplitButton__primaryActionButton'
|
|
24
|
+
};
|
|
25
|
+
const useSplitButtonStyles_unstable = (state)=>{
|
|
26
|
+
'use no memo';
|
|
27
|
+
const { appearance, disabled, disabledFocusable, shape, size } = state;
|
|
28
|
+
state.root.className = [
|
|
29
|
+
splitButtonClassNames.root,
|
|
30
|
+
// Appearance
|
|
31
|
+
appearance && `${splitButtonClassNames.root}--${appearance}`,
|
|
32
|
+
// Size
|
|
33
|
+
size && `${splitButtonClassNames.root}--${size}`,
|
|
34
|
+
// Shape
|
|
35
|
+
shape && `${splitButtonClassNames.root}--${shape}`,
|
|
36
|
+
// Disabled styles
|
|
37
|
+
disabled && `${splitButtonClassNames.root}--disabled`,
|
|
38
|
+
disabledFocusable && !disabled && `${splitButtonClassNames.root}--disabledFocusable`,
|
|
39
|
+
// User provided class name
|
|
40
|
+
state.root.className
|
|
41
|
+
].filter(Boolean).join(' ');
|
|
42
|
+
if (state.primaryActionButton) {
|
|
43
|
+
state.primaryActionButton.className = [
|
|
44
|
+
splitButtonClassNames.primaryActionButton,
|
|
45
|
+
state.primaryActionButton.className
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
47
|
+
}
|
|
48
|
+
if (state.menuButton) {
|
|
49
|
+
state.menuButton.className = [
|
|
50
|
+
splitButtonClassNames.menuButton,
|
|
51
|
+
state.menuButton.className
|
|
52
|
+
].filter(Boolean).join(' ');
|
|
53
|
+
}
|
|
54
|
+
return state;
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/SplitButton/useSplitButtonStyles.styles.headless.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\nexport const splitButtonClassNames: SlotClassNames<SplitButtonSlots> = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton',\n};\n\n/**\n * Attaches only semantic slot class names and state modifiers\n */\nexport const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitButtonState => {\n 'use no memo';\n\n const { appearance, disabled, disabledFocusable, shape, size } = state;\n\n state.root.className = [\n splitButtonClassNames.root,\n\n // Appearance\n appearance && `${splitButtonClassNames.root}--${appearance}`,\n\n // Size\n size && `${splitButtonClassNames.root}--${size}`,\n\n // Shape\n shape && `${splitButtonClassNames.root}--${shape}`,\n\n // Disabled styles\n disabled && `${splitButtonClassNames.root}--disabled`,\n disabledFocusable && !disabled && `${splitButtonClassNames.root}--disabledFocusable`,\n\n // User provided class name\n state.root.className,\n ]\n .filter(Boolean)\n .join(' ');\n\n if (state.primaryActionButton) {\n state.primaryActionButton.className = [\n splitButtonClassNames.primaryActionButton,\n state.primaryActionButton.className,\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n if (state.menuButton) {\n state.menuButton.className = [splitButtonClassNames.menuButton, state.menuButton.className]\n .filter(Boolean)\n .join(' ');\n }\n\n return state;\n};\n"],"names":["splitButtonClassNames","root","menuButton","primaryActionButton","useSplitButtonStyles_unstable","state","appearance","disabled","disabledFocusable","shape","size","className","filter","Boolean","join"],"mappings":"AAAA;;;;;;;;;;;;IAKaA,qBAAAA;;;iCASAI;;;;AATN,8BAAgE;IACrEH,MAAM;IACNC,YAAY;IACZC,qBAAqB;AACvB,EAAE;AAKK,MAAMC,gCAAgC,CAACC;IAC5C;IAEA,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGL;IAEjEA,MAAMJ,IAAI,CAACU,SAAS,GAAG;QACrBX,sBAAsBC,IAAI;QAE1B,aAAa;QACbK,cAAc,GAAGN,sBAAsBC,IAAI,CAAC,EAAE,EAAEK,YAAY;QAE5D,OAAO;QACPI,QAAQ,GAAGV,sBAAsBC,IAAI,CAAC,EAAE,EAAES,MAAM;QAEhD,QAAQ;QACRD,SAAS,GAAGT,sBAAsBC,IAAI,CAAC,EAAE,EAAEQ,OAAO;QAElD,kBAAkB;QAClBF,YAAY,GAAGP,sBAAsBC,IAAI,CAAC,UAAU,CAAC;QACrDO,qBAAqB,CAACD,YAAY,GAAGP,sBAAsBC,IAAI,CAAC,mBAAmB,CAAC;QAEpF,2BAA2B;QAC3BI,MAAMJ,IAAI,CAACU,SAAS;KACrB,CACEC,MAAM,CAACC,SACPC,IAAI,CAAC;IAER,IAAIT,MAAMF,mBAAmB,EAAE;QAC7BE,MAAMF,mBAAmB,CAACQ,SAAS,GAAG;YACpCX,sBAAsBG,mBAAmB;YACzCE,MAAMF,mBAAmB,CAACQ,SAAS;SACpC,CACEC,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IAEA,IAAIT,MAAMH,UAAU,EAAE;QACpBG,MAAMH,UAAU,CAACS,SAAS,GAAG;YAACX,sBAAsBE,UAAU;YAAEG,MAAMH,UAAU,CAACS,SAAS;SAAC,CACxFC,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IAEA,OAAOT;AACT,EAAE"}
|