@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,6 @@
1
- import * as React from 'react';
2
- import { ButtonProps } from './Button.types';
1
+ import type { ButtonProps } from './Button.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled Button, using the `useButton` hook.
5
- * {@docCategory Button}
4
+ * Buttons give people a way to trigger an action.
6
5
  */
7
- export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
6
+ export declare const Button: ForwardRefComponent<ButtonProps>;
@@ -1,16 +1,15 @@
1
1
  import * as React from 'react';
2
+ import { renderButton } from './renderButton';
2
3
  import { useButton } from './useButton';
3
- import { useInlineTokens } from '@fluentui/react-theme-provider';
4
- import { useButtonClasses } from './useButtonClasses';
4
+ import { useButtonStyles } from './useButtonStyles';
5
5
  /**
6
- * Define a styled Button, using the `useButton` hook.
7
- * {@docCategory Button}
6
+ * Buttons give people a way to trigger an action.
8
7
  */
9
- export var Button = React.forwardRef(function (props, ref) {
10
- var _a = useButton(props, ref), render = _a.render, state = _a.state;
11
- useButtonClasses(state);
12
- useInlineTokens(state, '--button');
13
- return render(state);
8
+
9
+ export var Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
+ var state = useButton(props, ref);
11
+ useButtonStyles(state);
12
+ return renderButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
14
13
  });
15
14
  Button.displayName = 'Button';
