@fluentui/react-button 1.0.0-beta.8 → 9.0.0-alpha.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (418) hide show
  1. package/CHANGELOG.json +3258 -1
  2. package/CHANGELOG.md +1247 -2
  3. package/README.md +19 -108
  4. package/dist/demo/index.html +71 -0
  5. package/dist/demo/react-dom.development.js +21413 -0
  6. package/dist/demo/react.development.js +3155 -0
  7. package/dist/react-button.d.ts +130 -355
  8. package/lib/Button.js.map +1 -1
  9. package/lib/CompoundButton.js.map +1 -1
  10. package/lib/MenuButton.js.map +1 -1
  11. package/lib/SplitButton.js.map +1 -1
  12. package/lib/ToggleButton.js.map +1 -1
  13. package/lib/common/isConformant.d.ts +4 -2
  14. package/lib/common/isConformant.js +9 -5
  15. package/lib/common/isConformant.js.map +1 -1
  16. package/lib/components/Button/Button.d.ts +4 -5
  17. package/lib/components/Button/Button.js +8 -9
  18. package/lib/components/Button/Button.js.map +1 -1
  19. package/lib/components/Button/Button.types.d.ts +46 -114
  20. package/lib/components/Button/Button.types.js +1 -0
  21. package/lib/components/Button/Button.types.js.map +1 -1
  22. package/lib/components/Button/index.d.ts +3 -3
  23. package/lib/components/Button/index.js +4 -3
  24. package/lib/components/Button/index.js.map +1 -1
  25. package/lib/components/Button/renderButton.d.ts +2 -2
  26. package/lib/components/Button/renderButton.js +10 -10
  27. package/lib/components/Button/renderButton.js.map +1 -1
  28. package/lib/components/Button/useButton.d.ts +5 -10
  29. package/lib/components/Button/useButton.js +49 -24
  30. package/lib/components/Button/useButton.js.map +1 -1
  31. package/lib/components/Button/useButtonStyles.d.ts +10 -0
  32. package/lib/components/Button/useButtonStyles.js +354 -0
  33. package/lib/components/Button/useButtonStyles.js.map +1 -0
  34. package/lib/components/CompoundButton/CompoundButton.d.ts +4 -5
  35. package/lib/components/CompoundButton/CompoundButton.js +8 -11
  36. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  37. package/lib/components/CompoundButton/CompoundButton.types.d.ts +8 -27
  38. package/lib/components/CompoundButton/CompoundButton.types.js +1 -0
  39. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  40. package/lib/components/CompoundButton/index.d.ts +2 -1
  41. package/lib/components/CompoundButton/index.js +3 -1
  42. package/lib/components/CompoundButton/index.js.map +1 -1
  43. package/lib/components/CompoundButton/renderCompoundButton.d.ts +2 -2
  44. package/lib/components/CompoundButton/renderCompoundButton.js +10 -12
  45. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  46. package/lib/components/CompoundButton/useCompoundButton.d.ts +5 -10
  47. package/lib/components/CompoundButton/useCompoundButton.js +25 -28
  48. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  49. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
  50. package/lib/components/CompoundButton/useCompoundButtonStyles.js +164 -0
  51. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
  52. package/lib/components/MenuButton/MenuButton.d.ts +4 -5
  53. package/lib/components/MenuButton/MenuButton.js +8 -21
  54. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  55. package/lib/components/MenuButton/MenuButton.types.d.ts +7 -50
  56. package/lib/components/MenuButton/MenuButton.types.js +1 -0
  57. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  58. package/lib/components/MenuButton/index.d.ts +2 -3
  59. package/lib/components/MenuButton/index.js +3 -3
  60. package/lib/components/MenuButton/index.js.map +1 -1
  61. package/lib/components/MenuButton/renderMenuButton.d.ts +2 -4
  62. package/lib/components/MenuButton/renderMenuButton.js +10 -14
  63. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  64. package/lib/components/MenuButton/useMenuButton.d.ts +3 -7
  65. package/lib/components/MenuButton/useMenuButton.js +28 -22
  66. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  67. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
  68. package/lib/components/MenuButton/useMenuButtonStyles.js +34 -0
  69. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -0
  70. package/lib/components/SplitButton/SplitButton.d.ts +5 -5
  71. package/lib/components/SplitButton/SplitButton.js +9 -22
  72. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  73. package/lib/components/SplitButton/SplitButton.types.d.ts +12 -28
  74. package/lib/components/SplitButton/SplitButton.types.js +1 -0
  75. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  76. package/lib/components/SplitButton/index.d.ts +3 -2
  77. package/lib/components/SplitButton/index.js +3 -1
  78. package/lib/components/SplitButton/index.js.map +1 -1
  79. package/lib/components/SplitButton/renderSplitButton.d.ts +2 -4
  80. package/lib/components/SplitButton/renderSplitButton.js +8 -10
  81. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  82. package/lib/components/SplitButton/useSplitButton.d.ts +5 -7
  83. package/lib/components/SplitButton/useSplitButton.js +69 -47
  84. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  85. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  86. package/lib/components/SplitButton/useSplitButtonStyles.js +77 -0
  87. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  88. package/lib/components/ToggleButton/ToggleButton.d.ts +4 -5
  89. package/lib/components/ToggleButton/ToggleButton.js +8 -11
  90. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  91. package/lib/components/ToggleButton/ToggleButton.types.d.ts +11 -17
  92. package/lib/components/ToggleButton/ToggleButton.types.js +1 -0
  93. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  94. package/lib/components/ToggleButton/index.d.ts +3 -3
  95. package/lib/components/ToggleButton/index.js +4 -3
  96. package/lib/components/ToggleButton/index.js.map +1 -1
  97. package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -0
  98. package/lib/components/ToggleButton/renderToggleButton.js +2 -0
  99. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -0
  100. package/lib/components/ToggleButton/useToggleButton.d.ts +8 -5
  101. package/lib/components/ToggleButton/useToggleButton.js +47 -5
  102. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  103. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
  104. package/lib/components/ToggleButton/useToggleButtonStyles.js +190 -0
  105. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
  106. package/lib/index.d.ts +0 -1
  107. package/lib/index.js +0 -1
  108. package/lib/index.js.map +1 -1
  109. package/lib/tsdoc-metadata.json +1 -1
  110. package/lib-commonjs/Button.js +7 -2
  111. package/lib-commonjs/Button.js.map +1 -1
  112. package/lib-commonjs/CompoundButton.js +7 -2
  113. package/lib-commonjs/CompoundButton.js.map +1 -1
  114. package/lib-commonjs/MenuButton.js +7 -2
  115. package/lib-commonjs/MenuButton.js.map +1 -1
  116. package/lib-commonjs/SplitButton.js +7 -2
  117. package/lib-commonjs/SplitButton.js.map +1 -1
  118. package/lib-commonjs/ToggleButton.js +7 -2
  119. package/lib-commonjs/ToggleButton.js.map +1 -1
  120. package/lib-commonjs/common/isConformant.d.ts +4 -2
  121. package/lib-commonjs/common/isConformant.js +19 -7
  122. package/lib-commonjs/common/isConformant.js.map +1 -1
  123. package/lib-commonjs/components/Button/Button.d.ts +4 -5
  124. package/lib-commonjs/components/Button/Button.js +20 -12
  125. package/lib-commonjs/components/Button/Button.js.map +1 -1
  126. package/lib-commonjs/components/Button/Button.types.d.ts +46 -114
  127. package/lib-commonjs/components/Button/Button.types.js +4 -1
  128. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  129. package/lib-commonjs/components/Button/index.d.ts +3 -3
  130. package/lib-commonjs/components/Button/index.js +23 -5
  131. package/lib-commonjs/components/Button/index.js.map +1 -1
  132. package/lib-commonjs/components/Button/renderButton.d.ts +2 -2
  133. package/lib-commonjs/components/Button/renderButton.js +24 -14
  134. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  135. package/lib-commonjs/components/Button/useButton.d.ts +5 -10
  136. package/lib-commonjs/components/Button/useButton.js +59 -25
  137. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  138. package/lib-commonjs/components/Button/useButtonStyles.d.ts +10 -0
  139. package/lib-commonjs/components/Button/useButtonStyles.js +365 -0
  140. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -0
  141. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +4 -5
  142. package/lib-commonjs/components/CompoundButton/CompoundButton.js +20 -14
  143. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  144. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +8 -27
  145. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +4 -1
  146. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  147. package/lib-commonjs/components/CompoundButton/index.d.ts +2 -1
  148. package/lib-commonjs/components/CompoundButton/index.js +22 -3
  149. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  150. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +2 -2
  151. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +24 -16
  152. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  153. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +5 -10
  154. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +35 -28
  155. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  156. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
  157. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +175 -0
  158. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
  159. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +4 -5
  160. package/lib-commonjs/components/MenuButton/MenuButton.js +20 -24
  161. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  162. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +7 -50
  163. package/lib-commonjs/components/MenuButton/MenuButton.types.js +4 -1
  164. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  165. package/lib-commonjs/components/MenuButton/index.d.ts +2 -3
  166. package/lib-commonjs/components/MenuButton/index.js +22 -5
  167. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  168. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +2 -4
  169. package/lib-commonjs/components/MenuButton/renderMenuButton.js +24 -18
  170. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  171. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +3 -7
  172. package/lib-commonjs/components/MenuButton/useMenuButton.js +41 -23
  173. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  174. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
  175. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +44 -0
  176. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -0
  177. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +5 -5
  178. package/lib-commonjs/components/SplitButton/SplitButton.js +21 -25
  179. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  180. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +12 -28
  181. package/lib-commonjs/components/SplitButton/SplitButton.types.js +4 -1
  182. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  183. package/lib-commonjs/components/SplitButton/index.d.ts +3 -2
  184. package/lib-commonjs/components/SplitButton/index.js +22 -3
  185. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  186. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +2 -4
  187. package/lib-commonjs/components/SplitButton/renderSplitButton.js +22 -14
  188. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  189. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +5 -7
  190. package/lib-commonjs/components/SplitButton/useSplitButton.js +81 -48
  191. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  192. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  193. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +88 -0
  194. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  195. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +4 -5
  196. package/lib-commonjs/components/ToggleButton/ToggleButton.js +20 -14
  197. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  198. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +11 -17
  199. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +4 -1
  200. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  201. package/lib-commonjs/components/ToggleButton/index.d.ts +3 -3
  202. package/lib-commonjs/components/ToggleButton/index.js +23 -5
  203. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  204. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -0
  205. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +16 -0
  206. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -0
  207. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +8 -5
  208. package/lib-commonjs/components/ToggleButton/useToggleButton.js +60 -7
  209. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  210. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
  211. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +200 -0
  212. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
  213. package/lib-commonjs/index.d.ts +0 -1
  214. package/lib-commonjs/index.js +11 -3
  215. package/lib-commonjs/index.js.map +1 -1
  216. package/package.json +37 -35
  217. package/config/api-extractor.json +0 -3
  218. package/config/pre-copy.json +0 -9
  219. package/config/tests.js +0 -11
  220. package/etc/react-button.api.md +0 -335
  221. package/just.config.ts +0 -3
  222. package/lib/components/Button/useButtonClasses.d.ts +0 -29
  223. package/lib/components/Button/useButtonClasses.js +0 -417
  224. package/lib/components/Button/useButtonClasses.js.map +0 -1
  225. package/lib/components/Button/useButtonState.d.ts +0 -6
  226. package/lib/components/Button/useButtonState.js +0 -28
  227. package/lib/components/Button/useButtonState.js.map +0 -1
  228. package/lib/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
  229. package/lib/components/CompoundButton/useCompoundButtonClasses.js +0 -180
  230. package/lib/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
  231. package/lib/components/MenuButton/useExpanded.d.ts +0 -18
  232. package/lib/components/MenuButton/useExpanded.js +0 -61
  233. package/lib/components/MenuButton/useExpanded.js.map +0 -1
  234. package/lib/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
  235. package/lib/components/MenuButton/useMenuButtonClasses.js +0 -78
  236. package/lib/components/MenuButton/useMenuButtonClasses.js.map +0 -1
  237. package/lib/components/MenuButton/useMenuButtonState.d.ts +0 -2
  238. package/lib/components/MenuButton/useMenuButtonState.js +0 -9
  239. package/lib/components/MenuButton/useMenuButtonState.js.map +0 -1
  240. package/lib/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
  241. package/lib/components/SplitButton/useSplitButtonClasses.js +0 -123
  242. package/lib/components/SplitButton/useSplitButtonClasses.js.map +0 -1
  243. package/lib/components/ToggleButton/useChecked.d.ts +0 -14
  244. package/lib/components/ToggleButton/useChecked.js +0 -25
  245. package/lib/components/ToggleButton/useChecked.js.map +0 -1
  246. package/lib/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
  247. package/lib/components/ToggleButton/useToggleButtonClasses.js +0 -130
  248. package/lib/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
  249. package/lib/utils/tempTypes.d.ts +0 -33
  250. package/lib/utils/tempTypes.js +0 -4
  251. package/lib/utils/tempTypes.js.map +0 -1
  252. package/lib/version.d.ts +0 -1
  253. package/lib/version.js +0 -5
  254. package/lib/version.js.map +0 -1
  255. package/lib-amd/Button.d.ts +0 -1
  256. package/lib-amd/Button.js +0 -6
  257. package/lib-amd/Button.js.map +0 -1
  258. package/lib-amd/CompoundButton.d.ts +0 -1
  259. package/lib-amd/CompoundButton.js +0 -6
  260. package/lib-amd/CompoundButton.js.map +0 -1
  261. package/lib-amd/MenuButton.d.ts +0 -1
  262. package/lib-amd/MenuButton.js +0 -6
  263. package/lib-amd/MenuButton.js.map +0 -1
  264. package/lib-amd/SplitButton.d.ts +0 -1
  265. package/lib-amd/SplitButton.js +0 -6
  266. package/lib-amd/SplitButton.js.map +0 -1
  267. package/lib-amd/ToggleButton.d.ts +0 -1
  268. package/lib-amd/ToggleButton.js +0 -6
  269. package/lib-amd/ToggleButton.js.map +0 -1
  270. package/lib-amd/common/isConformant.d.ts +0 -2
  271. package/lib-amd/common/isConformant.js +0 -13
  272. package/lib-amd/common/isConformant.js.map +0 -1
  273. package/lib-amd/components/Button/Button.d.ts +0 -7
  274. package/lib-amd/components/Button/Button.js +0 -16
  275. package/lib-amd/components/Button/Button.js.map +0 -1
  276. package/lib-amd/components/Button/Button.types.d.ts +0 -130
  277. package/lib-amd/components/Button/Button.types.js +0 -5
  278. package/lib-amd/components/Button/Button.types.js.map +0 -1
  279. package/lib-amd/components/Button/index.d.ts +0 -5
  280. package/lib-amd/components/Button/index.js +0 -9
  281. package/lib-amd/components/Button/index.js.map +0 -1
  282. package/lib-amd/components/Button/renderButton.d.ts +0 -5
  283. package/lib-amd/components/Button/renderButton.js +0 -17
  284. package/lib-amd/components/Button/renderButton.js.map +0 -1
  285. package/lib-amd/components/Button/useButton.d.ts +0 -13
  286. package/lib-amd/components/Button/useButton.js +0 -28
  287. package/lib-amd/components/Button/useButton.js.map +0 -1
  288. package/lib-amd/components/Button/useButtonClasses.d.ts +0 -29
  289. package/lib-amd/components/Button/useButtonClasses.js +0 -417
  290. package/lib-amd/components/Button/useButtonClasses.js.map +0 -1
  291. package/lib-amd/components/Button/useButtonState.d.ts +0 -6
  292. package/lib-amd/components/Button/useButtonState.js +0 -32
  293. package/lib-amd/components/Button/useButtonState.js.map +0 -1
  294. package/lib-amd/components/CompoundButton/CompoundButton.d.ts +0 -7
  295. package/lib-amd/components/CompoundButton/CompoundButton.js +0 -17
  296. package/lib-amd/components/CompoundButton/CompoundButton.js.map +0 -1
  297. package/lib-amd/components/CompoundButton/CompoundButton.types.d.ts +0 -33
  298. package/lib-amd/components/CompoundButton/CompoundButton.types.js +0 -5
  299. package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +0 -1
  300. package/lib-amd/components/CompoundButton/index.d.ts +0 -4
  301. package/lib-amd/components/CompoundButton/index.js +0 -8
  302. package/lib-amd/components/CompoundButton/index.js.map +0 -1
  303. package/lib-amd/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  304. package/lib-amd/components/CompoundButton/renderCompoundButton.js +0 -19
  305. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +0 -1
  306. package/lib-amd/components/CompoundButton/useCompoundButton.d.ts +0 -13
  307. package/lib-amd/components/CompoundButton/useCompoundButton.js +0 -32
  308. package/lib-amd/components/CompoundButton/useCompoundButton.js.map +0 -1
  309. package/lib-amd/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
  310. package/lib-amd/components/CompoundButton/useCompoundButtonClasses.js +0 -182
  311. package/lib-amd/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
  312. package/lib-amd/components/MenuButton/MenuButton.d.ts +0 -7
  313. package/lib-amd/components/MenuButton/MenuButton.js +0 -26
  314. package/lib-amd/components/MenuButton/MenuButton.js.map +0 -1
  315. package/lib-amd/components/MenuButton/MenuButton.types.d.ts +0 -54
  316. package/lib-amd/components/MenuButton/MenuButton.types.js +0 -5
  317. package/lib-amd/components/MenuButton/MenuButton.types.js.map +0 -1
  318. package/lib-amd/components/MenuButton/index.d.ts +0 -6
  319. package/lib-amd/components/MenuButton/index.js +0 -10
  320. package/lib-amd/components/MenuButton/index.js.map +0 -1
  321. package/lib-amd/components/MenuButton/renderMenuButton.d.ts +0 -7
  322. package/lib-amd/components/MenuButton/renderMenuButton.js +0 -21
  323. package/lib-amd/components/MenuButton/renderMenuButton.js.map +0 -1
  324. package/lib-amd/components/MenuButton/useExpanded.d.ts +0 -18
  325. package/lib-amd/components/MenuButton/useExpanded.js +0 -62
  326. package/lib-amd/components/MenuButton/useExpanded.js.map +0 -1
  327. package/lib-amd/components/MenuButton/useMenuButton.d.ts +0 -10
  328. package/lib-amd/components/MenuButton/useMenuButton.js +0 -27
  329. package/lib-amd/components/MenuButton/useMenuButton.js.map +0 -1
  330. package/lib-amd/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
  331. package/lib-amd/components/MenuButton/useMenuButtonClasses.js +0 -81
  332. package/lib-amd/components/MenuButton/useMenuButtonClasses.js.map +0 -1
  333. package/lib-amd/components/MenuButton/useMenuButtonState.d.ts +0 -2
  334. package/lib-amd/components/MenuButton/useMenuButtonState.js +0 -11
  335. package/lib-amd/components/MenuButton/useMenuButtonState.js.map +0 -1
  336. package/lib-amd/components/SplitButton/SplitButton.d.ts +0 -7
  337. package/lib-amd/components/SplitButton/SplitButton.js +0 -26
  338. package/lib-amd/components/SplitButton/SplitButton.js.map +0 -1
  339. package/lib-amd/components/SplitButton/SplitButton.types.d.ts +0 -35
  340. package/lib-amd/components/SplitButton/SplitButton.types.js +0 -5
  341. package/lib-amd/components/SplitButton/SplitButton.types.js.map +0 -1
  342. package/lib-amd/components/SplitButton/index.d.ts +0 -4
  343. package/lib-amd/components/SplitButton/index.js +0 -8
  344. package/lib-amd/components/SplitButton/index.js.map +0 -1
  345. package/lib-amd/components/SplitButton/renderSplitButton.d.ts +0 -7
  346. package/lib-amd/components/SplitButton/renderSplitButton.js +0 -17
  347. package/lib-amd/components/SplitButton/renderSplitButton.js.map +0 -1
  348. package/lib-amd/components/SplitButton/useSplitButton.d.ts +0 -10
  349. package/lib-amd/components/SplitButton/useSplitButton.js +0 -50
  350. package/lib-amd/components/SplitButton/useSplitButton.js.map +0 -1
  351. package/lib-amd/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
  352. package/lib-amd/components/SplitButton/useSplitButtonClasses.js +0 -123
  353. package/lib-amd/components/SplitButton/useSplitButtonClasses.js.map +0 -1
  354. package/lib-amd/components/ToggleButton/ToggleButton.d.ts +0 -7
  355. package/lib-amd/components/ToggleButton/ToggleButton.js +0 -17
  356. package/lib-amd/components/ToggleButton/ToggleButton.js.map +0 -1
  357. package/lib-amd/components/ToggleButton/ToggleButton.types.d.ts +0 -25
  358. package/lib-amd/components/ToggleButton/ToggleButton.types.js +0 -5
  359. package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +0 -1
  360. package/lib-amd/components/ToggleButton/index.d.ts +0 -5
  361. package/lib-amd/components/ToggleButton/index.js +0 -9
  362. package/lib-amd/components/ToggleButton/index.js.map +0 -1
  363. package/lib-amd/components/ToggleButton/useChecked.d.ts +0 -14
  364. package/lib-amd/components/ToggleButton/useChecked.js +0 -27
  365. package/lib-amd/components/ToggleButton/useChecked.js.map +0 -1
  366. package/lib-amd/components/ToggleButton/useToggleButton.d.ts +0 -6
  367. package/lib-amd/components/ToggleButton/useToggleButton.js +0 -10
  368. package/lib-amd/components/ToggleButton/useToggleButton.js.map +0 -1
  369. package/lib-amd/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
  370. package/lib-amd/components/ToggleButton/useToggleButtonClasses.js +0 -132
  371. package/lib-amd/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
  372. package/lib-amd/index.d.ts +0 -6
  373. package/lib-amd/index.js +0 -10
  374. package/lib-amd/index.js.map +0 -1
  375. package/lib-amd/utils/tempTypes.d.ts +0 -33
  376. package/lib-amd/utils/tempTypes.js +0 -8
  377. package/lib-amd/utils/tempTypes.js.map +0 -1
  378. package/lib-amd/version.d.ts +0 -1
  379. package/lib-amd/version.js +0 -6
  380. package/lib-amd/version.js.map +0 -1
  381. package/lib-commonjs/components/Button/useButtonClasses.d.ts +0 -29
  382. package/lib-commonjs/components/Button/useButtonClasses.js +0 -419
  383. package/lib-commonjs/components/Button/useButtonClasses.js.map +0 -1
  384. package/lib-commonjs/components/Button/useButtonState.d.ts +0 -6
  385. package/lib-commonjs/components/Button/useButtonState.js +0 -30
  386. package/lib-commonjs/components/Button/useButtonState.js.map +0 -1
  387. package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
  388. package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.js +0 -182
  389. package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
  390. package/lib-commonjs/components/MenuButton/useExpanded.d.ts +0 -18
  391. package/lib-commonjs/components/MenuButton/useExpanded.js +0 -63
  392. package/lib-commonjs/components/MenuButton/useExpanded.js.map +0 -1
  393. package/lib-commonjs/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
  394. package/lib-commonjs/components/MenuButton/useMenuButtonClasses.js +0 -80
  395. package/lib-commonjs/components/MenuButton/useMenuButtonClasses.js.map +0 -1
  396. package/lib-commonjs/components/MenuButton/useMenuButtonState.d.ts +0 -2
  397. package/lib-commonjs/components/MenuButton/useMenuButtonState.js +0 -11
  398. package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +0 -1
  399. package/lib-commonjs/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
  400. package/lib-commonjs/components/SplitButton/useSplitButtonClasses.js +0 -125
  401. package/lib-commonjs/components/SplitButton/useSplitButtonClasses.js.map +0 -1
  402. package/lib-commonjs/components/ToggleButton/useChecked.d.ts +0 -14
  403. package/lib-commonjs/components/ToggleButton/useChecked.js +0 -27
  404. package/lib-commonjs/components/ToggleButton/useChecked.js.map +0 -1
  405. package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
  406. package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.js +0 -132
  407. package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
  408. package/lib-commonjs/utils/tempTypes.d.ts +0 -33
  409. package/lib-commonjs/utils/tempTypes.js +0 -6
  410. package/lib-commonjs/utils/tempTypes.js.map +0 -1
  411. package/lib-commonjs/version.d.ts +0 -1
  412. package/lib-commonjs/version.js +0 -7
  413. package/lib-commonjs/version.js.map +0 -1
  414. package/src/components/Button/Button.types.ts +0 -166
  415. package/src/components/CompoundButton/CompoundButton.types.ts +0 -37
  416. package/src/components/MenuButton/MenuButton.types.ts +0 -63
  417. package/src/components/SplitButton/SplitButton.types.ts +0 -41
  418. package/src/components/ToggleButton/ToggleButton.types.ts +0 -29
