@fluentui/react-button 9.3.4 → 9.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +91 -1
  3. package/CHANGELOG.md +30 -2
  4. package/lib/Button.js.map +1 -1
  5. package/lib/CompoundButton.js.map +1 -1
  6. package/lib/MenuButton.js.map +1 -1
  7. package/lib/SplitButton.js.map +1 -1
  8. package/lib/ToggleButton.js.map +1 -1
  9. package/lib/components/Button/Button.js.map +1 -1
  10. package/lib/components/Button/Button.types.js.map +1 -1
  11. package/lib/components/Button/index.js.map +1 -1
  12. package/lib/components/Button/renderButton.js +1 -7
  13. package/lib/components/Button/renderButton.js.map +1 -1
  14. package/lib/components/Button/useButton.js +1 -0
  15. package/lib/components/Button/useButton.js.map +1 -1
  16. package/lib/components/Button/useButtonStyles.js.map +1 -1
  17. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  18. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  19. package/lib/components/CompoundButton/index.js.map +1 -1
  20. package/lib/components/CompoundButton/renderCompoundButton.js +1 -11
  21. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  22. package/lib/components/CompoundButton/useCompoundButton.js +3 -2
  23. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  24. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  25. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  26. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  27. package/lib/components/MenuButton/index.js.map +1 -1
  28. package/lib/components/MenuButton/renderMenuButton.js +1 -7
  29. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  30. package/lib/components/MenuButton/useMenuButton.js +2 -2
  31. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  32. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  33. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  34. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  35. package/lib/components/SplitButton/index.js.map +1 -1
  36. package/lib/components/SplitButton/renderSplitButton.js +1 -7
  37. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  38. package/lib/components/SplitButton/useSplitButton.js +1 -0
  39. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  40. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  41. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  42. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  43. package/lib/components/ToggleButton/index.js.map +1 -1
  44. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  45. package/lib/components/ToggleButton/useToggleButton.js +1 -0
  46. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  47. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  48. package/lib/contexts/ButtonContext.js +2 -4
  49. package/lib/contexts/ButtonContext.js.map +1 -1
  50. package/lib/contexts/index.js.map +1 -1
  51. package/lib/index.js.map +1 -1
  52. package/lib/utils/index.js.map +1 -1
  53. package/lib/utils/useToggleState.js.map +1 -1
  54. package/lib-commonjs/Button.js +5 -4
  55. package/lib-commonjs/Button.js.map +1 -1
  56. package/lib-commonjs/CompoundButton.js +5 -4
  57. package/lib-commonjs/CompoundButton.js.map +1 -1
  58. package/lib-commonjs/MenuButton.js +5 -4
  59. package/lib-commonjs/MenuButton.js.map +1 -1
  60. package/lib-commonjs/SplitButton.js +5 -4
  61. package/lib-commonjs/SplitButton.js.map +1 -1
  62. package/lib-commonjs/ToggleButton.js +5 -4
  63. package/lib-commonjs/ToggleButton.js.map +1 -1
  64. package/lib-commonjs/components/Button/Button.js +19 -21
  65. package/lib-commonjs/components/Button/Button.js.map +1 -1
  66. package/lib-commonjs/components/Button/Button.types.js +3 -2
  67. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  68. package/lib-commonjs/components/Button/index.js +17 -19
  69. package/lib-commonjs/components/Button/index.js.map +1 -1
  70. package/lib-commonjs/components/Button/renderButton.js +14 -26
  71. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  72. package/lib-commonjs/components/Button/useButton.js +40 -52
  73. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  74. package/lib-commonjs/components/Button/useButtonStyles.js +1129 -471
  75. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  76. package/lib-commonjs/components/CompoundButton/CompoundButton.js +19 -21
  77. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  78. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +3 -2
  79. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  80. package/lib-commonjs/components/CompoundButton/index.js +18 -20
  81. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  82. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +14 -30
  83. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  84. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +31 -36
  85. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  86. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +315 -184
  87. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  88. package/lib-commonjs/components/MenuButton/MenuButton.js +19 -22
  89. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  90. package/lib-commonjs/components/MenuButton/MenuButton.types.js +3 -2
  91. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  92. package/lib-commonjs/components/MenuButton/index.js +18 -20
  93. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  94. package/lib-commonjs/components/MenuButton/renderMenuButton.js +14 -26
  95. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  96. package/lib-commonjs/components/MenuButton/useMenuButton.js +34 -37
  97. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  98. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +166 -106
  99. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  100. package/lib-commonjs/components/SplitButton/SplitButton.js +19 -22
  101. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  102. package/lib-commonjs/components/SplitButton/SplitButton.types.js +3 -2
  103. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  104. package/lib-commonjs/components/SplitButton/index.js +18 -20
  105. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  106. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -22
  107. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  108. package/lib-commonjs/components/SplitButton/useSplitButton.js +66 -79
  109. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  110. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +263 -106
  111. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  112. package/lib-commonjs/components/ToggleButton/ToggleButton.js +19 -21
  113. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  114. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +3 -2
  115. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  116. package/lib-commonjs/components/ToggleButton/index.js +18 -20
  117. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  118. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +6 -8
  119. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  120. package/lib-commonjs/components/ToggleButton/useToggleButton.js +14 -16
  121. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  122. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +897 -380
  123. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  124. package/lib-commonjs/contexts/ButtonContext.js +18 -19
  125. package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
  126. package/lib-commonjs/contexts/index.js +5 -4
  127. package/lib-commonjs/contexts/index.js.map +1 -1
  128. package/lib-commonjs/index.js +47 -179
  129. package/lib-commonjs/index.js.map +1 -1
  130. package/lib-commonjs/utils/index.js +5 -4
  131. package/lib-commonjs/utils/index.js.map +1 -1
  132. package/lib-commonjs/utils/useToggleState.js +40 -40
  133. package/lib-commonjs/utils/useToggleState.js.map +1 -1
  134. package/package.json +12 -11
  135. package/lib-amd/Button.js +0 -6
  136. package/lib-amd/Button.js.map +0 -1
  137. package/lib-amd/CompoundButton.js +0 -6
  138. package/lib-amd/CompoundButton.js.map +0 -1
  139. package/lib-amd/MenuButton.js +0 -6
  140. package/lib-amd/MenuButton.js.map +0 -1
  141. package/lib-amd/SplitButton.js +0 -6
  142. package/lib-amd/SplitButton.js.map +0 -1
  143. package/lib-amd/ToggleButton.js +0 -6
  144. package/lib-amd/ToggleButton.js.map +0 -1
  145. package/lib-amd/components/Button/Button.js +0 -18
  146. package/lib-amd/components/Button/Button.js.map +0 -1
  147. package/lib-amd/components/Button/Button.types.js +0 -5
  148. package/lib-amd/components/Button/Button.types.js.map +0 -1
  149. package/lib-amd/components/Button/index.js +0 -11
  150. package/lib-amd/components/Button/index.js.map +0 -1
  151. package/lib-amd/components/Button/renderButton.js +0 -18
  152. package/lib-amd/components/Button/renderButton.js.map +0 -1
  153. package/lib-amd/components/Button/useButton.js +0 -41
  154. package/lib-amd/components/Button/useButton.js.map +0 -1
  155. package/lib-amd/components/Button/useButtonStyles.js +0 -227
  156. package/lib-amd/components/Button/useButtonStyles.js.map +0 -1
  157. package/lib-amd/components/CompoundButton/CompoundButton.js +0 -18
  158. package/lib-amd/components/CompoundButton/CompoundButton.js.map +0 -1
  159. package/lib-amd/components/CompoundButton/CompoundButton.types.js +0 -5
  160. package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +0 -1
  161. package/lib-amd/components/CompoundButton/index.js +0 -12
  162. package/lib-amd/components/CompoundButton/index.js.map +0 -1
  163. package/lib-amd/components/CompoundButton/renderCompoundButton.js +0 -20
  164. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +0 -1
  165. package/lib-amd/components/CompoundButton/useCompoundButton.js +0 -27
  166. package/lib-amd/components/CompoundButton/useCompoundButton.js.map +0 -1
  167. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js +0 -216
  168. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +0 -1
  169. package/lib-amd/components/MenuButton/MenuButton.js +0 -19
  170. package/lib-amd/components/MenuButton/MenuButton.js.map +0 -1
  171. package/lib-amd/components/MenuButton/MenuButton.types.js +0 -5
  172. package/lib-amd/components/MenuButton/MenuButton.types.js.map +0 -1
  173. package/lib-amd/components/MenuButton/index.js +0 -12
  174. package/lib-amd/components/MenuButton/index.js.map +0 -1
  175. package/lib-amd/components/MenuButton/renderMenuButton.js +0 -18
  176. package/lib-amd/components/MenuButton/renderMenuButton.js.map +0 -1
  177. package/lib-amd/components/MenuButton/useMenuButton.js +0 -30
  178. package/lib-amd/components/MenuButton/useMenuButton.js.map +0 -1
  179. package/lib-amd/components/MenuButton/useMenuButtonStyles.js +0 -97
  180. package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +0 -1
  181. package/lib-amd/components/SplitButton/SplitButton.js +0 -19
  182. package/lib-amd/components/SplitButton/SplitButton.js.map +0 -1
  183. package/lib-amd/components/SplitButton/SplitButton.types.js +0 -5
  184. package/lib-amd/components/SplitButton/SplitButton.types.js.map +0 -1
  185. package/lib-amd/components/SplitButton/index.js +0 -12
  186. package/lib-amd/components/SplitButton/index.js.map +0 -1
  187. package/lib-amd/components/SplitButton/renderSplitButton.js +0 -16
  188. package/lib-amd/components/SplitButton/renderSplitButton.js.map +0 -1
  189. package/lib-amd/components/SplitButton/useSplitButton.js +0 -67
  190. package/lib-amd/components/SplitButton/useSplitButton.js.map +0 -1
  191. package/lib-amd/components/SplitButton/useSplitButtonStyles.js +0 -162
  192. package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +0 -1
  193. package/lib-amd/components/ToggleButton/ToggleButton.js +0 -18
  194. package/lib-amd/components/ToggleButton/ToggleButton.js.map +0 -1
  195. package/lib-amd/components/ToggleButton/ToggleButton.types.js +0 -5
  196. package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +0 -1
  197. package/lib-amd/components/ToggleButton/index.js +0 -12
  198. package/lib-amd/components/ToggleButton/index.js.map +0 -1
  199. package/lib-amd/components/ToggleButton/renderToggleButton.js +0 -7
  200. package/lib-amd/components/ToggleButton/renderToggleButton.js.map +0 -1
  201. package/lib-amd/components/ToggleButton/useToggleButton.js +0 -17
  202. package/lib-amd/components/ToggleButton/useToggleButton.js.map +0 -1
  203. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js +0 -87
  204. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +0 -1
  205. package/lib-amd/contexts/ButtonContext.js +0 -19
  206. package/lib-amd/contexts/ButtonContext.js.map +0 -1
  207. package/lib-amd/contexts/index.js +0 -6
  208. package/lib-amd/contexts/index.js.map +0 -1
  209. package/lib-amd/index.js +0 -34
  210. package/lib-amd/index.js.map +0 -1
  211. package/lib-amd/utils/index.js +0 -6
  212. package/lib-amd/utils/index.js.map +0 -1
  213. package/lib-amd/utils/useToggleState.js +0 -27
  214. package/lib-amd/utils/useToggleState.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"sources":["../src/packages/react-components/react-button/src/utils/useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n ev => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAIlG,OAAM,SAAUC,cAAcA,CAI5BC,KAAyB,EAAEC,KAAmB;EAC9C,MAAM;IAAEC,OAAO;IAAEC,cAAc;IAAEC,QAAQ;IAAEC;EAAiB,CAAE,GAAGL,KAAK;EACtE,MAAM;IAAEM,OAAO;IAAEC;EAAI,CAAE,GAAGN,KAAK,CAACO,IAAI;EAEpC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGb,oBAAoB,CAAC;IAC3DI,KAAK,EAAEC,OAAO;IACdS,YAAY,EAAER,cAAc;IAC5BS,YAAY,EAAE;GACf,CAAC;EAEF,MAAMC,kBAAkB,GAAGN,IAAI,KAAK,kBAAkB,IAAIA,IAAI,KAAK,UAAU;EAE7E,MAAMO,aAAa,GAAGnB,KAAK,CAACoB,WAAW,CACrCC,EAAE,IAAG;IACH,IAAI,CAACZ,QAAQ,IAAI,CAACC,iBAAiB,EAAE;MACnC,IAAIW,EAAE,CAACC,gBAAgB,EAAE;QACvB;;MAGFP,eAAe,CAAC,CAACD,YAAY,CAAC;;EAElC,CAAC,EACD,CAACA,YAAY,EAAEL,QAAQ,EAAEC,iBAAiB,EAAEK,eAAe,CAAC,CAC7D;EAED,OAAO;IACL,GAAGT,KAAK;IAERC,OAAO,EAAEO,YAAY;IAErBD,IAAI,EAAE;MACJ,GAAGP,KAAK,CAACO,IAAI;MACb,CAACK,kBAAkB,GAAG,cAAc,GAAG,cAAc,GAAGJ,YAAY;MACpEH,OAAO,EAAER,gBAAgB,CACvBF,cAAc,CAACU,OAAyE,EAAEQ,aAAa,CAAC;;GAGvF;AACzB"}
