@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
@@ -4,19 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useSplitButton_unstable = void 0;
|
7
|
-
|
8
7
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
|
-
|
10
8
|
const Button_1 = /*#__PURE__*/require("../Button/Button");
|
11
|
-
|
12
9
|
const MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
|
13
10
|
/**
|
14
11
|
* Given user props, defines default props for the SplitButton and returns processed state.
|
15
12
|
* @param props - User provided props to the SplitButton component.
|
16
13
|
* @param ref - User provided ref to be passed to the SplitButton component.
|
17
14
|
*/
|
18
|
-
|
19
|
-
|
20
15
|
const useSplitButton_unstable = (props, ref) => {
|
21
16
|
const {
|
22
17
|
appearance = 'secondary',
|
@@ -56,13 +51,12 @@ const useSplitButton_unstable = (props, ref) => {
|
|
56
51
|
size
|
57
52
|
},
|
58
53
|
required: true
|
59
|
-
});
|
54
|
+
});
|
55
|
+
// Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
|
60
56
|
// by the user.
|
61
|
-
|
62
57
|
if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
|
63
58
|
menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
|
64
59
|
}
|
65
|
-
|
66
60
|
return {
|
67
61
|
// Props passed at the top-level
|
68
62
|
appearance,
|
@@ -85,6 +79,5 @@ const useSplitButton_unstable = (props, ref) => {
|
|
85
79
|
primaryActionButton: primaryActionButtonShorthand
|
86
80
|
};
|
87
81
|
};
|
88
|
-
|
89
82
|
exports.useSplitButton_unstable = useSplitButton_unstable;
|
90
83
|
//# sourceMappingURL=useSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AACA;AACA;AAGA;;;;;AAKO,MAAMA,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,GAAGC,uBAAK,CAAC,cAAc,CAAC;EAEpC,MAAMC,mBAAmB,GAAGD,kCAAgB,CAACN,UAAU,EAAE;IACvDQ,YAAY,EAAE;MACZd,UAAU;MACVE,QAAQ;MACRC,iBAAiB;MACjBI,QAAQ;MACRE,KAAK;MACLC;KACD;IACDK,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,4BAA4B,GAAGJ,kCAAgB,CAACJ,mBAAmB,EAAE;IACzEM,YAAY,EAAE;MACZd,UAAU;MACVC,QAAQ;MACRC,QAAQ;MACRC,iBAAiB;MACjBC,IAAI;MACJC,YAAY;MACZY,EAAE,EAAEN,MAAM,GAAG,uBAAuB;MACpCF,KAAK;MACLC;KACD;IACDK,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;IACAjB,UAAU;IACVE,QAAQ;IACRC,iBAAiB;IACjBE,YAAY;IACZI,KAAK;IACLC,IAAI;IAEJ;IACAQ,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXb,UAAU,EAAEc,uBAAU;MACtBZ,mBAAmB,EAAEa;KACtB;IAEDF,IAAI,EAAEP,uCAAqB,CAAC,KAAK,EAAE;MAAEb,GAAG;MAAE,GAAGD;IAAK,CAAE,CAAC;IACrDQ,UAAU,EAAEO,mBAAmB;IAC/BL,mBAAmB,EAAEQ;GACtB;AACH,CAAC;AA9EYM,+BAAuB","names":["useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","react_utilities_1","menuButtonShorthand","defaultProps","required","primaryActionButtonShorthand","id","components","root","MenuButton_1","Button_1","exports"],"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"]}
|
@@ -4,94 +4,87 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
11
|
-
|
12
9
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
|
-
|
14
10
|
exports.splitButtonClassNames = {
|
15
11
|
root: 'fui-SplitButton',
|
16
12
|
menuButton: 'fui-SplitButton__menuButton',
|
17
13
|
primaryActionButton: 'fui-SplitButton__primaryActionButton'
|
18
14
|
};
|
19
|
-
|
20
15
|
const useFocusStyles = /*#__PURE__*/react_1.__styles({
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
primaryActionButton: {
|
17
|
+
Brovlpu: "ftqa4ok",
|
18
|
+
B486eqv: "f2hkw1w",
|
19
|
+
B6xbmo0: ["f1x37qnr", "f1um7c6d"],
|
20
|
+
kdpuga: ["fn4c73s", "f6pwzcr"]
|
26
21
|
},
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
22
|
+
menuButton: {
|
23
|
+
Brovlpu: "ftqa4ok",
|
24
|
+
B486eqv: "f2hkw1w",
|
25
|
+
lbo84a: ["frrbwxo", "f1rgcpbv"],
|
26
|
+
dm238s: ["f1um7c6d", "f1x37qnr"],
|
27
|
+
Bw81rd7: ["f6pwzcr", "fn4c73s"]
|
33
28
|
}
|
34
29
|
}, {
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
31
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
32
|
+
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;}"]
|
38
33
|
});
|
39
|
-
|
40
34
|
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
base: {
|
36
|
+
mc9l5x: "ftuwxu6",
|
37
|
+
Brf1p80: "fsxf2b5",
|
38
|
+
qhf8xq: "f10pi13n",
|
39
|
+
ha4doy: "fmrv4ls",
|
40
|
+
kn2xc0: ["f14uur2j", "fc1btbj"],
|
41
|
+
Bs76p8a: ["fye5tvs", "fc597qq"],
|
42
|
+
cuxpm9: ["f1e8brtx", "fr36rk3"],
|
43
|
+
Biffepf: ["fxp12j1", "f1m6nt2y"],
|
44
|
+
Defnvf: ["fr7y8no", "f1dn0c6m"],
|
45
|
+
z0pv9t: "f1hvqvul"
|
52
46
|
},
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
47
|
+
outline: {},
|
48
|
+
primary: {
|
49
|
+
B1l9wao: ["f117mkrt", "f6ic349"],
|
50
|
+
lcnrd8: ["f10mpf6u", "f1bt8jlh"],
|
51
|
+
Brbpp8k: ["f1c28ih9", "fku5vw4"]
|
58
52
|
},
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
53
|
+
secondary: {},
|
54
|
+
subtle: {
|
55
|
+
B1l9wao: ["fbw67pg", "fcas6k2"],
|
56
|
+
lcnrd8: ["fn44ryq", "fwhhltr"],
|
57
|
+
Brbpp8k: ["f1xppm0p", "fkfp127"]
|
64
58
|
},
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
59
|
+
transparent: {
|
60
|
+
B1l9wao: ["fbw67pg", "fcas6k2"],
|
61
|
+
lcnrd8: ["fn44ryq", "fwhhltr"],
|
62
|
+
Brbpp8k: ["f1xppm0p", "fkfp127"]
|
69
63
|
},
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
64
|
+
circular: {},
|
65
|
+
rounded: {},
|
66
|
+
square: {},
|
67
|
+
disabled: {
|
68
|
+
B1l9wao: ["f10xrnr8", "f15nylwb"],
|
69
|
+
lcnrd8: ["f11fwhjz", "f18vtcsx"],
|
70
|
+
Brbpp8k: ["f31btwb", "fzgm9gq"]
|
77
71
|
},
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
72
|
+
disabledHighContrast: {
|
73
|
+
Bcsxniv: ["fj2q5vi", "f13tct40"],
|
74
|
+
tl7e51: ["fb2mzc7", "f179dhpp"],
|
75
|
+
mba178: ["f1ma39qa", "f1nzpdru"]
|
82
76
|
}
|
83
77
|
}, {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
78
|
+
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);}"],
|
79
|
+
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);}"],
|
80
|
+
m: [["@media (forced-colors: active){.fj2q5vi .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f13tct40 .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
81
|
+
m: "(forced-colors: active)"
|
88
82
|
}], ["@media (forced-colors: active){.fb2mzc7:hover .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f179dhpp:hover .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
89
|
-
|
83
|
+
m: "(forced-colors: active)"
|
90
84
|
}], ["@media (forced-colors: active){.f1ma39qa:hover:active .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f1nzpdru:hover:active .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", {
|
91
|
-
|
85
|
+
m: "(forced-colors: active)"
|
92
86
|
}]]
|
93
87
|
});
|
94
|
-
|
95
88
|
const useSplitButtonStyles_unstable = state => {
|
96
89
|
const rootStyles = useRootStyles();
|
97
90
|
const focusStyles = useFocusStyles();
|
@@ -101,17 +94,13 @@ const useSplitButtonStyles_unstable = state => {
|
|
101
94
|
disabledFocusable
|
102
95
|
} = state;
|
103
96
|
state.root.className = react_1.mergeClasses(exports.splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);
|
104
|
-
|
105
97
|
if (state.menuButton) {
|
106
98
|
state.menuButton.className = react_1.mergeClasses(exports.splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
107
99
|
}
|
108
|
-
|
109
100
|
if (state.primaryActionButton) {
|
110
101
|
state.primaryActionButton.className = react_1.mergeClasses(exports.splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
|
111
102
|
}
|
112
|
-
|
113
103
|
return state;
|
114
104
|
};
|
115
|
-
|
116
105
|
exports.useSplitButtonStyles_unstable = useSplitButtonStyles_unstable;
|
117
106
|
//# sourceMappingURL=useSplitButtonStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAIaA,6BAAqB,GAAqC;EACrEC,IAAI,EAAE,iBAAiB;EACvBC,UAAU,EAAE,6BAA6B;EACzCC,mBAAmB,EAAE;CACtB;AAED,MAAMC,cAAc,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAW/B;AAEF,MAAMC,aAAa,gBAAGD,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EA4H9B;AAEK,MAAME,6BAA6B,GAAIC,KAAuB,IAAsB;EACzF,MAAMC,UAAU,GAAGH,aAAa,EAAE;EAClC,MAAMI,WAAW,GAAGN,cAAc,EAAE;EAEpC,MAAM;IAAEO,UAAU;IAAEC,QAAQ;IAAEC;EAAiB,CAAE,GAAGL,KAAK;EAEzDA,KAAK,CAACP,IAAI,CAACa,SAAS,GAAGT,oBAAY,CACjCL,6BAAqB,CAACC,IAAI,EAC1BQ,UAAU,CAACM,IAAI,EACfJ,UAAU,IAAIF,UAAU,CAACE,UAAU,CAAC,EACpC,CAACC,QAAQ,IAAIC,iBAAiB,KAAKJ,UAAU,CAACG,QAAQ,EACtD,CAACA,QAAQ,IAAIC,iBAAiB,KAAKJ,UAAU,CAACO,oBAAoB,EAClER,KAAK,CAACP,IAAI,CAACa,SAAS,CACrB;EAED,IAAIN,KAAK,CAACN,UAAU,EAAE;IACpBM,KAAK,CAACN,UAAU,CAACY,SAAS,GAAGT,oBAAY,CACvCL,6BAAqB,CAACE,UAAU,EAChCQ,WAAW,CAACR,UAAU,EACtBM,KAAK,CAACN,UAAU,CAACY,SAAS,CAC3B;;EAGH,IAAIN,KAAK,CAACL,mBAAmB,EAAE;IAC7BK,KAAK,CAACL,mBAAmB,CAACW,SAAS,GAAGT,oBAAY,CAChDL,6BAAqB,CAACG,mBAAmB,EACzCO,WAAW,CAACP,mBAAmB,EAC/BK,KAAK,CAACL,mBAAmB,CAACW,SAAS,CACpC;;EAGH,OAAON,KAAK;AACd,CAAC;AAhCYR,qCAA6B","names":["exports","root","menuButton","primaryActionButton","useFocusStyles","react_1","useRootStyles","useSplitButtonStyles_unstable","state","rootStyles","focusStyles","appearance","disabled","disabledFocusable","className","base","disabledHighContrast"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/useSplitButtonStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\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\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n }),\n\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n});\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n },\n transparent: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n },\n\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n },\n },\n});\n\nexport const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitButtonState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n\n const { appearance, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n splitButtonClassNames.root,\n rootStyles.base,\n appearance && rootStyles[appearance],\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n state.root.className,\n );\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(\n splitButtonClassNames.menuButton,\n focusStyles.menuButton,\n state.menuButton.className,\n );\n }\n\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(\n splitButtonClassNames.primaryActionButton,\n focusStyles.primaryActionButton,\n state.primaryActionButton.className,\n );\n }\n\n return state;\n};\n"]}
|
@@ -4,23 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.ToggleButton = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const renderToggleButton_1 = /*#__PURE__*/require("./renderToggleButton");
|
11
|
-
|
12
9
|
const useToggleButton_1 = /*#__PURE__*/require("./useToggleButton");
|
13
|
-
|
14
10
|
const useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
15
11
|
/**
|
16
12
|
* ToggleButtons are buttons that toggle between two defined states when triggered.
|
17
13
|
*/
|
18
|
-
|
19
|
-
|
20
14
|
exports.ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
15
|
const state = useToggleButton_1.useToggleButton_unstable(props, ref);
|
22
16
|
useToggleButtonStyles_1.useToggleButtonStyles_unstable(state);
|
23
|
-
return renderToggleButton_1.renderToggleButton_unstable(state);
|
17
|
+
return renderToggleButton_1.renderToggleButton_unstable(state);
|
18
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
24
19
|
});
|
20
|
+
|
25
21
|
exports.ToggleButton.displayName = 'ToggleButton';
|
26
22
|
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,oBAAY,gBAA2CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAClG,MAAMC,KAAK,GAAGC,0CAAwB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAElDG,sDAA8B,CAACF,KAAK,CAAC;EAErC,OAAOG,gDAA2B,CAACH,KAAK,CAAC;EACzC;AACF,CAAC,CAA2C;;AAE5CL,oBAAY,CAACS,WAAW,GAAG,cAAc","names":["exports","React","forwardRef","props","ref","state","useToggleButton_1","useToggleButtonStyles_1","renderToggleButton_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderToggleButton_unstable } from './renderToggleButton';\nimport { useToggleButton_unstable } from './useToggleButton';\nimport { useToggleButtonStyles_unstable } from './useToggleButtonStyles';\nimport type { ToggleButtonProps } from './ToggleButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToggleButtons are buttons that toggle between two defined states when triggered.\n */\nexport const ToggleButton: ForwardRefComponent<ToggleButtonProps> = React.forwardRef((props, ref) => {\n const state = useToggleButton_unstable(props, ref);\n\n useToggleButtonStyles_unstable(state);\n\n return renderToggleButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToggleButtonProps>;\n\nToggleButton.displayName = 'ToggleButton';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassNames = void 0;
|
7
|
-
|
8
7
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
-
|
10
8
|
tslib_1.__exportStar(require("./ToggleButton"), exports);
|
11
|
-
|
12
9
|
tslib_1.__exportStar(require("./ToggleButton.types"), exports);
|
13
|
-
|
14
10
|
tslib_1.__exportStar(require("./renderToggleButton"), exports);
|
15
|
-
|
16
11
|
tslib_1.__exportStar(require("./useToggleButton"), exports);
|
17
|
-
|
18
12
|
var useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
19
|
-
|
20
13
|
Object.defineProperty(exports, "toggleButtonClassNames", {
|
21
14
|
enumerable: true,
|
22
15
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-button/src/components/ToggleButton/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;;AAAAA;AACAA;AACAA;AACAA;AACA;AAASC;EAAAC;EAAAC;IAAA,qDAAsB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,6DAA8B;EAAA;AAAA","names":["tslib_1","Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/ToggleButton/index.ts"],"sourcesContent":["export * from './ToggleButton';\nexport * from './ToggleButton.types';\nexport * from './renderToggleButton';\nexport * from './useToggleButton';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles';\n"]}
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderToggleButton_unstable = void 0;
|
7
|
-
|
8
7
|
var renderButton_1 = /*#__PURE__*/require("../Button/renderButton");
|
9
|
-
|
10
8
|
Object.defineProperty(exports, "renderToggleButton_unstable", {
|
11
9
|
enumerable: true,
|
12
10
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-button/src/components/ToggleButton/renderToggleButton.tsx"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,2CAAqB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/ToggleButton/renderToggleButton.tsx"],"sourcesContent":["export { renderButton_unstable as renderToggleButton_unstable } from '../Button/renderButton';\n"]}
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useToggleButton_unstable = void 0;
|
7
|
-
|
8
7
|
const useToggleState_1 = /*#__PURE__*/require("../../utils/useToggleState");
|
9
|
-
|
10
8
|
const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
11
9
|
/**
|
12
10
|
* Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
|
@@ -14,12 +12,9 @@ const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
|
14
12
|
* @param props - User provided props to the ToggleButton component.
|
15
13
|
* @param ref - User provided ref to be passed to the ToggleButton component.
|
16
14
|
*/
|
17
|
-
|
18
|
-
|
19
15
|
const useToggleButton_unstable = (props, ref) => {
|
20
16
|
const buttonState = useButton_1.useButton_unstable(props, ref);
|
21
17
|
return useToggleState_1.useToggleState(props, buttonState);
|
22
18
|
};
|
23
|
-
|
24
19
|
exports.useToggleButton_unstable = useToggleButton_unstable;
|
25
20
|
//# sourceMappingURL=useToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AACA;AAGA;;;;;;AAMO,MAAMA,wBAAwB,GAAG,CACtCC,KAAwB,EACxBC,GAAqD,KAChC;EACrB,MAAMC,WAAW,GAAGC,8BAAkB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAElD,OAAOG,+BAAc,CAACJ,KAAK,EAAEE,WAAW,CAAC;AAC3C,CAAC;AAPYG,gCAAwB","names":["useToggleButton_unstable","props","ref","buttonState","useButton_1","useToggleState_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/ToggleButton/useToggleButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButton_unstable } from '../Button/useButton';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToggleButton_unstable = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const buttonState = useButton_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"]}
|