@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/MenuButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,UAAA,gBAAmD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC1F,MAAM,KAAK,GAAG,eAAA,CAAA,aAAA,CAAc,KAAd,EAAqB,GAArB,CAAd;AAEA,EAAA,qBAAA,CAAA,mBAAA,CAAoB,KAApB;AAEA,SAAO,kBAAA,CAAA,gBAAA,CAAiB,KAAjB,CAAP,CAL0F,CAM1F;AACD,CAP+D,CAAnD;AASb,OAAA,CAAA,UAAA,CAAW,WAAX,GAAyB,YAAzB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,UAAA,gBAAmD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,eAAA,CAAA,sBAAA,CAAuB,KAAvB,EAA8B,GAA9B,CAAd;AAEA,EAAA,qBAAA,CAAA,4BAAA,CAA6B,KAA7B;AAEA,SAAO,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAP,CAL8F,CAM9F;AACD,CAP+D,CAAnD;AASb,OAAA,CAAA,UAAA,CAAW,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { renderMenuButton_unstable } from './renderMenuButton';\nimport { useMenuButton_unstable } from './useMenuButton';\nimport { useMenuButtonStyles_unstable } from './useMenuButtonStyles';\nimport type { MenuButtonProps } from './MenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close\n * menus.\n */\nexport const MenuButton: ForwardRefComponent<MenuButtonProps> = React.forwardRef((props, ref) => {\n const state = useMenuButton_unstable(props, ref);\n\n useMenuButtonStyles_unstable(state);\n\n return renderMenuButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<MenuButtonProps>;\n\nMenuButton.displayName = 'MenuButton';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuButtonStyles = void 0;
6
+ exports.useMenuButtonStyles_unstable = exports.menuButtonClassNames = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
9
 
10
10
  tslib_1.__exportStar(require("./MenuButton.types"), exports);
11
11
 
@@ -17,10 +17,16 @@ tslib_1.__exportStar(require("./useMenuButton"), exports);
17
17
 
18
18
  var useMenuButtonStyles_1 = /*#__PURE__*/require("./useMenuButtonStyles");
19
19
 
20
- Object.defineProperty(exports, "useMenuButtonStyles", {
20
+ Object.defineProperty(exports, "menuButtonClassNames", {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return useMenuButtonStyles_1.useMenuButtonStyles;
23
+ return useMenuButtonStyles_1.menuButtonClassNames;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "useMenuButtonStyles_unstable", {
27
+ enumerable: true,
28
+ get: function () {
29
+ return useMenuButtonStyles_1.useMenuButtonStyles_unstable;
24
30
  }
25
31
  });
26
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,qBAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,qBAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AAAsB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,qBAAA,CAAA,4BAAA;AAA4B;AAA5B,CAAA","sourcesContent":["export * from './MenuButton.types';\nexport * from './MenuButton';\nexport * from './renderMenuButton';\nexport * from './useMenuButton';\nexport { menuButtonClassNames, useMenuButtonStyles_unstable } from './useMenuButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -3,27 +3,30 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderMenuButton = void 0;
6
+ exports.renderMenuButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
11
  /**
14
12
  * Renders a MenuButton component by passing the state defined props to the appropriate slots.
15
13
  */
16
14
 
17
15
 
18
- var renderMenuButton = function (state) {
19
- var _a = react_utilities_1.getSlots(state, ['root', 'icon', 'menuIcon']),
20
- slots = _a.slots,
21
- slotProps = _a.slotProps;
22
-
23
- var icon = state.icon,
24
- iconOnly = state.iconOnly;
25
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon)));
16
+ const renderMenuButton_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ const {
22
+ icon,
23
+ iconOnly
24
+ } = state;
25
+ return React.createElement(slots.root, { ...slotProps.root
26
+ }, slots.icon && React.createElement(slots.icon, { ...slotProps.icon
27
+ }), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && React.createElement(slots.menuIcon, { ...slotProps.menuIcon
28
+ }));
26
29
  };
27
30
 
28
- exports.renderMenuButton = renderMenuButton;
31
+ exports.renderMenuButton_unstable = renderMenuButton_unstable;
29
32
  //# sourceMappingURL=renderMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAD,EAAuB;AAC/C,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,EAAiC,CAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,CAAjC,CAAvB;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,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,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,KAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAHrC,CADF;AAOD,CAXM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAqB,KAA3B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,IAAc,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,IAAoD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAHvD,CADF;AAOD,CAXM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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/"}
