@fluentui/react-button 9.6.11 → 9.7.0
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 +29 -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 +150 -150
- 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 +22 -22
- 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.js +2 -2
- package/lib/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
- 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 +17 -17
- 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 +133 -133
- 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 +262 -262
- 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 +25 -25
- 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.js +2 -2
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
- 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 +42 -42
- 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 +235 -235
- 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 +7 -7
|
@@ -14,31 +14,31 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
14
14
|
Bqenvij: "f11ysow2",
|
|
15
15
|
J657lq: "f1um431h",
|
|
16
16
|
Jlnjib: "fte7hqw",
|
|
17
|
-
|
|
17
|
+
Bo7webf: "frw79jk"
|
|
18
18
|
},
|
|
19
19
|
highContrast: {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
m3fafd: "ffcivv0",
|
|
21
|
+
pus4l6: "f1wchxtt"
|
|
22
22
|
},
|
|
23
23
|
outline: {},
|
|
24
24
|
primary: {
|
|
25
25
|
J657lq: "foe7gw6",
|
|
26
26
|
Jlnjib: "fvxlz81",
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Bo7webf: "f16twlsn",
|
|
28
|
+
D126e9: "fsglouz"
|
|
29
29
|
},
|
|
30
30
|
secondary: {},
|
|
31
31
|
subtle: {
|
|
32
32
|
J657lq: "f1um431h",
|
|
33
33
|
Jlnjib: "fte7hqw",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
Bo7webf: "frw79jk",
|
|
35
|
+
m3fafd: "f13lnigs",
|
|
36
|
+
pus4l6: "f1ba77l5"
|
|
37
37
|
},
|
|
38
38
|
transparent: {
|
|
39
39
|
J657lq: "f1um431h",
|
|
40
40
|
Jlnjib: "f1wn9xqz",
|
|
41
|
-
|
|
41
|
+
Bo7webf: "f1juxwb4"
|
|
42
42
|
},
|
|
43
43
|
small: {
|
|
44
44
|
Byoj8tv: 0,
|
|
@@ -70,12 +70,12 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
70
70
|
disabled: {
|
|
71
71
|
J657lq: "f1rlv8bf",
|
|
72
72
|
Jlnjib: "fd1dbtm",
|
|
73
|
-
|
|
73
|
+
Bo7webf: "f1x3eb98"
|
|
74
74
|
},
|
|
75
75
|
disabledHighContrast: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
D126e9: "fbqh1p7",
|
|
77
|
+
m3fafd: "fu2tbix",
|
|
78
|
+
pus4l6: "f1g2tosm"
|
|
79
79
|
}
|
|
80
80
|
}, {
|
|
81
81
|
d: [".f11ysow2{height:auto;}", ".f1um431h .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2);}", ".foe7gw6 .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", [".f1ge6w2w{padding:var(--spacingHorizontalS) var(--spacingHorizontalS) var(--spacingHorizontalMNudge) var(--spacingHorizontalS);}", {
|
|
@@ -85,22 +85,22 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
85
85
|
}], [".f14s4sho{padding:18px var(--spacingHorizontalL) var(--spacingHorizontalXL) var(--spacingHorizontalL);}", {
|
|
86
86
|
p: -1
|
|
87
87
|
}], ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1rlv8bf .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
|
88
|
-
h: [".fte7hqw:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".
|
|
89
|
-
m: [["@media (forced-colors: active){.
|
|
88
|
+
h: [".fte7hqw:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".frw79jk:hover:active .fui-CompoundButton__secondaryContent,.frw79jk:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".fvxlz81:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f16twlsn:hover:active .fui-CompoundButton__secondaryContent,.f16twlsn:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f1wn9xqz:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".f1juxwb4:hover:active .fui-CompoundButton__secondaryContent,.f1juxwb4:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".fd1dbtm:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}", ".f1x3eb98:hover:active .fui-CompoundButton__secondaryContent,.f1x3eb98:active:focus-visible .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
|
89
|
+
m: [["@media (forced-colors: active){.ffcivv0:hover .fui-CompoundButton__secondaryContent{color:Highlight;}}", {
|
|
90
90
|
m: "(forced-colors: active)"
|
|
91
|
-
}], ["@media (forced-colors: active){.
|
|
91
|
+
}], ["@media (forced-colors: active){.f1wchxtt:hover:active .fui-CompoundButton__secondaryContent,.f1wchxtt:active:focus-visible .fui-CompoundButton__secondaryContent{color:Highlight;}}", {
|
|
92
92
|
m: "(forced-colors: active)"
|
|
93
|
-
}], ["@media (forced-colors: active){.
|
|
93
|
+
}], ["@media (forced-colors: active){.fsglouz .fui-CompoundButton__secondaryContent{color:HighlightText;}}", {
|
|
94
94
|
m: "(forced-colors: active)"
|
|
95
|
-
}], ["@media (forced-colors: active){.
|
|
95
|
+
}], ["@media (forced-colors: active){.f13lnigs:hover .fui-CompoundButton__secondaryContent{color:Canvas;}}", {
|
|
96
96
|
m: "(forced-colors: active)"
|
|
97
|
-
}], ["@media (forced-colors: active){.
|
|
97
|
+
}], ["@media (forced-colors: active){.f1ba77l5:hover:active .fui-CompoundButton__secondaryContent,.f1ba77l5:active:focus-visible .fui-CompoundButton__secondaryContent{color:Canvas;}}", {
|
|
98
98
|
m: "(forced-colors: active)"
|
|
99
|
-
}], ["@media (forced-colors: active){.
|
|
99
|
+
}], ["@media (forced-colors: active){.fbqh1p7 .fui-CompoundButton__secondaryContent{color:GrayText;}}", {
|
|
100
100
|
m: "(forced-colors: active)"
|
|
101
|
-
}], ["@media (forced-colors: active){.
|
|
101
|
+
}], ["@media (forced-colors: active){.fu2tbix:hover .fui-CompoundButton__secondaryContent{color:GrayText;}}", {
|
|
102
102
|
m: "(forced-colors: active)"
|
|
103
|
-
}], ["@media (forced-colors: active){.
|
|
103
|
+
}], ["@media (forced-colors: active){.f1g2tosm:hover:active .fui-CompoundButton__secondaryContent,.f1g2tosm:active:focus-visible .fui-CompoundButton__secondaryContent{color:GrayText;}}", {
|
|
104
104
|
m: "(forced-colors: active)"
|
|
105
105
|
}]]
|
|
106
106
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","mergeClasses","__styles","useButtonStyles_unstable","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useRootStyles","base","Bqenvij","J657lq","Jlnjib","Bc29nj9","highContrast","pu7qz5","B10010i","outline","primary","B8ia98v","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"],"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;\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,IAAI,CAAC+D,QAAQ,KAAKC,SAAS,IAAIb,KAAK,CAACnD,IAAI,CAAC+D,QAAQ,KAAK,IAAI,IAAIT,UAAU,CAACM,YAAY,CAAC,EAAET,KAAK,CAAClD,IAAI,CAAC6D,SAAS,CAAC;EAC5M;EACA,IAAIX,KAAK,CAAChD,gBAAgB,EAAE;IACxBgD,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,GAAGlE,YAAY,CAACG,wBAAwB,CAACI,gBAAgB,EAAEqD,sBAAsB,CAACnD,IAAI,EAAEmD,sBAAsB,CAACK,IAAI,CAAC,EAAEV,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,CAAC;EAC3L;EACAhE,wBAAwB,CAACqD,KAAK,CAAC;EAC/B,OAAOA,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"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"],"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,: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"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,YAAY,EAAAC,QAAA,QAAoB,gBAAgB;AACzD,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,0BAA0B;EAChCC,gBAAgB,EAAE,sCAAsC;EACxDC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,aAAa,gBAAGP,QAAA;EAAAQ,IAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,YAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,OAAA;EAAAC,OAAA;IAAAP,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAM,MAAA;EAAA;EAAAC,SAAA;EAAAC,MAAA;IAAAV,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAE,MAAA;IAAAC,MAAA;EAAA;EAAAM,WAAA;IAAAX,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAU,KAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAP,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAE,KAAA;IAAAR,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAG,QAAA;IAAAt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SAAS,CAAC;EACzJ,IAAIX,KAAK,CAAClD,IAAI,EAAE;IACZkD,KAAK,CAAClD,IAAI,CAAC6D,SAAS,GAAGlE,YAAY,CAACG,wBAAwB,CAACE,IAAI,EAAEqD,UAAU,CAACjD,IAAI,EAAE8C,KAAK,CAACnD,IAAI,CAAC+D,QAAQ,KAAKC,SAAS,IAAIb,KAAK,CAACnD,IAAI,CAAC+D,QAAQ,KAAK,IAAI,IAAIT,UAAU,CAACM,YAAY,CAAC,EAAET,KAAK,CAAClD,IAAI,CAAC6D,SAAS,CAAC;EAC5M;EACA,IAAIX,KAAK,CAAChD,gBAAgB,EAAE;IACxBgD,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,GAAGlE,YAAY,CAACG,wBAAwB,CAACI,gBAAgB,EAAEqD,sBAAsB,CAACnD,IAAI,EAAEmD,sBAAsB,CAACK,IAAI,CAAC,EAAEV,KAAK,CAAChD,gBAAgB,CAAC2D,SAAS,CAAC;EAC3L;EACAhE,wBAAwB,CAACqD,KAAK,CAAC;EAC/B,OAAOA,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// Re-export the same slot class names mapping used by the griffel styles file
|
|
3
|
+
export const compoundButtonClassNames = {
|
|
4
|
+
root: 'fui-CompoundButton',
|
|
5
|
+
icon: 'fui-CompoundButton__icon',
|
|
6
|
+
contentContainer: 'fui-CompoundButton__contentContainer',
|
|
7
|
+
secondaryContent: 'fui-CompoundButton__secondaryContent'
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Attaches only semantic slot class names and state modifiers
|
|
11
|
+
*/ export const useCompoundButtonStyles_unstable = (state)=>{
|
|
12
|
+
'use no memo';
|
|
13
|
+
const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
|
|
14
|
+
state.root.className = [
|
|
15
|
+
compoundButtonClassNames.root,
|
|
16
|
+
// Appearance
|
|
17
|
+
appearance && `${compoundButtonClassNames.root}--${appearance}`,
|
|
18
|
+
// Size
|
|
19
|
+
size && `${compoundButtonClassNames.root}--${size}`,
|
|
20
|
+
// Shape
|
|
21
|
+
shape && `${compoundButtonClassNames.root}--${shape}`,
|
|
22
|
+
// Disabled styles
|
|
23
|
+
disabled && `${compoundButtonClassNames.root}--disabled`,
|
|
24
|
+
disabledFocusable && `${compoundButtonClassNames.root}--disabledFocusable`,
|
|
25
|
+
// Icon styles
|
|
26
|
+
icon && iconPosition === 'before' && `${compoundButtonClassNames.root}--iconBefore`,
|
|
27
|
+
icon && iconPosition === 'after' && `${compoundButtonClassNames.root}--iconAfter`,
|
|
28
|
+
icon && iconOnly && `${compoundButtonClassNames.root}--iconOnly`,
|
|
29
|
+
// User provided class name
|
|
30
|
+
state.root.className
|
|
31
|
+
].filter(Boolean).join(' ');
|
|
32
|
+
if (state.icon) {
|
|
33
|
+
state.icon.className = [
|
|
34
|
+
compoundButtonClassNames.icon,
|
|
35
|
+
state.icon.className
|
|
36
|
+
].filter(Boolean).join(' ');
|
|
37
|
+
}
|
|
38
|
+
state.contentContainer.className = [
|
|
39
|
+
compoundButtonClassNames.contentContainer,
|
|
40
|
+
state.contentContainer.className
|
|
41
|
+
].filter(Boolean).join(' ');
|
|
42
|
+
if (state.secondaryContent) {
|
|
43
|
+
state.secondaryContent.className = [
|
|
44
|
+
compoundButtonClassNames.secondaryContent,
|
|
45
|
+
state.secondaryContent.className
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
47
|
+
}
|
|
48
|
+
return state;
|
|
49
|
+
};
|
|
@@ -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;AAKA,8EAA8E;AAC9E,OAAO,MAAMA,2BAAgE;IAC3EC,MAAM;IACNC,MAAM;IACNC,kBAAkB;IAClBC,kBAAkB;AACpB,EAAE;AAEF;;CAEC,GACD,OAAO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,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"}
|
|
@@ -20,7 +20,7 @@ const useRootStyles = makeStyles({
|
|
|
20
20
|
color: tokens.colorNeutralForeground2Hover
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
':hover:active': {
|
|
23
|
+
':hover:active,:active:focus-visible': {
|
|
24
24
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
25
25
|
color: tokens.colorNeutralForeground2Pressed
|
|
26
26
|
}
|
|
@@ -34,7 +34,7 @@ const useRootStyles = makeStyles({
|
|
|
34
34
|
color: 'Highlight'
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
':hover:active': {
|
|
37
|
+
':hover:active,:active:focus-visible': {
|
|
38
38
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
39
39
|
color: 'Highlight'
|
|
40
40
|
}
|
|
@@ -53,7 +53,7 @@ const useRootStyles = makeStyles({
|
|
|
53
53
|
color: tokens.colorNeutralForegroundOnBrand
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
':hover:active': {
|
|
56
|
+
':hover:active,:active:focus-visible': {
|
|
57
57
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
58
58
|
color: tokens.colorNeutralForegroundOnBrand
|
|
59
59
|
}
|
|
@@ -75,7 +75,7 @@ const useRootStyles = makeStyles({
|
|
|
75
75
|
color: tokens.colorNeutralForeground2Hover
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
':hover:active': {
|
|
78
|
+
':hover:active,:active:focus-visible': {
|
|
79
79
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
80
80
|
color: tokens.colorNeutralForeground2Pressed
|
|
81
81
|
}
|
|
@@ -86,7 +86,7 @@ const useRootStyles = makeStyles({
|
|
|
86
86
|
color: 'Canvas'
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
':hover:active': {
|
|
89
|
+
':hover:active,:active:focus-visible': {
|
|
90
90
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
91
91
|
color: 'Canvas'
|
|
92
92
|
}
|
|
@@ -102,7 +102,7 @@ const useRootStyles = makeStyles({
|
|
|
102
102
|
color: tokens.colorNeutralForeground2BrandHover
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
':hover:active': {
|
|
105
|
+
':hover:active,:active:focus-visible': {
|
|
106
106
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
107
107
|
color: tokens.colorNeutralForeground2BrandPressed
|
|
108
108
|
}
|
|
@@ -134,7 +134,7 @@ const useRootStyles = makeStyles({
|
|
|
134
134
|
color: tokens.colorNeutralForegroundDisabled
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
':hover:active': {
|
|
137
|
+
':hover:active,:active:focus-visible': {
|
|
138
138
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
139
139
|
color: tokens.colorNeutralForegroundDisabled
|
|
140
140
|
}
|
|
@@ -151,7 +151,7 @@ const useRootStyles = makeStyles({
|
|
|
151
151
|
color: 'GrayText'
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
-
':hover:active': {
|
|
154
|
+
':hover:active,:active:focus-visible': {
|
|
155
155
|
[`& .${compoundButtonClassNames.secondaryContent}`]: {
|
|
156
156
|
color: 'GrayText'
|
|
157
157
|
}
|
|
@@ -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;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBA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qE,SAAS,GAAGzE,aACrBG,yBAAyBC,IAAI,EAE7B,cAAc;IACd2D,WAAWtD,IAAI,EACfsD,WAAWhD,YAAY,EACvBqD,cAAcL,UAAU,CAACK,WAAW,EACpCL,UAAU,CAACS,KAAK,EAGhB,AADA,kBAAkB;IACjBjC,CAAAA,YAAY8B,iBAAgB,KAAMN,WAAWxB,QAAQ,EACtD,AAACA,CAAAA,YAAY8B,iBAAgB,KAAMN,WAAWtB,oBAAoB,EAElE,mBAAmB;IACnB6B,YAAYN,kBAAkB,CAACQ,KAAK,EAEpC,2BAA2B;IAC3BV,MAAM1D,IAAI,CAACqE,SAAS;IAGtBX,MAAMxD,gBAAgB,CAACmE,SAAS,GAAGzE,aACjCG,yBAAyBG,gBAAgB,EACzC4D,uBAAuBzD,IAAI,EAC3BqD,MAAMxD,gBAAgB,CAACmE,SAAS;IAGlC,IAAIX,MAAMzD,IAAI,EAAE;QACdyD,MAAMzD,IAAI,CAACoE,SAAS,GAAGzE,aACrBG,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,GAAGzE,aACjCG,yBAAyBI,gBAAgB,EACzC4D,uBAAuB1D,IAAI,EAC3B0D,sBAAsB,CAACK,KAAK,EAC5BV,MAAMvD,gBAAgB,CAACkE,SAAS;IAEpC;IAEAvE,yBAAyB4D;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;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,wBAAwB,QAAQ,mCAAmC;AAI5E,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,MAAM;IACNC,kBAAkB;IAClBC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,gBAAgBP,WAAW;IAC/B,cAAc;IACdQ,MAAM;QACJC,QAAQ;QAER,CAAC,CAAC,GAAG,EAAEP,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;YACnDI,OAAOZ,OAAOa,uBAAuB;QACvC;QAEA,UAAU;YACR,CAAC,CAAC,GAAG,EAAET,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,OAAOc,4BAA4B;YAC5C;QACF;QAEA,uCAAuC;YACrC,CAAC,CAAC,GAAG,EAAEV,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,OAAOe,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,uCAAuC;gBACrC,CAAC,CAAC,GAAG,EAAER,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;oBACnDI,OAAO;gBACT;YACF;QACF;IACF;IAEA,wBAAwB;IACxBK,SAAS;IAET;IACAC,SAAS;QACP,CAAC,CAAC,GAAG,EAAEd,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;YACnDI,OAAOZ,OAAOmB,6BAA6B;QAC7C;QAEA,UAAU;YACR,CAAC,CAAC,GAAG,EAAEf,yBAAyBI,gBAAgB,EAAE,CAAC,EAAE;gBACnDI,OAAOZ,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}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
export const menuButtonClassNames = {
|
|
3
|
+
root: 'fui-MenuButton',
|
|
4
|
+
icon: 'fui-MenuButton__icon',
|
|
5
|
+
menuIcon: 'fui-MenuButton__menuIcon'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Attaches only semantic slot class names and state modifiers
|
|
9
|
+
*/ export const useMenuButtonStyles_unstable = (state)=>{
|
|
10
|
+
'use no memo';
|
|
11
|
+
const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;
|
|
12
|
+
const expanded = !!state.root['aria-expanded'];
|
|
13
|
+
state.root.className = [
|
|
14
|
+
menuButtonClassNames.root,
|
|
15
|
+
// Appearance
|
|
16
|
+
appearance && `${menuButtonClassNames.root}--${appearance}`,
|
|
17
|
+
// Size
|
|
18
|
+
size && `${menuButtonClassNames.root}--${size}`,
|
|
19
|
+
// Shape
|
|
20
|
+
shape && `${menuButtonClassNames.root}--${shape}`,
|
|
21
|
+
// Disabled styles
|
|
22
|
+
disabled && `${menuButtonClassNames.root}--disabled`,
|
|
23
|
+
disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,
|
|
24
|
+
// Expanded
|
|
25
|
+
expanded && `${menuButtonClassNames.root}--expanded`,
|
|
26
|
+
// Icons
|
|
27
|
+
icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,
|
|
28
|
+
// User provided class name
|
|
29
|
+
state.root.className
|
|
30
|
+
].filter(Boolean).join(' ');
|
|
31
|
+
if (state.icon) {
|
|
32
|
+
state.icon.className = [
|
|
33
|
+
menuButtonClassNames.icon,
|
|
34
|
+
state.icon.className
|
|
35
|
+
].filter(Boolean).join(' ');
|
|
36
|
+
}
|
|
37
|
+
if (state.menuIcon) {
|
|
38
|
+
state.menuIcon.className = [
|
|
39
|
+
menuButtonClassNames.menuIcon,
|
|
40
|
+
state.menuIcon.className
|
|
41
|
+
].filter(Boolean).join(' ');
|
|
42
|
+
}
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
@@ -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;AAKA,OAAO,MAAMA,uBAAwD;IACnEC,MAAM;IACNC,MAAM;IACNC,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IAAI,CAAC;IAC5G;IAEA,OAAOX;AACT,EAAE"}
|
|
@@ -62,11 +62,11 @@ const useIconExpandedStyles = /*#__PURE__*/__styles({
|
|
|
62
62
|
sj55zd: "f1qj7y59"
|
|
63
63
|
},
|
|
64
64
|
highContrast: {
|
|
65
|
-
|
|
65
|
+
Bahaeuw: "f1v3eptx"
|
|
66
66
|
}
|
|
67
67
|
}, {
|
|
68
68
|
d: [".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"],
|
|
69
|
-
m: [["@media (forced-colors: active){.
|
|
69
|
+
m: [["@media (forced-colors: active){.f1v3eptx:hover{color:Highlight;}}", {
|
|
70
70
|
m: "(forced-colors: active)"
|
|
71
71
|
}]]
|
|
72
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["iconFilledClassName","iconRegularClassName","tokens","mergeClasses","__styles","shorthands","useButtonStyles_unstable","menuButtonClassNames","root","icon","menuIcon","useRootExpandedStyles","base","D0sxk3","t6yez3","outline","g2u3we","h3c5rm","B9xav0g","zhjwy3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","sj55zd","primary","De3pzq","secondary","subtle","transparent","d","useIconExpandedStyles","highContrast","
|
|
1
|
+
{"version":3,"names":["iconFilledClassName","iconRegularClassName","tokens","mergeClasses","__styles","shorthands","useButtonStyles_unstable","menuButtonClassNames","root","icon","menuIcon","useRootExpandedStyles","base","D0sxk3","t6yez3","outline","g2u3we","h3c5rm","B9xav0g","zhjwy3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","sj55zd","primary","De3pzq","secondary","subtle","transparent","d","useIconExpandedStyles","highContrast","Bahaeuw","m","useMenuIconStyles","Bg96gwp","small","Be2twd7","Bqenvij","a9b677","medium","large","notIconOnly","Frg6f3","useMenuButtonStyles_unstable","state","rootExpandedStyles","iconExpandedStyles","menuIconStyles","className","appearance","size","iconOnly","iconPosition"],"sources":["useMenuButtonStyles.styles.js"],"sourcesContent":["'use client';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { tokens } from '@fluentui/react-theme';\nimport { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nexport const menuButtonClassNames = {\n root: 'fui-MenuButton',\n icon: 'fui-MenuButton__icon',\n menuIcon: 'fui-MenuButton__menuIcon'\n};\nconst useRootExpandedStyles = makeStyles({\n base: {\n [`& .${iconFilledClassName}`]: {\n display: 'inline'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none'\n }\n },\n // Appearance variations\n outline: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n color: tokens.colorNeutralForeground1Selected\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected\n },\n secondary: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n color: tokens.colorNeutralForeground1Selected\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground2Selected\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n color: tokens.colorNeutralForeground2BrandSelected\n }\n});\nconst useIconExpandedStyles = makeStyles({\n // Appearance variations\n outline: {\n color: tokens.colorNeutralForeground1Selected\n },\n primary: {\n },\n secondary: {\n color: tokens.colorNeutralForeground1Selected\n },\n subtle: {\n color: tokens.colorNeutralForeground2BrandSelected\n },\n transparent: {\n color: tokens.colorNeutralForeground2BrandSelected\n },\n highContrast: {\n // High contrast styles\n '@media (forced-colors: active)': {\n ':hover': {\n color: 'Highlight'\n }\n }\n }\n});\nconst useMenuIconStyles = makeStyles({\n base: {\n lineHeight: 0\n },\n // Size appearance\n small: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px'\n },\n medium: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px'\n },\n large: {\n fontSize: '16px',\n height: '16px',\n lineHeight: tokens.lineHeightBase400,\n width: '16px'\n },\n // Not-icon only\n notIconOnly: {\n marginLeft: tokens.spacingHorizontalXS\n }\n});\nexport const useMenuButtonStyles_unstable = (state)=>{\n 'use no memo';\n const rootExpandedStyles = useRootExpandedStyles();\n const iconExpandedStyles = useIconExpandedStyles();\n const menuIconStyles = useMenuIconStyles();\n state.root.className = mergeClasses(menuButtonClassNames.root, state.root['aria-expanded'] && rootExpandedStyles.base, state.root['aria-expanded'] && rootExpandedStyles[state.appearance], state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(menuButtonClassNames.icon, state.root['aria-expanded'] && iconExpandedStyles[state.appearance] && iconExpandedStyles.highContrast, state.icon.className);\n }\n if (state.menuIcon) {\n state.menuIcon.className = mergeClasses(menuButtonClassNames.menuIcon, menuIconStyles.base, menuIconStyles[state.size], !state.iconOnly && menuIconStyles.notIconOnly, state.menuIcon.className);\n }\n useButtonStyles_unstable({\n ...state,\n iconPosition: 'before'\n });\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,YAAY,EAAAC,QAAA,EAAcC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE,sBAAsB;EAC5BC,QAAQ,EAAE;AACd,CAAC;AACD,MAAMC,qBAAqB,gBAAGP,QAAA;EAAAQ,IAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAA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AAC,eAAe,CAAC,IAAIuC,kBAAkB,CAACnC,IAAI,EAAEkC,KAAK,CAACtC,IAAI,CAAC,eAAe,CAAC,IAAIuC,kBAAkB,CAACD,KAAK,CAACK,UAAU,CAAC,EAAEL,KAAK,CAACtC,IAAI,CAAC0C,SAAS,CAAC;EACjN,IAAIJ,KAAK,CAACrC,IAAI,EAAE;IACZqC,KAAK,CAACrC,IAAI,CAACyC,SAAS,GAAG/C,YAAY,CAACI,oBAAoB,CAACE,IAAI,EAAEqC,KAAK,CAACtC,IAAI,CAAC,eAAe,CAAC,IAAIwC,kBAAkB,CAACF,KAAK,CAACK,UAAU,CAAC,IAAIH,kBAAkB,CAAChB,YAAY,EAAEc,KAAK,CAACrC,IAAI,CAACyC,SAAS,CAAC;EAChM;EACA,IAAIJ,KAAK,CAACpC,QAAQ,EAAE;IAChBoC,KAAK,CAACpC,QAAQ,CAACwC,SAAS,GAAG/C,YAAY,CAACI,oBAAoB,CAACG,QAAQ,EAAEuC,cAAc,CAACrC,IAAI,EAAEqC,cAAc,CAACH,KAAK,CAACM,IAAI,CAAC,EAAE,CAACN,KAAK,CAACO,QAAQ,IAAIJ,cAAc,CAACN,WAAW,EAAEG,KAAK,CAACpC,QAAQ,CAACwC,SAAS,CAAC;EACpM;EACA5C,wBAAwB,CAAC;IACrB,GAAGwC,KAAK;IACRQ,YAAY,EAAE;EAClB,CAAC,CAAC;EACF,OAAOR,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
export const menuButtonClassNames = {
|
|
3
|
+
root: 'fui-MenuButton',
|
|
4
|
+
icon: 'fui-MenuButton__icon',
|
|
5
|
+
menuIcon: 'fui-MenuButton__menuIcon'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Attaches only semantic slot class names and state modifiers
|
|
9
|
+
*/ export const useMenuButtonStyles_unstable = (state)=>{
|
|
10
|
+
'use no memo';
|
|
11
|
+
const { appearance, disabled, disabledFocusable, shape, size, icon, iconOnly } = state;
|
|
12
|
+
const expanded = !!state.root['aria-expanded'];
|
|
13
|
+
state.root.className = [
|
|
14
|
+
menuButtonClassNames.root,
|
|
15
|
+
// Appearance
|
|
16
|
+
appearance && `${menuButtonClassNames.root}--${appearance}`,
|
|
17
|
+
// Size
|
|
18
|
+
size && `${menuButtonClassNames.root}--${size}`,
|
|
19
|
+
// Shape
|
|
20
|
+
shape && `${menuButtonClassNames.root}--${shape}`,
|
|
21
|
+
// Disabled styles
|
|
22
|
+
disabled && `${menuButtonClassNames.root}--disabled`,
|
|
23
|
+
disabledFocusable && `${menuButtonClassNames.root}--disabledFocusable`,
|
|
24
|
+
// Expanded
|
|
25
|
+
expanded && `${menuButtonClassNames.root}--expanded`,
|
|
26
|
+
// Icons
|
|
27
|
+
icon && iconOnly && `${menuButtonClassNames.root}--iconOnly`,
|
|
28
|
+
// User provided class name
|
|
29
|
+
state.root.className
|
|
30
|
+
].filter(Boolean).join(' ');
|
|
31
|
+
if (state.icon) {
|
|
32
|
+
state.icon.className = [
|
|
33
|
+
menuButtonClassNames.icon,
|
|
34
|
+
state.icon.className
|
|
35
|
+
].filter(Boolean).join(' ');
|
|
36
|
+
}
|
|
37
|
+
if (state.menuIcon) {
|
|
38
|
+
state.menuIcon.className = [
|
|
39
|
+
menuButtonClassNames.menuIcon,
|
|
40
|
+
state.menuIcon.className
|
|
41
|
+
].filter(Boolean).join(' ');
|
|
42
|
+
}
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
@@ -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;AAKA,OAAO,MAAMA,uBAAwD;IACnEC,MAAM;IACNC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF;;CAEC,GACD,OAAO,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,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
export const splitButtonClassNames = {
|
|
3
|
+
root: 'fui-SplitButton',
|
|
4
|
+
menuButton: 'fui-SplitButton__menuButton',
|
|
5
|
+
primaryActionButton: 'fui-SplitButton__primaryActionButton'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Attaches only semantic slot class names and state modifiers
|
|
9
|
+
*/ export const useSplitButtonStyles_unstable = (state)=>{
|
|
10
|
+
'use no memo';
|
|
11
|
+
const { appearance, disabled, disabledFocusable, shape, size } = state;
|
|
12
|
+
state.root.className = [
|
|
13
|
+
splitButtonClassNames.root,
|
|
14
|
+
// Appearance
|
|
15
|
+
appearance && `${splitButtonClassNames.root}--${appearance}`,
|
|
16
|
+
// Size
|
|
17
|
+
size && `${splitButtonClassNames.root}--${size}`,
|
|
18
|
+
// Shape
|
|
19
|
+
shape && `${splitButtonClassNames.root}--${shape}`,
|
|
20
|
+
// Disabled styles
|
|
21
|
+
disabled && `${splitButtonClassNames.root}--disabled`,
|
|
22
|
+
disabledFocusable && !disabled && `${splitButtonClassNames.root}--disabledFocusable`,
|
|
23
|
+
// User provided class name
|
|
24
|
+
state.root.className
|
|
25
|
+
].filter(Boolean).join(' ');
|
|
26
|
+
if (state.primaryActionButton) {
|
|
27
|
+
state.primaryActionButton.className = [
|
|
28
|
+
splitButtonClassNames.primaryActionButton,
|
|
29
|
+
state.primaryActionButton.className
|
|
30
|
+
].filter(Boolean).join(' ');
|
|
31
|
+
}
|
|
32
|
+
if (state.menuButton) {
|
|
33
|
+
state.menuButton.className = [
|
|
34
|
+
splitButtonClassNames.menuButton,
|
|
35
|
+
state.menuButton.className
|
|
36
|
+
].filter(Boolean).join(' ');
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
@@ -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;AAKA,OAAO,MAAMA,wBAA0D;IACrEC,MAAM;IACNC,YAAY;IACZC,qBAAqB;AACvB,EAAE;AAEF;;CAEC,GACD,OAAO,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"}
|