1
+ {"version":3,"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"sources":["../../src/utils/useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n ev => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ;AAIvE,OAAO,SAASC,eAIdC,KAAyB,EAAEC,KAAmB,EAAsB;EACpE,MAAM;IAAEC,OAAA;IAASC,cAAA;IAAgBC,QAAA;IAAUC;EAAiB,CAAE,GAAGL,KAAA;EACjE,MAAM;IAAEM,OAAA;IAASC;EAAI,CAAE,GAAGN,KAAA,CAAMO,IAAI;EAEpC,MAAM,CAACC,YAAA,EAAcC,eAAA,CAAgB,GAAGb,oBAAA,CAAqB;IAC3DI,KAAA,EAAOC,OAAA;IACPS,YAAA,EAAcR,cAAA;IACdS,YAAA,EAAc;EAChB;EAEA,MAAMC,kBAAA,GAAqBN,IAAA,KAAS,sBAAsBA,IAAA,KAAS;EAEnE,MAAMO,aAAA,GAAgBnB,KAAA,CAAMoB,WAAW,CACrCC,EAAA,IAAM;IACJ,IAAI,CAACZ,QAAA,IAAY,CAACC,iBAAA,EAAmB;MACnC,IAAIW,EAAA,CAAGC,gBAAgB,EAAE;QACvB;MACF;MAEAP,eAAA,CAAgB,CAACD,YAAA;IACnB;EACF,GACA,CAACA,YAAA,EAAcL,QAAA,EAAUC,iBAAA,EAAmBK,eAAA,CAAgB;EAG9D,OAAO;IACL,GAAGT,KAAK;IAERC,OAAA,EAASO,YAAA;IAETD,IAAA,EAAM;MACJ,GAAGP,KAAA,CAAMO,IAAI;MACb,CAACK,kBAAA,GAAqB,iBAAiB,cAAc,GAAGJ,YAAA;MACxDH,OAAA,EAASR,gBAAA,CACPF,cAAA,CAAeU,OAAA,EAA2EQ,aAAA;IAE9F;EACF;AACF"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Button/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Button/index"), exports);
7
+ //# sourceMappingURL=Button.js.map
8
+
8
9
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-button/src/Button.tsx"],"sourcesContent":["export * from './components/Button/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,+BAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Button.js"],"sourcesContent":["export * from './components/Button/index';\n//# sourceMappingURL=Button.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,kCAAkC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/CompoundButton/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/CompoundButton/index"), exports);
7
+ //# sourceMappingURL=CompoundButton.js.map
8
+
8
9
  //# sourceMappingURL=CompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-button/src/CompoundButton.ts"],"sourcesContent":["export * from './components/CompoundButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,uCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/CompoundButton.js"],"sourcesContent":["export * from './components/CompoundButton/index';\n//# sourceMappingURL=CompoundButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,0CAA0C"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/MenuButton/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/MenuButton/index"), exports);
