@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,457 +1,232 @@
1
- import { ColorTokens } from '@fluentui/theme';
2
- import { ComponentProps } from '@fluentui/react-compose/lib/next/index';
3
- import { FontTokens } from '@fluentui/theme';
4
- import * as React from 'react';
5
- import { RecursivePartial } from '@fluentui/theme';
6
- import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
7
- import { SizeValue } from '@fluentui/theme';
8
- import { Theme } from '@fluentui/react-theme-provider';
1
+ import { ARIAButtonShorthandProps } from '@fluentui/react-aria';
2
+ import type { ComponentProps } from '@fluentui/react-utilities';
3
+ import type { ComponentState } from '@fluentui/react-utilities';
4
+ import { ForwardRefComponent } from '@fluentui/react-utilities';
5
+ import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
6
+ import type { MenuTriggerChildProps } from '@fluentui/react-menu';
7
+ import type { ObjectShorthandProps } from '@fluentui/react-utilities';
8
+ import * as React_2 from 'react';
9
9
 
10
10
  /**
11
- * Define a styled Button, using the `useButton` hook.
12
- * {@docCategory Button}
11
+ * Buttons give people a way to trigger an action.
13
12
  */
14
- export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
13
+ export declare const Button: ForwardRefComponent<ButtonProps>;
15
14
 