16
15
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"../src/","sources":["components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,IAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAA2B,UAAC,KAAK,EAAE,GAAG;IACpE,IAAA,0BAAyC,EAAvC,kBAAM,EAAE,gBAA+B,CAAC;IAEhD,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import * as React from 'react';\nimport { useButton } from './useButton';\nimport { ButtonProps } from './Button.types';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useButtonClasses } from './useButtonClasses';\n\n/**\n * Define a styled Button, using the `useButton` hook.\n * {@docCategory Button}\n */\nexport const Button = React.forwardRef<HTMLElement, ButtonProps>((props, ref) => {\n const { render, state } = useButton(props, ref);\n\n useButtonClasses(state);\n useInlineTokens(state, '--button');\n\n return render(state);\n});\n\nButton.displayName = 'Button';\n"]}
1
+ {"version":3,"sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,SAAT,QAA0B,aAA1B;AACA,SAAS,eAAT,QAAgC,mBAAhC;AAIA;;AAEG;;AACH,OAAO,IAAM,MAAM,gBAAqC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClF,MAAM,KAAK,GAAG,SAAS,CAAC,KAAD,EAAQ,GAAR,CAAvB;AAEA,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,YAAY,CAAC,KAAD,CAAnB,CALkF,CAMlF;AACD,CAPuD,CAAjD;AASP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourceRoot":""}
@@ -1,130 +1,62 @@
1
- import * as React from 'react';
2
- import { ComponentProps, ShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { ColorTokens, RecursivePartial, SizeValue, FontTokens } from '@fluentui/theme';
4
- /**
5
- * {@docCategory Button}
6
- */
7
- export declare type ButtonProps = ComponentProps & React.HTMLAttributes<HTMLElement> & {
1
+ import { ARIAButtonShorthandProps } from '@fluentui/react-aria';
2
+ import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
3
+ export declare type ButtonSlots = {
8
4
  /**
9
- * Shorthand icon. A shorthand prop can be a literal, object, or
10
- * JSX. The `children` prop of the object can be a render function,
11
- * taking in the original slot component and props.
5
+ * Root of the component that renders as either a <button> tag.
12
6
  */
13
- icon?: ShorthandProps;
7
+ root: ARIAButtonShorthandProps;
14
8
  /**
15
- * Shorthand loader content within the button.
9
+ * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.
16
10
  */
17
- loader?: ShorthandProps;
11
+ icon?: IntrinsicShorthandProps<'span'>;
12
+ };
13
+ export declare type ButtonCommons = {
18
14
  /**
19
- * Shorthand children content within the button.
15
+ * A button can have its content and borders styled for greater emphasis or to be subtle.
16
+ * - 'primary': Emphasizes the button as a primary action.
17
+ * - 'outline': Removes background styling.
18
+ * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
19
+ * - 'transparent': Removes background and border styling.
20
20
  */
21
- content?: ShorthandProps;
21
+ appearance?: 'primary' | 'outline' | 'subtle' | 'transparent';
22
22
  /**
23
- * Defines the href to navigate to. If applied, will render the button as an anchor
24
- * element by default, unless `as` specifies otherwise. Note that specifying an href
25
- * and a non-anchor as the render type will prevent the Button from behaving like a
26
- * hyperlink and opening the href on click.
23
+ * A button can fill the width of its container.
24
+ * @default false
27
25
  */
28
- href?: string;
26
+ block: boolean;
29
27
  /**
30
- * Defines the target window to open the href in. Only is applied if the button renders
31
- * as an anchor tag, which is the default behavior if href is provided.
28
+ * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
29
+ * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
30
+ * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
31
+ * @default false
32
32
  */
33
- target?: string;
34
- /** A button can appear circular. */
35
- circular?: boolean;
36
- /** A button can show that it cannot be interacted with. */
37
- disabled?: boolean;
38
- /** A button can fill the width of its container. */
39
- block?: boolean;
40
- /** A button can contain only an icon. */
41
- iconOnly?: boolean;
42
- /** An icon button can format its icon to appear before or after its content. */
43
- iconPosition?: 'before' | 'after';
44
- /** A button that inherits its background and has a subtle appearance. */
45
- inverted?: boolean;
46
- /** Opt in to a named variant which can be supplied by a theme. */
47
- variant?: string;
48
- /** A button can show a loading indicator. */
49
- loading?: boolean;
33
+ disabledFocusable: boolean;
50
34
  /**
51
- * Called after a user clicks the button.
52
- * @param event - React's original SyntheticEvent.
53
- * @param data - All props.
35
+ * A button can show that it cannot be interacted with.
36
+ * @default false
54
37
  */
38
+ disabled: boolean;
55
39
  /**
56
- * Called after a user focuses the button.
57
- * @param event - React's original SyntheticEvent.
58
- * @param data - All props.
40
+ * A button can format its icon to appear before or after its content.
41
+ * @default 'before'
59
42
  */
60
- /** A button can emphasize that it represents the primary action. */
61
- primary?: boolean;
62
- /** A button can emphasize that it represents an alternative action. */
63
- secondary?: boolean;
64
- /** A button can blend into its background to become less emphasized. */
65
- ghost?: boolean;
66
- /** A button can have no background styling and just be emphasized through its content styling. */
67
- transparent?: boolean;
68
- /** A button can be sized. */
69
- size?: SizeValue;
70
- /** A button can be formatted to show only text in order to indicate a less-pronounced action. */
71
- tokens?: RecursivePartial<ButtonTokens>;
72
- };
73
- /**
74
- * {@docCategory Button}
75
- */
76
- export interface ButtonState extends ButtonProps {
77
- buttonRef?: React.RefObject<HTMLButtonElement>;
78
- }
79
- /**
80
- * {@docCategory Button}
81
- */
82
- export declare type ButtonTokens = ColorTokens & FontTokens & {
83
- paddingLeft?: string;
84
- paddingRight?: string;
85
- paddingTop?: string;
86
- paddingBottom?: string;
87
- margin?: string;
88
- height?: string;
89
- minWidth?: string;
90
- maxWidth?: string;
91
- minHeight?: string;
92
- contentGap?: string;
93
- iconSize?: string;
94
- borderRadius?: string;
95
- borderTopLeftRadius?: string;
96
- borderTopRightRadius?: string;
97
- borderBottomLeftRadius?: string;
98
- borderBottomRightRadius?: string;
99
- borderWidth?: string;
100
- boxShadow?: string;
101
- width?: string;
102
- forcedColorAdjust?: string;
103
- transform?: string;
104
- transition?: string;
105
- size?: {
106
- smallest?: string;
107
- smaller?: string;
108
- small?: string;
109
- regular?: string;
110
- large?: string;
111
- larger?: string;
112
- largest?: string;
113
- };
114
- pressed?: {
115
- transform?: string;
116
- transition?: string;
117
- };
43
+ iconPosition: 'before' | 'after';
44
+ /**
45
+ * A button can be rounded, circular, or square.
46
+ * @default 'rounded'
47
+ */
48
+ shape: 'rounded' | 'circular' | 'square';
49
+ /**
50
+ * A button supports different sizes.
51
+ * @default 'medium'
52
+ */
53
+ size: 'small' | 'medium' | 'large';
118
54
  };
119
- /**
120
- * {@docCategory Button}
121
- */
122
- export declare type ButtonVariants<TTokens = ButtonTokens> = {
123
- root?: TTokens;
124
- block?: TTokens;
125
- circular?: TTokens;
126
- iconOnly?: TTokens;
127
- ghost?: TTokens;
128
- primary?: TTokens;
129
- transparent?: TTokens;
55
+ export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
56
+ export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
57
+ /**
58
+ * A button can contain only an icon.
59
+ * @default false
60
+ */
61
+ iconOnly: boolean;
130
62
  };
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=Button.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.js","sourceRoot":"../src/","sources":["components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentProps, ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ColorTokens, RecursivePartial, SizeValue, FontTokens } from '@fluentui/theme';\n\n/**\n * {@docCategory Button}\n */\nexport type ButtonProps = ComponentProps &\n React.HTMLAttributes<HTMLElement> & {\n /**\n * Shorthand icon. A shorthand prop can be a literal, object, or\n * JSX. The `children` prop of the object can be a render function,\n * taking in the original slot component and props.\n */\n icon?: ShorthandProps;\n\n /**\n * Shorthand loader content within the button.\n */\n loader?: ShorthandProps;\n\n /**\n * Shorthand children content within the button.\n */\n content?: ShorthandProps;\n\n /**\n * Defines the href to navigate to. If applied, will render the button as an anchor\n * element by default, unless `as` specifies otherwise. Note that specifying an href\n * and a non-anchor as the render type will prevent the Button from behaving like a\n * hyperlink and opening the href on click.\n */\n href?: string;\n\n /**\n * Defines the target window to open the href in. Only is applied if the button renders\n * as an anchor tag, which is the default behavior if href is provided.\n */\n target?: string;\n\n /** A button can appear circular. */\n circular?: boolean;\n\n /** A button can show that it cannot be interacted with. */\n disabled?: boolean;\n\n /** A button can fill the width of its container. */\n block?: boolean;\n\n /** A button can contain only an icon. */\n iconOnly?: boolean;\n\n /** An icon button can format its icon to appear before or after its content. */\n iconPosition?: 'before' | 'after';\n\n /** A button that inherits its background and has a subtle appearance. */\n inverted?: boolean;\n\n /** Opt in to a named variant which can be supplied by a theme. */\n variant?: string;\n\n /** A button can show a loading indicator. */\n loading?: boolean;\n\n /**\n * Called after a user clicks the button.\n * @param event - React's original SyntheticEvent.\n * @param data - All props.\n */\n // onClick?: ComponentEventHandler<ButtonProps>;\n\n /**\n * Called after a user focuses the button.\n * @param event - React's original SyntheticEvent.\n * @param data - All props.\n */\n // onFocus?: ComponentEventHandler<ButtonProps>;\n\n /** A button can emphasize that it represents the primary action. */\n primary?: boolean;\n\n /** A button can emphasize that it represents an alternative action. */\n secondary?: boolean;\n\n /** A button can blend into its background to become less emphasized. */\n ghost?: boolean;\n\n /** A button can have no background styling and just be emphasized through its content styling. */\n transparent?: boolean;\n\n /** A button can be sized. */\n size?: SizeValue;\n\n // TODO: Deprecate or rename to textOnly for alignment with iconOnly?\n /** A button can be formatted to show only text in order to indicate a less-pronounced action. */\n // text?: boolean;\n\n tokens?: RecursivePartial<ButtonTokens>;\n };\n\n/**\n * {@docCategory Button}\n */\nexport interface ButtonState extends ButtonProps {\n buttonRef?: React.RefObject<HTMLButtonElement>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type ButtonTokens = ColorTokens &\n FontTokens & {\n /* sizing */\n paddingLeft?: string;\n paddingRight?: string;\n paddingTop?: string;\n paddingBottom?: string;\n margin?: string;\n height?: string;\n minWidth?: string;\n maxWidth?: string;\n minHeight?: string;\n contentGap?: string;\n iconSize?: string;\n borderRadius?: string;\n borderTopLeftRadius?: string;\n borderTopRightRadius?: string;\n borderBottomLeftRadius?: string;\n borderBottomRightRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n width?: string;\n\n forcedColorAdjust?: string;\n\n transform?: string;\n transition?: string;\n\n size?: {\n smallest?: string;\n smaller?: string;\n small?: string;\n regular?: string;\n large?: string;\n larger?: string;\n largest?: string;\n };\n\n pressed?: {\n transform?: string;\n transition?: string;\n };\n };\n\n/**\n * {@docCategory Button}\n */\nexport type ButtonVariants<TTokens = ButtonTokens> = {\n root?: TTokens;\n block?: TTokens;\n circular?: TTokens;\n iconOnly?: TTokens;\n ghost?: TTokens;\n primary?: TTokens;\n transparent?: TTokens;\n};\n"]}
1
+ {"version":3,"file":"Button.types.js","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
+ export * from './Button';
1
2
  export * from './Button.types';
2
- export * from './useButtonClasses';
3
+ export * from './renderButton';
3
4
  export * from './useButton';
4
- export * from './useButtonState';
5
- export * from './Button';
5
+ export { useButtonStyles } from './useButtonStyles';
@@ -1,5 +1,6 @@
1
- export * from './useButtonClasses';
2
- export * from './useButton';
3
- export * from './useButtonState';
4
1
  export * from './Button';
2
+ export * from './Button.types';
3
+ export * from './renderButton';
4
+ export * from './useButton';
5
+ export { useButtonStyles } from './useButtonStyles';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Button/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC","sourcesContent":["export * from './Button.types';\nexport * from './useButtonClasses';\nexport * from './useButton';\nexport * from './useButtonState';\nexport * from './Button';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ButtonState } from './Button.types';
1
+ import type { ButtonState } from './Button.types';
2
2
  /**
3
- * Define the render function. Given the state of a button, renders it.
3
+ * Renders a Button component by passing the state defined props to the appropriate slots.
4
4
  */
5
5
  export declare const renderButton: (state: ButtonState) => JSX.Element;
@@ -1,17 +1,17 @@
1
1
  import { __assign } from "tslib";
2
2
  import * as React from 'react';
3
- import { getSlots } from '@fluentui/react-compose/lib/next/index';
4
- import { buttonShorthandProps } from './useButton';
3
+ import { getSlots } from '@fluentui/react-utilities';
5
4
  /**
6
- * Define the render function. Given the state of a button, renders it.
5
+ * Renders a Button component by passing the state defined props to the appropriate slots.
7
6
  */
7
+
8
8
  export var renderButton = function (state) {
9
- var _a = getSlots(state, buttonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
10
- var loading = state.loading, iconPosition = state.iconPosition, iconOnly = state.iconOnly;
11
- return (React.createElement(slots.root, __assign({}, slotProps.root),
12
- loading && React.createElement(slots.loader, __assign({}, slotProps.loader)),
13
- iconPosition !== 'after' && React.createElement(slots.icon, __assign({}, slotProps.icon)),
14
- !iconOnly && React.createElement(slots.content, __assign({}, slotProps.content)),
15
- iconPosition === 'after' && React.createElement(slots.icon, __assign({}, slotProps.icon))));
9
+ var _a = getSlots(state, ['root', 'icon']),
10
+ slots = _a.slots,
11
+ slotProps = _a.slotProps;
12
+
13
+ var iconOnly = state.iconOnly,
14
+ iconPosition = state.iconPosition;
15
+ return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), iconPosition !== 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), !iconOnly && state.root.children, iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)));
16
16
  };
