@fluentui/react-button 9.0.0-nightly.b5b7401007.0 → 9.0.0-rc.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +445 -33
- package/CHANGELOG.md +105 -19
- package/dist/react-button.d.ts +42 -34
- 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 +7 -7
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +6 -6
- package/lib/components/Button/Button.types.js.map +1 -1
- 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 +13 -9
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +1 -1
- package/lib/components/Button/useButton.js +22 -25
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +2 -9
- package/lib/components/Button/useButtonStyles.js +118 -90
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +7 -7
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +4 -4
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- 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 +15 -9
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.d.ts +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +9 -9
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +52 -48
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +7 -7
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.d.ts +3 -4
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- 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 +13 -9
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.d.ts +1 -1
- package/lib/components/MenuButton/useMenuButton.js +11 -11
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +8 -6
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +7 -7
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.d.ts +6 -4
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
- 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 +9 -7
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.d.ts +1 -1
- package/lib/components/SplitButton/useSplitButton.js +57 -49
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +38 -34
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +7 -7
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +2 -1
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -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 +33 -31
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +47 -43
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Button.js +1 -1
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +1 -1
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +1 -1
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +1 -1
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +1 -1
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +8 -8
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +6 -6
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.d.ts +2 -2
- package/lib-commonjs/components/Button/index.js +10 -6
- 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 +17 -14
- 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 +26 -29
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +2 -9
- package/lib-commonjs/components/Button/useButtonStyles.js +121 -92
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
- 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/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +10 -4
- 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 +19 -14
- 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 +12 -13
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +58 -53
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +8 -8
- 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/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/index.js +10 -4
- 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 +17 -14
- 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 +15 -16
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +12 -9
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +8 -8
- 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/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/index.js +10 -4
- 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 +13 -12
- 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 +61 -54
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +44 -39
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
- 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/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +10 -4
- 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 +37 -36
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +51 -45
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/index.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
@@ -1,7 +1,6 @@
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
2
1
|
import { useControllableState } from '@fluentui/react-utilities';
|
3
2
|
import * as React from 'react';
|
4
|
-
import {
|
3
|
+
import { useButton_unstable } from '../Button/useButton';
|
5
4
|
/**
|
6
5
|
* Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
|
7
6
|
* processed state.
|
@@ -9,42 +8,45 @@ import { useButton } from '../Button/useButton';
|
|
9
8
|
* @param ref - User provided ref to be passed to the ToggleButton component.
|
10
9
|
*/
|
11
10
|
|
12
|
-
export
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
export const useToggleButton_unstable = ({
|
12
|
+
checked,
|
13
|
+
defaultChecked,
|
14
|
+
...props
|
15
|
+
}, ref) => {
|
16
|
+
const {
|
17
|
+
disabled,
|
18
|
+
disabledFocusable
|
19
|
+
} = props;
|
20
|
+
const buttonState = useButton_unstable(props, ref);
|
21
|
+
const {
|
22
|
+
role,
|
23
|
+
onClick
|
24
|
+
} = buttonState.root;
|
25
|
+
const [checkedValue, setCheckedValue] = useControllableState({
|
25
26
|
state: checked,
|
26
27
|
defaultState: defaultChecked,
|
27
28
|
initialState: false
|
28
|
-
})
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
var isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
33
|
-
return __assign(__assign({}, buttonState), {
|
29
|
+
});
|
30
|
+
const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
31
|
+
return { // Button state
|
32
|
+
...buttonState,
|
34
33
|
// State calculated from a set of props
|
35
34
|
checked: checkedValue,
|
36
35
|
// Slots definition
|
37
|
-
root:
|
38
|
-
|
39
|
-
|
36
|
+
root: { ...buttonState.root,
|
37
|
+
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,
|
38
|
+
onClick: React.useCallback(ev => {
|
39
|
+
if (!disabled && !disabledFocusable) {
|
40
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
42
|
+
if (ev.defaultPrevented) {
|
43
|
+
return;
|
44
|
+
}
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
setCheckedValue(!checkedValue);
|
47
|
+
}
|
48
|
+
}, [checkedValue, disabled, disabledFocusable, setCheckedValue, onClick])
|
49
|
+
}
|
50
|
+
};
|
49
51
|
};
|
50
52
|
//# sourceMappingURL=useToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":"AAAA,SAAS,oBAAT,QAAqC,2BAArC;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,qBAAnC;AAGA;;;;;AAKG;;AACH,OAAO,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,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAAtC;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAoB,WAAW,CAAC,IAAtC;AAEA,QAAM,CAAC,YAAD,EAAe,eAAf,IAAkC,oBAAoB,CAAC;AAC3D,IAAA,KAAK,EAAE,OADoD;AAE3D,IAAA,YAAY,EAAE,cAF6C;AAG3D,IAAA,YAAY,EAAE;AAH6C,GAAD,CAA5D;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,YAFpD;AAGJ,MAAA,OAAO,EAAE,KAAK,CAAC,WAAN,CACP,EAAE,IAAG;AACH,YAAI,CAAC,QAAD,IAAa,CAAC,iBAAlB,EAAqC;AACnC,UAAA,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAG,EAAH,CAAP;;AAEA,cAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;;AAED,UAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD;AACF,OAXM,EAYP,CAAC,YAAD,EAAe,QAAf,EAAyB,iBAAzB,EAA4C,eAA5C,EAA6D,OAA7D,CAZO;AAHL;AARD,GAAP;AA2BD,CA3CM","sourcesContent":["import { useControllableState } from '@fluentui/react-utilities';\nimport * as React from 'react';\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 { checked, defaultChecked, ...props }: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const { disabled, disabledFocusable } = props;\n const buttonState = useButton_unstable(props, ref);\n const { role, onClick } = buttonState.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n return {\n // Button state\n ...buttonState,\n\n // State calculated from a set of props\n checked: checkedValue,\n\n // Slots definition\n root: {\n ...buttonState.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: React.useCallback(\n ev => {\n if (!disabled && !disabledFocusable) {\n onClick?.(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue, onClick],\n ),\n },\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,2 +1,3 @@
|
|
1
1
|
import type { ToggleButtonState } from './ToggleButton.types';
|
2
|
-
export declare const
|
2
|
+
export declare const toggleButtonClassName = "fui-ToggleButton";
|
3
|
+
export declare const useToggleButtonStyles_unstable: (state: ToggleButtonState) => ToggleButtonState;
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import { mergeClasses, __styles } from '@
|
2
|
-
import {
|
1
|
+
import { shorthands, mergeClasses, __styles } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
3
|
+
import { useButtonStyles_unstable } from '../Button/useButtonStyles';
|
4
|
+
export const toggleButtonClassName = 'fui-ToggleButton';
|
3
5
|
|
4
|
-
|
6
|
+
const useCheckedStyles = /*#__PURE__*/__styles({
|
5
7
|
"base": {
|
6
|
-
"
|
8
|
+
"De3pzq": "f1nfm20t",
|
7
9
|
"g2u3we": "fj3muxo",
|
8
10
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
9
11
|
"B9xav0g": "f1aperda",
|
@@ -13,13 +15,13 @@ var useCheckedStyles = /*#__PURE__*/__styles({
|
|
13
15
|
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
14
16
|
"Bn0qgzm": "f1vxd6vx",
|
15
17
|
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
16
|
-
"
|
18
|
+
"Jwef8y": "f1knas48",
|
17
19
|
"Bgoe8wy": "fvcxoqz",
|
18
20
|
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
19
21
|
"oetu4i": "f1xlaoq0",
|
20
22
|
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
21
23
|
"Bi91k9c": "fax3udt",
|
22
|
-
"
|
24
|
+
"ecr2s2": "fb40n2d",
|
23
25
|
"B6oc9vd": "fvs00aa",
|
24
26
|
"ak43y8": ["f1assf6x", "f4ruux4"],
|
25
27
|
"wmxk5l": "fumykes",
|
@@ -27,24 +29,24 @@ var useCheckedStyles = /*#__PURE__*/__styles({
|
|
27
29
|
"lj723h": "f1r2dosr"
|
28
30
|
},
|
29
31
|
"outline": {
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"
|
32
|
+
"De3pzq": "f1q9pm1r",
|
33
|
+
"Jwef8y": "fjxutwb",
|
34
|
+
"ecr2s2": "fophhak"
|
33
35
|
},
|
34
36
|
"primary": {
|
35
|
-
"
|
37
|
+
"De3pzq": "f8w4g0q",
|
36
38
|
"g2u3we": "f1p3nwhy",
|
37
39
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
38
40
|
"B9xav0g": "f1q5o8ev",
|
39
41
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
40
42
|
"sj55zd": "f1phragk",
|
41
|
-
"
|
43
|
+
"Jwef8y": "f15wkkf3",
|
42
44
|
"Bgoe8wy": "f1s2uweq",
|
43
45
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
44
46
|
"oetu4i": "f1ukrpxl",
|
45
47
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
46
48
|
"Bi91k9c": "f1rq72xc",
|
47
|
-
"
|
49
|
+
"ecr2s2": "fsp1bjw",
|
48
50
|
"B6oc9vd": "ff472gp",
|
49
51
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
50
52
|
"wmxk5l": "fggejwh",
|
@@ -52,19 +54,19 @@ var useCheckedStyles = /*#__PURE__*/__styles({
|
|
52
54
|
"lj723h": "f18otbis"
|
53
55
|
},
|
54
56
|
"subtle": {
|
55
|
-
"
|
57
|
+
"De3pzq": "fq5gl1p",
|
56
58
|
"g2u3we": "f1p3nwhy",
|
57
59
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
58
60
|
"B9xav0g": "f1q5o8ev",
|
59
61
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
60
62
|
"sj55zd": "f1qj7y59",
|
61
|
-
"
|
63
|
+
"Jwef8y": "f1t94bn6",
|
62
64
|
"Bgoe8wy": "f1s2uweq",
|
63
65
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
64
66
|
"oetu4i": "f1ukrpxl",
|
65
67
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
66
68
|
"Bi91k9c": "f139oj5f",
|
67
|
-
"
|
69
|
+
"ecr2s2": "f1wfn5kd",
|
68
70
|
"B6oc9vd": "ff472gp",
|
69
71
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
70
72
|
"wmxk5l": "fggejwh",
|
@@ -72,19 +74,19 @@ var useCheckedStyles = /*#__PURE__*/__styles({
|
|
72
74
|
"lj723h": "f19au66r"
|
73
75
|
},
|
74
76
|
"transparent": {
|
75
|
-
"
|
77
|
+
"De3pzq": "f1q9pm1r",
|
76
78
|
"g2u3we": "f1p3nwhy",
|
77
79
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
78
80
|
"B9xav0g": "f1q5o8ev",
|
79
81
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
80
82
|
"sj55zd": "f1qj7y59",
|
81
|
-
"
|
83
|
+
"Jwef8y": "fjxutwb",
|
82
84
|
"Bgoe8wy": "f1s2uweq",
|
83
85
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
84
86
|
"oetu4i": "f1ukrpxl",
|
85
87
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
86
88
|
"Bi91k9c": "f139oj5f",
|
87
|
-
"
|
89
|
+
"ecr2s2": "fophhak",
|
88
90
|
"B6oc9vd": "ff472gp",
|
89
91
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
90
92
|
"wmxk5l": "fggejwh",
|
@@ -92,26 +94,26 @@ var useCheckedStyles = /*#__PURE__*/__styles({
|
|
92
94
|
"lj723h": "f19au66r"
|
93
95
|
}
|
94
96
|
}, {
|
95
|
-
"d": [".
|
96
|
-
"h": [".
|
97
|
-
"a": [".
|
97
|
+
"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);}"],
|
98
|
+
"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);}"],
|
99
|
+
"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);}"]
|
98
100
|
});
|
99
101
|
|
100
|
-
|
102
|
+
const useDisabledStyles = /*#__PURE__*/__styles({
|
101
103
|
"base": {
|
102
|
-
"
|
104
|
+
"De3pzq": "f1bg9a2p",
|
103
105
|
"g2u3we": "f1jj8ep1",
|
104
106
|
"h3c5rm": ["f15xbau", "fy0fskl"],
|
105
107
|
"B9xav0g": "f4ikngz",
|
106
108
|
"zhjwy3": ["fy0fskl", "f15xbau"],
|
107
109
|
"sj55zd": "f1s2aq7o",
|
108
|
-
"
|
110
|
+
"Jwef8y": "f1falr9n",
|
109
111
|
"Bgoe8wy": "f12mpcsy",
|
110
112
|
"Bwzppfd": ["f1gwvigk", "f18rmfxp"],
|
111
113
|
"oetu4i": "f1jnshp0",
|
112
114
|
"gg5e9n": ["f18rmfxp", "f1gwvigk"],
|
113
115
|
"Bi91k9c": "fvgxktp",
|
114
|
-
"
|
116
|
+
"ecr2s2": "f1ryyzvn",
|
115
117
|
"B6oc9vd": "fdi4vxw",
|
116
118
|
"ak43y8": ["f4ryxzl", "fkdgpbx"],
|
117
119
|
"wmxk5l": "fcmhn06",
|
@@ -134,57 +136,59 @@ var useDisabledStyles = /*#__PURE__*/__styles({
|
|
134
136
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
135
137
|
},
|
136
138
|
"subtle": {
|
137
|
-
"
|
139
|
+
"De3pzq": "f3rmtva",
|
138
140
|
"g2u3we": "f1p3nwhy",
|
139
141
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
140
142
|
"B9xav0g": "f1q5o8ev",
|
141
143
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
142
|
-
"
|
144
|
+
"Jwef8y": "f1cio4g9",
|
143
145
|
"Bgoe8wy": "f1s2uweq",
|
144
146
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
145
147
|
"oetu4i": "f1ukrpxl",
|
146
148
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
147
|
-
"
|
149
|
+
"ecr2s2": "f1rot6hk",
|
148
150
|
"B6oc9vd": "ff472gp",
|
149
151
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
150
152
|
"wmxk5l": "fggejwh",
|
151
153
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
152
154
|
},
|
153
155
|
"transparent": {
|
154
|
-
"
|
156
|
+
"De3pzq": "f3rmtva",
|
155
157
|
"g2u3we": "f1p3nwhy",
|
156
158
|
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
157
159
|
"B9xav0g": "f1q5o8ev",
|
158
160
|
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
159
|
-
"
|
161
|
+
"Jwef8y": "f1cio4g9",
|
160
162
|
"Bgoe8wy": "f1s2uweq",
|
161
163
|
"Bwzppfd": ["fr80ssc", "fecsdlb"],
|
162
164
|
"oetu4i": "f1ukrpxl",
|
163
165
|
"gg5e9n": ["fecsdlb", "fr80ssc"],
|
164
|
-
"
|
166
|
+
"ecr2s2": "f1rot6hk",
|
165
167
|
"B6oc9vd": "ff472gp",
|
166
168
|
"ak43y8": ["f4yyc7m", "ft2aflc"],
|
167
169
|
"wmxk5l": "fggejwh",
|
168
170
|
"B50zh58": ["ft2aflc", "f4yyc7m"]
|
169
171
|
}
|
170
172
|
}, {
|
171
|
-
"d": [".
|
172
|
-
"h": [".
|
173
|
-
"a": [".
|
173
|
+
"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;}"],
|
174
|
+
"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;}"],
|
175
|
+
"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;}"]
|
174
176
|
});
|
175
177
|
|
176
|
-
export
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
178
|
+
export const useToggleButtonStyles_unstable = state => {
|
179
|
+
const checkedStyles = useCheckedStyles();
|
180
|
+
const disabledStyles = useDisabledStyles();
|
181
|
+
const {
|
182
|
+
appearance,
|
183
|
+
checked,
|
184
|
+
disabled,
|
185
|
+
disabledFocusable
|
186
|
+
} = state;
|
187
|
+
state.root.className = mergeClasses(toggleButtonClassName, // Checked styles
|
184
188
|
checked && checkedStyles.base, appearance && checked && checkedStyles[appearance], // Disabled styles
|
185
189
|
(disabled || disabledFocusable) && disabledStyles.base, appearance && (disabled || disabledFocusable) && disabledStyles[appearance], // User provided class name
|
186
190
|
state.root.className);
|
187
|
-
|
191
|
+
useButtonStyles_unstable(state);
|
188
192
|
return state;
|
189
193
|
};
|
190
194
|
//# sourceMappingURL=useToggleButtonStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,wBAAT,QAAyC,2BAAzC;AAGA,OAAO,MAAM,qBAAqB,GAAG,kBAA9B;;AAEP,MAAM,gBAAgB,gBAAG;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,EAAzB;;AAuFA,MAAM,iBAAiB,gBAAG;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,EAA1B;;AAiEA,OAAO,MAAM,8BAA8B,GAAI,KAAD,IAAgD;AAC5F,QAAM,aAAa,GAAG,gBAAgB,EAAtC;AACA,QAAM,cAAc,GAAG,iBAAiB,EAAxC;AAEA,QAAM;AAAE,IAAA,UAAF;AAAc,IAAA,OAAd;AAAuB,IAAA,QAAvB;AAAiC,IAAA;AAAjC,MAAuD,KAA7D;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,qBADiC,EAGjC;AACA,EAAA,OAAO,IAAI,aAAa,CAAC,IAJQ,EAKjC,UAAU,IAAI,OAAd,IAAyB,aAAa,CAAC,UAAD,CALL,EAOjC;AACA,GAAC,QAAQ,IAAI,iBAAb,KAAmC,cAAc,CAAC,IARjB,EASjC,UAAU,KAAK,QAAQ,IAAI,iBAAjB,CAAV,IAAiD,cAAc,CAAC,UAAD,CAT9B,EAWjC;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAZsB,CAAnC;AAeA,EAAA,wBAAwB,CAAC,KAAD,CAAxB;AAEA,SAAO,KAAP;AACD,CAxBM","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nexport const toggleButtonClassName = 'fui-ToggleButton';\n\nconst useCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1,\n\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1,\n },\n\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1,\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':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 ':active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\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 ':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 ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\nconst 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 ':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 ':active': {\n ...shorthands.borderColor('transparent'),\n },\n },\n subtle: {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n\n ':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 ':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 toggleButtonClassName,\n\n // Checked styles\n checked && checkedStyles.base,\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 useButtonStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './SplitButton';\nexport * from './ToggleButton';\n"]}
|
package/lib-commonjs/Button.js
CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/Button/index"), exports);
|
10
10
|
//# sourceMappingURL=Button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["Button.tsx"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Button/index';\n"],"sourceRoot":"../src/"}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/CompoundButton/index"), exports);
|
10
10
|
//# sourceMappingURL=CompoundButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["CompoundButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/CompoundButton/index';\n"],"sourceRoot":"../src/"}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuButton/index"), exports);
|
10
10
|
//# sourceMappingURL=MenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["MenuButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,+BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/MenuButton/index';\n"],"sourceRoot":"../src/"}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/SplitButton/index"), exports);
|
10
10
|
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["SplitButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/SplitButton/index';\n"],"sourceRoot":"../src/"}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/ToggleButton/index"), exports);
|
10
10
|
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["ToggleButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/ToggleButton/index';\n"],"sourceRoot":"../src/"}
|
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.Button = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const renderButton_1 = /*#__PURE__*/require("./renderButton");
|
11
11
|
|
12
|
-
|
12
|
+
const useButton_1 = /*#__PURE__*/require("./useButton");
|
13
13
|
|
14
|
-
|
14
|
+
const useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
|
15
15
|
/**
|
16
16
|
* Buttons give people a way to trigger an action.
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
exports.Button = /*#__PURE__*/React.forwardRef(
|
21
|
-
|
22
|
-
useButtonStyles_1.
|
23
|
-
return renderButton_1.
|
20
|
+
exports.Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
+
const state = useButton_1.useButton_unstable(props, ref);
|
22
|
+
useButtonStyles_1.useButtonStyles_unstable(state);
|
23
|
+
return renderButton_1.renderButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
24
|
});
|
25
25
|
exports.Button.displayName = 'Button';
|
26
26
|
//# sourceMappingURL=Button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,MAAA,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAAd;AAEA,EAAA,iBAAA,CAAA,wBAAA,CAAyB,KAAzB;AAEA,SAAO,cAAA,CAAA,qBAAA,CAAsB,KAAtB,CAAP,CALsF,CAMtF;AACD,CAPuD,CAA3C;AASb,OAAA,CAAA,MAAA,CAAO,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"sourceRoot":"../src/"}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
import type { ComponentProps, ComponentState,
|
1
|
+
import type { ARIAButtonSlotProps } from '@fluentui/react-aria';
|
2
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
3
3
|
export declare type ButtonSlots = {
|
4
4
|
/**
|
5
|
-
* Root of the component that renders as either a
|
5
|
+
* Root of the component that renders as either a `<button>` tag or an `<a>` tag.
|
6
6
|
*/
|
7
|
-
root:
|
7
|
+
root: Slot<ARIAButtonSlotProps>;
|
8
8
|
/**
|
9
9
|
* Icon that renders either before or after the `children` as specified by the `iconPosition` prop.
|
10
10
|
*/
|
11
|
-
icon?:
|
11
|
+
icon?: Slot<'span'>;
|
12
12
|
};
|
13
13
|
export declare type ButtonCommons = {
|
14
14
|
/**
|
@@ -40,7 +40,7 @@ export declare type ButtonCommons = {
|
|
40
40
|
* A button can format its icon to appear before or after its content.
|
41
41
|
* @default 'before'
|
42
42
|
*/
|
43
|
-
iconPosition
|
43
|
+
iconPosition?: 'before' | 'after';
|
44
44
|
/**
|
45
45
|
* A button can be rounded, circular, or square.
|
46
46
|
* @default 'rounded'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export * from './Button';
|
2
|
-
export
|
2
|
+
export type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';
|
3
3
|
export * from './renderButton';
|
4
4
|
export * from './useButton';
|
5
|
-
export {
|
5
|
+
export { buttonClassName, useButtonStyles_unstable } from './useButtonStyles';
|
@@ -3,24 +3,28 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useButtonStyles_unstable = exports.buttonClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
10
10
|
tslib_1.__exportStar(require("./Button"), exports);
|
11
11
|
|
12
|
-
tslib_1.__exportStar(require("./Button.types"), exports);
|
13
|
-
|
14
12
|
tslib_1.__exportStar(require("./renderButton"), exports);
|
15
13
|
|
16
14
|
tslib_1.__exportStar(require("./useButton"), exports);
|
17
15
|
|
18
16
|
var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
|
19
17
|
|
20
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "buttonClassName", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () {
|
21
|
+
return useButtonStyles_1.buttonClassName;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "useButtonStyles_unstable", {
|
21
25
|
enumerable: true,
|
22
26
|
get: function () {
|
23
|
-
return useButtonStyles_1.
|
27
|
+
return useButtonStyles_1.useButtonStyles_unstable;
|
24
28
|
}
|
25
29
|
});
|
26
30
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Button/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AAGA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA","sourcesContent":["export * from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassName, useButtonStyles_unstable } from './useButtonStyles';\n"],"sourceRoot":"../src/"}
|
@@ -2,4 +2,4 @@ import type { ButtonState } from './Button.types';
|
|
2
2
|
/**
|
3
3
|
* Renders a Button component by passing the state defined props to the appropriate slots.
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderButton_unstable: (state: ButtonState) => JSX.Element;
|