@fluentui/react-menu 9.7.4 → 9.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (491) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +94 -1
  3. package/CHANGELOG.md +24 -2
  4. package/lib/Menu.js.map +1 -1
  5. package/lib/MenuDivider.js.map +1 -1
  6. package/lib/MenuGroup.js.map +1 -1
  7. package/lib/MenuGroupHeader.js.map +1 -1
  8. package/lib/MenuItem.js.map +1 -1
  9. package/lib/MenuItemCheckbox.js.map +1 -1
  10. package/lib/MenuItemRadio.js.map +1 -1
  11. package/lib/MenuList.js.map +1 -1
  12. package/lib/MenuPopover.js.map +1 -1
  13. package/lib/MenuSplitGroup.js.map +1 -1
  14. package/lib/MenuTrigger.js.map +1 -1
  15. package/lib/components/Menu/Menu.js +1 -0
  16. package/lib/components/Menu/Menu.js.map +1 -1
  17. package/lib/components/Menu/Menu.types.js +1 -1
  18. package/lib/components/Menu/Menu.types.js.map +1 -1
  19. package/lib/components/Menu/index.js.map +1 -1
  20. package/lib/components/Menu/renderMenu.js.map +1 -1
  21. package/lib/components/Menu/useMenu.js +9 -8
  22. package/lib/components/Menu/useMenu.js.map +1 -1
  23. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  24. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  25. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  26. package/lib/components/MenuDivider/index.js.map +1 -1
  27. package/lib/components/MenuDivider/renderMenuDivider.js +1 -3
  28. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  29. package/lib/components/MenuDivider/useMenuDivider.js +1 -0
  30. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  31. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  32. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  33. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  34. package/lib/components/MenuGroup/index.js.map +1 -1
  35. package/lib/components/MenuGroup/renderMenuGroup.js +1 -3
  36. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  37. package/lib/components/MenuGroup/useMenuGroup.js +1 -0
  38. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  39. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  40. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  41. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  42. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  43. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  44. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +1 -3
  45. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  46. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +1 -0
  47. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  48. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  49. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  50. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  51. package/lib/components/MenuItem/index.js.map +1 -1
  52. package/lib/components/MenuItem/renderMenuItem.js +1 -13
  53. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  54. package/lib/components/MenuItem/useCharacterSearch.js +3 -2
  55. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  56. package/lib/components/MenuItem/useMenuItem.js +7 -7
  57. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  58. package/lib/components/MenuItem/useMenuItemStyles.js +15 -2
  59. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  60. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  61. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  62. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  63. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +1 -11
  64. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  65. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +4 -4
  66. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  67. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  68. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  69. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  70. package/lib/components/MenuItemRadio/index.js.map +1 -1
  71. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +1 -11
  72. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  73. package/lib/components/MenuItemRadio/useMenuItemRadio.js +4 -4
  74. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  75. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  76. package/lib/components/MenuList/MenuList.js.map +1 -1
  77. package/lib/components/MenuList/MenuList.types.js +1 -1
  78. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  79. package/lib/components/MenuList/index.js.map +1 -1
  80. package/lib/components/MenuList/renderMenuList.js +1 -3
  81. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  82. package/lib/components/MenuList/useMenuList.js +6 -5
  83. package/lib/components/MenuList/useMenuList.js.map +1 -1
  84. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  85. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  86. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  87. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  88. package/lib/components/MenuPopover/index.js.map +1 -1
  89. package/lib/components/MenuPopover/renderMenuPopover.js +2 -6
  90. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  91. package/lib/components/MenuPopover/useMenuPopover.js +4 -4
  92. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  93. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  94. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  95. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  96. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  97. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +1 -3
  98. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  99. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +2 -2
  100. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  101. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  102. package/lib/components/MenuTrigger/MenuTrigger.js +1 -0
  103. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  104. package/lib/components/MenuTrigger/MenuTrigger.types.js +1 -1
  105. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  106. package/lib/components/MenuTrigger/index.js.map +1 -1
  107. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  108. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  109. package/lib/components/index.js.map +1 -1
  110. package/lib/contexts/menuContext.js +1 -0
  111. package/lib/contexts/menuContext.js.map +1 -1
  112. package/lib/contexts/menuGroupContext.js +2 -4
  113. package/lib/contexts/menuGroupContext.js.map +1 -1
  114. package/lib/contexts/menuListContext.js +1 -0
  115. package/lib/contexts/menuListContext.js.map +1 -1
  116. package/lib/contexts/menuTriggerContext.js +2 -4
  117. package/lib/contexts/menuTriggerContext.js.map +1 -1
  118. package/lib/index.js.map +1 -1
  119. package/lib/selectable/index.js.map +1 -1
  120. package/lib/selectable/types.js +1 -1
  121. package/lib/selectable/types.js.map +1 -1
  122. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  123. package/lib/utils/index.js.map +1 -1
  124. package/lib/utils/useIsSubmenu.js.map +1 -1
  125. package/lib/utils/useOnMenuEnter.js +2 -2
  126. package/lib/utils/useOnMenuEnter.js.map +1 -1
  127. package/lib-commonjs/Menu.js +5 -4
  128. package/lib-commonjs/Menu.js.map +1 -1
  129. package/lib-commonjs/MenuDivider.js +5 -4
  130. package/lib-commonjs/MenuDivider.js.map +1 -1
  131. package/lib-commonjs/MenuGroup.js +5 -4
  132. package/lib-commonjs/MenuGroup.js.map +1 -1
  133. package/lib-commonjs/MenuGroupHeader.js +5 -4
  134. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  135. package/lib-commonjs/MenuItem.js +5 -4
  136. package/lib-commonjs/MenuItem.js.map +1 -1
  137. package/lib-commonjs/MenuItemCheckbox.js +5 -4
  138. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  139. package/lib-commonjs/MenuItemRadio.js +5 -4
  140. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  141. package/lib-commonjs/MenuList.js +5 -4
  142. package/lib-commonjs/MenuList.js.map +1 -1
  143. package/lib-commonjs/MenuPopover.js +5 -4
  144. package/lib-commonjs/MenuPopover.js.map +1 -1
  145. package/lib-commonjs/MenuSplitGroup.js +5 -4
  146. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  147. package/lib-commonjs/MenuTrigger.js +5 -4
  148. package/lib-commonjs/MenuTrigger.js.map +1 -1
  149. package/lib-commonjs/components/Menu/Menu.js +16 -15
  150. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  151. package/lib-commonjs/components/Menu/Menu.types.js +5 -2
  152. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  153. package/lib-commonjs/components/Menu/index.js +9 -8
  154. package/lib-commonjs/components/Menu/index.js.map +1 -1
  155. package/lib-commonjs/components/Menu/renderMenu.js +14 -14
  156. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  157. package/lib-commonjs/components/Menu/useMenu.js +258 -256
  158. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  159. package/lib-commonjs/components/Menu/useMenuContextValues.js +29 -43
  160. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  161. package/lib-commonjs/components/MenuDivider/MenuDivider.js +19 -20
  162. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  163. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js +3 -2
  164. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  165. package/lib-commonjs/components/MenuDivider/index.js +9 -8
  166. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  167. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +13 -19
  168. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  169. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +22 -21
  170. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  171. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +47 -25
  172. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  173. package/lib-commonjs/components/MenuGroup/MenuGroup.js +21 -22
  174. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  175. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js +3 -2
  176. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  177. package/lib-commonjs/components/MenuGroup/index.js +10 -9
  178. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  179. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +16 -22
  180. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  181. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +23 -22
  182. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  183. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +18 -15
  184. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  185. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +19 -11
  186. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  187. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +19 -20
  188. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  189. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js +3 -2
  190. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  191. package/lib-commonjs/components/MenuGroupHeader/index.js +9 -8
  192. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  193. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +13 -19
  194. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  195. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +22 -23
  196. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  197. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +47 -25
  198. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  199. package/lib-commonjs/components/MenuItem/MenuItem.js +19 -20
  200. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  201. package/lib-commonjs/components/MenuItem/MenuItem.types.js +3 -2
  202. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  203. package/lib-commonjs/components/MenuItem/index.js +9 -8
  204. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  205. package/lib-commonjs/components/MenuItem/renderMenuItem.js +13 -28
  206. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  207. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +24 -22
  208. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  209. package/lib-commonjs/components/MenuItem/useMenuItem.js +97 -104
  210. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  211. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +318 -137
  212. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  213. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +19 -20
  214. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  215. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js +3 -2
  216. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  217. package/lib-commonjs/components/MenuItemCheckbox/index.js +9 -8
  218. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  219. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +13 -24
  220. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  221. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +44 -45
  222. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  223. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +38 -30
  224. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  225. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +19 -20
  226. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  227. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js +3 -2
  228. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  229. package/lib-commonjs/components/MenuItemRadio/index.js +9 -8
  230. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  231. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +13 -27
  232. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  233. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +42 -45
  234. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  235. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +38 -30
  236. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  237. package/lib-commonjs/components/MenuList/MenuList.js +21 -22
  238. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  239. package/lib-commonjs/components/MenuList/MenuList.types.js +5 -2
  240. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  241. package/lib-commonjs/components/MenuList/index.js +10 -9
  242. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  243. package/lib-commonjs/components/MenuList/renderMenuList.js +16 -21
  244. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  245. package/lib-commonjs/components/MenuList/useMenuList.js +143 -137
  246. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  247. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +20 -25
  248. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  249. package/lib-commonjs/components/MenuList/useMenuListStyles.js +33 -23
  250. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  251. package/lib-commonjs/components/MenuPopover/MenuPopover.js +19 -20
  252. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  253. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js +3 -2
  254. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  255. package/lib-commonjs/components/MenuPopover/index.js +9 -8
  256. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  257. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +19 -26
  258. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  259. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +102 -110
  260. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  261. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +121 -50
  262. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  263. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +19 -20
  264. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  265. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +3 -2
  266. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  267. package/lib-commonjs/components/MenuSplitGroup/index.js +9 -8
  268. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  269. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +13 -18
  270. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  271. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +58 -64
  272. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  273. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +61 -32
  274. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  275. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +15 -15
  276. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  277. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js +5 -2
  278. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  279. package/lib-commonjs/components/MenuTrigger/index.js +8 -7
  280. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  281. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +14 -16
  282. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  283. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +163 -170
  284. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  285. package/lib-commonjs/components/index.js +6 -5
  286. package/lib-commonjs/components/index.js.map +1 -1
  287. package/lib-commonjs/contexts/menuContext.js +38 -27
  288. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  289. package/lib-commonjs/contexts/menuGroupContext.js +19 -12
  290. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  291. package/lib-commonjs/contexts/menuListContext.js +25 -14
  292. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  293. package/lib-commonjs/contexts/menuTriggerContext.js +18 -12
  294. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  295. package/lib-commonjs/index.js +91 -399
  296. package/lib-commonjs/index.js.map +1 -1
  297. package/lib-commonjs/selectable/index.js +6 -5
  298. package/lib-commonjs/selectable/index.js.map +1 -1
  299. package/lib-commonjs/selectable/types.js +5 -2
  300. package/lib-commonjs/selectable/types.js.map +1 -1
  301. package/lib-commonjs/selectable/useCheckmarkStyles.js +28 -26
  302. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  303. package/lib-commonjs/utils/index.js +5 -4
  304. package/lib-commonjs/utils/index.js.map +1 -1
  305. package/lib-commonjs/utils/useIsSubmenu.js +13 -19
  306. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  307. package/lib-commonjs/utils/useOnMenuEnter.js +57 -68
  308. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  309. package/package.json +15 -14
  310. package/lib-amd/Menu.js +0 -6
  311. package/lib-amd/Menu.js.map +0 -1
  312. package/lib-amd/MenuDivider.js +0 -6
  313. package/lib-amd/MenuDivider.js.map +0 -1
  314. package/lib-amd/MenuGroup.js +0 -6
  315. package/lib-amd/MenuGroup.js.map +0 -1
  316. package/lib-amd/MenuGroupHeader.js +0 -6
  317. package/lib-amd/MenuGroupHeader.js.map +0 -1
  318. package/lib-amd/MenuItem.js +0 -6
  319. package/lib-amd/MenuItem.js.map +0 -1
  320. package/lib-amd/MenuItemCheckbox.js +0 -6
  321. package/lib-amd/MenuItemCheckbox.js.map +0 -1
  322. package/lib-amd/MenuItemRadio.js +0 -6
  323. package/lib-amd/MenuItemRadio.js.map +0 -1
  324. package/lib-amd/MenuList.js +0 -6
  325. package/lib-amd/MenuList.js.map +0 -1
  326. package/lib-amd/MenuPopover.js +0 -6
  327. package/lib-amd/MenuPopover.js.map +0 -1
  328. package/lib-amd/MenuSplitGroup.js +0 -6
  329. package/lib-amd/MenuSplitGroup.js.map +0 -1
  330. package/lib-amd/MenuTrigger.js +0 -6
  331. package/lib-amd/MenuTrigger.js.map +0 -1
  332. package/lib-amd/components/Menu/Menu.js +0 -16
  333. package/lib-amd/components/Menu/Menu.js.map +0 -1
  334. package/lib-amd/components/Menu/Menu.types.js +0 -5
  335. package/lib-amd/components/Menu/Menu.types.js.map +0 -1
  336. package/lib-amd/components/Menu/index.js +0 -10
  337. package/lib-amd/components/Menu/index.js.map +0 -1
  338. package/lib-amd/components/Menu/renderMenu.js +0 -15
  339. package/lib-amd/components/Menu/renderMenu.js.map +0 -1
  340. package/lib-amd/components/Menu/useMenu.js +0 -224
  341. package/lib-amd/components/Menu/useMenu.js.map +0 -1
  342. package/lib-amd/components/Menu/useMenuContextValues.js +0 -29
  343. package/lib-amd/components/Menu/useMenuContextValues.js.map +0 -1
  344. package/lib-amd/components/MenuDivider/MenuDivider.js +0 -17
  345. package/lib-amd/components/MenuDivider/MenuDivider.js.map +0 -1
  346. package/lib-amd/components/MenuDivider/MenuDivider.types.js +0 -5
  347. package/lib-amd/components/MenuDivider/MenuDivider.types.js.map +0 -1
  348. package/lib-amd/components/MenuDivider/index.js +0 -10
  349. package/lib-amd/components/MenuDivider/index.js.map +0 -1
  350. package/lib-amd/components/MenuDivider/renderMenuDivider.js +0 -15
  351. package/lib-amd/components/MenuDivider/renderMenuDivider.js.map +0 -1
  352. package/lib-amd/components/MenuDivider/useMenuDivider.js +0 -18
  353. package/lib-amd/components/MenuDivider/useMenuDivider.js.map +0 -1
  354. package/lib-amd/components/MenuDivider/useMenuDividerStyles.js +0 -18
  355. package/lib-amd/components/MenuDivider/useMenuDividerStyles.js.map +0 -1
  356. package/lib-amd/components/MenuGroup/MenuGroup.js +0 -18
  357. package/lib-amd/components/MenuGroup/MenuGroup.js.map +0 -1
  358. package/lib-amd/components/MenuGroup/MenuGroup.types.js +0 -5
  359. package/lib-amd/components/MenuGroup/MenuGroup.types.js.map +0 -1
  360. package/lib-amd/components/MenuGroup/index.js +0 -11
  361. package/lib-amd/components/MenuGroup/index.js.map +0 -1
  362. package/lib-amd/components/MenuGroup/renderMenuGroup.js +0 -16
  363. package/lib-amd/components/MenuGroup/renderMenuGroup.js.map +0 -1
  364. package/lib-amd/components/MenuGroup/useMenuGroup.js +0 -20
  365. package/lib-amd/components/MenuGroup/useMenuGroup.js.map +0 -1
  366. package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js +0 -12
  367. package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js.map +0 -1
  368. package/lib-amd/components/MenuGroup/useMenuGroupStyles.js +0 -14
  369. package/lib-amd/components/MenuGroup/useMenuGroupStyles.js.map +0 -1
  370. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js +0 -17
  371. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js.map +0 -1
  372. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js +0 -5
  373. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js.map +0 -1
  374. package/lib-amd/components/MenuGroupHeader/index.js +0 -10
  375. package/lib-amd/components/MenuGroupHeader/index.js.map +0 -1
  376. package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js +0 -15
  377. package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js.map +0 -1
  378. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js +0 -19
  379. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js.map +0 -1
  380. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +0 -27
  381. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +0 -1
  382. package/lib-amd/components/MenuItem/MenuItem.js +0 -17
  383. package/lib-amd/components/MenuItem/MenuItem.js.map +0 -1
  384. package/lib-amd/components/MenuItem/MenuItem.types.js +0 -5
  385. package/lib-amd/components/MenuItem/MenuItem.types.js.map +0 -1
  386. package/lib-amd/components/MenuItem/index.js +0 -10
  387. package/lib-amd/components/MenuItem/index.js.map +0 -1
  388. package/lib-amd/components/MenuItem/renderMenuItem.js +0 -19
  389. package/lib-amd/components/MenuItem/renderMenuItem.js.map +0 -1
  390. package/lib-amd/components/MenuItem/useCharacterSearch.js +0 -22
  391. package/lib-amd/components/MenuItem/useCharacterSearch.js.map +0 -1
  392. package/lib-amd/components/MenuItem/useMenuItem.js +0 -75
  393. package/lib-amd/components/MenuItem/useMenuItem.js.map +0 -1
  394. package/lib-amd/components/MenuItem/useMenuItemStyles.js +0 -109
  395. package/lib-amd/components/MenuItem/useMenuItemStyles.js.map +0 -1
  396. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -17
  397. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js.map +0 -1
  398. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js +0 -5
  399. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +0 -1
  400. package/lib-amd/components/MenuItemCheckbox/index.js +0 -10
  401. package/lib-amd/components/MenuItemCheckbox/index.js.map +0 -1
  402. package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js +0 -16
  403. package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +0 -1
  404. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js +0 -26
  405. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +0 -1
  406. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -31
  407. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +0 -1
  408. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js +0 -17
  409. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js.map +0 -1
  410. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js +0 -5
  411. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js.map +0 -1
  412. package/lib-amd/components/MenuItemRadio/index.js +0 -10
  413. package/lib-amd/components/MenuItemRadio/index.js.map +0 -1
  414. package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js +0 -19
  415. package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js.map +0 -1
  416. package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js +0 -27
  417. package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js.map +0 -1
  418. package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -31
  419. package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js.map +0 -1
  420. package/lib-amd/components/MenuList/MenuList.js +0 -18
  421. package/lib-amd/components/MenuList/MenuList.js.map +0 -1
  422. package/lib-amd/components/MenuList/MenuList.types.js +0 -5
  423. package/lib-amd/components/MenuList/MenuList.types.js.map +0 -1
  424. package/lib-amd/components/MenuList/index.js +0 -11
  425. package/lib-amd/components/MenuList/index.js.map +0 -1
  426. package/lib-amd/components/MenuList/renderMenuList.js +0 -15
  427. package/lib-amd/components/MenuList/renderMenuList.js.map +0 -1
  428. package/lib-amd/components/MenuList/useMenuList.js +0 -125
  429. package/lib-amd/components/MenuList/useMenuList.js.map +0 -1
  430. package/lib-amd/components/MenuList/useMenuListContextValues.js +0 -20
  431. package/lib-amd/components/MenuList/useMenuListContextValues.js.map +0 -1
  432. package/lib-amd/components/MenuList/useMenuListStyles.js +0 -21
  433. package/lib-amd/components/MenuList/useMenuListStyles.js.map +0 -1
  434. package/lib-amd/components/MenuPopover/MenuPopover.js +0 -17
  435. package/lib-amd/components/MenuPopover/MenuPopover.js.map +0 -1
  436. package/lib-amd/components/MenuPopover/MenuPopover.types.js +0 -5
  437. package/lib-amd/components/MenuPopover/MenuPopover.types.js.map +0 -1
  438. package/lib-amd/components/MenuPopover/index.js +0 -10
  439. package/lib-amd/components/MenuPopover/index.js.map +0 -1
  440. package/lib-amd/components/MenuPopover/renderMenuPopover.js +0 -18
  441. package/lib-amd/components/MenuPopover/renderMenuPopover.js.map +0 -1
  442. package/lib-amd/components/MenuPopover/useMenuPopover.js +0 -83
  443. package/lib-amd/components/MenuPopover/useMenuPopover.js.map +0 -1
  444. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js +0 -21
  445. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js.map +0 -1
  446. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js +0 -17
  447. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js.map +0 -1
  448. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js +0 -5
  449. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js.map +0 -1
  450. package/lib-amd/components/MenuSplitGroup/index.js +0 -10
  451. package/lib-amd/components/MenuSplitGroup/index.js.map +0 -1
  452. package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js +0 -14
  453. package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js.map +0 -1
  454. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js +0 -47
  455. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js.map +0 -1
  456. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js +0 -43
  457. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +0 -1
  458. package/lib-amd/components/MenuTrigger/MenuTrigger.js +0 -18
  459. package/lib-amd/components/MenuTrigger/MenuTrigger.js.map +0 -1
  460. package/lib-amd/components/MenuTrigger/MenuTrigger.types.js +0 -5
  461. package/lib-amd/components/MenuTrigger/MenuTrigger.types.js.map +0 -1
  462. package/lib-amd/components/MenuTrigger/index.js +0 -9
  463. package/lib-amd/components/MenuTrigger/index.js.map +0 -1
  464. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js +0 -15
  465. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js.map +0 -1
  466. package/lib-amd/components/MenuTrigger/useMenuTrigger.js +0 -112
  467. package/lib-amd/components/MenuTrigger/useMenuTrigger.js.map +0 -1
  468. package/lib-amd/components/index.js +0 -7
  469. package/lib-amd/components/index.js.map +0 -1
  470. package/lib-amd/contexts/menuContext.js +0 -32
  471. package/lib-amd/contexts/menuContext.js.map +0 -1
  472. package/lib-amd/contexts/menuGroupContext.js +0 -13
  473. package/lib-amd/contexts/menuGroupContext.js.map +0 -1
  474. package/lib-amd/contexts/menuListContext.js +0 -23
  475. package/lib-amd/contexts/menuListContext.js.map +0 -1
  476. package/lib-amd/contexts/menuTriggerContext.js +0 -14
  477. package/lib-amd/contexts/menuTriggerContext.js.map +0 -1
  478. package/lib-amd/index.js +0 -69
  479. package/lib-amd/index.js.map +0 -1
  480. package/lib-amd/selectable/index.js +0 -7
  481. package/lib-amd/selectable/index.js.map +0 -1
  482. package/lib-amd/selectable/types.js +0 -5
  483. package/lib-amd/selectable/types.js.map +0 -1
  484. package/lib-amd/selectable/useCheckmarkStyles.js +0 -28
  485. package/lib-amd/selectable/useCheckmarkStyles.js.map +0 -1
  486. package/lib-amd/utils/index.js +0 -6
  487. package/lib-amd/utils/index.js.map +0 -1
  488. package/lib-amd/utils/useIsSubmenu.js +0 -20
  489. package/lib-amd/utils/useIsSubmenu.js.map +0 -1
  490. package/lib-amd/utils/useOnMenuEnter.js +0 -59
  491. package/lib-amd/utils/useOnMenuEnter.js.map +0 -1
