@fluentui/react-button 9.8.0 → 9.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/dist/index.d.ts +1 -1
  3. package/lib/CompoundButton.js +1 -1
  4. package/lib/CompoundButton.js.map +1 -1
  5. package/lib/MenuButton.js +1 -1
  6. package/lib/MenuButton.js.map +1 -1
  7. package/lib/SplitButton.js +1 -1
  8. package/lib/SplitButton.js.map +1 -1
  9. package/lib/ToggleButton.js.map +1 -1
  10. package/lib/components/Button/Button.types.js.map +1 -1
  11. package/lib/components/Button/index.js +1 -2
  12. package/lib/components/Button/index.js.map +1 -1
  13. package/lib/components/Button/useButton.js +34 -4
  14. package/lib/components/Button/useButton.js.map +1 -1
  15. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  16. package/lib/components/CompoundButton/index.js +0 -1
  17. package/lib/components/CompoundButton/index.js.map +1 -1
  18. package/lib/components/CompoundButton/useCompoundButton.js +23 -10
  19. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  20. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  21. package/lib/components/MenuButton/index.js +0 -1
  22. package/lib/components/MenuButton/index.js.map +1 -1
  23. package/lib/components/MenuButton/useMenuButton.js +24 -14
  24. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  25. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  26. package/lib/components/SplitButton/index.js +0 -1
  27. package/lib/components/SplitButton/index.js.map +1 -1
  28. package/lib/components/SplitButton/useSplitButton.js +53 -16
  29. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  30. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  31. package/lib/components/ToggleButton/index.js +1 -2
  32. package/lib/components/ToggleButton/index.js.map +1 -1
  33. package/lib/components/ToggleButton/useToggleButton.js +16 -13
  34. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  35. package/lib/index.js +0 -6
  36. package/lib/index.js.map +1 -1
  37. package/lib-commonjs/CompoundButton.js +0 -3
  38. package/lib-commonjs/CompoundButton.js.map +1 -1
  39. package/lib-commonjs/MenuButton.js +0 -3
  40. package/lib-commonjs/MenuButton.js.map +1 -1
  41. package/lib-commonjs/SplitButton.js +0 -3
  42. package/lib-commonjs/SplitButton.js.map +1 -1
  43. package/lib-commonjs/ToggleButton.js.map +1 -1
  44. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  45. package/lib-commonjs/components/Button/index.js +1 -2
  46. package/lib-commonjs/components/Button/index.js.map +1 -1
  47. package/lib-commonjs/components/Button/useButton.js +40 -7
  48. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  49. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  50. package/lib-commonjs/components/CompoundButton/index.js +0 -4
  51. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  52. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +23 -10
  53. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  54. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  55. package/lib-commonjs/components/MenuButton/index.js +0 -4
  56. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  57. package/lib-commonjs/components/MenuButton/useMenuButton.js +24 -14
  58. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  59. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  60. package/lib-commonjs/components/SplitButton/index.js +0 -4
  61. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  62. package/lib-commonjs/components/SplitButton/useSplitButton.js +53 -16
  63. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  64. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  65. package/lib-commonjs/components/ToggleButton/index.js +1 -2
  66. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  67. package/lib-commonjs/components/ToggleButton/useToggleButton.js +21 -15
  68. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  69. package/lib-commonjs/index.js +0 -6
  70. package/lib-commonjs/index.js.map +1 -1
  71. package/package.json +6 -6
  72. package/lib/components/Button/useButtonBase.js +0 -34
  73. package/lib/components/Button/useButtonBase.js.map +0 -1
  74. package/lib/components/CompoundButton/useCompoundButtonBase.js +0 -31
  75. package/lib/components/CompoundButton/useCompoundButtonBase.js.map +0 -1
  76. package/lib/components/MenuButton/useMenuButtonBase.js +0 -27
  77. package/lib/components/MenuButton/useMenuButtonBase.js.map +0 -1
  78. package/lib/components/SplitButton/useSplitButtonBase.js +0 -57
  79. package/lib/components/SplitButton/useSplitButtonBase.js.map +0 -1
  80. package/lib/components/ToggleButton/useToggleButtonBase.js +0 -13
  81. package/lib/components/ToggleButton/useToggleButtonBase.js.map +0 -1
  82. package/lib-commonjs/components/Button/useButtonBase.js +0 -41
  83. package/lib-commonjs/components/Button/useButtonBase.js.map +0 -1
  84. package/lib-commonjs/components/CompoundButton/useCompoundButtonBase.js +0 -38
  85. package/lib-commonjs/components/CompoundButton/useCompoundButtonBase.js.map +0 -1
  86. package/lib-commonjs/components/MenuButton/useMenuButtonBase.js +0 -36
  87. package/lib-commonjs/components/MenuButton/useMenuButtonBase.js.map +0 -1
  88. package/lib-commonjs/components/SplitButton/useSplitButtonBase.js +0 -64
  89. package/lib-commonjs/components/SplitButton/useSplitButtonBase.js.map +0 -1
  90. package/lib-commonjs/components/ToggleButton/useToggleButtonBase.js +0 -19
  91. package/lib-commonjs/components/ToggleButton/useToggleButtonBase.js.map +0 -1