@@ -1,28 +1,46 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var index_1 = require("@fluentui/react-compose/lib-commonjs/next/index");
4
- var useMenuButtonState_1 = require("./useMenuButtonState");
5
- var renderMenuButton_1 = require("./renderMenuButton");
6
- exports.menuButtonShorthandProps = ['icon', 'content', 'menuIcon', 'menu'];
7
- var mergeProps = index_1.makeMergeProps({ deepMerge: exports.menuButtonShorthandProps });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMenuButton = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ var React = /*#__PURE__*/require("react");
11
+
12
+ var react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
13
+
14
+ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
+
16
+ var index_1 = /*#__PURE__*/require("../Button/index");
8
17
  /**
9
- * Redefine the component factory, reusing button factory.
18
+ * Given user props, returns the final state for a MenuButton.
10
19
  */
11
- exports.useMenuButton = function (props, ref, defaultProps) {
12
- // Note: because menu button's template and slots are different, we can't reuse
13
- // those, but the useMenuButtonState hook can reuse useButtonState.
14
- var state = mergeProps({
15
- ref: ref,
16
- as: 'button',
17
- icon: { as: 'span' },
18
- content: { as: 'span', children: props.children },
19
- menuIcon: { as: 'span' },
20
- menu: { as: 'span' },
21
- }, defaultProps, index_1.resolveShorthandProps(props, exports.menuButtonShorthandProps));
22
- useMenuButtonState_1.useMenuButtonState(state);
23
- return {
24
- state: state,
25
- render: renderMenuButton_1.renderMenuButton,
26
- };
20
+
21
+
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), {
28
+ // State calculated from a set of props
29
+ iconOnly: Boolean(!props.children),
30
+ // Slots definition
31
+ components: {
32
+ root: 'button',
33
+ icon: 'span',
34
+ menuIcon: 'span'
35
+ },
36
+ menuIcon: react_utilities_1.resolveShorthand(menuIcon, {
37
+ defaultProps: {
38
+ children: buttonState.size === 'large' ? React.createElement(react_icons_1.ChevronDown24Regular, null) : React.createElement(react_icons_1.ChevronDown20Regular, null)
39
+ },
40
+ required: true
41
+ })
42
+ });
27
43
  };
