@fluentui/react-button 9.0.0-beta.1 → 9.0.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +275 -1
- package/CHANGELOG.md +67 -2
- package/dist/react-button.d.ts +15 -2
- package/lib/common/isConformant.js +1 -1
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +1 -1
- package/lib/components/Button/index.d.ts +1 -1
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.js +10 -9
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +20 -24
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +1 -0
- package/lib/components/Button/useButtonStyles.js +27 -24
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +2 -2
- package/lib/components/CompoundButton/CompoundButton.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.js +10 -9
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +8 -8
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +40 -37
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +2 -2
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.d.ts +5 -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.js +10 -9
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +8 -8
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +1 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js +5 -3
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +2 -2
- package/lib/components/SplitButton/SplitButton.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.js +6 -7
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +41 -45
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js +36 -33
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +2 -2
- package/lib/components/ToggleButton/ToggleButton.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/useToggleButton.js +27 -29
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js +13 -10
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/Button.js +1 -1
- package/lib-commonjs/CompoundButton.js +1 -1
- package/lib-commonjs/MenuButton.js +1 -1
- package/lib-commonjs/SplitButton.js +1 -1
- package/lib-commonjs/ToggleButton.js +1 -1
- package/lib-commonjs/common/isConformant.js +3 -3
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +6 -6
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +1 -1
- package/lib-commonjs/components/Button/index.d.ts +1 -1
- package/lib-commonjs/components/Button/index.js +8 -2
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +12 -12
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +22 -26
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +1 -0
- package/lib-commonjs/components/Button/useButtonStyles.js +29 -26
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +6 -6
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +8 -2
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +12 -12
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +10 -11
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +43 -40
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +6 -6
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +5 -1
- package/lib-commonjs/components/MenuButton/index.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/index.js +8 -2
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +12 -12
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +12 -13
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +9 -6
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +6 -6
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/index.js +8 -2
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +8 -10
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +44 -49
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +39 -36
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +6 -6
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +8 -2
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +31 -34
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +17 -13
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +9 -11
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useSplitButton = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
10
|
-
|
10
|
+
const Button_1 = /*#__PURE__*/require("../Button/Button");
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
var MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
|
12
|
+
const MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
|
15
13
|
/**
|
16
14
|
* Given user props, defines default props for the SplitButton and returns processed state.
|
17
15
|
* @param props - User provided props to the SplitButton component.
|
@@ -19,64 +17,61 @@ var MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
|
|
19
17
|
*/
|
20
18
|
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
shape = _e === void 0 ? 'rounded' : _e,
|
38
|
-
_f = props.size,
|
39
|
-
size = _f === void 0 ? 'medium' : _f;
|
40
|
-
var menuButtonShorthand = react_utilities_1.resolveShorthand(menuButton, {
|
20
|
+
const useSplitButton = (props, ref) => {
|
21
|
+
const {
|
22
|
+
appearance,
|
23
|
+
block = false,
|
24
|
+
children,
|
25
|
+
disabled = false,
|
26
|
+
disabledFocusable = false,
|
27
|
+
icon,
|
28
|
+
iconPosition = 'before',
|
29
|
+
menuButton,
|
30
|
+
primaryActionButton,
|
31
|
+
shape = 'rounded',
|
32
|
+
size = 'medium'
|
33
|
+
} = props;
|
34
|
+
const menuButtonShorthand = react_utilities_1.resolveShorthand(menuButton, {
|
41
35
|
defaultProps: {
|
42
|
-
appearance
|
43
|
-
disabled
|
44
|
-
disabledFocusable
|
45
|
-
shape
|
46
|
-
size
|
36
|
+
appearance,
|
37
|
+
disabled,
|
38
|
+
disabledFocusable,
|
39
|
+
shape,
|
40
|
+
size
|
47
41
|
}
|
48
42
|
});
|
49
|
-
|
43
|
+
const primaryActionButtonShorthand = react_utilities_1.resolveShorthand(primaryActionButton, {
|
50
44
|
defaultProps: {
|
51
|
-
appearance
|
52
|
-
block
|
53
|
-
children
|
54
|
-
disabled
|
55
|
-
disabledFocusable
|
56
|
-
icon
|
57
|
-
iconPosition
|
58
|
-
shape
|
59
|
-
size
|
45
|
+
appearance,
|
46
|
+
block,
|
47
|
+
children,
|
48
|
+
disabled,
|
49
|
+
disabledFocusable,
|
50
|
+
icon,
|
51
|
+
iconPosition,
|
52
|
+
shape,
|
53
|
+
size
|
60
54
|
}
|
61
55
|
});
|
62
56
|
return {
|
63
57
|
// Props passed at the top-level
|
64
|
-
appearance
|
65
|
-
block
|
66
|
-
disabled
|
67
|
-
disabledFocusable
|
68
|
-
iconPosition
|
69
|
-
shape
|
70
|
-
size
|
58
|
+
appearance,
|
59
|
+
block,
|
60
|
+
disabled,
|
61
|
+
disabledFocusable,
|
62
|
+
iconPosition,
|
63
|
+
shape,
|
64
|
+
size,
|
71
65
|
// Slots definition
|
72
66
|
components: {
|
73
67
|
root: 'div',
|
74
68
|
menuButton: MenuButton_1.MenuButton,
|
75
69
|
primaryActionButton: Button_1.Button
|
76
70
|
},
|
77
|
-
root: react_utilities_1.getNativeElementProps('div',
|
78
|
-
ref
|
79
|
-
|
71
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
72
|
+
ref,
|
73
|
+
...props
|
74
|
+
}),
|
80
75
|
menuButton: menuButtonShorthand,
|
81
76
|
primaryActionButton: primaryActionButtonShorthand
|
82
77
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAA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AGV,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,CA7DM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
|
@@ -3,18 +3,19 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useSplitButtonStyles = void 0;
|
6
|
+
exports.useSplitButtonStyles = exports.splitButtonClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
9
|
|
10
|
-
|
10
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
exports.splitButtonClassName = 'fui-SplitButton';
|
13
|
+
const SplitButtonClassNames = {
|
14
|
+
primaryActionButton: `${exports.splitButtonClassName}-primaryActionButton`,
|
15
|
+
menuButton: `${exports.splitButtonClassName}-menuButton`
|
15
16
|
};
|
16
17
|
|
17
|
-
|
18
|
+
const useFocusStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
18
19
|
"primaryActionButton": {
|
19
20
|
"B486eqv": "f2hkw1w",
|
20
21
|
"Bmrpcm6": ["fub8a6s", "f1g41uvt"],
|
@@ -31,59 +32,61 @@ var useFocusStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
31
32
|
"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;}"]
|
32
33
|
});
|
33
34
|
|
34
|
-
|
35
|
+
const useRootStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
35
36
|
"base": {
|
36
37
|
"mc9l5x": "ftuwxu6",
|
37
38
|
"Brf1p80": "fsxf2b5",
|
38
39
|
"qhf8xq": "f10pi13n",
|
39
40
|
"ha4doy": "fmrv4ls",
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
41
|
+
"mfjwoh": ["fwj9yvy", "f1lzjiju"],
|
42
|
+
"ibxugx": ["f1a35zaw", "f1l6wyf7"],
|
43
|
+
"Bqvcgfq": ["f104opbk", "f147sopj"],
|
44
|
+
"Baxitl6": ["fxs6g7p", "f1moly3t"],
|
45
|
+
"zkjfwm": ["f1m1y7kk", "ff82swa"]
|
45
46
|
},
|
46
47
|
"block": {
|
47
48
|
"a9b677": "fly5x3f"
|
48
49
|
},
|
49
50
|
"outline": {},
|
50
51
|
"primary": {
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
52
|
+
"Bt6mj9": ["fptrtw7", "f51449u"],
|
53
|
+
"xhdd7j": ["f1n4yg8a", "fbebbjo"],
|
54
|
+
"Jxu9b0": ["fnmoi2n", "f1l3povx"]
|
54
55
|
},
|
55
56
|
"subtle": {
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
57
|
+
"Bt6mj9": ["fh2ci0", "f1us00qf"],
|
58
|
+
"xhdd7j": ["fj8butq", "fkv8iz"],
|
59
|
+
"Jxu9b0": ["fjmcta", "fm99moz"]
|
59
60
|
},
|
60
61
|
"transparent": {
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
62
|
+
"Bt6mj9": ["fh2ci0", "f1us00qf"],
|
63
|
+
"xhdd7j": ["fj8butq", "fkv8iz"],
|
64
|
+
"Jxu9b0": ["fjmcta", "fm99moz"]
|
64
65
|
},
|
65
66
|
"circular": {},
|
66
67
|
"rounded": {},
|
67
68
|
"square": {},
|
68
69
|
"disabled": {
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
70
|
+
"Bt6mj9": ["f1gu8nb8", "f7r8m4m"],
|
71
|
+
"xhdd7j": ["f3cl9o2", "f12vilfs"],
|
72
|
+
"Jxu9b0": ["f1lpnjjp", "f8nirj0"]
|
72
73
|
}
|
73
74
|
}, {
|
74
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".
|
75
|
-
"h": [".
|
76
|
-
"a": [".
|
75
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".fwj9yvy .fui-SplitButton-primaryActionButton{border-top-right-radius:0;}", ".f1lzjiju .fui-SplitButton-primaryActionButton{border-top-left-radius:0;}", ".f1a35zaw .fui-SplitButton-primaryActionButton{border-bottom-right-radius:0;}", ".f1l6wyf7 .fui-SplitButton-primaryActionButton{border-bottom-left-radius:0;}", ".f104opbk .fui-SplitButton-menuButton{border-left-width:0;}", ".f147sopj .fui-SplitButton-menuButton{border-right-width:0;}", ".fxs6g7p .fui-SplitButton-menuButton{border-top-left-radius:0;}", ".f1moly3t .fui-SplitButton-menuButton{border-top-right-radius:0;}", ".f1m1y7kk .fui-SplitButton-menuButton{border-bottom-left-radius:0;}", ".ff82swa .fui-SplitButton-menuButton{border-bottom-right-radius:0;}", ".fly5x3f{width:100%;}", ".fptrtw7 .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f51449u .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fh2ci0 .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1us00qf .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1gu8nb8 .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f7r8m4m .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
76
|
+
"h": [".f1n4yg8a:hover .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fbebbjo:hover .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fj8butq:hover .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fkv8iz:hover .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f3cl9o2:hover .fui-SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f12vilfs:hover .fui-SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
77
|
+
"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);}"]
|
77
78
|
});
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
80
|
+
const useSplitButtonStyles = state => {
|
81
|
+
const rootStyles = useRootStyles();
|
82
|
+
const focusStyles = useFocusStyles();
|
83
|
+
const {
|
84
|
+
appearance,
|
85
|
+
block,
|
86
|
+
disabled,
|
87
|
+
disabledFocusable
|
88
|
+
} = state;
|
89
|
+
state.root.className = react_make_styles_1.mergeClasses(exports.splitButtonClassName, rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
|
87
90
|
|
88
91
|
if (state.menuButton) {
|
89
92
|
state.menuButton.className = react_make_styles_1.mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,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,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAvB;;AAaA,MAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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
5
5
|
});
|
6
6
|
exports.ToggleButton = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const renderToggleButton_1 = /*#__PURE__*/require("./renderToggleButton");
|
11
11
|
|
12
|
-
|
12
|
+
const useToggleButton_1 = /*#__PURE__*/require("./useToggleButton");
|
13
13
|
|
14
|
-
|
14
|
+
const useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
15
15
|
/**
|
16
16
|
* ToggleButtons are buttons that toggle between two defined states when triggered.
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
exports.ToggleButton = /*#__PURE__*/React.forwardRef(
|
21
|
-
|
20
|
+
exports.ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
+
const state = useToggleButton_1.useToggleButton(props, ref);
|
22
22
|
useToggleButtonStyles_1.useToggleButtonStyles(state);
|
23
23
|
return renderToggleButton_1.renderToggleButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
24
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,
|
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,eAAA,CAAgB,KAAhB,EAAuB,GAAvB,CAAd;AAEA,EAAA,uBAAA,CAAA,qBAAA,CAAsB,KAAtB;AAEA,SAAO,oBAAA,CAAA,kBAAA,CAAmB,KAAnB,CAAP,CALkG,CAMlG;AACD,CAPmE,CAAvD;AASb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","sourceRoot":""}
|
@@ -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 { useToggleButtonStyles } from './useToggleButtonStyles';
|
5
|
+
export { toggleButtonClassName, useToggleButtonStyles } from './useToggleButtonStyles';
|
@@ -3,9 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useToggleButtonStyles = void 0;
|
6
|
+
exports.useToggleButtonStyles = exports.toggleButtonClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
10
10
|
tslib_1.__exportStar(require("./ToggleButton"), exports);
|
11
11
|
|
@@ -17,6 +17,12 @@ tslib_1.__exportStar(require("./useToggleButton"), exports);
|
|
17
17
|
|
18
18
|
var useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
|
19
19
|
|
20
|
+
Object.defineProperty(exports, "toggleButtonClassName", {
|
21
|
+
enumerable: true,
|
22
|
+
get: function () {
|
23
|
+
return useToggleButtonStyles_1.toggleButtonClassName;
|
24
|
+
}
|
25
|
+
});
|
20
26
|
Object.defineProperty(exports, "useToggleButtonStyles", {
|
21
27
|
enumerable: true,
|
22
28
|
get: function () {
|
@@ -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","sourceRoot":""}
|
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,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA","sourceRoot":""}
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useToggleButton = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
10
|
-
|
10
|
+
const React = /*#__PURE__*/require("react");
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
var useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
12
|
+
const useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
15
13
|
/**
|
16
14
|
* Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
|
17
15
|
* processed state.
|
@@ -20,43 +18,42 @@ var useButton_1 = /*#__PURE__*/require("../Button/useButton");
|
|
20
18
|
*/
|
21
19
|
|
22
20
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
var _d = react_utilities_1.useControllableState({
|
21
|
+
const useToggleButton = ({
|
22
|
+
checked,
|
23
|
+
defaultChecked,
|
24
|
+
...props
|
25
|
+
}, ref) => {
|
26
|
+
const buttonState = useButton_1.useButton(props, ref);
|
27
|
+
const {
|
28
|
+
role,
|
29
|
+
onClick
|
30
|
+
} = buttonState.root;
|
31
|
+
const [checkedValue, setCheckedValue] = react_utilities_1.useControllableState({
|
36
32
|
state: checked,
|
37
33
|
defaultState: defaultChecked,
|
38
34
|
initialState: false
|
39
|
-
})
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
var isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
44
|
-
return tslib_1.__assign(tslib_1.__assign({}, buttonState), {
|
35
|
+
});
|
36
|
+
const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
37
|
+
return { // Button state
|
38
|
+
...buttonState,
|
45
39
|
// State calculated from a set of props
|
46
40
|
checked: checkedValue,
|
47
41
|
// Slots definition
|
48
|
-
root:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
42
|
+
root: { ...buttonState.root,
|
43
|
+
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: !!checkedValue,
|
44
|
+
onClick: React.useCallback(ev => {
|
45
|
+
if (onClick) {
|
46
|
+
onClick(ev);
|
47
|
+
|
48
|
+
if (ev.defaultPrevented) {
|
49
|
+
return;
|
50
|
+
}
|
54
51
|
}
|
55
|
-
}
|
56
52
|
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
setCheckedValue(!checkedValue);
|
54
|
+
}, [checkedValue, setCheckedValue, onClick])
|
55
|
+
}
|
56
|
+
};
|
60
57
|
};
|
61
58
|
|
62
59
|
exports.useToggleButton = useToggleButton;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":"
|
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,eAAe,GAAG,CAC7B;AAAE,EAAA,OAAF;AAAW,EAAA,cAAX;AAA2B,KAAG;AAA9B,CAD6B,EAE7B,GAF6B,KAGR;AACrB,QAAM,WAAW,GAAG,WAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,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,CAAC,YAFtD;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,CA1CM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
|
@@ -3,13 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useToggleButtonStyles = void 0;
|
6
|
+
exports.useToggleButtonStyles = exports.toggleButtonClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
9
|
|
10
|
-
|
10
|
+
const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
|
11
11
|
|
12
|
-
|
12
|
+
exports.toggleButtonClassName = 'fui-ToggleButton';
|
13
|
+
|
14
|
+
const useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
13
15
|
"base": {
|
14
16
|
"ayd6f0": "fg85c1j",
|
15
17
|
"g2u3we": "fj3muxo",
|
@@ -105,7 +107,7 @@ var useCheckedStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
105
107
|
"a": [".fzgy25m:active{background: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);}", ".flt377r:active{background:var(--colorTransparentBackgroundPressed);}", ".f4ihffn:active{background: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);}", ".f1be4e1d:active{background:var(--colorSubtleBackgroundPressed);}", ".f19au66r:active{color:var(--colorNeutralForeground2BrandPressed);}"]
|
106
108
|
});
|
107
109
|
|
108
|
-
|
110
|
+
const useDisabledStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
109
111
|
"base": {
|
110
112
|
"ayd6f0": "fqst6tg",
|
111
113
|
"g2u3we": "f1jj8ep1",
|
@@ -181,14 +183,16 @@ var useDisabledStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
181
183
|
"a": [".fkqx3al:active{background: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;}", ".f17oliv9:active{background:none;}"]
|
182
184
|
});
|
183
185
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
186
|
+
const useToggleButtonStyles = state => {
|
187
|
+
const checkedStyles = useCheckedStyles();
|
188
|
+
const disabledStyles = useDisabledStyles();
|
189
|
+
const {
|
190
|
+
appearance,
|
191
|
+
checked,
|
192
|
+
disabled,
|
193
|
+
disabledFocusable
|
194
|
+
} = state;
|
195
|
+
state.root.className = react_make_styles_1.mergeClasses(exports.toggleButtonClassName, // Checked styles
|
192
196
|
checked && checkedStyles.base, appearance && checked && checkedStyles[appearance], // Disabled styles
|
193
197
|
(disabled || disabledFocusable) && disabledStyles.base, appearance && (disabled || disabledFocusable) && disabledStyles[appearance], // User provided class name
|
194
198
|
state.root.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGa,OAAA,CAAA,qBAAA,GAAwB,kBAAxB;;AAEb,MAAM,gBAAgB,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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BAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CAxBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourceRoot":""}
|
package/lib-commonjs/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-button",
|
3
|
-
"version": "9.0.0-beta.
|
3
|
+
"version": "9.0.0-beta.5",
|
4
4
|
"description": "Fluent UI React Button component.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -26,12 +26,11 @@
|
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/a11y-testing": "^0.1.0",
|
29
|
-
"@fluentui/babel-make-styles": "9.0.0-beta.
|
29
|
+
"@fluentui/babel-make-styles": "9.0.0-beta.4",
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
31
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.
|
31
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.4",
|
32
32
|
"@fluentui/react-conformance": "*",
|
33
|
-
"@fluentui/react-conformance-make-styles": "9.0.0-beta.
|
34
|
-
"@fluentui/react-menu": "9.0.0-beta.1",
|
33
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-beta.4",
|
35
34
|
"@fluentui/scripts": "^1.0.0",
|
36
35
|
"@types/enzyme": "3.10.3",
|
37
36
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -46,11 +45,11 @@
|
|
46
45
|
},
|
47
46
|
"dependencies": {
|
48
47
|
"@fluentui/keyboard-keys": "9.0.0-beta.1",
|
49
|
-
"@fluentui/react-aria": "9.0.0-beta.
|
50
|
-
"@fluentui/react-icons": "^
|
51
|
-
"@fluentui/react-make-styles": "9.0.0-beta.
|
52
|
-
"@fluentui/react-tabster": "9.0.0-beta.
|
53
|
-
"@fluentui/react-utilities": "9.0.0-beta.
|
48
|
+
"@fluentui/react-aria": "9.0.0-beta.4",
|
49
|
+
"@fluentui/react-icons": "^2.0.152-beta.3",
|
50
|
+
"@fluentui/react-make-styles": "9.0.0-beta.4",
|
51
|
+
"@fluentui/react-tabster": "9.0.0-beta.5",
|
52
|
+
"@fluentui/react-utilities": "9.0.0-beta.4",
|
54
53
|
"tslib": "^2.1.0"
|
55
54
|
},
|
56
55
|
"peerDependencies": {
|
@@ -60,7 +59,6 @@
|
|
60
59
|
"react-dom": ">=16.8.0 <18.0.0"
|
61
60
|
},
|
62
61
|
"beachball": {
|
63
|
-
"tag": "beta",
|
64
62
|
"disallowedChangeTypes": [
|
65
63
|
"major",
|
66
64
|
"minor",
|