7
+ //# sourceMappingURL=MenuButton.js.map
8
+
8
9
  //# sourceMappingURL=MenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-button/src/MenuButton.ts"],"sourcesContent":["export * from './components/MenuButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/MenuButton.js"],"sourcesContent":["export * from './components/MenuButton/index';\n//# sourceMappingURL=MenuButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/SplitButton/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/SplitButton/index"), exports);
7
+ //# sourceMappingURL=SplitButton.js.map
8
+
8
9
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-button/src/SplitButton.ts"],"sourcesContent":["export * from './components/SplitButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,oCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/SplitButton.js"],"sourcesContent":["export * from './components/SplitButton/index';\n//# sourceMappingURL=SplitButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,uCAAuC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/ToggleButton/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/ToggleButton/index"), exports);
7
+ //# sourceMappingURL=ToggleButton.js.map
8
+
8
9
  //# sourceMappingURL=ToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-button/src/ToggleButton.ts"],"sourcesContent":["export * from './components/ToggleButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,qCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/ToggleButton.js"],"sourcesContent":["export * from './components/ToggleButton/index';\n//# sourceMappingURL=ToggleButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,wCAAwC"}
@@ -1,27 +1,25 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Button", {
6
+ enumerable: true,
7
+ get: ()=>Button
5
8
  });
