@fluentui/react-button 0.0.0-nightlyfbae36b19b20211111.1 → 0.0.0-nightlyfc5cfdc52420220215.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +331 -26
- package/CHANGELOG.md +79 -14
- package/dist/react-button.d.ts +31 -33
- package/lib/components/Button/Button.js +6 -6
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +5 -5
- package/lib/components/Button/index.d.ts +2 -2
- package/lib/components/Button/index.js +1 -2
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.d.ts +1 -1
- package/lib/components/Button/renderButton.js +6 -3
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +1 -1
- package/lib/components/Button/useButton.js +3 -2
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +1 -9
- package/lib/components/Button/useButtonStyles.js +97 -72
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +6 -6
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +4 -4
- package/lib/components/CompoundButton/index.d.ts +1 -1
- package/lib/components/CompoundButton/index.js +1 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +8 -3
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.d.ts +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +3 -3
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +14 -13
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -6
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.d.ts +3 -4
- package/lib/components/MenuButton/index.d.ts +1 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.d.ts +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +6 -3
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.d.ts +1 -1
- package/lib/components/MenuButton/useMenuButton.js +5 -5
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +4 -4
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +6 -6
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.d.ts +6 -4
- package/lib/components/SplitButton/index.d.ts +1 -1
- package/lib/components/SplitButton/index.js +1 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.d.ts +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +6 -3
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.d.ts +1 -1
- package/lib/components/SplitButton/useSplitButton.js +13 -3
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +3 -2
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +6 -6
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +2 -1
- package/lib/components/ToggleButton/index.d.ts +1 -1
- package/lib/components/ToggleButton/index.js +1 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +8 -4
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +35 -34
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +3 -3
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +5 -5
- package/lib-commonjs/components/Button/index.d.ts +2 -2
- package/lib-commonjs/components/Button/index.js +3 -5
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.d.ts +1 -1
- package/lib-commonjs/components/Button/renderButton.js +8 -5
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.d.ts +1 -1
- package/lib-commonjs/components/Button/useButton.js +5 -4
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +1 -9
- package/lib-commonjs/components/Button/useButtonStyles.js +106 -80
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -3
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +4 -4
- package/lib-commonjs/components/CompoundButton/index.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +3 -3
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +10 -5
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +4 -4
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +25 -23
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -3
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +3 -4
- package/lib-commonjs/components/MenuButton/index.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/index.js +3 -3
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +8 -5
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +5 -5
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +8 -8
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -3
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +6 -4
- package/lib-commonjs/components/SplitButton/index.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/index.js +3 -3
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +8 -5
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +14 -4
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +11 -9
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -3
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +2 -1
- package/lib-commonjs/components/ToggleButton/index.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +3 -3
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +9 -5
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +40 -38
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/package.json +12 -15
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderSplitButton_unstable = void 0;
|
7
7
|
|
8
8
|
const React = /*#__PURE__*/require("react");
|
9
9
|
|
@@ -13,13 +13,16 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
|
16
|
-
const
|
16
|
+
const renderSplitButton_unstable = state => {
|
17
17
|
const {
|
18
18
|
slots,
|
19
19
|
slotProps
|
20
|
-
} = react_utilities_1.getSlots(state
|
21
|
-
return React.createElement(slots.root,
|
20
|
+
} = react_utilities_1.getSlots(state);
|
21
|
+
return React.createElement(slots.root, { ...slotProps.root
|
22
|
+
}, slots.primaryActionButton && React.createElement(slots.primaryActionButton, { ...slotProps.primaryActionButton
|
23
|
+
}), slots.menuButton && React.createElement(slots.menuButton, { ...slotProps.menuButton
|
24
|
+
}));
|
22
25
|
};
|
23
26
|
|
24
|
-
exports.
|
27
|
+
exports.renderSplitButton_unstable = renderSplitButton_unstable;
|
25
28
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,mBAAN,IAA6B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,EAAA,GAAK,SAAS,CAAC;AAAf,GAA1B,CADhC,EAEG,KAAK,CAAC,UAAN,IAAoB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAjB,CAFvB,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourceRoot":""}
|
@@ -5,4 +5,4 @@ import type { SplitButtonProps, SplitButtonState } from './SplitButton.types';
|
|
5
5
|
* @param props - User provided props to the SplitButton component.
|
6
6
|
* @param ref - User provided ref to be passed to the SplitButton component.
|
7
7
|
*/
|
8
|
-
export declare const
|
8
|
+
export declare const useSplitButton_unstable: (props: SplitButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useSplitButton_unstable = void 0;
|
7
7
|
|
8
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
@@ -17,7 +17,7 @@ const MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
|
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
const
|
20
|
+
const useSplitButton_unstable = (props, ref) => {
|
21
21
|
const {
|
22
22
|
appearance,
|
23
23
|
block = false,
|
@@ -27,15 +27,18 @@ const useSplitButton = (props, ref) => {
|
|
27
27
|
icon,
|
28
28
|
iconPosition = 'before',
|
29
29
|
menuButton,
|
30
|
+
menuIcon,
|
30
31
|
primaryActionButton,
|
31
32
|
shape = 'rounded',
|
32
33
|
size = 'medium'
|
33
34
|
} = props;
|
35
|
+
const baseId = react_utilities_1.useId('splitButton-');
|
34
36
|
const menuButtonShorthand = react_utilities_1.resolveShorthand(menuButton, {
|
35
37
|
defaultProps: {
|
36
38
|
appearance,
|
37
39
|
disabled,
|
38
40
|
disabledFocusable,
|
41
|
+
menuIcon,
|
39
42
|
shape,
|
40
43
|
size
|
41
44
|
}
|
@@ -49,10 +52,17 @@ const useSplitButton = (props, ref) => {
|
|
49
52
|
disabledFocusable,
|
50
53
|
icon,
|
51
54
|
iconPosition,
|
55
|
+
id: baseId + '__primaryActionButton',
|
52
56
|
shape,
|
53
57
|
size
|
54
58
|
}
|
55
|
-
});
|
59
|
+
}); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
|
60
|
+
// by the user.
|
61
|
+
|
62
|
+
if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
|
63
|
+
menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
|
64
|
+
}
|
65
|
+
|
56
66
|
return {
|
57
67
|
// Props passed at the top-level
|
58
68
|
appearance,
|
@@ -77,5 +87,5 @@ const useSplitButton = (props, ref) => {
|
|
77
87
|
};
|
78
88
|
};
|
79
89
|
|
80
|
-
exports.
|
90
|
+
exports.useSplitButton_unstable = useSplitButton_unstable;
|
81
91
|
//# sourceMappingURL=useSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,QAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,QAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,uBAAuB,GAAG,CACrC,KADqC,EAErC,GAFqC,KAGjB;AACpB,QAAM;AACJ,IAAA,UADI;AAEJ,IAAA,KAAK,GAAG,KAFJ;AAGJ,IAAA,QAHI;AAIJ,IAAA,QAAQ,GAAG,KAJP;AAKJ,IAAA,iBAAiB,GAAG,KALhB;AAMJ,IAAA,IANI;AAOJ,IAAA,YAAY,GAAG,QAPX;AAQJ,IAAA,UARI;AASJ,IAAA,QATI;AAUJ,IAAA,mBAVI;AAWJ,IAAA,KAAK,GAAG,SAXJ;AAYJ,IAAA,IAAI,GAAG;AAZH,MAaF,KAbJ;AAeA,QAAM,MAAM,GAAG,iBAAA,CAAA,KAAA,CAAM,cAAN,CAAf;AAEA,QAAM,mBAAmB,GAAG,iBAAA,CAAA,gBAAA,CAAiB,UAAjB,EAA6B;AACvD,IAAA,YAAY,EAAE;AACZ,MAAA,UADY;AAEZ,MAAA,QAFY;AAGZ,MAAA,iBAHY;AAIZ,MAAA,QAJY;AAKZ,MAAA,KALY;AAMZ,MAAA;AANY;AADyC,GAA7B,CAA5B;AAWA,QAAM,4BAA4B,GAAG,iBAAA,CAAA,gBAAA,CAAiB,mBAAjB,EAAsC;AACzE,IAAA,YAAY,EAAE;AACZ,MAAA,UADY;AAEZ,MAAA,KAFY;AAGZ,MAAA,QAHY;AAIZ,MAAA,QAJY;AAKZ,MAAA,iBALY;AAMZ,MAAA,IANY;AAOZ,MAAA,YAPY;AAQZ,MAAA,EAAE,EAAE,MAAM,GAAG,uBARD;AASZ,MAAA,KATY;AAUZ,MAAA;AAVY;AAD2D,GAAtC,CAArC,CA7BoB,CA4CpB;AACA;;AACA,MACE,mBAAmB,IACnB,4BADA,IAEA,CAAC,mBAAmB,CAAC,YAAD,CAFpB,IAGA,CAAC,mBAAmB,CAAC,iBAAD,CAJtB,EAKE;AACA,IAAA,mBAAmB,CAAC,iBAAD,CAAnB,GAAyC,4BAA4B,CAAC,EAAtE;AACD;;AAED,SAAO;AACL;AACA,IAAA,UAFK;AAGL,IAAA,KAHK;AAIL,IAAA,QAJK;AAKL,IAAA,iBALK;AAML,IAAA,YANK;AAOL,IAAA,KAPK;AAQL,IAAA,IARK;AAUL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,UAAU,EAAE,YAAA,CAAA,UAFF;AAGV,MAAA,mBAAmB,EAAE,QAAA,CAAA;AAHX,KAXP;AAiBL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAA7B,CAjBD;AAkBL,IAAA,UAAU,EAAE,mBAlBP;AAmBL,IAAA,mBAAmB,EAAE;AAnBhB,GAAP;AAqBD,CA/EM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { SplitButtonState } from './SplitButton.types';
|
2
2
|
export declare const splitButtonClassName = "fui-SplitButton";
|
3
|
-
export declare const
|
3
|
+
export declare const useSplitButtonStyles_unstable: (state: SplitButtonState) => SplitButtonState;
|
@@ -3,19 +3,21 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useSplitButtonStyles_unstable = exports.splitButtonClassName = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
10
10
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
11
11
|
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
|
+
|
12
14
|
exports.splitButtonClassName = 'fui-SplitButton';
|
13
15
|
const SplitButtonClassNames = {
|
14
16
|
primaryActionButton: `${exports.splitButtonClassName}-primaryActionButton`,
|
15
17
|
menuButton: `${exports.splitButtonClassName}-menuButton`
|
16
18
|
};
|
17
19
|
|
18
|
-
const useFocusStyles = /*#__PURE__*/
|
20
|
+
const useFocusStyles = /*#__PURE__*/react_1.__styles({
|
19
21
|
"primaryActionButton": {
|
20
22
|
"B486eqv": "f2hkw1w",
|
21
23
|
"Bmrpcm6": ["fub8a6s", "f1g41uvt"],
|
@@ -32,7 +34,7 @@ const useFocusStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
32
34
|
"d": ["[data-keyboard-nav] .fub8a6s:focus{border-top-right-radius:0;}", "[data-keyboard-nav] .f1g41uvt:focus{border-top-left-radius:0;}", "[data-keyboard-nav] .f58hr3h:focus{border-bottom-right-radius:0;}", "[data-keyboard-nav] .f1u1mnrj:focus{border-bottom-left-radius:0;}", "[data-keyboard-nav] .fy9hclh:focus{border-left-width:0;}", "[data-keyboard-nav] .f549e1y:focus{border-right-width:0;}"]
|
33
35
|
});
|
34
36
|
|
35
|
-
const useRootStyles = /*#__PURE__*/
|
37
|
+
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
36
38
|
"base": {
|
37
39
|
"mc9l5x": "ftuwxu6",
|
38
40
|
"Brf1p80": "fsxf2b5",
|
@@ -77,7 +79,7 @@ const useRootStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
77
79
|
"a": [".fnmoi2n:active .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1l3povx:active .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fjmcta:active .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fm99moz:active .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1lpnjjp:active .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f8nirj0:active .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"]
|
78
80
|
});
|
79
81
|
|
80
|
-
const
|
82
|
+
const useSplitButtonStyles_unstable = state => {
|
81
83
|
const rootStyles = useRootStyles();
|
82
84
|
const focusStyles = useFocusStyles();
|
83
85
|
const {
|
@@ -86,18 +88,18 @@ const useSplitButtonStyles = state => {
|
|
86
88
|
disabled,
|
87
89
|
disabledFocusable
|
88
90
|
} = state;
|
89
|
-
state.root.className =
|
91
|
+
state.root.className = react_1.mergeClasses(exports.splitButtonClassName, rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
|
90
92
|
|
91
93
|
if (state.menuButton) {
|
92
|
-
state.menuButton.className =
|
94
|
+
state.menuButton.className = react_1.mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
93
95
|
}
|
94
96
|
|
95
97
|
if (state.primaryActionButton) {
|
96
|
-
state.primaryActionButton.className =
|
98
|
+
state.primaryActionButton.className = react_1.mergeClasses(SplitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
|
97
99
|
}
|
98
100
|
|
99
101
|
return state;
|
100
102
|
};
|
101
103
|
|
102
|
-
exports.
|
104
|
+
exports.useSplitButtonStyles_unstable = useSplitButtonStyles_unstable;
|
103
105
|
//# sourceMappingURL=useSplitButtonStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,
|
1
|
+
{"version":3,"sources":["../../../src/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;;AAGa,OAAA,CAAA,oBAAA,GAAuB,iBAAvB;AAEb,MAAM,qBAAqB,GAAG;AAC5B,EAAA,mBAAmB,EAAE,GAAG,OAAA,CAAA,oBAAoB,sBADhB;AAE5B,EAAA,UAAU,EAAE,GAAG,OAAA,CAAA,oBAAoB;AAFP,CAA9B;;AAKA,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,EAAtB;;AAgHO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;AACzF,QAAM,UAAU,GAAG,aAAa,EAAhC;AACA,QAAM,WAAW,GAAG,cAAc,EAAlC;AAEA,QAAM;AAAE,IAAA,UAAF;AAAc,IAAA,KAAd;AAAqB,IAAA,QAArB;AAA+B,IAAA;AAA/B,MAAqD,KAA3D;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,oBADqB,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,KAAK,CAAC,IAAN,CAAW,SANU,CAAvB;;AASA,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,OAAA,CAAA,YAAA,CAC3B,qBAAqB,CAAC,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,qBAAqB,CAAC,mBADc,EAEpC,WAAW,CAAC,mBAFwB,EAGpC,KAAK,CAAC,mBAAN,CAA0B,SAHU,CAAtC;AAKD;;AAED,SAAO,KAAP;AACD,CAhCM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourceRoot":""}
|
@@ -18,9 +18,9 @@ const useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
|
18
18
|
|
19
19
|
|
20
20
|
exports.ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
-
const state = useToggleButton_1.
|
22
|
-
useToggleButtonStyles_1.
|
23
|
-
return renderToggleButton_1.
|
21
|
+
const state = useToggleButton_1.useToggleButton_unstable(props, ref);
|
22
|
+
useToggleButtonStyles_1.useToggleButtonStyles_unstable(state);
|
23
|
+
return renderToggleButton_1.renderToggleButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
24
|
});
|
25
25
|
exports.ToggleButton.displayName = 'ToggleButton';
|
26
26
|
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/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,
|
1
|
+
{"version":3,"sources":["../../../src/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","sourceRoot":""}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ButtonProps, ButtonState } from '../Button/Button.types';
|
2
|
-
|
2
|
+
declare type ToggleButtonCommons = {
|
3
3
|
/**
|
4
4
|
* Defines the controlled checked state of the `ToggleButton`.
|
5
5
|
* If passed, `ToggleButton` ignores the `defaultChecked` property.
|
@@ -17,3 +17,4 @@ export declare type ToggleButtonProps = ButtonProps & Partial<ToggleButtonCommon
|
|
17
17
|
defaultChecked?: boolean;
|
18
18
|
};
|
19
19
|
export declare type ToggleButtonState = ButtonState & ToggleButtonCommons;
|
20
|
+
export {};
|
@@ -2,4 +2,4 @@ export * from './ToggleButton';
|
|
2
2
|
export * from './ToggleButton.types';
|
3
3
|
export * from './renderToggleButton';
|
4
4
|
export * from './useToggleButton';
|
5
|
-
export { toggleButtonClassName,
|
5
|
+
export { toggleButtonClassName, useToggleButtonStyles_unstable } from './useToggleButtonStyles';
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassName = void 0;
|
7
7
|
|
8
8
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
@@ -23,10 +23,10 @@ Object.defineProperty(exports, "toggleButtonClassName", {
|
|
23
23
|
return useToggleButtonStyles_1.toggleButtonClassName;
|
24
24
|
}
|
25
25
|
});
|
26
|
-
Object.defineProperty(exports, "
|
26
|
+
Object.defineProperty(exports, "useToggleButtonStyles_unstable", {
|
27
27
|
enumerable: true,
|
28
28
|
get: function () {
|
29
|
-
return useToggleButtonStyles_1.
|
29
|
+
return useToggleButtonStyles_1.useToggleButtonStyles_unstable;
|
30
30
|
}
|
31
31
|
});
|
32
32
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/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;;AAAS,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;AAAuB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,
|
1
|
+
{"version":3,"sources":["../../../src/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;;AAAS,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;AAAuB,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","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
export {
|
1
|
+
export { renderButton_unstable as renderToggleButton_unstable } from '../Button/renderButton';
|
@@ -3,14 +3,14 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderToggleButton_unstable = void 0;
|
7
7
|
|
8
8
|
var renderButton_1 = /*#__PURE__*/require("../Button/renderButton");
|
9
9
|
|
10
|
-
Object.defineProperty(exports, "
|
10
|
+
Object.defineProperty(exports, "renderToggleButton_unstable", {
|
11
11
|
enumerable: true,
|
12
12
|
get: function () {
|
13
|
-
return renderButton_1.
|
13
|
+
return renderButton_1.renderButton_unstable;
|
14
14
|
}
|
15
15
|
});
|
16
16
|
//# sourceMappingURL=renderToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,
|
1
|
+
{"version":3,"sources":["../../../src/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","sourceRoot":""}
|
@@ -6,4 +6,4 @@ import type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types'
|
|
6
6
|
* @param props - User provided props to the ToggleButton component.
|
7
7
|
* @param ref - User provided ref to be passed to the ToggleButton component.
|
8
8
|
*/
|
9
|
-
export declare const
|
9
|
+
export declare const useToggleButton_unstable: ({ checked, defaultChecked, ...props }: ToggleButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToggleButtonState;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useToggleButton_unstable = void 0;
|
7
7
|
|
8
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
@@ -18,12 +18,16 @@ const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
|
18
18
|
*/
|
19
19
|
|
20
20
|
|
21
|
-
const
|
21
|
+
const useToggleButton_unstable = ({
|
22
22
|
checked,
|
23
23
|
defaultChecked,
|
24
24
|
...props
|
25
25
|
}, ref) => {
|
26
|
-
const
|
26
|
+
const {
|
27
|
+
disabled,
|
28
|
+
disabledFocusable
|
29
|
+
} = props;
|
30
|
+
const buttonState = useButton_1.useButton_unstable(props, ref);
|
27
31
|
const {
|
28
32
|
role,
|
29
33
|
onClick
|
@@ -40,7 +44,7 @@ const useToggleButton = ({
|
|
40
44
|
checked: checkedValue,
|
41
45
|
// Slots definition
|
42
46
|
root: { ...buttonState.root,
|
43
|
-
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']:
|
47
|
+
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: !disabled && !disabledFocusable && checkedValue,
|
44
48
|
onClick: React.useCallback(ev => {
|
45
49
|
if (onClick) {
|
46
50
|
onClick(ev);
|
@@ -56,5 +60,5 @@ const useToggleButton = ({
|
|
56
60
|
};
|
57
61
|
};
|
58
62
|
|
59
|
-
exports.
|
63
|
+
exports.useToggleButton_unstable = useToggleButton_unstable;
|
60
64
|
//# sourceMappingURL=useToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;AAKG;;;AACI,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;AAKG;;;AACI,MAAM,wBAAwB,GAAG,CACtC;AAAE,EAAA,OAAF;AAAW,EAAA,cAAX;AAA2B,KAAG;AAA9B,CADsC,EAEtC,GAFsC,KAGjB;AACrB,QAAM;AAAE,IAAA,QAAF;AAAY,IAAA;AAAZ,MAAkC,KAAxC;AACA,QAAM,WAAW,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAApB;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAoB,WAAW,CAAC,IAAtC;AAEA,QAAM,CAAC,YAAD,EAAe,eAAf,IAAkC,iBAAA,CAAA,oBAAA,CAAqB;AAC3D,IAAA,KAAK,EAAE,OADoD;AAE3D,IAAA,YAAY,EAAE,cAF6C;AAG3D,IAAA,YAAY,EAAE;AAH6C,GAArB,CAAxC;AAMA,QAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;AAEA,SAAO,EACL;AACA,OAAG,WAFE;AAIL;AACA,IAAA,OAAO,EAAE,YALJ;AAOL;AACA,IAAA,IAAI,EAAE,EACJ,GAAG,WAAW,CAAC,IADX;AAEJ,OAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,GAAwD,CAAC,QAAD,IAAa,CAAC,iBAAd,IAAmC,YAFvF;AAGJ,MAAA,OAAO,EAAE,KAAK,CAAC,WAAN,CACP,EAAE,IAAG;AACH,YAAI,OAAJ,EAAa;AACX,UAAA,OAAO,CAAC,EAAD,CAAP;;AAEA,cAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;AACF;;AAED,QAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD,OAXM,EAYP,CAAC,YAAD,EAAe,eAAf,EAAgC,OAAhC,CAZO;AAHL;AARD,GAAP;AA2BD,CA3CM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourceRoot":""}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { ToggleButtonState } from './ToggleButton.types';
|
2
2
|
export declare const toggleButtonClassName = "fui-ToggleButton";
|
3
|
-
export declare const
|
3
|
+
export declare const useToggleButtonStyles_unstable: (state: ToggleButtonState) => ToggleButtonState;
|
@@ -3,17 +3,19 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useToggleButtonStyles_unstable = exports.toggleButtonClassName = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
11
|
|
10
12
|
const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
|
11
13
|
|
12
14
|
exports.toggleButtonClassName = 'fui-ToggleButton';
|
13
15
|
|
14
|
-
const useCheckedStyles = /*#__PURE__*/
|
16
|
+
const useCheckedStyles = /*#__PURE__*/react_1.__styles({
|
15
17
|
"base": {
|
16
|
-
"
|
18
|
+
"De3pzq": "f1nfm20t",
|
17
19
|
"g2u3we": "fj3muxo",
|
18
20
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
19
21
|
"B9xav0g": "f1aperda",
|
@@ -23,13 +25,13 @@ const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
23
25
|
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
24
26
|
"Bn0qgzm": "f1vxd6vx",
|
25
27
|
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
26
|
-
"
|
28
|
+
"Jwef8y": "f1knas48",
|
27
29
|
"Bgoe8wy": "fvcxoqz",
|
28
30
|
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
29
31
|
"oetu4i": "f1xlaoq0",
|
30
32
|
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
31
33
|
"Bi91k9c": "fax3udt",
|
32
|
-
"
|
34
|
+
"ecr2s2": "fb40n2d",
|
33
35
|
"B6oc9vd": "fvs00aa",
|
34
36
|
"ak43y8": ["f1assf6x", "f4ruux4"],
|
35
37
|
"wmxk5l": "fumykes",
|
@@ -37,24 +39,24 @@ const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
37
39
|
"lj723h": "f1r2dosr"
|
38
40
|
},
|
39
41
|
"outline": {
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
42
|
+
"De3pzq": "f1q9pm1r",
|
43
|
+
"Jwef8y": "fjxutwb",
|
44
|
+
"ecr2s2": "fophhak"
|
43
45
|
},
|
44
46
|
"primary": {
|
45
|
-
"
|
47
|
+
"De3pzq": "f8w4g0q",
|
46
48
|
"g2u3we": "f1p3nwhy",
|
47
49
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
48
50
|
"B9xav0g": "f1q5o8ev",
|
49
51
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
50
52
|
"sj55zd": "f1phragk",
|
51
|
-
"
|
53
|
+
"Jwef8y": "f15wkkf3",
|
52
54
|
"Bgoe8wy": "f1s2uweq",
|
53
55
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
54
56
|
"oetu4i": "f1ukrpxl",
|
55
57
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
56
58
|
"Bi91k9c": "f1rq72xc",
|
57
|
-
"
|
59
|
+
"ecr2s2": "fsp1bjw",
|
58
60
|
"B6oc9vd": "ff472gp",
|
59
61
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
60
62
|
"wmxk5l": "fggejwh",
|
@@ -62,19 +64,19 @@ const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
62
64
|
"lj723h": "f18otbis"
|
63
65
|
},
|
64
66
|
"subtle": {
|
65
|
-
"
|
67
|
+
"De3pzq": "fq5gl1p",
|
66
68
|
"g2u3we": "f1p3nwhy",
|
67
69
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
68
70
|
"B9xav0g": "f1q5o8ev",
|
69
71
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
70
72
|
"sj55zd": "f1qj7y59",
|
71
|
-
"
|
73
|
+
"Jwef8y": "f1t94bn6",
|
72
74
|
"Bgoe8wy": "f1s2uweq",
|
73
75
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
74
76
|
"oetu4i": "f1ukrpxl",
|
75
77
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
76
78
|
"Bi91k9c": "f139oj5f",
|
77
|
-
"
|
79
|
+
"ecr2s2": "f1wfn5kd",
|
78
80
|
"B6oc9vd": "ff472gp",
|
79
81
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
80
82
|
"wmxk5l": "fggejwh",
|
@@ -82,19 +84,19 @@ const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
82
84
|
"lj723h": "f19au66r"
|
83
85
|
},
|
84
86
|
"transparent": {
|
85
|
-
"
|
87
|
+
"De3pzq": "f1q9pm1r",
|
86
88
|
"g2u3we": "f1p3nwhy",
|
87
89
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
88
90
|
"B9xav0g": "f1q5o8ev",
|
89
91
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
90
92
|
"sj55zd": "f1qj7y59",
|
91
|
-
"
|
93
|
+
"Jwef8y": "fjxutwb",
|
92
94
|
"Bgoe8wy": "f1s2uweq",
|
93
95
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
94
96
|
"oetu4i": "f1ukrpxl",
|
95
97
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
96
98
|
"Bi91k9c": "f139oj5f",
|
97
|
-
"
|
99
|
+
"ecr2s2": "fophhak",
|
98
100
|
"B6oc9vd": "ff472gp",
|
99
101
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
100
102
|
"wmxk5l": "fggejwh",
|
@@ -102,26 +104,26 @@ const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
102
104
|
"lj723h": "f19au66r"
|
103
105
|
}
|
104
106
|
}, {
|
105
|
-
"d": [".
|
106
|
-
"h": [".
|
107
|
-
"a": [".
|
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);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".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);}"],
|
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);}", ".fax3udt:hover{color:var(--colorNeutralForeground1);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".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);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}"],
|
109
|
+
"a": [".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fumykes:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f1r2dosr:active{color:var(--colorNeutralForeground1);}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".fsp1bjw:active{background-color:var(--colorBrandBackgroundPressed);}", ".ff472gp:active{border-top-color:transparent;}", ".f4yyc7m:active{border-right-color:transparent;}", ".ft2aflc:active{border-left-color:transparent;}", ".fggejwh:active{border-bottom-color:transparent;}", ".f18otbis:active{color:var(--colorNeutralForegroundOnBrand);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}", ".f19au66r:active{color:var(--colorNeutralForeground2BrandPressed);}"]
|
108
110
|
});
|
109
111
|
|
110
|
-
const useDisabledStyles = /*#__PURE__*/
|
112
|
+
const useDisabledStyles = /*#__PURE__*/react_1.__styles({
|
111
113
|
"base": {
|
112
|
-
"
|
114
|
+
"De3pzq": "f1bg9a2p",
|
113
115
|
"g2u3we": "f1jj8ep1",
|
114
116
|
"h3c5rm": ["f15xbau", "fy0fskl"],
|
115
117
|
"B9xav0g": "f4ikngz",
|
116
118
|
"zhjwy3": ["fy0fskl", "f15xbau"],
|
117
119
|
"sj55zd": "f1s2aq7o",
|
118
|
-
"
|
120
|
+
"Jwef8y": "f1falr9n",
|
119
121
|
"Bgoe8wy": "f12mpcsy",
|
120
122
|
"Bwzppfd": ["f1gwvigk", "f18rmfxp"],
|
121
123
|
"oetu4i": "f1jnshp0",
|
122
124
|
"gg5e9n": ["f18rmfxp", "f1gwvigk"],
|
123
125
|
"Bi91k9c": "fvgxktp",
|
124
|
-
"
|
126
|
+
"ecr2s2": "f1ryyzvn",
|
125
127
|
"B6oc9vd": "fdi4vxw",
|
126
128
|
"ak43y8": ["f4ryxzl", "fkdgpbx"],
|
127
129
|
"wmxk5l": "fcmhn06",
|
@@ -144,46 +146,46 @@ const useDisabledStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
144
146
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
145
147
|
},
|
146
148
|
"subtle": {
|
147
|
-
"
|
149
|
+
"De3pzq": "f3rmtva",
|
148
150
|
"g2u3we": "f1p3nwhy",
|
149
151
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
150
152
|
"B9xav0g": "f1q5o8ev",
|
151
153
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
152
|
-
"
|
154
|
+
"Jwef8y": "f1cio4g9",
|
153
155
|
"Bgoe8wy": "f1s2uweq",
|
154
156
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
155
157
|
"oetu4i": "f1ukrpxl",
|
156
158
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
157
|
-
"
|
159
|
+
"ecr2s2": "f1rot6hk",
|
158
160
|
"B6oc9vd": "ff472gp",
|
159
161
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
160
162
|
"wmxk5l": "fggejwh",
|
161
163
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
162
164
|
},
|
163
165
|
"transparent": {
|
164
|
-
"
|
166
|
+
"De3pzq": "f3rmtva",
|
165
167
|
"g2u3we": "f1p3nwhy",
|
166
168
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
167
169
|
"B9xav0g": "f1q5o8ev",
|
168
170
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
169
|
-
"
|
171
|
+
"Jwef8y": "f1cio4g9",
|
170
172
|
"Bgoe8wy": "f1s2uweq",
|
171
173
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
172
174
|
"oetu4i": "f1ukrpxl",
|
173
175
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
174
|
-
"
|
176
|
+
"ecr2s2": "f1rot6hk",
|
175
177
|
"B6oc9vd": "ff472gp",
|
176
178
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
177
179
|
"wmxk5l": "fggejwh",
|
178
180
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
179
181
|
}
|
180
182
|
}, {
|
181
|
-
"d": [".
|
182
|
-
"h": [".
|
183
|
-
"a": [".
|
183
|
+
"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;}"]
|
184
186
|
});
|
185
187
|
|
186
|
-
const
|
188
|
+
const useToggleButtonStyles_unstable = state => {
|
187
189
|
const checkedStyles = useCheckedStyles();
|
188
190
|
const disabledStyles = useDisabledStyles();
|
189
191
|
const {
|
@@ -192,13 +194,13 @@ const useToggleButtonStyles = state => {
|
|
192
194
|
disabled,
|
193
195
|
disabledFocusable
|
194
196
|
} = state;
|
195
|
-
state.root.className =
|
197
|
+
state.root.className = react_1.mergeClasses(exports.toggleButtonClassName, // Checked styles
|
196
198
|
checked && checkedStyles.base, appearance && checked && checkedStyles[appearance], // Disabled styles
|
197
199
|
(disabled || disabledFocusable) && disabledStyles.base, appearance && (disabled || disabledFocusable) && disabledStyles[appearance], // User provided class name
|
198
200
|
state.root.className);
|
199
|
-
useButtonStyles_1.
|
201
|
+
useButtonStyles_1.useButtonStyles_unstable(state);
|
200
202
|
return state;
|
201
203
|
};
|
202
204
|
|
203
|
-
exports.
|
205
|
+
exports.useToggleButtonStyles_unstable = useToggleButtonStyles_unstable;
|
204
206
|
//# sourceMappingURL=useToggleButtonStyles.js.map
|