17
17
  //# sourceMappingURL=renderButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderButton.js","sourceRoot":"../src/","sources":["components/Button/renderButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,KAAkB;IACvC,IAAA,0CAA4D,EAA1D,gBAAK,EAAE,wBAAmD,CAAC;IAC3D,IAAA,uBAAO,EAAE,iCAAY,EAAE,yBAAQ,CAAW;IAElD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC3B,OAAO,IAAI,oBAAC,KAAK,CAAC,MAAM,eAAK,SAAS,CAAC,MAAM,EAAI;QACjD,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI,EAAI;QAC9D,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,OAAO,eAAK,SAAS,CAAC,OAAO,EAAI;QACrD,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonState } from './Button.types';\nimport { buttonShorthandProps } from './useButton';\n\n/**\n * Define the render function. Given the state of a button, renders it.\n */\nexport const renderButton = (state: ButtonState) => {\n const { slots, slotProps } = getSlots(state, buttonShorthandProps);\n const { loading, iconPosition, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {loading && <slots.loader {...slotProps.loader} />}\n {iconPosition !== 'after' && <slots.icon {...slotProps.icon} />}\n {!iconOnly && <slots.content {...slotProps.content} />}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,YAAY,GAAG,UAAC,KAAD,EAAmB;AACvC,MAAA,EAAA,GAAuB,QAAQ,CAAc,KAAd,EAAqB,CAAC,MAAD,EAAS,MAAT,CAArB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACE,MAAA,QAAQ,GAAmB,KAAK,CAAxB,QAAR;AAAA,MAAU,YAAY,GAAK,KAAK,CAAV,YAAtB;AAER,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,YAAY,KAAK,OAAjB,iBAA4B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAD/B,EAEG,CAAC,QAAD,IAAa,KAAK,CAAC,IAAN,CAAW,QAF3B,EAGG,YAAY,KAAK,OAAjB,iBAA4B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAH/B,CADF;AAOD,CAXM","sourceRoot":""}
