@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.
Files changed (102) hide show
  1. package/CHANGELOG.json +97 -1
  2. package/CHANGELOG.md +31 -2
  3. package/lib/components/Button/Button.js.map +1 -1
  4. package/lib/components/Button/renderButton.js +9 -3
  5. package/lib/components/Button/renderButton.js.map +1 -1
  6. package/lib/components/Button/useButton.js +4 -3
  7. package/lib/components/Button/useButton.js.map +1 -1
  8. package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
  9. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  10. package/lib/components/CompoundButton/renderCompoundButton.js +14 -3
  11. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  12. package/lib/components/CompoundButton/useCompoundButton.js +1 -1
  13. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  14. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  15. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  16. package/lib/components/MenuButton/renderMenuButton.js +10 -3
  17. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  18. package/lib/components/MenuButton/useMenuButton.js +1 -1
  19. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  20. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  21. package/lib/components/SplitButton/renderSplitButton.js +7 -2
  22. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  23. package/lib/components/SplitButton/useSplitButton.js +1 -1
  24. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  25. package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  26. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  27. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  28. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  29. package/lib/contexts/ButtonContext.js.map +1 -1
  30. package/lib/utils/useToggleState.js +2 -2
  31. package/lib/utils/useToggleState.js.map +1 -1
  32. package/lib-commonjs/Button.js +2 -2
  33. package/lib-commonjs/Button.js.map +1 -1
  34. package/lib-commonjs/CompoundButton.js +2 -2
  35. package/lib-commonjs/CompoundButton.js.map +1 -1
  36. package/lib-commonjs/MenuButton.js +2 -2
  37. package/lib-commonjs/MenuButton.js.map +1 -1
  38. package/lib-commonjs/SplitButton.js +2 -2
  39. package/lib-commonjs/SplitButton.js.map +1 -1
  40. package/lib-commonjs/ToggleButton.js +2 -2
  41. package/lib-commonjs/ToggleButton.js.map +1 -1
  42. package/lib-commonjs/components/Button/Button.js +9 -7
  43. package/lib-commonjs/components/Button/Button.js.map +1 -1
  44. package/lib-commonjs/components/Button/index.js +11 -7
  45. package/lib-commonjs/components/Button/index.js.map +1 -1
  46. package/lib-commonjs/components/Button/renderButton.js +15 -7
  47. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  48. package/lib-commonjs/components/Button/useButton.js +14 -11
  49. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  50. package/lib-commonjs/components/Button/useButtonStyles.styles.js +14 -10
  51. package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
  52. package/lib-commonjs/components/CompoundButton/CompoundButton.js +9 -7
  53. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  54. package/lib-commonjs/components/CompoundButton/index.js +12 -8
  55. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  56. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +20 -7
  57. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  58. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +9 -7
  59. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  60. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js +14 -10
  61. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  62. package/lib-commonjs/components/MenuButton/MenuButton.js +9 -7
  63. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  64. package/lib-commonjs/components/MenuButton/index.js +12 -8
  65. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  66. package/lib-commonjs/components/MenuButton/renderMenuButton.js +16 -7
  67. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  68. package/lib-commonjs/components/MenuButton/useMenuButton.js +10 -8
  69. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  70. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js +11 -7
  71. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
  72. package/lib-commonjs/components/SplitButton/SplitButton.js +9 -7
  73. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  74. package/lib-commonjs/components/SplitButton/index.js +12 -8
  75. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  76. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -6
  77. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  78. package/lib-commonjs/components/SplitButton/useSplitButton.js +17 -15
  79. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  80. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js +9 -5
  81. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  82. package/lib-commonjs/components/ToggleButton/ToggleButton.js +9 -7
  83. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  84. package/lib-commonjs/components/ToggleButton/index.js +12 -8
  85. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  86. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -1
  87. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  88. package/lib-commonjs/components/ToggleButton/useToggleButton.js +5 -3
  89. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  90. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js +13 -9
  91. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  92. package/lib-commonjs/contexts/ButtonContext.js +8 -4
  93. package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
  94. package/lib-commonjs/contexts/index.js +2 -2
  95. package/lib-commonjs/contexts/index.js.map +1 -1
  96. package/lib-commonjs/index.js +89 -33
  97. package/lib-commonjs/index.js.map +1 -1
  98. package/lib-commonjs/utils/index.js +2 -2
  99. package/lib-commonjs/utils/index.js.map +1 -1
  100. package/lib-commonjs/utils/useToggleState.js +10 -8
  101. package/lib-commonjs/utils/useToggleState.js.map +1 -1
  102. package/package.json +13 -13
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./useToggleState"), exports);
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":";;;;;oBAAc"}
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: ()=>useToggleState
7
+ get: function() {
8
+ return useToggleState;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
- const _reactUtilities = require("@fluentui/react-utilities");
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 , defaultChecked , disabled , disabledFocusable } = props;
14
- const { onClick , role } = state.root;
15
- const [checkedValue, setCheckedValue] = (0, _reactUtilities.useControllableState)({
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, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(onClick, onToggleClick))
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 , 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;;aAAAA;;;6DAFO;gCACgD;AAChE,SAASA,eAAeC,KAAK,EAAEC,KAAK,EAAE;IACzC,MAAM,EAAEC,QAAO,EAAGC,eAAc,EAAGC,SAAQ,EAAGC,kBAAiB,EAAG,GAAGL;IACrE,MAAM,EAAEM,QAAO,EAAGC,KAAI,EAAG,GAAGN,MAAMO,IAAI;IACtC,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,IAAAA,oCAAoB,EAAC;QACzDV,OAAOC;QACPU,cAAcT;QACdU,cAAc,KAAK;IACvB;IACA,MAAMC,qBAAqBP,SAAS,sBAAsBA,SAAS;IACnE,MAAMQ,gBAAgBC,OAAMC,WAAW,CAAC,CAACC,KAAK;QAC1C,IAAI,CAACd,YAAY,CAACC,mBAAmB;YACjC,IAAIa,GAAGC,gBAAgB,EAAE;gBACrB;YACJ,CAAC;YACDT,gBAAgB,CAACD;QACrB,CAAC;IACL,GAAG;QACCA;QACAL;QACAC;QACAK;KACH;IACD,OAAO;QACH,GAAGT,KAAK;QACRC,SAASO;QACTD,MAAM;YACF,GAAGP,MAAMO,IAAI;YACb,CAACM,qBAAqB,iBAAiB,cAAc,CAAC,EAAEL;YACxDH,SAASc,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACf,SAASS;QACtD;IACJ;AACJ"}
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.34",
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.3",
38
- "@fluentui/react-aria": "^9.3.33",
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.3",
41
- "@fluentui/react-shared-contexts": "^9.7.2",
42
- "@fluentui/react-tabster": "^9.12.5",
43
- "@fluentui/react-theme": "^9.1.11",
44
- "@fluentui/react-utilities": "^9.13.0",
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.4.14"
46
+ "@swc/helpers": "^0.5.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@types/react": ">=16.8.0 <19.0.0",
50
- "@types/react-dom": ">=16.8.0 <19.0.0",
51
- "react": ">=16.8.0 <19.0.0",
52
- "react-dom": ">=16.8.0 <19.0.0"
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": [