44
+
45
+ exports.useMenuButton = useMenuButton;
28
46
  //# sourceMappingURL=useMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;AACA,gEAA+F;AAE/F,2DAA0D;AAC1D,uDAAsD;AAEzC,QAAA,wBAAwB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAEhF,IAAM,UAAU,GAAG,sBAAc,CAAC,EAAE,SAAS,EAAE,gCAAwB,EAAE,CAAC,CAAC;AAE3E;;GAEG;AACU,QAAA,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;IAC/G,+EAA+E;IAC/E,mEAAmE;IACnE,IAAM,KAAK,GAAG,UAAU,CACtB;QACE,GAAG,KAAA;QACH,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACpB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;QACjD,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACxB,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;KACrB,EACD,YAAY,EACZ,6BAAqB,CAAC,KAAK,EAAE,gCAAwB,CAAC,CACpC,CAAC;IAErB,uCAAkB,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO;QACL,KAAK,OAAA;QACL,MAAM,EAAE,mCAAgB;KACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';\nimport { MenuButtonProps, MenuButtonState } from './MenuButton.types';\nimport { useMenuButtonState } from './useMenuButtonState';\nimport { renderMenuButton } from './renderMenuButton';\n\nexport const menuButtonShorthandProps = ['icon', 'content', 'menuIcon', 'menu'];\n\nconst mergeProps = makeMergeProps({ deepMerge: menuButtonShorthandProps });\n\n/**\n * Redefine the component factory, reusing button factory.\n */\nexport const useMenuButton = (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps) => {\n // Note: because menu button's template and slots are different, we can't reuse\n // those, but the useMenuButtonState hook can reuse useButtonState.\n const state = mergeProps(\n {\n ref,\n as: 'button',\n icon: { as: 'span' },\n content: { as: 'span', children: props.children },\n menuIcon: { as: 'span' },\n menu: { as: 'span' },\n },\n defaultProps,\n resolveShorthandProps(props, menuButtonShorthandProps),\n ) as MenuButtonState;\n\n useMenuButtonState(state);\n\n return {\n state,\n render: renderMenuButton,\n };\n};\n"]}
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,KANE;AAYd,IAAA,QAAQ,EAAE,iBAAA,CAAA,gBAAA,CAAiB,QAAjB,EAA2B;AACnC,MAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,EAAE,WAAW,CAAC,IAAZ,KAAqB,OAArB,GAA+B,KAAA,CAAA,aAAA,CAAC,aAAA,CAAA,oBAAD,EAAqB,IAArB,CAA/B,GAA0D,KAAA,CAAA,aAAA,CAAC,aAAA,CAAA,oBAAD,EAAqB,IAArB;AADxD,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAA3B;AAZI,GAFhB,CAAA;AAqBD,CA1BM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { MenuButtonState } from './MenuButton.types';
2
+ export declare const useMenuButtonStyles: (state: MenuButtonState) => MenuButtonState;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMenuButtonStyles = void 0;
7
+
8
+ var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
9
+
10
+ var useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
11
+
12
+ var useMenuIconStyles = /*#__PURE__*/react_make_styles_1.__styles({
13
+ "small": {
14
+ "Be2twd7": "fe5j1ua",
15
+ "Bqenvij": "fjamq6b",
16
+ "a9b677": "f64fuq3"
17
+ },
18
+ "medium": {
19
+ "Be2twd7": "fe5j1ua",
20
+ "Bqenvij": "fjamq6b",
21
+ "a9b677": "f64fuq3"
22
+ },
23
+ "large": {
24
+ "Be2twd7": "f1rt2boy",
25
+ "Bqenvij": "frvgh55",
26
+ "a9b677": "fq4mcun"
27
+ }
28
+ }, {
29
+ "d": [".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
30
+ });
31
+
32
+ var useMenuButtonStyles = function (state) {
33
+ var menuIconStyles = useMenuIconStyles();
34
+
35
+ if (state.menuIcon) {
36
+ state.menuIcon.className = react_make_styles_1.mergeClasses(menuIconStyles[state.size], state.menuIcon.className);
37
+ }
38
+
39
+ useButtonStyles_1.useButtonStyles(state);
40
+ return state;
41
+ };
42
+
43
+ exports.useMenuButtonStyles = useMenuButtonStyles;
44
+ //# sourceMappingURL=useMenuButtonStyles.js.map
@@ -0,0 +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,CAAC,KAAK,CAAC,IAAP,CAA3B,EAAyC,KAAK,CAAC,QAAN,CAAe,SAAxD,CAA3B;AACD;;AAED,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CATM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","sourceRoot":""}
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
2
- import { SplitButtonProps } from './SplitButton.types';
1
+ import type { SplitButtonProps } from './SplitButton.types';
2
+ import { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled SplitButton, using the `useSplitButton` hook.
5
- * {@docCategory Button}
4
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
5
+ * action, while interacting with the second one opens a menu with secondary actions.
6
6
  */
7
- export declare const SplitButton: React.ForwardRefExoticComponent<Pick<SplitButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
7
+ export declare const SplitButton: ForwardRefComponent<SplitButtonProps>;
@@ -1,31 +1,27 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var React = require("react");
4
- var react_icons_mdl2_1 = require("@fluentui/react-icons-mdl2");
5
- var react_theme_provider_1 = require("@fluentui/react-theme-provider");
6
- var useSplitButton_1 = require("./useSplitButton");
7
- var useSplitButtonClasses_1 = require("./useSplitButtonClasses");
8
- var index_1 = require("../Button/index");
9
- var index_2 = require("../MenuButton/index");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SplitButton = void 0;
7
+
8
+ var React = /*#__PURE__*/require("react");
9
+
10
+ var renderSplitButton_1 = /*#__PURE__*/require("./renderSplitButton");
11
+
12
+ var useSplitButton_1 = /*#__PURE__*/require("./useSplitButton");
13
+
14
+ var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
10
15
  /**
11
- * Define a styled SplitButton, using the `useSplitButton` hook.
12
- * {@docCategory Button}
16
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
17
+ * action, while interacting with the second one opens a menu with secondary actions.
13
18
  */
14
- exports.SplitButton = React.forwardRef(function (props, ref) {
15
- var _a = useSplitButton_1.useSplitButton(props, ref, {
16
- button: { as: index_1.Button },
17
- menuButton: { as: index_2.MenuButton, iconOnly: true, icon: React.createElement(react_icons_mdl2_1.ChevronDownIcon, null) },
18
- }), state = _a.state, render = _a.render;
19
- useSplitButtonClasses_1.useSplitButtonClasses(state);
20
- // TODO remove any
21
- /**
22
- * Type 'SplitButtonState' has no properties in common with type '{
23
- * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
24
- * | undefined; }
25
- */
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- react_theme_provider_1.useInlineTokens(state, '--button');
28
- return render(state);
19
+
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
29
25
  });
30
26
  exports.SplitButton.displayName = 'SplitButton';
31
27
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;AAAA,6BAA+B;AAC/B,+DAA6D;AAC7D,uEAAiE;AAEjE,mDAAkD;AAClD,iEAAgE;AAChE,yCAAyC;AACzC,6CAAiD;AAEjD;;;GAGG;AACU,QAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;IAC9E,IAAA;;;MAGJ,EAHM,gBAAK,EAAE,kBAGb,CAAC;IAEH,6CAAqB,CAAC,KAAK,CAAC,CAAC;IAE7B,kBAAkB;IAClB;;;;OAIG;IACH,8DAA8D;IAC9D,sCAAe,CAAC,KAAY,EAAE,UAAU,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from '@fluentui/react-icons-mdl2';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { SplitButtonProps } from './SplitButton.types';\nimport { useSplitButton } from './useSplitButton';\nimport { useSplitButtonClasses } from './useSplitButtonClasses';\nimport { Button } from '../Button/index';\nimport { MenuButton } from '../MenuButton/index';\n\n/**\n * Define a styled SplitButton, using the `useSplitButton` hook.\n * {@docCategory Button}\n */\nexport const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>((props, ref) => {\n const { state, render } = useSplitButton(props, ref, {\n button: { as: Button },\n menuButton: { as: MenuButton, iconOnly: true, icon: <ChevronDownIcon /> },\n });\n\n useSplitButtonClasses(state);\n\n // TODO remove any\n /**\n * Type 'SplitButtonState' has no properties in common with type '{\n * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }\n * | undefined; }\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useInlineTokens(state as any, '--button');\n\n return render(state);\n});\n\nSplitButton.displayName = 'SplitButton';\n"]}
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,35 +1,19 @@
1
- import * as React from 'react';
2
- import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { ButtonProps, ButtonVariants } from '../Button/Button.types';
4
- import { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';
5
- /**
6
- * {@docCategory Button}
7
- */
8
- export interface SplitButtonProps extends ButtonProps, MenuButtonProps {
1
+ import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
2
+ import type { ButtonProps, ButtonState } from '../Button/Button.types';
3
+ import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';
4
+ export declare type SplitButtonSlots = {
9
5
  /**
10
- * Button to perform primary action in SplitButton.
6
+ * Root of the component that wraps the primary action button and menu button.
11
7
  */
12
- button?: ShorthandProps;
8
+ root: IntrinsicShorthandProps<'div'>;
13
9
  /**
14
- * Divider that separates the primary action button and the menu button parts of the SplitButton
10
+ * Button that opens menu with secondary actions in SplitButton.
15
11
  */
16
- divider?: ShorthandProps;
12
+ menuButton?: ObjectShorthandProps<MenuButtonProps>;
17
13
  /**
18
- * Button that opens menu with secondary actions in SplitButton.
14
+ * Button to perform primary action in SplitButton.
19
15
  */
20
- menuButton?: ShorthandProps;
21
- }
22
- export interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {
23
- menuButtonRef?: React.RefObject<HTMLButtonElement>;
24
- }
25
- /**
26
- * {@docCategory Button}
27
- */
28
- export declare type SplitButtonTokens = MenuButtonTokens & {
29
- dividerColor?: string;
30
- dividerThickness?: string;
16
+ primaryActionButton?: ObjectShorthandProps<ButtonProps>;
31
17
  };
32
- /**
33
- * {@docCategory Button}
34
- */
35
- export declare type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;
18
+ export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
19
+ export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  //# sourceMappingURL=SplitButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps, ButtonVariants } from '../Button/Button.types';\nimport { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface SplitButtonProps extends ButtonProps, MenuButtonProps {\n /**\n * Button to perform primary action in SplitButton.\n */\n button?: ShorthandProps;\n\n /**\n * Divider that separates the primary action button and the menu button parts of the SplitButton\n */\n divider?: ShorthandProps;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: ShorthandProps;\n}\n\nexport interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {\n menuButtonRef?: React.RefObject<HTMLButtonElement>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonTokens = MenuButtonTokens & {\n dividerColor?: string;\n dividerThickness?: string;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
@@ -1,4 +1,5 @@
1
- export * from './SplitButton.types';
2
1
  export * from './SplitButton';
2
+ export * from './SplitButton.types';
3
+ export * from './renderSplitButton';
3
4
  export * from './useSplitButton';
4
- export * from './useSplitButtonClasses';
5
+ export { useSplitButtonStyles } from './useSplitButtonStyles';
@@ -1,7 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSplitButtonStyles = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
4
10
  tslib_1.__exportStar(require("./SplitButton"), exports);
11
+
12
+ tslib_1.__exportStar(require("./SplitButton.types"), exports);
13
+
14
+ tslib_1.__exportStar(require("./renderSplitButton"), exports);
15
+
5
16
  tslib_1.__exportStar(require("./useSplitButton"), exports);
6
- tslib_1.__exportStar(require("./useSplitButtonClasses"), exports);
17
+
18
+ var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
19
+
20
+ Object.defineProperty(exports, "useSplitButtonStyles", {
21
+ enumerable: true,
22
+ get: function () {
23
+ return useSplitButtonStyles_1.useSplitButtonStyles;
24
+ }
25
+ });
7
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;AACA,wDAA8B;AAC9B,2DAAiC;AACjC,kEAAwC","sourcesContent":["export * from './SplitButton.types';\nexport * from './SplitButton';\nexport * from './useSplitButton';\nexport * from './useSplitButtonClasses';\n"]}
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,7 +1,5 @@
1
- import { SplitButtonState } from './SplitButton.types';
1
+ import type { SplitButtonState } from './SplitButton.types';
2
2
  /**
3
- * Redefine the render function to add slots. Reuse the button structure but add
4
- * slots to children.
5
- * @param state
3
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
6
4
  */
7
5
  export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
@@ -1,19 +1,27 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var React = require("react");
5
- var index_1 = require("@fluentui/react-compose/lib-commonjs/next/index");
6
- var useSplitButton_1 = require("./useSplitButton");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderSplitButton = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ var React = /*#__PURE__*/require("react");
11
+
12
+ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
7
13
  /**
8
- * Redefine the render function to add slots. Reuse the button structure but add
9
- * slots to children.
10
- * @param state
14
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
11
15
  */
12
- exports.renderSplitButton = function (state) {
13
- var _a = index_1.getSlots(state, useSplitButton_1.splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
14
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
15
- React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)),
16
- React.createElement(slots.divider, tslib_1.__assign({}, slotProps.divider)),
17
- React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton))));
16
+
17
+
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)));
18
24
  };
