@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,32 +1,29 @@
1
- import * as React from 'react';
2
- import { makeMergeProps, resolveShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { useButtonState } from '../Button/useButtonState';
4
- import { renderCompoundButton } from './renderCompoundButton';
1
+ import { __assign, __rest } from "tslib";
2
+ import { resolveShorthand } from '@fluentui/react-utilities';
3
+ import { useButton } from '../Button/index';
5
4
  /**
6
- * Consts listing which props are shorthand props.
5
+ * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
6
+ * @param props - User provided props to the CompoundButton component.
7
+ * @param ref - User provided ref to be passed to the CompoundButton component.
7
8
  */
8
- export var compoundButtonShorthandProps = ['icon', 'loader', 'content', 'contentContainer', 'secondaryContent'];
9
- var mergeProps = makeMergeProps({
10
- deepMerge: compoundButtonShorthandProps,
11
- });
12
- /**
13
- * Given user props, returns state and render function for a Button.
14
- */
15
- export var useCompoundButton = function (props, ref, defaultProps) {
16
- // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.
17
- // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.
18
- // eslint-disable-next-line react-hooks/rules-of-hooks
19
- var resolvedRef = ref || React.useRef();
20
- var state = mergeProps({
21
- ref: resolvedRef,
22
- as: 'button',
23
- icon: { as: 'span' },
24
- content: { as: 'span', children: props.children },
25
- contentContainer: { as: 'span', children: null },
26
- secondaryContent: { as: 'span' },
27
- loader: { as: 'span' },
28
- }, defaultProps, resolveShorthandProps(props, compoundButtonShorthandProps));
29
- useButtonState(state);
30
- return { state: state, render: renderCompoundButton };
9
+
10
+ export var useCompoundButton = function (_a, ref) {
11
+ var contentContainer = _a.contentContainer,
12
+ secondaryContent = _a.secondaryContent,
13
+ props = __rest(_a, ["contentContainer", "secondaryContent"]);
14
+
15
+ return __assign(__assign({}, useButton(props, ref)), {
16
+ // Slots definition
17
+ components: {
18
+ root: 'button',
19
+ icon: 'span',
20
+ contentContainer: 'span',
21
+ secondaryContent: 'span'
22
+ },
23
+ contentContainer: resolveShorthand(contentContainer, {
24
+ required: true
25
+ }),
26
+ secondaryContent: resolveShorthand(secondaryContent)
27
+ });
31
28
  };
32
29
  //# sourceMappingURL=useCompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,IAAM,4BAA4B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAElH,IAAM,UAAU,GAAG,cAAc,CAAC;IAChC,SAAS,EAAE,4BAA4B;CACxC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAC/B,KAA0B,EAC1B,GAA2B,EAC3B,YAAkC;IAElC,oGAAoG;IACpG,4FAA4F;IAC5F,sDAAsD;IACtD,IAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,UAAU,CACtB;QACE,GAAG,EAAE,WAAW;QAChB,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,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QAChC,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;KACvB,EACD,YAAY,EACZ,qBAAqB,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAC3D,CAAC;IAEF,cAAc,CAAC,KAAK,CAAC,CAAC;IAEtB,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;AACjD,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { CompoundButtonProps } from './CompoundButton.types';\nimport { useButtonState } from '../Button/useButtonState';\nimport { renderCompoundButton } from './renderCompoundButton';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const compoundButtonShorthandProps = ['icon', 'loader', 'content', 'contentContainer', 'secondaryContent'];\n\nconst mergeProps = makeMergeProps({\n deepMerge: compoundButtonShorthandProps,\n});\n\n/**\n * Given user props, returns state and render function for a Button.\n */\nexport const useCompoundButton = (\n props: CompoundButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CompoundButtonProps,\n) => {\n // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.\n // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const resolvedRef = ref || React.useRef();\n const state = mergeProps(\n {\n ref: resolvedRef,\n as: 'button',\n icon: { as: 'span' },\n content: { as: 'span', children: props.children },\n contentContainer: { as: 'span', children: null },\n secondaryContent: { as: 'span' },\n loader: { as: 'span' },\n },\n defaultProps,\n resolveShorthandProps(props, compoundButtonShorthandProps),\n );\n\n useButtonState(state);\n\n return { state, render: renderCompoundButton };\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA,SAAS,SAAT,QAA0B,iBAA1B;AAEA;;;;AAIG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAC/B,EAD+B,EAE/B,GAF+B,EAEsB;AADnD,MAAA,gBAAgB,GAAA,EAAA,CAAA,gBAAhB;AAAA,MAAkB,gBAAgB,GAAA,EAAA,CAAA,gBAAlC;AAAA,MAAuC,KAAK,GAAA,MAAA,CAAA,EAAA,EAA9C,CAAA,kBAAA,EAAA,kBAAA,CAA8C,CAA5C;;AAGF,SAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EAEK,SAAS,CAAC,KAAD,EAAQ,GAAR,CAFd,CAAA,EAE0B;AAExB;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KAHY;AASxB,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD,EAAmB;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnB,CATV;AAUxB,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD;AAVV,GAF1B,CAAA;AAcD,CAlBM","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { CompoundButtonState } from './CompoundButton.types';
2
+ export declare const useCompoundButtonStyles: (state: CompoundButtonState) => CompoundButtonState;
@@ -0,0 +1,164 @@
1
+ import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
+ import { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';
3
+ var CompoundButtonClassNames = {
4
+ secondaryContent: 'CompoundButton-secondaryContent'
5
+ };
6
+
7
+ var useRootStyles = /*#__PURE__*/__styles({
8
+ "base": {
9
+ "rmohyg": "fsbu5mz",
10
+ "Bqenvij": "f11ysow2",
11
+ "Bekya5a": "f1smw4j4",
12
+ "Bi863bl": "f1b73140",
13
+ "B7j81dy": "f19sbf7w"
14
+ },
15
+ "outline": {},
16
+ "primary": {
17
+ "Bekya5a": "f1wrmfx5",
18
+ "Bi863bl": "fl6im4w",
19
+ "B7j81dy": "f1y0ndy"
20
+ },
21
+ "subtle": {
22
+ "Bekya5a": "f1smw4j4",
23
+ "Bi863bl": "f182e9fe",
24
+ "B7j81dy": "fdrkfd0"
25
+ },
26
+ "transparent": {
27
+ "Bekya5a": "f1smw4j4",
28
+ "Bi863bl": "f182e9fe",
29
+ "B7j81dy": "fdrkfd0"
30
+ },
31
+ "small": {
32
+ "z8tnut": "fp9bwmr",
33
+ "z189sj": ["f19lj068", "f177v4lu"],
34
+ "Byoj8tv": "f150uoa4",
35
+ "uwmqm3": ["f177v4lu", "f19lj068"],
36
+ "Be2twd7": "fkhj508",
37
+ "Bg96gwp": "f1i3iumi"
38
+ },
39
+ "medium": {
40
+ "z8tnut": "f1kcqot9",
41
+ "z189sj": ["f11qrl6u", "fjlbh76"],
42
+ "Byoj8tv": "fpe6lb7",
43
+ "uwmqm3": ["fjlbh76", "f11qrl6u"],
44
+ "Be2twd7": "fkhj508",
45
+ "Bg96gwp": "f1i3iumi"
46
+ },
47
+ "large": {
48
+ "z8tnut": "fqag9an",
49
+ "z189sj": ["f1gbmcue", "f1rh9g5y"],
50
+ "Byoj8tv": "fp67ikv",
51
+ "uwmqm3": ["f1rh9g5y", "f1gbmcue"],
52
+ "Be2twd7": "fod5ikn",
53
+ "Bg96gwp": "faaz57k"
54
+ },
55
+ "disabled": {
56
+ "Bekya5a": "f1ygg8x6",
57
+ "Bi863bl": "fhtktt2",
58
+ "B7j81dy": "f1v2jbe6"
59
+ }
60
+ }, {
61
+ "d": [".fsbu5mz{gap:12px;}", ".f11ysow2{height:auto;}", ".f1smw4j4 .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1wrmfx5 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1ygg8x6 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
62
+ "h": [".f1b73140:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".fl6im4w:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f182e9fe:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fhtktt2:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
63
+ "a": [".f19sbf7w:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1y0ndy:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fdrkfd0:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1v2jbe6:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
64
+ });
65
+
66
+ var useRootIconOnlyStyles = /*#__PURE__*/__styles({
67
+ "small": {
68
+ "z8tnut": "f10ra9hq",
69
+ "z189sj": ["f8wuabp", "fycuoez"],
70
+ "Byoj8tv": "f1y2xyjm",
71
+ "uwmqm3": ["fycuoez", "f8wuabp"],
72
+ "B2u0y6b": "ft5vyj6",
73
+ "Bf4jedk": "f17suaiq"
74
+ },
75
+ "medium": {
76
+ "z8tnut": "f1xp5gbu",
77
+ "z189sj": ["f1sgzk6v", "f1bg5zqg"],
78
+ "Byoj8tv": "f1d7kygh",
79
+ "uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
80
+ "B2u0y6b": "fdczgix",
81
+ "Bf4jedk": "fjdcg9m"
82
+ },
83
+ "large": {
84
+ "z8tnut": "fp9bwmr",
85
+ "z189sj": ["f19lj068", "f177v4lu"],
86
+ "Byoj8tv": "f150uoa4",
87
+ "uwmqm3": ["f177v4lu", "f19lj068"],
88
+ "B2u0y6b": "fww51uw",
89
+ "Bf4jedk": "f1qhsl2h"
90
+ }
91
+ }, {
92
+ "d": [".f10ra9hq{padding-top:4px;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1y2xyjm{padding-bottom:4px;}", ".ft5vyj6{max-width:48px;}", ".f17suaiq{min-width:48px;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".fdczgix{max-width:52px;}", ".fjdcg9m{min-width:52px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fww51uw{max-width:56px;}", ".f1qhsl2h{min-width:56px;}"]
93
+ });
94
+
95
+ var useIconStyles = /*#__PURE__*/__styles({
96
+ "base": {
97
+ "Be2twd7": "fndrnj9",
98
+ "Bqenvij": "fbhnoac",
99
+ "a9b677": "feqmc2u"
100
+ }
101
+ }, {
102
+ "d": [".fndrnj9{font-size:40px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}"]
103
+ });
104
+
105
+ var useContentContainerStyles = /*#__PURE__*/__styles({
106
+ "base": {
107
+ "mc9l5x": "f22iagw",
108
+ "Beiy3e4": "f1vx9l62",
109
+ "fsow6f": ["f1o700av", "fes3tcz"]
110
+ }
111
+ }, {
112
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"]
113
+ });
114
+
115
+ var useSecondaryContentStyles = /*#__PURE__*/__styles({
116
+ "base": {
117
+ "Bg96gwp": "flkuc6h",
118
+ "B6of3ja": "fvjh0tl",
119
+ "Bhrd7zp": "figsok6"
120
+ },
121
+ "small": {
122
+ "Be2twd7": "fy9rknc"
123
+ },
124
+ "medium": {
125
+ "Be2twd7": "fy9rknc"
126
+ },
127
+ "large": {
128
+ "Be2twd7": "fkhj508"
129
+ }
130
+ }, {
131
+ "d": [".flkuc6h{line-height:100%;}", ".fvjh0tl{margin-top:4px;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
132
+ });
133
+
134
+ export var useCompoundButtonStyles = function (state) {
135
+ var rootStyles = useRootStyles();
136
+ var rootIconOnlyStyles = useRootIconOnlyStyles();
137
+ var iconStyles = useIconStyles();
138
+ var contentContainerStyles = useContentContainerStyles();
139
+ var secondaryContentStyles = useSecondaryContentStyles();
140
+ var appearance = state.appearance,
141
+ disabled = state.disabled,
142
+ disabledFocusable = state.disabledFocusable,
143
+ iconOnly = state.iconOnly,
144
+ size = state.size;
145
+ state.root.className = mergeClasses( // Root styles
146
+ rootStyles.base, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles
147
+ (disabled || disabledFocusable) && rootStyles.disabled, // Icon-only styles
148
+ iconOnly && rootIconOnlyStyles[size], // User provided class name
149
+ state.root.className);
150
+
151
+ if (state.icon) {
152
+ state.icon.className = mergeClasses(iconStyles.base, state.icon.className);
153
+ }
154
+
155
+ state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);
156
+
157
+ if (state.secondaryContent) {
158
+ state.secondaryContent.className = mergeClasses(CompoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
159
+ }
160
+
161
+ useButtonStyles(state);
162
+ return state;
163
+ };
164
+ //# sourceMappingURL=useCompoundButtonStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,aAAT,EAAwB,eAAxB,QAA+C,2BAA/C;AAGA,IAAM,wBAAwB,GAAG;AAC/B,EAAA,gBAAgB,EAAE;AADa,CAAjC;;AAIA,IAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAwHA,IAAM,qBAAqB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA9B;;AAsBA,IAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AASA,IAAM,yBAAyB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlC;;AASA,IAAM,yBAAyB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlC;;AAoBA,OAAO,IAAM,uBAAuB,GAAG,UAAC,KAAD,EAA2B;AAChE,MAAM,UAAU,GAAG,aAAa,EAAhC;AACA,MAAM,kBAAkB,GAAG,qBAAqB,EAAhD;AACA,MAAM,UAAU,GAAG,aAAa,EAAhC;AACA,MAAM,sBAAsB,GAAG,yBAAyB,EAAxD;AACA,MAAM,sBAAsB,GAAG,yBAAyB,EAAxD;AAEQ,MAAA,UAAU,GAAkD,KAAK,CAAvD,UAAV;AAAA,MAAY,QAAQ,GAAwC,KAAK,CAA7C,QAApB;AAAA,MAAsB,iBAAiB,GAAqB,KAAK,CAA1B,iBAAvC;AAAA,MAAyC,QAAQ,GAAW,KAAK,CAAhB,QAAjD;AAAA,MAAmD,IAAI,GAAK,KAAK,CAAV,IAAvD;AAER,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,EACjC;AACA,EAAA,UAAU,CAAC,IAFsB,EAGjC,UAAU,IAAI,UAAU,CAAC,UAAD,CAHS,EAIjC,UAAU,CAAC,IAAD,CAJuB,EAMjC;AACA,GAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,QAPb,EASjC;AACA,EAAA,QAAQ,IAAI,kBAAkB,CAAC,IAAD,CAVG,EAYjC;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAbsB,CAAnC;;AAgBA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,KAAK,CAAC,IAAN,CAAW,SAA7B,CAAnC;AACD;;AAED,EAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAAC,sBAAsB,CAAC,IAAxB,EAA8B,KAAK,CAAC,gBAAN,CAAuB,SAArD,CAA/C;;AAEA,MAAI,KAAK,CAAC,gBAAV,EAA4B;AAC1B,IAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAC7C,wBAAwB,CAAC,gBADoB,EAE7C,sBAAsB,CAAC,IAFsB,EAG7C,sBAAsB,CAAC,IAAD,CAHuB,EAI7C,KAAK,CAAC,gBAAN,CAAuB,SAJsB,CAA/C;AAMD;;AAED,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,KAAP;AACD,CA3CM","sourceRoot":""}
@@ -1,7 +1,6 @@
1
- import * as React from 'react';
2
- import { MenuButtonProps } from './MenuButton.types';
1
+ import type { MenuButtonProps } from './MenuButton.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled MenuButton, using the `useMenuButton` hook.
5
- * {@docCategory Button}
4
+ * MenuButtons are buttons that handle opening and closing a menu when they are triggered.
6
5
  */
7
- export declare const MenuButton: React.ForwardRefExoticComponent<Pick<MenuButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
6
+ export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
@@ -1,28 +1,15 @@
1
1
  import * as React from 'react';
2
- import { ChevronDownIcon } from '@fluentui/react-icons-mdl2';
3
- import { useInlineTokens } from '@fluentui/react-theme-provider';
2
+ import { renderMenuButton } from './renderMenuButton';
4
3
  import { useMenuButton } from './useMenuButton';
5
- import { useButtonClasses } from '../Button/index';
6
- import { useMenuButtonClasses } from './useMenuButtonClasses';
4
+ import { useMenuButtonStyles } from './useMenuButtonStyles';
7
5
  /**
8
- * Define a styled MenuButton, using the `useMenuButton` hook.
9
- * {@docCategory Button}
6
+ * MenuButtons are buttons that handle opening and closing a menu when they are triggered.
10
7
  */
11
- export var MenuButton = React.forwardRef(function (props, ref) {
12
- var _a = useMenuButton(props, ref, {
13
- menuIcon: { as: ChevronDownIcon },
14
- }), state = _a.state, render = _a.render;
15
- useButtonClasses(state);
16
- useMenuButtonClasses(state);
17
- // TODO remove any
18
- /**
19
- * Type 'MenuButtonState' has no properties in common with type '{
20
- * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
21
- * | undefined; }
22
- */
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- useInlineTokens(state, '--button');
25
- return render(state);
8
+
9
+ export var MenuButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
+ var state = useMenuButton(props, ref);
11
+ useMenuButtonStyles(state);
12
+ return renderMenuButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
26
13
  });
27
14
  MenuButton.displayName = 'MenuButton';
28
15
  //# sourceMappingURL=MenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,IAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAA+B,UAAC,KAAK,EAAE,GAAG;IAC5E,IAAA;;MAEJ,EAFM,gBAAK,EAAE,kBAEb,CAAC;IAEH,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE5B,kBAAkB;IAClB;;;;OAIG;IACH,8DAA8D;IAC9D,eAAe,CAAC,KAAY,EAAE,UAAU,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from '@fluentui/react-icons-mdl2';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useMenuButton } from './useMenuButton';\nimport { MenuButtonProps } from './MenuButton.types';\nimport { useButtonClasses } from '../Button/index';\nimport { useMenuButtonClasses } from './useMenuButtonClasses';\n\n/**\n * Define a styled MenuButton, using the `useMenuButton` hook.\n * {@docCategory Button}\n */\nexport const MenuButton = React.forwardRef<HTMLElement, MenuButtonProps>((props, ref) => {\n const { state, render } = useMenuButton(props, ref, {\n menuIcon: { as: ChevronDownIcon },\n });\n\n useButtonClasses(state);\n useMenuButtonClasses(state);\n\n // TODO remove any\n /**\n * Type 'MenuButtonState' 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\nMenuButton.displayName = 'MenuButton';\n"]}
1
+ {"version":3,"sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AACA,SAAS,aAAT,QAA8B,iBAA9B;AACA,SAAS,mBAAT,QAAoC,uBAApC;AAIA;;AAEG;;AACH,OAAO,IAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC1F,MAAM,KAAK,GAAG,aAAa,CAAC,KAAD,EAAQ,GAAR,CAA3B;AAEA,EAAA,mBAAmB,CAAC,KAAD,CAAnB;AAEA,SAAO,gBAAgB,CAAC,KAAD,CAAvB,CAL0F,CAM1F;AACD,CAP+D,CAAzD;AASP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourceRoot":""}
@@ -1,54 +1,11 @@
1
- import * as React from 'react';
2
- import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { ButtonProps, ButtonState, ButtonTokens, ButtonVariants } from '../Button/Button.types';
4
- /**
5
- * {@docCategory Button}
6
- */
7
- export declare type MinimalMenuProps = {
8
- hidden?: boolean;
9
- onDismiss?: () => void;
10
- target?: React.Ref<HTMLElement | undefined>;
11
- };
12
- /**
13
- * {@docCategory Button}
14
- */
15
- export declare type MenuButtonProps = Omit<ButtonProps, 'iconPosition' | 'loader'> & {
16
- /**
17
- * Menu that is displayed when the button is pressed.
18
- */
19
- menu?: ShorthandProps;
1
+ import type { MenuTriggerChildProps } from '@fluentui/react-menu';
2
+ import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
3
+ import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
4
+ export declare type MenuButtonSlots = ButtonSlots & {
20
5
  /**
21
6
  * Menu icon that indicates that this button has a menu that can be expanded.
22
7
  */
23
- menuIcon?: ShorthandProps;
24
- /**
25
- * Defines the inital expanded state of the MenuButton. Use this if you want the MenuButton to maintain its own state.
26
- * Mutually exclusive with `expanded`.
27
- * @defaultvalue false
28
- */
29
- defaultExpanded?: boolean;
30
- /**
31
- * Defines whether the MenuButton is in an expanded state. Use this if you wish to have the expanded state of the
32
- * MenuButton be controlled. Mutually exclusive with `defaultExpanded`.
33
- * @defaultvalue defaultExpanded
34
- */
35
- expanded?: boolean;
36
- /**
37
- * Defines a callback that runs after the MenuButton's contextual menu has been dismissed.
38
- */
39
- onMenuDismiss?: () => void;
40
- };
41
- export interface MenuButtonState extends Omit<MenuButtonProps, 'menu'>, Omit<ButtonState, 'iconPosition' | 'loader'> {
42
- menu?: React.PropsWithChildren<MinimalMenuProps>;
43
- }
44
- /**
45
- * {@docCategory Button}
46
- */
47
- export declare type MenuButtonTokens = ButtonTokens & {
48
- menuIconColor?: string;
49
- menuIconSize?: string;
8
+ menuIcon?: IntrinsicShorthandProps<'span'>;
50
9
  };
51
- /**
52
- * {@docCategory Button}
53
- */
54
- export declare type MenuButtonVariants = ButtonVariants<MenuButtonTokens>;
10
+ export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>> & Partial<MenuTriggerChildProps>;
11
+ export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=MenuButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.types.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps, ButtonState, ButtonTokens, ButtonVariants } from '../Button/Button.types';\n\n/**\n * {@docCategory Button}\n */\nexport type MinimalMenuProps = {\n hidden?: boolean;\n onDismiss?: () => void;\n target?: React.Ref<HTMLElement | undefined>;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonProps = Omit<ButtonProps, 'iconPosition' | 'loader'> & {\n /**\n * Menu that is displayed when the button is pressed.\n */\n menu?: ShorthandProps;\n\n /**\n * Menu icon that indicates that this button has a menu that can be expanded.\n */\n menuIcon?: ShorthandProps;\n\n /**\n * Defines the inital expanded state of the MenuButton. Use this if you want the MenuButton to maintain its own state.\n * Mutually exclusive with `expanded`.\n * @defaultvalue false\n */\n defaultExpanded?: boolean;\n\n /**\n * Defines whether the MenuButton is in an expanded state. Use this if you wish to have the expanded state of the\n * MenuButton be controlled. Mutually exclusive with `defaultExpanded`.\n * @defaultvalue defaultExpanded\n */\n expanded?: boolean;\n\n /**\n * Defines a callback that runs after the MenuButton's contextual menu has been dismissed.\n */\n onMenuDismiss?: () => void;\n};\n\nexport interface MenuButtonState extends Omit<MenuButtonProps, 'menu'>, Omit<ButtonState, 'iconPosition' | 'loader'> {\n menu?: React.PropsWithChildren<MinimalMenuProps>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonTokens = ButtonTokens & {\n menuIconColor?: string;\n menuIconSize?: string;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonVariants = ButtonVariants<MenuButtonTokens>;\n"]}
1
+ {"version":3,"file":"MenuButton.types.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  export * from './MenuButton.types';
2
2
  export * from './MenuButton';
3
+ export * from './renderMenuButton';
3
4
  export * from './useMenuButton';
4
- export * from './useMenuButtonState';
5
- export * from './useExpanded';
6
- export * from './useMenuButtonClasses';
5
+ export { useMenuButtonStyles } from './useMenuButtonStyles';
@@ -1,6 +1,6 @@
1
+ export * from './MenuButton.types';
1
2
  export * from './MenuButton';
3
+ export * from './renderMenuButton';
2
4
  export * from './useMenuButton';
3
- export * from './useMenuButtonState';
4
- export * from './useExpanded';
5
- export * from './useMenuButtonClasses';
5
+ export { useMenuButtonStyles } from './useMenuButtonStyles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuButton/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './MenuButton.types';\nexport * from './MenuButton';\nexport * from './useMenuButton';\nexport * from './useMenuButtonState';\nexport * from './useExpanded';\nexport * from './useMenuButtonClasses';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,7 +1,5 @@
1
- import { MenuButtonState } from './MenuButton.types';
1
+ import type { MenuButtonState } from './MenuButton.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 MenuButton component by passing the state defined props to the appropriate slots.
6
4
  */
7
5
  export declare const renderMenuButton: (state: MenuButtonState) => JSX.Element;
@@ -1,21 +1,17 @@
1
1
  import { __assign } from "tslib";
2
2
  import * as React from 'react';
3
- import { getSlots } from '@fluentui/react-compose/lib/next/index';
4
- import { menuButtonShorthandProps } from './useMenuButton';
3
+ import { getSlots } from '@fluentui/react-utilities';
5
4
  /**
6
- * Redefine the render function to add slots. Reuse the button structure but add
7
- * slots to children.
8
- * @param state
5
+ * Renders a MenuButton component by passing the state defined props to the appropriate slots.
9
6
  */
7
+
10
8
  export var renderMenuButton = function (state) {
11
- var _a;
12
- var _b = getSlots(state, menuButtonShorthandProps), slots = _b.slots, slotProps = _b.slotProps;
13
- var iconOnly = state.iconOnly, children = state.children;
14
- var contentVisible = !iconOnly && (children || ((_a = slotProps.content) === null || _a === void 0 ? void 0 : _a.children));
15
- return (React.createElement(slots.root, __assign({}, slotProps.root),
16
- React.createElement(slots.icon, __assign({}, slotProps.icon)),
17
- contentVisible && React.createElement(slots.content, __assign({}, slotProps.content)),
18
- !iconOnly && React.createElement(slots.menuIcon, __assign({}, slotProps.menuIcon)),
19
- React.createElement(slots.menu, __assign({}, slotProps.menu))));
9
+ var _a = getSlots(state, ['root', 'icon', 'menuIcon']),
10
+ slots = _a.slots,
11
+ slotProps = _a.slotProps;
12
+
13
+ var icon = state.icon,
14
+ iconOnly = state.iconOnly;
15
+ return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && /*#__PURE__*/React.createElement(slots.menuIcon, __assign({}, slotProps.menuIcon)));
20
16
  };
21
17
  //# sourceMappingURL=renderMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,KAAsB;;IAC/C,IAAA,8CAAgE,EAA9D,gBAAK,EAAE,wBAAuD,CAAC;IAC/D,IAAA,yBAAQ,EAAE,yBAAQ,CAAW;IAErC,IAAM,cAAc,GAAG,CAAC,QAAQ,IAAI,CAAC,QAAQ,WAAI,SAAS,CAAC,OAAO,0CAAE,QAAQ,CAAA,CAAC,CAAC;IAE9E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC5B,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI,EAAI;QACjC,cAAc,IAAI,oBAAC,KAAK,CAAC,OAAO,eAAK,SAAS,CAAC,OAAO,EAAI;QAC1D,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,eAAK,SAAS,CAAC,QAAQ,EAAI;QACxD,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI,EAAI,CACvB,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { MenuButtonState } from './MenuButton.types';\nimport { menuButtonShorthandProps } from './useMenuButton';\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 renderMenuButton = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots(state, menuButtonShorthandProps);\n const { iconOnly, children } = state;\n\n const contentVisible = !iconOnly && (children || slotProps.content?.children);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.icon {...slotProps.icon} />\n {contentVisible && <slots.content {...slotProps.content} />}\n {!iconOnly && <slots.menuIcon {...slotProps.menuIcon} />}\n <slots.menu {...slotProps.menu} />\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,gBAAgB,GAAG,UAAC,KAAD,EAAuB;AAC/C,MAAA,EAAA,GAAuB,QAAQ,CAAkB,KAAlB,EAAyB,CAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,CAAzB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACE,MAAA,IAAI,GAAe,KAAK,CAApB,IAAJ;AAAA,MAAM,QAAQ,GAAK,KAAK,CAAV,QAAd;AAER,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,EAEG,CAAC,QAAD,IAAa,SAAS,CAAC,IAAV,CAAe,QAF/B,EAGG,CAAC,CAAC,QAAD,IAAa,EAAC,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,QAAP,CAAd,kBAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAHrC,CADF;AAOD,CAXM","sourceRoot":""}
@@ -1,10 +1,6 @@
1
1
  import * as React from 'react';
2
- import { MenuButtonProps, MenuButtonState } from './MenuButton.types';
3
- export declare const menuButtonShorthandProps: string[];
2
+ import type { MenuButtonProps, MenuButtonState } from './MenuButton.types';
4
3
  /**
5
- * Redefine the component factory, reusing button factory.
4
+ * Given user props, returns the final state for a MenuButton.
6
5
  */
7
- export declare const useMenuButton: (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps | undefined) => {
8
- state: MenuButtonState;
9
- render: (state: MenuButtonState) => JSX.Element;
10
- };
6
+ export declare const useMenuButton: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
@@ -1,26 +1,32 @@
1
- import { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';
2
- import { useMenuButtonState } from './useMenuButtonState';
3
- import { renderMenuButton } from './renderMenuButton';
4
- export var menuButtonShorthandProps = ['icon', 'content', 'menuIcon', 'menu'];
5
- var mergeProps = makeMergeProps({ deepMerge: menuButtonShorthandProps });
1
+ import { __assign, __rest } from "tslib";
2
+ import * as React from 'react';
3
+ import { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';
4
+ import { resolveShorthand } from '@fluentui/react-utilities';
5
+ import { useButton } from '../Button/index';
6
6
  /**
7
- * Redefine the component factory, reusing button factory.
7
+ * Given user props, returns the final state for a MenuButton.
8
8
  */
9
- export var useMenuButton = function (props, ref, defaultProps) {
10
- // Note: because menu button's template and slots are different, we can't reuse
11
- // those, but the useMenuButtonState hook can reuse useButtonState.
12
- var state = mergeProps({
13
- ref: ref,
14
- as: 'button',
15
- icon: { as: 'span' },
16
- content: { as: 'span', children: props.children },
17
- menuIcon: { as: 'span' },
18
- menu: { as: 'span' },
19
- }, defaultProps, resolveShorthandProps(props, menuButtonShorthandProps));
20
- useMenuButtonState(state);
21
- return {
22
- state: state,
23
- render: renderMenuButton,
24
- };
9
+
10
+ export var useMenuButton = function (_a, ref) {
11
+ var menuIcon = _a.menuIcon,
12
+ props = __rest(_a, ["menuIcon"]);
13
+
14
+ var buttonState = useButton(props, ref);
15
+ return __assign(__assign({}, buttonState), {
16
+ // State calculated from a set of props
17
+ iconOnly: Boolean(!props.children),
18
+ // Slots definition
19
+ components: {
20
+ root: 'button',
21
+ icon: 'span',
22
+ menuIcon: 'span'
23
+ },
24
+ menuIcon: resolveShorthand(menuIcon, {
25
+ defaultProps: {
26
+ children: buttonState.size === 'large' ? /*#__PURE__*/React.createElement(ChevronDown24Regular, null) : /*#__PURE__*/React.createElement(ChevronDown20Regular, null)
27
+ },
28
+ required: true
29
+ })
30
+ });
25
31
  };
26
32
  //# sourceMappingURL=useMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,IAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAEhF,IAAM,UAAU,GAAG,cAAc,CAAC,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,IAAM,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,qBAAqB,CAAC,KAAK,EAAE,wBAAwB,CAAC,CACpC,CAAC;IAErB,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO;QACL,KAAK,OAAA;QACL,MAAM,EAAE,gBAAgB;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,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,EAA+B,oBAA/B,QAA2D,uBAA3D;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,SAAT,QAA0B,iBAA1B;AAGA;;AAEG;;AACH,OAAO,IAAM,aAAa,GAAG,UAC3B,EAD2B,EAE3B,GAF2B,EAE0B;AADnD,MAAA,QAAQ,GAAA,EAAA,CAAA,QAAR;AAAA,MAAa,KAAK,GAAA,MAAA,CAAA,EAAA,EAApB,CAAA,UAAA,CAAoB,CAAlB;;AAGF,MAAM,WAAW,GAAG,SAAS,CAAC,KAAD,EAAQ,GAAR,CAA7B;AACA,SAAA,QAAA,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,gBAAgB,CAAC,QAAD,EAAW;AACnC,MAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,EAAE,WAAW,CAAC,IAAZ,KAAqB,OAArB,gBAA+B,KAAA,CAAA,aAAA,CAAC,oBAAD,EAAqB,IAArB,CAA/B,gBAA0D,KAAA,CAAA,aAAA,CAAC,oBAAD,EAAqB,IAArB;AADxD,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAAX;AAZZ,GAFhB,CAAA;AAqBD,CA1BM","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { MenuButtonState } from './MenuButton.types';
2
+ export declare const useMenuButtonStyles: (state: MenuButtonState) => MenuButtonState;
@@ -0,0 +1,34 @@
1
+ import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
+ import { useButtonStyles } from '../Button/useButtonStyles';
3
+
4
+ var useMenuIconStyles = /*#__PURE__*/__styles({
5
+ "small": {
6
+ "Be2twd7": "fe5j1ua",
7
+ "Bqenvij": "fjamq6b",
8
+ "a9b677": "f64fuq3"
9
+ },
10
+ "medium": {
11
+ "Be2twd7": "fe5j1ua",
12
+ "Bqenvij": "fjamq6b",
13
+ "a9b677": "f64fuq3"
14
+ },
15
+ "large": {
16
+ "Be2twd7": "f1rt2boy",
17
+ "Bqenvij": "frvgh55",
18
+ "a9b677": "fq4mcun"
19
+ }
20
+ }, {
21
+ "d": [".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
22
+ });
23
+
24
+ export var useMenuButtonStyles = function (state) {
25
+ var menuIconStyles = useMenuIconStyles();
26
+
27
+ if (state.menuIcon) {
28
+ state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);
29
+ }
30
+
31
+ useButtonStyles(state);
32
+ return state;
33
+ };
34
+ //# sourceMappingURL=useMenuButtonStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AAEA,SAAS,eAAT,QAAgC,2BAAhC;;AAGA,IAAM,iBAAiB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AAmBA,OAAO,IAAM,mBAAmB,GAAG,UAAC,KAAD,EAAuB;AACxD,MAAM,cAAc,GAAG,iBAAiB,EAAxC;;AACA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAP,CAAf,EAA6B,KAAK,CAAC,QAAN,CAAe,SAA5C,CAAvC;AACD;;AAED,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,KAAP;AACD,CATM","sourceRoot":""}