@@ -19,7 +19,7 @@ _export(exports, {
19
19
  return _useToggleButtonStylesstyles.toggleButtonClassNames;
20
20
  },
21
21
  useToggleButtonBase_unstable: function() {
22
- return _useToggleButtonBase.useToggleButtonBase_unstable;
22
+ return _useToggleButton.useToggleButtonBase_unstable;
23
23
  },
24
24
  useToggleButtonStyles_unstable: function() {
25
25
  return _useToggleButtonStylesstyles.useToggleButtonStyles_unstable;
@@ -31,5 +31,4 @@ _export(exports, {
31
31
  const _ToggleButton = require("./ToggleButton");
32
32
  const _renderToggleButton = require("./renderToggleButton");
33
33
  const _useToggleButton = require("./useToggleButton");
34
- const _useToggleButtonBase = require("./useToggleButtonBase");
35
34
  const _useToggleButtonStylesstyles = require("./useToggleButtonStyles.styles");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToggleButton/index.ts"],"sourcesContent":["export { ToggleButton } from './ToggleButton';\nexport type {\n ToggleButtonBaseProps,\n ToggleButtonProps,\n ToggleButtonBaseState,\n ToggleButtonState,\n} from './ToggleButton.types';\nexport { renderToggleButton_unstable } from './renderToggleButton';\nexport { useToggleButton_unstable } from './useToggleButton';\nexport { useToggleButtonBase_unstable } from './useToggleButtonBase';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';\n"],"names":["ToggleButton","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonBase_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,0BAAY;;;eAOZC,+CAA2B;;;eAG3BG,mDAAsB;;;eADtBD,iDAA4B;;;eACJE,2DAA8B;;;eAFtDH,yCAAwB;;;8BARJ,iBAAiB;oCAOF,uBAAuB;iCAC1B,oBAAoB;qCAChB,wBAAwB;6CACE,iCAAiC"}
1
+ {"version":3,"sources":["../src/components/ToggleButton/index.ts"],"sourcesContent":["export { ToggleButton } from './ToggleButton';\nexport type {\n ToggleButtonBaseProps,\n ToggleButtonProps,\n ToggleButtonState,\n ToggleButtonBaseState,\n} from './ToggleButton.types';\nexport { renderToggleButton_unstable } from './renderToggleButton';\nexport { useToggleButton_unstable, useToggleButtonBase_unstable } from './useToggleButton';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';\n"],"names":["ToggleButton","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonBase_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,0BAAY;;;eAOZC,+CAA2B;;;eAE3BG,mDAAsB;;;eADID,6CAA4B;;;eAC9BE,2DAA8B;;;eADtDH,yCAAwB;;;8BARJ,iBAAiB;oCAOF,uBAAuB;iCACI,oBAAoB;6CACpB,iCAAiC"}
@@ -3,25 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "useToggleButton_unstable", {
7
- enumerable: true,
8
- get: function() {
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ useToggleButtonBase_unstable: function() {
14
+ return useToggleButtonBase_unstable;
15
+ },
16
+ useToggleButton_unstable: function() {
9
17
  return useToggleButton_unstable;
10
18
  }
11
19
  });
12
20
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
21
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _useToggleButtonBase = require("./useToggleButtonBase");
15
- const _contexts = require("../../contexts");
22
+ const _useToggleState = require("../../utils/useToggleState");
23
+ const _useButton = require("../Button/useButton");
16
24
  const useToggleButton_unstable = (props, ref)=>{
17
- 'use no memo';
18
- const { size: contextSize } = (0, _contexts.useButtonContext)();
19
- const { appearance = 'secondary', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
20
- const buttonState = (0, _useToggleButtonBase.useToggleButtonBase_unstable)(props, ref);
21
- return {
22
- appearance,
23
- shape,
24
- size,
25
- ...buttonState
26
- };
25
+ const { checked = false, defaultChecked = false, ...buttonProps } = props;
26
+ const buttonState = (0, _useButton.useButton_unstable)(buttonProps, ref);
27
+ return (0, _useToggleState.useToggleState)(props, buttonState);
28
+ };
29
+ const useToggleButtonBase_unstable = (props, ref)=>{
30
+ const { checked = false, defaultChecked = false, ...buttonProps } = props;
31
+ const buttonState = (0, _useButton.useButtonBase_unstable)(buttonProps, ref);
32
+ return (0, _useToggleState.useToggleState)(props, buttonState);
27
33
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ToggleButton/useToggleButton.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\nimport { useToggleButtonBase_unstable } from './useToggleButtonBase';\nimport { useButtonContext } from '../../contexts';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls `useToggleButtonBase_unstable` and adds design-related props, 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 props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n 'use no memo';\n\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', shape = 'rounded', size = contextSize ?? 'medium' } = props;\n\n const buttonState = useToggleButtonBase_unstable(props, ref);\n\n return {\n appearance,\n shape,\n size,\n ...buttonState,\n };\n};\n"],"names":["React","useToggleButtonBase_unstable","useButtonContext","useToggleButton_unstable","props","ref","size","contextSize","appearance","shape","buttonState"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;qCAEc,wBAAwB;0BACpC,iBAAiB;AAQ3C,MAAMG,2BAA2B,CACtCC,OACAC;IAEA;IAEA,MAAM,EAAEC,MAAMC,WAAW,EAAE,OAAGL,0BAAAA;IAC9B,MAAM,EAAEM,aAAa,WAAW,EAAEC,QAAQ,SAAS,EAAEH,OAAOC,gBAAAA,QAAAA,gBAAAA,KAAAA,IAAAA,cAAe,QAAQ,EAAE,GAAGH;IAExF,MAAMM,kBAAcT,iDAAAA,EAA6BG,OAAOC;IAExD,OAAO;QACLG;QACAC;QACAH;QACA,GAAGI,WAAW;IAChB;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/ToggleButton/useToggleButton.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButton_unstable, useButtonBase_unstable } from '../Button/useButton';\nimport type { ToggleButtonBaseState, 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 props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const { checked = false, defaultChecked = false, ...buttonProps } = props;\n const buttonState = useButton_unstable(buttonProps, ref);\n\n return useToggleState(props, buttonState);\n};\n\n/**\n * Base hook for ToggleButton component, which manages state related to slots structure and ARIA attributes.\n *\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 useToggleButtonBase_unstable = (\n props: ToggleButtonProps,\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonBaseState => {\n const { checked = false, defaultChecked = false, ...buttonProps } = props;\n const buttonState = useButtonBase_unstable(buttonProps, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"names":["React","useToggleState","useButton_unstable","useButtonBase_unstable","useToggleButton_unstable","props","ref","checked","defaultChecked","buttonProps","buttonState","useToggleButtonBase_unstable"],"mappings":"AAAA;;;;;;;;;;;;IA6BaW,4BAAAA;;;4BAhBAP;;;;;iEAXU,QAAQ;gCACA,6BAA6B;2BACD,sBAAsB;AAS1E,MAAMA,2BAA2B,CACtCC,OACAC;IAEA,MAAM,EAAEC,UAAU,KAAK,EAAEC,iBAAiB,KAAK,EAAE,GAAGC,aAAa,GAAGJ;IACpE,MAAMK,kBAAcR,6BAAAA,EAAmBO,aAAaH;IAEpD,WAAOL,8BAAAA,EAAeI,OAAOK;AAC/B,EAAE;AAQK,qCAAqC,CAC1CL,OACAC;IAEA,MAAM,EAAEC,UAAU,KAAK,EAAEC,iBAAiB,KAAK,EAAE,GAAGC,aAAa,GAAGJ;IACpE,MAAMK,kBAAcP,iCAAAA,EAAuBM,aAAaH;IAExD,WAAOL,8BAAAA,EAAeI,OAAOK;AAC/B,EAAE"}
@@ -104,11 +104,5 @@ const _index1 = require("./contexts/index");
104
104
  // Experimental APIs - will be uncommented in the experimental release branch
105
105
  // export { useButtonBase_unstable } from './Button';
106
106
  // export type { ButtonBaseProps, ButtonBaseState } from './Button';
107
- // export { useCompoundButtonBase_unstable } from './CompoundButton';
108
- // export type { CompoundButtonBaseProps, CompoundButtonBaseState } from './CompoundButton';
109
- // export { useMenuButtonBase_unstable } from './MenuButton';
110
- // export type { MenuButtonBaseProps, MenuButtonBaseState } from './MenuButton';
111
- // export { useSplitButtonBase_unstable } from './SplitButton';
112
- // export type { SplitButtonBaseProps, SplitButtonBaseState } from './SplitButton';
113
107
  // export { useToggleButtonBase_unstable } from './ToggleButton';
114
108
  // export type { ToggleButtonBaseProps, ToggleButtonBaseState } from './ToggleButton';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Button,\n buttonClassNames,\n renderButton_unstable,\n useButtonStyles_unstable,\n useButton_unstable,\n} from './Button';\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button';\nexport {\n CompoundButton,\n compoundButtonClassNames,\n renderCompoundButton_unstable,\n useCompoundButtonStyles_unstable,\n useCompoundButton_unstable,\n} from './CompoundButton';\nexport type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';\nexport {\n MenuButton,\n menuButtonClassNames,\n renderMenuButton_unstable,\n useMenuButtonStyles_unstable,\n useMenuButton_unstable,\n} from './MenuButton';\nexport type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuButton';\nexport {\n SplitButton,\n renderSplitButton_unstable,\n splitButtonClassNames,\n useSplitButtonStyles_unstable,\n useSplitButton_unstable,\n} from './SplitButton';\nexport type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';\nexport {\n ToggleButton,\n renderToggleButton_unstable,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n} from './ToggleButton';\nexport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n\nexport { ButtonContextProvider, useButtonContext } from './contexts/index';\nexport type { ButtonContextValue } from './contexts/index';\n\n// Experimental APIs - will be uncommented in the experimental release branch\n// export { useButtonBase_unstable } from './Button';\n// export type { ButtonBaseProps, ButtonBaseState } from './Button';\n// export { useCompoundButtonBase_unstable } from './CompoundButton';\n// export type { CompoundButtonBaseProps, CompoundButtonBaseState } from './CompoundButton';\n// export { useMenuButtonBase_unstable } from './MenuButton';\n// export type { MenuButtonBaseProps, MenuButtonBaseState } from './MenuButton';\n// export { useSplitButtonBase_unstable } from './SplitButton';\n// export type { SplitButtonBaseProps, SplitButtonBaseState } from './SplitButton';\n// export { useToggleButtonBase_unstable } from './ToggleButton';\n// export type { ToggleButtonBaseProps, ToggleButtonBaseState } from './ToggleButton';\n"],"names":["Button","buttonClassNames","renderButton_unstable","useButtonStyles_unstable","useButton_unstable","CompoundButton","compoundButtonClassNames","renderCompoundButton_unstable","useCompoundButtonStyles_unstable","useCompoundButton_unstable","MenuButton","menuButtonClassNames","renderMenuButton_unstable","useMenuButtonStyles_unstable","useMenuButton_unstable","SplitButton","renderSplitButton_unstable","splitButtonClassNames","useSplitButtonStyles_unstable","useSplitButton_unstable","ToggleButton","renderToggleButton_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable","useToggleButton_unstable","useToggleState","ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;yBA0CsB;eAArB0B;;;eAlCPrB,8BAAc;;;eAQdK,sBAAU;;IAQVK;uCAAW;;IAQXK;yCAAY;;;eA/BZnB,wBAAgB;;;eAQhBK,wCAAwB;;IAQxBK,oBAAoB;;;;eAfpBT,6BAAqB;;;eAQrBK,6CAA6B;;;eAQ7BK,qCAAyB;;;eAOzBI,uCAA0B;;IAQ1BK;wDAA2B;;;eAP3BJ,kCAAqB;;;eAQrBK,oCAAsB;;;eAQQK,wBAAgB;;;eAvC9CxB,gCAAwB;;;eACxBC,0BAAkB;;;eAOlBI,gDAAgC;;;eAChCC,0CAA0B;;;eAO1BI,wCAA4B;;;eAC5BC,kCAAsB;;;eAOtBI,0CAA6B;;;eAC7BC,oCAAuB;;;eAOvBI,4CAA8B;;IAC9BC;qDAAwB;;kBAIH;eAAdC;;;wBAnCF,WAAW;gCAQX,mBAAmB;4BAQnB,eAAe;6BAQf,gBAAgB;8BAQhB,iBAAiB;uBAGO,gBAAgB;wBAES,mBAAmB;CAG3E,6EAA6E;CAC7E,qDAAqD;CACrD,oEAAoE;CACpE,qEAAqE;CACrE,4FAA4F;CAC5F,6DAA6D;CAC7D,gFAAgF;CAChF,+DAA+D;CAC/D,mFAAmF;CACnF,iEAAiE;CACjE,sFAAsF"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Button,\n buttonClassNames,\n renderButton_unstable,\n useButtonStyles_unstable,\n useButton_unstable,\n} from './Button';\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button';\nexport {\n CompoundButton,\n compoundButtonClassNames,\n renderCompoundButton_unstable,\n useCompoundButtonStyles_unstable,\n useCompoundButton_unstable,\n} from './CompoundButton';\nexport type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';\nexport {\n MenuButton,\n menuButtonClassNames,\n renderMenuButton_unstable,\n useMenuButtonStyles_unstable,\n useMenuButton_unstable,\n} from './MenuButton';\nexport type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuButton';\nexport {\n SplitButton,\n renderSplitButton_unstable,\n splitButtonClassNames,\n useSplitButtonStyles_unstable,\n useSplitButton_unstable,\n} from './SplitButton';\nexport type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';\nexport {\n ToggleButton,\n renderToggleButton_unstable,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n} from './ToggleButton';\nexport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n\nexport { ButtonContextProvider, useButtonContext } from './contexts/index';\nexport type { ButtonContextValue } from './contexts/index';\n\n// Experimental APIs - will be uncommented in the experimental release branch\n// export { useButtonBase_unstable } from './Button';\n// export type { ButtonBaseProps, ButtonBaseState } from './Button';\n// export { useToggleButtonBase_unstable } from './ToggleButton';\n// export type { ToggleButtonBaseProps, ToggleButtonBaseState } from './ToggleButton';\n"],"names":["Button","buttonClassNames","renderButton_unstable","useButtonStyles_unstable","useButton_unstable","CompoundButton","compoundButtonClassNames","renderCompoundButton_unstable","useCompoundButtonStyles_unstable","useCompoundButton_unstable","MenuButton","menuButtonClassNames","renderMenuButton_unstable","useMenuButtonStyles_unstable","useMenuButton_unstable","SplitButton","renderSplitButton_unstable","splitButtonClassNames","useSplitButtonStyles_unstable","useSplitButton_unstable","ToggleButton","renderToggleButton_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable","useToggleButton_unstable","useToggleState","ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;yBA0CsB;eAArB0B;;;eAlCPrB,8BAAc;;;eAQdK,sBAAU;;IAQVK;uCAAW;;IAQXK;yCAAY;;;eA/BZnB,wBAAgB;;;eAQhBK,wCAAwB;;IAQxBK,oBAAoB;;;;eAfpBT,6BAAqB;;;eAQrBK,6CAA6B;;;eAQ7BK,qCAAyB;;;eAOzBI,uCAA0B;;IAQ1BK;wDAA2B;;;eAP3BJ,kCAAqB;;;eAQrBK,oCAAsB;;;eAQQK,wBAAgB;;;eAvC9CxB,gCAAwB;;;eACxBC,0BAAkB;;IAOlBI;+DAAgC;;;eAChCC,0CAA0B;;;eAO1BI,wCAA4B;;;eAC5BC,kCAAsB;;;eAOtBI,0CAA6B;;;eAC7BC,oCAAuB;;;eAOvBI,4CAA8B;;IAC9BC;qDAAwB;;kBAIH;eAAdC;;;wBAnCF,WAAW;gCAQX,mBAAmB;4BAQnB,eAAe;6BAQf,gBAAgB;8BAQhB,iBAAiB;uBAGO,gBAAgB;wBAES,mBAAmB;CAG3E,6EAA6E;CAC7E,qDAAqD;CACrD,oEAAoE;CACpE,iEAAiE;CACjE,sFAAsF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.8.0",
3
+ "version": "9.8.2",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -13,13 +13,13 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@fluentui/keyboard-keys": "^9.0.8",
16
- "@fluentui/react-aria": "^9.17.8",
16
+ "@fluentui/react-aria": "^9.17.10",
17
17
  "@fluentui/react-icons": "^2.0.245",
18
- "@fluentui/react-jsx-runtime": "^9.3.5",
19
- "@fluentui/react-shared-contexts": "^9.26.1",
20
- "@fluentui/react-tabster": "^9.26.12",
18
+ "@fluentui/react-jsx-runtime": "^9.4.1",
19
+ "@fluentui/react-shared-contexts": "^9.26.2",
20
+ "@fluentui/react-tabster": "^9.26.13",
21
21
  "@fluentui/react-theme": "^9.2.1",
22
- "@fluentui/react-utilities": "^9.26.1",
22
+ "@fluentui/react-utilities": "^9.26.2",
23
23
  "@griffel/react": "^1.5.32",
24
24
  "@swc/helpers": "^0.5.1"
25
25
  },
@@ -1,34 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { useARIAButtonProps } from '@fluentui/react-aria';
4
- import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
5
- /**
6
- * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
7
- * @param props - User provided props to the Button component.
8
- * @param ref - User provided ref to be passed to the Button component.
9
- */ export const useButtonBase_unstable = (props, ref)=>{
10
- const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;
11
- const iconShorthand = slot.optional(icon, {
12
- elementType: 'span'
13
- });
14
- return {
15
- // Props passed at the top-level
16
- disabled,
17
- disabledFocusable,
18
- iconPosition,
19
- iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
20
- // Slots definition
21
- components: {
22
- root: 'button',
23
- icon: 'span'
24
- },
25
- root: slot.always(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {
26
- elementType: 'button',
27
- defaultProps: {
28
- ref: ref,
29
- type: as === 'button' ? 'button' : undefined
30
- }
31
- }),
32
- icon: iconShorthand
33
- };
34
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Button/useButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ButtonBaseProps, ButtonBaseState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButtonBase_unstable = (\n props: ButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonBaseState => {\n const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n return {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n iconPosition,\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n // Slots definition\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: as === 'button' ? 'button' : undefined,\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonProps","getIntrinsicElementProps","slot","useButtonBase_unstable","props","ref","as","disabled","disabledFocusable","icon","iconPosition","iconShorthand","optional","elementType","iconOnly","Boolean","children","components","root","always","defaultProps","type","undefined"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAA8BC,kBAAkB,QAAQ,uBAAuB;AAC/E,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;;;CAIC,GACD,OAAO,MAAMC,yBAAyB,CACpCC,OACAC;IAEA,MAAM,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAE,GAAGN;IACtG,MAAMO,gBAAgBT,KAAKU,QAAQ,CAACH,MAAM;QAAEI,aAAa;IAAO;IAChE,OAAO;QACL,gCAAgC;QAChCN;QACAC;QACAE;QACAI,UAAUC,QAAQJ,CAAAA,0BAAAA,oCAAAA,cAAeK,QAAQ,KAAI,CAACZ,MAAMY,QAAQ;QAC5D,mBAAmB;QACnBC,YAAY;YAAEC,MAAM;YAAUT,MAAM;QAAO;QAC3CS,MAAMhB,KAAKiB,MAAM,CAA2BlB,yBAAyBK,IAAIN,mBAAmBI,MAAME,EAAE,EAAEF,SAAS;YAC7GS,aAAa;YACbO,cAAc;gBACZf,KAAKA;gBACLgB,MAAMf,OAAO,WAAW,WAAWgB;YACrC;QACF;QACAb,MAAME;IACR;AACF,EAAE"}
@@ -1,31 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { slot } from '@fluentui/react-utilities';
4
- import { useButtonBase_unstable } from '../Button/index';
5
- /**
6
- * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
7
- * @param props - User provided props to the CompoundButton component.
8
- * @param ref - User provided ref to be passed to the CompoundButton component.
9
- */ export const useCompoundButtonBase_unstable = ({ contentContainer, secondaryContent, ...props }, ref)=>{
10
- var _state_icon, _state_secondaryContent;
11
- const state = {
12
- // Button state
13
- ...useButtonBase_unstable(props, ref),
14
- // Slots definition
15
- components: {
16
- root: 'button',
17
- icon: 'span',
18
- contentContainer: 'span',
19
- secondaryContent: 'span'
20
- },
21
- contentContainer: slot.always(contentContainer, {
22
- elementType: 'span'
23
- }),
24
- secondaryContent: slot.optional(secondaryContent, {
25
- elementType: 'span'
26
- })
27
- };
28
- // Recalculate iconOnly to take into account secondaryContent.
29
- state.iconOnly = Boolean(((_state_icon = state.icon) === null || _state_icon === void 0 ? void 0 : _state_icon.children) && !props.children && !((_state_secondaryContent = state.secondaryContent) === null || _state_secondaryContent === void 0 ? void 0 : _state_secondaryContent.children));
30
- return state;
31
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { CompoundButtonBaseProps, CompoundButtonBaseState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButtonBase_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonBaseState => {\n const state: CompoundButtonBaseState = {\n // Button state\n ...useButtonBase_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: slot.always(contentContainer, { elementType: 'span' }),\n secondaryContent: slot.optional(secondaryContent, { elementType: 'span' }),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"names":["React","slot","useButtonBase_unstable","useCompoundButtonBase_unstable","contentContainer","secondaryContent","props","ref","state","components","root","icon","always","elementType","optional","iconOnly","Boolean","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD;;;;CAIC,GACD,OAAO,MAAMC,iCAAiC,CAC5C,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAE,GAAGC,OAAgC,EACzEC;QAkByBC,aAA4CA;IAhBrE,MAAMA,QAAiC;QACrC,eAAe;QACf,GAAGN,uBAAuBI,OAAOC,IAAI;QAErC,mBAAmB;QACnBE,YAAY;YACVC,MAAM;YACNC,MAAM;YACNP,kBAAkB;YAClBC,kBAAkB;QACpB;QACAD,kBAAkBH,KAAKW,MAAM,CAACR,kBAAkB;YAAES,aAAa;QAAO;QACtER,kBAAkBJ,KAAKa,QAAQ,CAACT,kBAAkB;YAAEQ,aAAa;QAAO;IAC1E;IAEA,8DAA8D;IAC9DL,MAAMO,QAAQ,GAAGC,QAAQR,EAAAA,cAAAA,MAAMG,IAAI,cAAVH,kCAAAA,YAAYS,QAAQ,KAAI,CAACX,MAAMW,QAAQ,IAAI,GAACT,0BAAAA,MAAMH,gBAAgB,cAAtBG,8CAAAA,wBAAwBS,QAAQ;IAErG,OAAOT;AACT,EAAE"}
@@ -1,27 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { slot } from '@fluentui/react-utilities';
4
- import { useButtonBase_unstable } from '../Button/index';
5
- /**
6
- * Given user props, returns the final state for a MenuButton.
7
- */ export const useMenuButtonBase_unstable = ({ menuIcon, ...props }, ref)=>{
8
- 'use no memo';
9
- const buttonState = useButtonBase_unstable(props, ref);
10
- // force aria-expanded to be a boolean, not a string
11
- buttonState.root['aria-expanded'] = props['aria-expanded'] ? props['aria-expanded'] === 'true' || props['aria-expanded'] === true : false;
12
- return {
13
- ...buttonState,
14
- // State calculated from a set of props
15
- iconOnly: Boolean(!props.children),
16
- // Slots definition
17
- components: {
18
- root: 'button',
19
- icon: 'span',
20
- menuIcon: 'span'
21
- },
22
- menuIcon: slot.optional(menuIcon, {
23
- elementType: 'span',
24
- renderByDefault: true
25
- })
26
- };
27
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/MenuButton/useMenuButtonBase.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { MenuButtonBaseProps, MenuButtonBaseState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButtonBase_unstable = (\n { menuIcon, ...props }: MenuButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonBaseState => {\n 'use no memo';\n\n const buttonState = useButtonBase_unstable(props, ref);\n // force aria-expanded to be a boolean, not a string\n buttonState.root['aria-expanded'] = props['aria-expanded']\n ? props['aria-expanded'] === 'true' || props['aria-expanded'] === true\n : false;\n\n return {\n ...buttonState,\n\n // State calculated from a set of props\n iconOnly: Boolean(!props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n menuIcon: 'span',\n },\n\n menuIcon: slot.optional(menuIcon, {\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["React","slot","useButtonBase_unstable","useMenuButtonBase_unstable","menuIcon","props","ref","buttonState","root","iconOnly","Boolean","children","components","icon","optional","elementType","renderByDefault"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CACxC,EAAEC,QAAQ,EAAE,GAAGC,OAA4B,EAC3CC;IAEA;IAEA,MAAMC,cAAcL,uBAAuBG,OAAOC;IAClD,oDAAoD;IACpDC,YAAYC,IAAI,CAAC,gBAAgB,GAAGH,KAAK,CAAC,gBAAgB,GACtDA,KAAK,CAAC,gBAAgB,KAAK,UAAUA,KAAK,CAAC,gBAAgB,KAAK,OAChE;IAEJ,OAAO;QACL,GAAGE,WAAW;QAEd,uCAAuC;QACvCE,UAAUC,QAAQ,CAACL,MAAMM,QAAQ;QAEjC,mBAAmB;QACnBC,YAAY;YACVJ,MAAM;YACNK,MAAM;YACNT,UAAU;QACZ;QAEAA,UAAUH,KAAKa,QAAQ,CAACV,UAAU;YAChCW,aAAa;YACbC,iBAAiB;QACnB;IACF;AACF,EAAE"}
@@ -1,57 +0,0 @@
1
- import * as React from 'react';
2
- import { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';
3
- import { Button } from '../Button/Button';
4
- import { MenuButton } from '../MenuButton/MenuButton';
5
- /**
6
- * Given user props, defines default props for the SplitButton and returns processed state.
7
- * @param props - User provided props to the SplitButton component.
8
- * @param ref - User provided ref to be passed to the SplitButton component.
9
- */ export const useSplitButtonBase_unstable = (props, ref)=>{
10
- const { children, disabled = false, disabledFocusable = false, icon, iconPosition = 'before', menuButton, menuIcon, primaryActionButton } = props;
11
- const baseId = useId('splitButton-');
12
- const menuButtonShorthand = slot.optional(menuButton, {
13
- defaultProps: {
14
- disabled,
15
- disabledFocusable,
16
- menuIcon
17
- },
18
- renderByDefault: true,
19
- elementType: MenuButton
20
- });
21
- const primaryActionButtonShorthand = slot.optional(primaryActionButton, {
22
- defaultProps: {
23
- children,
24
- disabled,
25
- disabledFocusable,
26
- icon,
27
- iconPosition,
28
- id: baseId + '__primaryActionButton'
29
- },
30
- renderByDefault: true,
31
- elementType: Button
32
- });
33
- // Resolve menu button's aria-labelledby to be labelled by the primary action button if no label was provided by the
34
- // user.
35
- if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
36
- menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
37
- }
38
- return {
39
- // Props passed at the top-level
40
- disabled,
41
- disabledFocusable,
42
- iconPosition,
43
- components: {
44
- root: 'div',
45
- menuButton: MenuButton,
46
- primaryActionButton: Button
47
- },
48
- root: slot.always(getIntrinsicElementProps('div', {
49
- ref,
50
- ...props
51
- }), {
52
- elementType: 'div'
53
- }),
54
- menuButton: menuButtonShorthand,
55
- primaryActionButton: primaryActionButtonShorthand
56
- };
57
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/SplitButton/useSplitButtonBase.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonBaseProps, SplitButtonBaseState } from './SplitButton.types';\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButtonBase_unstable = (\n props: SplitButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonBaseState => {\n const {\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n } = props;\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = slot.optional(menuButton, {\n defaultProps: {\n disabled,\n disabledFocusable,\n menuIcon,\n },\n renderByDefault: true,\n elementType: MenuButton,\n });\n const primaryActionButtonShorthand = slot.optional(primaryActionButton, {\n defaultProps: {\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n },\n renderByDefault: true,\n elementType: Button,\n });\n\n // Resolve menu button's aria-labelledby to be labelled by the primary action button if no label was provided by the\n // user.\n if (\n menuButtonShorthand &&\n primaryActionButtonShorthand &&\n !menuButtonShorthand['aria-label'] &&\n !menuButtonShorthand['aria-labelledby']\n ) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n\n return {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n iconPosition,\n components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button },\n root: slot.always(getIntrinsicElementProps('div', { ref, ...props }), { elementType: 'div' }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"],"names":["React","getIntrinsicElementProps","useId","slot","Button","MenuButton","useSplitButtonBase_unstable","props","ref","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","baseId","menuButtonShorthand","optional","defaultProps","renderByDefault","elementType","primaryActionButtonShorthand","id","components","root","always"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAClF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,2BAA2B;AAGtD;;;;CAIC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EACJC,QAAQ,EACRC,WAAW,KAAK,EAChBC,oBAAoB,KAAK,EACzBC,IAAI,EACJC,eAAe,QAAQ,EACvBC,UAAU,EACVC,QAAQ,EACRC,mBAAmB,EACpB,GAAGT;IACJ,MAAMU,SAASf,MAAM;IAErB,MAAMgB,sBAAsBf,KAAKgB,QAAQ,CAACL,YAAY;QACpDM,cAAc;YACZV;YACAC;YACAI;QACF;QACAM,iBAAiB;QACjBC,aAAajB;IACf;IACA,MAAMkB,+BAA+BpB,KAAKgB,QAAQ,CAACH,qBAAqB;QACtEI,cAAc;YACZX;YACAC;YACAC;YACAC;YACAC;YACAW,IAAIP,SAAS;QACf;QACAI,iBAAiB;QACjBC,aAAalB;IACf;IAEA,oHAAoH;IACpH,QAAQ;IACR,IACEc,uBACAK,gCACA,CAACL,mBAAmB,CAAC,aAAa,IAClC,CAACA,mBAAmB,CAAC,kBAAkB,EACvC;QACAA,mBAAmB,CAAC,kBAAkB,GAAGK,6BAA6BC,EAAE;IAC1E;IAEA,OAAO;QACL,gCAAgC;QAChCd;QACAC;QACAE;QACAY,YAAY;YAAEC,MAAM;YAAOZ,YAAYT;YAAYW,qBAAqBZ;QAAO;QAC/EsB,MAAMvB,KAAKwB,MAAM,CAAC1B,yBAAyB,OAAO;YAAEO;YAAK,GAAGD,KAAK;QAAC,IAAI;YAAEe,aAAa;QAAM;QAC3FR,YAAYI;QACZF,qBAAqBO;IACvB;AACF,EAAE"}
@@ -1,13 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { useToggleState } from '../../utils/useToggleState';
4
- import { useButtonBase_unstable } from '../Button/index';
5
- /**
6
- * Given user props, defines base props (including behavioral and structural ones) for the ToggleButton returns
7
- * processed state.
8
- * @param props - User provided props to the ToggleButton component.
9
- * @param ref - User provided ref to be passed to the ToggleButton component.
10
- */ export const useToggleButtonBase_unstable = (props, ref)=>{
11
- const buttonState = useButtonBase_unstable(props, ref);
12
- return useToggleState(props, buttonState);
13
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ToggleButton/useToggleButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { ToggleButtonBaseProps, ToggleButtonBaseState } from './ToggleButton.types';\n\n/**\n * Given user props, defines base props (including behavioral and structural ones) for the ToggleButton 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 useToggleButtonBase_unstable = (\n props: ToggleButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonBaseState => {\n const buttonState = useButtonBase_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"names":["React","useToggleState","useButtonBase_unstable","useToggleButtonBase_unstable","props","ref","buttonState"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAAQ,6BAA6B;AAC5D,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD;;;;;CAKC,GACD,OAAO,MAAMC,+BAA+B,CAC1CC,OACAC;IAEA,MAAMC,cAAcJ,uBAAuBE,OAAOC;IAElD,OAAOJ,eAAeG,OAAOE;AAC/B,EAAE"}
@@ -1,41 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useButtonBase_unstable", {
7
- enumerable: true,
8
- get: function() {
9
- return useButtonBase_unstable;
10
- }
11
- });
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _reactaria = require("@fluentui/react-aria");
15
- const _reactutilities = require("@fluentui/react-utilities");
16
- const useButtonBase_unstable = (props, ref)=>{
17
- const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;
18
- const iconShorthand = _reactutilities.slot.optional(icon, {
19
- elementType: 'span'
20
- });
21
- return {
22
- // Props passed at the top-level
23
- disabled,
24
- disabledFocusable,
25
- iconPosition,
26
- iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
27
- // Slots definition
28
- components: {
29
- root: 'button',
30
- icon: 'span'
31
- },
32
- root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)(as, (0, _reactaria.useARIAButtonProps)(props.as, props)), {
33
- elementType: 'button',
34
- defaultProps: {
35
- ref: ref,
36
- type: as === 'button' ? 'button' : undefined
37
- }
38
- }),
39
- icon: iconShorthand
40
- };
41
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Button/useButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ButtonBaseProps, ButtonBaseState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButtonBase_unstable = (\n props: ButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonBaseState => {\n const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n return {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n iconPosition,\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n // Slots definition\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: as === 'button' ? 'button' : undefined,\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonProps","getIntrinsicElementProps","slot","useButtonBase_unstable","props","ref","as","disabled","disabledFocusable","icon","iconPosition","iconShorthand","optional","elementType","iconOnly","Boolean","children","components","root","always","defaultProps","type","undefined"],"mappings":"AAAA;;;;;+BAYaI;;;;;;;iEAVU,QAAQ;2BACyB,uBAAuB;gCAChC,4BAA4B;AAQpE,+BAA+B,CACpCC,OACAC;IAEA,MAAM,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAE,GAAGN;IACtG,MAAMO,gBAAgBT,oBAAAA,CAAKU,QAAQ,CAACH,MAAM;QAAEI,aAAa;IAAO;IAChE,OAAO;QACL,gCAAgC;QAChCN;QACAC;QACAE;QACAI,UAAUC,QAAQJ,CAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeK,QAAAA,AAAQ,KAAI,CAACZ,MAAMY,QAAQ;QAC5D,mBAAmB;QACnBC,YAAY;YAAEC,MAAM;YAAUT,MAAM;QAAO;QAC3CS,MAAMhB,oBAAAA,CAAKiB,MAAM,CAA2BlB,4CAAAA,EAAyBK,QAAIN,6BAAAA,EAAmBI,MAAME,EAAE,EAAEF,SAAS;YAC7GS,aAAa;YACbO,cAAc;gBACZf,KAAKA;gBACLgB,MAAMf,OAAO,WAAW,WAAWgB;YACrC;QACF;QACAb,MAAME;IACR;AACF,EAAE"}
@@ -1,38 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useCompoundButtonBase_unstable", {
7
- enumerable: true,
8
- get: function() {
9
- return useCompoundButtonBase_unstable;
10
- }
11
- });
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _reactutilities = require("@fluentui/react-utilities");
15
- const _index = require("../Button/index");
16
- const useCompoundButtonBase_unstable = ({ contentContainer, secondaryContent, ...props }, ref)=>{
17
- var _state_icon, _state_secondaryContent;
18
- const state = {
19
- // Button state
20
- ...(0, _index.useButtonBase_unstable)(props, ref),
21
- // Slots definition
22
- components: {
23
- root: 'button',
24
- icon: 'span',
25
- contentContainer: 'span',
26
- secondaryContent: 'span'
27
- },
28
- contentContainer: _reactutilities.slot.always(contentContainer, {
29
- elementType: 'span'
30
- }),
31
- secondaryContent: _reactutilities.slot.optional(secondaryContent, {
32
- elementType: 'span'
33
- })
34
- };
35
- // Recalculate iconOnly to take into account secondaryContent.
36
- state.iconOnly = Boolean(((_state_icon = state.icon) === null || _state_icon === void 0 ? void 0 : _state_icon.children) && !props.children && !((_state_secondaryContent = state.secondaryContent) === null || _state_secondaryContent === void 0 ? void 0 : _state_secondaryContent.children));
37
- return state;
38
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { CompoundButtonBaseProps, CompoundButtonBaseState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButtonBase_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonBaseState => {\n const state: CompoundButtonBaseState = {\n // Button state\n ...useButtonBase_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: slot.always(contentContainer, { elementType: 'span' }),\n secondaryContent: slot.optional(secondaryContent, { elementType: 'span' }),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"names":["React","slot","useButtonBase_unstable","useCompoundButtonBase_unstable","contentContainer","secondaryContent","props","ref","state","components","root","icon","always","elementType","optional","iconOnly","Boolean","children"],"mappings":"AAAA;;;;;+BAYaG;;;;;;;iEAVU,QAAQ;gCACV,4BAA4B;uBACV,kBAAkB;AAQlD,uCAAuC,CAC5C,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAE,GAAGC,OAAgC,EACzEC;QAkByBC,aAA4CA;IAhBrE,MAAMA,QAAiC;QACrC,eAAe;QACf,OAAGN,6BAAAA,EAAuBI,OAAOC,IAAI;QAErC,mBAAmB;QACnBE,YAAY;YACVC,MAAM;YACNC,MAAM;YACNP,kBAAkB;YAClBC,kBAAkB;QACpB;QACAD,kBAAkBH,oBAAAA,CAAKW,MAAM,CAACR,kBAAkB;YAAES,aAAa;QAAO;QACtER,kBAAkBJ,oBAAAA,CAAKa,QAAQ,CAACT,kBAAkB;YAAEQ,aAAa;QAAO;IAC1E;IAEA,8DAA8D;IAC9DL,MAAMO,QAAQ,GAAGC,QAAQR,CAAAA,CAAAA,cAAAA,MAAMG,IAAAA,AAAI,MAAA,QAAVH,gBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,YAAYS,QAAAA,AAAQ,KAAI,CAACX,MAAMW,QAAQ,IAAI,CAAA,CAAA,CAACT,0BAAAA,MAAMH,gBAAAA,AAAgB,MAAA,QAAtBG,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAwBS,QAAAA,AAAQ;IAErG,OAAOT;AACT,EAAE"}
@@ -1,36 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useMenuButtonBase_unstable", {
7
- enumerable: true,
8
- get: function() {
9
- return useMenuButtonBase_unstable;
10
- }
11
- });
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _reactutilities = require("@fluentui/react-utilities");
15
- const _index = require("../Button/index");
16
- const useMenuButtonBase_unstable = ({ menuIcon, ...props }, ref)=>{
17
- 'use no memo';
18
- const buttonState = (0, _index.useButtonBase_unstable)(props, ref);
19
- // force aria-expanded to be a boolean, not a string
20
- buttonState.root['aria-expanded'] = props['aria-expanded'] ? props['aria-expanded'] === 'true' || props['aria-expanded'] === true : false;
21
- return {
22
- ...buttonState,
23
- // State calculated from a set of props
24
- iconOnly: Boolean(!props.children),
25
- // Slots definition
26
- components: {
27
- root: 'button',
28
- icon: 'span',
29
- menuIcon: 'span'
30
- },
31
- menuIcon: _reactutilities.slot.optional(menuIcon, {
32
- elementType: 'span',
33
- renderByDefault: true
34
- })
35
- };
36
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/MenuButton/useMenuButtonBase.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { MenuButtonBaseProps, MenuButtonBaseState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButtonBase_unstable = (\n { menuIcon, ...props }: MenuButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonBaseState => {\n 'use no memo';\n\n const buttonState = useButtonBase_unstable(props, ref);\n // force aria-expanded to be a boolean, not a string\n buttonState.root['aria-expanded'] = props['aria-expanded']\n ? props['aria-expanded'] === 'true' || props['aria-expanded'] === true\n : false;\n\n return {\n ...buttonState,\n\n // State calculated from a set of props\n iconOnly: Boolean(!props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n menuIcon: 'span',\n },\n\n menuIcon: slot.optional(menuIcon, {\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["React","slot","useButtonBase_unstable","useMenuButtonBase_unstable","menuIcon","props","ref","buttonState","root","iconOnly","Boolean","children","components","icon","optional","elementType","renderByDefault"],"mappings":"AAAA;;;;;+BAUaG;;;;;;;iEARU,QAAQ;gCACV,4BAA4B;uBACV,kBAAkB;AAMlD,mCAAmC,CACxC,EAAEC,QAAQ,EAAE,GAAGC,OAA4B,EAC3CC;IAEA;IAEA,MAAMC,kBAAcL,6BAAAA,EAAuBG,OAAOC;IAClD,oDAAoD;IACpDC,YAAYC,IAAI,CAAC,gBAAgB,GAAGH,KAAK,CAAC,gBAAgB,GACtDA,KAAK,CAAC,gBAAgB,KAAK,UAAUA,KAAK,CAAC,gBAAgB,KAAK,OAChE;IAEJ,OAAO;QACL,GAAGE,WAAW;QAEd,uCAAuC;QACvCE,UAAUC,QAAQ,CAACL,MAAMM,QAAQ;QAEjC,mBAAmB;QACnBC,YAAY;YACVJ,MAAM;YACNK,MAAM;YACNT,UAAU;QACZ;QAEAA,UAAUH,oBAAAA,CAAKa,QAAQ,CAACV,UAAU;YAChCW,aAAa;YACbC,iBAAiB;QACnB;IACF;AACF,EAAE"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useSplitButtonBase_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return useSplitButtonBase_unstable;
9
- }
10
- });
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");
14
- const _Button = require("../Button/Button");
15
- const _MenuButton = require("../MenuButton/MenuButton");
16
- const useSplitButtonBase_unstable = (props, ref)=>{
17
- const { children, disabled = false, disabledFocusable = false, icon, iconPosition = 'before', menuButton, menuIcon, primaryActionButton } = props;
18
- const baseId = (0, _reactutilities.useId)('splitButton-');
19
- const menuButtonShorthand = _reactutilities.slot.optional(menuButton, {
20
- defaultProps: {
21
- disabled,
22
- disabledFocusable,
23
- menuIcon
24
- },
25
- renderByDefault: true,
26
- elementType: _MenuButton.MenuButton
27
- });
28
- const primaryActionButtonShorthand = _reactutilities.slot.optional(primaryActionButton, {
29
- defaultProps: {
30
- children,
31
- disabled,
32
- disabledFocusable,
33
- icon,
34
- iconPosition,
35
- id: baseId + '__primaryActionButton'
36
- },
37
- renderByDefault: true,
38
- elementType: _Button.Button
39
- });
40
- // Resolve menu button's aria-labelledby to be labelled by the primary action button if no label was provided by the
41
- // user.
42
- if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
43
- menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
44
- }
45
- return {
46
- // Props passed at the top-level
47
- disabled,
48
- disabledFocusable,
49
- iconPosition,
50
- components: {
51
- root: 'div',
52
- menuButton: _MenuButton.MenuButton,
53
- primaryActionButton: _Button.Button
54
- },
55
- root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
56
- ref,
57
- ...props
58
- }), {
59
- elementType: 'div'
60
- }),
61
- menuButton: menuButtonShorthand,
62
- primaryActionButton: primaryActionButtonShorthand
63
- };
64
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/SplitButton/useSplitButtonBase.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonBaseProps, SplitButtonBaseState } from './SplitButton.types';\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButtonBase_unstable = (\n props: SplitButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonBaseState => {\n const {\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n } = props;\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = slot.optional(menuButton, {\n defaultProps: {\n disabled,\n disabledFocusable,\n menuIcon,\n },\n renderByDefault: true,\n elementType: MenuButton,\n });\n const primaryActionButtonShorthand = slot.optional(primaryActionButton, {\n defaultProps: {\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n },\n renderByDefault: true,\n elementType: Button,\n });\n\n // Resolve menu button's aria-labelledby to be labelled by the primary action button if no label was provided by the\n // user.\n if (\n menuButtonShorthand &&\n primaryActionButtonShorthand &&\n !menuButtonShorthand['aria-label'] &&\n !menuButtonShorthand['aria-labelledby']\n ) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n\n return {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n iconPosition,\n components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button },\n root: slot.always(getIntrinsicElementProps('div', { ref, ...props }), { elementType: 'div' }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"],"names":["React","getIntrinsicElementProps","useId","slot","Button","MenuButton","useSplitButtonBase_unstable","props","ref","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","baseId","menuButtonShorthand","optional","defaultProps","renderByDefault","elementType","primaryActionButtonShorthand","id","components","root","always"],"mappings":";;;;+BAWaM;;;;;;;iEAXU,QAAQ;gCACuB,4BAA4B;wBAC3D,mBAAmB;4BACf,2BAA2B;AAQ/C,oCAAoC,CACzCC,OACAC;IAEA,MAAM,EACJC,QAAQ,EACRC,WAAW,KAAK,EAChBC,oBAAoB,KAAK,EACzBC,IAAI,EACJC,eAAe,QAAQ,EACvBC,UAAU,EACVC,QAAQ,EACRC,mBAAmB,EACpB,GAAGT;IACJ,MAAMU,aAASf,qBAAAA,EAAM;IAErB,MAAMgB,sBAAsBf,oBAAAA,CAAKgB,QAAQ,CAACL,YAAY;QACpDM,cAAc;YACZV;YACAC;YACAI;QACF;QACAM,iBAAiB;QACjBC,aAAajB,sBAAAA;IACf;IACA,MAAMkB,+BAA+BpB,oBAAAA,CAAKgB,QAAQ,CAACH,qBAAqB;QACtEI,cAAc;YACZX;YACAC;YACAC;YACAC;YACAC;YACAW,IAAIP,SAAS;QACf;QACAI,iBAAiB;QACjBC,aAAalB,cAAAA;IACf;IAEA,oHAAoH;IACpH,QAAQ;IACR,IACEc,uBACAK,gCACA,CAACL,mBAAmB,CAAC,aAAa,IAClC,CAACA,mBAAmB,CAAC,kBAAkB,EACvC;QACAA,mBAAmB,CAAC,kBAAkB,GAAGK,6BAA6BC,EAAE;IAC1E;IAEA,OAAO;QACL,gCAAgC;QAChCd;QACAC;QACAE;QACAY,YAAY;YAAEC,MAAM;YAAOZ,YAAYT,sBAAAA;YAAYW,qBAAqBZ,cAAAA;QAAO;QAC/EsB,MAAMvB,oBAAAA,CAAKwB,MAAM,KAAC1B,wCAAAA,EAAyB,OAAO;YAAEO;YAAK,GAAGD,KAAK;QAAC,IAAI;YAAEe,aAAa;QAAM;QAC3FR,YAAYI;QACZF,qBAAqBO;IACvB;AACF,EAAE"}
@@ -1,19 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useToggleButtonBase_unstable", {
7
- enumerable: true,
8
- get: function() {
9
- return useToggleButtonBase_unstable;
10
- }
11
- });
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _useToggleState = require("../../utils/useToggleState");
15
- const _index = require("../Button/index");
16
- const useToggleButtonBase_unstable = (props, ref)=>{
17
- const buttonState = (0, _index.useButtonBase_unstable)(props, ref);
18
- return (0, _useToggleState.useToggleState)(props, buttonState);
19
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ToggleButton/useToggleButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { ToggleButtonBaseProps, ToggleButtonBaseState } from './ToggleButton.types';\n\n/**\n * Given user props, defines base props (including behavioral and structural ones) for the ToggleButton 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 useToggleButtonBase_unstable = (\n props: ToggleButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonBaseState => {\n const buttonState = useButtonBase_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"names":["React","useToggleState","useButtonBase_unstable","useToggleButtonBase_unstable","props","ref","buttonState"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;gCACA,6BAA6B;uBACrB,kBAAkB;AASlD,MAAMG,+BAA+B,CAC1CC,OACAC;IAEA,MAAMC,kBAAcJ,6BAAAA,EAAuBE,OAAOC;IAElD,WAAOJ,8BAAAA,EAAeG,OAAOE;AAC/B,EAAE"}