@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,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,29 +1,16 @@
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 { renderSplitButton } from './renderSplitButton';
4
3
  import { useSplitButton } from './useSplitButton';
5
- import { useSplitButtonClasses } from './useSplitButtonClasses';
6
- import { Button } from '../Button/index';
7
- import { MenuButton } from '../MenuButton/index';
4
+ import { useSplitButtonStyles } from './useSplitButtonStyles';
8
5
  /**
9
- * Define a styled SplitButton, using the `useSplitButton` hook.
10
- * {@docCategory Button}
6
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
7
+ * action, while interacting with the second one opens a menu with secondary actions.
11
8
  */
12
- export var SplitButton = React.forwardRef(function (props, ref) {
13
- var _a = useSplitButton(props, ref, {
14
- button: { as: Button },
15
- menuButton: { as: MenuButton, iconOnly: true, icon: React.createElement(ChevronDownIcon, null) },
16
- }), state = _a.state, render = _a.render;
17
- useSplitButtonClasses(state);
18
- // TODO remove any
19
- /**
20
- * Type 'SplitButtonState' has no properties in common with type '{
21
- * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
22
- * | undefined; }
23
- */
24
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
- useInlineTokens(state, '--button');
26
- return render(state);
9
+
10
+ export var SplitButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
+ var state = useSplitButton(props, ref);
12
+ useSplitButtonStyles(state);
13
+ return renderSplitButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
27
14
  });
28
15
  SplitButton.displayName = 'SplitButton';
29
16
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.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;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;IAC9E,IAAA;;;MAGJ,EAHM,gBAAK,EAAE,kBAGb,CAAC;IAEH,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE7B,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,WAAW,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,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,oBAAT,QAAqC,wBAArC;AAIA;;;AAGG;;AACH,OAAO,IAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC5F,MAAM,KAAK,GAAG,cAAc,CAAC,KAAD,EAAQ,GAAR,CAA5B;AAEA,EAAA,oBAAoB,CAAC,KAAD,CAApB;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB,CAL4F,CAM5F;AACD,CAPiE,CAA3D;AASP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
@@ -1,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 +1,2 @@
1
+ export {};
1
2
  //# 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,"file":"SplitButton.types.js","sourceRoot":"","sources":["../../../src/components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":""}
@@ -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,4 +1,6 @@
1
1
  export * from './SplitButton';
2
+ export * from './SplitButton.types';
3
+ export * from './renderSplitButton';
2
4
  export * from './useSplitButton';
3
- export * from './useSplitButtonClasses';
5
+ export { useSplitButtonStyles } from './useSplitButtonStyles';
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './SplitButton.types';\nexport * from './SplitButton';\nexport * from './useSplitButton';\nexport * from './useSplitButtonClasses';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SplitButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,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,17 +1,15 @@
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 { splitButtonShorthandProps } from './useSplitButton';
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 SplitButton component by passing the state defined props to the appropriate slots.
9
6
  */
7
+
10
8
  export var renderSplitButton = function (state) {
11
- var _a = getSlots(state, splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
12
- return (React.createElement(slots.root, __assign({}, slotProps.root),
13
- React.createElement(slots.button, __assign({}, slotProps.button)),
14
- React.createElement(slots.divider, __assign({}, slotProps.divider)),
15
- React.createElement(slots.menuButton, __assign({}, slotProps.menuButton))));
9
+ var _a = getSlots(state, ['root', 'menuButton', 'primaryActionButton']),
10
+ slots = _a.slots,
11
+ slotProps = _a.slotProps;
12
+
13
+ return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.primaryActionButton, __assign({}, slotProps.primaryActionButton)), /*#__PURE__*/React.createElement(slots.menuButton, __assign({}, slotProps.menuButton)));
16
14
  };