6
- exports.Button = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const renderButton_1 = /*#__PURE__*/require("./renderButton");
9
- const useButton_1 = /*#__PURE__*/require("./useButton");
10
- const useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- /**
13
- * Buttons give people a way to trigger an action.
14
- */
15
- exports.Button = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = useButton_1.useButton_unstable(props, ref);
17
- useButtonStyles_1.useButtonStyles_unstable(state);
18
- const {
19
- useButtonStyles_unstable: useCustomStyles
20
- } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
- useCustomStyles(state);
22
- return renderButton_1.renderButton_unstable(state);
23
- // Casting is required due to lack of distributive union to support unions on @types/react
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _renderButton = require("./renderButton");
12
+ const _useButton = require("./useButton");
13
+ const _useButtonStyles = require("./useButtonStyles");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const Button = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
+ const state = (0, _useButton.useButton_unstable)(props, ref);
17
+ (0, _useButtonStyles.useButtonStyles_unstable)(state);
18
+ const { useButtonStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
19
+ useCustomStyles(state);
20
+ return (0, _renderButton.renderButton_unstable)(state);
21
+ // Casting is required due to lack of distributive union to support unions on @types/react
24
22
  });
23
+ Button.displayName = 'Button'; //# sourceMappingURL=Button.js.map
25
24
 
