@fluentui/react-button 9.0.0-rc.1 → 9.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +475 -1
- package/CHANGELOG.md +297 -172
- package/dist/{react-button.d.ts → index.d.ts} +67 -31
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/Button.js.map +1 -1
- package/lib/CompoundButton.js.map +1 -1
- package/lib/MenuButton.js.map +1 -1
- package/lib/SplitButton.js.map +1 -1
- package/lib/ToggleButton.js.map +1 -1
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.js +3 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +2 -1
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +155 -97
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib/components/CompoundButton/index.js +3 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +7 -2
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +77 -55
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib/components/MenuButton/index.js +3 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +39 -14
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib/components/SplitButton/index.js +3 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +18 -5
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +40 -27
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib/components/ToggleButton/index.js +3 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +3 -41
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +85 -60
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js +11 -5
- package/lib/index.js.map +1 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/useToggleState.js +37 -0
- package/lib/utils/useToggleState.js.map +1 -0
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js.map +1 -1
- 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 +9 -1
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +2 -1
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +157 -98
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- 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 +9 -1
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +7 -2
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +79 -57
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- 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 +9 -1
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +41 -15
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- 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 +9 -1
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +17 -4
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +41 -28
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- 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 +9 -1
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +3 -42
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +89 -62
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +204 -6
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +10 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/lib-commonjs/utils/useToggleState.js +48 -0
- package/lib-commonjs/utils/useToggleState.js.map +1 -0
- package/package.json +20 -22
- package/dist/demo/index.html +0 -71
- package/dist/demo/react-dom.development.js +0 -21413
- package/dist/demo/react.development.js +0 -3155
- package/lib/Button.d.ts +0 -1
- package/lib/CompoundButton.d.ts +0 -1
- package/lib/MenuButton.d.ts +0 -1
- package/lib/SplitButton.d.ts +0 -1
- package/lib/ToggleButton.d.ts +0 -1
- package/lib/components/Button/Button.d.ts +0 -6
- package/lib/components/Button/Button.types.d.ts +0 -62
- package/lib/components/Button/index.d.ts +0 -5
- package/lib/components/Button/renderButton.d.ts +0 -5
- package/lib/components/Button/useButton.d.ts +0 -8
- package/lib/components/Button/useButtonStyles.d.ts +0 -3
- package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
- package/lib/components/CompoundButton/index.d.ts +0 -5
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
- package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -3
- package/lib/components/MenuButton/MenuButton.d.ts +0 -6
- package/lib/components/MenuButton/MenuButton.types.d.ts +0 -10
- package/lib/components/MenuButton/index.d.ts +0 -5
- package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
- package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -3
- package/lib/components/SplitButton/SplitButton.d.ts +0 -7
- package/lib/components/SplitButton/SplitButton.types.d.ts +0 -21
- package/lib/components/SplitButton/index.d.ts +0 -5
- package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
- package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -3
- package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -20
- package/lib/components/ToggleButton/index.d.ts +0 -5
- package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
- package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -3
- package/lib/index.d.ts +0 -5
- package/lib-commonjs/Button.d.ts +0 -1
- package/lib-commonjs/CompoundButton.d.ts +0 -1
- package/lib-commonjs/MenuButton.d.ts +0 -1
- package/lib-commonjs/SplitButton.d.ts +0 -1
- package/lib-commonjs/ToggleButton.d.ts +0 -1
- package/lib-commonjs/components/Button/Button.d.ts +0 -6
- package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
- package/lib-commonjs/components/Button/index.d.ts +0 -5
- package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
- package/lib-commonjs/components/Button/useButton.d.ts +0 -8
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -3
- package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
- package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -3
- package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -10
- package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -3
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -21
- package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -3
- package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -20
- package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -3
- package/lib-commonjs/index.d.ts +0 -5
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useSplitButtonStyles_unstable = exports.splitButtonClassName = void 0;
|
6
|
+
exports.useSplitButtonStyles_unstable = exports.splitButtonClassName = exports.splitButtonClassNames = void 0;
|
7
7
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
@@ -11,11 +11,16 @@ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
11
|
|
12
12
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
13
|
|
14
|
-
exports.
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
exports.splitButtonClassNames = {
|
15
|
+
root: 'fui-SplitButton',
|
16
|
+
menuButton: 'fui-SplitButton__menuButton',
|
17
|
+
primaryActionButton: 'fui-SplitButton__primaryActionButton'
|
18
18
|
};
|
19
|
+
/**
|
20
|
+
* @deprecated Use `splitButtonClassName.root` instead.
|
21
|
+
*/
|
22
|
+
|
23
|
+
exports.splitButtonClassName = exports.splitButtonClassNames.root;
|
19
24
|
|
20
25
|
const useFocusStyles = /*#__PURE__*/react_1.__styles({
|
21
26
|
"primaryActionButton": {
|
@@ -40,43 +45,50 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
40
45
|
"Brf1p80": "fsxf2b5",
|
41
46
|
"qhf8xq": "f10pi13n",
|
42
47
|
"ha4doy": "fmrv4ls",
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
+
"kn2xc0": ["f14uur2j", "fc1btbj"],
|
49
|
+
"Bs76p8a": ["fye5tvs", "fc597qq"],
|
50
|
+
"cuxpm9": ["f1e8brtx", "fr36rk3"],
|
51
|
+
"Biffepf": ["fxp12j1", "f1m6nt2y"],
|
52
|
+
"Defnvf": ["fr7y8no", "f1dn0c6m"],
|
53
|
+
"z0pv9t": "f1hvqvul"
|
48
54
|
},
|
49
55
|
"block": {
|
50
56
|
"a9b677": "fly5x3f"
|
51
57
|
},
|
52
58
|
"outline": {},
|
53
59
|
"primary": {
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
60
|
+
"B1l9wao": ["f12j1tfo", "f1ufkr8r"],
|
61
|
+
"lcnrd8": ["f17lyyco", "f151o42i"],
|
62
|
+
"Brbpp8k": ["f1nb07eg", "fg8a8qi"]
|
57
63
|
},
|
64
|
+
"secondary": {},
|
58
65
|
"subtle": {
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
66
|
+
"B1l9wao": ["f1ysqkm5", "f10nbrj"],
|
67
|
+
"lcnrd8": ["fn44ryq", "fwhhltr"],
|
68
|
+
"Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
|
62
69
|
},
|
63
70
|
"transparent": {
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
71
|
+
"B1l9wao": ["f1ysqkm5", "f10nbrj"],
|
72
|
+
"lcnrd8": ["fn44ryq", "fwhhltr"],
|
73
|
+
"Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
|
67
74
|
},
|
68
75
|
"circular": {},
|
69
76
|
"rounded": {},
|
70
77
|
"square": {},
|
71
78
|
"disabled": {
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
79
|
+
"B1l9wao": ["f10xrnr8", "f15nylwb"],
|
80
|
+
"lcnrd8": ["f11fwhjz", "f18vtcsx"],
|
81
|
+
"Brbpp8k": ["f31btwb", "fzgm9gq"]
|
82
|
+
},
|
83
|
+
"disabledHighContrast": {
|
84
|
+
"Bcsxniv": ["fj2q5vi", "f13tct40"],
|
85
|
+
"tl7e51": ["fb2mzc7", "f179dhpp"],
|
86
|
+
"mba178": ["f1ma39qa", "f1nzpdru"]
|
75
87
|
}
|
76
88
|
}, {
|
77
|
-
"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;}", ".
|
78
|
-
"h": [".
|
79
|
-
"
|
89
|
+
"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;}", ".fly5x3f{width:100%;}", ".f12j1tfo .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ufkr8r .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1ysqkm5 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f10nbrj .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f10xrnr8 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f15nylwb .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
90
|
+
"h": [".f17lyyco:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f151o42i:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1nb07eg:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fg8a8qi:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fn44ryq:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fwhhltr:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fg8lp5p:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1p6hj0a:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".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);}"],
|
91
|
+
"t": ["@media (forced-colors: active){.fj2q5vi .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f13tct40 .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.fb2mzc7:hover .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f179dhpp:hover .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.f1ma39qa:hover:active .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f1nzpdru:hover:active .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}"]
|
80
92
|
});
|
81
93
|
|
82
94
|
const useSplitButtonStyles_unstable = state => {
|
@@ -84,18 +96,19 @@ const useSplitButtonStyles_unstable = state => {
|
|
84
96
|
const focusStyles = useFocusStyles();
|
85
97
|
const {
|
86
98
|
appearance,
|
99
|
+
// eslint-disable-next-line deprecation/deprecation
|
87
100
|
block,
|
88
101
|
disabled,
|
89
102
|
disabledFocusable
|
90
103
|
} = state;
|
91
|
-
state.root.className = react_1.mergeClasses(exports.
|
104
|
+
state.root.className = react_1.mergeClasses(exports.splitButtonClassNames.root, rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);
|
92
105
|
|
93
106
|
if (state.menuButton) {
|
94
|
-
state.menuButton.className = react_1.mergeClasses(
|
107
|
+
state.menuButton.className = react_1.mergeClasses(exports.splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
95
108
|
}
|
96
109
|
|
97
110
|
if (state.primaryActionButton) {
|
98
|
-
state.primaryActionButton.className = react_1.mergeClasses(
|
111
|
+
state.primaryActionButton.className = react_1.mergeClasses(exports.splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
|
99
112
|
}
|
100
113
|
|
101
114
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,qBAAA,GAA0D;AACrE,EAAA,IAAI,EAAE,iBAD+D;AAErE,EAAA,UAAU,EAAE,6BAFyD;AAGrE,EAAA,mBAAmB,EAAE;AAHgD,CAA1D;AAMb;;AAEG;;AACU,OAAA,CAAA,oBAAA,GAAuB,OAAA,CAAA,qBAAA,CAAsB,IAA7C;;AAEb,MAAM,cAAc,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAvB;;AAaA,MAAM,aAAa,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAmIO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;AACzF,QAAM,UAAU,GAAG,aAAa,EAAhC;AACA,QAAM,WAAW,GAAG,cAAc,EAAlC;AAEA,QAAM;AACJ,IAAA,UADI;AAEJ;AACA,IAAA,KAHI;AAIJ,IAAA,QAJI;AAKJ,IAAA;AALI,MAMF,KANJ;AAQA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBAAA,CAAsB,IADD,EAErB,UAAU,CAAC,IAFU,EAGrB,KAAK,IAAI,UAAU,CAAC,KAHC,EAIrB,UAAU,IAAI,UAAU,CAAC,UAAD,CAJH,EAKrB,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,QALzB,EAMrB,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,oBANzB,EAOrB,KAAK,CAAC,IAAN,CAAW,SAPU,CAAvB;;AAUA,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,OAAA,CAAA,YAAA,CAC3B,OAAA,CAAA,qBAAA,CAAsB,UADK,EAE3B,WAAW,CAAC,UAFe,EAG3B,KAAK,CAAC,UAAN,CAAiB,SAHU,CAA7B;AAKD;;AAED,MAAI,KAAK,CAAC,mBAAV,EAA+B;AAC7B,IAAA,KAAK,CAAC,mBAAN,CAA0B,SAA1B,GAAsC,OAAA,CAAA,YAAA,CACpC,OAAA,CAAA,qBAAA,CAAsB,mBADc,EAEpC,WAAW,CAAC,mBAFwB,EAGpC,KAAK,CAAC,mBAAN,CAA0B,SAHU,CAAtC;AAKD;;AAED,SAAO,KAAP;AACD,CAvCM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","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\n/**\n * @deprecated Use `splitButtonClassName.root` instead.\n */\nexport const splitButtonClassName = splitButtonClassNames.root;\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 // Block styles\n block: {\n width: '100%',\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\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.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n },\n transparent: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\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 {\n appearance,\n // eslint-disable-next-line deprecation/deprecation\n block,\n disabled,\n disabledFocusable,\n } = state;\n\n state.root.className = mergeClasses(\n splitButtonClassNames.root,\n rootStyles.base,\n block && rootStyles.block,\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"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,YAAA,gBAAuD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,iBAAA,CAAA,wBAAA,CAAyB,KAAzB,EAAgC,GAAhC,CAAd;AAEA,EAAA,uBAAA,CAAA,8BAAA,CAA+B,KAA/B;AAEA,SAAO,oBAAA,CAAA,2BAAA,CAA4B,KAA5B,CAAP,CALkG,CAMlG;AACD,CAPmE,CAAvD;AASb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","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"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassName = void 0;
|
6
|
+
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassNames = exports.toggleButtonClassName = void 0;
|
7
7
|
|
8
8
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
@@ -16,6 +16,8 @@ tslib_1.__exportStar(require("./renderToggleButton"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./useToggleButton"), exports);
|
17
17
|
|
18
18
|
var useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
19
|
+
/* eslint-disable-next-line deprecation/deprecation */
|
20
|
+
|
19
21
|
|
20
22
|
Object.defineProperty(exports, "toggleButtonClassName", {
|
21
23
|
enumerable: true,
|
@@ -23,6 +25,12 @@ Object.defineProperty(exports, "toggleButtonClassName", {
|
|
23
25
|
return useToggleButtonStyles_1.toggleButtonClassName;
|
24
26
|
}
|
25
27
|
});
|
28
|
+
Object.defineProperty(exports, "toggleButtonClassNames", {
|
29
|
+
enumerable: true,
|
30
|
+
get: function () {
|
31
|
+
return useToggleButtonStyles_1.toggleButtonClassNames;
|
32
|
+
}
|
33
|
+
});
|
26
34
|
Object.defineProperty(exports, "useToggleButtonStyles_unstable", {
|
27
35
|
enumerable: true,
|
28
36
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AACE;;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,8BAAA;AAA8B;AAA9B,CAAA","sourcesContent":["export * from './ToggleButton';\nexport * from './ToggleButton.types';\nexport * from './renderToggleButton';\nexport * from './useToggleButton';\nexport {\n /* eslint-disable-next-line deprecation/deprecation */\n toggleButtonClassName,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n} from './useToggleButtonStyles';\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA","sourcesContent":["export { renderButton_unstable as renderToggleButton_unstable } from '../Button/renderButton';\n"],"sourceRoot":"../src/"}
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useToggleButton_unstable = void 0;
|
7
7
|
|
8
|
-
const
|
9
|
-
|
10
|
-
const React = /*#__PURE__*/require("react");
|
8
|
+
const useToggleState_1 = /*#__PURE__*/require("../../utils/useToggleState");
|
11
9
|
|
12
10
|
const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
13
11
|
/**
|
@@ -18,46 +16,9 @@ const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
|
18
16
|
*/
|
19
17
|
|
20
18
|
|
21
|
-
const useToggleButton_unstable = ({
|
22
|
-
checked,
|
23
|
-
defaultChecked,
|
24
|
-
...props
|
25
|
-
}, ref) => {
|
26
|
-
const {
|
27
|
-
disabled,
|
28
|
-
disabledFocusable
|
29
|
-
} = props;
|
19
|
+
const useToggleButton_unstable = (props, ref) => {
|
30
20
|
const buttonState = useButton_1.useButton_unstable(props, ref);
|
31
|
-
|
32
|
-
role,
|
33
|
-
onClick
|
34
|
-
} = buttonState.root;
|
35
|
-
const [checkedValue, setCheckedValue] = react_utilities_1.useControllableState({
|
36
|
-
state: checked,
|
37
|
-
defaultState: defaultChecked,
|
38
|
-
initialState: false
|
39
|
-
});
|
40
|
-
const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
41
|
-
return { // Button state
|
42
|
-
...buttonState,
|
43
|
-
// State calculated from a set of props
|
44
|
-
checked: checkedValue,
|
45
|
-
// Slots definition
|
46
|
-
root: { ...buttonState.root,
|
47
|
-
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: !disabled && !disabledFocusable && checkedValue,
|
48
|
-
onClick: React.useCallback(ev => {
|
49
|
-
if (onClick) {
|
50
|
-
onClick(ev);
|
51
|
-
|
52
|
-
if (ev.defaultPrevented) {
|
53
|
-
return;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
setCheckedValue(!checkedValue);
|
58
|
-
}, [checkedValue, setCheckedValue, onClick])
|
59
|
-
}
|
60
|
-
};
|
21
|
+
return useToggleState_1.useToggleState(props, buttonState);
|
61
22
|
};
|
62
23
|
|
63
24
|
exports.useToggleButton_unstable = useToggleButton_unstable;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;AAKG;;;AACI,MAAM,wBAAwB,GAAG,CACtC,KADsC,EAEtC,GAFsC,KAGjB;AACrB,QAAM,WAAW,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAApB;AAEA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,WAAtB,CAAP;AACD,CAPM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","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"],"sourceRoot":"../src/"}
|
@@ -3,45 +3,67 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassName = void 0;
|
6
|
+
exports.useToggleButtonStyles_unstable = exports.useDisabledStyles = exports.useCheckedStyles = exports.toggleButtonClassName = exports.toggleButtonClassNames = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
9
9
|
|
10
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
11
|
|
12
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
13
|
+
|
12
14
|
const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
|
13
15
|
|
14
|
-
exports.
|
16
|
+
exports.toggleButtonClassNames = {
|
17
|
+
root: 'fui-ToggleButton',
|
18
|
+
icon: 'fui-ToggleButton__icon'
|
19
|
+
};
|
20
|
+
/**
|
21
|
+
* @deprecated Use `toggleButtonClassName.root` instead.
|
22
|
+
*/
|
15
23
|
|
16
|
-
|
24
|
+
exports.toggleButtonClassName = exports.toggleButtonClassNames.root;
|
25
|
+
exports.useCheckedStyles = /*#__PURE__*/react_1.__styles({
|
17
26
|
"base": {
|
18
27
|
"De3pzq": "f1nfm20t",
|
19
28
|
"g2u3we": "fj3muxo",
|
20
29
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
21
30
|
"B9xav0g": "f1aperda",
|
22
31
|
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
23
|
-
"sj55zd": "
|
32
|
+
"sj55zd": "f14nttnl",
|
24
33
|
"B4j52fo": "f192inf7",
|
25
34
|
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
26
35
|
"Bn0qgzm": "f1vxd6vx",
|
27
36
|
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
37
|
+
"D0sxk3": "fxoiby5",
|
38
|
+
"t6yez3": "f15q0o9g",
|
28
39
|
"Jwef8y": "f1knas48",
|
29
40
|
"Bgoe8wy": "fvcxoqz",
|
30
41
|
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
31
42
|
"oetu4i": "f1xlaoq0",
|
32
43
|
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
33
|
-
"Bi91k9c": "
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
44
|
+
"Bi91k9c": "feu1g3u",
|
45
|
+
"iro3zm": "f141de4g",
|
46
|
+
"b661bw": "f11v6sdu",
|
47
|
+
"Bk6r4ia": ["f9yn8i4", "f1ajwf28"],
|
48
|
+
"B9zn80p": "f1uwu36w",
|
49
|
+
"Bpld233": ["f1ajwf28", "f9yn8i4"],
|
50
|
+
"B2d53fq": "f9olfzr"
|
51
|
+
},
|
52
|
+
"highContrast": {
|
53
|
+
"Bjwas2f": "f132fbg1",
|
54
|
+
"Bn1d65q": ["f1ene5x0", "fzbc999"],
|
55
|
+
"Bxeuatn": "f6jgcol",
|
56
|
+
"n51gp8": ["fzbc999", "f1ene5x0"],
|
57
|
+
"Bbusuzp": "f1isslxv",
|
58
|
+
"G867l3": "fr7nen4",
|
59
|
+
"gdbnj": ["f10aq6ld", "fq8rgo9"],
|
60
|
+
"mxns5l": "f1md2qq2",
|
61
|
+
"o3nasb": ["fq8rgo9", "f10aq6ld"]
|
40
62
|
},
|
41
63
|
"outline": {
|
42
64
|
"De3pzq": "f1q9pm1r",
|
43
65
|
"Jwef8y": "fjxutwb",
|
44
|
-
"
|
66
|
+
"iro3zm": "fwiml72"
|
45
67
|
},
|
46
68
|
"primary": {
|
47
69
|
"De3pzq": "f8w4g0q",
|
@@ -56,13 +78,14 @@ const useCheckedStyles = /*#__PURE__*/react_1.__styles({
|
|
56
78
|
"oetu4i": "f1ukrpxl",
|
57
79
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
58
80
|
"Bi91k9c": "f1rq72xc",
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
81
|
+
"iro3zm": "fnp9lpt",
|
82
|
+
"b661bw": "f1h0usnq",
|
83
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
84
|
+
"B9zn80p": "f16h9ulv",
|
85
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"],
|
86
|
+
"B2d53fq": "f1d6v5y2"
|
65
87
|
},
|
88
|
+
"secondary": {},
|
66
89
|
"subtle": {
|
67
90
|
"De3pzq": "fq5gl1p",
|
68
91
|
"g2u3we": "f1p3nwhy",
|
@@ -76,12 +99,12 @@ const useCheckedStyles = /*#__PURE__*/react_1.__styles({
|
|
76
99
|
"oetu4i": "f1ukrpxl",
|
77
100
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
78
101
|
"Bi91k9c": "f139oj5f",
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
102
|
+
"iro3zm": "fsv2rcd",
|
103
|
+
"b661bw": "f1h0usnq",
|
104
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
105
|
+
"B9zn80p": "f16h9ulv",
|
106
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"],
|
107
|
+
"B2d53fq": "f1fg1p5m"
|
85
108
|
},
|
86
109
|
"transparent": {
|
87
110
|
"De3pzq": "f1q9pm1r",
|
@@ -96,20 +119,19 @@ const useCheckedStyles = /*#__PURE__*/react_1.__styles({
|
|
96
119
|
"oetu4i": "f1ukrpxl",
|
97
120
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
98
121
|
"Bi91k9c": "f139oj5f",
|
99
|
-
"
|
100
|
-
"
|
101
|
-
"
|
102
|
-
"
|
103
|
-
"
|
104
|
-
"
|
122
|
+
"iro3zm": "fwiml72",
|
123
|
+
"b661bw": "f1h0usnq",
|
124
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
125
|
+
"B9zn80p": "f16h9ulv",
|
126
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"],
|
127
|
+
"B2d53fq": "f1fg1p5m"
|
105
128
|
}
|
106
129
|
}, {
|
107
|
-
"d": [".f1nfm20t{background-color:var(--colorNeutralBackground1Selected);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".
|
108
|
-
"h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".
|
109
|
-
"
|
130
|
+
"d": [".f1nfm20t{background-color:var(--colorNeutralBackground1Selected);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fxoiby5 .fui-Icon-filled{display:inline;}", ".f15q0o9g .fui-Icon-regular{display:none;}", ".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}", ".f8w4g0q{background-color:var(--colorBrandBackgroundSelected);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".fq5gl1p{background-color:var(--colorSubtleBackgroundSelected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"],
|
131
|
+
"h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}", ".f141de4g:hover:active{background-color:var(--colorNeutralBackground1Pressed);}", ".f11v6sdu:hover:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f9yn8i4:hover:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1ajwf28:hover:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f1uwu36w:hover:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f9olfzr:hover:active{color:var(--colorNeutralForeground1Pressed);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".fwiml72:hover:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f15wkkf3:hover{background-color:var(--colorBrandBackgroundHover);}", ".f1s2uweq:hover{border-top-color:transparent;}", ".fr80ssc:hover{border-right-color:transparent;}", ".fecsdlb:hover{border-left-color:transparent;}", ".f1ukrpxl:hover{border-bottom-color:transparent;}", ".f1rq72xc:hover{color:var(--colorNeutralForegroundOnBrand);}", ".fnp9lpt:hover:active{background-color:var(--colorBrandBackgroundPressed);}", ".f1h0usnq:hover:active{border-top-color:transparent;}", ".fs4ktlq:hover:active{border-right-color:transparent;}", ".fx2bmrt:hover:active{border-left-color:transparent;}", ".f16h9ulv:hover:active{border-bottom-color:transparent;}", ".f1d6v5y2:hover:active{color:var(--colorNeutralForegroundOnBrand);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}", ".fsv2rcd:hover:active{background-color:var(--colorSubtleBackgroundPressed);}", ".f1fg1p5m:hover:active{color:var(--colorNeutralForeground2BrandPressed);}"],
|
132
|
+
"t": ["@media (forced-colors: active){.f132fbg1{border-top-color:Highlight;}}", "@media (forced-colors: active){.f1ene5x0{border-right-color:Highlight;}.fzbc999{border-left-color:Highlight;}}", "@media (forced-colors: active){.f6jgcol{border-bottom-color:Highlight;}}", "@media (forced-colors: active){.fzbc999{border-left-color:Highlight;}.f1ene5x0{border-right-color:Highlight;}}", "@media (forced-colors: active){.f1isslxv{color:Highlight;}}", "@media (forced-colors: active){.fr7nen4:focus{border-top-color:Highlight;}}", "@media (forced-colors: active){.f10aq6ld:focus{border-right-color:Highlight;}.fq8rgo9:focus{border-left-color:Highlight;}}", "@media (forced-colors: active){.f1md2qq2:focus{border-bottom-color:Highlight;}}", "@media (forced-colors: active){.fq8rgo9:focus{border-left-color:Highlight;}.f10aq6ld:focus{border-right-color:Highlight;}}"]
|
110
133
|
});
|
111
|
-
|
112
|
-
const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
134
|
+
exports.useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
113
135
|
"base": {
|
114
136
|
"De3pzq": "f1bg9a2p",
|
115
137
|
"g2u3we": "f1jj8ep1",
|
@@ -123,12 +145,12 @@ const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
|
123
145
|
"oetu4i": "f1jnshp0",
|
124
146
|
"gg5e9n": ["f18rmfxp", "f1gwvigk"],
|
125
147
|
"Bi91k9c": "fvgxktp",
|
126
|
-
"
|
127
|
-
"
|
128
|
-
"
|
129
|
-
"
|
130
|
-
"
|
131
|
-
"
|
148
|
+
"iro3zm": "f1t6o4dc",
|
149
|
+
"b661bw": "f10ztigi",
|
150
|
+
"Bk6r4ia": ["f1ft5sdu", "f1gzf82w"],
|
151
|
+
"B9zn80p": "f12zbtn2",
|
152
|
+
"Bpld233": ["f1gzf82w", "f1ft5sdu"],
|
153
|
+
"B2d53fq": "fcvwxyo"
|
132
154
|
},
|
133
155
|
"outline": {},
|
134
156
|
"primary": {
|
@@ -140,11 +162,12 @@ const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
|
140
162
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
141
163
|
"oetu4i": "f1ukrpxl",
|
142
164
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
143
|
-
"
|
144
|
-
"
|
145
|
-
"
|
146
|
-
"
|
165
|
+
"b661bw": "f1h0usnq",
|
166
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
167
|
+
"B9zn80p": "f16h9ulv",
|
168
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"]
|
147
169
|
},
|
170
|
+
"secondary": {},
|
148
171
|
"subtle": {
|
149
172
|
"De3pzq": "f3rmtva",
|
150
173
|
"g2u3we": "f1p3nwhy",
|
@@ -156,11 +179,11 @@ const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
|
156
179
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
157
180
|
"oetu4i": "f1ukrpxl",
|
158
181
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
159
|
-
"
|
160
|
-
"
|
161
|
-
"
|
162
|
-
"
|
163
|
-
"
|
182
|
+
"iro3zm": "fvaszet",
|
183
|
+
"b661bw": "f1h0usnq",
|
184
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
185
|
+
"B9zn80p": "f16h9ulv",
|
186
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"]
|
164
187
|
},
|
165
188
|
"transparent": {
|
166
189
|
"De3pzq": "f3rmtva",
|
@@ -173,31 +196,35 @@ const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
|
173
196
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
174
197
|
"oetu4i": "f1ukrpxl",
|
175
198
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
176
|
-
"
|
177
|
-
"
|
178
|
-
"
|
179
|
-
"
|
180
|
-
"
|
199
|
+
"iro3zm": "fvaszet",
|
200
|
+
"b661bw": "f1h0usnq",
|
201
|
+
"Bk6r4ia": ["fs4ktlq", "fx2bmrt"],
|
202
|
+
"B9zn80p": "f16h9ulv",
|
203
|
+
"Bpld233": ["fx2bmrt", "fs4ktlq"]
|
181
204
|
}
|
182
205
|
}, {
|
183
206
|
"d": [".f1bg9a2p{background-color:var(--colorNeutralBackgroundDisabled);}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f3rmtva{background-color:transparent;}"],
|
184
|
-
"h": [".f1falr9n:hover{background-color:var(--colorNeutralBackgroundDisabled);}", ".f12mpcsy:hover{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f1gwvigk:hover{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f18rmfxp:hover{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f1jnshp0:hover{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}", ".f1s2uweq:hover{border-top-color:transparent;}", ".fr80ssc:hover{border-right-color:transparent;}", ".fecsdlb:hover{border-left-color:transparent;}", ".f1ukrpxl:hover{border-bottom-color:transparent;}", ".f1cio4g9:hover{background-color:transparent;}"]
|
185
|
-
"a": [".f1ryyzvn:active{background-color:var(--colorNeutralBackgroundDisabled);}", ".fdi4vxw:active{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f4ryxzl:active{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fkdgpbx:active{border-left-color:var(--colorNeutralStrokeDisabled);}", ".fcmhn06:active{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f19wldhg:active{color:var(--colorNeutralForegroundDisabled);}", ".ff472gp:active{border-top-color:transparent;}", ".f4yyc7m:active{border-right-color:transparent;}", ".ft2aflc:active{border-left-color:transparent;}", ".fggejwh:active{border-bottom-color:transparent;}", ".f1rot6hk:active{background-color:transparent;}"]
|
207
|
+
"h": [".f1falr9n:hover{background-color:var(--colorNeutralBackgroundDisabled);}", ".f12mpcsy:hover{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f1gwvigk:hover{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f18rmfxp:hover{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f1jnshp0:hover{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}", ".f1t6o4dc:hover:active{background-color:var(--colorNeutralBackgroundDisabled);}", ".f10ztigi:hover:active{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f1ft5sdu:hover:active{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1gzf82w:hover:active{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f12zbtn2:hover:active{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".fcvwxyo:hover:active{color:var(--colorNeutralForegroundDisabled);}", ".f1s2uweq:hover{border-top-color:transparent;}", ".fr80ssc:hover{border-right-color:transparent;}", ".fecsdlb:hover{border-left-color:transparent;}", ".f1ukrpxl:hover{border-bottom-color:transparent;}", ".f1h0usnq:hover:active{border-top-color:transparent;}", ".fs4ktlq:hover:active{border-right-color:transparent;}", ".fx2bmrt:hover:active{border-left-color:transparent;}", ".f16h9ulv:hover:active{border-bottom-color:transparent;}", ".f1cio4g9:hover{background-color:transparent;}", ".fvaszet:hover:active{background-color:transparent;}"]
|
186
208
|
});
|
187
209
|
|
188
210
|
const useToggleButtonStyles_unstable = state => {
|
189
|
-
const checkedStyles = useCheckedStyles();
|
190
|
-
const disabledStyles = useDisabledStyles();
|
211
|
+
const checkedStyles = exports.useCheckedStyles();
|
212
|
+
const disabledStyles = exports.useDisabledStyles();
|
191
213
|
const {
|
192
214
|
appearance,
|
193
215
|
checked,
|
194
216
|
disabled,
|
195
217
|
disabledFocusable
|
196
218
|
} = state;
|
197
|
-
state.root.className = react_1.mergeClasses(exports.
|
198
|
-
checked && checkedStyles.base, appearance && checked && checkedStyles[appearance], // Disabled styles
|
219
|
+
state.root.className = react_1.mergeClasses(exports.toggleButtonClassNames.root, // Checked styles
|
220
|
+
checked && checkedStyles.base, checked && checkedStyles.highContrast, appearance && checked && checkedStyles[appearance], // Disabled styles
|
199
221
|
(disabled || disabledFocusable) && disabledStyles.base, appearance && (disabled || disabledFocusable) && disabledStyles[appearance], // User provided class name
|
200
222
|
state.root.className);
|
223
|
+
|
224
|
+
if (state.icon) {
|
225
|
+
state.icon.className = react_1.mergeClasses(exports.toggleButtonClassNames.icon, state.icon.className);
|
226
|
+
}
|
227
|
+
|
201
228
|
useButtonStyles_1.useButtonStyles_unstable(state);
|
202
229
|
return state;
|
203
230
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAKa,OAAA,CAAA,sBAAA,GAAsD;AACjE,EAAA,IAAI,EAAE,kBAD2D;AAEjE,EAAA,IAAI,EAAE;AAF2D,CAAtD;AAKb;;AAEG;;AACU,OAAA,CAAA,qBAAA,GAAwB,OAAA,CAAA,sBAAA,CAAuB,IAA/C;AAEA,OAAA,CAAA,gBAAA,gBAAmB,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAnB;AA6GA,OAAA,CAAA,iBAAA,gBAAoB,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAoEN,MAAM,8BAA8B,GAAI,KAAD,IAAgD;AAC5F,QAAM,aAAa,GAAG,OAAA,CAAA,gBAAA,EAAtB;AACA,QAAM,cAAc,GAAG,OAAA,CAAA,iBAAA,EAAvB;AAEA,QAAM;AAAE,IAAA,UAAF;AAAc,IAAA,OAAd;AAAuB,IAAA,QAAvB;AAAiC,IAAA;AAAjC,MAAuD,KAA7D;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,sBAAA,CAAuB,IADF,EAGrB;AACA,EAAA,OAAO,IAAI,aAAa,CAAC,IAJJ,EAKrB,OAAO,IAAI,aAAa,CAAC,YALJ,EAMrB,UAAU,IAAI,OAAd,IAAyB,aAAa,CAAC,UAAD,CANjB,EAQrB;AACA,GAAC,QAAQ,IAAI,iBAAb,KAAmC,cAAc,CAAC,IAT7B,EAUrB,UAAU,KAAK,QAAQ,IAAI,iBAAjB,CAAV,IAAiD,cAAc,CAAC,UAAD,CAV1C,EAYrB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAbU,CAAvB;;AAgBA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,sBAAA,CAAuB,IAApC,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAvB;AACD;;AAED,EAAA,iBAAA,CAAA,wBAAA,CAAyB,KAAzB;AAEA,SAAO,KAAP;AACD,CA7BM;;AAAM,OAAA,CAAA,8BAAA,GAA8B,8BAA9B","sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots } from '../Button/Button.types';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nexport const toggleButtonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon',\n};\n\n/**\n * @deprecated Use `toggleButtonClassName.root` instead.\n */\nexport const toggleButtonClassName = toggleButtonClassNames.root;\n\nexport const useCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n\n ':focus': {\n ...shorthands.borderColor('Highlight'),\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\nexport const useDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n ...shorthands.borderColor('transparent'),\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nexport const useToggleButtonStyles_unstable = (state: ToggleButtonState): ToggleButtonState => {\n const checkedStyles = useCheckedStyles();\n const disabledStyles = useDisabledStyles();\n\n const { appearance, checked, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n toggleButtonClassNames.root,\n\n // Checked styles\n checked && checkedStyles.base,\n checked && checkedStyles.highContrast,\n appearance && checked && checkedStyles[appearance],\n\n // Disabled styles\n (disabled || disabledFocusable) && disabledStyles.base,\n appearance && (disabled || disabledFocusable) && disabledStyles[appearance],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(toggleButtonClassNames.icon, state.icon.className);\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|