16
- /**
17
- * {@docCategory Button}
18
- */
19
- export declare type ButtonProps = ComponentProps & React.HTMLAttributes<HTMLElement> & {
15
+ export declare type ButtonCommons = {
20
16
  /**
21
- * Shorthand icon. A shorthand prop can be a literal, object, or
22
- * JSX. The `children` prop of the object can be a render function,
23
- * taking in the original slot component and props.
17
+ * A button can have its content and borders styled for greater emphasis or to be subtle.
18
+ * - 'primary': Emphasizes the button as a primary action.
19
+ * - 'outline': Removes background styling.
20
+ * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
21
+ * - 'transparent': Removes background and border styling.
24
22
  */
25
- icon?: ShorthandProps;
23
+ appearance?: 'primary' | 'outline' | 'subtle' | 'transparent';
26
24
  /**
27
- * Shorthand loader content within the button.
25
+ * A button can fill the width of its container.
26
+ * @default false
28
27
  */
29
- loader?: ShorthandProps;
28
+ block: boolean;
30
29
  /**
31
- * Shorthand children content within the button.
30
+ * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
31
+ * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
32
+ * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
33
+ * @default false
32
34
  */
33
- content?: ShorthandProps;
35
+ disabledFocusable: boolean;
34
36
  /**
35
- * Defines the href to navigate to. If applied, will render the button as an anchor
36
- * element by default, unless `as` specifies otherwise. Note that specifying an href
37
- * and a non-anchor as the render type will prevent the Button from behaving like a
38
- * hyperlink and opening the href on click.
37
+ * A button can show that it cannot be interacted with.
38
+ * @default false
39
39
  */
40
- href?: string;
40
+ disabled: boolean;
41
41
  /**
42
- * Defines the target window to open the href in. Only is applied if the button renders
43
- * as an anchor tag, which is the default behavior if href is provided.
42
+ * A button can format its icon to appear before or after its content.
43
+ * @default 'before'
44
44
  */
45
- target?: string;
46
- /** A button can appear circular. */
47
- circular?: boolean;
48
- /** A button can show that it cannot be interacted with. */
49
- disabled?: boolean;
50
- /** A button can fill the width of its container. */
51
- block?: boolean;
52
- /** A button can contain only an icon. */
53
- iconOnly?: boolean;
54
- /** An icon button can format its icon to appear before or after its content. */
55
- iconPosition?: 'before' | 'after';
56
- /** A button that inherits its background and has a subtle appearance. */
57
- inverted?: boolean;
58
- /** Opt in to a named variant which can be supplied by a theme. */
59
- variant?: string;
60
- /** A button can show a loading indicator. */
61
- loading?: boolean;
45
+ iconPosition: 'before' | 'after';
62
46
  /**
63
- * Called after a user clicks the button.
64
- * @param event - React's original SyntheticEvent.
65
- * @param data - All props.
47
+ * A button can be rounded, circular, or square.
48
+ * @default 'rounded'
66
49
  */
50
+ shape: 'rounded' | 'circular' | 'square';
67
51
  /**
68
- * Called after a user focuses the button.
69
- * @param event - React's original SyntheticEvent.
70
- * @param data - All props.
52
+ * A button supports different sizes.
53
+ * @default 'medium'
71
54
  */
72
- /** A button can emphasize that it represents the primary action. */
73
- primary?: boolean;
74
- /** A button can emphasize that it represents an alternative action. */
75
- secondary?: boolean;
76
- /** A button can blend into its background to become less emphasized. */
77
- ghost?: boolean;
78
- /** A button can have no background styling and just be emphasized through its content styling. */
79
- transparent?: boolean;
80
- /** A button can be sized. */
81
- size?: SizeValue;
82
- /** A button can be formatted to show only text in order to indicate a less-pronounced action. */
83
- tokens?: RecursivePartial<ButtonTokens>;
55
+ size: 'small' | 'medium' | 'large';
84
56
  };
85
57
 
86
- /**
87
- * Consts listing which props are shorthand props.
88
- */
89
- export declare const buttonShorthandProps: string[];
90
-
91
- export declare const ButtonSizeVariants: {
92
- size_smallest: {
93
- height: string;
94
- minHeight: string;
95
- };
96
- size_smaller: {
97
- height: string;
98
- minHeight: string;
99
- };
100
- size_small: {
101
- height: string;
102
- minHeight: string;
103
- };
104
- size_large: {
105
- height: string;
106
- minHeight: string;
107
- };
108
- size_larger: {
109
- height: string;
110
- minHeight: string;
111
- };
112
- size_largest: {
113
- height: string;
114
- minHeight: string;
115
- };
116
- };
58
+ export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
117
59
 
118
- /**
119
- * {@docCategory Button}
120
- */
121
- export declare interface ButtonState extends ButtonProps {
122
- buttonRef?: React.RefObject<HTMLButtonElement>;
123
- }
124
-
125
- /**
126
- * {@docCategory Button}
127
- */
128
- export declare type ButtonTokens = ColorTokens & FontTokens & {
129
- paddingLeft?: string;
130
- paddingRight?: string;
131
- paddingTop?: string;
132
- paddingBottom?: string;
133
- margin?: string;
134
- height?: string;
135
- minWidth?: string;
136
- maxWidth?: string;
137
- minHeight?: string;
138
- contentGap?: string;
139
- iconSize?: string;
140
- borderRadius?: string;
141
- borderTopLeftRadius?: string;
142
- borderTopRightRadius?: string;
143
- borderBottomLeftRadius?: string;
144
- borderBottomRightRadius?: string;
145
- borderWidth?: string;
146
- boxShadow?: string;
147
- width?: string;
148
- forcedColorAdjust?: string;
149
- transform?: string;
150
- transition?: string;
151
- size?: {
152
- smallest?: string;
153
- smaller?: string;
154
- small?: string;
155
- regular?: string;
156
- large?: string;
157
- larger?: string;
158
- largest?: string;
159
- };
160
- pressed?: {
161
- transform?: string;
162
- transition?: string;
163
- };
60
+ export declare type ButtonSlots = {
61
+ /**
62
+ * Root of the component that renders as either a <button> tag.
63
+ */
64
+ root: ARIAButtonShorthandProps;
65
+ /**
66
+ * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.
67
+ */
68
+ icon?: IntrinsicShorthandProps<'span'>;
164
69
  };
165
70
 
166
- /**
167
- * {@docCategory Button}
168
- */
169
- export declare type ButtonVariants<TTokens = ButtonTokens> = {
170
- root?: TTokens;
171
- block?: TTokens;
172
- circular?: TTokens;
173
- iconOnly?: TTokens;
174
- ghost?: TTokens;
175
- primary?: TTokens;
176
- transparent?: TTokens;
71
+ export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
72
+ /**
73
+ * A button can contain only an icon.
74
+ * @default false
75
+ */
76
+ iconOnly: boolean;
177
77
  };
178
78
 
179
- export declare interface CheckedState {
180
- checked?: boolean;
181
- defaultChecked?: boolean;
182
- onClick?: React.DOMAttributes<HTMLElement>['onClick'];
183
- role?: string;
184
- 'aria-checked'?: React.AriaAttributes['aria-pressed'];
185
- 'aria-pressed'?: React.AriaAttributes['aria-pressed'];
186
- }
187
-
188
79
  /**
189
- * Define a styled CompoundButton, using the `useCompoundButton` hook.
190
- * {@docCategory Button}
80
+ * CompoundButtons are buttons that can have secondary content that adds extra information to the user.
191
81
  */
192
- export declare const CompoundButton: React.ForwardRefExoticComponent<Pick<CompoundButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
82
+ export declare const CompoundButton: ForwardRefComponent<CompoundButtonProps>;
193
83
 
194
- /**
195
- * {@docCategory Button}
196
- */
197
- export declare interface CompoundButtonProps extends ButtonProps {
84
+ export declare type CompoundButtonProps = ComponentProps<CompoundButtonSlots> & Partial<ButtonCommons>;
85
+
86
+ export declare type CompoundButtonSlots = ButtonSlots & {
198
87
  /**
199
88
  * Second line of text that describes the action this button takes.
200
89
  */
201
- secondaryContent?: ShorthandProps;
90
+ secondaryContent?: IntrinsicShorthandProps<'span'>;
202
91
  /**
203
- * Container that wraps the children and secondaryContent slots.
92
+ * Container that wraps the children and the secondaryContent slot.
204
93
  */
205
- contentContainer?: ShorthandProps;
206
- }
207
-
208
- /**
209
- * Consts listing which props are shorthand props.
210
- */
211
- export declare const compoundButtonShorthandProps: string[];
212
-
213
- /**
214
- * {@docCategory Button}
215
- */
216
- export declare interface CompoundButtonState extends CompoundButtonProps {
217
- }
218
-
219
- /**
220
- * {@docCategory Button}
221
- */
222
- export declare type CompoundButtonTokens = ButtonTokens & {
223
- secondaryContentColor?: string;
224
- secondaryContentFontSize?: string;
225
- secondaryContentFontWeight?: string;
226
- secondaryContentGap?: string;
94
+ contentContainer: IntrinsicShorthandProps<'span'>;
227
95
  };
228
96
 
229
- /**
230
- * {@docCategory Button}
231
- */
232
- export declare type CompoundButtonVariants = ButtonVariants<CompoundButtonTokens>;
233
-
234
- export declare type ExpandedState = {
235
- ref?: React.Ref<unknown>;
236
- expanded?: boolean;
237
- defaultExpanded?: boolean;
238
- onClick?: (ev: React.MouseEvent) => void;
239
- onMenuDismiss?: () => void;
240
- onKeyDown?: (ev: React.KeyboardEvent) => void;
241
- 'aria-expanded'?: React.HTMLAttributes<HTMLElement>['aria-expanded'];
242
- 'aria-haspopup'?: React.HTMLAttributes<HTMLElement>['aria-haspopup'];
243
- menu?: MenuButtonState['menu'];
244
- };
97
+ export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
245
98
 
246
99
  /**
247
- * Define a styled MenuButton, using the `useMenuButton` hook.
248
- * {@docCategory Button}
100
+ * MenuButtons are buttons that handle opening and closing a menu when they are triggered.
249
101
  */
250
- export declare const MenuButton: React.ForwardRefExoticComponent<Pick<MenuButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
102
+ export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
251
103
 
252
- /**
253
- * {@docCategory Button}
254
- */
255
- export declare type MenuButtonProps = Omit<ButtonProps, 'iconPosition' | 'loader'> & {
256
- /**
257
- * Menu that is displayed when the button is pressed.
258
- */
259
- menu?: ShorthandProps;
104
+ export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>> & Partial<MenuTriggerChildProps>;
105
+
106
+ export declare type MenuButtonSlots = ButtonSlots & {
260
107
  /**
261
108
  * Menu icon that indicates that this button has a menu that can be expanded.
262
109
  */
263
- menuIcon?: ShorthandProps;
264
- /**
265
- * Defines the inital expanded state of the MenuButton. Use this if you want the MenuButton to maintain its own state.
266
- * Mutually exclusive with `expanded`.
267
- * @defaultvalue false
268
- */
269
- defaultExpanded?: boolean;
270
- /**
271
- * Defines whether the MenuButton is in an expanded state. Use this if you wish to have the expanded state of the
272
- * MenuButton be controlled. Mutually exclusive with `defaultExpanded`.
273
- * @defaultvalue defaultExpanded
274
- */
275
- expanded?: boolean;
276
- /**
277
- * Defines a callback that runs after the MenuButton's contextual menu has been dismissed.
278
- */
279
- onMenuDismiss?: () => void;
110
+ menuIcon?: IntrinsicShorthandProps<'span'>;
280
111
  };
281
112
 
282
- export declare const menuButtonShorthandProps: string[];
283
-
284
- export declare interface MenuButtonState extends Omit<MenuButtonProps, 'menu'>, Omit<ButtonState, 'iconPosition' | 'loader'> {
285
- menu?: React.PropsWithChildren<MinimalMenuProps>;
286
- }
113
+ export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
287
114
 
288
115
  /**
289
- * {@docCategory Button}
116
+ * Renders a Button component by passing the state defined props to the appropriate slots.
290
117
  */
291
- export declare type MenuButtonTokens = ButtonTokens & {
292
- menuIconColor?: string;
293
- menuIconSize?: string;
294
- };
118
+ declare const renderButton: (state: ButtonState) => JSX.Element;
119
+ export { renderButton }
120
+ export { renderButton as renderToggleButton }
295
121
 
296
122
  /**
297
- * {@docCategory Button}
123
+ * Renders a CompoundButton component by passing the state defined props to the appropriate slots.
298
124
  */
299
- export declare type MenuButtonVariants = ButtonVariants<MenuButtonTokens>;
125
+ export declare const renderCompoundButton: (state: CompoundButtonState) => JSX.Element;
300
126
 
301
127
  /**
302
- * {@docCategory Button}
128
+ * Renders a MenuButton component by passing the state defined props to the appropriate slots.
303
129
  */
304
- export declare type MinimalMenuProps = {
305
- hidden?: boolean;
306
- onDismiss?: () => void;
307
- target?: React.Ref<HTMLElement | undefined>;
308
- };
130
+ export declare const renderMenuButton: (state: MenuButtonState) => JSX.Element;
309
131
 
310
132
  /**
311
- * Define a styled SplitButton, using the `useSplitButton` hook.
312
- * {@docCategory Button}
133
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
313
134
  */
314
- export declare const SplitButton: React.ForwardRefExoticComponent<Pick<SplitButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
135
+ export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
315
136
 
316
137
  /**
317
- * {@docCategory Button}
138
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
139
+ * action, while interacting with the second one opens a menu with secondary actions.
318
140
  */
319
- export declare interface SplitButtonProps extends ButtonProps, MenuButtonProps {
141
+ export declare const SplitButton: ForwardRefComponent<SplitButtonProps>;
142
+
143
+ export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
144
+
145
+ export declare type SplitButtonSlots = {
320
146
  /**
321
- * Button to perform primary action in SplitButton.
147
+ * Root of the component that wraps the primary action button and menu button.
322
148
  */
323
- button?: ShorthandProps;
149
+ root: IntrinsicShorthandProps<'div'>;
324
150
  /**
325
- * Divider that separates the primary action button and the menu button parts of the SplitButton
151
+ * Button that opens menu with secondary actions in SplitButton.
326
152
  */
327
- divider?: ShorthandProps;
153
+ menuButton?: ObjectShorthandProps<MenuButtonProps>;
328
154
  /**
329
- * Button that opens menu with secondary actions in SplitButton.
155
+ * Button to perform primary action in SplitButton.
330
156
  */
331
- menuButton?: ShorthandProps;
332
- }
333
-
334
- export declare const splitButtonShorthandProps: string[];
335
-
336
- export declare interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {
337
- menuButtonRef?: React.RefObject<HTMLButtonElement>;
338
- }
339
-
340
- /**
341
- * {@docCategory Button}
342
- */
343
- export declare type SplitButtonTokens = MenuButtonTokens & {
344
- dividerColor?: string;
345
- dividerThickness?: string;
157
+ primaryActionButton?: ObjectShorthandProps<ButtonProps>;
346
158
  };
347
159
 
348
- /**
349
- * {@docCategory Button}
350
- */
351
- export declare type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;
160
+ export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
352
161
 
353
162
  /**
354
- * Define a styled ToggleButton, using the `useToggleButton` hook.
355
- * {@docCategory Button}
163
+ * ToggleButtons are buttons that toggle between two defined states when triggered.
356
164
  */
357
- export declare const ToggleButton: React.ForwardRefExoticComponent<Pick<ToggleButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
165
+ export declare const ToggleButton: ForwardRefComponent<ToggleButtonProps>;
358
166
 
359
- /**
360
- * {@docCategory Button}
361
- */
362
- export declare interface ToggleButtonProps extends ButtonProps {
167
+ export declare type ToggleButtonCommons = {
363
168
  /**
364
169
  * Defines the controlled checked state of the `ToggleButton`.
365
- * Mutually exclusive to `defaultChecked`.
170
+ * If passed, `ToggleButton` ignores the `defaultChecked` property.
366
171
  * 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
367
172
  * correct value based on handling `onClick` events and re-rendering.
173
+ * @default false
368
174
  */
369
- checked?: boolean;
175
+ checked: boolean;
176
+ };
177
+
178
+ export declare type ToggleButtonProps = ButtonProps & Partial<ToggleButtonCommons> & {
370
179
  /**
371
- * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.
372
- * Mutually exclusive to `checked`.
180
+ * Defines whether the `ToggleButton` is initially in a checked state or not when rendered.
181
+ * @default false
373
182
  */
374
183
  defaultChecked?: boolean;
375
- }
376
-
377
- /**
378
- * {@docCategory Button}
379
- */
380
- export declare interface ToggleButtonState extends ToggleButtonProps {
381
- }
382
-
383
- export declare type ToggleButtonTokens = ButtonTokens;
384
-
385
- export declare type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;
386
-
387
- /**
388
- * Given user props, returns state and render function for a Button.
389
- */
390
- export declare const useButton: (props: ButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ButtonProps | undefined) => {
391
- state: Record<string, any>;
392
- render: (state: import("./Button.types").ButtonState) => JSX.Element;
393
184
  };
394
185
 
395
- export declare const useButtonClasses: (state: ButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
186
+ export declare type ToggleButtonState = ButtonState & ToggleButtonCommons;
396
187
 
397
188
  /**
398
- * The useButton hook processes the Button draft state.
399
- * @param draftState - Button draft state to mutate.
189
+ * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
190
+ * @param props - User provided props to the Button component.
191
+ * @param ref - User provided ref to be passed to the Button component.
400
192
  */
401
- export declare const useButtonState: (draftState: ButtonState) => void;
193
+ export declare const useButton: (props: ButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ButtonState;
402
194
 
403
- /**
404
- * The useToggle hook processes adds the correct toggled state and acccessibility as needed.
405
- * @param draftState - state to read and augment.
406
- */
407
- export declare const useChecked: <TDraftState extends CheckedState>(draftState: TDraftState) => void;
408
-
409
- export declare const useClasses: (state: CompoundButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
195
+ export declare const useButtonStyles: (state: ButtonState) => ButtonState;
410
196
 
411
197
  /**
412
- * Given user props, returns state and render function for a Button.
198
+ * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
199
+ * @param props - User provided props to the CompoundButton component.
200
+ * @param ref - User provided ref to be passed to the CompoundButton component.
413
201
  */
414
- export declare const useCompoundButton: (props: CompoundButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: CompoundButtonProps | undefined) => {
415
- state: Record<string, any>;
416
- render: (state: import("./CompoundButton.types").CompoundButtonState) => JSX.Element;
417
- };
202
+ export declare const useCompoundButton: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
418
203
 
419
- export declare const useCompoundButtonClasses: (state: CompoundButtonState) => void;
204
+ export declare const useCompoundButtonStyles: (state: CompoundButtonState) => CompoundButtonState;
420
205
 
421
206
  /**
422
- * @param draftState - mutable state object to update to add expanded behavior.
207
+ * Given user props, returns the final state for a MenuButton.
423
208
  */
424
- export declare const useExpanded: <TDraftState extends ExpandedState>(draftState: TDraftState) => void;
209
+ export declare const useMenuButton: ({ menuIcon, ...props }: MenuButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
210
+
211
+ export declare const useMenuButtonStyles: (state: MenuButtonState) => MenuButtonState;
425
212
 
426
213
  /**
427
- * Redefine the component factory, reusing button factory.
214
+ * Given user props, defines default props for the SplitButton and returns processed state.
215
+ * @param props - User provided props to the SplitButton component.
216
+ * @param ref - User provided ref to be passed to the SplitButton component.
428
217
  */
429
- export declare const useMenuButton: (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps | undefined) => {
430
- state: MenuButtonState;
431
- render: (state: MenuButtonState) => JSX.Element;
432
- };
433
-
434
- export declare const useMenuButtonClasses: (state: MenuButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
218
+ export declare const useSplitButton: (props: SplitButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
435
219
 
436
- export declare const useMenuButtonState: (state: MenuButtonState) => void;
437
-
438
- export declare const useMenuContext: () => MinimalMenuProps;
220
+ export declare const useSplitButtonStyles: (state: SplitButtonState) => SplitButtonState;
439
221
 
440
222
  /**
441
- * Redefine the component factory, reusing button factory.
223
+ * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
224
+ * processed state.
225
+ * @param props - User provided props to the ToggleButton component.
226
+ * @param ref - User provided ref to be passed to the ToggleButton component.
442
227
  */
443
- export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => {
444
- state: SplitButtonState;
445
- render: (state: SplitButtonState) => JSX.Element;
446
- };
447
-
448
- export declare const useSplitButtonClasses: (state: SplitButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
449
-
450
- export declare const useToggleButton: (props: ToggleButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ToggleButtonProps | undefined) => {
451
- state: Record<string, any>;
452
- render: (state: import("../Button").ButtonState) => JSX.Element;
453
- };
228
+ export declare const useToggleButton: ({ checked, defaultChecked, ...props }: ToggleButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToggleButtonState;
454
229
 
455
- export declare const useToggleButtonClasses: (state: ToggleButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
230
+ export declare const useToggleButtonStyles: (state: ToggleButtonState) => ToggleButtonState;
456
231
 
457
232
  export { }
package/lib/Button.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"../src/","sources":["Button.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC","sourcesContent":["export * from './components/Button/index';\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompoundButton.js","sourceRoot":"../src/","sources":["CompoundButton.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/CompoundButton/index';\n"]}
1
+ {"version":3,"file":"CompoundButton.js","sourceRoot":"","sources":["../src/CompoundButton.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.js","sourceRoot":"../src/","sources":["MenuButton.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/MenuButton/index';\n"]}
1
+ {"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../src/MenuButton.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["SplitButton.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/SplitButton/index';\n"]}
1
+ {"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../src/SplitButton.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.js","sourceRoot":"../src/","sources":["ToggleButton.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './components/ToggleButton/index';\n"]}
1
+ {"version":3,"file":"ToggleButton.js","sourceRoot":"","sources":["../src/ToggleButton.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
@@ -1,2 +1,4 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant(testInfo: Omit<IsConformantOptions, 'componentPath'>): void;
1
+ import type { IsConformantOptions } from '@fluentui/react-conformance';
2
+ export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
+ componentPath?: string;
4
+ }): void;
@@ -1,9 +1,13 @@
1
1
  import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
+ import makeStylesTests from '@fluentui/react-conformance-make-styles';
2
3
  export function isConformant(testInfo) {
3
- var defaultOptions = {
4
- disabledTests: ['has-docblock', 'kebab-aria-attributes'],
5
- componentPath: module.parent.filename.replace('.test', ''),
6
- };
7
- baseIsConformant(defaultOptions, testInfo);
4
+ var defaultOptions = {
5
+ asPropHandlesRef: true,
6
+ componentPath: module.parent.filename.replace('.test', ''),
7
+ disabledTests: ['has-docblock', 'kebab-aria-attributes'],
8
+ extraTests: makeStylesTests,
9
+ skipAsPropTests: true
10
+ };
11
+ baseIsConformant(defaultOptions, testInfo);
8
12
  }
9
13
  //# sourceMappingURL=isConformant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,MAAM,UAAU,YAAY,CAAC,QAAoD;IAC/E,IAAM,cAAc,GAAG;QACrB,aAAa,EAAE,CAAC,cAAc,EAAE,uBAAuB,CAAC;QACxD,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant(testInfo: Omit<IsConformantOptions, 'componentPath'>) {\n const defaultOptions = {\n disabledTests: ['has-docblock', 'kebab-aria-attributes'],\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
1
+ {"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,EAAiB,uBAAjB,CAH4C;AAI3D,IAAA,UAAU,EAAE,eAJ+C;AAK3D,IAAA,eAAe,EAAE;AAL0C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}