26
- exports.Button.displayName = 'Button';
27
25
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","renderButton_1","useButton_1","useButtonStyles_1","react_shared_contexts_1","exports","Button","forwardRef","props","ref","state","useButton_unstable","useButtonStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderButton_unstable","displayName"],"sources":["../src/packages/react-components/react-button/src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n const { useButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,cAAA,gBAAAD,OAAA;AACA,MAAAE,WAAA,gBAAAF,OAAA;AACA,MAAAG,iBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,MAAM,gBAAqCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACtF,MAAMC,KAAK,GAAGR,WAAA,CAAAS,kBAAkB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE5CN,iBAAA,CAAAS,wBAAwB,CAACF,KAAK,CAAC;EAE/B,MAAM;IAAEE,wBAAwB,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACpFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOT,cAAA,CAAAc,qBAAqB,CAACL,KAAK,CAAC;EACnC;AACF,CAAC,CAAqC;;AAEtCL,OAAA,CAAAC,MAAM,CAACU,WAAW,GAAG,QAAQ"}
1
+ {"version":3,"sources":["../../../lib/components/Button/Button.js"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n useButtonStyles_unstable(state);\n const {\n useButtonStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n});\n\nButton.displayName = 'Button';\n//# sourceMappingURL=Button.js.map"],"names":["Button","React","forwardRef","props","ref","state","useButton_unstable","useButtonStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderButton_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;8BACe;2BACH;iCACM;qCACI;AAItC,MAAMA,SAAS,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAClE,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,yCAAwB,EAACF;IACzB,MAAM,EACJE,0BAA0BC,gBAAe,EAC1C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,mCAAqB,EAACL;AAC7B,0FAA0F;AAC5F;AAEAL,OAAOW,WAAW,GAAG,UACrB,kCAAkC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ //# sourceMappingURL=Button.types.js.map
6
+
6
7
  //# sourceMappingURL=Button.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-button/src/components/Button/Button.types.ts"],"sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * A button supports different sizes.\n */\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: ButtonSize;\n};\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Button/Button.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Button.types.js.map"],"names":[],"mappings":";;;;CACA,wCAAwC"}
@@ -1,24 +1,22 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useButtonStyles_unstable = exports.buttonClassNames = void 0;
7
- const tslib_1 = /*#__PURE__*/require("tslib");
8
- tslib_1.__exportStar(require("./Button"), exports);
9
- tslib_1.__exportStar(require("./renderButton"), exports);
10
- tslib_1.__exportStar(require("./useButton"), exports);
11
- var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
12
- Object.defineProperty(exports, "buttonClassNames", {
13
- enumerable: true,
14
- get: function () {
15
- return useButtonStyles_1.buttonClassNames;
16
- }
3
+ value: true
17
4
  });
18
- Object.defineProperty(exports, "useButtonStyles_unstable", {
19
- enumerable: true,
20
- get: function () {
21
- return useButtonStyles_1.useButtonStyles_unstable;
22
- }
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ buttonClassNames: ()=>_useButtonStyles.buttonClassNames,
13
+ useButtonStyles_unstable: ()=>_useButtonStyles.useButtonStyles_unstable
23
14
  });
15
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
16
+ _exportStar(require("./Button"), exports);
17
+ _exportStar(require("./renderButton"), exports);
18
+ _exportStar(require("./useButton"), exports);
19
+ const _useButtonStyles = require("./useButtonStyles");
20
+ //# sourceMappingURL=index.js.map
21
+
24
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports","useButtonStyles_1","Object","defineProperty","enumerable","get","buttonClassNames","useButtonStyles_unstable"],"sources":["../src/packages/react-components/react-button/src/components/Button/index.ts"],"sourcesContent":["export * from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n"],"mappings":";;;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,cAAAC,OAAA;AAGAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,iBAAAC,OAAA;AACA,IAAAC,iBAAA,gBAAAF,OAAA;AAASG,MAAA,CAAAC,cAAA,CAAAH,OAAA;EAAAI,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAJ,iBAAA,CAAAK,gBAAgB;EAAA;AAAA;AAAEJ,MAAA,CAAAC,cAAA,CAAAH,OAAA;EAAAI,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAJ,iBAAA,CAAAM,wBAAwB;EAAA;AAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Button/index.js"],"sourcesContent":["export * from './Button';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":["buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAGSA,gBAAgB,MAAhBA,iCAAgB;IAAEC,wBAAwB,MAAxBA,yCAAwB;;;oBAHrC;oBACA;oBACA;iCAC6C;CAC3D,iCAAiC"}
@@ -1,30 +1,18 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderButton_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderButton_unstable
5
8
  });