25
+
26
+ exports.renderSplitButton = renderSplitButton;
19
27
  //# sourceMappingURL=renderSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,gEAAkE;AAElE,mDAA6D;AAE7D;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,UAAC,KAAuB;IACjD,IAAA,wEAAiE,EAA/D,gBAAK,EAAE,wBAAwD,CAAC;IAExE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;QAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;QACtC,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;QACxC,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACnC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonState } from './SplitButton.types';\nimport { splitButtonShorthandProps } from './useSplitButton';\n\n/**\n * Redefine the render function to add slots. Reuse the button structure but add\n * slots to children.\n * @param state\n */\nexport const renderSplitButton = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots(state, splitButtonShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button} />\n <slots.divider {...slotProps.divider} />\n <slots.menuButton {...slotProps.menuButton} />\n </slots.root>\n );\n};\n"]}
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,10 +1,8 @@
1
1
  import * as React from 'react';
2
- import { SplitButtonProps, SplitButtonState } from './SplitButton.types';
3
- export declare const splitButtonShorthandProps: string[];
2
+ import type { SplitButtonProps, SplitButtonState } from './SplitButton.types';
4
3
  /**
5
- * Redefine the component factory, reusing button factory.
4
+ * Given user props, defines default props for the SplitButton and returns processed state.
5
+ * @param props - User provided props to the SplitButton component.
6
+ * @param ref - User provided ref to be passed to the SplitButton component.
6
7
  */