@@ -1,41 +1,70 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ menuSplitGroupClassNames: ()=>menuSplitGroupClassNames,
13
+ useMenuSplitGroupStyles_unstable: ()=>useMenuSplitGroupStyles_unstable
5
14
  });
6
- exports.useMenuSplitGroupStyles_unstable = exports.menuSplitGroupClassNames = void 0;
7
- const react_1 = /*#__PURE__*/require("@griffel/react");
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
- const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
10
- exports.menuSplitGroupClassNames = {
11
- root: 'fui-MenuSplitGroup'
15
+ const _react = require("@griffel/react");
16
+ const menuSplitGroupClassNames = {
17
+ root: 'fui-MenuSplitGroup'
12
18
  };
13
19
  /**
14
20
  * Styles for the root slot
15
- */
16
- const useStyles = /*#__PURE__*/react_1.__styles({
17
- root: {
18
- mc9l5x: "f22iagw",
19
- u7v6m2: "f168awwq",
20
- Bo1wru1: ["f1om2jlk", "fcyhg04"],
21
- Bhkyaub: ["fgqgg70", "fqo1hry"],
22
- J9ixe0: ["fh1zedf", "f1auaj6e"],
23
- rj29m3: ["fokbbcd", "f1xlvh9o"],
24
- B2knx3v: "f1mf2v5d",
25
- Bl7aesu: "fi8lk9b",
26
- e82tai: "f1tc32yi",
27
- Bnkcs84: "f1kve8m0"
28
- }
21
+ */ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
22
+ root: {
23
+ mc9l5x: "f22iagw",
24
+ u7v6m2: "f168awwq",
25
+ Bo1wru1: [
26
+ "f1om2jlk",
27
+ "fcyhg04"
28
+ ],
29
+ Bhkyaub: [
30
+ "fgqgg70",
31
+ "fqo1hry"
32
+ ],
33
+ J9ixe0: [
34
+ "fh1zedf",
35
+ "f1auaj6e"
36
+ ],
37
+ rj29m3: [
38
+ "fokbbcd",
39
+ "f1xlvh9o"
40
+ ],
41
+ B2knx3v: "f1mf2v5d",
42
+ Bl7aesu: "fi8lk9b",
43
+ e82tai: "f1tc32yi",
44
+ Bnkcs84: "f1kve8m0"
45
+ }
29
46
  }, {
30
- d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f168awwq>.fui-MenuItem:nth-child(1){width:100%;}", ".f1om2jlk>.fui-MenuItem:nth-child(2){border-top-left-radius:0;}", ".fcyhg04>.fui-MenuItem:nth-child(2){border-top-right-radius:0;}", ".fgqgg70>.fui-MenuItem:nth-child(2){border-bottom-left-radius:0;}", ".fqo1hry>.fui-MenuItem:nth-child(2){border-bottom-right-radius:0;}", ".fh1zedf>.fui-MenuItem:nth-child(2){padding-left:0;}", ".f1auaj6e>.fui-MenuItem:nth-child(2){padding-right:0;}", ".fokbbcd>.fui-MenuItem:nth-child(2){margin-left:auto;}", ".f1xlvh9o>.fui-MenuItem:nth-child(2){margin-right:auto;}", ".f1mf2v5d>.fui-MenuItem:nth-child(2)::before{content:\"\";}", ".fi8lk9b>.fui-MenuItem:nth-child(2)::before{width:var(--strokeWidthThin);}", ".f1tc32yi>.fui-MenuItem:nth-child(2)::before{height:24px;}", ".f1kve8m0>.fui-MenuItem:nth-child(2)::before{background-color:var(--colorNeutralStroke1);}"]
47
+ d: [
48
+ ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}",
49
+ ".f168awwq>.fui-MenuItem:nth-child(1){width:100%;}",
50
+ ".f1om2jlk>.fui-MenuItem:nth-child(2){border-top-left-radius:0;}",
51
+ ".fcyhg04>.fui-MenuItem:nth-child(2){border-top-right-radius:0;}",
52
+ ".fgqgg70>.fui-MenuItem:nth-child(2){border-bottom-left-radius:0;}",
53
+ ".fqo1hry>.fui-MenuItem:nth-child(2){border-bottom-right-radius:0;}",
54
+ ".fh1zedf>.fui-MenuItem:nth-child(2){padding-left:0;}",
55
+ ".f1auaj6e>.fui-MenuItem:nth-child(2){padding-right:0;}",
56
+ ".fokbbcd>.fui-MenuItem:nth-child(2){margin-left:auto;}",
57
+ ".f1xlvh9o>.fui-MenuItem:nth-child(2){margin-right:auto;}",
58
+ ".f1mf2v5d>.fui-MenuItem:nth-child(2)::before{content:\"\";}",
59
+ ".fi8lk9b>.fui-MenuItem:nth-child(2)::before{width:var(--strokeWidthThin);}",
60
+ ".f1tc32yi>.fui-MenuItem:nth-child(2)::before{height:24px;}",
61
+ ".f1kve8m0>.fui-MenuItem:nth-child(2)::before{background-color:var(--colorNeutralStroke1);}"
62
+ ]
31
63
  });
