@fluentui/react-button 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/CHANGELOG.json +914 -24
  2. package/CHANGELOG.md +388 -180
  3. package/README.md +80 -18
  4. package/dist/{react-button.d.ts → index.d.ts} +72 -59
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/Button.js.map +1 -1
  7. package/lib/CompoundButton.js.map +1 -1
  8. package/lib/MenuButton.js.map +1 -1
  9. package/lib/SplitButton.js.map +1 -1
  10. package/lib/ToggleButton.js.map +1 -1
  11. package/lib/components/Button/Button.js +7 -7
  12. package/lib/components/Button/Button.js.map +1 -1
  13. package/lib/components/Button/Button.types.js.map +1 -1
  14. package/lib/components/Button/index.js +1 -2
  15. package/lib/components/Button/index.js.map +1 -1
  16. package/lib/components/Button/renderButton.js +13 -9
  17. package/lib/components/Button/renderButton.js.map +1 -1
  18. package/lib/components/Button/useButton.js +20 -25
  19. package/lib/components/Button/useButton.js.map +1 -1
  20. package/lib/components/Button/useButtonStyles.js +240 -165
  21. package/lib/components/Button/useButtonStyles.js.map +1 -1
  22. package/lib/components/CompoundButton/CompoundButton.js +7 -7
  23. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  24. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  25. package/lib/components/CompoundButton/index.js +1 -1
  26. package/lib/components/CompoundButton/index.js.map +1 -1
  27. package/lib/components/CompoundButton/renderCompoundButton.js +15 -9
  28. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  29. package/lib/components/CompoundButton/useCompoundButton.js +13 -8
  30. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  31. package/lib/components/CompoundButton/useCompoundButtonStyles.js +96 -75
  32. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  33. package/lib/components/MenuButton/MenuButton.js +9 -8
  34. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  35. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  36. package/lib/components/MenuButton/index.js +1 -1
  37. package/lib/components/MenuButton/index.js.map +1 -1
  38. package/lib/components/MenuButton/renderMenuButton.js +13 -9
  39. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  40. package/lib/components/MenuButton/useMenuButton.js +11 -11
  41. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  42. package/lib/components/MenuButton/useMenuButtonStyles.js +39 -17
  43. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  44. package/lib/components/SplitButton/SplitButton.js +8 -8
  45. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  46. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  47. package/lib/components/SplitButton/index.js +1 -1
  48. package/lib/components/SplitButton/index.js.map +1 -1
  49. package/lib/components/SplitButton/renderSplitButton.js +9 -7
  50. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  51. package/lib/components/SplitButton/useSplitButton.js +54 -49
  52. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  53. package/lib/components/SplitButton/useSplitButtonStyles.js +46 -39
  54. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  55. package/lib/components/ToggleButton/ToggleButton.js +7 -7
  56. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  57. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  58. package/lib/components/ToggleButton/index.js +1 -1
  59. package/lib/components/ToggleButton/index.js.map +1 -1
  60. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  61. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  62. package/lib/components/ToggleButton/useToggleButton.js +5 -41
  63. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  64. package/lib/components/ToggleButton/useToggleButtonStyles.js +110 -86
  65. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  66. package/lib/index.js +6 -5
  67. package/lib/index.js.map +1 -1
  68. package/lib/utils/index.js +2 -0
  69. package/lib/utils/index.js.map +1 -0
  70. package/lib/utils/useToggleState.js +37 -0
  71. package/lib/utils/useToggleState.js.map +1 -0
  72. package/lib-commonjs/Button.js +1 -1
  73. package/lib-commonjs/Button.js.map +1 -1
  74. package/lib-commonjs/CompoundButton.js +1 -1
  75. package/lib-commonjs/CompoundButton.js.map +1 -1
  76. package/lib-commonjs/MenuButton.js +1 -1
  77. package/lib-commonjs/MenuButton.js.map +1 -1
  78. package/lib-commonjs/SplitButton.js +1 -1
  79. package/lib-commonjs/SplitButton.js.map +1 -1
  80. package/lib-commonjs/ToggleButton.js +1 -1
  81. package/lib-commonjs/ToggleButton.js.map +1 -1
  82. package/lib-commonjs/components/Button/Button.js +8 -8
  83. package/lib-commonjs/components/Button/Button.js.map +1 -1
  84. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  85. package/lib-commonjs/components/Button/index.js +10 -6
  86. package/lib-commonjs/components/Button/index.js.map +1 -1
  87. package/lib-commonjs/components/Button/renderButton.js +17 -14
  88. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  89. package/lib-commonjs/components/Button/useButton.js +24 -29
  90. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  91. package/lib-commonjs/components/Button/useButtonStyles.js +243 -166
  92. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  93. package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
  94. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  95. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  96. package/lib-commonjs/components/CompoundButton/index.js +10 -4
  97. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  98. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +19 -14
  99. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  100. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +16 -12
  101. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  102. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +99 -77
  103. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  104. package/lib-commonjs/components/MenuButton/MenuButton.js +10 -9
  105. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  106. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  107. package/lib-commonjs/components/MenuButton/index.js +10 -4
  108. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  109. package/lib-commonjs/components/MenuButton/renderMenuButton.js +17 -14
  110. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  111. package/lib-commonjs/components/MenuButton/useMenuButton.js +15 -16
  112. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  113. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +43 -19
  114. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  115. package/lib-commonjs/components/SplitButton/SplitButton.js +9 -9
  116. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  117. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  118. package/lib-commonjs/components/SplitButton/index.js +10 -4
  119. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  120. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -12
  121. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  122. package/lib-commonjs/components/SplitButton/useSplitButton.js +58 -54
  123. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  124. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +50 -42
  125. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  126. package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
  127. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  128. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  129. package/lib-commonjs/components/ToggleButton/index.js +10 -4
  130. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  131. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
  132. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  133. package/lib-commonjs/components/ToggleButton/useToggleButton.js +7 -45
  134. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  135. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +114 -86
  136. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  137. package/lib-commonjs/index.js +169 -6
  138. package/lib-commonjs/index.js.map +1 -1
  139. package/lib-commonjs/utils/index.js +10 -0
  140. package/lib-commonjs/utils/index.js.map +1 -0
  141. package/lib-commonjs/utils/useToggleState.js +48 -0
  142. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  143. package/package.json +22 -27
  144. package/dist/demo/index.html +0 -71
  145. package/dist/demo/react-dom.development.js +0 -21413
  146. package/dist/demo/react.development.js +0 -3155
  147. package/lib/Button.d.ts +0 -1
  148. package/lib/CompoundButton.d.ts +0 -1
  149. package/lib/MenuButton.d.ts +0 -1
  150. package/lib/SplitButton.d.ts +0 -1
  151. package/lib/ToggleButton.d.ts +0 -1
  152. package/lib/common/isConformant.d.ts +0 -4
  153. package/lib/common/isConformant.js +0 -13
  154. package/lib/common/isConformant.js.map +0 -1
  155. package/lib/components/Button/Button.d.ts +0 -6
  156. package/lib/components/Button/Button.types.d.ts +0 -62
  157. package/lib/components/Button/index.d.ts +0 -5
  158. package/lib/components/Button/renderButton.d.ts +0 -5
  159. package/lib/components/Button/useButton.d.ts +0 -8
  160. package/lib/components/Button/useButtonStyles.d.ts +0 -10
  161. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  162. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  163. package/lib/components/CompoundButton/index.d.ts +0 -5
  164. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  165. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  166. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  167. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  168. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -11
  169. package/lib/components/MenuButton/index.d.ts +0 -5
  170. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  171. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  172. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  173. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  174. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -19
  175. package/lib/components/SplitButton/index.d.ts +0 -5
  176. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  177. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  178. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  179. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  180. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  181. package/lib/components/ToggleButton/index.d.ts +0 -5
  182. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  183. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  184. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  185. package/lib/index.d.ts +0 -5
  186. package/lib-commonjs/Button.d.ts +0 -1
  187. package/lib-commonjs/CompoundButton.d.ts +0 -1
  188. package/lib-commonjs/MenuButton.d.ts +0 -1
  189. package/lib-commonjs/SplitButton.d.ts +0 -1
  190. package/lib-commonjs/ToggleButton.d.ts +0 -1
  191. package/lib-commonjs/common/isConformant.d.ts +0 -4
  192. package/lib-commonjs/common/isConformant.js +0 -24
  193. package/lib-commonjs/common/isConformant.js.map +0 -1
  194. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  195. package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
  196. package/lib-commonjs/components/Button/index.d.ts +0 -5
  197. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  198. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  199. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -10
  200. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  201. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  202. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  203. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  204. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  205. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  206. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  207. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -11
  208. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  209. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  210. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  211. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  212. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  213. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -19
  214. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  215. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  216. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  217. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  218. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  219. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  220. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  221. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  222. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  223. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  224. package/lib-commonjs/index.d.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,gBAAgB,GAAG,UAAC,KAAD,EAAuB;AAC/C,MAAA,EAAA,GAAuB,QAAQ,CAAkB,KAAlB,EAAyB,CAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,CAAzB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACE,MAAA,IAAI,GAAe,KAAK,CAApB,IAAJ;AAAA,MAAM,QAAQ,GAAK,KAAK,CAAV,QAAd;AAER,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,EAEG,CAAC,QAAD,IAAa,SAAS,CAAC,IAAV,CAAe,QAF/B,EAGG,CAAC,CAAC,QAAD,IAAa,EAAC,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,QAAP,CAAd,kBAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAHrC,CADF;AAOD,CAXM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAkB,KAAlB,CAArC;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAqB,KAA3B;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADjB,EAEG,CAAC,QAAD,IAAa,SAAS,CAAC,IAAV,CAAe,QAF/B,EAGG,CAAC,CAAC,QAAD,IAAa,EAAC,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,QAAP,CAAd,KAAkC,KAAK,CAAC,QAAxC,iBAAoD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAHvD,CADF;AAOD,CAXM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && slotProps.root.children}\n {(!iconOnly || !icon?.children) && slots.menuIcon && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,18 +1,18 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import * as React from 'react';
3
- import { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';
2
+ import { ChevronDownRegular } from '@fluentui/react-icons';
4
3
  import { resolveShorthand } from '@fluentui/react-utilities';
5
- import { useButton } from '../Button/index';
4
+ import { useButton_unstable } from '../Button/index';
6
5
  /**
7
6
  * Given user props, returns the final state for a MenuButton.
8
7
  */
9
8
 
10
- export var useMenuButton = function (_a, ref) {
11
- var menuIcon = _a.menuIcon,
12
- props = __rest(_a, ["menuIcon"]);
13
-
14
- var buttonState = useButton(props, ref);
15
- return __assign(__assign({}, buttonState), {
9
+ export const useMenuButton_unstable = ({
10
+ menuIcon,
11
+ ...props
12
+ }, ref) => {
13
+ const buttonState = useButton_unstable(props, ref);
14
+ return { // Button state
15
+ ...buttonState,
16
16
  // State calculated from a set of props
17
17
  iconOnly: Boolean(!props.children),
18
18
  // Slots definition
@@ -23,10 +23,10 @@ export var useMenuButton = function (_a, ref) {
23
23
  },
24
24
  menuIcon: resolveShorthand(menuIcon, {
25
25
  defaultProps: {
26
- children: buttonState.size === 'large' ? /*#__PURE__*/React.createElement(ChevronDown24Regular, null) : /*#__PURE__*/React.createElement(ChevronDown20Regular, null)
26
+ children: /*#__PURE__*/React.createElement(ChevronDownRegular, null)
27
27
  },
28
28
  required: true
29
29
  })
30
- });
30
+ };
31
31
  };
32
32
  //# sourceMappingURL=useMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,EAA+B,oBAA/B,QAA2D,uBAA3D;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,SAAT,QAA0B,iBAA1B;AAGA;;AAEG;;AACH,OAAO,IAAM,aAAa,GAAG,UAC3B,EAD2B,EAE3B,GAF2B,EAE0B;AADnD,MAAA,QAAQ,GAAA,EAAA,CAAA,QAAR;AAAA,MAAa,KAAK,GAAA,MAAA,CAAA,EAAA,EAApB,CAAA,UAAA,CAAoB,CAAlB;;AAGF,MAAM,WAAW,GAAG,SAAS,CAAC,KAAD,EAA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IAAA,QAAQ,EAAE,gBAAgB,CAAC,QAAD,EAAW;AACnC,MAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAC,kBAAD,EAAmB,IAAnB;AADE,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAAX;AAdrB,GAAP;AAqBD,CA1BM","sourcesContent":["import * as React from 'react';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { MenuButtonProps, MenuButtonState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButton_unstable = (\n { menuIcon, ...props }: MenuButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonState => {\n const buttonState = useButton_unstable(props, ref);\n return {\n // Button state\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: resolveShorthand(menuIcon, {\n defaultProps: {\n children: <ChevronDownRegular />,\n },\n required: true,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1,34 +1,56 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
- import { useButtonStyles } from '../Button/useButtonStyles';
1
+ import { mergeClasses, __styles } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { useButtonStyles_unstable } from '../Button/useButtonStyles';
4
+ export const menuButtonClassNames = {
5
+ root: 'fui-MenuButton',
6
+ icon: 'fui-MenuButton__icon',
7
+ menuIcon: 'fui-MenuButton__menuIcon'
8
+ };
3
9
 
4
- var useMenuIconStyles = /*#__PURE__*/__styles({
10
+ const useMenuIconStyles = /*#__PURE__*/__styles({
11
+ "base": {
12
+ "Bg96gwp": "fez10in"
13
+ },
5
14
  "small": {
6
- "Be2twd7": "fe5j1ua",
7
- "Bqenvij": "fjamq6b",
8
- "a9b677": "f64fuq3"
15
+ "Be2twd7": "f1ugzwwg",
16
+ "Bqenvij": "fvblgha",
17
+ "Bg96gwp": "fwrc4pm",
18
+ "a9b677": "frx94fk"
9
19
  },
10
20
  "medium": {
11
- "Be2twd7": "fe5j1ua",
12
- "Bqenvij": "fjamq6b",
13
- "a9b677": "f64fuq3"
21
+ "Be2twd7": "f1ugzwwg",
22
+ "Bqenvij": "fvblgha",
23
+ "Bg96gwp": "fwrc4pm",
24
+ "a9b677": "frx94fk"
14
25
  },
15
26
  "large": {
16
- "Be2twd7": "f1rt2boy",
17
- "Bqenvij": "frvgh55",
18
- "a9b677": "fq4mcun"
27
+ "Be2twd7": "f4ybsrx",
28
+ "Bqenvij": "fd461yt",
29
+ "Bg96gwp": "faaz57k",
30
+ "a9b677": "fjw5fx7"
31
+ },
32
+ "notIconOnly": {
33
+ "Frg6f3": ["fbyavb5", "fm0x6gh"]
19
34
  }
20
35
  }, {
21
- "d": [".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
36
+ "d": [".fez10in{line-height:0;}", ".f1ugzwwg{font-size:12px;}", ".fvblgha{height:12px;}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".frx94fk{width:12px;}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fjw5fx7{width:16px;}", ".fbyavb5{margin-left:var(--spacingHorizontalXS);}", ".fm0x6gh{margin-right:var(--spacingHorizontalXS);}"]
22
37
  });
23
38
 
24
- export var useMenuButtonStyles = function (state) {
25
- var menuIconStyles = useMenuIconStyles();
39
+ export const useMenuButtonStyles_unstable = state => {
40
+ const menuIconStyles = useMenuIconStyles();
41
+ state.root.className = mergeClasses(menuButtonClassNames.root, state.root.className);
42
+
43
+ if (state.icon) {
44
+ state.icon.className = mergeClasses(menuButtonClassNames.icon, state.icon.className);
45
+ }
26
46
 
27
47
  if (state.menuIcon) {
28
- state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);
48
+ state.menuIcon.className = mergeClasses(menuButtonClassNames.menuIcon, menuIconStyles.base, menuIconStyles[state.size], !state.iconOnly && menuIconStyles.notIconOnly, state.menuIcon.className);
29
49
  }
30
50
 
31
- useButtonStyles(state);
51
+ useButtonStyles_unstable({ ...state,
52
+ iconPosition: 'before'
53
+ });
32
54
  return state;
33
55
  };
34
56
  //# sourceMappingURL=useMenuButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AAEA,SAAS,eAAT,QAAgC,2BAAhC;;AAGA,IAAM,iBAAiB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AAmBA,OAAO,IAAM,mBAAmB,GAAG,UAAC,KAAD,EAAuB;AACxD,MAAM,cAAc,GAAG,iBAAiB,EAAxC;;AACA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAP,CAAf,EAA6B,KAAK,CAAC,QAAN,CAAe,SAA5C,CAAvC;AACD;;AAED,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,KAAP;AACD,CATM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,wBAAT,QAAyC,2BAAzC;AAIA,OAAO,MAAM,oBAAoB,GAAoC;AACnE,EAAA,IAAI,EAAE,gBAD6D;AAEnE,EAAA,IAAI,EAAE,sBAF6D;AAGnE,EAAA,QAAQ,EAAE;AAHyD,CAA9D;;AAMP,MAAM,iBAAiB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AA+BA,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;AACtF,QAAM,cAAc,GAAG,iBAAiB,EAAxC;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAoB,CAAC,IAAtB,EAA4B,KAAK,CAAC,IAAN,CAAW,SAAvC,CAAnC;;AAEA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAoB,CAAC,IAAtB,EAA4B,KAAK,CAAC,IAAN,CAAW,SAAvC,CAAnC;AACD;;AAED,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CACrC,oBAAoB,CAAC,QADgB,EAErC,cAAc,CAAC,IAFsB,EAGrC,cAAc,CAAC,KAAK,CAAC,IAAP,CAHuB,EAIrC,CAAC,KAAK,CAAC,QAAP,IAAmB,cAAc,CAAC,WAJG,EAKrC,KAAK,CAAC,QAAN,CAAe,SALsB,CAAvC;AAOD;;AAED,EAAA,wBAAwB,CAAC,EAAE,GAAG,KAAL;AAAY,IAAA,YAAY,EAAE;AAA1B,GAAD,CAAxB;AAEA,SAAO,KAAP;AACD,CAtBM","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\nexport const menuButtonClassNames: SlotClassNames<MenuButtonSlots> = {\n root: 'fui-MenuButton',\n icon: 'fui-MenuButton__icon',\n menuIcon: 'fui-MenuButton__menuIcon',\n};\n\nconst useMenuIconStyles = makeStyles({\n base: {\n lineHeight: 0,\n },\n\n // Size appearance\n small: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px',\n },\n medium: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px',\n },\n large: {\n fontSize: '16px',\n height: '16px',\n lineHeight: tokens.lineHeightBase400,\n width: '16px',\n },\n\n // Not-icon only\n notIconOnly: {\n marginLeft: tokens.spacingHorizontalXS,\n },\n});\n\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n const menuIconStyles = useMenuIconStyles();\n\n state.root.className = mergeClasses(menuButtonClassNames.root, state.root.className);\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuButtonClassNames.icon, state.icon.className);\n }\n\n if (state.menuIcon) {\n state.menuIcon.className = mergeClasses(\n menuButtonClassNames.menuIcon,\n menuIconStyles.base,\n menuIconStyles[state.size],\n !state.iconOnly && menuIconStyles.notIconOnly,\n state.menuIcon.className,\n );\n }\n\n useButtonStyles_unstable({ ...state, iconPosition: 'before' });\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
- import { renderSplitButton } from './renderSplitButton';
3
- import { useSplitButton } from './useSplitButton';
4
- import { useSplitButtonStyles } from './useSplitButtonStyles';
2
+ import { renderSplitButton_unstable } from './renderSplitButton';
3
+ import { useSplitButton_unstable } from './useSplitButton';
4
+ import { useSplitButtonStyles_unstable } from './useSplitButtonStyles';
5
5
  /**
6
- * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
6
+ * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
7
7
  * action, while interacting with the second one opens a menu with secondary actions.
8
8
  */
9
9
 
10
- export var SplitButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
- var state = useSplitButton(props, ref);
12
- useSplitButtonStyles(state);
13
- return renderSplitButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
10
+ export const SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const state = useSplitButton_unstable(props, ref);
12
+ useSplitButtonStyles_unstable(state);
13
+ return renderSplitButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
14
14
  });
15
15
  SplitButton.displayName = 'SplitButton';
16
16
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/SplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,oBAAT,QAAqC,wBAArC;AAIA;;;AAGG;;AACH,OAAO,IAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC5F,MAAM,KAAK,GAAG,cAAc,CAAC,KAAD,EAAQ,GAAR,CAA5B;AAEA,EAAA,oBAAoB,CAAC,KAAD,CAApB;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB,CAL4F,CAM5F;AACD,CAPiE,CAA3D;AASP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AAIA;;;AAGG;;AACH,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAChG,QAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,EAAQ,GAAR,CAArC;AAEA,EAAA,6BAA6B,CAAC,KAAD,CAA7B;AAEA,SAAO,0BAA0B,CAAC,KAAD,CAAjC,CALgG,CAMhG;AACD,CAPiE,CAA3D;AASP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { renderSplitButton_unstable } from './renderSplitButton';\nimport { useSplitButton_unstable } from './useSplitButton';\nimport { useSplitButtonStyles_unstable } from './useSplitButtonStyles';\nimport type { SplitButtonProps } from './SplitButton.types';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton: ForwardRefComponent<SplitButtonProps> = React.forwardRef((props, ref) => {\n const state = useSplitButton_unstable(props, ref);\n\n useSplitButtonStyles_unstable(state);\n\n return renderSplitButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<SplitButtonProps>;\n\nSplitButton.displayName = 'SplitButton';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.types.js","sourceRoot":"","sources":["../../../src/components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { ButtonProps, ButtonState } from '../Button/Button.types';\nimport type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';\n\nexport type SplitButtonSlots = {\n /**\n * Root of the component that wraps the primary action button and menu button.\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: Slot<typeof MenuButton>;\n /**\n * Button to perform primary action in SplitButton.\n */\n primaryActionButton?: Slot<typeof Button>;\n};\n\nexport type SplitButtonProps = ComponentProps<SplitButtonSlots> &\n Omit<ButtonProps, 'root'> &\n Omit<MenuButtonProps, 'root'>;\n\nexport type SplitButtonState = ComponentState<SplitButtonSlots> &\n Omit<ButtonState, 'components' | 'iconOnly' | 'root'> &\n Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;\n"]}
@@ -2,5 +2,5 @@ export * from './SplitButton';
2
2
  export * from './SplitButton.types';
3
3
  export * from './renderSplitButton';
4
4
  export * from './useSplitButton';
5
- export { useSplitButtonStyles } from './useSplitButtonStyles';
5
+ export { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SplitButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';\n"]}
@@ -1,15 +1,17 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  /**
5
4
  * Renders a SplitButton component by passing the state defined props to the appropriate slots.
6
5
  */
7
6
 
8
- export var renderSplitButton = function (state) {
9
- var _a = getSlots(state, ['root', 'menuButton', 'primaryActionButton']),
10
- slots = _a.slots,
11
- slotProps = _a.slotProps;
12
-
13
- return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.primaryActionButton, __assign({}, slotProps.primaryActionButton)), /*#__PURE__*/React.createElement(slots.menuButton, __assign({}, slotProps.menuButton)));
7
+ export const renderSplitButton_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ }, slots.primaryActionButton && /*#__PURE__*/React.createElement(slots.primaryActionButton, { ...slotProps.primaryActionButton
14
+ }), slots.menuButton && /*#__PURE__*/React.createElement(slots.menuButton, { ...slotProps.menuButton
15
+ }));
14
16
  };
15
17
  //# sourceMappingURL=renderSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACjD,MAAA,EAAA,GAAuB,QAAQ,CAAmB,KAAnB,EAA0B,CAAC,MAAD,EAAS,YAAT,EAAuB,qBAAvB,CAA1B,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,mBAAf,CAA1B,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CAFF,CADF;AAMD,CATM","sourceRoot":""}
1
+ {"version":3,"sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAmB,KAAnB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,mBAAN,iBAA6B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,EAAA,GAAK,SAAS,CAAC;AAAf,GAA1B,CADhC,EAEG,KAAK,CAAC,UAAN,iBAAoB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAjB,CAFvB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton_unstable = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots<SplitButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.primaryActionButton && <slots.primaryActionButton {...slotProps.primaryActionButton} />}\n {slots.menuButton && <slots.menuButton {...slotProps.menuButton} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,5 +1,4 @@
1
- import { __assign } from "tslib";
2
- import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
1
+ import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
3
2
  import { Button } from '../Button/Button';
4
3
  import { MenuButton } from '../MenuButton/MenuButton';
5
4
  /**
@@ -8,64 +7,70 @@ import { MenuButton } from '../MenuButton/MenuButton';
8
7
  * @param ref - User provided ref to be passed to the SplitButton component.
9
8
  */
10
9
 
11
- export var useSplitButton = function (props, ref) {
12
- var appearance = props.appearance,
13
- _a = props.block,
14
- block = _a === void 0 ? false : _a,
15
- children = props.children,
16
- _b = props.disabled,
17
- disabled = _b === void 0 ? false : _b,
18
- _c = props.disabledFocusable,
19
- disabledFocusable = _c === void 0 ? false : _c,
20
- icon = props.icon,
21
- _d = props.iconPosition,
22
- iconPosition = _d === void 0 ? 'before' : _d,
23
- menuButton = props.menuButton,
24
- primaryActionButton = props.primaryActionButton,
25
- _e = props.shape,
26
- shape = _e === void 0 ? 'rounded' : _e,
27
- _f = props.size,
28
- size = _f === void 0 ? 'medium' : _f;
29
- var menuButtonShorthand = resolveShorthand(menuButton, {
10
+ export const useSplitButton_unstable = (props, ref) => {
11
+ const {
12
+ appearance = 'secondary',
13
+ children,
14
+ disabled = false,
15
+ disabledFocusable = false,
16
+ icon,
17
+ iconPosition = 'before',
18
+ menuButton,
19
+ menuIcon,
20
+ primaryActionButton,
21
+ shape = 'rounded',
22
+ size = 'medium'
23
+ } = props;
24
+ const baseId = useId('splitButton-');
25
+ const menuButtonShorthand = resolveShorthand(menuButton, {
30
26
  defaultProps: {
31
- appearance: appearance,
32
- disabled: disabled,
33
- disabledFocusable: disabledFocusable,
34
- shape: shape,
35
- size: size
36
- }
27
+ appearance,
28
+ disabled,
29
+ disabledFocusable,
30
+ menuIcon,
31
+ shape,
32
+ size
33
+ },
34
+ required: true
37
35
  });
38
- var primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {
36
+ const primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {
39
37
  defaultProps: {
40
- appearance: appearance,
41
- block: block,
42
- children: children,
43
- disabled: disabled,
44
- disabledFocusable: disabledFocusable,
45
- icon: icon,
46
- iconPosition: iconPosition,
47
- shape: shape,
48
- size: size
49
- }
50
- });
38
+ appearance,
39
+ children,
40
+ disabled,
41
+ disabledFocusable,
42
+ icon,
43
+ iconPosition,
44
+ id: baseId + '__primaryActionButton',
45
+ shape,
46
+ size
47
+ },
48
+ required: true
49
+ }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
50
+ // by the user.
51
+
52
+ if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
53
+ menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
54
+ }
55
+
51
56
  return {
52
57
  // Props passed at the top-level
53
- appearance: appearance,
54
- block: block,
55
- disabled: disabled,
56
- disabledFocusable: disabledFocusable,
57
- iconPosition: iconPosition,
58
- shape: shape,
59
- size: size,
58
+ appearance,
59
+ disabled,
60
+ disabledFocusable,
61
+ iconPosition,
62
+ shape,
63
+ size,
60
64
  // Slots definition
61
65
  components: {
62
66
  root: 'div',
63
67
  menuButton: MenuButton,
64
68
  primaryActionButton: Button
65
69
  },
66
- root: getNativeElementProps('div', __assign({
67
- ref: ref
68
- }, props)),
70
+ root: getNativeElementProps('div', {
71
+ ref,
72
+ ...props
73
+ }),
69
74
  menuButton: menuButtonShorthand,
70
75
  primaryActionButton: primaryActionButtonShorthand
71
76
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,MAAT,QAAuB,kBAAvB;AACA,SAAS,UAAT,QAA2B,0BAA3B;AAGA;;;;AAIG;;AACH,OAAO,IAAM,cAAc,GAAG,UAC5B,KAD4B,EAE5B,GAF4B,EAEyB;AAGnD,MAAA,UAAU,GAWR,KAAK,CAXG,UAAV;AAAA,MACA,EAAA,GAUE,KAAK,CAVM,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IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAAR,CAhBtB;AAiBL,IAAA,UAAU,EAAE,mBAjBP;AAkBL,IAAA,mBAAmB,EAAE;AAlBhB,GAAP;AAoBD,CA9EM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonProps, SplitButtonState } 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 useSplitButton_unstable = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonState => {\n const {\n appearance = 'secondary',\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n shape = 'rounded',\n size = 'medium',\n } = props;\n\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = resolveShorthand(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size,\n },\n required: true,\n });\n\n const primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {\n defaultProps: {\n appearance,\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n shape,\n size,\n },\n required: true,\n });\n\n // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided\n // by the 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 appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // Slots definition\n components: {\n root: 'div',\n menuButton: MenuButton,\n primaryActionButton: Button,\n },\n\n root: getNativeElementProps('div', { ref, ...props }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1,11 +1,13 @@
1
- import { __styles, mergeClasses } from '@fluentui/react-make-styles';
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
2
  import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
3
- var SplitButtonClassNames = {
4
- primaryActionButton: 'SplitButton-primaryActionButton',
5
- menuButton: 'SplitButton-menuButton'
3
+ import { tokens } from '@fluentui/react-theme';
4
+ export const splitButtonClassNames = {
5
+ root: 'fui-SplitButton',
6
+ menuButton: 'fui-SplitButton__menuButton',
7
+ primaryActionButton: 'fui-SplitButton__primaryActionButton'
6
8
  };
7
9
 
8
- var useFocusStyles = /*#__PURE__*/__styles({
10
+ const useFocusStyles = /*#__PURE__*/__styles({
9
11
  "primaryActionButton": {
10
12
  "B486eqv": "f2hkw1w",
11
13
  "Bmrpcm6": ["fub8a6s", "f1g41uvt"],
@@ -22,66 +24,71 @@ var useFocusStyles = /*#__PURE__*/__styles({
22
24
  "d": ["[data-keyboard-nav] .fub8a6s:focus{border-top-right-radius:0;}", "[data-keyboard-nav] .f1g41uvt:focus{border-top-left-radius:0;}", "[data-keyboard-nav] .f58hr3h:focus{border-bottom-right-radius:0;}", "[data-keyboard-nav] .f1u1mnrj:focus{border-bottom-left-radius:0;}", "[data-keyboard-nav] .fy9hclh:focus{border-left-width:0;}", "[data-keyboard-nav] .f549e1y:focus{border-right-width:0;}"]
23
25
  });
24
26
 
25
- var useRootStyles = /*#__PURE__*/__styles({
27
+ const useRootStyles = /*#__PURE__*/__styles({
26
28
  "base": {
27
29
  "mc9l5x": "ftuwxu6",
28
30
  "Brf1p80": "fsxf2b5",
29
31
  "qhf8xq": "f10pi13n",
30
32
  "ha4doy": "fmrv4ls",
31
- "ipgm0c": ["f178uykt", "f90yzzo"],
32
- "B6cuk21": ["f1bxd3c5", "f1ekv84t"],
33
- "bajz6s": ["fnux5s6", "f5nfhee"],
34
- "Bzqncq": ["f19wc9x7", "f5bevrs"],
35
- "Flt4rd": ["f1wefiyg", "f1leuqsa"]
36
- },
37
- "block": {
38
- "a9b677": "fly5x3f"
33
+ "kn2xc0": ["f14uur2j", "fc1btbj"],
34
+ "Bs76p8a": ["fye5tvs", "fc597qq"],
35
+ "cuxpm9": ["f1e8brtx", "fr36rk3"],
36
+ "Biffepf": ["fxp12j1", "f1m6nt2y"],
37
+ "Defnvf": ["fr7y8no", "f1dn0c6m"],
38
+ "z0pv9t": "f1hvqvul"
39
39
  },
40
40
  "outline": {},
41
41
  "primary": {
42
- "Bxrr62k": ["f8z1slf", "f1qj10op"],
43
- "wqijrc": ["fmrqvvu", "fu0z9tm"],
44
- "Bsk9mq6": ["f1naws84", "f1ry7auu"]
42
+ "B1l9wao": ["f12j1tfo", "f1ufkr8r"],
43
+ "lcnrd8": ["f17lyyco", "f151o42i"],
44
+ "Brbpp8k": ["f1nb07eg", "fg8a8qi"]
45
45
  },
46
+ "secondary": {},
46
47
  "subtle": {
47
- "Bxrr62k": ["f1xobncs", "f1xirlzn"],
48
- "wqijrc": ["f1hmsn3f", "fi0rm9z"],
49
- "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
48
+ "B1l9wao": ["f1ysqkm5", "f10nbrj"],
49
+ "lcnrd8": ["fn44ryq", "fwhhltr"],
50
+ "Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
50
51
  },
51
52
  "transparent": {
52
- "Bxrr62k": ["f1xobncs", "f1xirlzn"],
53
- "wqijrc": ["f1hmsn3f", "fi0rm9z"],
54
- "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
53
+ "B1l9wao": ["f1ysqkm5", "f10nbrj"],
54
+ "lcnrd8": ["fn44ryq", "fwhhltr"],
55
+ "Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
55
56
  },
56
57
  "circular": {},
57
58
  "rounded": {},
58
59
  "square": {},
59
60
  "disabled": {
60
- "Bxrr62k": ["f11wzqjl", "f1a5dzic"],
61
- "wqijrc": ["fhk4lgh", "f1r7ztp2"],
62
- "Bsk9mq6": ["f1ot7jx6", "f1qvd61g"]
61
+ "B1l9wao": ["f10xrnr8", "f15nylwb"],
62
+ "lcnrd8": ["f11fwhjz", "f18vtcsx"],
63
+ "Brbpp8k": ["f31btwb", "fzgm9gq"]
64
+ },
65
+ "disabledHighContrast": {
66
+ "Bcsxniv": ["fj2q5vi", "f13tct40"],
67
+ "tl7e51": ["fb2mzc7", "f179dhpp"],
68
+ "mba178": ["f1ma39qa", "f1nzpdru"]
63
69
  }
64
70
  }, {
65
- "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f178uykt .SplitButton-primaryActionButton{border-top-right-radius:0;}", ".f90yzzo .SplitButton-primaryActionButton{border-top-left-radius:0;}", ".f1bxd3c5 .SplitButton-primaryActionButton{border-bottom-right-radius:0;}", ".f1ekv84t .SplitButton-primaryActionButton{border-bottom-left-radius:0;}", ".fnux5s6 .SplitButton-menuButton{border-left-width:0;}", ".f5nfhee .SplitButton-menuButton{border-right-width:0;}", ".f19wc9x7 .SplitButton-menuButton{border-top-left-radius:0;}", ".f5bevrs .SplitButton-menuButton{border-top-right-radius:0;}", ".f1wefiyg .SplitButton-menuButton{border-bottom-left-radius:0;}", ".f1leuqsa .SplitButton-menuButton{border-bottom-right-radius:0;}", ".fly5x3f{width:100%;}", ".f8z1slf .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1qj10op .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1xobncs .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1xirlzn .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11wzqjl .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1a5dzic .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
66
- "h": [".fmrqvvu:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fu0z9tm:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1hmsn3f:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fi0rm9z:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fhk4lgh:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1r7ztp2:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
67
- "a": [".f1naws84:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ry7auu:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fam4u78:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1hqq1j6:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1ot7jx6:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1qvd61g:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"]
71
+ "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f14uur2j .fui-SplitButton__primaryActionButton{border-top-right-radius:0;}", ".fc1btbj .fui-SplitButton__primaryActionButton{border-top-left-radius:0;}", ".fye5tvs .fui-SplitButton__primaryActionButton{border-bottom-right-radius:0;}", ".fc597qq .fui-SplitButton__primaryActionButton{border-bottom-left-radius:0;}", ".f1e8brtx .fui-SplitButton__menuButton{border-left-width:0;}", ".fr36rk3 .fui-SplitButton__menuButton{border-right-width:0;}", ".fxp12j1 .fui-SplitButton__menuButton{border-top-left-radius:0;}", ".f1m6nt2y .fui-SplitButton__menuButton{border-top-right-radius:0;}", ".fr7y8no .fui-SplitButton__menuButton{border-bottom-left-radius:0;}", ".f1dn0c6m .fui-SplitButton__menuButton{border-bottom-right-radius:0;}", ".f1hvqvul .fui-SplitButton__menuButton{min-width:0;}", ".f12j1tfo .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ufkr8r .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1ysqkm5 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f10nbrj .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f10xrnr8 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f15nylwb .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
72
+ "h": [".f17lyyco:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f151o42i:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1nb07eg:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fg8a8qi:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fn44ryq:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fwhhltr:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fg8lp5p:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1p6hj0a:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11fwhjz:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f18vtcsx:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f31btwb:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fzgm9gq:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
73
+ "t": ["@media (forced-colors: active){.fj2q5vi .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f13tct40 .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.fb2mzc7:hover .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f179dhpp:hover .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.f1ma39qa:hover:active .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f1nzpdru:hover:active .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}"]
68
74
  });
69
75
 
70
- export var useSplitButtonStyles = function (state) {
71
- var rootStyles = useRootStyles();
72
- var focusStyles = useFocusStyles();
73
- var appearance = state.appearance,
74
- block = state.block,
75
- disabled = state.disabled,
76
- disabledFocusable = state.disabledFocusable;
77
- state.root.className = mergeClasses(rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
76
+ export const useSplitButtonStyles_unstable = state => {
77
+ const rootStyles = useRootStyles();
78
+ const focusStyles = useFocusStyles();
79
+ const {
80
+ appearance,
81
+ disabled,
82
+ disabledFocusable
83
+ } = state;
84
+ state.root.className = mergeClasses(splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);
78
85
 
79
86
  if (state.menuButton) {
80
- state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
87
+ state.menuButton.className = mergeClasses(splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
81
88
  }
82
89
 
83
90
  if (state.primaryActionButton) {
84
- state.primaryActionButton.className = mergeClasses(SplitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
91
+ state.primaryActionButton.className = mergeClasses(splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
85
92
  }
86
93
 
87
94
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,mBAAmB,EAAE,iCADO;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,cAAc,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAvB;;AAaA,IAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAgHA,OAAO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,UAAU,GAAG,aAAa,EAAhC;AACA,MAAM,WAAW,GAAG,cAAc,EAAlC;AAEQ,MAAA,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AAC,mBAD0B,EAEhD,WAAW,CAAC,mBAFoC,EAGhD,KAAK,CAAC,mBAAN,CAA0B,SAHsB,CAAlD;AAKD;;AAED,SAAO,KAAP;AACD,CAhCM","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\nexport const splitButtonClassNames: SlotClassNames<SplitButtonSlots> = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton',\n};\n\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n }),\n\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n});\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n },\n transparent: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n },\n\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n },\n },\n});\n\nexport const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitButtonState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n\n const { appearance, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n splitButtonClassNames.root,\n rootStyles.base,\n appearance && rootStyles[appearance],\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n state.root.className,\n );\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(\n splitButtonClassNames.menuButton,\n focusStyles.menuButton,\n state.menuButton.className,\n );\n }\n\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(\n splitButtonClassNames.primaryActionButton,\n focusStyles.primaryActionButton,\n state.primaryActionButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { renderToggleButton } from './renderToggleButton';
3
- import { useToggleButton } from './useToggleButton';
4
- import { useToggleButtonStyles } from './useToggleButtonStyles';
2
+ import { renderToggleButton_unstable } from './renderToggleButton';
3
+ import { useToggleButton_unstable } from './useToggleButton';
4
+ import { useToggleButtonStyles_unstable } from './useToggleButtonStyles';
5
5
  /**
6
6
  * ToggleButtons are buttons that toggle between two defined states when triggered.
7
7
  */
8
8
 
9
- export var ToggleButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var state = useToggleButton(props, ref);
11
- useToggleButtonStyles(state);
12
- return renderToggleButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
9
+ export const ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useToggleButton_unstable(props, ref);
11
+ useToggleButtonStyles_unstable(state);
12
+ return renderToggleButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
13
13
  });
14
14
  ToggleButton.displayName = 'ToggleButton';
15
15
  //# sourceMappingURL=ToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AAIA;;AAEG;;AACH,OAAO,IAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;AAEA,EAAA,qBAAqB,CAAC,KAAD,CAArB;AAEA,SAAO,kBAAkB,CAAC,KAAD,CAAzB,CAL8F,CAM9F;AACD,CAPmE,CAA7D;AASP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourceRoot":""}
1
+ {"version":3,"sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,2BAAT,QAA4C,sBAA5C;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AACA,SAAS,8BAAT,QAA+C,yBAA/C;AAIA;;AAEG;;AACH,OAAO,MAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,wBAAwB,CAAC,KAAD,EAAQ,GAAR,CAAtC;AAEA,EAAA,8BAA8B,CAAC,KAAD,CAA9B;AAEA,SAAO,2BAA2B,CAAC,KAAD,CAAlC,CALkG,CAMlG;AACD,CAPmE,CAA7D;AASP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourcesContent":["import * as React from 'react';\nimport { renderToggleButton_unstable } from './renderToggleButton';\nimport { useToggleButton_unstable } from './useToggleButton';\nimport { useToggleButtonStyles_unstable } from './useToggleButtonStyles';\nimport type { ToggleButtonProps } from './ToggleButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToggleButtons are buttons that toggle between two defined states when triggered.\n */\nexport const ToggleButton: ForwardRefComponent<ToggleButtonProps> = React.forwardRef((props, ref) => {\n const state = useToggleButton_unstable(props, ref);\n\n useToggleButtonStyles_unstable(state);\n\n return renderToggleButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToggleButtonProps>;\n\nToggleButton.displayName = 'ToggleButton';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.types.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ToggleButton.types.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonProps, ButtonState } from '../Button/Button.types';\n\nexport type ToggleButtonProps = ButtonProps & {\n /**\n * Defines whether the `ToggleButton` is initially in a checked state or not when rendered.\n *\n * @default false\n */\n defaultChecked?: boolean;\n\n /**\n * Defines the controlled checked state of the `ToggleButton`.\n * If passed, `ToggleButton` ignores the `defaultChecked` property.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onClick` events and re-rendering.\n *\n * @default false\n */\n checked?: boolean;\n};\n\nexport type ToggleButtonState = ButtonState & Required<Pick<ToggleButtonProps, 'checked'>>;\n"]}