@fluentui/react-button 9.1.12 → 9.1.14
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +81 -1
- package/CHANGELOG.md +26 -2
- package/lib/components/Button/Button.js +3 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/renderButton.js +6 -4
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +0 -1
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +309 -315
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +3 -2
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +10 -6
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +4 -5
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +124 -129
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +3 -2
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +6 -4
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +2 -3
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +61 -67
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +3 -2
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +6 -4
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +2 -4
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +56 -62
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +3 -2
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +0 -1
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +246 -249
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/useToggleState.js +4 -3
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.js +0 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +0 -2
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +0 -2
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +0 -2
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +0 -2
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +3 -7
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +0 -6
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +6 -8
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +0 -5
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +309 -321
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -7
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +0 -7
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +10 -10
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +4 -9
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +124 -134
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -7
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +0 -7
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +6 -8
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +2 -9
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +61 -73
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -7
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +0 -7
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +6 -8
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +2 -9
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +56 -67
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -7
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +0 -7
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +0 -2
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +0 -5
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +246 -256
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +0 -12
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +4 -7
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +7 -7
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,4BAA4B,QAAQ,uBAAuB;AAIpE;;;;AAIA,OAAO,MAAMC,UAAU,gBAAyCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGN,sBAAsB,CAACI,KAAK,EAAEC,GAAG,CAAC;EAEhDJ,4BAA4B,CAACK,KAAK,CAAC;EAEnC,OAAOP,yBAAyB,CAACO,KAAK,CAAC;EACvC;AACF,CAAC,CAAyC;;AAE1CJ,UAAU,CAACK,WAAW,GAAG,YAAY","names":["React","renderMenuButton_unstable","useMenuButton_unstable","useMenuButtonStyles_unstable","MenuButton","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderMenuButton_unstable } from './renderMenuButton';\nimport { useMenuButton_unstable } from './useMenuButton';\nimport { useMenuButtonStyles_unstable } from './useMenuButtonStyles';\nimport type { MenuButtonProps } from './MenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close\n * menus.\n */\nexport const MenuButton: ForwardRefComponent<MenuButtonProps> = React.forwardRef((props, ref) => {\n const state = useMenuButton_unstable(props, ref);\n\n useMenuButtonStyles_unstable(state);\n\n return renderMenuButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<MenuButtonProps>;\n\nMenuButton.displayName = 'MenuButton';\n"]}
|
@@ -3,7 +3,6 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
|
-
|
7
6
|
export const renderMenuButton_unstable = state => {
|
8
7
|
const {
|
9
8
|
slots,
|
@@ -13,9 +12,12 @@ export const renderMenuButton_unstable = state => {
|
|
13
12
|
icon,
|
14
13
|
iconOnly
|
15
14
|
} = state;
|
16
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
17
|
-
|
18
|
-
}
|
15
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
16
|
+
...slotProps.root
|
17
|
+
}, slots.icon && /*#__PURE__*/React.createElement(slots.icon, {
|
18
|
+
...slotProps.icon
|
19
|
+
}), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && /*#__PURE__*/React.createElement(slots.menuIcon, {
|
20
|
+
...slotProps.menuIcon
|
19
21
|
}));
|
20
22
|
};
|
21
23
|
//# sourceMappingURL=renderMenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAkBE,KAAK,CAAC;EAC7D,MAAM;IAAEG,IAAI;IAAEC;EAAQ,CAAE,GAAGJ,KAAK;EAEhC,oBACEH,oBAACI,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BJ,KAAK,CAACE,IAAI,iBAAIN,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,EAAI,EAChD,CAACC,QAAQ,IAAIF,SAAS,CAACG,IAAI,CAACC,QAAQ,EACpC,CAAC,CAACF,QAAQ,IAAI,EAACD,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,QAAQ,MAAKL,KAAK,CAACM,QAAQ,iBAAIV,oBAACI,KAAK,CAACM,QAAQ;IAAA,GAAKL,SAAS,CAACK;EAAQ,EAAI,CACpF;AAEjB,CAAC","names":["React","getSlots","renderMenuButton_unstable","state","slots","slotProps","icon","iconOnly","root","children","menuIcon"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/renderMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && slotProps.root.children}\n {(!iconOnly || !icon?.children) && slots.menuIcon && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -5,16 +5,15 @@ import { useButton_unstable } from '../Button/index';
|
|
5
5
|
/**
|
6
6
|
* Given user props, returns the final state for a MenuButton.
|
7
7
|
*/
|
8
|
-
|
9
8
|
export const useMenuButton_unstable = ({
|
10
9
|
menuIcon,
|
11
10
|
...props
|
12
11
|
}, ref) => {
|
13
12
|
var _a;
|
14
|
-
|
15
13
|
const buttonState = useButton_unstable(props, ref);
|
16
14
|
buttonState.root['aria-expanded'] = (_a = props['aria-expanded']) !== null && _a !== void 0 ? _a : false;
|
17
|
-
return {
|
15
|
+
return {
|
16
|
+
// Button state
|
18
17
|
...buttonState,
|
19
18
|
// State calculated from a set of props
|
20
19
|
iconOnly: Boolean(!props.children),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,SAASC,kBAAkB,QAAQ,iBAAiB;AAGpD;;;AAGA,OAAO,MAAMC,sBAAsB,GAAG,CACpC;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAmB,EACvCC,GAAqD,KAClC;;EACnB,MAAMC,WAAW,GAAGL,kBAAkB,CAACG,KAAK,EAAEC,GAAG,CAAC;EAClDC,WAAW,CAACC,IAAI,CAAC,eAAe,CAAC,GAAG,WAAK,CAAC,eAAe,CAAC,mCAAI,KAAK;EAEnE,OAAO;IACL;IACA,GAAGD,WAAW;IAEd;IACAE,QAAQ,EAAEC,OAAO,CAAC,CAACL,KAAK,CAACM,QAAQ,CAAC;IAElC;IACAC,UAAU,EAAE;MACVJ,IAAI,EAAE,QAAQ;MACdK,IAAI,EAAE,MAAM;MACZT,QAAQ,EAAE;KACX;IAEDA,QAAQ,EAAEH,gBAAgB,CAACG,QAAQ,EAAE;MACnCU,YAAY,EAAE;QACZH,QAAQ,eAAEZ,oBAACC,kBAAkB;OAC9B;MACDe,QAAQ,EAAE;KACX;GACF;AACH,CAAC","names":["React","ChevronDownRegular","resolveShorthand","useButton_unstable","useMenuButton_unstable","menuIcon","props","ref","buttonState","root","iconOnly","Boolean","children","components","icon","defaultProps","required"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/useMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { MenuButtonProps, MenuButtonState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButton_unstable = (\n { menuIcon, ...props }: MenuButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonState => {\n const buttonState = useButton_unstable(props, ref);\n buttonState.root['aria-expanded'] = props['aria-expanded'] ?? false;\n\n return {\n // Button state\n ...buttonState,\n\n // State calculated from a set of props\n iconOnly: Boolean(!props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n menuIcon: 'span',\n },\n\n menuIcon: resolveShorthand(menuIcon, {\n defaultProps: {\n children: <ChevronDownRegular />,\n },\n required: true,\n }),\n };\n};\n"]}
|
@@ -7,108 +7,102 @@ export const menuButtonClassNames = {
|
|
7
7
|
icon: 'fui-MenuButton__icon',
|
8
8
|
menuIcon: 'fui-MenuButton__menuIcon'
|
9
9
|
};
|
10
|
-
|
11
10
|
const useRootExpandedStyles = /*#__PURE__*/__styles({
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
base: {
|
12
|
+
D0sxk3: "fxoiby5",
|
13
|
+
t6yez3: "f15q0o9g"
|
15
14
|
},
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
outline: {
|
16
|
+
g2u3we: "f1ly1fcm",
|
17
|
+
h3c5rm: ["fi8bssc", "fj6btzu"],
|
18
|
+
B9xav0g: "f1s9tnsa",
|
19
|
+
zhjwy3: ["fj6btzu", "fi8bssc"],
|
20
|
+
B4j52fo: "fgx37oo",
|
21
|
+
Bekrc4i: ["f130t4y6", "f1efpmoh"],
|
22
|
+
Bn0qgzm: "fv51ejd",
|
23
|
+
ibv6hh: ["f1efpmoh", "f130t4y6"],
|
24
|
+
sj55zd: "f14nttnl"
|
26
25
|
},
|
27
|
-
|
28
|
-
|
26
|
+
primary: {
|
27
|
+
De3pzq: "f8w4g0q"
|
29
28
|
},
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
secondary: {
|
30
|
+
De3pzq: "f1nfm20t",
|
31
|
+
g2u3we: "f1ly1fcm",
|
32
|
+
h3c5rm: ["fi8bssc", "fj6btzu"],
|
33
|
+
B9xav0g: "f1s9tnsa",
|
34
|
+
zhjwy3: ["fj6btzu", "fi8bssc"],
|
35
|
+
sj55zd: "f14nttnl"
|
37
36
|
},
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
subtle: {
|
38
|
+
De3pzq: "fq5gl1p",
|
39
|
+
sj55zd: "f1eryozh"
|
41
40
|
},
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
transparent: {
|
42
|
+
De3pzq: "f1q9pm1r",
|
43
|
+
sj55zd: "f1qj7y59"
|
45
44
|
}
|
46
45
|
}, {
|
47
|
-
|
46
|
+
d: [".fxoiby5 .fui-Icon-filled{display:inline;}", ".f15q0o9g .fui-Icon-regular{display:none;}", ".f1ly1fcm{border-top-color:var(--colorNeutralStroke1Selected);}", ".fi8bssc{border-right-color:var(--colorNeutralStroke1Selected);}", ".fj6btzu{border-left-color:var(--colorNeutralStroke1Selected);}", ".f1s9tnsa{border-bottom-color:var(--colorNeutralStroke1Selected);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f8w4g0q{background-color:var(--colorBrandBackgroundSelected);}", ".f1nfm20t{background-color:var(--colorNeutralBackground1Selected);}", ".fq5gl1p{background-color:var(--colorSubtleBackgroundSelected);}", ".f1eryozh{color:var(--colorNeutralForeground2Selected);}", ".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"]
|
48
47
|
});
|
49
|
-
|
50
48
|
const useIconExpandedStyles = /*#__PURE__*/__styles({
|
51
|
-
|
52
|
-
|
49
|
+
outline: {
|
50
|
+
sj55zd: "f14nttnl"
|
53
51
|
},
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
primary: {},
|
53
|
+
secondary: {
|
54
|
+
sj55zd: "f14nttnl"
|
57
55
|
},
|
58
|
-
|
59
|
-
|
56
|
+
subtle: {
|
57
|
+
sj55zd: "f1qj7y59"
|
60
58
|
},
|
61
|
-
|
62
|
-
|
59
|
+
transparent: {
|
60
|
+
sj55zd: "f1qj7y59"
|
63
61
|
}
|
64
62
|
}, {
|
65
|
-
|
63
|
+
d: [".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"]
|
66
64
|
});
|
67
|
-
|
68
65
|
const useMenuIconStyles = /*#__PURE__*/__styles({
|
69
|
-
|
70
|
-
|
66
|
+
base: {
|
67
|
+
Bg96gwp: "fez10in"
|
71
68
|
},
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
small: {
|
70
|
+
Be2twd7: "f1ugzwwg",
|
71
|
+
Bqenvij: "fvblgha",
|
72
|
+
Bg96gwp: "fwrc4pm",
|
73
|
+
a9b677: "frx94fk"
|
77
74
|
},
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
75
|
+
medium: {
|
76
|
+
Be2twd7: "f1ugzwwg",
|
77
|
+
Bqenvij: "fvblgha",
|
78
|
+
Bg96gwp: "fwrc4pm",
|
79
|
+
a9b677: "frx94fk"
|
83
80
|
},
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
large: {
|
82
|
+
Be2twd7: "f4ybsrx",
|
83
|
+
Bqenvij: "fd461yt",
|
84
|
+
Bg96gwp: "faaz57k",
|
85
|
+
a9b677: "fjw5fx7"
|
89
86
|
},
|
90
|
-
|
91
|
-
|
87
|
+
notIconOnly: {
|
88
|
+
Frg6f3: ["fbyavb5", "fm0x6gh"]
|
92
89
|
}
|
93
90
|
}, {
|
94
|
-
|
91
|
+
d: [".fez10in{line-height:0;}", ".f1ugzwwg{font-size:12px;}", ".fvblgha{height:12px;}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".frx94fk{width:12px;}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fjw5fx7{width:16px;}", ".fbyavb5{margin-left:var(--spacingHorizontalXS);}", ".fm0x6gh{margin-right:var(--spacingHorizontalXS);}"]
|
95
92
|
});
|
96
|
-
|
97
93
|
export const useMenuButtonStyles_unstable = state => {
|
98
94
|
const rootExpandedStyles = useRootExpandedStyles();
|
99
95
|
const iconExpandedStyles = useIconExpandedStyles();
|
100
96
|
const menuIconStyles = useMenuIconStyles();
|
101
97
|
state.root.className = mergeClasses(menuButtonClassNames.root, state.root['aria-expanded'] && rootExpandedStyles.base, state.root['aria-expanded'] && rootExpandedStyles[state.appearance], state.root.className);
|
102
|
-
|
103
98
|
if (state.icon) {
|
104
99
|
state.icon.className = mergeClasses(menuButtonClassNames.icon, state.root['aria-expanded'] && iconExpandedStyles[state.appearance], state.icon.className);
|
105
100
|
}
|
106
|
-
|
107
101
|
if (state.menuIcon) {
|
108
102
|
state.menuIcon.className = mergeClasses(menuButtonClassNames.menuIcon, menuIconStyles.base, menuIconStyles[state.size], !state.iconOnly && menuIconStyles.notIconOnly, state.menuIcon.className);
|
109
103
|
}
|
110
|
-
|
111
|
-
|
104
|
+
useButtonStyles_unstable({
|
105
|
+
...state,
|
112
106
|
iconPosition: 'before'
|
113
107
|
});
|
114
108
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,SAASC,YAAY,YAAcC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,wBAAwB,QAAQ,2BAA2B;AAGpE,OAAO,MAAMC,oBAAoB,GAAoC;EACnEC,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE,sBAAsB;EAC5BC,QAAQ,EAAE;CACX;AAED,MAAMC,qBAAqB,gBAAG;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAgC5B;AAEF,MAAMC,qBAAqB,gBAAG;EAAA;IAAA;EAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAiB5B;AAEF,MAAMC,iBAAiB,gBAAG;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EA6BxB;AAEF,OAAO,MAAMC,4BAA4B,GAAIC,KAAsB,IAAqB;EACtF,MAAMC,kBAAkB,GAAGL,qBAAqB,EAAE;EAClD,MAAMM,kBAAkB,GAAGL,qBAAqB,EAAE;EAClD,MAAMM,cAAc,GAAGL,iBAAiB,EAAE;EAE1CE,KAAK,CAACP,IAAI,CAACW,SAAS,GAAGf,YAAY,CACjCG,oBAAoB,CAACC,IAAI,EACzBO,KAAK,CAACP,IAAI,CAAC,eAAe,CAAC,IAAIQ,kBAAkB,CAACI,IAAI,EACtDL,KAAK,CAACP,IAAI,CAAC,eAAe,CAAC,IAAIQ,kBAAkB,CAACD,KAAK,CAACM,UAAU,CAAC,EACnEN,KAAK,CAACP,IAAI,CAACW,SAAS,CACrB;EAED,IAAIJ,KAAK,CAACN,IAAI,EAAE;IACdM,KAAK,CAACN,IAAI,CAACU,SAAS,GAAGf,YAAY,CACjCG,oBAAoB,CAACE,IAAI,EACzBM,KAAK,CAACP,IAAI,CAAC,eAAe,CAAC,IAAIS,kBAAkB,CAACF,KAAK,CAACM,UAAU,CAAC,EACnEN,KAAK,CAACN,IAAI,CAACU,SAAS,CACrB;;EAGH,IAAIJ,KAAK,CAACL,QAAQ,EAAE;IAClBK,KAAK,CAACL,QAAQ,CAACS,SAAS,GAAGf,YAAY,CACrCG,oBAAoB,CAACG,QAAQ,EAC7BQ,cAAc,CAACE,IAAI,EACnBF,cAAc,CAACH,KAAK,CAACO,IAAI,CAAC,EAC1B,CAACP,KAAK,CAACQ,QAAQ,IAAIL,cAAc,CAACM,WAAW,EAC7CT,KAAK,CAACL,QAAQ,CAACS,SAAS,CACzB;;EAGHb,wBAAwB,CAAC;IAAE,GAAGS,KAAK;IAAEU,YAAY,EAAE;EAAQ,CAAE,CAAC;EAE9D,OAAOV,KAAK;AACd,CAAC","names":["iconFilledClassName","iconRegularClassName","tokens","mergeClasses","shorthands","useButtonStyles_unstable","menuButtonClassNames","root","icon","menuIcon","useRootExpandedStyles","useIconExpandedStyles","useMenuIconStyles","useMenuButtonStyles_unstable","state","rootExpandedStyles","iconExpandedStyles","menuIconStyles","className","base","appearance","size","iconOnly","notIconOnly","iconPosition"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/useMenuButtonStyles.ts"],"sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\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\nconst useRootExpandedStyles = makeStyles({\n base: {\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\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});\n\nconst useIconExpandedStyles = makeStyles({\n // Appearance variations\n outline: {\n color: tokens.colorNeutralForeground1Selected,\n },\n primary: {\n /* The primary styles are exactly the same as the base styles. */\n },\n secondary: {\n color: tokens.colorNeutralForeground1Selected,\n },\n subtle: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n transparent: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\nconst useMenuIconStyles = makeStyles({\n base: {\n lineHeight: 0,\n },\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\n // Not-icon only\n notIconOnly: {\n marginLeft: tokens.spacingHorizontalXS,\n },\n});\n\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n const rootExpandedStyles = useRootExpandedStyles();\n const iconExpandedStyles = useIconExpandedStyles();\n const menuIconStyles = useMenuIconStyles();\n\n state.root.className = mergeClasses(\n menuButtonClassNames.root,\n state.root['aria-expanded'] && rootExpandedStyles.base,\n state.root['aria-expanded'] && rootExpandedStyles[state.appearance],\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n menuButtonClassNames.icon,\n state.root['aria-expanded'] && iconExpandedStyles[state.appearance],\n state.icon.className,\n );\n }\n\n if (state.menuIcon) {\n state.menuIcon.className = mergeClasses(\n menuButtonClassNames.menuIcon,\n menuIconStyles.base,\n menuIconStyles[state.size],\n !state.iconOnly && menuIconStyles.notIconOnly,\n state.menuIcon.className,\n );\n }\n\n useButtonStyles_unstable({ ...state, iconPosition: 'before' });\n\n return state;\n};\n"]}
|
@@ -6,11 +6,12 @@ import { useSplitButtonStyles_unstable } from './useSplitButtonStyles';
|
|
6
6
|
* SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
|
7
7
|
* action, while interacting with the second one opens a menu with secondary actions.
|
8
8
|
*/
|
9
|
-
|
10
9
|
export const SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
11
10
|
const state = useSplitButton_unstable(props, ref);
|
12
11
|
useSplitButtonStyles_unstable(state);
|
13
|
-
return renderSplitButton_unstable(state);
|
12
|
+
return renderSplitButton_unstable(state);
|
13
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
14
14
|
});
|
15
|
+
|
15
16
|
SplitButton.displayName = 'SplitButton';
|
16
17
|
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,6BAA6B,QAAQ,wBAAwB;AAItE;;;;AAIA,OAAO,MAAMC,WAAW,gBAA0CJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGN,uBAAuB,CAACI,KAAK,EAAEC,GAAG,CAAC;EAEjDJ,6BAA6B,CAACK,KAAK,CAAC;EAEpC,OAAOP,0BAA0B,CAACO,KAAK,CAAC;EACxC;AACF,CAAC,CAA0C;;AAE3CJ,WAAW,CAACK,WAAW,GAAG,aAAa","names":["React","renderSplitButton_unstable","useSplitButton_unstable","useSplitButtonStyles_unstable","SplitButton","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/SplitButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderSplitButton_unstable } from './renderSplitButton';\nimport { useSplitButton_unstable } from './useSplitButton';\nimport { useSplitButtonStyles_unstable } from './useSplitButtonStyles';\nimport type { SplitButtonProps } from './SplitButton.types';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton: ForwardRefComponent<SplitButtonProps> = React.forwardRef((props, ref) => {\n const state = useSplitButton_unstable(props, ref);\n\n useSplitButtonStyles_unstable(state);\n\n return renderSplitButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<SplitButtonProps>;\n\nSplitButton.displayName = 'SplitButton';\n"]}
|
@@ -3,15 +3,17 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
|
-
|
7
6
|
export const renderSplitButton_unstable = state => {
|
8
7
|
const {
|
9
8
|
slots,
|
10
9
|
slotProps
|
11
10
|
} = getSlots(state);
|
12
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
13
|
-
|
14
|
-
}
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
12
|
+
...slotProps.root
|
13
|
+
}, slots.primaryActionButton && /*#__PURE__*/React.createElement(slots.primaryActionButton, {
|
14
|
+
...slotProps.primaryActionButton
|
15
|
+
}), slots.menuButton && /*#__PURE__*/React.createElement(slots.menuButton, {
|
16
|
+
...slotProps.menuButton
|
15
17
|
}));
|
16
18
|
};
|
17
19
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAmBE,KAAK,CAAC;EAE9D,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,GAC3BF,KAAK,CAACG,mBAAmB,iBAAIP,oBAACI,KAAK,CAACG,mBAAmB;IAAA,GAAKF,SAAS,CAACE;EAAmB,EAAI,EAC7FH,KAAK,CAACI,UAAU,iBAAIR,oBAACI,KAAK,CAACI,UAAU;IAAA,GAAKH,SAAS,CAACG;EAAU,EAAI,CACxD;AAEjB,CAAC","names":["React","getSlots","renderSplitButton_unstable","state","slots","slotProps","root","primaryActionButton","menuButton"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/renderSplitButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton_unstable = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots<SplitButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.primaryActionButton && <slots.primaryActionButton {...slotProps.primaryActionButton} />}\n {slots.menuButton && <slots.menuButton {...slotProps.menuButton} />}\n </slots.root>\n );\n};\n"]}
|
@@ -6,7 +6,6 @@ import { MenuButton } from '../MenuButton/MenuButton';
|
|
6
6
|
* @param props - User provided props to the SplitButton component.
|
7
7
|
* @param ref - User provided ref to be passed to the SplitButton component.
|
8
8
|
*/
|
9
|
-
|
10
9
|
export const useSplitButton_unstable = (props, ref) => {
|
11
10
|
const {
|
12
11
|
appearance = 'secondary',
|
@@ -46,13 +45,12 @@ export const useSplitButton_unstable = (props, ref) => {
|
|
46
45
|
size
|
47
46
|
},
|
48
47
|
required: true
|
49
|
-
});
|
48
|
+
});
|
49
|
+
// Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
|
50
50
|
// by the user.
|
51
|
-
|
52
51
|
if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
|
53
52
|
menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
|
54
53
|
}
|
55
|
-
|
56
54
|
return {
|
57
55
|
// Props passed at the top-level
|
58
56
|
appearance,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AAC1F,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,UAAU,QAAQ,0BAA0B;AAGrD;;;;;AAKA,OAAO,MAAMC,uBAAuB,GAAG,CACrCC,KAAuB,EACvBC,GAAqD,KACjC;EACpB,MAAM;IACJC,UAAU,GAAG,WAAW;IACxBC,QAAQ;IACRC,QAAQ,GAAG,KAAK;IAChBC,iBAAiB,GAAG,KAAK;IACzBC,IAAI;IACJC,YAAY,GAAG,QAAQ;IACvBC,UAAU;IACVC,QAAQ;IACRC,mBAAmB;IACnBC,KAAK,GAAG,SAAS;IACjBC,IAAI,GAAG;EAAQ,CAChB,GAAGZ,KAAK;EAET,MAAMa,MAAM,GAAGjB,KAAK,CAAC,cAAc,CAAC;EAEpC,MAAMkB,mBAAmB,GAAGnB,gBAAgB,CAACa,UAAU,EAAE;IACvDO,YAAY,EAAE;MACZb,UAAU;MACVE,QAAQ;MACRC,iBAAiB;MACjBI,QAAQ;MACRE,KAAK;MACLC;KACD;IACDI,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,4BAA4B,GAAGtB,gBAAgB,CAACe,mBAAmB,EAAE;IACzEK,YAAY,EAAE;MACZb,UAAU;MACVC,QAAQ;MACRC,QAAQ;MACRC,iBAAiB;MACjBC,IAAI;MACJC,YAAY;MACZW,EAAE,EAAEL,MAAM,GAAG,uBAAuB;MACpCF,KAAK;MACLC;KACD;IACDI,QAAQ,EAAE;GACX,CAAC;EAEF;EACA;EACA,IACEF,mBAAmB,IACnBG,4BAA4B,IAC5B,CAACH,mBAAmB,CAAC,YAAY,CAAC,IAClC,CAACA,mBAAmB,CAAC,iBAAiB,CAAC,EACvC;IACAA,mBAAmB,CAAC,iBAAiB,CAAC,GAAGG,4BAA4B,CAACC,EAAE;;EAG1E,OAAO;IACL;IACAhB,UAAU;IACVE,QAAQ;IACRC,iBAAiB;IACjBE,YAAY;IACZI,KAAK;IACLC,IAAI;IAEJ;IACAO,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXZ,UAAU,EAAEV,UAAU;MACtBY,mBAAmB,EAAEb;KACtB;IAEDuB,IAAI,EAAE1B,qBAAqB,CAAC,KAAK,EAAE;MAAEO,GAAG;MAAE,GAAGD;IAAK,CAAE,CAAC;IACrDQ,UAAU,EAAEM,mBAAmB;IAC/BJ,mBAAmB,EAAEO;GACtB;AACH,CAAC","names":["getNativeElementProps","resolveShorthand","useId","Button","MenuButton","useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","menuButtonShorthand","defaultProps","required","primaryActionButtonShorthand","id","components","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/useSplitButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonProps, SplitButtonState } from './SplitButton.types';\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButton_unstable = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonState => {\n const {\n appearance = 'secondary',\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n shape = 'rounded',\n size = 'medium',\n } = props;\n\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = resolveShorthand(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size,\n },\n required: true,\n });\n\n const primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {\n defaultProps: {\n appearance,\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n shape,\n size,\n },\n required: true,\n });\n\n // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided\n // by the user.\n if (\n menuButtonShorthand &&\n primaryActionButtonShorthand &&\n !menuButtonShorthand['aria-label'] &&\n !menuButtonShorthand['aria-labelledby']\n ) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // Slots definition\n components: {\n root: 'div',\n menuButton: MenuButton,\n primaryActionButton: Button,\n },\n\n root: getNativeElementProps('div', { ref, ...props }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"]}
|
@@ -6,82 +6,79 @@ export const splitButtonClassNames = {
|
|
6
6
|
menuButton: 'fui-SplitButton__menuButton',
|
7
7
|
primaryActionButton: 'fui-SplitButton__primaryActionButton'
|
8
8
|
};
|
9
|
-
|
10
9
|
const useFocusStyles = /*#__PURE__*/__styles({
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
primaryActionButton: {
|
11
|
+
Brovlpu: "ftqa4ok",
|
12
|
+
B486eqv: "f2hkw1w",
|
13
|
+
B6xbmo0: ["f1x37qnr", "f1um7c6d"],
|
14
|
+
kdpuga: ["fn4c73s", "f6pwzcr"]
|
16
15
|
},
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
menuButton: {
|
17
|
+
Brovlpu: "ftqa4ok",
|
18
|
+
B486eqv: "f2hkw1w",
|
19
|
+
lbo84a: ["frrbwxo", "f1rgcpbv"],
|
20
|
+
dm238s: ["f1um7c6d", "f1x37qnr"],
|
21
|
+
Bw81rd7: ["f6pwzcr", "fn4c73s"]
|
23
22
|
}
|
24
23
|
}, {
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
25
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
26
|
+
d: [".f1x37qnr[data-fui-focus-visible]{border-top-right-radius:0;}", ".f1um7c6d[data-fui-focus-visible]{border-top-left-radius:0;}", ".fn4c73s[data-fui-focus-visible]{border-bottom-right-radius:0;}", ".f6pwzcr[data-fui-focus-visible]{border-bottom-left-radius:0;}", ".frrbwxo[data-fui-focus-visible]{border-left-width:0;}", ".f1rgcpbv[data-fui-focus-visible]{border-right-width:0;}"]
|
28
27
|
});
|
29
|
-
|
30
28
|
const useRootStyles = /*#__PURE__*/__styles({
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
29
|
+
base: {
|
30
|
+
mc9l5x: "ftuwxu6",
|
31
|
+
Brf1p80: "fsxf2b5",
|
32
|
+
qhf8xq: "f10pi13n",
|
33
|
+
ha4doy: "fmrv4ls",
|
34
|
+
kn2xc0: ["f14uur2j", "fc1btbj"],
|
35
|
+
Bs76p8a: ["fye5tvs", "fc597qq"],
|
36
|
+
cuxpm9: ["f1e8brtx", "fr36rk3"],
|
37
|
+
Biffepf: ["fxp12j1", "f1m6nt2y"],
|
38
|
+
Defnvf: ["fr7y8no", "f1dn0c6m"],
|
39
|
+
z0pv9t: "f1hvqvul"
|
42
40
|
},
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
outline: {},
|
42
|
+
primary: {
|
43
|
+
B1l9wao: ["f117mkrt", "f6ic349"],
|
44
|
+
lcnrd8: ["f10mpf6u", "f1bt8jlh"],
|
45
|
+
Brbpp8k: ["f1c28ih9", "fku5vw4"]
|
48
46
|
},
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
secondary: {},
|
48
|
+
subtle: {
|
49
|
+
B1l9wao: ["fbw67pg", "fcas6k2"],
|
50
|
+
lcnrd8: ["fn44ryq", "fwhhltr"],
|
51
|
+
Brbpp8k: ["f1xppm0p", "fkfp127"]
|
54
52
|
},
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
transparent: {
|
54
|
+
B1l9wao: ["fbw67pg", "fcas6k2"],
|
55
|
+
lcnrd8: ["fn44ryq", "fwhhltr"],
|
56
|
+
Brbpp8k: ["f1xppm0p", "fkfp127"]
|
59
57
|
},
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
circular: {},
|
59
|
+
rounded: {},
|
60
|
+
square: {},
|
61
|
+
disabled: {
|
62
|
+
B1l9wao: ["f10xrnr8", "f15nylwb"],
|
63
|
+
lcnrd8: ["f11fwhjz", "f18vtcsx"],
|
64
|
+
Brbpp8k: ["f31btwb", "fzgm9gq"]
|
67
65
|
},
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
disabledHighContrast: {
|
67
|
+
Bcsxniv: ["fj2q5vi", "f13tct40"],
|
68
|
+
tl7e51: ["fb2mzc7", "f179dhpp"],
|
69
|
+
mba178: ["f1ma39qa", "f1nzpdru"]
|
72
70
|
}
|
73
71
|
}, {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
d: [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f14uur2j .fui-SplitButton__primaryActionButton{border-top-right-radius:0;}", ".fc1btbj .fui-SplitButton__primaryActionButton{border-top-left-radius:0;}", ".fye5tvs .fui-SplitButton__primaryActionButton{border-bottom-right-radius:0;}", ".fc597qq .fui-SplitButton__primaryActionButton{border-bottom-left-radius:0;}", ".f1e8brtx .fui-SplitButton__menuButton{border-left-width:0;}", ".fr36rk3 .fui-SplitButton__menuButton{border-right-width:0;}", ".fxp12j1 .fui-SplitButton__menuButton{border-top-left-radius:0;}", ".f1m6nt2y .fui-SplitButton__menuButton{border-top-right-radius:0;}", ".fr7y8no .fui-SplitButton__menuButton{border-bottom-left-radius:0;}", ".f1dn0c6m .fui-SplitButton__menuButton{border-bottom-right-radius:0;}", ".f1hvqvul .fui-SplitButton__menuButton{min-width:0;}", ".f117mkrt .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundOnBrand);}", ".f6ic349 .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundOnBrand);}", ".fbw67pg .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1);}", ".fcas6k2 .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1);}", ".f10xrnr8 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f15nylwb .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
73
|
+
h: [".f10mpf6u:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundOnBrand);}", ".f1bt8jlh:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundOnBrand);}", ".f1c28ih9:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundOnBrand);}", ".fku5vw4:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundOnBrand);}", ".fn44ryq:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fwhhltr:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xppm0p:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Pressed);}", ".fkfp127:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f11fwhjz:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f18vtcsx:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f31btwb:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fzgm9gq:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
74
|
+
m: [["@media (forced-colors: active){.fj2q5vi .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f13tct40 .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
75
|
+
m: "(forced-colors: active)"
|
78
76
|
}], ["@media (forced-colors: active){.fb2mzc7:hover .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f179dhpp:hover .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
79
|
-
|
77
|
+
m: "(forced-colors: active)"
|
80
78
|
}], ["@media (forced-colors: active){.f1ma39qa:hover:active .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f1nzpdru:hover:active .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
81
|
-
|
79
|
+
m: "(forced-colors: active)"
|
82
80
|
}]]
|
83
81
|
});
|
84
|
-
|
85
82
|
export const useSplitButtonStyles_unstable = state => {
|
86
83
|
const rootStyles = useRootStyles();
|
87
84
|
const focusStyles = useFocusStyles();
|
@@ -91,15 +88,12 @@ export const useSplitButtonStyles_unstable = state => {
|
|
91
88
|
disabledFocusable
|
92
89
|
} = state;
|
93
90
|
state.root.className = mergeClasses(splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);
|
94
|
-
|
95
91
|
if (state.menuButton) {
|
96
92
|
state.menuButton.className = mergeClasses(splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
97
93
|
}
|
98
|
-
|
99
94
|
if (state.primaryActionButton) {
|
100
95
|
state.primaryActionButton.className = mergeClasses(splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
|
101
96
|
}
|
102
|
-
|
103
97
|
return state;
|
104
98
|
};
|
105
99
|
//# sourceMappingURL=useSplitButtonStyles.js.map
|