32
- /**
33
- * Apply styling to the MenuSplitGroup slots based on the state
34
- */
35
- const useMenuSplitGroupStyles_unstable = state => {
36
- const styles = useStyles();
37
- state.root.className = react_1.mergeClasses(exports.menuSplitGroupClassNames.root, styles.root, state.root.className);
38
- return state;
39
- };
40
- exports.useMenuSplitGroupStyles_unstable = useMenuSplitGroupStyles_unstable;
64
+ const useMenuSplitGroupStyles_unstable = (state)=>{
65
+ const styles = useStyles();
66
+ state.root.className = (0, _react.mergeClasses)(menuSplitGroupClassNames.root, styles.root, state.root.className);
67
+ return state;
68
+ }; //# sourceMappingURL=useMenuSplitGroupStyles.js.map
69
+
41
70
  //# sourceMappingURL=useMenuSplitGroupStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_1","require","react_theme_1","useMenuItemStyles_1","exports","menuSplitGroupClassNames","root","useStyles","__styles","mc9l5x","u7v6m2","Bo1wru1","Bhkyaub","J9ixe0","rj29m3","B2knx3v","Bl7aesu","e82tai","Bnkcs84","d","useMenuSplitGroupStyles_unstable","state","styles","className","mergeClasses"],"sources":["../src/packages/react-components/react-menu/src/components/MenuSplitGroup/useMenuSplitGroupStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles';\nimport type { MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots> = {\n root: 'fui-MenuSplitGroup',\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n [`& > .${menuItemClassNames.root}:nth-child(1)`]: {\n width: '100%',\n },\n [`& > .${menuItemClassNames.root}:nth-child(2)`]: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n paddingLeft: 0,\n marginLeft: 'auto',\n '::before': {\n content: '\"\"',\n width: tokens.strokeWidthThin,\n height: '24px',\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n});\n\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = (state: MenuSplitGroupState): MenuSplitGroupState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,mBAAA,gBAAAF,OAAA;AAIaG,OAAA,CAAAC,wBAAwB,GAAwC;EAC3EC,IAAI,EAAE;CACP;AACD;;;AAGA,MAAMC,SAAS,gBAAGP,OAAA,CAAAQ,QAAU;EAAAF,IAAA;IAAAG,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAmB1B;AAEF;;;AAGO,MAAMC,gCAAgC,GAAIC,KAA0B,IAAyB;EAClG,MAAMC,MAAM,GAAGf,SAAS,EAAE;EAC1Bc,KAAK,CAACf,IAAI,CAACiB,SAAS,GAAGvB,OAAA,CAAAwB,YAAY,CAACpB,OAAA,CAAAC,wBAAwB,CAACC,IAAI,EAAEgB,MAAM,CAAChB,IAAI,EAAEe,KAAK,CAACf,IAAI,CAACiB,SAAS,CAAC;EACrG,OAAOF,KAAK;AACd,CAAC;AAJYjB,OAAA,CAAAgB,gCAAgC,GAAAA,gCAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles';\nexport const menuSplitGroupClassNames = {\n root: 'fui-MenuSplitGroup'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n u7v6m2: \"f168awwq\",\n Bo1wru1: [\"f1om2jlk\", \"fcyhg04\"],\n Bhkyaub: [\"fgqgg70\", \"fqo1hry\"],\n J9ixe0: [\"fh1zedf\", \"f1auaj6e\"],\n rj29m3: [\"fokbbcd\", \"f1xlvh9o\"],\n B2knx3v: \"f1mf2v5d\",\n Bl7aesu: \"fi8lk9b\",\n e82tai: \"f1tc32yi\",\n Bnkcs84: \"f1kve8m0\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f168awwq>.fui-MenuItem:nth-child(1){width:100%;}\", \".f1om2jlk>.fui-MenuItem:nth-child(2){border-top-left-radius:0;}\", \".fcyhg04>.fui-MenuItem:nth-child(2){border-top-right-radius:0;}\", \".fgqgg70>.fui-MenuItem:nth-child(2){border-bottom-left-radius:0;}\", \".fqo1hry>.fui-MenuItem:nth-child(2){border-bottom-right-radius:0;}\", \".fh1zedf>.fui-MenuItem:nth-child(2){padding-left:0;}\", \".f1auaj6e>.fui-MenuItem:nth-child(2){padding-right:0;}\", \".fokbbcd>.fui-MenuItem:nth-child(2){margin-left:auto;}\", \".f1xlvh9o>.fui-MenuItem:nth-child(2){margin-right:auto;}\", \".f1mf2v5d>.fui-MenuItem:nth-child(2)::before{content:\\\"\\\";}\", \".fi8lk9b>.fui-MenuItem:nth-child(2)::before{width:var(--strokeWidthThin);}\", \".f1tc32yi>.fui-MenuItem:nth-child(2)::before{height:24px;}\", \".f1kve8m0>.fui-MenuItem:nth-child(2)::before{background-color:var(--colorNeutralStroke1);}\"]\n});\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuSplitGroupStyles.js.map"],"names":["menuSplitGroupClassNames","useMenuSplitGroupStyles_unstable","root","useStyles","__styles","mc9l5x","u7v6m2","Bo1wru1","Bhkyaub","J9ixe0","rj29m3","B2knx3v","Bl7aesu","e82tai","Bnkcs84","d","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IAyBAC,gCAAgC,MAAhCA;;uBA5B0B;AAGhC,MAAMD,2BAA2B;IACtCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,QAAQ;QACRC,SAAS;YAAC;YAAY;SAAU;QAChCC,SAAS;YAAC;YAAW;SAAU;QAC/BC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAAwF;QAAqD;QAAmE;QAAmE;QAAqE;QAAsE;QAAwD;QAA0D;QAA0D;QAA4D;QAA+D;QAA8E;QAA8D;KAA6F;AACp7B;AAIO,MAAMd,mCAAmCe,CAAAA,QAAS;IACvD,MAAMC,SAASd;IACfa,MAAMd,IAAI,CAACgB,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,yBAAyBE,IAAI,EAAEe,OAAOf,IAAI,EAAEc,MAAMd,IAAI,CAACgB,SAAS;IACpG,OAAOF;AACT,GACA,mDAAmD"}
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "MenuTrigger", {
6
+ enumerable: true,
7
+ get: ()=>MenuTrigger
5
8
  });