17
15
  //# sourceMappingURL=renderSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,KAAuB;IACjD,IAAA,+CAAiE,EAA/D,gBAAK,EAAE,wBAAwD,CAAC;IAExE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC5B,oBAAC,KAAK,CAAC,MAAM,eAAK,SAAS,CAAC,MAAM,EAAI;QACtC,oBAAC,KAAK,CAAC,OAAO,eAAK,SAAS,CAAC,OAAO,EAAI;QACxC,oBAAC,KAAK,CAAC,UAAU,eAAK,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,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACjD,MAAA,EAAA,GAAuB,QAAQ,CAAmB,KAAnB,EAA0B,CAAC,MAAD,EAAS,YAAT,EAAuB,qBAAvB,CAA1B,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,mBAAf,CAA1B,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CAFF,CADF;AAMD,CATM","sourceRoot":""}
@@ -1,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,51 +1,73 @@
1
- import { __assign, __rest } from "tslib";
2
- import * as React from 'react';
3
- import { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';
4
- import { renderSplitButton } from './renderSplitButton';
5
- import { useMergedRefs } from '@fluentui/react-hooks';
6
- export var splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];
7
- var mergeProps = makeMergeProps({ deepMerge: splitButtonShorthandProps });
1
+ import { __assign } from "tslib";
2
+ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
3
+ import { Button } from '../Button/Button';
4
+ import { MenuButton } from '../MenuButton/MenuButton';
8
5
  /**
9
- * Redefine the component factory, reusing button factory.
6
+ * Given user props, defines default props for the SplitButton and returns processed state.
7
+ * @param props - User provided props to the SplitButton component.
8
+ * @param ref - User provided ref to be passed to the SplitButton component.
10
9
  */