7
- export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => {
8
- state: SplitButtonState;
9
- render: (state: SplitButtonState) => JSX.Element;
10
- };
8
+ export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
@@ -1,53 +1,86 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var React = require("react");
5
- var index_1 = require("@fluentui/react-compose/lib-commonjs/next/index");
6
- var renderSplitButton_1 = require("./renderSplitButton");
7
- var react_hooks_1 = require("@fluentui/react-hooks");
8
- exports.splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];
9
- var mergeProps = index_1.makeMergeProps({ deepMerge: exports.splitButtonShorthandProps });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSplitButton = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ var Button_1 = /*#__PURE__*/require("../Button/Button");
13
+
14
+ var MenuButton_1 = /*#__PURE__*/require("../MenuButton/MenuButton");
10
15
  /**
11
- * Redefine the component factory, reusing button factory.
16
+ * Given user props, defines default props for the SplitButton and returns processed state.
17
+ * @param props - User provided props to the SplitButton component.
18
+ * @param ref - User provided ref to be passed to the SplitButton component.
12
19
  */
13
- exports.useSplitButton = function (props, ref, defaultProps) {
14
- var _a = index_1.resolveShorthandProps(props, exports.splitButtonShorthandProps), _b = _a.as, as = _b === void 0 ? 'span' : _b, className = _a.className, style = _a.style, primary = _a.primary, ghost = _a.ghost, disabled = _a.disabled, loading = _a.loading, circular = _a.circular, block = _a.block, menu = _a.menu, size = _a.size, transparent = _a.transparent, userProps = tslib_1.__rest(_a, ["as", "className", "style", "primary", "ghost", "disabled", "loading", "circular", "block", "menu", "size", "transparent"]);
15
- ref = react_hooks_1.useMergedRefs(ref, React.useRef(null));
16
- // A split button should be disabled when disabled or loading.
17
- var disabledOrLoading = disabled || loading;
18
- var state = mergeProps({
19
- as: 'span',
20
- className: className,
21
- style: style,
22
- disabled: disabled,
23
- block: block,
24
- primary: primary,
25
- size: size,
26
- transparent: transparent,
27
- 'aria-disabled': disabledOrLoading,
28
- button: tslib_1.__assign({ as: 'span', ref: ref,
29
- primary: primary,
30
- ghost: ghost,
31
- circular: circular, disabled: disabledOrLoading, loading: loading,
32
- size: size,
33
- transparent: transparent }, userProps),
34
- divider: { as: 'span', children: null },
35
- menuButton: {
36
- as: 'span',
37
- primary: primary,
38
- ghost: ghost,
39
- circular: circular,
40
- size: size,
41
- disabled: disabledOrLoading,
42
- loading: loading,
43
- transparent: transparent,
44
- menu: menu,
45
- children: null,
46
- },
47
- }, defaultProps);
48
- return {
49
- state: state,
50
- render: renderSplitButton_1.renderSplitButton,
51
- };
20
+
21
+
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, {
41
+ defaultProps: {
42
+ appearance: appearance,
43
+ disabled: disabled,
44
+ disabledFocusable: disabledFocusable,
45
+ shape: shape,
46
+ size: size
47
+ }
48
+ });
49
+ var primaryActionButtonShorthand = react_utilities_1.resolveShorthand(primaryActionButton, {
50
+ 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
+ });
62
+ return {
63
+ // 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,
71
+ // Slots definition
72
+ components: {
73
+ root: 'div',
74
+ menuButton: MenuButton_1.MenuButton,
75
+ primaryActionButton: Button_1.Button
76
+ },
77
+ root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({
78
+ ref: ref
79
+ }, props)),
80
+ menuButton: menuButtonShorthand,
81
+ primaryActionButton: primaryActionButtonShorthand
82
+ };
52
83
  };
