@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,81 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-theme-provider"], function (require, exports, react_theme_provider_1) {
2
- "use strict";
3
- var _a, _b;
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- var GlobalClassNames = {
6
- root: 'ms-Button-root',
7
- menuIcon: 'ms-Button-menuIcon',
8
- _disabled: 'ms-Button--disabled',
9
- _iconOnly: 'ms-Button--iconOnly',
10
- _ghost: 'ms-Button--ghost',
11
- _expanded: 'ms-Button--expanded',
12
- };
13
- exports.useMenuButtonClasses = react_theme_provider_1.makeVariantClasses({
14
- name: 'MenuButton',
15
- prefix: '--button',
16
- styles: {
17
- root: [
18
- GlobalClassNames.root,
19
- (_a = {
20
- // This seems like a bad selector.
21
- '& > .ms-Button-menuIcon + *': {
22
- marginLeft: 0,
23
- },
24
- '& .ms-layer': {
25
- position: 'absolute',
26
- }
27
- },
28
- _a["&:hover ." + GlobalClassNames.menuIcon] = {
29
- color: 'var(--button-hovered-menuIconColor, var(--button-menuIconColor))',
30
- },
31
- _a["&:active ." + GlobalClassNames.menuIcon] = {
32
- color: 'var(--button-pressed-menuIconColor, var(--button-hovered-menuIconColor, var(--button-menuIconColor)))',
33
- },
34
- _a),
35
- ],
36
- menuIcon: [
37
- GlobalClassNames.menuIcon,
38
- (_b = {
39
- color: 'var(--button-menuIconColor)',
40
- fontSize: 'var(--button-menuIconSize)'
41
- },
42
- _b["." + GlobalClassNames._disabled + " &"] = {
43
- color: 'var(--button-disabled-menuIconColor)',
44
- },
45
- _b),
46
- ],
47
- _disabled: [GlobalClassNames._disabled],
48
- _iconOnly: [
49
- GlobalClassNames._iconOnly,
50
- {
51
- '& > .ms-Button-icon + *': {
52
- marginLeft: 0,
53
- },
54
- },
55
- ],
56
- },
57
- variants: function (theme) {
58
- var _a, _b, _c, _d;
59
- var palette = theme.palette;
60
- return {
61
- root: {
62
- menuIconSize: '12px',
63
- menuIconColor: 'var(--body-menuIconColor)',
64
- },
65
- ghost: {
66
- menuIconColor: (_a = palette) === null || _a === void 0 ? void 0 : _a.neutralSecondary,
67
- hovered: {
68
- menuIconColor: (_b = palette) === null || _b === void 0 ? void 0 : _b.themePrimary,
69
- },
70
- pressed: {
71
- menuIconColor: (_c = palette) === null || _c === void 0 ? void 0 : _c.black,
72
- },
73
- },
74
- transparent: {
75
- menuIconColor: (_d = palette) === null || _d === void 0 ? void 0 : _d.neutralSecondary,
76
- },
77
- };
78
- },
79
- });
80
- });
81
- //# sourceMappingURL=useMenuButtonClasses.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuButtonClasses.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonClasses.ts"],"names":[],"mappings":";;;;IAGA,IAAM,gBAAgB,GAAG;QACvB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,oBAAoB;QAC9B,SAAS,EAAE,qBAAqB;QAChC,SAAS,EAAE,qBAAqB;QAChC,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,qBAAqB;KACjC,CAAC;IAEW,QAAA,oBAAoB,GAAG,yCAAkB,CAAsC;QAC1F,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,gBAAgB,CAAC,IAAI;;wBAEnB,kCAAkC;wBAClC,6BAA6B,EAAE;4BAC7B,UAAU,EAAE,CAAC;yBACd;wBAED,aAAa,EAAE;4BACb,QAAQ,EAAE,UAAU;yBACrB;;oBAED,GAAC,cAAY,gBAAgB,CAAC,QAAU,IAAG;wBACzC,KAAK,EAAE,kEAAkE;qBAC1E;oBAED,GAAC,eAAa,gBAAgB,CAAC,QAAU,IAAG;wBAC1C,KAAK,EACH,uGAAuG;qBAC1G;;aAEJ;YAED,QAAQ,EAAE;gBACR,gBAAgB,CAAC,QAAQ;;wBAEvB,KAAK,EAAE,6BAA6B;wBACpC,QAAQ,EAAE,4BAA4B;;oBAEtC,GAAC,MAAI,gBAAgB,CAAC,SAAS,OAAI,IAAG;wBACpC,KAAK,EAAE,sCAAsC;qBAC9C;;aAEJ;YAED,SAAS,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC;YAEvC,SAAS,EAAE;gBACT,gBAAgB,CAAC,SAAS;gBAC1B;oBACE,yBAAyB,EAAE;wBACzB,UAAU,EAAE,CAAC;qBACd;iBACF;aACF;SACF;QAED,QAAQ,EAAE,UAAC,KAAY;;YACb,IAAA,uBAAO,CAAW;YAE1B,OAAO;gBACL,IAAI,EAAE;oBACJ,YAAY,EAAE,MAAM;oBACpB,aAAa,EAAE,2BAA2B;iBAC3C;gBAED,KAAK,EAAE;oBACL,aAAa,QAAE,OAAO,0CAAE,gBAAgB;oBACxC,OAAO,EAAE;wBACP,aAAa,QAAE,OAAO,0CAAE,YAAY;qBACrC;oBACD,OAAO,EAAE;wBACP,aAAa,QAAE,OAAO,0CAAE,KAAK;qBAC9B;iBACF;gBAED,WAAW,EAAE;oBACX,aAAa,QAAE,OAAO,0CAAE,gBAAgB;iBACzC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC","sourcesContent":["import { makeVariantClasses, Theme } from '@fluentui/react-theme-provider';\nimport { MenuButtonState, MenuButtonVariants } from './MenuButton.types';\n\nconst GlobalClassNames = {\n root: 'ms-Button-root',\n menuIcon: 'ms-Button-menuIcon',\n _disabled: 'ms-Button--disabled',\n _iconOnly: 'ms-Button--iconOnly',\n _ghost: 'ms-Button--ghost',\n _expanded: 'ms-Button--expanded',\n};\n\nexport const useMenuButtonClasses = makeVariantClasses<MenuButtonState, MenuButtonVariants>({\n name: 'MenuButton',\n prefix: '--button',\n styles: {\n root: [\n GlobalClassNames.root,\n {\n // This seems like a bad selector.\n '& > .ms-Button-menuIcon + *': {\n marginLeft: 0,\n },\n\n '& .ms-layer': {\n position: 'absolute',\n },\n\n [`&:hover .${GlobalClassNames.menuIcon}`]: {\n color: 'var(--button-hovered-menuIconColor, var(--button-menuIconColor))',\n },\n\n [`&:active .${GlobalClassNames.menuIcon}`]: {\n color:\n 'var(--button-pressed-menuIconColor, var(--button-hovered-menuIconColor, var(--button-menuIconColor)))',\n },\n },\n ],\n\n menuIcon: [\n GlobalClassNames.menuIcon,\n {\n color: 'var(--button-menuIconColor)',\n fontSize: 'var(--button-menuIconSize)',\n\n [`.${GlobalClassNames._disabled} &`]: {\n color: 'var(--button-disabled-menuIconColor)',\n },\n },\n ],\n\n _disabled: [GlobalClassNames._disabled],\n\n _iconOnly: [\n GlobalClassNames._iconOnly,\n {\n '& > .ms-Button-icon + *': {\n marginLeft: 0,\n },\n },\n ],\n },\n\n variants: (theme: Theme): MenuButtonVariants => {\n const { palette } = theme;\n\n return {\n root: {\n menuIconSize: '12px',\n menuIconColor: 'var(--body-menuIconColor)',\n },\n\n ghost: {\n menuIconColor: palette?.neutralSecondary,\n hovered: {\n menuIconColor: palette?.themePrimary,\n },\n pressed: {\n menuIconColor: palette?.black,\n },\n },\n\n transparent: {\n menuIconColor: palette?.neutralSecondary,\n },\n };\n },\n});\n"]}
@@ -1,2 +0,0 @@
1
- import { MenuButtonState } from './MenuButton.types';
2
- export declare const useMenuButtonState: (state: MenuButtonState) => void;
@@ -1,11 +0,0 @@
1
- define(["require", "exports", "../Button/useButtonState", "./useExpanded"], function (require, exports, useButtonState_1, useExpanded_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useMenuButtonState = function (state) {
5
- // It behaves like a button.
6
- useButtonState_1.useButtonState(state);
7
- // It can be expanded.
8
- useExpanded_1.useExpanded(state);
9
- };
10
- });
11
- //# sourceMappingURL=useMenuButtonState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.ts"],"names":[],"mappings":";;;IAIa,QAAA,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEtB,sBAAsB;QACtB,yBAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC","sourcesContent":["import { MenuButtonState } from './MenuButton.types';\nimport { useButtonState } from '../Button/useButtonState';\nimport { useExpanded } from './useExpanded';\n\nexport const useMenuButtonState = (state: MenuButtonState) => {\n // It behaves like a button.\n useButtonState(state);\n\n // It can be expanded.\n useExpanded(state);\n};\n"]}
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { SplitButtonProps } from './SplitButton.types';
3
- /**
4
- * Define a styled SplitButton, using the `useSplitButton` hook.
5
- * {@docCategory Button}
6
- */
7
- export declare const SplitButton: React.ForwardRefExoticComponent<Pick<SplitButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
@@ -1,26 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-icons-mdl2", "@fluentui/react-theme-provider", "./useSplitButton", "./useSplitButtonClasses", "../Button/index", "../MenuButton/index"], function (require, exports, React, react_icons_mdl2_1, react_theme_provider_1, useSplitButton_1, useSplitButtonClasses_1, index_1, index_2) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Define a styled SplitButton, using the `useSplitButton` hook.
6
- * {@docCategory Button}
7
- */
8
- exports.SplitButton = React.forwardRef(function (props, ref) {
9
- var _a = useSplitButton_1.useSplitButton(props, ref, {
10
- button: { as: index_1.Button },
11
- menuButton: { as: index_2.MenuButton, iconOnly: true, icon: React.createElement(react_icons_mdl2_1.ChevronDownIcon, null) },
12
- }), state = _a.state, render = _a.render;
13
- useSplitButtonClasses_1.useSplitButtonClasses(state);
14
- // TODO remove any
15
- /**
16
- * Type 'SplitButtonState' has no properties in common with type '{
17
- * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
18
- * | undefined; }
19
- */
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- react_theme_provider_1.useInlineTokens(state, '--button');
22
- return render(state);
23
- });
24
- exports.SplitButton.displayName = 'SplitButton';
25
- });
26
- //# sourceMappingURL=SplitButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;IASA;;;OAGG;IACU,QAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;QAC9E,IAAA;;;UAGJ,EAHM,gBAAK,EAAE,kBAGb,CAAC;QAEH,6CAAqB,CAAC,KAAK,CAAC,CAAC;QAE7B,kBAAkB;QAClB;;;;WAIG;QACH,8DAA8D;QAC9D,sCAAe,CAAC,KAAY,EAAE,UAAU,CAAC,CAAC;QAE1C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from '@fluentui/react-icons-mdl2';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { SplitButtonProps } from './SplitButton.types';\nimport { useSplitButton } from './useSplitButton';\nimport { useSplitButtonClasses } from './useSplitButtonClasses';\nimport { Button } from '../Button/index';\nimport { MenuButton } from '../MenuButton/index';\n\n/**\n * Define a styled SplitButton, using the `useSplitButton` hook.\n * {@docCategory Button}\n */\nexport const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>((props, ref) => {\n const { state, render } = useSplitButton(props, ref, {\n button: { as: Button },\n menuButton: { as: MenuButton, iconOnly: true, icon: <ChevronDownIcon /> },\n });\n\n useSplitButtonClasses(state);\n\n // TODO remove any\n /**\n * Type 'SplitButtonState' has no properties in common with type '{\n * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }\n * | undefined; }\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useInlineTokens(state as any, '--button');\n\n return render(state);\n});\n\nSplitButton.displayName = 'SplitButton';\n"]}
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { ButtonProps, ButtonVariants } from '../Button/Button.types';
4
- import { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';
5
- /**
6
- * {@docCategory Button}
7
- */
8
- export interface SplitButtonProps extends ButtonProps, MenuButtonProps {
9
- /**
10
- * Button to perform primary action in SplitButton.
11
- */
12
- button?: ShorthandProps;
13
- /**
14
- * Divider that separates the primary action button and the menu button parts of the SplitButton
15
- */
16
- divider?: ShorthandProps;
17
- /**
18
- * Button that opens menu with secondary actions in SplitButton.
19
- */
20
- menuButton?: ShorthandProps;
21
- }
22
- export interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {
23
- menuButtonRef?: React.RefObject<HTMLButtonElement>;
24
- }
25
- /**
26
- * {@docCategory Button}
27
- */
28
- export declare type SplitButtonTokens = MenuButtonTokens & {
29
- dividerColor?: string;
30
- dividerThickness?: string;
31
- };
32
- /**
33
- * {@docCategory Button}
34
- */
35
- export declare type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=SplitButton.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps, ButtonVariants } from '../Button/Button.types';\nimport { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface SplitButtonProps extends ButtonProps, MenuButtonProps {\n /**\n * Button to perform primary action in SplitButton.\n */\n button?: ShorthandProps;\n\n /**\n * Divider that separates the primary action button and the menu button parts of the SplitButton\n */\n divider?: ShorthandProps;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: ShorthandProps;\n}\n\nexport interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {\n menuButtonRef?: React.RefObject<HTMLButtonElement>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonTokens = MenuButtonTokens & {\n dividerColor?: string;\n dividerThickness?: string;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;\n"]}
@@ -1,4 +0,0 @@
1
- export * from './SplitButton.types';
2
- export * from './SplitButton';
3
- export * from './useSplitButton';
4
- export * from './useSplitButtonClasses';
@@ -1,8 +0,0 @@
1
- define(["require", "exports", "tslib", "./SplitButton", "./useSplitButton", "./useSplitButtonClasses"], function (require, exports, tslib_1, SplitButton_1, useSplitButton_1, useSplitButtonClasses_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(SplitButton_1, exports);
5
- tslib_1.__exportStar(useSplitButton_1, exports);
6
- tslib_1.__exportStar(useSplitButtonClasses_1, exports);
7
- });
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;IACA,6CAA8B;IAC9B,gDAAiC;IACjC,uDAAwC","sourcesContent":["export * from './SplitButton.types';\nexport * from './SplitButton';\nexport * from './useSplitButton';\nexport * from './useSplitButtonClasses';\n"]}
@@ -1,7 +0,0 @@
1
- import { SplitButtonState } from './SplitButton.types';
2
- /**
3
- * Redefine the render function to add slots. Reuse the button structure but add
4
- * slots to children.
5
- * @param state
6
- */
7
- export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
@@ -1,17 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./useSplitButton"], function (require, exports, tslib_1, React, index_1, useSplitButton_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Redefine the render function to add slots. Reuse the button structure but add
6
- * slots to children.
7
- * @param state
8
- */
9
- exports.renderSplitButton = function (state) {
10
- var _a = index_1.getSlots(state, useSplitButton_1.splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
11
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
12
- React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)),
13
- React.createElement(slots.divider, tslib_1.__assign({}, slotProps.divider)),
14
- React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton))));
15
- };
16
- });
17
- //# sourceMappingURL=renderSplitButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;IAKA;;;;OAIG;IACU,QAAA,iBAAiB,GAAG,UAAC,KAAuB;QACjD,IAAA,wEAAiE,EAA/D,gBAAK,EAAE,wBAAwD,CAAC;QAExE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACtC,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;YACxC,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACnC,CACd,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonState } from './SplitButton.types';\nimport { splitButtonShorthandProps } from './useSplitButton';\n\n/**\n * Redefine the render function to add slots. Reuse the button structure but add\n * slots to children.\n * @param state\n */\nexport const renderSplitButton = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots(state, splitButtonShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button} />\n <slots.divider {...slotProps.divider} />\n <slots.menuButton {...slotProps.menuButton} />\n </slots.root>\n );\n};\n"]}
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { SplitButtonProps, SplitButtonState } from './SplitButton.types';
3
- export declare const splitButtonShorthandProps: string[];
4
- /**
5
- * Redefine the component factory, reusing button factory.
6
- */
7
- export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => {
8
- state: SplitButtonState;
9
- render: (state: SplitButtonState) => JSX.Element;
10
- };
@@ -1,50 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./renderSplitButton", "@fluentui/react-hooks"], function (require, exports, tslib_1, React, index_1, renderSplitButton_1, react_hooks_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];
5
- var mergeProps = index_1.makeMergeProps({ deepMerge: exports.splitButtonShorthandProps });
6
- /**
7
- * Redefine the component factory, reusing button factory.
8
- */
9
- exports.useSplitButton = function (props, ref, defaultProps) {
10
- var _a = index_1.resolveShorthandProps(props, exports.splitButtonShorthandProps), _b = _a.as, as = _b === void 0 ? 'span' : _b, className = _a.className, style = _a.style, primary = _a.primary, ghost = _a.ghost, disabled = _a.disabled, loading = _a.loading, circular = _a.circular, block = _a.block, menu = _a.menu, size = _a.size, transparent = _a.transparent, userProps = tslib_1.__rest(_a, ["as", "className", "style", "primary", "ghost", "disabled", "loading", "circular", "block", "menu", "size", "transparent"]);
11
- ref = react_hooks_1.useMergedRefs(ref, React.useRef(null));
12
- // A split button should be disabled when disabled or loading.
13
- var disabledOrLoading = disabled || loading;
14
- var state = mergeProps({
15
- as: 'span',
16
- className: className,
17
- style: style,
18
- disabled: disabled,
19
- block: block,
20
- primary: primary,
21
- size: size,
22
- transparent: transparent,
23
- 'aria-disabled': disabledOrLoading,
24
- button: tslib_1.__assign({ as: 'span', ref: ref,
25
- primary: primary,
26
- ghost: ghost,
27
- circular: circular, disabled: disabledOrLoading, loading: loading,
28
- size: size,
29
- transparent: transparent }, userProps),
30
- divider: { as: 'span', children: null },
31
- menuButton: {
32
- as: 'span',
33
- primary: primary,
34
- ghost: ghost,
35
- circular: circular,
36
- size: size,
37
- disabled: disabledOrLoading,
38
- loading: loading,
39
- transparent: transparent,
40
- menu: menu,
41
- children: null,
42
- },
43
- }, defaultProps);
44
- return {
45
- state: state,
46
- render: renderSplitButton_1.renderSplitButton,
47
- };
48
- };
49
- });
50
- //# sourceMappingURL=useSplitButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;IAMa,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAErF,IAAM,UAAU,GAAG,sBAAc,CAAC,EAAE,SAAS,EAAE,iCAAyB,EAAE,CAAC,CAAC;IAE5E;;OAEG;IACU,QAAA,cAAc,GAAG,UAC5B,KAAuB,EACvB,GAA2B,EAC3B,YAA+B;QAE/B,IAAM,4EAcqD,EAbzD,UAAW,EAAX,gCAAW,EACX,wBAAS,EACT,gBAAK,EACL,oBAAO,EACP,gBAAK,EACL,sBAAQ,EACR,oBAAO,EACP,sBAAQ,EACR,gBAAK,EACL,cAAI,EACJ,cAAI,EACJ,4BAAW,EACX,2JACyD,CAAC;QAE5D,GAAG,GAAG,2BAAa,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC,CAAC;QAE1D,8DAA8D;QAC9D,IAAM,iBAAiB,GAAG,QAAQ,IAAI,OAAO,CAAC;QAE9C,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,EAAE,EAAE,MAAM;YACV,SAAS,WAAA;YACT,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,KAAK,OAAA;YACL,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,WAAW,aAAA;YACX,eAAe,EAAE,iBAAiB;YAElC,MAAM,qBACJ,EAAE,EAAE,MAAM,EACV,GAAG,KAAA;gBACH,OAAO,SAAA;gBACP,KAAK,OAAA;gBACL,QAAQ,UAAA,EACR,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,SAAA;gBACP,IAAI,MAAA;gBACJ,WAAW,aAAA,IACR,SAAS,CACb;YAED,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;YAEvC,UAAU,EAAE;gBACV,EAAE,EAAE,MAAM;gBACV,OAAO,SAAA;gBACP,KAAK,OAAA;gBACL,QAAQ,UAAA;gBACR,IAAI,MAAA;gBACJ,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,SAAA;gBACP,WAAW,aAAA;gBACX,IAAI,MAAA;gBACJ,QAAQ,EAAE,IAAI;aACf;SACF,EACD,YAAY,CACO,CAAC;QAEtB,OAAO;YACL,KAAK,OAAA;YACL,MAAM,EAAE,qCAAiB;SAC1B,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonProps, SplitButtonState } from './SplitButton.types';\nimport { renderSplitButton } from './renderSplitButton';\nimport { useMergedRefs } from '@fluentui/react-hooks';\n\nexport const splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];\n\nconst mergeProps = makeMergeProps({ deepMerge: splitButtonShorthandProps });\n\n/**\n * Redefine the component factory, reusing button factory.\n */\nexport const useSplitButton = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: SplitButtonProps,\n) => {\n const {\n as = 'span',\n className,\n style,\n primary,\n ghost,\n disabled,\n loading,\n circular,\n block,\n menu,\n size,\n transparent,\n ...userProps\n } = resolveShorthandProps(props, splitButtonShorthandProps);\n\n ref = useMergedRefs(ref, React.useRef<HTMLElement>(null));\n\n // A split button should be disabled when disabled or loading.\n const disabledOrLoading = disabled || loading;\n\n const state = mergeProps(\n {\n as: 'span',\n className,\n style,\n disabled,\n block,\n primary,\n size,\n transparent,\n 'aria-disabled': disabledOrLoading,\n\n button: {\n as: 'span',\n ref,\n primary,\n ghost,\n circular,\n disabled: disabledOrLoading,\n loading,\n size,\n transparent,\n ...userProps,\n },\n\n divider: { as: 'span', children: null },\n\n menuButton: {\n as: 'span',\n primary,\n ghost,\n circular,\n size,\n disabled: disabledOrLoading,\n loading,\n transparent,\n menu,\n children: null,\n },\n },\n defaultProps,\n ) as SplitButtonState;\n\n return {\n state,\n render: renderSplitButton,\n };\n};\n"]}
@@ -1,3 +0,0 @@
1
- import { Theme } from '@fluentui/react-theme-provider';
2
- import { SplitButtonState } from './SplitButton.types';
3
- export declare const useSplitButtonClasses: (state: SplitButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
@@ -1,123 +0,0 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-theme-provider", "@fluentui/style-utilities", "../Button/index"], function (require, exports, tslib_1, react_theme_provider_1, style_utilities_1, index_1) {
2
- "use strict";
3
- var _a, _b, _c, _d;
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- var GlobalClassNames = {
6
- root: 'ms-SplitButton',
7
- button: 'ms-SplitButton-button',
8
- menuButton: 'ms-SplitButton-menuButton',
9
- };
10
- var menuButtonWidth = '32px';
11
- exports.useSplitButtonClasses = react_theme_provider_1.makeVariantClasses({
12
- name: 'SplitButton',
13
- prefix: '--button',
14
- styles: {
15
- root: [
16
- GlobalClassNames.root,
17
- {
18
- display: 'inline-flex',
19
- justifyContent: 'stretch',
20
- position: 'relative',
21
- // Forward the menuIconSize to a variable which can be consumed by the child menu button.
22
- '--button-splitMenuIconSize': 'var(--button-menuIconSize)',
23
- },
24
- ],
25
- button: [
26
- GlobalClassNames.button,
27
- {
28
- '--button-borderRightWidth': 0,
29
- '--button-borderTopRightRadius': 0,
30
- '--button-borderBottomRightRadius': 0,
31
- },
32
- ],
33
- menuButton: [
34
- GlobalClassNames.menuButton,
35
- (_a = {},
36
- // Scope the override to a child component, increase specificity.
37
- _a["." + GlobalClassNames.root + " &"] = {
38
- width: menuButtonWidth,
39
- minWidth: menuButtonWidth,
40
- '--button-borderLeftWidth': 0,
41
- '--button-borderTopLeftRadius': 0,
42
- '--button-borderBottomLeftRadius': 0,
43
- '--button-iconColor': 'var(--button-menuIconColor)',
44
- '--button-iconSize': 'var(--button-splitMenuIconSize)',
45
- },
46
- _a),
47
- ],
48
- divider: (_b = {
49
- width: 'var(--button-dividerThickness)',
50
- backgroundColor: 'var(--button-dividerColor)',
51
- position: 'absolute',
52
- right: menuButtonWidth,
53
- top: 'calc(100% - var(--button-dividerLength, 100% + 8px))',
54
- bottom: 'calc(100% - var(--button-dividerLength, 100% + 8px))'
55
- },
56
- _b[style_utilities_1.EdgeChromiumHighContrastSelector] = {
57
- backgroundColor: 'var(--button-highContrast-dividerColor)',
58
- },
59
- _b["." + GlobalClassNames.root + "[aria-disabled=\"true\"] &"] = (_c = {
60
- backgroundColor: 'var(--button-disabled-dividerColor)'
61
- },
62
- _c[style_utilities_1.EdgeChromiumHighContrastSelector] = {
63
- backgroundColor: 'var(--button-highContrast-disabled-dividerColor, var(--button-highContrast-dividerColor))',
64
- },
65
- _c),
66
- _b),
67
- _block: (_d = {
68
- width: '100%',
69
- maxWidth: '100%'
70
- },
71
- _d["." + GlobalClassNames.button] = {
72
- flexGrow: 1,
73
- maxWidth: '100%',
74
- },
75
- _d["." + GlobalClassNames.menuButton] = {
76
- width: menuButtonWidth,
77
- },
78
- _d),
79
- },
80
- variants: function (theme) {
81
- var _a;
82
- var palette = theme.palette, semanticColors = theme.semanticColors;
83
- return tslib_1.__assign({ root: {
84
- size: {
85
- smallest: '24px',
86
- smaller: '24px',
87
- small: '24px',
88
- regular: '32px',
89
- large: '40px',
90
- larger: '48px',
91
- largest: '64px',
92
- },
93
- dividerThickness: '1px',
94
- dividerColor: (_a = palette) === null || _a === void 0 ? void 0 : _a.neutralTertiaryAlt,
95
- disabled: {
96
- dividerColor: semanticColors.disabledText,
97
- },
98
- menuIconColor: 'var(--body-menuIconColor)',
99
- menuIconSize: '12px',
100
- highContrast: {
101
- dividerColor: 'WindowText',
102
- disabled: {
103
- dividerColor: 'GrayText',
104
- },
105
- },
106
- }, primary: {
107
- dividerColor: palette.white,
108
- disabled: {
109
- dividerColor: semanticColors.disabledText,
110
- },
111
- highContrast: {
112
- dividerColor: 'Window',
113
- disabled: {
114
- dividerColor: 'GrayText',
115
- },
116
- },
117
- }, transparent: {
118
- menuIconColor: palette.neutralSecondary,
119
- } }, index_1.ButtonSizeVariants);
120
- },
121
- });
122
- });
123
- //# sourceMappingURL=useSplitButtonClasses.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSplitButtonClasses.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButtonClasses.tsx"],"names":[],"mappings":";;;;IAKA,IAAM,gBAAgB,GAAG;QACvB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,uBAAuB;QAC/B,UAAU,EAAE,2BAA2B;KACxC,CAAC;IAEF,IAAM,eAAe,GAAG,MAAM,CAAC;IAElB,QAAA,qBAAqB,GAAG,yCAAkB,CAAwC;QAC7F,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,UAAU;QAElB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,gBAAgB,CAAC,IAAI;gBACrB;oBACE,OAAO,EAAE,aAAa;oBACtB,cAAc,EAAE,SAAS;oBACzB,QAAQ,EAAE,UAAU;oBAEpB,yFAAyF;oBACzF,4BAA4B,EAAE,4BAA4B;iBAC3D;aACF;YAED,MAAM,EAAE;gBACN,gBAAgB,CAAC,MAAM;gBACvB;oBACE,2BAA2B,EAAE,CAAC;oBAC9B,+BAA+B,EAAE,CAAC;oBAClC,kCAAkC,EAAE,CAAC;iBACtC;aACF;YAED,UAAU,EAAE;gBACV,gBAAgB,CAAC,UAAU;;oBAEzB,iEAAiE;oBACjE,GAAC,MAAI,gBAAgB,CAAC,IAAI,OAAI,IAAG;wBAC/B,KAAK,EAAE,eAAe;wBACtB,QAAQ,EAAE,eAAe;wBACzB,0BAA0B,EAAE,CAAC;wBAC7B,8BAA8B,EAAE,CAAC;wBACjC,iCAAiC,EAAE,CAAC;wBACpC,oBAAoB,EAAE,6BAA6B;wBACnD,mBAAmB,EAAE,iCAAiC;qBACvD;;aAEJ;YAED,OAAO;oBACL,KAAK,EAAE,gCAAgC;oBACvC,eAAe,EAAE,4BAA4B;oBAC7C,QAAQ,EAAE,UAAU;oBACpB,KAAK,EAAE,eAAe;oBACtB,GAAG,EAAE,sDAAsD;oBAC3D,MAAM,EAAE,sDAAsD;;gBAE9D,GAAC,kDAAgC,IAAG;oBAClC,eAAe,EAAE,yCAAyC;iBAC3D;gBAED,GAAC,MAAI,gBAAgB,CAAC,IAAI,+BAA0B;wBAClD,eAAe,EAAE,qCAAqC;;oBAEtD,GAAC,kDAAgC,IAAG;wBAClC,eAAe,EAAE,2FAA2F;qBAC7G;uBACF;mBACF;YAED,MAAM;oBACJ,KAAK,EAAE,MAAM;oBACb,QAAQ,EAAE,MAAM;;gBAEhB,GAAC,MAAI,gBAAgB,CAAC,MAAQ,IAAG;oBAC/B,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,MAAM;iBACjB;gBAED,GAAC,MAAI,gBAAgB,CAAC,UAAY,IAAG;oBACnC,KAAK,EAAE,eAAe;iBACvB;mBACF;SACF;QACD,QAAQ,EAAE,UAAC,KAAY;;YACb,IAAA,uBAAO,EAAE,qCAAc,CAAW;YAE1C,0BACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,QAAQ,EAAE,MAAM;wBAChB,OAAO,EAAE,MAAM;wBACf,KAAK,EAAE,MAAM;wBACb,OAAO,EAAE,MAAM;wBACf,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE,MAAM;qBAChB;oBACD,gBAAgB,EAAE,KAAK;oBACvB,YAAY,QAAE,OAAO,0CAAE,kBAAkB;oBACzC,QAAQ,EAAE;wBACR,YAAY,EAAE,cAAc,CAAC,YAAY;qBAC1C;oBACD,aAAa,EAAE,2BAA2B;oBAC1C,YAAY,EAAE,MAAM;oBAEpB,YAAY,EAAE;wBACZ,YAAY,EAAE,YAAY;wBAE1B,QAAQ,EAAE;4BACR,YAAY,EAAE,UAAU;yBACzB;qBACF;iBACF,EAED,OAAO,EAAE;oBACP,YAAY,EAAE,OAAO,CAAC,KAAK;oBAE3B,QAAQ,EAAE;wBACR,YAAY,EAAE,cAAc,CAAC,YAAY;qBAC1C;oBAED,YAAY,EAAE;wBACZ,YAAY,EAAE,QAAQ;wBAEtB,QAAQ,EAAE;4BACR,YAAY,EAAE,UAAU;yBACzB;qBACF;iBACF,EAED,WAAW,EAAE;oBACX,aAAa,EAAE,OAAO,CAAC,gBAAgB;iBACxC,IAEE,0BAAkB,EACrB;QACJ,CAAC;KACF,CAAC,CAAC","sourcesContent":["import { makeVariantClasses, Theme } from '@fluentui/react-theme-provider';\nimport { EdgeChromiumHighContrastSelector } from '@fluentui/style-utilities';\nimport { ButtonSizeVariants } from '../Button/index';\nimport { SplitButtonState, SplitButtonVariants } from './SplitButton.types';\n\nconst GlobalClassNames = {\n root: 'ms-SplitButton',\n button: 'ms-SplitButton-button',\n menuButton: 'ms-SplitButton-menuButton',\n};\n\nconst menuButtonWidth = '32px';\n\nexport const useSplitButtonClasses = makeVariantClasses<SplitButtonState, SplitButtonVariants>({\n name: 'SplitButton',\n prefix: '--button',\n\n styles: {\n root: [\n GlobalClassNames.root,\n {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n\n // Forward the menuIconSize to a variable which can be consumed by the child menu button.\n '--button-splitMenuIconSize': 'var(--button-menuIconSize)',\n },\n ],\n\n button: [\n GlobalClassNames.button,\n {\n '--button-borderRightWidth': 0,\n '--button-borderTopRightRadius': 0,\n '--button-borderBottomRightRadius': 0,\n },\n ],\n\n menuButton: [\n GlobalClassNames.menuButton,\n {\n // Scope the override to a child component, increase specificity.\n [`.${GlobalClassNames.root} &`]: {\n width: menuButtonWidth,\n minWidth: menuButtonWidth,\n '--button-borderLeftWidth': 0,\n '--button-borderTopLeftRadius': 0,\n '--button-borderBottomLeftRadius': 0,\n '--button-iconColor': 'var(--button-menuIconColor)',\n '--button-iconSize': 'var(--button-splitMenuIconSize)',\n },\n },\n ],\n\n divider: {\n width: 'var(--button-dividerThickness)',\n backgroundColor: 'var(--button-dividerColor)',\n position: 'absolute',\n right: menuButtonWidth,\n top: 'calc(100% - var(--button-dividerLength, 100% + 8px))',\n bottom: 'calc(100% - var(--button-dividerLength, 100% + 8px))',\n\n [EdgeChromiumHighContrastSelector]: {\n backgroundColor: 'var(--button-highContrast-dividerColor)',\n },\n\n [`.${GlobalClassNames.root}[aria-disabled=\"true\"] &`]: {\n backgroundColor: 'var(--button-disabled-dividerColor)',\n\n [EdgeChromiumHighContrastSelector]: {\n backgroundColor: 'var(--button-highContrast-disabled-dividerColor, var(--button-highContrast-dividerColor))',\n },\n },\n },\n\n _block: {\n width: '100%',\n maxWidth: '100%',\n\n [`.${GlobalClassNames.button}`]: {\n flexGrow: 1,\n maxWidth: '100%',\n },\n\n [`.${GlobalClassNames.menuButton}`]: {\n width: menuButtonWidth,\n },\n },\n },\n variants: (theme: Theme): SplitButtonVariants => {\n const { palette, semanticColors } = theme;\n\n return {\n root: {\n size: {\n smallest: '24px',\n smaller: '24px',\n small: '24px',\n regular: '32px',\n large: '40px',\n larger: '48px',\n largest: '64px',\n },\n dividerThickness: '1px',\n dividerColor: palette?.neutralTertiaryAlt,\n disabled: {\n dividerColor: semanticColors.disabledText,\n },\n menuIconColor: 'var(--body-menuIconColor)',\n menuIconSize: '12px',\n\n highContrast: {\n dividerColor: 'WindowText',\n\n disabled: {\n dividerColor: 'GrayText',\n },\n },\n },\n\n primary: {\n dividerColor: palette.white,\n\n disabled: {\n dividerColor: semanticColors.disabledText,\n },\n\n highContrast: {\n dividerColor: 'Window',\n\n disabled: {\n dividerColor: 'GrayText',\n },\n },\n },\n\n transparent: {\n menuIconColor: palette.neutralSecondary,\n },\n\n ...ButtonSizeVariants,\n };\n },\n});\n"]}
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { ToggleButtonProps } from './ToggleButton.types';
3
- /**
4
- * Define a styled ToggleButton, using the `useToggleButton` hook.
5
- * {@docCategory Button}
6
- */
7
- export declare const ToggleButton: React.ForwardRefExoticComponent<Pick<ToggleButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
@@ -1,17 +0,0 @@
1
- define(["require", "exports", "react", "./useToggleButton", "@fluentui/react-theme-provider", "../Button/useButtonClasses", "./useToggleButtonClasses"], function (require, exports, React, useToggleButton_1, react_theme_provider_1, useButtonClasses_1, useToggleButtonClasses_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Define a styled ToggleButton, using the `useToggleButton` hook.
6
- * {@docCategory Button}
7
- */
8
- exports.ToggleButton = React.forwardRef(function (props, ref) {
9
- var _a = useToggleButton_1.useToggleButton(props, ref), render = _a.render, state = _a.state;
10
- useButtonClasses_1.useButtonClasses(state);
11
- useToggleButtonClasses_1.useToggleButtonClasses(state);
12
- react_theme_provider_1.useInlineTokens(state, '--button');
13
- return render(state);
14
- });
15
- exports.ToggleButton.displayName = 'ToggleButton';
16
- });
17
- //# sourceMappingURL=ToggleButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToggleButton.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;IAOA;;;OAGG;IACU,QAAA,YAAY,GAAG,KAAK,CAAC,UAAU,CAAiC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAA,kDAA+C,EAA7C,kBAAM,EAAE,gBAAqC,CAAC;QAEtD,mCAAgB,CAAC,KAAK,CAAC,CAAC;QACxB,+CAAsB,CAAC,KAAK,CAAC,CAAC;QAC9B,sCAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { ToggleButtonProps } from './ToggleButton.types';\nimport { useToggleButton } from './useToggleButton';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useButtonClasses } from '../Button/useButtonClasses';\nimport { useToggleButtonClasses } from './useToggleButtonClasses';\n\n/**\n * Define a styled ToggleButton, using the `useToggleButton` hook.\n * {@docCategory Button}\n */\nexport const ToggleButton = React.forwardRef<HTMLElement, ToggleButtonProps>((props, ref) => {\n const { render, state } = useToggleButton(props, ref);\n\n useButtonClasses(state);\n useToggleButtonClasses(state);\n useInlineTokens(state, '--button');\n\n return render(state);\n});\n\nToggleButton.displayName = 'ToggleButton';\n"]}
@@ -1,25 +0,0 @@
1
- import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';
2
- /**
3
- * {@docCategory Button}
4
- */
5
- export interface ToggleButtonProps extends ButtonProps {
6
- /**
7
- * Defines the controlled checked state of the `ToggleButton`.
8
- * Mutually exclusive to `defaultChecked`.
9
- * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
10
- * correct value based on handling `onClick` events and re-rendering.
11
- */
12
- checked?: boolean;
13
- /**
14
- * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.
15
- * Mutually exclusive to `checked`.
16
- */
17
- defaultChecked?: boolean;
18
- }
19
- /**
20
- * {@docCategory Button}
21
- */
22
- export interface ToggleButtonState extends ToggleButtonProps {
23
- }
24
- export declare type ToggleButtonTokens = ButtonTokens;
25
- export declare type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=ToggleButton.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToggleButton.types.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonProps extends ButtonProps {\n /**\n * Defines the controlled checked state of the `ToggleButton`.\n * Mutually exclusive to `defaultChecked`.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onClick` events and re-rendering.\n */\n checked?: boolean;\n\n /**\n * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.\n * Mutually exclusive to `checked`.\n */\n defaultChecked?: boolean;\n}\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonState extends ToggleButtonProps {}\n\nexport type ToggleButtonTokens = ButtonTokens;\n\nexport type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;\n"]}
@@ -1,5 +0,0 @@
1
- export * from './ToggleButton.types';
2
- export * from './useToggleButton';
3
- export * from './useToggleButtonClasses';
4
- export * from './ToggleButton';
5
- export * from './useChecked';
@@ -1,9 +0,0 @@
1
- define(["require", "exports", "tslib", "./useToggleButton", "./useToggleButtonClasses", "./ToggleButton", "./useChecked"], function (require, exports, tslib_1, useToggleButton_1, useToggleButtonClasses_1, ToggleButton_1, useChecked_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(useToggleButton_1, exports);
5
- tslib_1.__exportStar(useToggleButtonClasses_1, exports);
6
- tslib_1.__exportStar(ToggleButton_1, exports);
7
- tslib_1.__exportStar(useChecked_1, exports);
8
- });
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ToggleButton/index.ts"],"names":[],"mappings":";;;IACA,iDAAkC;IAClC,wDAAyC;IACzC,8CAA+B;IAC/B,4CAA6B","sourcesContent":["export * from './ToggleButton.types';\nexport * from './useToggleButton';\nexport * from './useToggleButtonClasses';\nexport * from './ToggleButton';\nexport * from './useChecked';\n"]}
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- export interface CheckedState {
3
- checked?: boolean;
4
- defaultChecked?: boolean;
5
- onClick?: React.DOMAttributes<HTMLElement>['onClick'];
6
- role?: string;
7
- 'aria-checked'?: React.AriaAttributes['aria-pressed'];
8
- 'aria-pressed'?: React.AriaAttributes['aria-pressed'];
9
- }
10
- /**
11
- * The useToggle hook processes adds the correct toggled state and acccessibility as needed.
12
- * @param draftState - state to read and augment.
13
- */
14
- export declare const useChecked: <TDraftState extends CheckedState>(draftState: TDraftState) => void;
@@ -1,27 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-hooks"], function (require, exports, React, react_hooks_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * The useToggle hook processes adds the correct toggled state and acccessibility as needed.
6
- * @param draftState - state to read and augment.
7
- */
8
- exports.useChecked = function (draftState) {
9
- var onClick = draftState.onClick, checked = draftState.checked, defaultChecked = draftState.defaultChecked, role = draftState.role;
10
- var _a = react_hooks_1.useControllableValue(checked, defaultChecked), checkedValue = _a[0], setCheckedValue = _a[1];
11
- // Ensure the state is the correct controlled/uncontrolled value.
12
- draftState.checked = checkedValue;
13
- // Ensure the right aria value is set to represent the checked state.
14
- var isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
15
- draftState[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = checkedValue;
16
- draftState.onClick = React.useCallback(function (ev) {
17
- if (onClick) {
18
- onClick(ev);
19
- if (ev.defaultPrevented) {
20
- return;
21
- }
22
- }
23
- setCheckedValue(!checkedValue);
24
- }, [checkedValue, setCheckedValue, onClick]);
25
- };
26
- });
27
- //# sourceMappingURL=useChecked.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChecked.js","sourceRoot":"../src/","sources":["components/ToggleButton/useChecked.ts"],"names":[],"mappings":";;;IAaA;;;OAGG;IACU,QAAA,UAAU,GAAG,UAAmC,UAAuB;QAC1E,IAAA,4BAAO,EAAE,4BAAO,EAAE,0CAAc,EAAE,sBAAI,CAAgB;QACxD,IAAA,gEAA+E,EAA9E,oBAAY,EAAE,uBAAgE,CAAC;QAEtF,iEAAiE;QACjE,UAAU,CAAC,OAAO,GAAG,YAAY,CAAC;QAElC,qEAAqE;QACrE,IAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAkB,IAAI,IAAI,KAAK,UAAU,CAAC;QAE9E,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;QAEhF,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CACpC,UAAC,EAAmD;YAClD,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,EAAE,CAAC,CAAC;gBAEZ,IAAI,EAAE,CAAC,gBAAgB,EAAE;oBACvB,OAAO;iBACR;aACF;YAED,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,YAAY,EAAE,eAAe,EAAE,OAAO,CAAC,CACzC,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { useControllableValue } from '@fluentui/react-hooks';\n\nexport interface CheckedState {\n checked?: boolean;\n defaultChecked?: boolean;\n onClick?: React.DOMAttributes<HTMLElement>['onClick'];\n\n role?: string;\n 'aria-checked'?: React.AriaAttributes['aria-pressed'];\n 'aria-pressed'?: React.AriaAttributes['aria-pressed'];\n}\n\n/**\n * The useToggle hook processes adds the correct toggled state and acccessibility as needed.\n * @param draftState - state to read and augment.\n */\nexport const useChecked = <TDraftState extends CheckedState>(draftState: TDraftState) => {\n const { onClick, checked, defaultChecked, role } = draftState;\n const [checkedValue, setCheckedValue] = useControllableValue(checked, defaultChecked);\n\n // Ensure the state is the correct controlled/uncontrolled value.\n draftState.checked = checkedValue;\n\n // Ensure the right aria value is set to represent the checked state.\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n draftState[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = checkedValue;\n\n draftState.onClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (onClick) {\n onClick(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n setCheckedValue(!checkedValue);\n },\n [checkedValue, setCheckedValue, onClick],\n );\n};\n"]}