@@ -1,13 +1,8 @@
1
1
  import * as React from 'react';
2
- import { ButtonProps } from './Button.types';
2
+ import type { ButtonProps, ButtonState } from './Button.types';
3
3
  /**
4
- * Consts listing which props are shorthand props.
4
+ * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
5
+ * @param props - User provided props to the Button component.
6
+ * @param ref - User provided ref to be passed to the Button component.
5
7
  */
6
- export declare const buttonShorthandProps: string[];
7
- /**
8
- * Given user props, returns state and render function for a Button.
9
- */
10
- export declare const useButton: (props: ButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ButtonProps | undefined) => {
11
- state: Record<string, any>;
12
- render: (state: import("./Button.types").ButtonState) => JSX.Element;
13
- };
8
+ export declare const useButton: (props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ButtonState;
@@ -1,28 +1,53 @@
1
- import * as React from 'react';
2
- import { makeMergeProps, resolveShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { useButtonState } from './useButtonState';
4
- import { renderButton } from './renderButton';
1
+ import { useARIAButton } from '@fluentui/react-aria';
2
+ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
5
3
  /**
6
- * Consts listing which props are shorthand props.
4
+ * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
5
+ * @param props - User provided props to the Button component.
6
+ * @param ref - User provided ref to be passed to the Button component.
7
7
  */
8
- export var buttonShorthandProps = ['icon', 'loader', 'content'];
9
- var mergeProps = makeMergeProps({ deepMerge: buttonShorthandProps });
10
- /**
11
- * Given user props, returns state and render function for a Button.
12
- */
13
- export var useButton = function (props, ref, defaultProps) {
14
- // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.
15
- // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.
16
- // eslint-disable-next-line react-hooks/rules-of-hooks
17
- var resolvedRef = ref || React.useRef();
18
- var state = mergeProps({
19
- ref: resolvedRef,
20
- as: props.href ? 'a' : 'button',
21
- icon: { as: 'span' },
22
- content: { as: 'span', children: props.children },
23
- loader: { as: 'span' },
24
- }, defaultProps, resolveShorthandProps(props, buttonShorthandProps));
25
- useButtonState(state);
26
- return { state: state, render: renderButton };
8
+
9
+ export var useButton = function (props, ref) {
10
+ var appearance = props.appearance,
11
+ as = props.as,
12
+ _a = props.block,
13
+ block = _a === void 0 ? false : _a,
14
+ _b = props.disabled,
15
+ disabled = _b === void 0 ? false : _b,
16
+ _c = props.disabledFocusable,
17
+ disabledFocusable = _c === void 0 ? false : _c,
18
+ icon = props.icon,
19
+ _d = props.iconPosition,
20
+ iconPosition = _d === void 0 ? 'before' : _d,
21
+ _e = props.shape,
22
+ shape = _e === void 0 ? 'rounded' : _e,
23
+ _f = props.size,
24
+ size = _f === void 0 ? 'medium' : _f;
25
+ var iconShorthand = resolveShorthand(icon);
26
+ return {
27
+ // Props passed at the top-level
28
+ appearance: appearance,
29
+ block: block,
30
+ disabled: disabled,
31
+ disabledFocusable: disabledFocusable,
32
+ iconPosition: iconPosition,
33
+ shape: shape,
34
+ size: size,
35
+ // State calculated from a set of props
36
+ iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
37
+ // Slots definition
38
+ components: {
39
+ root: 'button',
40
+ icon: 'span'
41
+ },
42
+ root: getNativeElementProps(as || 'button', useARIAButton(props, {
43
+ required: true,
44
+ defaultProps: {
45
+ // useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>
46
+ ref: ref,
47
+ type: 'button'
48
+ }
49
+ })),
50
+ icon: iconShorthand
51
+ };
27
52
  };
28
53
  //# sourceMappingURL=useButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useButton.js","sourceRoot":"../src/","sources":["components/Button/useButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,IAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAElE,IAAM,UAAU,GAAG,cAAc,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,KAAkB,EAAE,GAA2B,EAAE,YAA0B;IACnG,oGAAoG;IACpG,4FAA4F;IAC5F,sDAAsD;IACtD,IAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,UAAU,CACtB;QACE,GAAG,EAAE,WAAW;QAChB,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ;QAC/B,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACpB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;QACjD,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;KACvB,EACD,YAAY,EACZ,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,CAAC,CACnD,CAAC;IAEF,cAAc,CAAC,KAAK,CAAC,CAAC;IAEtB,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps } from './Button.types';\nimport { useButtonState } from './useButtonState';\nimport { renderButton } from './renderButton';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const buttonShorthandProps = ['icon', 'loader', 'content'];\n\nconst mergeProps = makeMergeProps({ deepMerge: buttonShorthandProps });\n\n/**\n * Given user props, returns state and render function for a Button.\n */\nexport const useButton = (props: ButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ButtonProps) => {\n // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.\n // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const resolvedRef = ref || React.useRef();\n const state = mergeProps(\n {\n ref: resolvedRef,\n as: props.href ? 'a' : 'button',\n icon: { as: 'span' },\n content: { as: 'span', children: props.children },\n loader: { as: 'span' },\n },\n defaultProps,\n resolveShorthandProps(props, buttonShorthandProps),\n );\n\n useButtonState(state);\n\n return { state, render: renderButton };\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Button/useButton.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,QAA8B,sBAA9B;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;;;AAIG;;AACH,OAAO,IAAM,SAAS,GAAG,UAAC,KAAD,EAAqB,GAArB,EAA0E;AAE/F,MAAA,UAAU,GASR,KAAK,CATG,UAAV;AAAA,MACA,EAAE,GAQA,KAAK,CARL,EADF;AAAA,MAEA,EAAA,GAOE,KAAK,CAPM,KAFb;AAAA,MAEA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAFb;AAAA,MAGA,EAAA,GAME,KAAK,CANS,QAHhB;AAAA,MAGA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAHhB;AAAA,MAIA,EAAA,GAKE,KAAK,CALkB,iBAJzB;AAAA,MAIA,iBAAiB,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAJzB;AAAA,MAKA,IAAI,GAIF,KAAK,CAJH,IALJ;AAAA,MAMA,EAAA,GAGE,KAAK,CAHgB,YANvB;AAAA,MAMA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EANvB;AAAA,MAOA,EAAA,GAEE,KAAK,CAFU,KAPjB;AAAA,MAOA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,SAAH,GAAY,EAPjB;AAAA,MAQA,EAAA,GACE,KAAK,CADQ,IARf;AAAA,MAQA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EARf;AAUF,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAD,CAAtC;AAEA,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,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAA,aAAa,CAAE,QAAf,KAA2B,CAAC,KAAK,CAAC,QAAnC,CAXZ;AAaL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE;AAFI,KAdP;AAmBL,IAAA,IAAI,EAAE,qBAAqB,CACzB,EAAE,IAAI,QADmB,EAEzB,aAAa,CAAC,KAAD,EAAQ;AACnB,MAAA,QAAQ,EAAE,IADS;AAEnB,MAAA,YAAY,EAAE;AACZ;AACA,QAAA,GAAG,EAAE,GAFO;AAGZ,QAAA,IAAI,EAAE;AAHM;AAFK,KAAR,CAFY,CAnBtB;AA8BL,IAAA,IAAI,EAAE;AA9BD,GAAP;AAgCD,CA9CM","sourceRoot":""}
@@ -0,0 +1,10 @@
1
+ import type { ButtonState } from './Button.types';
2
+ export declare const buttonSpacing: {
3
+ smallest: string;
4
+ smaller: string;
5
+ small: string;
6
+ medium: string;
7
+ large: string;
8
+ larger: string;
9
+ };
10
+ export declare const useButtonStyles: (state: ButtonState) => ButtonState;