6
- exports.renderButton_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Renders a Button component by passing the state defined props to the appropriate slots.
11
- */
12
- const renderButton_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- const {
18
- iconOnly,
19
- iconPosition
20
- } = state;
21
- return React.createElement(slots.root, {
22
- ...slotProps.root
23
- }, iconPosition !== 'after' && slots.icon && React.createElement(slots.icon, {
24
- ...slotProps.icon
25
- }), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && React.createElement(slots.icon, {
26
- ...slotProps.icon
27
- }));
28
- };
29
- exports.renderButton_unstable = renderButton_unstable;
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");
12
+ const renderButton_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ const { iconOnly , iconPosition } = state;
15
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/ _react.createElement(slots.icon, slotProps.icon), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/ _react.createElement(slots.icon, slotProps.icon));
16
+ }; //# sourceMappingURL=renderButton.js.map
17
+
30
18
  //# sourceMappingURL=renderButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderButton_unstable","state","slots","slotProps","getSlots","iconOnly","iconPosition","createElement","root","icon","children","exports"],"sources":["../src/packages/react-components/react-button/src/components/Button/renderButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonState) => {\n const { slots, slotProps } = getSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,qBAAqB,GAAIC,KAAkB,IAAI;EAC1D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAcH,KAAK,CAAC;EACzD,MAAM;IAAEI,QAAQ;IAAEC;EAAY,CAAE,GAAGL,KAAK;EAExC,OACEJ,KAAA,CAAAU,aAAA,CAACL,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,GAC3BF,YAAY,KAAK,OAAO,IAAIJ,KAAK,CAACO,IAAI,IAAIZ,KAAA,CAAAU,aAAA,CAACL,KAAK,CAACO,IAAI;IAAA,GAAKN,SAAS,CAACM;EAAI,EAAI,EAC5E,CAACJ,QAAQ,IAAIJ,KAAK,CAACO,IAAI,CAACE,QAAQ,EAChCJ,YAAY,KAAK,OAAO,IAAIJ,KAAK,CAACO,IAAI,IAAIZ,KAAA,CAAAU,aAAA,CAACL,KAAK,CAACO,IAAI;IAAA,GAAKN,SAAS,CAACM;EAAI,EAAI,CAClE;AAEjB,CAAC;AAXYE,OAAA,CAAAX,qBAAqB,GAAAA,qBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Button/renderButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n const {\n iconOnly,\n iconPosition\n } = state;\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon));\n};\n//# sourceMappingURL=renderButton.js.map"],"names":["renderButton_unstable","state","slots","slotProps","getSlots","iconOnly","iconPosition","React","createElement","root","icon","children"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,wBAAwBC,CAAAA,QAAS;IAC5C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,MAAM,EACJI,SAAQ,EACRC,aAAY,EACb,GAAGL;IACJ,OAAO,WAAW,GAAEM,OAAMC,aAAa,CAACN,MAAMO,IAAI,EAAEN,UAAUM,IAAI,EAAEH,iBAAiB,WAAWJ,MAAMQ,IAAI,IAAI,WAAW,GAAEH,OAAMC,aAAa,CAACN,MAAMQ,IAAI,EAAEP,UAAUO,IAAI,GAAG,CAACL,YAAYJ,MAAMQ,IAAI,CAACE,QAAQ,EAAEL,iBAAiB,WAAWJ,MAAMQ,IAAI,IAAI,WAAW,GAAEH,OAAMC,aAAa,CAACN,MAAMQ,IAAI,EAAEP,UAAUO,IAAI;AACrT,GACA,wCAAwC"}