84
+
85
+ exports.useSplitButton = useSplitButton;
53
86
  //# sourceMappingURL=useSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,gEAA+F;AAE/F,yDAAwD;AACxD,qDAAsD;AAEzC,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAErF,IAAM,UAAU,GAAG,sBAAc,CAAC,EAAE,SAAS,EAAE,iCAAyB,EAAE,CAAC,CAAC;AAE5E;;GAEG;AACU,QAAA,cAAc,GAAG,UAC5B,KAAuB,EACvB,GAA2B,EAC3B,YAA+B;IAE/B,IAAM,4EAcqD,EAbzD,UAAW,EAAX,gCAAW,EACX,wBAAS,EACT,gBAAK,EACL,oBAAO,EACP,gBAAK,EACL,sBAAQ,EACR,oBAAO,EACP,sBAAQ,EACR,gBAAK,EACL,cAAI,EACJ,cAAI,EACJ,4BAAW,EACX,2JACyD,CAAC;IAE5D,GAAG,GAAG,2BAAa,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC,CAAC;IAE1D,8DAA8D;IAC9D,IAAM,iBAAiB,GAAG,QAAQ,IAAI,OAAO,CAAC;IAE9C,IAAM,KAAK,GAAG,UAAU,CACtB;QACE,EAAE,EAAE,MAAM;QACV,SAAS,WAAA;QACT,KAAK,OAAA;QACL,QAAQ,UAAA;QACR,KAAK,OAAA;QACL,OAAO,SAAA;QACP,IAAI,MAAA;QACJ,WAAW,aAAA;QACX,eAAe,EAAE,iBAAiB;QAElC,MAAM,qBACJ,EAAE,EAAE,MAAM,EACV,GAAG,KAAA;YACH,OAAO,SAAA;YACP,KAAK,OAAA;YACL,QAAQ,UAAA,EACR,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,WAAW,aAAA,IACR,SAAS,CACb;QAED,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAEvC,UAAU,EAAE;YACV,EAAE,EAAE,MAAM;YACV,OAAO,SAAA;YACP,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,IAAI,MAAA;YACJ,QAAQ,EAAE,iBAAiB;YAC3B,OAAO,SAAA;YACP,WAAW,aAAA;YACX,IAAI,MAAA;YACJ,QAAQ,EAAE,IAAI;SACf;KACF,EACD,YAAY,CACO,CAAC;IAEtB,OAAO;QACL,KAAK,OAAA;QACL,MAAM,EAAE,qCAAiB;KAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonProps, SplitButtonState } from './SplitButton.types';\nimport { renderSplitButton } from './renderSplitButton';\nimport { useMergedRefs } from '@fluentui/react-hooks';\n\nexport const splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];\n\nconst mergeProps = makeMergeProps({ deepMerge: splitButtonShorthandProps });\n\n/**\n * Redefine the component factory, reusing button factory.\n */\nexport const useSplitButton = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: SplitButtonProps,\n) => {\n const {\n as = 'span',\n className,\n style,\n primary,\n ghost,\n disabled,\n loading,\n circular,\n block,\n menu,\n size,\n transparent,\n ...userProps\n } = resolveShorthandProps(props, splitButtonShorthandProps);\n\n ref = useMergedRefs(ref, React.useRef<HTMLElement>(null));\n\n // A split button should be disabled when disabled or loading.\n const disabledOrLoading = disabled || loading;\n\n const state = mergeProps(\n {\n as: 'span',\n className,\n style,\n disabled,\n block,\n primary,\n size,\n transparent,\n 'aria-disabled': disabledOrLoading,\n\n button: {\n as: 'span',\n ref,\n primary,\n ghost,\n circular,\n disabled: disabledOrLoading,\n loading,\n size,\n transparent,\n ...userProps,\n },\n\n divider: { as: 'span', children: null },\n\n menuButton: {\n as: 'span',\n primary,\n ghost,\n circular,\n size,\n disabled: disabledOrLoading,\n loading,\n transparent,\n menu,\n children: null,\n },\n },\n defaultProps,\n ) as SplitButtonState;\n\n return {\n state,\n render: renderSplitButton,\n };\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,QAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAGA;;;;AAIG;;;AACI,IAAM,cAAc,GAAG,UAC5B,KAD4B,EAE5B,GAF4B,EAEyB;AAGnD,MAAA,UAAU,GAWR,KAAK,CAXG,UAAV;AAAA,MACA,EAAA,GAUE,KAAK,CAVM,KADb;AAAA,MACA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EADb;AAAA,MAEA,QAAQ,GASN,KAAK,CATC,QAFR;AAAA,MAGA,EAAA,GAQE,KAAK,CARS,QAHhB;AAAA,MAGA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAHhB;AAAA,MAIA,EAAA,GAOE,KAAK,CAPkB,iBAJzB;AAAA,MAIA,iBAAiB,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAJzB;AAAA,MAKA,IAAI,GAMF,KAAK,CANH,IALJ;AAAA,MAMA,EAAA,GAKE,KAAK,CALgB,YANvB;AAAA,MAMA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EANvB;AAAA,MAOA,UAAU,GAIR,KAAK,CAJG,UAPV;AAAA,MAQA,mBAAmB,GAGjB,KAAK,CAHY,mBARnB;AAAA,MASA,EAAA,GAEE,KAAK,CAFU,KATjB;AAAA,MASA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,SAAH,GAAY,EATjB;AAAA,MAUA,EAAA,GACE,KAAK,CADQ,IAVf;AAAA,MAUA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAVf;AAYF,MAAM,mBAAmB,GAAG,iBAAA,CAAA,gBAAA,CAAiB,UAAjB,EAA6B;AACvD,IAAA,YAAY,EAAE;AACZ,MAAA,UAAU,EAAA,UADE;AAEZ,MAAA,QAAQ,EAAA,QAFI;AAGZ,MAAA,iBAAiB,EAAA,iBAHL;AAIZ,MAAA,KAAK,EAAA,KAJO;AAKZ,MAAA,IAAI,EAAA;AALQ;AADyC,GAA7B,CAA5B;AASA,MAAM,4BAA4B,GAAG,iBAAA,CAAA,gBAAA,CAAiB,mBAAjB,EAAsC;AACzE,IAAA,YAAY,EAAE;AACZ,MAAA,UAAU,EAAA,UADE;AAEZ,MAAA,KAAK,EAAA,KAFO;AAGZ,MAAA,QAAQ,EAAA,QAHI;AAIZ,MAAA,QAAQ,EAAA,QAJI;AAKZ,MAAA,iBAAiB,EAAA,iBALL;AAMZ,MAAA,IAAI,EAAA,IANQ;AAOZ,MAAA,YAAY,EAAA,YAPA;AAQZ,MAAA,KAAK,EAAA,KARO;AASZ,MAAA,IAAI,EAAA;AATQ;AAD2D,GAAtC,CAArC;AAcA,SAAO;AACL;AACA,IAAA,UAAU,EAAA,UAFL;AAGL,IAAA,KAAK,EAAA,KAHA;AAIL,IAAA,QAAQ,EAAA,QAJH;AAKL,IAAA,iBAAiB,EAAA,iBALZ;AAML,IAAA,YAAY,EAAA,YANP;AAOL,IAAA,KAAK,EAAA,KAPA;AAQL,IAAA,IAAI,EAAA,IARC;AAUL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,UAAU,EAAE,YAAA,CAAA,UAFF;AAGV,MAAA,mBAAmB,EAAE,QAAA,CAAA;AAHX,KAXP;AAiBL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA2B,OAAA,CAAA,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAA3B,CAjBD;AAkBL,IAAA,UAAU,EAAE,mBAlBP;AAmBL,IAAA,mBAAmB,EAAE;AAnBhB,GAAP;AAqBD,CA7DM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { SplitButtonState } from './SplitButton.types';
2
+ export declare const useSplitButtonStyles: (state: SplitButtonState) => SplitButtonState;