@fluentui/react-button 9.3.34 → 9.3.36
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +97 -1
- package/CHANGELOG.md +31 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/renderButton.js +9 -3
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +4 -3
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +14 -3
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +10 -3
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +1 -1
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +7 -2
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +1 -1
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
- package/lib/contexts/ButtonContext.js.map +1 -1
- package/lib/utils/useToggleState.js +2 -2
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.js +2 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +2 -2
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +2 -2
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +2 -2
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +2 -2
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +9 -7
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +11 -7
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +15 -7
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +14 -11
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.js +14 -10
- package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +9 -7
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +12 -8
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +20 -7
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +9 -7
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js +14 -10
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +9 -7
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +12 -8
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +16 -7
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +10 -8
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js +11 -7
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +9 -7
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +12 -8
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -6
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +17 -15
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js +9 -5
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +9 -7
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +12 -8
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +5 -3
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js +13 -9
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/ButtonContext.js +8 -4
- package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +2 -2
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +89 -33
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +2 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +10 -8
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +13 -13
@@ -2,5 +2,5 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./useToggleState"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './useToggleState';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './useToggleState';\n"],"names":[],"mappings":";;;;;uBAAc"}
|
@@ -4,15 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "useToggleState", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return useToggleState;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/
|
11
|
-
const
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
12
14
|
function useToggleState(props, state) {
|
13
|
-
const { checked
|
14
|
-
const { onClick
|
15
|
-
const [checkedValue, setCheckedValue] = (0,
|
15
|
+
const { checked, defaultChecked, disabled, disabledFocusable } = props;
|
16
|
+
const { onClick, role } = state.root;
|
17
|
+
const [checkedValue, setCheckedValue] = (0, _reactutilities.useControllableState)({
|
16
18
|
state: checked,
|
17
19
|
defaultState: defaultChecked,
|
18
20
|
initialState: false
|
@@ -37,7 +39,7 @@ function useToggleState(props, state) {
|
|
37
39
|
root: {
|
38
40
|
...state.root,
|
39
41
|
[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,
|
40
|
-
onClick: (0,
|
42
|
+
onClick: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(onClick, onToggleClick))
|
41
43
|
}
|
42
44
|
};
|
43
45
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useToggleState.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nexport function useToggleState(props, state) {\n const { checked
|
1
|
+
{"version":3,"sources":["useToggleState.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nexport function useToggleState(props, state) {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false\n });\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n const onToggleClick = React.useCallback((ev)=>{\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n setCheckedValue(!checkedValue);\n }\n }, [\n checkedValue,\n disabled,\n disabledFocusable,\n setCheckedValue\n ]);\n return {\n ...state,\n checked: checkedValue,\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(mergeCallbacks(onClick, onToggleClick))\n }\n };\n}\n"],"names":["useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","useControllableState","defaultState","initialState","isCheckboxTypeRole","onToggleClick","React","useCallback","ev","defaultPrevented","useEventCallback","mergeCallbacks"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;iEAFO;gCACgD;AAChE,SAASA,eAAeC,KAAK,EAAEC,KAAK;IACvC,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGL;IACjE,MAAM,EAAEM,OAAO,EAAEC,IAAI,EAAE,GAAGN,MAAMO,IAAI;IACpC,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,IAAAA,oCAAoB,EAAC;QACzDV,OAAOC;QACPU,cAAcT;QACdU,cAAc;IAClB;IACA,MAAMC,qBAAqBP,SAAS,sBAAsBA,SAAS;IACnE,MAAMQ,gBAAgBC,OAAMC,WAAW,CAAC,CAACC;QACrC,IAAI,CAACd,YAAY,CAACC,mBAAmB;YACjC,IAAIa,GAAGC,gBAAgB,EAAE;gBACrB;YACJ;YACAT,gBAAgB,CAACD;QACrB;IACJ,GAAG;QACCA;QACAL;QACAC;QACAK;KACH;IACD,OAAO;QACH,GAAGT,KAAK;QACRC,SAASO;QACTD,MAAM;YACF,GAAGP,MAAMO,IAAI;YACb,CAACM,qBAAqB,iBAAiB,eAAe,EAAEL;YACxDH,SAASc,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACf,SAASS;QACtD;IACJ;AACJ"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-button",
|
3
|
-
"version": "9.3.
|
3
|
+
"version": "9.3.36",
|
4
4
|
"description": "Fluent UI React Button component.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -34,22 +34,22 @@
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@fluentui/keyboard-keys": "^9.0.
|
38
|
-
"@fluentui/react-aria": "^9.3.
|
37
|
+
"@fluentui/keyboard-keys": "^9.0.4",
|
38
|
+
"@fluentui/react-aria": "^9.3.35",
|
39
39
|
"@fluentui/react-icons": "^2.0.207",
|
40
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
41
|
-
"@fluentui/react-shared-contexts": "^9.7.
|
42
|
-
"@fluentui/react-tabster": "^9.12.
|
43
|
-
"@fluentui/react-theme": "^9.1.
|
44
|
-
"@fluentui/react-utilities": "^9.13.
|
40
|
+
"@fluentui/react-jsx-runtime": "^9.0.5",
|
41
|
+
"@fluentui/react-shared-contexts": "^9.7.3",
|
42
|
+
"@fluentui/react-tabster": "^9.12.7",
|
43
|
+
"@fluentui/react-theme": "^9.1.12",
|
44
|
+
"@fluentui/react-utilities": "^9.13.2",
|
45
45
|
"@griffel/react": "^1.5.14",
|
46
|
-
"@swc/helpers": "^0.
|
46
|
+
"@swc/helpers": "^0.5.1"
|
47
47
|
},
|
48
48
|
"peerDependencies": {
|
49
|
-
"@types/react": ">=16.
|
50
|
-
"@types/react-dom": ">=16.
|
51
|
-
"react": ">=16.
|
52
|
-
"react-dom": ">=16.
|
49
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
50
|
+
"@types/react-dom": ">=16.14.0 <19.0.0",
|
51
|
+
"react": ">=16.14.0 <19.0.0",
|
52
|
+
"react-dom": ">=16.14.0 <19.0.0"
|
53
53
|
},
|
54
54
|
"beachball": {
|
55
55
|
"disallowedChangeTypes": [
|