@@ -3,28 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuButton = void 0;
6
+ exports.useMenuButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
11
11
 
12
- var react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
12
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
13
 
14
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
-
16
- var index_1 = /*#__PURE__*/require("../Button/index");
14
+ const index_1 = /*#__PURE__*/require("../Button/index");
17
15
  /**
18
16
  * Given user props, returns the final state for a MenuButton.
19
17
  */
20
18
 
21
19
 
22
- var useMenuButton = function (_a, ref) {
23
- var menuIcon = _a.menuIcon,
24
- props = tslib_1.__rest(_a, ["menuIcon"]);
25
-
26
- var buttonState = index_1.useButton(props, ref);
27
- return tslib_1.__assign(tslib_1.__assign({}, buttonState), {
20
+ const useMenuButton_unstable = ({
21
+ menuIcon,
22
+ ...props
23
+ }, ref) => {
24
+ const buttonState = index_1.useButton_unstable(props, ref);
25
+ return { // Button state
26
+ ...buttonState,
28
27
  // State calculated from a set of props
29
28
  iconOnly: Boolean(!props.children),
30
29
  // Slots definition
@@ -35,12 +34,12 @@ var useMenuButton = function (_a, ref) {
35
34
  },
36
35
  menuIcon: react_utilities_1.resolveShorthand(menuIcon, {
37
36
  defaultProps: {
38
- children: buttonState.size === 'large' ? React.createElement(react_icons_1.ChevronDown24Regular, null) : React.createElement(react_icons_1.ChevronDown20Regular, null)
37
+ children: React.createElement(react_icons_1.ChevronDownRegular, null)
39
38
  },
40
39
  required: true
41
40
  })
42
- });
41
+ };
43
42
  };
44
43
 
45
- exports.useMenuButton = useMenuButton;
44
+ exports.useMenuButton_unstable = useMenuButton_unstable;
46
45
  //# sourceMappingURL=useMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,aAAa,GAAG,UAC3B,EAD2B,EAE3B,GAF2B,EAE0B;AADnD,MAAA,QAAQ,GAAA,EAAA,CAAA,QAAR;AAAA,MAAa,KAAK,GAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAApB,CAAA,UAAA,CAAoB,CAAlB;;AAGF,MAAM,WAAW,GAAG,OAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,CAApB;AACA,SAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EAEK,WAFL,CAAA,EAEgB;AAEd;AACA,IAAA,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,QAAR,CAHH;AAKd;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,QAAQ,EAAE;AAHA,K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aAAA,CAAC,aAAA,CAAA,kBAAD,EAAmB,IAAnB;AADE,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAA3B;AAdL,GAAP;AAqBD,CA1BM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","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/"}
@@ -3,42 +3,66 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuButtonStyles = void 0;
6
+ exports.useMenuButtonStyles_unstable = exports.menuButtonClassNames = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- var useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
- var useMenuIconStyles = /*#__PURE__*/react_make_styles_1.__styles({
12
+ const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
13
+
14
+ exports.menuButtonClassNames = {
15
+ root: 'fui-MenuButton',
16
+ icon: 'fui-MenuButton__icon',
17
+ menuIcon: 'fui-MenuButton__menuIcon'
18
+ };
19
+
20
+ const useMenuIconStyles = /*#__PURE__*/react_1.__styles({
21
+ "base": {
22
+ "Bg96gwp": "fez10in"
23
+ },
13
24
  "small": {
14
- "Be2twd7": "fe5j1ua",
15
- "Bqenvij": "fjamq6b",
16
- "a9b677": "f64fuq3"
25
+ "Be2twd7": "f1ugzwwg",
26
+ "Bqenvij": "fvblgha",
27
+ "Bg96gwp": "fwrc4pm",
28
+ "a9b677": "frx94fk"
17
29
  },
18
30
  "medium": {
19
- "Be2twd7": "fe5j1ua",
20
- "Bqenvij": "fjamq6b",
21
- "a9b677": "f64fuq3"
31
+ "Be2twd7": "f1ugzwwg",
32
+ "Bqenvij": "fvblgha",
33
+ "Bg96gwp": "fwrc4pm",
34
+ "a9b677": "frx94fk"
22
35
  },
23
36
  "large": {
24
- "Be2twd7": "f1rt2boy",
25
- "Bqenvij": "frvgh55",
26
- "a9b677": "fq4mcun"
37
+ "Be2twd7": "f4ybsrx",
38
+ "Bqenvij": "fd461yt",
39
+ "Bg96gwp": "faaz57k",
40
+ "a9b677": "fjw5fx7"
41
+ },
42
+ "notIconOnly": {
43
+ "Frg6f3": ["fbyavb5", "fm0x6gh"]
27
44
  }
28
45
  }, {
29
- "d": [".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
46
+ "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);}"]
30
47
  });
31
48
 
32
- var useMenuButtonStyles = function (state) {
33
- var menuIconStyles = useMenuIconStyles();
49
+ const useMenuButtonStyles_unstable = state => {
50
+ const menuIconStyles = useMenuIconStyles();
51
+ state.root.className = react_1.mergeClasses(exports.menuButtonClassNames.root, state.root.className);
52
+
53
+ if (state.icon) {
54
+ state.icon.className = react_1.mergeClasses(exports.menuButtonClassNames.icon, state.icon.className);
55
+ }
34
56
 
35
57
  if (state.menuIcon) {
36
- state.menuIcon.className = react_make_styles_1.mergeClasses(menuIconStyles[state.size], state.menuIcon.className);
58
+ state.menuIcon.className = react_1.mergeClasses(exports.menuButtonClassNames.menuIcon, menuIconStyles.base, menuIconStyles[state.size], !state.iconOnly && menuIconStyles.notIconOnly, state.menuIcon.className);
37
59
  }
38
60
 
39
- useButtonStyles_1.useButtonStyles(state);
61
+ useButtonStyles_1.useButtonStyles_unstable({ ...state,
62
+ iconPosition: 'before'
63
+ });
40
64
  return state;
41
65
  };
42
66
 
43
- exports.useMenuButtonStyles = useMenuButtonStyles;
67
+ exports.useMenuButtonStyles_unstable = useMenuButtonStyles_unstable;
44
68
  //# sourceMappingURL=useMenuButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,IAAM,iBAAiB,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AAmBO,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,mBAAA,CAAA,YAAA,CAAa,cAAc,CA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AAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,OAAA,CAAA,YAAA,CACzB,OAAA,CAAA,oBAAA,CAAqB,QADI,EAEzB,cAAc,CAAC,IAFU,EAGzB,cAAc,CAAC,KAAK,CAAC,IAAP,CAHW,EAIzB,CAAC,KAAK,CAAC,QAAP,IAAmB,cAAc,CAAC,WAJT,EAKzB,KAAK,CAAC,QAAN,CAAe,SALU,CAA3B;AAOD;;AAED,EAAA,iBAAA,CAAA,wBAAA,CAAyB,EAAE,GAAG,KAAL;AAAY,IAAA,YAAY,EAAE;AAA1B,GAAzB;AAEA,SAAO,KAAP;AACD,CAtBM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","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/"}
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SplitButton = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var renderSplitButton_1 = /*#__PURE__*/require("./renderSplitButton");
10
+ const renderSplitButton_1 = /*#__PURE__*/require("./renderSplitButton");
11
11
 
12
- var useSplitButton_1 = /*#__PURE__*/require("./useSplitButton");
12
+ const useSplitButton_1 = /*#__PURE__*/require("./useSplitButton");
13
13
 
14
- var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
14
+ const useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
15
15
  /**
16
- * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
16
+ * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
17
17
  * action, while interacting with the second one opens a menu with secondary actions.
18
18
  */
19
19
 
20
20
 
21
- exports.SplitButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
22
- var state = useSplitButton_1.useSplitButton(props, ref);
23
- useSplitButtonStyles_1.useSplitButtonStyles(state);
24
- return renderSplitButton_1.renderSplitButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
21
+ exports.SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {
22
+ const state = useSplitButton_1.useSplitButton_unstable(props, ref);
23
+ useSplitButtonStyles_1.useSplitButtonStyles_unstable(state);
24
+ return renderSplitButton_1.renderSplitButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
25
25
  });
26
26
  exports.SplitButton.displayName = 'SplitButton';
27
27
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC5F,MAAM,KAAK,GAAG,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,GAAtB,CAAd;AAEA,EAAA,sBAAA,CAAA,oBAAA,CAAqB,KAArB;AAEA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP,CAL4F,CAM5F;AACD,CAPiE,CAArD;AASb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAChG,QAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,GAA/B,CAAd;AAEA,EAAA,sBAAA,CAAA,6BAAA,CAA8B,KAA9B;AAEA,SAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP,CALgG,CAMhG;AACD,CAPiE,CAArD;AASb,OAAA,CAAA,WAAA,CAAY,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,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useSplitButtonStyles = void 0;
6
+ exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
9
 
10
10
  tslib_1.__exportStar(require("./SplitButton"), exports);
11
11
 
@@ -17,10 +17,16 @@ tslib_1.__exportStar(require("./useSplitButton"), exports);
17
17
 
18
18
  var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
19
19
 
20
- Object.defineProperty(exports, "useSplitButtonStyles", {
20
+ Object.defineProperty(exports, "splitButtonClassNames", {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return useSplitButtonStyles_1.useSplitButtonStyles;
23
+ return useSplitButtonStyles_1.splitButtonClassNames;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "useSplitButtonStyles_unstable", {
27
+ enumerable: true,
28
+ get: function () {
29
+ return useSplitButtonStyles_1.useSplitButtonStyles_unstable;
24
30
  }
25
31
  });
26
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,sBAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,sBAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA;AAAuB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,+BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,sBAAA,CAAA,6BAAA;AAA6B;AAA7B,CAAA","sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -3,25 +3,26 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderSplitButton = void 0;
6
+ exports.renderSplitButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
11
  /**
14
12
  * Renders a SplitButton component by passing the state defined props to the appropriate slots.
15
13
  */
16
14
 
17
15
 
18
- var renderSplitButton = function (state) {
19
- var _a = react_utilities_1.getSlots(state, ['root', 'menuButton', 'primaryActionButton']),
20
- slots = _a.slots,
21
- slotProps = _a.slotProps;
22
-
23
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), React.createElement(slots.primaryActionButton, tslib_1.__assign({}, slotProps.primaryActionButton)), React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton)));
16
+ const renderSplitButton_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ return React.createElement(slots.root, { ...slotProps.root
22
+ }, slots.primaryActionButton && React.createElement(slots.primaryActionButton, { ...slotProps.primaryActionButton
23
+ }), slots.menuButton && React.createElement(slots.menuButton, { ...slotProps.menuButton
24
+ }));
24
25
  };
25
26
 
26
- exports.renderSplitButton = renderSplitButton;
27
+ exports.renderSplitButton_unstable = renderSplitButton_unstable;
27
28
  //# sourceMappingURL=renderSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACjD,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,EAAkC,CAAC,MAAD,EAAS,YAAT,EAAuB,qBAAvB,CAAlC,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,mBAAf,CAA1B,CADF,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CAFF,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,mBAAN,IAA6B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,EAAA,GAAK,SAAS,CAAC;AAAf,GAA1B,CADhC,EAEG,KAAK,CAAC,UAAN,IAAoB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAjB,CAFvB,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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/"}
@@ -3,15 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useSplitButton = void 0;
6
+ exports.useSplitButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
9
 
10
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const Button_1 = /*#__PURE__*/require("../Button/Button");
11
11
 
12
- var Button_1 = /*#__PURE__*/require("../Button/Button");
13
-
14
- var MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
12
+ const MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
15
13
  /**
16
14
  * Given user props, defines default props for the SplitButton and returns processed state.
17
15
  * @param props - User provided props to the SplitButton component.
@@ -19,68 +17,74 @@ var MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
19
17
  */
20
18
 
21
19
 
22
- var useSplitButton = function (props, ref) {
23
- var appearance = props.appearance,
24
- _a = props.block,
25
- block = _a === void 0 ? false : _a,
26
- children = props.children,
27
- _b = props.disabled,
28
- disabled = _b === void 0 ? false : _b,
29
- _c = props.disabledFocusable,
30
- disabledFocusable = _c === void 0 ? false : _c,
31
- icon = props.icon,
32
- _d = props.iconPosition,
33
- iconPosition = _d === void 0 ? 'before' : _d,
34
- menuButton = props.menuButton,
35
- primaryActionButton = props.primaryActionButton,
36
- _e = props.shape,
37
- shape = _e === void 0 ? 'rounded' : _e,
38
- _f = props.size,
39
- size = _f === void 0 ? 'medium' : _f;
40
- var menuButtonShorthand = react_utilities_1.resolveShorthand(menuButton, {
20
+ const useSplitButton_unstable = (props, ref) => {
21
+ const {
22
+ appearance = 'secondary',
23
+ children,
24
+ disabled = false,
25
+ disabledFocusable = false,
26
+ icon,
27
+ iconPosition = 'before',
28
+ menuButton,
29
+ menuIcon,
30
+ primaryActionButton,
31
+ shape = 'rounded',
32
+ size = 'medium'
33
+ } = props;
34
+ const baseId = react_utilities_1.useId('splitButton-');
35
+ const menuButtonShorthand = react_utilities_1.resolveShorthand(menuButton, {
41
36
  defaultProps: {
42
- appearance: appearance,
43
- disabled: disabled,
44
- disabledFocusable: disabledFocusable,
45
- shape: shape,
46
- size: size
47
- }
37
+ appearance,
38
+ disabled,
39
+ disabledFocusable,
40
+ menuIcon,
41
+ shape,
42
+ size
43
+ },
44
+ required: true
48
45
  });
49
- var primaryActionButtonShorthand = react_utilities_1.resolveShorthand(primaryActionButton, {
46
+ const primaryActionButtonShorthand = react_utilities_1.resolveShorthand(primaryActionButton, {
50
47
  defaultProps: {
51
- appearance: appearance,
52
- block: block,
53
- children: children,
54
- disabled: disabled,
55
- disabledFocusable: disabledFocusable,
56
- icon: icon,
57
- iconPosition: iconPosition,
58
- shape: shape,
59
- size: size
60
- }
61
- });
48
+ appearance,
49
+ children,
50
+ disabled,
51
+ disabledFocusable,
52
+ icon,
53
+ iconPosition,
54
+ id: baseId + '__primaryActionButton',
55
+ shape,
56
+ size
57
+ },
58
+ required: true
59
+ }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
60
+ // by the user.
61
+
62
+ if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
63
+ menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
64
+ }
65
+
62
66
  return {
63
67
  // Props passed at the top-level
64
- appearance: appearance,
65
- block: block,
66
- disabled: disabled,
67
- disabledFocusable: disabledFocusable,
68
- iconPosition: iconPosition,
69
- shape: shape,
70
- size: size,
68
+ appearance,
69
+ disabled,
70
+ disabledFocusable,
71
+ iconPosition,
72
+ shape,
73
+ size,
71
74
  // Slots definition
72
75
  components: {
73
76
  root: 'div',
74
77
  menuButton: MenuButton_1.MenuButton,
75
78
  primaryActionButton: Button_1.Button
76
79
  },
77
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({
78
- ref: ref
79
- }, props)),
80
+ root: react_utilities_1.getNativeElementProps('div', {
81
+ ref,
82
+ ...props
83
+ }),
80
84
  menuButton: menuButtonShorthand,
81
85
  primaryActionButton: primaryActionButtonShorthand
82
86
  };
83
87
  };
84
88
 
85
- exports.useSplitButton = useSplitButton;
89
+ exports.useSplitButton_unstable = useSplitButton_unstable;
86
90
  //# sourceMappingURL=useSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/useSplitButton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AATY,KAD2D;AAYzE,IAAA,QAAQ,EAAE;AAZ+D,GAAtC,CAArC,CA7BoB,CA4CpB;AACA;;AACA,MACE,mBAAmB,IACnB,4BADA,IAEA,CAAC,mBAAmB,CAAC,YAAD,CAFpB,IAGA,CAAC,mBAAmB,CAAC,iBAAD,CAJtB,EAKE;AACA,IAAA,mBAAmB,CAAC,iBAAD,CAAnB,GAAyC,4BAA4B,CAAC,EAAtE;AACD;;AAED,SAAO;AACL;AACA,IAAA,UAFK;AAGL,IAAA,QAHK;AAIL,IAAA,iBAJK;AAKL,IAAA,YALK;AAML,IAAA,KANK;AAOL,IAAA,IAPK;AASL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,UAAU,EAAE,YAAA,CAAA,UAFF;AAGV,MAAA,mBAAmB,EAAE,QAAA,CAAA;AAHX,KAVP;AAgBL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAA7B,CAhBD;AAiBL,IAAA,UAAU,EAAE,mBAjBP;AAkBL,IAAA,mBAAmB,EAAE;AAlBhB,GAAP;AAoBD,CA9EM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","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/"}