11
- export var useSplitButton = function (props, ref, defaultProps) {
12
- var _a = resolveShorthandProps(props, 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 = __rest(_a, ["as", "className", "style", "primary", "ghost", "disabled", "loading", "circular", "block", "menu", "size", "transparent"]);
13
- ref = useMergedRefs(ref, React.useRef(null));
14
- // A split button should be disabled when disabled or loading.
15
- var disabledOrLoading = disabled || loading;
16
- var state = mergeProps({
17
- as: 'span',
18
- className: className,
19
- style: style,
20
- disabled: disabled,
21
- block: block,
22
- primary: primary,
23
- size: size,
24
- transparent: transparent,
25
- 'aria-disabled': disabledOrLoading,
26
- button: __assign({ as: 'span', ref: ref,
27
- primary: primary,
28
- ghost: ghost,
29
- circular: circular, disabled: disabledOrLoading, loading: loading,
30
- size: size,
31
- transparent: transparent }, userProps),
32
- divider: { as: 'span', children: null },
33
- menuButton: {
34
- as: 'span',
35
- primary: primary,
36
- ghost: ghost,
37
- circular: circular,
38
- size: size,
39
- disabled: disabledOrLoading,
40
- loading: loading,
41
- transparent: transparent,
42
- menu: menu,
43
- children: null,
44
- },
45
- }, defaultProps);
46
- return {
47
- state: state,
48
- render: renderSplitButton,
49
- };
10
+
11
+ export var useSplitButton = function (props, ref) {
12
+ var appearance = props.appearance,
13
+ _a = props.block,
14
+ block = _a === void 0 ? false : _a,
15
+ children = props.children,
16
+ _b = props.disabled,
17
+ disabled = _b === void 0 ? false : _b,
18
+ _c = props.disabledFocusable,
19
+ disabledFocusable = _c === void 0 ? false : _c,
20
+ icon = props.icon,
21
+ _d = props.iconPosition,
22
+ iconPosition = _d === void 0 ? 'before' : _d,
23
+ menuButton = props.menuButton,
24
+ primaryActionButton = props.primaryActionButton,
25
+ _e = props.shape,
26
+ shape = _e === void 0 ? 'rounded' : _e,
27
+ _f = props.size,
28
+ size = _f === void 0 ? 'medium' : _f;
29
+ var menuButtonShorthand = resolveShorthand(menuButton, {
30
+ defaultProps: {
31
+ appearance: appearance,
32
+ disabled: disabled,
33
+ disabledFocusable: disabledFocusable,
34
+ shape: shape,
35
+ size: size
36
+ }
37
+ });
38
+ var primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {
39
+ defaultProps: {
40
+ appearance: appearance,
41
+ block: block,
42
+ children: children,
43
+ disabled: disabled,
44
+ disabledFocusable: disabledFocusable,
45
+ icon: icon,
46
+ iconPosition: iconPosition,
47
+ shape: shape,
48
+ size: size
49
+ }
50
+ });
51
+ return {
52
+ // Props passed at the top-level
53
+ appearance: appearance,
54
+ block: block,
55
+ disabled: disabled,
56
+ disabledFocusable: disabledFocusable,
57
+ iconPosition: iconPosition,
58
+ shape: shape,
59
+ size: size,
60
+ // Slots definition
61
+ components: {
62
+ root: 'div',
63
+ menuButton: MenuButton,
64
+ primaryActionButton: Button
65
+ },
66
+ root: getNativeElementProps('div', __assign({
67
+ ref: ref
68
+ }, props)),
69
+ menuButton: menuButtonShorthand,
70
+ primaryActionButton: primaryActionButtonShorthand
71
+ };
50
72
  };
51
73
  //# sourceMappingURL=useSplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,IAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAErF,IAAM,UAAU,GAAG,cAAc,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,IAAM,cAAc,GAAG,UAC5B,KAAuB,EACvB,GAA2B,EAC3B,YAA+B;IAE/B,IAAM,4DAcqD,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,mJACyD,CAAC;IAE5D,GAAG,GAAG,aAAa,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,aACJ,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,iBAAiB;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,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,MAAT,QAAuB,kBAAvB;AACA,SAAS,UAAT,QAA2B,0BAA3B;AAGA;;;;AAIG;;AACH,OAAO,IAAM,cAAc,GAAG,UAC5B,KAD4B,EAE5B,GAF4B,EAEyB;AAGnD,MAAA,UAAU,GAWR,KAAK,CAXG,UAAV;AAAA,MACA,EAAA,GAUE,KAAK,CAVM,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,gBAAgB,CAAC,UAAD,EAAa;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,GAAb,CAA5C;AASA,MAAM,4BAA4B,GAAG,gBAAgB,CAAC,mBAAD,EAAsB;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,GAAtB,CAArD;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,UAFF;AAGV,MAAA,mBAAmB,EAAE;AAHX,KAXP;AAiBL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAM,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAAN,CAjBtB;AAkBL,IAAA,UAAU,EAAE,mBAlBP;AAmBL,IAAA,mBAAmB,EAAE;AAnBhB,GAAP;AAqBD,CA7DM","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { SplitButtonState } from './SplitButton.types';
2
+ export declare const useSplitButtonStyles: (state: SplitButtonState) => SplitButtonState;
@@ -0,0 +1,77 @@
1
+ import { __styles, mergeClasses } from '@fluentui/react-make-styles';
2
+ import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
3
+ var SplitButtonClassNames = {
4
+ primaryActionButton: 'SplitButton-primaryActionButton',
5
+ menuButton: 'SplitButton-menuButton'
6
+ };
7
+
8
+ var useFocusStyles = /*#__PURE__*/__styles({
9
+ "primaryActionButton": {},
10
+ "menuButton": {}
11
+ }, {});
12
+
13
+ var useRootStyles = /*#__PURE__*/__styles({
14
+ "base": {
15
+ "mc9l5x": "ftuwxu6",
16
+ "Brf1p80": "fsxf2b5",
17
+ "qhf8xq": "f10pi13n",
18
+ "ha4doy": "fmrv4ls",
19
+ "ipgm0c": ["f178uykt", "f90yzzo"],
20
+ "B6cuk21": ["f1bxd3c5", "f1ekv84t"],
21
+ "bajz6s": ["fnux5s6", "f5nfhee"],
22
+ "Bzqncq": ["f19wc9x7", "f5bevrs"],
23
+ "Flt4rd": ["f1wefiyg", "f1leuqsa"]
24
+ },
25
+ "block": {
26
+ "a9b677": "fly5x3f"
27
+ },
28
+ "outline": {},
29
+ "primary": {
30
+ "Bxrr62k": ["f8z1slf", "f1qj10op"],
31
+ "wqijrc": ["fmrqvvu", "fu0z9tm"],
32
+ "Bsk9mq6": ["f1naws84", "f1ry7auu"]
33
+ },
34
+ "subtle": {
35
+ "Bxrr62k": ["f1xobncs", "f1xirlzn"],
36
+ "wqijrc": ["f1hmsn3f", "fi0rm9z"],
37
+ "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
38
+ },
39
+ "transparent": {
40
+ "Bxrr62k": ["f1xobncs", "f1xirlzn"],
41
+ "wqijrc": ["f1hmsn3f", "fi0rm9z"],
42
+ "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
43
+ },
44
+ "circular": {},
45
+ "rounded": {},
46
+ "square": {},
47
+ "disabled": {
48
+ "Bxrr62k": ["f11wzqjl", "f1a5dzic"],
49
+ "wqijrc": ["fhk4lgh", "f1r7ztp2"],
50
+ "Bsk9mq6": ["f1ot7jx6", "f1qvd61g"]
51
+ }
52
+ }, {
53
+ "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f178uykt .SplitButton-primaryActionButton{border-top-right-radius:0;}", ".f90yzzo .SplitButton-primaryActionButton{border-top-left-radius:0;}", ".f1bxd3c5 .SplitButton-primaryActionButton{border-bottom-right-radius:0;}", ".f1ekv84t .SplitButton-primaryActionButton{border-bottom-left-radius:0;}", ".fnux5s6 .SplitButton-menuButton{border-left-width:0;}", ".f5nfhee .SplitButton-menuButton{border-right-width:0;}", ".f19wc9x7 .SplitButton-menuButton{border-top-left-radius:0;}", ".f5bevrs .SplitButton-menuButton{border-top-right-radius:0;}", ".f1wefiyg .SplitButton-menuButton{border-bottom-left-radius:0;}", ".f1leuqsa .SplitButton-menuButton{border-bottom-right-radius:0;}", ".fly5x3f{width:100%;}", ".f8z1slf .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1qj10op .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1xobncs .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1xirlzn .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11wzqjl .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1a5dzic .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
54
+ "h": [".fmrqvvu:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fu0z9tm:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1hmsn3f:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fi0rm9z:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fhk4lgh:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1r7ztp2:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
55
+ "a": [".f1naws84:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ry7auu:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fam4u78:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1hqq1j6:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1ot7jx6:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1qvd61g:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"]
56
+ });
57
+
58
+ export var useSplitButtonStyles = function (state) {
59
+ var rootStyles = useRootStyles();
60
+ var focusStyles = useFocusStyles();
61
+ var appearance = state.appearance,
62
+ block = state.block,
63
+ disabled = state.disabled,
64
+ disabledFocusable = state.disabledFocusable;
65
+ state.root.className = mergeClasses(rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
66
+
67
+ if (state.menuButton) {
68
+ state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
69
+ }
70
+
71
+ if (state.primaryActionButton) {
72
+ state.primaryActionButton.className = mergeClasses(SplitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
73
+ }
74
+
75
+ return state;
76
+ };
77
+ //# sourceMappingURL=useSplitButtonStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,mBAAmB,EAAE,iCADO;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,cAAc,gBAAG;AAAA;AAAA;AAAA,MAAvB;;AAaA,IAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAgHA,OAAO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,UAAU,GAAG,aAAa,EAAhC;AACA,MAAM,WAAW,GAAG,cAAc,EAAlC;AAEQ,MAAA,UAAU,GAAyC,KAAK,CAA9C,UAAV;AAAA,MAAY,KAAK,GAAkC,KAAK,CAAvC,KAAjB;AAAA,MAAmB,QAAQ,GAAwB,KAAK,CAA7B,QAA3B;AAAA,MAA6B,iBAAiB,GAAK,KAAK,CAAV,iBAA9C;AAER,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,UAAU,CAAC,IADsB,EAEjC,KAAK,IAAI,UAAU,CAAC,KAFa,EAGjC,UAAU,IAAI,UAAU,CAAC,UAAD,CAHS,EAIjC,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,QAJb,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;;AAQA,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,YAAY,CACvC,qBAAqB,CAAC,UADiB,EAEvC,WAAW,CAAC,UAF2B,EAGvC,KAAK,CAAC,UAAN,CAAiB,SAHsB,CAAzC;AAKD;;AAED,MAAI,KAAK,CAAC,mBAAV,EAA+B;AAC7B,IAAA,KAAK,CAAC,mBAAN,CAA0B,SAA1B,GAAsC,YAAY,CAChD,qBAAqB,CAAC,mBAD0B,EAEhD,WAAW,CAAC,mBAFoC,EAGhD,KAAK,CAAC,mBAAN,CAA0B,SAHsB,CAAlD;AAKD;;AAED,SAAO,KAAP;AACD,CA/BM","sourceRoot":""}
@@ -1,7 +1,6 @@
1
- import * as React from 'react';
2
- import { ToggleButtonProps } from './ToggleButton.types';
1
+ import type { ToggleButtonProps } from './ToggleButton.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled ToggleButton, using the `useToggleButton` hook.
5
- * {@docCategory Button}
4
+ * ToggleButtons are buttons that toggle between two defined states when triggered.
6
5
  */
7
- export declare const ToggleButton: React.ForwardRefExoticComponent<Pick<ToggleButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
6
+ export declare const ToggleButton: ForwardRefComponent<ToggleButtonProps>;
@@ -1,18 +1,15 @@
1
1
  import * as React from 'react';
2
+ import { renderToggleButton } from './renderToggleButton';
2
3
  import { useToggleButton } from './useToggleButton';
3
- import { useInlineTokens } from '@fluentui/react-theme-provider';
4
- import { useButtonClasses } from '../Button/useButtonClasses';
5
- import { useToggleButtonClasses } from './useToggleButtonClasses';
4
+ import { useToggleButtonStyles } from './useToggleButtonStyles';
6
5
  /**
7
- * Define a styled ToggleButton, using the `useToggleButton` hook.
8
- * {@docCategory Button}
6
+ * ToggleButtons are buttons that toggle between two defined states when triggered.
9
7
  */
10
- export var ToggleButton = React.forwardRef(function (props, ref) {
11
- var _a = useToggleButton(props, ref), render = _a.render, state = _a.state;
12
- useButtonClasses(state);
13
- useToggleButtonClasses(state);
14
- useInlineTokens(state, '--button');
15
- return render(state);
8
+
9
+ export var ToggleButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
+ var state = useToggleButton(props, ref);
11
+ useToggleButtonStyles(state);
12
+ return renderToggleButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
16
13
  });
17
14
  ToggleButton.displayName = 'ToggleButton';
18
15
  //# sourceMappingURL=ToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAiC,UAAC,KAAK,EAAE,GAAG;IAChF,IAAA,gCAA+C,EAA7C,kBAAM,EAAE,gBAAqC,CAAC;IAEtD,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9B,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { ToggleButtonProps } from './ToggleButton.types';\nimport { useToggleButton } from './useToggleButton';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useButtonClasses } from '../Button/useButtonClasses';\nimport { useToggleButtonClasses } from './useToggleButtonClasses';\n\n/**\n * Define a styled ToggleButton, using the `useToggleButton` hook.\n * {@docCategory Button}\n */\nexport const ToggleButton = React.forwardRef<HTMLElement, ToggleButtonProps>((props, ref) => {\n const { render, state } = useToggleButton(props, ref);\n\n useButtonClasses(state);\n useToggleButtonClasses(state);\n useInlineTokens(state, '--button');\n\n return render(state);\n});\n\nToggleButton.displayName = 'ToggleButton';\n"]}
1
+ {"version":3,"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AAIA;;AAEG;;AACH,OAAO,IAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;AAEA,EAAA,qBAAqB,CAAC,KAAD,CAArB;AAEA,SAAO,kBAAkB,CAAC,KAAD,CAAzB,CAL8F,CAM9F;AACD,CAPmE,CAA7D;AASP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourceRoot":""}
@@ -1,25 +1,19 @@
1
- import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';
2
- /**
3
- * {@docCategory Button}
4
- */
5
- export interface ToggleButtonProps extends ButtonProps {
1
+ import type { ButtonProps, ButtonState } from '../Button/Button.types';
2
+ export declare type ToggleButtonCommons = {
6
3
  /**
7
4
  * Defines the controlled checked state of the `ToggleButton`.
8
- * Mutually exclusive to `defaultChecked`.
5
+ * If passed, `ToggleButton` ignores the `defaultChecked` property.
9
6
  * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
10
7
  * correct value based on handling `onClick` events and re-rendering.
8
+ * @default false
11
9
  */
12
- checked?: boolean;
10
+ checked: boolean;
11
+ };
12
+ export declare type ToggleButtonProps = ButtonProps & Partial<ToggleButtonCommons> & {
13
13
  /**
14
- * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.
15
- * Mutually exclusive to `checked`.
14
+ * Defines whether the `ToggleButton` is initially in a checked state or not when rendered.
15
+ * @default false
16
16
  */
17
17
  defaultChecked?: boolean;
18
- }
19
- /**
20
- * {@docCategory Button}
21
- */
22
- export interface ToggleButtonState extends ToggleButtonProps {
23
- }
24
- export declare type ToggleButtonTokens = ButtonTokens;
25
- export declare type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;
18
+ };
19
+ export declare type ToggleButtonState = ButtonState & ToggleButtonCommons;
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=ToggleButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.types.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonProps extends ButtonProps {\n /**\n * Defines the controlled checked state of the `ToggleButton`.\n * Mutually exclusive to `defaultChecked`.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onClick` events and re-rendering.\n */\n checked?: boolean;\n\n /**\n * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.\n * Mutually exclusive to `checked`.\n */\n defaultChecked?: boolean;\n}\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonState extends ToggleButtonProps {}\n\nexport type ToggleButtonTokens = ButtonTokens;\n\nexport type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;\n"]}
1
+ {"version":3,"file":"ToggleButton.types.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
+ export * from './ToggleButton';
1
2
  export * from './ToggleButton.types';
3
+ export * from './renderToggleButton';
2
4
  export * from './useToggleButton';
3
- export * from './useToggleButtonClasses';
4
- export * from './ToggleButton';
5
- export * from './useChecked';
5
+ export { useToggleButtonStyles } from './useToggleButtonStyles';
@@ -1,5 +1,6 @@
1
- export * from './useToggleButton';
2
- export * from './useToggleButtonClasses';
3
1
  export * from './ToggleButton';
4
- export * from './useChecked';
2
+ export * from './ToggleButton.types';
3
+ export * from './renderToggleButton';
4
+ export * from './useToggleButton';
5
+ export { useToggleButtonStyles } from './useToggleButtonStyles';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ToggleButton/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC","sourcesContent":["export * from './ToggleButton.types';\nexport * from './useToggleButton';\nexport * from './useToggleButtonClasses';\nexport * from './ToggleButton';\nexport * from './useChecked';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ export { renderButton as renderToggleButton } from '../Button/renderButton';
@@ -0,0 +1,2 @@
1
+ export { renderButton as renderToggleButton } from '../Button/renderButton';
2
+ //# sourceMappingURL=renderToggleButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderToggleButton.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}