@@ -1,56 +1,44 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useButton_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useButton_unstable
5
8
  });
6
- exports.useButton_unstable = void 0;
7
- const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const ButtonContext_1 = /*#__PURE__*/require("../../contexts/ButtonContext");
10
- /**
11
- * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
12
- * @param props - User provided props to the Button component.
13
- * @param ref - User provided ref to be passed to the Button component.
14
- */
15
- const useButton_unstable = (props, ref) => {
16
- const {
17
- size: contextSize
18
- } = ButtonContext_1.useButtonContext();
19
- const {
20
- appearance = 'secondary',
21
- as = 'button',
22
- disabled = false,
23
- disabledFocusable = false,
24
- icon,
25
- iconPosition = 'before',
26
- shape = 'rounded',
27
- size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium'
28
- } = props;
29
- const iconShorthand = react_utilities_1.resolveShorthand(icon);
30
- return {
31
- // Props passed at the top-level
32
- appearance,
33
- disabled,
34
- disabledFocusable,
35
- iconPosition,
36
- shape,
37
- size,
38
- // State calculated from a set of props
39
- iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
40
- // Slots definition
41
- components: {
42
- root: 'button',
43
- icon: 'span'
44
- },
45
- root: react_utilities_1.getNativeElementProps(as, react_aria_1.useARIAButtonShorthand(props, {
46
- required: true,
47
- defaultProps: {
48
- ref: ref,
49
- type: 'button'
50
- }
51
- })),
52
- icon: iconShorthand
53
- };
54
- };
55
- exports.useButton_unstable = useButton_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactAria = require("@fluentui/react-aria");
12
+ const _reactUtilities = require("@fluentui/react-utilities");
13
+ const _buttonContext = require("../../contexts/ButtonContext");
14
+ const useButton_unstable = (props, ref)=>{
15
+ const { size: contextSize } = (0, _buttonContext.useButtonContext)();
16
+ const { appearance ='secondary' , as ='button' , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , shape ='rounded' , size =contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
17
+ const iconShorthand = (0, _reactUtilities.resolveShorthand)(icon);
18
+ return {
19
+ // Props passed at the top-level
20
+ appearance,
21
+ disabled,
22
+ disabledFocusable,
23
+ iconPosition,
24
+ shape,
25
+ size,
26
+ // State calculated from a set of props
27
+ iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
28
+ // Slots definition
29
+ components: {
30
+ root: 'button',
31
+ icon: 'span'
32
+ },
33
+ root: (0, _reactUtilities.getNativeElementProps)(as, (0, _reactAria.useARIAButtonShorthand)(props, {
34
+ required: true,
35
+ defaultProps: {
36
+ ref: ref,
37
+ type: 'button'
38
+ }
39
+ })),
40
+ icon: iconShorthand
41
+ };
42
+ }; //# sourceMappingURL=useButton.js.map
43
+
56
44
  //# sourceMappingURL=useButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_aria_1","require","react_utilities_1","ButtonContext_1","useButton_unstable","props","ref","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","resolveShorthand","iconOnly","Boolean","children","components","root","getNativeElementProps","useARIAButtonShorthand","required","defaultProps","type","exports"],"sources":["../src/packages/react-components/react-button/src/components/Button/useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ButtonProps, ButtonState } 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 useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = contextSize ?? 'medium',\n } = props;\n const iconShorthand = resolveShorthand(icon);\n\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n },\n\n root: getNativeElementProps(\n as,\n useARIAButtonShorthand<ARIAButtonSlotProps<'a'>>(props, {\n required: true,\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: 'button',\n },\n }),\n ),\n icon: iconShorthand,\n };\n};\n"],"mappings":";;;;;;AACA,MAAAA,YAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AAGA;;;;;AAKO,MAAMG,kBAAkB,GAAGA,CAChCC,KAAkB,EAClBC,GAAqD,KACtC;EACf,MAAM;IAAEC,IAAI,EAAEC;EAAW,CAAE,GAAGL,eAAA,CAAAM,gBAAgB,EAAE;EAChD,MAAM;IACJC,UAAU,GAAG,WAAW;IACxBC,EAAE,GAAG,QAAQ;IACbC,QAAQ,GAAG,KAAK;IAChBC,iBAAiB,GAAG,KAAK;IACzBC,IAAI;IACJC,YAAY,GAAG,QAAQ;IACvBC,KAAK,GAAG,SAAS;IACjBT,IAAI,GAAGC,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;EAAQ,CAC/B,GAAGH,KAAK;EACT,MAAMY,aAAa,GAAGf,iBAAA,CAAAgB,gBAAgB,CAACJ,IAAI,CAAC;EAE5C,OAAO;IACL;IACAJ,UAAU;IACVE,QAAQ;IACRC,iBAAiB;IACjBE,YAAY;IACZC,KAAK;IACLT,IAAI;IAEJ;IACAY,QAAQ,EAAEC,OAAO,CAAC,CAAAH,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEI,QAAQ,KAAI,CAAChB,KAAK,CAACgB,QAAQ,CAAC;IAE7D;IACAC,UAAU,EAAE;MACVC,IAAI,EAAE,QAAQ;MACdT,IAAI,EAAE;KACP;IAEDS,IAAI,EAAErB,iBAAA,CAAAsB,qBAAqB,CACzBb,EAAE,EACFX,YAAA,CAAAyB,sBAAsB,CAA2BpB,KAAK,EAAE;MACtDqB,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZrB,GAAG,EAAEA,GAAuD;QAC5DsB,IAAI,EAAE;;KAET,CAAC,CACH;IACDd,IAAI,EAAEG;GACP;AACH,CAAC;AA/CYY,OAAA,CAAAzB,kBAAkB,GAAAA,kBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Button/useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\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 useButton_unstable = (props, ref) => {\n const {\n size: contextSize\n } = useButtonContext();\n const {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium'\n } = props;\n const iconShorthand = resolveShorthand(icon);\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n // State calculated from a set of props\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),\n // Slots definition\n components: {\n root: 'button',\n icon: 'span'\n },\n root: getNativeElementProps(as, useARIAButtonShorthand(props, {\n required: true,\n defaultProps: {\n ref: ref,\n type: 'button'\n }\n })),\n icon: iconShorthand\n };\n};\n//# sourceMappingURL=useButton.js.map"],"names":["useButton_unstable","props","ref","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","resolveShorthand","iconOnly","Boolean","children","components","root","getNativeElementProps","useARIAButtonShorthand","required","defaultProps","type"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;2BACgB;gCACiB;+BACvB;AAM1B,MAAMA,qBAAqB,CAACC,OAAOC,MAAQ;IAChD,MAAM,EACJC,MAAMC,YAAW,EAClB,GAAGC,IAAAA,+BAAgB;IACpB,MAAM,EACJC,YAAa,YAAW,EACxBC,IAAK,SAAQ,EACbC,UAAW,KAAK,CAAA,EAChBC,mBAAoB,KAAK,CAAA,EACzBC,KAAI,EACJC,cAAe,SAAQ,EACvBC,OAAQ,UAAS,EACjBT,MAAOC,gBAAgB,IAAI,IAAIA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,CAAA,EAC/E,GAAGH;IACJ,MAAMY,gBAAgBC,IAAAA,gCAAgB,EAACJ;IACvC,OAAO;QACL,gCAAgC;QAChCJ;QACAE;QACAC;QACAE;QACAC;QACAT;QACA,uCAAuC;QACvCY,UAAUC,QAAQ,AAACH,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcI,QAAQ,AAAD,KAAM,CAAChB,MAAMgB,QAAQ;QAC3H,mBAAmB;QACnBC,YAAY;YACVC,MAAM;YACNT,MAAM;QACR;QACAS,MAAMC,IAAAA,qCAAqB,EAACb,IAAIc,IAAAA,iCAAsB,EAACpB,OAAO;YAC5DqB,UAAU,IAAI;YACdC,cAAc;gBACZrB,KAAKA;gBACLsB,MAAM;YACR;QACF;QACAd,MAAMG;IACR;AACF,GACA,qCAAqC"}