6
- exports.MenuTrigger = void 0;
7
- const useMenuTrigger_1 = /*#__PURE__*/require("./useMenuTrigger");
8
- const renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
9
- /**
10
- * Wraps a trigger element as an only child
11
- * and adds the necessary event handling to open a popup menu
12
- */
13
- const MenuTrigger = props => {
14
- const state = useMenuTrigger_1.useMenuTrigger_unstable(props);
15
- return renderMenuTrigger_1.renderMenuTrigger_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useMenuTrigger = require("./useMenuTrigger");
12
+ const _renderMenuTrigger = require("./renderMenuTrigger");
13
+ const MenuTrigger = (props)=>{
14
+ const state = (0, _useMenuTrigger.useMenuTrigger_unstable)(props);
15
+ return (0, _renderMenuTrigger.renderMenuTrigger_unstable)(state);
16
16
  };
17
- exports.MenuTrigger = MenuTrigger;
18
- exports.MenuTrigger.displayName = 'MenuTrigger';
17
+ MenuTrigger.displayName = 'MenuTrigger';
19
18
  // type casting here is required to ensure internal type FluentTriggerComponent is not leaked
20
- exports.MenuTrigger.isFluentTriggerComponent = true;
19
+ MenuTrigger.isFluentTriggerComponent = true; //# sourceMappingURL=MenuTrigger.js.map
20
+
21
21
  //# sourceMappingURL=MenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useMenuTrigger_1","require","renderMenuTrigger_1","MenuTrigger","props","state","useMenuTrigger_unstable","renderMenuTrigger_unstable","exports","displayName","isFluentTriggerComponent"],"sources":["../src/packages/react-components/react-menu/src/components/MenuTrigger/MenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger';\nimport { renderMenuTrigger_unstable } from './renderMenuTrigger';\nimport type { MenuTriggerProps } from './MenuTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */\nexport const MenuTrigger: React.FC<MenuTriggerProps> = props => {\n const state = useMenuTrigger_unstable(props);\n\n return renderMenuTrigger_unstable(state);\n};\n\nMenuTrigger.displayName = 'MenuTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(MenuTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"mappings":";;;;;;AACA,MAAAA,gBAAA,gBAAAC,OAAA;AACA,MAAAC,mBAAA,gBAAAD,OAAA;AAIA;;;;AAIO,MAAME,WAAW,GAA+BC,KAAK,IAAG;EAC7D,MAAMC,KAAK,GAAGL,gBAAA,CAAAM,uBAAuB,CAACF,KAAK,CAAC;EAE5C,OAAOF,mBAAA,CAAAK,0BAA0B,CAACF,KAAK,CAAC;AAC1C,CAAC;AAJYG,OAAA,CAAAL,WAAW,GAAAA,WAAA;AAMxBK,OAAA,CAAAL,WAAW,CAACM,WAAW,GAAG,aAAa;AACvC;AACCD,OAAA,CAAAL,WAAsC,CAACO,wBAAwB,GAAG,IAAI"}
1
+ {"version":3,"sources":["../../../lib/components/MenuTrigger/MenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger';\nimport { renderMenuTrigger_unstable } from './renderMenuTrigger';\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */\nexport const MenuTrigger = props => {\n const state = useMenuTrigger_unstable(props);\n return renderMenuTrigger_unstable(state);\n};\nMenuTrigger.displayName = 'MenuTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\nMenuTrigger.isFluentTriggerComponent = true;\n//# sourceMappingURL=MenuTrigger.js.map"],"names":["MenuTrigger","props","state","useMenuTrigger_unstable","renderMenuTrigger_unstable","displayName","isFluentTriggerComponent"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;gCACiB;mCACG;AAKpC,MAAMA,cAAcC,CAAAA,QAAS;IAClC,MAAMC,QAAQC,IAAAA,uCAAuB,EAACF;IACtC,OAAOG,IAAAA,6CAA0B,EAACF;AACpC;AACAF,YAAYK,WAAW,GAAG;AAC1B,6FAA6F;AAC7FL,YAAYM,wBAAwB,GAAG,IAAI,EAC3C,uCAAuC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=MenuTrigger.types.js.map
8
+
6
9
  //# sourceMappingURL=MenuTrigger.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-menu/src/components/MenuTrigger/MenuTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type MenuTriggerProps = TriggerProps<MenuTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu\n */\nexport type MenuTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'menu';\n 'aria-expanded'?: boolean;\n id: string;\n ref: React.Ref<never>;\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseMove: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n }\n>;\n\nexport type MenuTriggerState = {\n children: React.ReactElement | null;\n isSubmenu: boolean;\n};\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/MenuTrigger/MenuTrigger.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=MenuTrigger.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,6CAA6C"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./MenuTrigger"), exports);
8
- tslib_1.__exportStar(require("./MenuTrigger.types"), exports);
9
- tslib_1.__exportStar(require("./renderMenuTrigger"), exports);
10
- tslib_1.__exportStar(require("./useMenuTrigger"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./MenuTrigger"), exports);
7
+ _exportStar(require("./MenuTrigger.types"), exports);
8
+ _exportStar(require("./renderMenuTrigger"), exports);
9
+ _exportStar(require("./useMenuTrigger"), exports);
10
+ //# sourceMappingURL=index.js.map
11
+
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-menu/src/components/MenuTrigger/index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuTrigger/index.js"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,20 +1,18 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderMenuTrigger_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderMenuTrigger_unstable
5
8
  });
6
- exports.renderMenuTrigger_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
9
- /**
10
- * Render the final JSX of MenuTrigger
11
- *
12
- * Only renders children
13
- */
14
- const renderMenuTrigger_unstable = state => {
15
- return React.createElement(menuTriggerContext_1.MenuTriggerContextProvider, {
16
- value: state.isSubmenu
17
- }, state.children);
18
- };
19
- exports.renderMenuTrigger_unstable = renderMenuTrigger_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _menuTriggerContext = require("../../contexts/menuTriggerContext");
12
+ const renderMenuTrigger_unstable = (state)=>{
13
+ return /*#__PURE__*/ _react.createElement(_menuTriggerContext.MenuTriggerContextProvider, {
14
+ value: state.isSubmenu
15
+ }, state.children);
16
+ }; //# sourceMappingURL=renderMenuTrigger.js.map
17
+
20
18
  //# sourceMappingURL=renderMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","menuTriggerContext_1","renderMenuTrigger_unstable","state","createElement","MenuTriggerContextProvider","value","isSubmenu","children","exports"],"sources":["../src/packages/react-components/react-menu/src/components/MenuTrigger/renderMenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\nimport type { MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderMenuTrigger_unstable = (state: MenuTriggerState) => {\n return <MenuTriggerContextProvider value={state.isSubmenu}>{state.children}</MenuTriggerContextProvider>;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,oBAAA,gBAAAD,OAAA;AAGA;;;;;AAKO,MAAME,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,OAAOJ,KAAA,CAAAK,aAAA,CAACH,oBAAA,CAAAI,0BAA0B;IAACC,KAAK,EAAEH,KAAK,CAACI;EAAS,GAAGJ,KAAK,CAACK,QAAQ,CAA8B;AAC1G,CAAC;AAFYC,OAAA,CAAAP,0BAA0B,GAAAA,0BAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuTrigger/renderMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderMenuTrigger_unstable = state => {\n return /*#__PURE__*/React.createElement(MenuTriggerContextProvider, {\n value: state.isSubmenu\n }, state.children);\n};\n//# sourceMappingURL=renderMenuTrigger.js.map"],"names":["renderMenuTrigger_unstable","state","React","createElement","MenuTriggerContextProvider","value","isSubmenu","children"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;oCACoB;AAMpC,MAAMA,6BAA6BC,CAAAA,QAAS;IACjD,OAAO,WAAW,GAAEC,OAAMC,aAAa,CAACC,8CAA0B,EAAE;QAClEC,OAAOJ,MAAMK,SAAS;IACxB,GAAGL,MAAMM,QAAQ;AACnB,GACA,6CAA6C"}
@@ -1,175 +1,168 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.useMenuTrigger_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
9
- const useIsSubmenu_1 = /*#__PURE__*/require("../../utils/useIsSubmenu");
10
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
13
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
14
- const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
15
- /**
16
- * Create the state required to render MenuTrigger.
17
- * Clones the only child component and adds necessary event handling behaviours to open a popup menu
18
- *
19
- * @param props - props from this instance of MenuTrigger
20
- */
21
- const useMenuTrigger_unstable = props => {
22
- const {
23
- children,
24
- disableButtonEnhancement = false
25
- } = props;
26
- const triggerRef = menuContext_1.useMenuContext_unstable(context => context.triggerRef);
27
- const menuPopoverRef = menuContext_1.useMenuContext_unstable(context => context.menuPopoverRef);
28
- const setOpen = menuContext_1.useMenuContext_unstable(context => context.setOpen);
29
- const open = menuContext_1.useMenuContext_unstable(context => context.open);
30
- const triggerId = menuContext_1.useMenuContext_unstable(context => context.triggerId);
31
- const openOnHover = menuContext_1.useMenuContext_unstable(context => context.openOnHover);
32
- const openOnContext = menuContext_1.useMenuContext_unstable(context => context.openOnContext);
33
- const isSubmenu = useIsSubmenu_1.useIsSubmenu();
34
- const {
35
- findFirstFocusable
36
- } = react_tabster_1.useFocusFinders();
37
- const focusFirst = React.useCallback(() => {
38
- const firstFocusable = findFirstFocusable(menuPopoverRef.current);
39
- firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
40
- }, [findFirstFocusable, menuPopoverRef]);
41
- const openedWithKeyboardRef = React.useRef(false);
42
- const hasMouseMoved = React.useRef(false);
43
- const {
44
- dir
45
- } = react_shared_contexts_1.useFluent_unstable();
46
- const OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft;
47
- const child = react_utilities_1.getTriggerChild(children);
48
- const onContextMenu = event => {
49
- if (isTargetDisabled(event)) {
50
- return;
51
- }
52
- if (openOnContext) {
53
- event.preventDefault();
54
- setOpen(event, {
55
- open: true,
56
- keyboard: false,
57
- type: 'menuTriggerContextMenu',
58
- event
59
- });
60
- }
61
- };
62
- const onClick = event => {
63
- if (isTargetDisabled(event)) {
64
- return;
65
- }
66
- if (!openOnContext) {
67
- setOpen(event, {
68
- open: !open,
69
- keyboard: openedWithKeyboardRef.current,
70
- type: 'menuTriggerClick',
71
- event
72
- });
73
- openedWithKeyboardRef.current = false;
74
- }
75
- };
76
- const onKeyDown = event => {
77
- if (isTargetDisabled(event)) {
78
- return;
79
- }
80
- const key = event.key;
81
- if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === keyboard_keys_1.ArrowDown)) {
82
- setOpen(event, {
83
- open: true,
84
- keyboard: true,
85
- type: 'menuTriggerKeyDown',
86
- event
87
- });
88
- }
89
- if (key === keyboard_keys_1.Escape && !isSubmenu) {
90
- setOpen(event, {
91
- open: false,
92
- keyboard: true,
93
- type: 'menuTriggerKeyDown',
94
- event
95
- });
96
- }
97
- // if menu is already open, can't rely on effects to focus
98
- if (open && key === OpenArrowKey && isSubmenu) {
99
- focusFirst();
100
- }
101
- };
102
- const onMouseEnter = event => {
103
- if (isTargetDisabled(event)) {
104
- return;
105
- }
106
- if (openOnHover && hasMouseMoved.current) {
107
- setOpen(event, {
108
- open: true,
109
- keyboard: false,
110
- type: 'menuTriggerMouseEnter',
111
- event
112
- });
113
- }
114
- };
115
- // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
116
- // First time open the mouse using mousemove and then continue with mouseenter
117
- // Only use once to determine that the user is using the mouse since it is an expensive event to handle
118
- const onMouseMove = event => {
119
- if (isTargetDisabled(event)) {
120
- return;
121
- }
122
- if (openOnHover && !hasMouseMoved.current) {
123
- setOpen(event, {
124
- open: true,
125
- keyboard: false,
126
- type: 'menuTriggerMouseMove',
127
- event
128
- });
129
- hasMouseMoved.current = true;
130
- }
131
- };
132
- const onMouseLeave = event => {
133
- if (isTargetDisabled(event)) {
134
- return;
135
- }
136
- if (openOnHover) {
137
- setOpen(event, {
138
- open: false,
139
- keyboard: false,
140
- type: 'menuTriggerMouseLeave',
141
- event
142
- });
143
- }
144
- };
145
- const contextMenuProps = {
146
- id: triggerId,
147
- ...(child === null || child === void 0 ? void 0 : child.props),
148
- ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
149
- onMouseEnter: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),
150
- onMouseLeave: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),
151
- onContextMenu: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),
152
- onMouseMove: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))
153
- };
154
- const triggerChildProps = {
155
- 'aria-haspopup': 'menu',
156
- 'aria-expanded': !open && !isSubmenu ? undefined : open,
157
- ...contextMenuProps,
158
- onClick: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),
159
- onKeyDown: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))
160
- };
161
- const ariaButtonTriggerChildProps = react_aria_1.useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);
162
- return {
163
- isSubmenu,
164
- children: react_utilities_1.applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)
165
- };
166
- };
167
- exports.useMenuTrigger_unstable = useMenuTrigger_unstable;
168
- const isTargetDisabled = event => {
169
- const isDisabled = el => el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';
170
- if (react_utilities_1.isHTMLElement(event.target) && isDisabled(event.target)) {
171
- return true;
172
- }
173
- return react_utilities_1.isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);
5
+ Object.defineProperty(exports, "useMenuTrigger_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useMenuTrigger_unstable
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _menuContext = require("../../contexts/menuContext");
12
+ const _useIsSubmenu = require("../../utils/useIsSubmenu");
13
+ const _reactTabster = require("@fluentui/react-tabster");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const _keyboardKeys = require("@fluentui/keyboard-keys");
16
+ const _reactUtilities = require("@fluentui/react-utilities");
17
+ const _reactAria = require("@fluentui/react-aria");
18
+ const useMenuTrigger_unstable = (props)=>{
19
+ const { children , disableButtonEnhancement =false } = props;
20
+ const triggerRef = (0, _menuContext.useMenuContext_unstable)((context)=>context.triggerRef);
21
+ const menuPopoverRef = (0, _menuContext.useMenuContext_unstable)((context)=>context.menuPopoverRef);
22
+ const setOpen = (0, _menuContext.useMenuContext_unstable)((context)=>context.setOpen);
23
+ const open = (0, _menuContext.useMenuContext_unstable)((context)=>context.open);
24
+ const triggerId = (0, _menuContext.useMenuContext_unstable)((context)=>context.triggerId);
25
+ const openOnHover = (0, _menuContext.useMenuContext_unstable)((context)=>context.openOnHover);
26
+ const openOnContext = (0, _menuContext.useMenuContext_unstable)((context)=>context.openOnContext);
27
+ const isSubmenu = (0, _useIsSubmenu.useIsSubmenu)();
28
+ const { findFirstFocusable } = (0, _reactTabster.useFocusFinders)();
29
+ const focusFirst = _react.useCallback(()=>{
30
+ const firstFocusable = findFirstFocusable(menuPopoverRef.current);
31
+ firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
32
+ }, [
33
+ findFirstFocusable,
34
+ menuPopoverRef
35
+ ]);
36
+ const openedWithKeyboardRef = _react.useRef(false);
37
+ const hasMouseMoved = _react.useRef(false);
38
+ const { dir } = (0, _reactSharedContexts.useFluent_unstable)();
39
+ const OpenArrowKey = dir === 'ltr' ? _keyboardKeys.ArrowRight : _keyboardKeys.ArrowLeft;
40
+ const child = (0, _reactUtilities.getTriggerChild)(children);
41
+ const onContextMenu = (event)=>{
42
+ if (isTargetDisabled(event)) {
43
+ return;
44
+ }
45
+ if (openOnContext) {
46
+ event.preventDefault();
47
+ setOpen(event, {
48
+ open: true,
49
+ keyboard: false,
50
+ type: 'menuTriggerContextMenu',
51
+ event
52
+ });
53
+ }
54
+ };
55
+ const onClick = (event)=>{
56
+ if (isTargetDisabled(event)) {
57
+ return;
58
+ }
59
+ if (!openOnContext) {
60
+ setOpen(event, {
61
+ open: !open,
62
+ keyboard: openedWithKeyboardRef.current,
63
+ type: 'menuTriggerClick',
64
+ event
65
+ });
66
+ openedWithKeyboardRef.current = false;
67
+ }
68
+ };
69
+ const onKeyDown = (event)=>{
70
+ if (isTargetDisabled(event)) {
71
+ return;
72
+ }
73
+ const key = event.key;
74
+ if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === _keyboardKeys.ArrowDown)) {
75
+ setOpen(event, {
76
+ open: true,
77
+ keyboard: true,
78
+ type: 'menuTriggerKeyDown',
79
+ event
80
+ });
81
+ }
82
+ if (key === _keyboardKeys.Escape && !isSubmenu) {
83
+ setOpen(event, {
84
+ open: false,
85
+ keyboard: true,
86
+ type: 'menuTriggerKeyDown',
87
+ event
88
+ });
89
+ }
90
+ // if menu is already open, can't rely on effects to focus
91
+ if (open && key === OpenArrowKey && isSubmenu) {
92
+ focusFirst();
93
+ }
94
+ };
95
+ const onMouseEnter = (event)=>{
96
+ if (isTargetDisabled(event)) {
97
+ return;
98
+ }
99
+ if (openOnHover && hasMouseMoved.current) {
100
+ setOpen(event, {
101
+ open: true,
102
+ keyboard: false,
103
+ type: 'menuTriggerMouseEnter',
104
+ event
105
+ });
106
+ }
107
+ };
108
+ // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
109
+ // First time open the mouse using mousemove and then continue with mouseenter
110
+ // Only use once to determine that the user is using the mouse since it is an expensive event to handle
111
+ const onMouseMove = (event)=>{
112
+ if (isTargetDisabled(event)) {
113
+ return;
114
+ }
115
+ if (openOnHover && !hasMouseMoved.current) {
116
+ setOpen(event, {
117
+ open: true,
118
+ keyboard: false,
119
+ type: 'menuTriggerMouseMove',
120
+ event
121
+ });
122
+ hasMouseMoved.current = true;
123
+ }
124
+ };
125
+ const onMouseLeave = (event)=>{
126
+ if (isTargetDisabled(event)) {
127
+ return;
128
+ }
129
+ if (openOnHover) {
130
+ setOpen(event, {
131
+ open: false,
132
+ keyboard: false,
133
+ type: 'menuTriggerMouseLeave',
134
+ event
135
+ });
136
+ }
137
+ };
138
+ const contextMenuProps = {
139
+ id: triggerId,
140
+ ...child === null || child === void 0 ? void 0 : child.props,
141
+ ref: (0, _reactUtilities.useMergedRefs)(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
142
+ onMouseEnter: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),
143
+ onMouseLeave: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),
144
+ onContextMenu: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),
145
+ onMouseMove: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))
146
+ };
147
+ const triggerChildProps = {
148
+ 'aria-haspopup': 'menu',
149
+ 'aria-expanded': !open && !isSubmenu ? undefined : open,
150
+ ...contextMenuProps,
151
+ onClick: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),
152
+ onKeyDown: (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))
153
+ };
154
+ const ariaButtonTriggerChildProps = (0, _reactAria.useARIAButtonProps)((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);
155
+ return {
156
+ isSubmenu,
157
+ children: (0, _reactUtilities.applyTriggerPropsToChildren)(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)
158
+ };
174
159
  };
160
+ const isTargetDisabled = (event)=>{
161
+ const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';
162
+ if ((0, _reactUtilities.isHTMLElement)(event.target) && isDisabled(event.target)) {
163
+ return true;
164
+ }
165
+ return (0, _reactUtilities.isHTMLElement)(event.currentTarget) && isDisabled(event.currentTarget);
166
+ }; //# sourceMappingURL=useMenuTrigger.js.map
167
+
175
168
  //# sourceMappingURL=useMenuTrigger.js.map