@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,19 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./useCompoundButton"], function (require, exports, tslib_1, React, index_1, useCompoundButton_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Define the render function. Given the state of a button, renders it.
6
- */
7
- exports.renderCompoundButton = function (state) {
8
- var _a = index_1.getSlots(state, useCompoundButton_1.compoundButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
9
- var loading = state.loading, iconPosition = state.iconPosition, iconOnly = state.iconOnly;
10
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
- loading && React.createElement(slots.loader, tslib_1.__assign({}, slotProps.loader)),
12
- iconPosition !== 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
13
- !iconOnly && (React.createElement(slots.contentContainer, tslib_1.__assign({}, slotProps.contentContainer),
14
- React.createElement(slots.content, tslib_1.__assign({}, slotProps.content)),
15
- React.createElement(slots.secondaryContent, tslib_1.__assign({}, slotProps.secondaryContent)))),
16
- iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon))));
17
- };
18
- });
19
- //# sourceMappingURL=renderCompoundButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;IAKA;;OAEG;IACU,QAAA,oBAAoB,GAAG,UAAC,KAA0B;QACvD,IAAA,8EAAoE,EAAlE,gBAAK,EAAE,wBAA2D,CAAC;QACnE,IAAA,uBAAO,EAAE,iCAAY,EAAE,yBAAQ,CAAW;QAElD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,OAAO,IAAI,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACjD,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC9D,CAAC,QAAQ,IAAI,CACZ,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB;gBACpD,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;gBACxC,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI,CACnC,CAC1B;YACA,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { CompoundButtonState } from './CompoundButton.types';\nimport { compoundButtonShorthandProps } from './useCompoundButton';\n\n/**\n * Define the render function. Given the state of a button, renders it.\n */\nexport const renderCompoundButton = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlots(state, compoundButtonShorthandProps);\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 && (\n <slots.contentContainer {...slotProps.contentContainer}>\n <slots.content {...slotProps.content} />\n <slots.secondaryContent {...slotProps.secondaryContent} />\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- import { CompoundButtonProps } from './CompoundButton.types';
3
- /**
4
- * Consts listing which props are shorthand props.
5
- */
6
- export declare const compoundButtonShorthandProps: string[];
7
- /**
8
- * Given user props, returns state and render function for a Button.
9
- */
10
- export declare const useCompoundButton: (props: CompoundButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: CompoundButtonProps | undefined) => {
11
- state: Record<string, any>;
12
- render: (state: import("./CompoundButton.types").CompoundButtonState) => JSX.Element;
13
- };
@@ -1,32 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-compose/lib/next/index", "../Button/useButtonState", "./renderCompoundButton"], function (require, exports, React, index_1, useButtonState_1, renderCompoundButton_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Consts listing which props are shorthand props.
6
- */
7
- exports.compoundButtonShorthandProps = ['icon', 'loader', 'content', 'contentContainer', 'secondaryContent'];
8
- var mergeProps = index_1.makeMergeProps({
9
- deepMerge: exports.compoundButtonShorthandProps,
10
- });
11
- /**
12
- * Given user props, returns state and render function for a Button.
13
- */
14
- exports.useCompoundButton = function (props, ref, defaultProps) {
15
- // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.
16
- // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.
17
- // eslint-disable-next-line react-hooks/rules-of-hooks
18
- var resolvedRef = ref || React.useRef();
19
- var state = mergeProps({
20
- ref: resolvedRef,
21
- as: 'button',
22
- icon: { as: 'span' },
23
- content: { as: 'span', children: props.children },
24
- contentContainer: { as: 'span', children: null },
25
- secondaryContent: { as: 'span' },
26
- loader: { as: 'span' },
27
- }, defaultProps, index_1.resolveShorthandProps(props, exports.compoundButtonShorthandProps));
28
- useButtonState_1.useButtonState(state);
29
- return { state: state, render: renderCompoundButton_1.renderCompoundButton };
30
- };
31
- });
32
- //# sourceMappingURL=useCompoundButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;IAMA;;OAEG;IACU,QAAA,4BAA4B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAElH,IAAM,UAAU,GAAG,sBAAc,CAAC;QAChC,SAAS,EAAE,oCAA4B;KACxC,CAAC,CAAC;IAEH;;OAEG;IACU,QAAA,iBAAiB,GAAG,UAC/B,KAA0B,EAC1B,GAA2B,EAC3B,YAAkC;QAElC,oGAAoG;QACpG,4FAA4F;QAC5F,sDAAsD;QACtD,IAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QAC1C,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,EAAE,WAAW;YAChB,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;YACjD,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChD,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YAChC,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;SACvB,EACD,YAAY,EACZ,6BAAqB,CAAC,KAAK,EAAE,oCAA4B,CAAC,CAC3D,CAAC;QAEF,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEtB,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,EAAE,2CAAoB,EAAE,CAAC;IACjD,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { CompoundButtonProps } from './CompoundButton.types';\nimport { useButtonState } from '../Button/useButtonState';\nimport { renderCompoundButton } from './renderCompoundButton';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const compoundButtonShorthandProps = ['icon', 'loader', 'content', 'contentContainer', 'secondaryContent'];\n\nconst mergeProps = makeMergeProps({\n deepMerge: compoundButtonShorthandProps,\n});\n\n/**\n * Given user props, returns state and render function for a Button.\n */\nexport const useCompoundButton = (\n props: CompoundButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CompoundButtonProps,\n) => {\n // Ensure that the `ref` prop can be used by other things (like useFocusRects) to refer to the root.\n // NOTE: We are assuming refs should not mutate to undefined. Either they are passed or not.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const resolvedRef = ref || React.useRef();\n const state = mergeProps(\n {\n ref: resolvedRef,\n as: 'button',\n icon: { as: 'span' },\n content: { as: 'span', children: props.children },\n contentContainer: { as: 'span', children: null },\n secondaryContent: { as: 'span' },\n loader: { as: 'span' },\n },\n defaultProps,\n resolveShorthandProps(props, compoundButtonShorthandProps),\n );\n\n useButtonState(state);\n\n return { state, render: renderCompoundButton };\n};\n"]}
@@ -1,4 +0,0 @@
1
- import { Theme } from '@fluentui/react-theme-provider';
2
- import { CompoundButtonState } from './CompoundButton.types';
3
- export declare const useClasses: (state: CompoundButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
4
- export declare const useCompoundButtonClasses: (state: CompoundButtonState) => void;
@@ -1,182 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-theme-provider", "../Button/useButtonClasses"], function (require, exports, react_theme_provider_1, useButtonClasses_1) {
2
- "use strict";
3
- var _a;
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- var GlobalClassNames = {
6
- root: 'ms-CompoundButton',
7
- contentContainer: 'ms-CompoundButton-contentContainer',
8
- secondaryContent: 'ms-CompoundButton-secondaryContent',
9
- };
10
- exports.useClasses = react_theme_provider_1.makeVariantClasses({
11
- name: 'CompoundButton',
12
- prefix: '--button',
13
- styles: {
14
- root: [
15
- GlobalClassNames.root,
16
- {
17
- alignItems: 'flex-start',
18
- },
19
- ],
20
- contentContainer: [
21
- GlobalClassNames.contentContainer,
22
- {
23
- display: 'flex',
24
- flexDirection: 'column',
25
- textAlign: 'left',
26
- },
27
- ],
28
- secondaryContent: [
29
- GlobalClassNames.secondaryContent,
30
- (_a = {
31
- color: 'var(--button-secondaryContentColor, var(--button-contentColor))',
32
- fontSize: 'var(--button-secondaryContentFontSize)',
33
- fontWeight: 'var(--button-secondaryContentFontWeight)',
34
- lineHeight: '100%',
35
- marginTop: 'var(--button-secondaryContentGap)',
36
- '@media (forced-colors: active)': {
37
- color: 'var(--button-highContrast-secondaryContentColor)',
38
- }
39
- },
40
- _a["." + GlobalClassNames.root + ":hover &"] = {
41
- color: 'var(--button-hovered-secondaryContentColor, var(--button-secondaryContentColor))',
42
- '@media (forced-colors: active)': {
43
- color: 'var(--button-highContrast-hovered-secondaryContentColor, ' +
44
- 'var(--button-highContrast-secondaryContentColor))',
45
- },
46
- },
47
- _a["." + GlobalClassNames.root + ":active &"] = {
48
- color: 'var(--button-pressed-secondaryContentColor, ' +
49
- 'var(--button-hovered-secondaryContentColor, ' +
50
- 'var(--button-secondaryContentColor)))',
51
- '@media (forced-colors: active)': {
52
- color: 'var(--button-highContrast-pressed-secondaryContentColor, ' +
53
- 'var(--button-highContrast-hovered-secondaryContentColor, ' +
54
- 'var(--button-highContrast-secondaryContentColor)))',
55
- },
56
- },
57
- _a["." + GlobalClassNames.root + "[aria-disabled=\"true\"] &"] = {
58
- color: 'var(--button-disabled-secondaryContentColor, var(--button-disabled-contentColor))',
59
- '@media (forced-colors: active)': {
60
- color: 'var(--button-highContrast-disabled-secondaryContentColor, ' +
61
- 'var(--button-highContrast-secondaryContentColor))',
62
- },
63
- },
64
- _a),
65
- ],
66
- },
67
- variants: function (theme) {
68
- var _a, _b;
69
- var fonts = theme.fonts, palette = theme.palette, semanticColors = theme.semanticColors;
70
- return {
71
- root: {
72
- height: 'auto',
73
- maxWidth: '280px',
74
- minWidth: '72px',
75
- paddingBottom: '16px',
76
- paddingLeft: '12px',
77
- paddingRight: '12px',
78
- paddingTop: '16px',
79
- iconSize: '28px',
80
- secondaryContentColor: palette.neutralSecondary,
81
- secondaryContentGap: '4px',
82
- secondaryContentFontSize: (_a = fonts) === null || _a === void 0 ? void 0 : _a.small.fontSize,
83
- secondaryContentFontWeight: 'normal',
84
- hovered: {
85
- secondaryContentColor: palette.neutralDark,
86
- },
87
- pressed: {
88
- secondaryContentColor: semanticColors.buttonTextPressed,
89
- },
90
- disabled: {
91
- secondaryContentColor: semanticColors.buttonTextDisabled,
92
- },
93
- highContrast: {
94
- secondaryContentColor: 'WindowText',
95
- hovered: {
96
- secondaryContentColor: 'Highlight',
97
- },
98
- pressed: {
99
- secondaryContentColor: 'WindowText',
100
- },
101
- disabled: {
102
- secondaryContentColor: 'GrayText',
103
- },
104
- },
105
- },
106
- block: {
107
- maxWidth: '100%',
108
- },
109
- iconOnly: {
110
- minHeight: 'var(--button-size-regular)',
111
- width: 'var(--button-minHeight)',
112
- minWidth: '0',
113
- paddingBottom: '0',
114
- paddingTop: '0',
115
- paddingLeft: '0',
116
- paddingRight: '0',
117
- },
118
- primary: {
119
- secondaryContentColor: 'var(--color-brand-secondaryContentColor)',
120
- focused: {
121
- secondaryContentColor: 'var(--color-brand-focused-secondaryContentColor)',
122
- },
123
- hovered: {
124
- secondaryContentColor: 'var(--color-brand-hovered-secondaryContentColor)',
125
- },
126
- pressed: {
127
- secondaryContentColor: 'var(--color-brand-pressed-secondaryContentColor)',
128
- },
129
- highContrast: {
130
- secondaryContentColor: 'Window',
131
- hovered: {
132
- secondaryContentColor: 'Window',
133
- },
134
- pressed: {
135
- secondaryContentColor: 'Window',
136
- },
137
- disabled: {
138
- secondaryContentColor: 'GrayText',
139
- },
140
- },
141
- },
142
- ghost: {
143
- secondaryContentColor: palette.neutralSecondary,
144
- disabled: {
145
- secondaryContentColor: palette.neutralTertiary,
146
- },
147
- focused: {
148
- secondaryContentColor: palette.neutralSecondary,
149
- },
150
- hovered: {
151
- secondaryContentColor: palette.neutralDark,
152
- },
153
- pressed: {
154
- secondaryContentColor: palette.black,
155
- },
156
- highContrast: {
157
- secondaryContentColor: 'WindowText',
158
- hovered: {
159
- secondaryContentColor: 'Highlight',
160
- },
161
- pressed: {
162
- secondaryContentColor: 'Highlight',
163
- },
164
- disabled: {
165
- secondaryContentColor: 'GrayText',
166
- },
167
- },
168
- },
169
- transparent: {
170
- hovered: {
171
- secondaryContentColor: (_b = palette) === null || _b === void 0 ? void 0 : _b.themePrimary,
172
- },
173
- },
174
- };
175
- },
176
- });
177
- exports.useCompoundButtonClasses = function (state) {
178
- useButtonClasses_1.useButtonClasses(state);
179
- exports.useClasses(state);
180
- };
181
- });
182
- //# sourceMappingURL=useCompoundButtonClasses.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCompoundButtonClasses.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButtonClasses.ts"],"names":[],"mappings":"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","sourcesContent":["import { makeVariantClasses, Theme } from '@fluentui/react-theme-provider';\nimport { CompoundButtonState, CompoundButtonVariants } from './CompoundButton.types';\nimport { useButtonClasses } from '../Button/useButtonClasses';\n\nconst GlobalClassNames = {\n root: 'ms-CompoundButton',\n contentContainer: 'ms-CompoundButton-contentContainer',\n secondaryContent: 'ms-CompoundButton-secondaryContent',\n};\n\nexport const useClasses = makeVariantClasses<CompoundButtonState, CompoundButtonVariants>({\n name: 'CompoundButton',\n prefix: '--button',\n styles: {\n root: [\n GlobalClassNames.root,\n {\n alignItems: 'flex-start',\n },\n ],\n\n contentContainer: [\n GlobalClassNames.contentContainer,\n {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n ],\n\n secondaryContent: [\n GlobalClassNames.secondaryContent,\n {\n color: 'var(--button-secondaryContentColor, var(--button-contentColor))',\n fontSize: 'var(--button-secondaryContentFontSize)',\n fontWeight: 'var(--button-secondaryContentFontWeight)',\n lineHeight: '100%',\n marginTop: 'var(--button-secondaryContentGap)',\n\n '@media (forced-colors: active)': {\n color: 'var(--button-highContrast-secondaryContentColor)',\n },\n\n [`.${GlobalClassNames.root}:hover &`]: {\n color: 'var(--button-hovered-secondaryContentColor, var(--button-secondaryContentColor))',\n\n '@media (forced-colors: active)': {\n color:\n 'var(--button-highContrast-hovered-secondaryContentColor, ' +\n 'var(--button-highContrast-secondaryContentColor))',\n },\n },\n\n [`.${GlobalClassNames.root}:active &`]: {\n color:\n 'var(--button-pressed-secondaryContentColor, ' +\n 'var(--button-hovered-secondaryContentColor, ' +\n 'var(--button-secondaryContentColor)))',\n\n '@media (forced-colors: active)': {\n color:\n 'var(--button-highContrast-pressed-secondaryContentColor, ' +\n 'var(--button-highContrast-hovered-secondaryContentColor, ' +\n 'var(--button-highContrast-secondaryContentColor)))',\n },\n },\n\n [`.${GlobalClassNames.root}[aria-disabled=\"true\"] &`]: {\n color: 'var(--button-disabled-secondaryContentColor, var(--button-disabled-contentColor))',\n\n '@media (forced-colors: active)': {\n color:\n 'var(--button-highContrast-disabled-secondaryContentColor, ' +\n 'var(--button-highContrast-secondaryContentColor))',\n },\n },\n },\n ],\n },\n\n variants: (theme: Theme): CompoundButtonVariants => {\n const { fonts, palette, semanticColors } = theme;\n\n return {\n root: {\n height: 'auto',\n maxWidth: '280px',\n minWidth: '72px',\n paddingBottom: '16px',\n paddingLeft: '12px',\n paddingRight: '12px',\n paddingTop: '16px',\n iconSize: '28px',\n secondaryContentColor: palette.neutralSecondary,\n secondaryContentGap: '4px',\n secondaryContentFontSize: fonts?.small.fontSize as string,\n secondaryContentFontWeight: 'normal',\n\n hovered: {\n secondaryContentColor: palette.neutralDark,\n },\n\n pressed: {\n secondaryContentColor: semanticColors.buttonTextPressed,\n },\n\n disabled: {\n secondaryContentColor: semanticColors.buttonTextDisabled,\n },\n\n highContrast: {\n secondaryContentColor: 'WindowText',\n hovered: {\n secondaryContentColor: 'Highlight',\n },\n pressed: {\n secondaryContentColor: 'WindowText',\n },\n disabled: {\n secondaryContentColor: 'GrayText',\n },\n },\n },\n\n block: {\n maxWidth: '100%',\n },\n\n iconOnly: {\n minHeight: 'var(--button-size-regular)',\n width: 'var(--button-minHeight)',\n minWidth: '0',\n paddingBottom: '0',\n paddingTop: '0',\n paddingLeft: '0',\n paddingRight: '0',\n },\n\n primary: {\n secondaryContentColor: 'var(--color-brand-secondaryContentColor)',\n\n focused: {\n secondaryContentColor: 'var(--color-brand-focused-secondaryContentColor)',\n },\n\n hovered: {\n secondaryContentColor: 'var(--color-brand-hovered-secondaryContentColor)',\n },\n\n pressed: {\n secondaryContentColor: 'var(--color-brand-pressed-secondaryContentColor)',\n },\n\n highContrast: {\n secondaryContentColor: 'Window',\n hovered: {\n secondaryContentColor: 'Window',\n },\n pressed: {\n secondaryContentColor: 'Window',\n },\n disabled: {\n secondaryContentColor: 'GrayText',\n },\n },\n },\n\n ghost: {\n secondaryContentColor: palette.neutralSecondary,\n disabled: {\n secondaryContentColor: palette.neutralTertiary,\n },\n focused: {\n secondaryContentColor: palette.neutralSecondary,\n },\n hovered: {\n secondaryContentColor: palette.neutralDark,\n },\n pressed: {\n secondaryContentColor: palette.black,\n },\n\n highContrast: {\n secondaryContentColor: 'WindowText',\n hovered: {\n secondaryContentColor: 'Highlight',\n },\n pressed: {\n secondaryContentColor: 'Highlight',\n },\n disabled: {\n secondaryContentColor: 'GrayText',\n },\n },\n },\n\n transparent: {\n hovered: {\n secondaryContentColor: palette?.themePrimary,\n },\n },\n };\n },\n});\n\nexport const useCompoundButtonClasses = (state: CompoundButtonState) => {\n useButtonClasses(state);\n useClasses(state);\n};\n"]}
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { MenuButtonProps } from './MenuButton.types';
3
- /**
4
- * Define a styled MenuButton, using the `useMenuButton` hook.
5
- * {@docCategory Button}
6
- */
7
- export declare const MenuButton: React.ForwardRefExoticComponent<Pick<MenuButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
@@ -1,26 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-icons-mdl2", "@fluentui/react-theme-provider", "./useMenuButton", "../Button/index", "./useMenuButtonClasses"], function (require, exports, React, react_icons_mdl2_1, react_theme_provider_1, useMenuButton_1, index_1, useMenuButtonClasses_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /**
5
- * Define a styled MenuButton, using the `useMenuButton` hook.
6
- * {@docCategory Button}
7
- */
8
- exports.MenuButton = React.forwardRef(function (props, ref) {
9
- var _a = useMenuButton_1.useMenuButton(props, ref, {
10
- menuIcon: { as: react_icons_mdl2_1.ChevronDownIcon },
11
- }), state = _a.state, render = _a.render;
12
- index_1.useButtonClasses(state);
13
- useMenuButtonClasses_1.useMenuButtonClasses(state);
14
- // TODO remove any
15
- /**
16
- * Type 'MenuButtonState' 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.MenuButton.displayName = 'MenuButton';
25
- });
26
- //# sourceMappingURL=MenuButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";;;IAQA;;;OAGG;IACU,QAAA,UAAU,GAAG,KAAK,CAAC,UAAU,CAA+B,UAAC,KAAK,EAAE,GAAG;QAC5E,IAAA;;UAEJ,EAFM,gBAAK,EAAE,kBAEb,CAAC;QAEH,wBAAgB,CAAC,KAAK,CAAC,CAAC;QACxB,2CAAoB,CAAC,KAAK,CAAC,CAAC;QAE5B,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,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from '@fluentui/react-icons-mdl2';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useMenuButton } from './useMenuButton';\nimport { MenuButtonProps } from './MenuButton.types';\nimport { useButtonClasses } from '../Button/index';\nimport { useMenuButtonClasses } from './useMenuButtonClasses';\n\n/**\n * Define a styled MenuButton, using the `useMenuButton` hook.\n * {@docCategory Button}\n */\nexport const MenuButton = React.forwardRef<HTMLElement, MenuButtonProps>((props, ref) => {\n const { state, render } = useMenuButton(props, ref, {\n menuIcon: { as: ChevronDownIcon },\n });\n\n useButtonClasses(state);\n useMenuButtonClasses(state);\n\n // TODO remove any\n /**\n * Type 'MenuButtonState' has no properties in common with type '{\n * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }\n * | undefined; }\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useInlineTokens(state as any, '--button');\n\n return render(state);\n});\n\nMenuButton.displayName = 'MenuButton';\n"]}
@@ -1,54 +0,0 @@
1
- import * as React from 'react';
2
- import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
3
- import { ButtonProps, ButtonState, ButtonTokens, ButtonVariants } from '../Button/Button.types';
4
- /**
5
- * {@docCategory Button}
6
- */
7
- export declare type MinimalMenuProps = {
8
- hidden?: boolean;
9
- onDismiss?: () => void;
10
- target?: React.Ref<HTMLElement | undefined>;
11
- };
12
- /**
13
- * {@docCategory Button}
14
- */
15
- export declare type MenuButtonProps = Omit<ButtonProps, 'iconPosition' | 'loader'> & {
16
- /**
17
- * Menu that is displayed when the button is pressed.
18
- */
19
- menu?: ShorthandProps;
20
- /**
21
- * Menu icon that indicates that this button has a menu that can be expanded.
22
- */
23
- menuIcon?: ShorthandProps;
24
- /**
25
- * Defines the inital expanded state of the MenuButton. Use this if you want the MenuButton to maintain its own state.
26
- * Mutually exclusive with `expanded`.
27
- * @defaultvalue false
28
- */
29
- defaultExpanded?: boolean;
30
- /**
31
- * Defines whether the MenuButton is in an expanded state. Use this if you wish to have the expanded state of the
32
- * MenuButton be controlled. Mutually exclusive with `defaultExpanded`.
33
- * @defaultvalue defaultExpanded
34
- */
35
- expanded?: boolean;
36
- /**
37
- * Defines a callback that runs after the MenuButton's contextual menu has been dismissed.
38
- */
39
- onMenuDismiss?: () => void;
40
- };
41
- export interface MenuButtonState extends Omit<MenuButtonProps, 'menu'>, Omit<ButtonState, 'iconPosition' | 'loader'> {
42
- menu?: React.PropsWithChildren<MinimalMenuProps>;
43
- }
44
- /**
45
- * {@docCategory Button}
46
- */
47
- export declare type MenuButtonTokens = ButtonTokens & {
48
- menuIconColor?: string;
49
- menuIconSize?: string;
50
- };
51
- /**
52
- * {@docCategory Button}
53
- */
54
- export declare type MenuButtonVariants = ButtonVariants<MenuButtonTokens>;
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=MenuButton.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuButton.types.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps, ButtonState, ButtonTokens, ButtonVariants } from '../Button/Button.types';\n\n/**\n * {@docCategory Button}\n */\nexport type MinimalMenuProps = {\n hidden?: boolean;\n onDismiss?: () => void;\n target?: React.Ref<HTMLElement | undefined>;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonProps = Omit<ButtonProps, 'iconPosition' | 'loader'> & {\n /**\n * Menu that is displayed when the button is pressed.\n */\n menu?: ShorthandProps;\n\n /**\n * Menu icon that indicates that this button has a menu that can be expanded.\n */\n menuIcon?: ShorthandProps;\n\n /**\n * Defines the inital expanded state of the MenuButton. Use this if you want the MenuButton to maintain its own state.\n * Mutually exclusive with `expanded`.\n * @defaultvalue false\n */\n defaultExpanded?: boolean;\n\n /**\n * Defines whether the MenuButton is in an expanded state. Use this if you wish to have the expanded state of the\n * MenuButton be controlled. Mutually exclusive with `defaultExpanded`.\n * @defaultvalue defaultExpanded\n */\n expanded?: boolean;\n\n /**\n * Defines a callback that runs after the MenuButton's contextual menu has been dismissed.\n */\n onMenuDismiss?: () => void;\n};\n\nexport interface MenuButtonState extends Omit<MenuButtonProps, 'menu'>, Omit<ButtonState, 'iconPosition' | 'loader'> {\n menu?: React.PropsWithChildren<MinimalMenuProps>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonTokens = ButtonTokens & {\n menuIconColor?: string;\n menuIconSize?: string;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type MenuButtonVariants = ButtonVariants<MenuButtonTokens>;\n"]}
@@ -1,6 +0,0 @@
1
- export * from './MenuButton.types';
2
- export * from './MenuButton';
3
- export * from './useMenuButton';
4
- export * from './useMenuButtonState';
5
- export * from './useExpanded';
6
- export * from './useMenuButtonClasses';
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "tslib", "./MenuButton", "./useMenuButton", "./useMenuButtonState", "./useExpanded", "./useMenuButtonClasses"], function (require, exports, tslib_1, MenuButton_1, useMenuButton_1, useMenuButtonState_1, useExpanded_1, useMenuButtonClasses_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(MenuButton_1, exports);
5
- tslib_1.__exportStar(useMenuButton_1, exports);
6
- tslib_1.__exportStar(useMenuButtonState_1, exports);
7
- tslib_1.__exportStar(useExpanded_1, exports);
8
- tslib_1.__exportStar(useMenuButtonClasses_1, exports);
9
- });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuButton/index.ts"],"names":[],"mappings":";;;IACA,4CAA6B;IAC7B,+CAAgC;IAChC,oDAAqC;IACrC,6CAA8B;IAC9B,sDAAuC","sourcesContent":["export * from './MenuButton.types';\nexport * from './MenuButton';\nexport * from './useMenuButton';\nexport * from './useMenuButtonState';\nexport * from './useExpanded';\nexport * from './useMenuButtonClasses';\n"]}
@@ -1,7 +0,0 @@
1
- import { MenuButtonState } from './MenuButton.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 renderMenuButton: (state: MenuButtonState) => JSX.Element;
@@ -1,21 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./useMenuButton"], function (require, exports, tslib_1, React, index_1, useMenuButton_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.renderMenuButton = function (state) {
10
- var _a;
11
- var _b = index_1.getSlots(state, useMenuButton_1.menuButtonShorthandProps), slots = _b.slots, slotProps = _b.slotProps;
12
- var iconOnly = state.iconOnly, children = state.children;
13
- var contentVisible = !iconOnly && (children || ((_a = slotProps.content) === null || _a === void 0 ? void 0 : _a.children));
14
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
15
- React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
16
- contentVisible && React.createElement(slots.content, tslib_1.__assign({}, slotProps.content)),
17
- !iconOnly && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon)),
18
- React.createElement(slots.menu, tslib_1.__assign({}, slotProps.menu))));
19
- };
20
- });
21
- //# sourceMappingURL=renderMenuButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;IAKA;;;;OAIG;IACU,QAAA,gBAAgB,GAAG,UAAC,KAAsB;;QAC/C,IAAA,sEAAgE,EAA9D,gBAAK,EAAE,wBAAuD,CAAC;QAC/D,IAAA,yBAAQ,EAAE,yBAAQ,CAAW;QAErC,IAAM,cAAc,GAAG,CAAC,QAAQ,IAAI,CAAC,QAAQ,WAAI,SAAS,CAAC,OAAO,0CAAE,QAAQ,CAAA,CAAC,CAAC;QAE9E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACjC,cAAc,IAAI,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;YAC1D,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI;YACxD,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACvB,CACd,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { MenuButtonState } from './MenuButton.types';\nimport { menuButtonShorthandProps } from './useMenuButton';\n\n/**\n * Redefine the render function to add slots. Reuse the button structure but add\n * slots to children.\n * @param state\n */\nexport const renderMenuButton = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots(state, menuButtonShorthandProps);\n const { iconOnly, children } = state;\n\n const contentVisible = !iconOnly && (children || slotProps.content?.children);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.icon {...slotProps.icon} />\n {contentVisible && <slots.content {...slotProps.content} />}\n {!iconOnly && <slots.menuIcon {...slotProps.menuIcon} />}\n <slots.menu {...slotProps.menu} />\n </slots.root>\n );\n};\n"]}
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import { MenuButtonState, MinimalMenuProps } from './MenuButton.types';
3
- export declare type ExpandedState = {
4
- ref?: React.Ref<unknown>;
5
- expanded?: boolean;
6
- defaultExpanded?: boolean;
7
- onClick?: (ev: React.MouseEvent) => void;
8
- onMenuDismiss?: () => void;
9
- onKeyDown?: (ev: React.KeyboardEvent) => void;
10
- 'aria-expanded'?: React.HTMLAttributes<HTMLElement>['aria-expanded'];
11
- 'aria-haspopup'?: React.HTMLAttributes<HTMLElement>['aria-haspopup'];
12
- menu?: MenuButtonState['menu'];
13
- };
14
- export declare const useMenuContext: () => MinimalMenuProps;
15
- /**
16
- * @param draftState - mutable state object to update to add expanded behavior.
17
- */
18
- export declare const useExpanded: <TDraftState extends ExpandedState>(draftState: TDraftState) => void;
@@ -1,62 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-hooks", "@fluentui/keyboard-key"], function (require, exports, React, react_hooks_1, keyboard_key_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var MenuContext = React.createContext({});
5
- exports.useMenuContext = function () {
6
- return React.useContext(MenuContext);
7
- };
8
- /**
9
- * @param draftState - mutable state object to update to add expanded behavior.
10
- */
11
- exports.useExpanded = function (draftState) {
12
- var expanded = draftState.expanded, defaultExpanded = draftState.defaultExpanded, onClick = draftState.onClick, onMenuDismiss = draftState.onMenuDismiss, onKeyDown = draftState.onKeyDown;
13
- var _a = react_hooks_1.useControllableValue(expanded, defaultExpanded), expandedValue = _a[0], setExpandedValue = _a[1];
14
- var rootRef = React.useRef();
15
- // Set up a ref to be used for the menu target.
16
- draftState.ref = react_hooks_1.useMergedRefs(draftState.ref, rootRef);
17
- // Set true value.
18
- draftState.expanded = expandedValue;
19
- // When the root is clicked, toggle menu.
20
- draftState.onClick = React.useCallback(function (ev) {
21
- if (onClick) {
22
- onClick(ev);
23
- if (ev.defaultPrevented) {
24
- return;
25
- }
26
- }
27
- setExpandedValue(!expandedValue);
28
- }, [onClick, expandedValue, setExpandedValue]);
29
- // When alt/meta down arrow is pressed, expand.
30
- draftState.onKeyDown = React.useCallback(function (ev) {
31
- if (onKeyDown) {
32
- onKeyDown(ev);
33
- if (ev.defaultPrevented) {
34
- return;
35
- }
36
- }
37
- if ((ev.altKey || ev.metaKey) && keyboard_key_1.getCode(ev) === keyboard_key_1.ArrowDownKey) {
38
- setExpandedValue(true);
39
- ev.stopPropagation();
40
- ev.preventDefault();
41
- }
42
- }, [onKeyDown, setExpandedValue]);
43
- var onDismiss = React.useCallback(function () {
44
- var _a;
45
- (_a = onMenuDismiss) === null || _a === void 0 ? void 0 : _a();
46
- setExpandedValue(false);
47
- // TODO: should we re-focus the root?
48
- }, [onMenuDismiss, setExpandedValue]);
49
- var menuProps = {
50
- hidden: !expandedValue,
51
- onDismiss: onDismiss,
52
- target: rootRef,
53
- };
54
- // Assign extra props to the menu slot.
55
- draftState.menu = {
56
- children: draftState.menu ? (typeof draftState.menu.children === 'function' ? (draftState.menu.children(menuProps)) : (React.createElement(MenuContext.Provider, { value: menuProps }, draftState.menu.children))) : null,
57
- };
58
- draftState['aria-expanded'] = expandedValue;
59
- draftState['aria-haspopup'] = true;
60
- };
61
- });
62
- //# sourceMappingURL=useExpanded.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useExpanded.js","sourceRoot":"../src/","sources":["components/MenuButton/useExpanded.tsx"],"names":[],"mappings":";;;IAkBA,IAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAmB,EAAE,CAAC,CAAC;IACjD,QAAA,cAAc,GAAG;QAC5B,OAAO,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF;;OAEG;IACU,QAAA,WAAW,GAAG,UAAoC,UAAuB;QAC5E,IAAA,8BAAQ,EAAE,4CAAe,EAAE,4BAAO,EAAE,wCAAa,EAAE,gCAAS,CAAgB;QAC9E,IAAA,kEAAmF,EAAlF,qBAAa,EAAE,wBAAmE,CAAC;QAC1F,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAA2B,CAAC;QAExD,+CAA+C;QAC/C,UAAU,CAAC,GAAG,GAAG,2BAAa,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAExD,kBAAkB;QAClB,UAAU,CAAC,QAAQ,GAAG,aAAa,CAAC;QAEpC,yCAAyC;QACzC,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CACpC,UAAC,EAAuC;YACtC,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,EAAE,CAAC,CAAC;gBAEZ,IAAI,EAAE,CAAC,gBAAgB,EAAE;oBACvB,OAAO;iBACR;aACF;YAED,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC,EACD,CAAC,OAAO,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAC3C,CAAC;QAEF,+CAA+C;QAC/C,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW,CACtC,UAAC,EAAuB;YACtB,IAAI,SAAS,EAAE;gBACb,SAAS,CAAC,EAAE,CAAC,CAAC;gBAEd,IAAI,EAAE,CAAC,gBAAgB,EAAE;oBACvB,OAAO;iBACR;aACF;YAED,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,sBAAO,CAAC,EAAE,CAAC,KAAK,2BAAY,EAAE;gBAC7D,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBACvB,EAAE,CAAC,eAAe,EAAE,CAAC;gBACrB,EAAE,CAAC,cAAc,EAAE,CAAC;aACrB;QACH,CAAC,EACD,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAC9B,CAAC;QAEF,IAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC;;YAClC,MAAA,aAAa,4CAAK;YAElB,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAExB,qCAAqC;QACvC,CAAC,EAAE,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAEtC,IAAM,SAAS,GAAqB;YAClC,MAAM,EAAE,CAAC,aAAa;YACtB,SAAS,WAAA;YACT,MAAM,EAAE,OAAO;SAChB,CAAC;QAEF,uCAAuC;QACvC,UAAU,CAAC,IAAI,GAAG;YAChB,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,CAC/C,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CACpC,CAAC,CAAC,CAAC,CACF,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,IAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAwB,CAC1F,CACF,CAAC,CAAC,CAAC,IAAI;SACT,CAAC;QAEF,UAAU,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;QAC5C,UAAU,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IACrC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { useControllableValue, useMergedRefs } from '@fluentui/react-hooks';\nimport { getCode, ArrowDownKey } from '@fluentui/keyboard-key';\nimport { MenuButtonState, MinimalMenuProps } from './MenuButton.types';\n\nexport type ExpandedState = {\n ref?: React.Ref<unknown>;\n expanded?: boolean;\n defaultExpanded?: boolean;\n onClick?: (ev: React.MouseEvent) => void;\n onMenuDismiss?: () => void;\n onKeyDown?: (ev: React.KeyboardEvent) => void;\n 'aria-expanded'?: React.HTMLAttributes<HTMLElement>['aria-expanded'];\n 'aria-haspopup'?: React.HTMLAttributes<HTMLElement>['aria-haspopup'];\n\n menu?: MenuButtonState['menu'];\n};\n\nconst MenuContext = React.createContext<MinimalMenuProps>({});\nexport const useMenuContext = () => {\n return React.useContext(MenuContext);\n};\n\n/**\n * @param draftState - mutable state object to update to add expanded behavior.\n */\nexport const useExpanded = <TDraftState extends ExpandedState>(draftState: TDraftState) => {\n const { expanded, defaultExpanded, onClick, onMenuDismiss, onKeyDown } = draftState;\n const [expandedValue, setExpandedValue] = useControllableValue(expanded, defaultExpanded);\n const rootRef = React.useRef<HTMLElement | undefined>();\n\n // Set up a ref to be used for the menu target.\n draftState.ref = useMergedRefs(draftState.ref, rootRef);\n\n // Set true value.\n draftState.expanded = expandedValue;\n\n // When the root is clicked, toggle menu.\n draftState.onClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement>) => {\n if (onClick) {\n onClick(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n setExpandedValue(!expandedValue);\n },\n [onClick, expandedValue, setExpandedValue],\n );\n\n // When alt/meta down arrow is pressed, expand.\n draftState.onKeyDown = React.useCallback(\n (ev: React.KeyboardEvent) => {\n if (onKeyDown) {\n onKeyDown(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n if ((ev.altKey || ev.metaKey) && getCode(ev) === ArrowDownKey) {\n setExpandedValue(true);\n ev.stopPropagation();\n ev.preventDefault();\n }\n },\n [onKeyDown, setExpandedValue],\n );\n\n const onDismiss = React.useCallback(() => {\n onMenuDismiss?.();\n\n setExpandedValue(false);\n\n // TODO: should we re-focus the root?\n }, [onMenuDismiss, setExpandedValue]);\n\n const menuProps: MinimalMenuProps = {\n hidden: !expandedValue,\n onDismiss,\n target: rootRef,\n };\n\n // Assign extra props to the menu slot.\n draftState.menu = {\n children: draftState.menu ? (\n typeof draftState.menu.children === 'function' ? (\n draftState.menu.children(menuProps)\n ) : (\n <MenuContext.Provider value={menuProps}>{draftState.menu.children}</MenuContext.Provider>\n )\n ) : null,\n };\n\n draftState['aria-expanded'] = expandedValue;\n draftState['aria-haspopup'] = true;\n};\n"]}
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { MenuButtonProps, MenuButtonState } from './MenuButton.types';
3
- export declare const menuButtonShorthandProps: string[];
4
- /**
5
- * Redefine the component factory, reusing button factory.
6
- */
7
- export declare const useMenuButton: (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps | undefined) => {
8
- state: MenuButtonState;
9
- render: (state: MenuButtonState) => JSX.Element;
10
- };
@@ -1,27 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-compose/lib/next/index", "./useMenuButtonState", "./renderMenuButton"], function (require, exports, index_1, useMenuButtonState_1, renderMenuButton_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.menuButtonShorthandProps = ['icon', 'content', 'menuIcon', 'menu'];
5
- var mergeProps = index_1.makeMergeProps({ deepMerge: exports.menuButtonShorthandProps });
6
- /**
7
- * Redefine the component factory, reusing button factory.
8
- */
9
- exports.useMenuButton = function (props, ref, defaultProps) {
10
- // Note: because menu button's template and slots are different, we can't reuse
11
- // those, but the useMenuButtonState hook can reuse useButtonState.
12
- var state = mergeProps({
13
- ref: ref,
14
- as: 'button',
15
- icon: { as: 'span' },
16
- content: { as: 'span', children: props.children },
17
- menuIcon: { as: 'span' },
18
- menu: { as: 'span' },
19
- }, defaultProps, index_1.resolveShorthandProps(props, exports.menuButtonShorthandProps));
20
- useMenuButtonState_1.useMenuButtonState(state);
21
- return {
22
- state: state,
23
- render: renderMenuButton_1.renderMenuButton,
24
- };
25
- };
26
- });
27
- //# sourceMappingURL=useMenuButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;;IAMa,QAAA,wBAAwB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAEhF,IAAM,UAAU,GAAG,sBAAc,CAAC,EAAE,SAAS,EAAE,gCAAwB,EAAE,CAAC,CAAC;IAE3E;;OAEG;IACU,QAAA,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;QAC/G,+EAA+E;QAC/E,mEAAmE;QACnE,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;YACjD,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACxB,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;SACrB,EACD,YAAY,EACZ,6BAAqB,CAAC,KAAK,EAAE,gCAAwB,CAAC,CACpC,CAAC;QAErB,uCAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,OAAO;YACL,KAAK,OAAA;YACL,MAAM,EAAE,mCAAgB;SACzB,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';\nimport { MenuButtonProps, MenuButtonState } from './MenuButton.types';\nimport { useMenuButtonState } from './useMenuButtonState';\nimport { renderMenuButton } from './renderMenuButton';\n\nexport const menuButtonShorthandProps = ['icon', 'content', 'menuIcon', 'menu'];\n\nconst mergeProps = makeMergeProps({ deepMerge: menuButtonShorthandProps });\n\n/**\n * Redefine the component factory, reusing button factory.\n */\nexport const useMenuButton = (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps) => {\n // Note: because menu button's template and slots are different, we can't reuse\n // those, but the useMenuButtonState hook can reuse useButtonState.\n const state = mergeProps(\n {\n ref,\n as: 'button',\n icon: { as: 'span' },\n content: { as: 'span', children: props.children },\n menuIcon: { as: 'span' },\n menu: { as: 'span' },\n },\n defaultProps,\n resolveShorthandProps(props, menuButtonShorthandProps),\n ) as MenuButtonState;\n\n useMenuButtonState(state);\n\n return {\n state,\n render: renderMenuButton,\n };\n};\n"]}
@@ -1,3 +0,0 @@
1
- import { Theme } from '@fluentui/react-theme-provider';
2
- import { MenuButtonState } from './MenuButton.types';
3
- export declare const useMenuButtonClasses: (state: MenuButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;