@fluentui/react-menu 9.7.14 → 9.7.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. package/CHANGELOG.json +115 -1
  2. package/CHANGELOG.md +34 -2
  3. package/lib/Menu.js +0 -1
  4. package/lib/Menu.js.map +1 -1
  5. package/lib/MenuDivider.js +0 -1
  6. package/lib/MenuDivider.js.map +1 -1
  7. package/lib/MenuGroup.js +0 -1
  8. package/lib/MenuGroup.js.map +1 -1
  9. package/lib/MenuGroupHeader.js +0 -1
  10. package/lib/MenuGroupHeader.js.map +1 -1
  11. package/lib/MenuItem.js +0 -1
  12. package/lib/MenuItem.js.map +1 -1
  13. package/lib/MenuItemCheckbox.js +0 -1
  14. package/lib/MenuItemCheckbox.js.map +1 -1
  15. package/lib/MenuItemRadio.js +0 -1
  16. package/lib/MenuItemRadio.js.map +1 -1
  17. package/lib/MenuList.js +0 -1
  18. package/lib/MenuList.js.map +1 -1
  19. package/lib/MenuPopover.js +0 -1
  20. package/lib/MenuPopover.js.map +1 -1
  21. package/lib/MenuSplitGroup.js +0 -1
  22. package/lib/MenuSplitGroup.js.map +1 -1
  23. package/lib/MenuTrigger.js +0 -1
  24. package/lib/MenuTrigger.js.map +1 -1
  25. package/lib/components/Menu/Menu.js +4 -6
  26. package/lib/components/Menu/Menu.js.map +1 -1
  27. package/lib/components/Menu/Menu.types.js +0 -1
  28. package/lib/components/Menu/Menu.types.js.map +1 -1
  29. package/lib/components/Menu/index.js +0 -1
  30. package/lib/components/Menu/index.js.map +1 -1
  31. package/lib/components/Menu/renderMenu.js +4 -6
  32. package/lib/components/Menu/renderMenu.js.map +1 -1
  33. package/lib/components/Menu/useMenu.js +242 -236
  34. package/lib/components/Menu/useMenu.js.map +1 -1
  35. package/lib/components/Menu/useMenuContextValues.js +22 -39
  36. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  37. package/lib/components/MenuDivider/MenuDivider.js +5 -7
  38. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  39. package/lib/components/MenuDivider/MenuDivider.types.js +1 -2
  40. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  41. package/lib/components/MenuDivider/index.js +0 -1
  42. package/lib/components/MenuDivider/index.js.map +1 -1
  43. package/lib/components/MenuDivider/renderMenuDivider.js +4 -9
  44. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  45. package/lib/components/MenuDivider/useMenuDivider.js +12 -14
  46. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  47. package/lib/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -1
  48. package/lib/components/MenuGroup/MenuGroup.js +6 -8
  49. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  50. package/lib/components/MenuGroup/MenuGroup.types.js +1 -2
  51. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  52. package/lib/components/MenuGroup/index.js +0 -1
  53. package/lib/components/MenuGroup/index.js.map +1 -1
  54. package/lib/components/MenuGroup/renderMenuGroup.js +6 -11
  55. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  56. package/lib/components/MenuGroup/useMenuGroup.js +14 -16
  57. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  58. package/lib/components/MenuGroup/useMenuGroupContextValues.js +9 -10
  59. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  60. package/lib/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -1
  61. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +5 -7
  62. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  63. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js +1 -2
  64. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  65. package/lib/components/MenuGroupHeader/index.js +0 -1
  66. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  67. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +4 -9
  68. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  69. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +12 -16
  70. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  71. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -1
  72. package/lib/components/MenuItem/MenuItem.js +5 -7
  73. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  74. package/lib/components/MenuItem/MenuItem.types.js +1 -2
  75. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  76. package/lib/components/MenuItem/index.js +0 -1
  77. package/lib/components/MenuItem/index.js.map +1 -1
  78. package/lib/components/MenuItem/renderMenuItem.js +4 -9
  79. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  80. package/lib/components/MenuItem/useCharacterSearch.js +14 -17
  81. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  82. package/lib/components/MenuItem/useMenuItem.js +79 -88
  83. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  84. package/lib/components/MenuItem/useMenuItemStyles.styles.js +5 -5
  85. package/lib/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  86. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +5 -7
  87. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  88. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js +1 -2
  89. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  90. package/lib/components/MenuItemCheckbox/index.js +0 -1
  91. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  92. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +4 -9
  93. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  94. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +31 -36
  95. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  96. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -1
  97. package/lib/components/MenuItemRadio/MenuItemRadio.js +5 -7
  98. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  99. package/lib/components/MenuItemRadio/MenuItemRadio.types.js +1 -2
  100. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  101. package/lib/components/MenuItemRadio/index.js +0 -1
  102. package/lib/components/MenuItemRadio/index.js.map +1 -1
  103. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +4 -9
  104. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  105. package/lib/components/MenuItemRadio/useMenuItemRadio.js +29 -34
  106. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  107. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -1
  108. package/lib/components/MenuList/MenuList.js +6 -8
  109. package/lib/components/MenuList/MenuList.js.map +1 -1
  110. package/lib/components/MenuList/MenuList.types.js +0 -1
  111. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  112. package/lib/components/MenuList/index.js +0 -1
  113. package/lib/components/MenuList/index.js.map +1 -1
  114. package/lib/components/MenuList/renderMenuList.js +6 -11
  115. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  116. package/lib/components/MenuList/useMenuList.js +130 -126
  117. package/lib/components/MenuList/useMenuList.js.map +1 -1
  118. package/lib/components/MenuList/useMenuListContextValues.js +13 -21
  119. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  120. package/lib/components/MenuList/useMenuListStyles.styles.js.map +1 -1
  121. package/lib/components/MenuPopover/MenuPopover.js +5 -7
  122. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  123. package/lib/components/MenuPopover/MenuPopover.types.js +1 -2
  124. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  125. package/lib/components/MenuPopover/index.js +0 -1
  126. package/lib/components/MenuPopover/index.js.map +1 -1
  127. package/lib/components/MenuPopover/renderMenuPopover.js +9 -14
  128. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  129. package/lib/components/MenuPopover/useMenuPopover.js +87 -91
  130. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  131. package/lib/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -1
  132. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +5 -7
  133. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  134. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +1 -2
  135. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  136. package/lib/components/MenuSplitGroup/index.js +0 -1
  137. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  138. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +4 -9
  139. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  140. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +45 -47
  141. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  142. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -1
  143. package/lib/components/MenuTrigger/MenuTrigger.js +3 -5
  144. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  145. package/lib/components/MenuTrigger/MenuTrigger.types.js +0 -1
  146. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  147. package/lib/components/MenuTrigger/index.js +0 -1
  148. package/lib/components/MenuTrigger/index.js.map +1 -1
  149. package/lib/components/MenuTrigger/renderMenuTrigger.js +4 -6
  150. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  151. package/lib/components/MenuTrigger/useMenuTrigger.styles.js.map +1 -1
  152. package/lib/components/index.js +0 -1
  153. package/lib/components/index.js.map +1 -1
  154. package/lib/contexts/menuContext.js +21 -22
  155. package/lib/contexts/menuContext.js.map +1 -1
  156. package/lib/contexts/menuGroupContext.js +3 -4
  157. package/lib/contexts/menuGroupContext.js.map +1 -1
  158. package/lib/contexts/menuListContext.js +8 -9
  159. package/lib/contexts/menuListContext.js.map +1 -1
  160. package/lib/contexts/menuTriggerContext.js +2 -4
  161. package/lib/contexts/menuTriggerContext.js.map +1 -1
  162. package/lib/index.js +0 -1
  163. package/lib/index.js.map +1 -1
  164. package/lib/selectable/index.js +0 -1
  165. package/lib/selectable/index.js.map +1 -1
  166. package/lib/selectable/types.js +0 -1
  167. package/lib/selectable/types.js.map +1 -1
  168. package/lib/selectable/useCheckmarkStyles.styles.js.map +1 -1
  169. package/lib/utils/index.js +0 -1
  170. package/lib/utils/index.js.map +1 -1
  171. package/lib/utils/useIsSubmenu.js +4 -6
  172. package/lib/utils/useIsSubmenu.js.map +1 -1
  173. package/lib/utils/useOnMenuEnter.js +39 -44
  174. package/lib/utils/useOnMenuEnter.js.map +1 -1
  175. package/lib-commonjs/Menu.js +0 -3
  176. package/lib-commonjs/Menu.js.map +1 -1
  177. package/lib-commonjs/MenuDivider.js +0 -3
  178. package/lib-commonjs/MenuDivider.js.map +1 -1
  179. package/lib-commonjs/MenuGroup.js +0 -3
  180. package/lib-commonjs/MenuGroup.js.map +1 -1
  181. package/lib-commonjs/MenuGroupHeader.js +0 -3
  182. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  183. package/lib-commonjs/MenuItem.js +0 -3
  184. package/lib-commonjs/MenuItem.js.map +1 -1
  185. package/lib-commonjs/MenuItemCheckbox.js +0 -3
  186. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  187. package/lib-commonjs/MenuItemRadio.js +0 -3
  188. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  189. package/lib-commonjs/MenuList.js +0 -3
  190. package/lib-commonjs/MenuList.js.map +1 -1
  191. package/lib-commonjs/MenuPopover.js +0 -3
  192. package/lib-commonjs/MenuPopover.js.map +1 -1
  193. package/lib-commonjs/MenuSplitGroup.js +0 -3
  194. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  195. package/lib-commonjs/MenuTrigger.js +0 -3
  196. package/lib-commonjs/MenuTrigger.js.map +1 -1
  197. package/lib-commonjs/components/Menu/Menu.js +1 -3
  198. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  199. package/lib-commonjs/components/Menu/Menu.types.js +0 -3
  200. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  201. package/lib-commonjs/components/Menu/index.js +0 -3
  202. package/lib-commonjs/components/Menu/index.js.map +1 -1
  203. package/lib-commonjs/components/Menu/renderMenu.js +1 -3
  204. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  205. package/lib-commonjs/components/Menu/useMenu.js +2 -5
  206. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  207. package/lib-commonjs/components/Menu/useMenuContextValues.js +1 -3
  208. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  209. package/lib-commonjs/components/MenuDivider/MenuDivider.js +1 -3
  210. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  211. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js +0 -3
  212. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  213. package/lib-commonjs/components/MenuDivider/index.js +0 -3
  214. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  215. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +1 -3
  216. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  217. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +1 -3
  218. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  219. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js +0 -2
  220. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -1
  221. package/lib-commonjs/components/MenuGroup/MenuGroup.js +1 -3
  222. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  223. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js +0 -3
  224. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  225. package/lib-commonjs/components/MenuGroup/index.js +0 -3
  226. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  227. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +1 -3
  228. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  229. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +1 -3
  230. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  231. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +1 -3
  232. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  233. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js +0 -2
  234. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -1
  235. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +1 -3
  236. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  237. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js +0 -3
  238. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  239. package/lib-commonjs/components/MenuGroupHeader/index.js +0 -3
  240. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  241. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +1 -3
  242. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  243. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +1 -3
  244. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  245. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js +0 -2
  246. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -1
  247. package/lib-commonjs/components/MenuItem/MenuItem.js +1 -3
  248. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  249. package/lib-commonjs/components/MenuItem/MenuItem.types.js +0 -3
  250. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  251. package/lib-commonjs/components/MenuItem/index.js +0 -3
  252. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  253. package/lib-commonjs/components/MenuItem/renderMenuItem.js +1 -3
  254. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  255. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +1 -3
  256. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  257. package/lib-commonjs/components/MenuItem/useMenuItem.js +3 -5
  258. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  259. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js +12 -14
  260. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  261. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +1 -3
  262. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  263. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js +0 -3
  264. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  265. package/lib-commonjs/components/MenuItemCheckbox/index.js +0 -3
  266. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  267. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +1 -3
  268. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  269. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +1 -3
  270. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  271. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js +0 -2
  272. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -1
  273. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +1 -3
  274. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  275. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js +0 -3
  276. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  277. package/lib-commonjs/components/MenuItemRadio/index.js +0 -3
  278. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  279. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +1 -3
  280. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  281. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +1 -3
  282. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  283. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js +0 -2
  284. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -1
  285. package/lib-commonjs/components/MenuList/MenuList.js +1 -3
  286. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  287. package/lib-commonjs/components/MenuList/MenuList.types.js +0 -3
  288. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  289. package/lib-commonjs/components/MenuList/index.js +0 -3
  290. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  291. package/lib-commonjs/components/MenuList/renderMenuList.js +1 -3
  292. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  293. package/lib-commonjs/components/MenuList/useMenuList.js +1 -3
  294. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  295. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +1 -3
  296. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  297. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js +0 -2
  298. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js.map +1 -1
  299. package/lib-commonjs/components/MenuPopover/MenuPopover.js +1 -3
  300. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  301. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js +0 -3
  302. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  303. package/lib-commonjs/components/MenuPopover/index.js +0 -3
  304. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  305. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +1 -3
  306. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  307. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +1 -3
  308. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  309. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js +0 -2
  310. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -1
  311. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +1 -3
  312. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  313. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +0 -3
  314. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  315. package/lib-commonjs/components/MenuSplitGroup/index.js +0 -3
  316. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  317. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +1 -3
  318. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  319. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +1 -3
  320. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  321. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js +0 -2
  322. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -1
  323. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +1 -3
  324. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  325. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js +0 -3
  326. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  327. package/lib-commonjs/components/MenuTrigger/index.js +0 -3
  328. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  329. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +1 -3
  330. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  331. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.styles.js +0 -2
  332. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.styles.js.map +1 -1
  333. package/lib-commonjs/components/index.js +0 -3
  334. package/lib-commonjs/components/index.js.map +1 -1
  335. package/lib-commonjs/contexts/menuContext.js +2 -4
  336. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  337. package/lib-commonjs/contexts/menuGroupContext.js +1 -3
  338. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  339. package/lib-commonjs/contexts/menuListContext.js +2 -4
  340. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  341. package/lib-commonjs/contexts/menuTriggerContext.js +1 -3
  342. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  343. package/lib-commonjs/index.js +0 -3
  344. package/lib-commonjs/index.js.map +1 -1
  345. package/lib-commonjs/selectable/index.js +0 -3
  346. package/lib-commonjs/selectable/index.js.map +1 -1
  347. package/lib-commonjs/selectable/types.js +0 -3
  348. package/lib-commonjs/selectable/types.js.map +1 -1
  349. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js +0 -2
  350. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -1
  351. package/lib-commonjs/utils/index.js +0 -3
  352. package/lib-commonjs/utils/index.js.map +1 -1
  353. package/lib-commonjs/utils/useIsSubmenu.js +1 -3
  354. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  355. package/lib-commonjs/utils/useOnMenuEnter.js +1 -3
  356. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  357. package/package.json +10 -10
@@ -13,96 +13,92 @@ import { useIsSubmenu } from '../../utils/useIsSubmenu';
13
13
  *
14
14
  * @param props - props from this instance of MenuPopover
15
15
  * @param ref - reference to root HTMLElement of MenuPopover
16
- */
17
- export const useMenuPopover_unstable = (props, ref) => {
18
- const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);
19
- const setOpen = useMenuContext_unstable(context => context.setOpen);
20
- const open = useMenuContext_unstable(context => context.open);
21
- const openOnHover = useMenuContext_unstable(context => context.openOnHover);
22
- const isSubmenu = useIsSubmenu();
23
- const canDispatchCustomEventRef = React.useRef(true);
24
- const throttleDispatchTimerRef = React.useRef(0);
25
- const {
26
- dir
27
- } = useFluent();
28
- const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;
29
- // use DOM listener since react events propagate up the react tree
30
- // no need to do `contains` logic as menus are all positioned in different portals
31
- const mouseOverListenerCallbackRef = React.useCallback(node => {
32
- if (node) {
33
- // Dispatches the custom menu mouse enter event with throttling
34
- // Needs to trigger on mouseover to support keyboard + mouse together
35
- // i.e. keyboard opens submenus while cursor is still on the parent
36
- node.addEventListener('mouseover', e => {
37
- if (canDispatchCustomEventRef.current) {
38
- canDispatchCustomEventRef.current = false;
39
- dispatchMenuEnterEvent(popoverRef.current, e);
40
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
- // @ts-ignore #16889 Node setTimeout type leaking
42
- throttleDispatchTimerRef.current = setTimeout(() => canDispatchCustomEventRef.current = true, 250);
16
+ */ export const useMenuPopover_unstable = (props, ref)=>{
17
+ const popoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);
18
+ const setOpen = useMenuContext_unstable((context)=>context.setOpen);
19
+ const open = useMenuContext_unstable((context)=>context.open);
20
+ const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);
21
+ const isSubmenu = useIsSubmenu();
22
+ const canDispatchCustomEventRef = React.useRef(true);
23
+ const throttleDispatchTimerRef = React.useRef(0);
24
+ const { dir } = useFluent();
25
+ const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;
26
+ // use DOM listener since react events propagate up the react tree
27
+ // no need to do `contains` logic as menus are all positioned in different portals
28
+ const mouseOverListenerCallbackRef = React.useCallback((node)=>{
29
+ if (node) {
30
+ // Dispatches the custom menu mouse enter event with throttling
31
+ // Needs to trigger on mouseover to support keyboard + mouse together
32
+ // i.e. keyboard opens submenus while cursor is still on the parent
33
+ node.addEventListener('mouseover', (e)=>{
34
+ if (canDispatchCustomEventRef.current) {
35
+ canDispatchCustomEventRef.current = false;
36
+ dispatchMenuEnterEvent(popoverRef.current, e);
37
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
+ // @ts-ignore #16889 Node setTimeout type leaking
39
+ throttleDispatchTimerRef.current = setTimeout(()=>canDispatchCustomEventRef.current = true, 250);
40
+ }
41
+ });
43
42
  }
44
- });
45
- }
46
- }, [popoverRef, throttleDispatchTimerRef]);
47
- React.useEffect(() => {
48
- () => clearTimeout(throttleDispatchTimerRef.current);
49
- }, []);
50
- var _useMenuContext_unstable;
51
- const inline = (_useMenuContext_unstable = useMenuContext_unstable(context => context.inline)) !== null && _useMenuContext_unstable !== void 0 ? _useMenuContext_unstable : false;
52
- const mountNode = useMenuContext_unstable(context => context.mountNode);
53
- const rootProps = getNativeElementProps('div', {
54
- role: 'presentation',
55
- ...props,
56
- ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef)
57
- });
58
- const {
59
- onMouseEnter: onMouseEnterOriginal,
60
- onKeyDown: onKeyDownOriginal
61
- } = rootProps;
62
- rootProps.onMouseEnter = useEventCallback(event => {
63
- if (openOnHover) {
64
- setOpen(event, {
65
- open: true,
66
- keyboard: false,
67
- type: 'menuPopoverMouseEnter',
68
- event
69
- });
70
- }
71
- onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(event);
72
- });
73
- rootProps.onKeyDown = useEventCallback(event => {
74
- const key = event.key;
75
- if (key === Escape || isSubmenu && key === CloseArrowKey) {
76
- var _popoverRef_current;
77
- if (open && ((_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.contains(event.target))) {
78
- setOpen(event, {
79
- open: false,
80
- keyboard: true,
81
- type: 'menuPopoverKeyDown',
82
- event
83
- });
84
- // stop propagation to avoid conflicting with other elements that listen for `Escape`
85
- // e,g: Dialog, Popover and Tooltip
86
- event.stopPropagation();
87
- }
88
- }
89
- if (key === Tab) {
90
- setOpen(event, {
91
- open: false,
92
- keyboard: true,
93
- type: 'menuPopoverKeyDown',
94
- event
95
- });
96
- }
97
- onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(event);
98
- });
99
- return {
100
- inline,
101
- mountNode,
102
- components: {
103
- root: 'div'
104
- },
105
- root: rootProps
106
- };
43
+ }, [
44
+ popoverRef,
45
+ throttleDispatchTimerRef
46
+ ]);
47
+ React.useEffect(()=>{
48
+ ()=>clearTimeout(throttleDispatchTimerRef.current);
49
+ }, []);
50
+ var _useMenuContext_unstable;
51
+ const inline = (_useMenuContext_unstable = useMenuContext_unstable((context)=>context.inline)) !== null && _useMenuContext_unstable !== void 0 ? _useMenuContext_unstable : false;
52
+ const mountNode = useMenuContext_unstable((context)=>context.mountNode);
53
+ const rootProps = getNativeElementProps('div', {
54
+ role: 'presentation',
55
+ ...props,
56
+ ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef)
57
+ });
58
+ const { onMouseEnter: onMouseEnterOriginal , onKeyDown: onKeyDownOriginal } = rootProps;
59
+ rootProps.onMouseEnter = useEventCallback((event)=>{
60
+ if (openOnHover) {
61
+ setOpen(event, {
62
+ open: true,
63
+ keyboard: false,
64
+ type: 'menuPopoverMouseEnter',
65
+ event
66
+ });
67
+ }
68
+ onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(event);
69
+ });
70
+ rootProps.onKeyDown = useEventCallback((event)=>{
71
+ const key = event.key;
72
+ if (key === Escape || isSubmenu && key === CloseArrowKey) {
73
+ var _popoverRef_current;
74
+ if (open && ((_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.contains(event.target))) {
75
+ setOpen(event, {
76
+ open: false,
77
+ keyboard: true,
78
+ type: 'menuPopoverKeyDown',
79
+ event
80
+ });
81
+ // stop propagation to avoid conflicting with other elements that listen for `Escape`
82
+ // e,g: Dialog, Popover and Tooltip
83
+ event.stopPropagation();
84
+ }
85
+ }
86
+ if (key === Tab) {
87
+ setOpen(event, {
88
+ open: false,
89
+ keyboard: true,
90
+ type: 'menuPopoverKeyDown',
91
+ event
92
+ });
93
+ }
94
+ onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(event);
95
+ });
96
+ return {
97
+ inline,
98
+ mountNode,
99
+ components: {
100
+ root: 'div'
101
+ },
102
+ root: rootProps
103
+ };
107
104
  };
108
- //# sourceMappingURL=useMenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ArrowLeft","Tab","ArrowRight","Escape","getNativeElementProps","useEventCallback","useMergedRefs","useMenuContext_unstable","dispatchMenuEnterEvent","useFluent_unstable","useFluent","useIsSubmenu","useMenuPopover_unstable","props","ref","popoverRef","context","menuPopoverRef","setOpen","open","openOnHover","isSubmenu","canDispatchCustomEventRef","useRef","throttleDispatchTimerRef","dir","CloseArrowKey","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","setTimeout","useEffect","clearTimeout","_useMenuContext_unstable","inline","mountNode","rootProps","role","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","event","keyboard","type","key","_popoverRef_current","contains","target","stopPropagation","components","root"],"sources":["../../../src/components/MenuPopover/useMenuPopover.ts"],"sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { dispatchMenuEnterEvent } from '../../utils/index';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n\n/**\n * Create the state required to render MenuPopover.\n *\n * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,\n * before being passed to renderMenuPopover_unstable.\n *\n * @param props - props from this instance of MenuPopover\n * @param ref - reference to root HTMLElement of MenuPopover\n */\nexport const useMenuPopover_unstable = (props: MenuPopoverProps, ref: React.Ref<HTMLElement>): MenuPopoverState => {\n const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const isSubmenu = useIsSubmenu();\n const canDispatchCustomEventRef = React.useRef(true);\n const throttleDispatchTimerRef = React.useRef(0);\n\n const { dir } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\n\n // use DOM listener since react events propagate up the react tree\n // no need to do `contains` logic as menus are all positioned in different portals\n const mouseOverListenerCallbackRef = React.useCallback(\n (node: HTMLElement) => {\n if (node) {\n // Dispatches the custom menu mouse enter event with throttling\n // Needs to trigger on mouseover to support keyboard + mouse together\n // i.e. keyboard opens submenus while cursor is still on the parent\n node.addEventListener('mouseover', e => {\n if (canDispatchCustomEventRef.current) {\n canDispatchCustomEventRef.current = false;\n dispatchMenuEnterEvent(popoverRef.current as HTMLElement, e);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore #16889 Node setTimeout type leaking\n throttleDispatchTimerRef.current = setTimeout(() => (canDispatchCustomEventRef.current = true), 250);\n }\n });\n }\n },\n [popoverRef, throttleDispatchTimerRef],\n );\n\n React.useEffect(() => {\n () => clearTimeout(throttleDispatchTimerRef.current);\n }, []);\n\n const inline = useMenuContext_unstable(context => context.inline) ?? false;\n const mountNode = useMenuContext_unstable(context => context.mountNode);\n\n const rootProps = getNativeElementProps('div', {\n role: 'presentation',\n ...props,\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef),\n });\n\n const { onMouseEnter: onMouseEnterOriginal, onKeyDown: onKeyDownOriginal } = rootProps;\n\n rootProps.onMouseEnter = useEventCallback((event: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(event, { open: true, keyboard: false, type: 'menuPopoverMouseEnter', event });\n }\n\n onMouseEnterOriginal?.(event);\n });\n\n rootProps.onKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLElement>) => {\n const key = event.key;\n\n if (key === Escape || (isSubmenu && key === CloseArrowKey)) {\n if (open && popoverRef.current?.contains(event.target as HTMLElement)) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover and Tooltip\n event.stopPropagation();\n }\n }\n\n if (key === Tab) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n }\n\n onKeyDownOriginal?.(event);\n });\n\n return {\n inline,\n mountNode,\n components: {\n root: 'div',\n },\n root: rootProps,\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,GAAG,EAAEC,UAAU,EAAEC,MAAM,QAAQ;AACnD,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ;AAEvE,SAASC,uBAAuB,QAAQ;AACxC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,YAAY,QAAQ;AAE7B;;;;;;;;;AASA,OAAO,MAAMC,uBAAA,GAA0BA,CAACC,KAAA,EAAyBC,GAAA,KAAkD;EACjH,MAAMC,UAAA,GAAaR,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQC,cAAc;EAC5E,MAAMC,OAAA,GAAUX,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQE,OAAO;EAClE,MAAMC,IAAA,GAAOZ,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQG,IAAI;EAC5D,MAAMC,WAAA,GAAcb,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQI,WAAW;EAC1E,MAAMC,SAAA,GAAYV,YAAA;EAClB,MAAMW,yBAAA,GAA4BvB,KAAA,CAAMwB,MAAM,CAAC,IAAI;EACnD,MAAMC,wBAAA,GAA2BzB,KAAA,CAAMwB,MAAM,CAAC;EAE9C,MAAM;IAAEE;EAAG,CAAE,GAAGf,SAAA;EAChB,MAAMgB,aAAA,GAAgBD,GAAA,KAAQ,QAAQzB,SAAA,GAAYE,UAAU;EAE5D;EACA;EACA,MAAMyB,4BAAA,GAA+B5B,KAAA,CAAM6B,WAAW,CACnDC,IAAA,IAAsB;IACrB,IAAIA,IAAA,EAAM;MACR;MACA;MACA;MACAA,IAAA,CAAKC,gBAAgB,CAAC,aAAaC,CAAA,IAAK;QACtC,IAAIT,yBAAA,CAA0BU,OAAO,EAAE;UACrCV,yBAAA,CAA0BU,OAAO,GAAG,KAAK;UACzCxB,sBAAA,CAAuBO,UAAA,CAAWiB,OAAO,EAAiBD,CAAA;UAC1D;UACA;UACAP,wBAAA,CAAyBQ,OAAO,GAAGC,UAAA,CAAW,MAAOX,yBAAA,CAA0BU,OAAO,GAAG,IAAI,EAAG;QAClG;MACF;IACF;EACF,GACA,CAACjB,UAAA,EAAYS,wBAAA,CAAyB;EAGxCzB,KAAA,CAAMmC,SAAS,CAAC,MAAM;IACpB,MAAMC,YAAA,CAAaX,wBAAA,CAAyBQ,OAAO;EACrD,GAAG,EAAE;MAEUI,wBAAA;EAAf,MAAMC,MAAA,GAAS,CAAAD,wBAAA,GAAA7B,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQqB,MAAM,eAAjDD,wBAAA,cAAAA,wBAAA,GAAsD,KAAK;EAC1E,MAAME,SAAA,GAAY/B,uBAAA,CAAwBS,OAAA,IAAWA,OAAA,CAAQsB,SAAS;EAEtE,MAAMC,SAAA,GAAYnC,qBAAA,CAAsB,OAAO;IAC7CoC,IAAA,EAAM;IACN,GAAG3B,KAAK;IACRC,GAAA,EAAKR,aAAA,CAAcQ,GAAA,EAAKC,UAAA,EAAYY,4BAAA;EACtC;EAEA,MAAM;IAAEc,YAAA,EAAcC,oBAAA;IAAsBC,SAAA,EAAWC;EAAiB,CAAE,GAAGL,SAAA;EAE7EA,SAAA,CAAUE,YAAY,GAAGpC,gBAAA,CAAkBwC,KAAA,IAAyC;IAClF,IAAIzB,WAAA,EAAa;MACfF,OAAA,CAAQ2B,KAAA,EAAO;QAAE1B,IAAA,EAAM,IAAI;QAAE2B,QAAA,EAAU,KAAK;QAAEC,IAAA,EAAM;QAAyBF;MAAM;IACrF;IAEAH,oBAAA,aAAAA,oBAAA,uBAAAA,oBAAA,CAAuBG,KAAA;EACzB;EAEAN,SAAA,CAAUI,SAAS,GAAGtC,gBAAA,CAAkBwC,KAAA,IAA4C;IAClF,MAAMG,GAAA,GAAMH,KAAA,CAAMG,GAAG;IAErB,IAAIA,GAAA,KAAQ7C,MAAA,IAAWkB,SAAA,IAAa2B,GAAA,KAAQtB,aAAA,EAAgB;UAC9CuB,mBAAA;MAAZ,IAAI9B,IAAA,KAAQ,CAAA8B,mBAAA,GAAAlC,UAAA,CAAWiB,OAAO,cAAlBiB,mBAAA,uBAAAA,mBAAA,CAAoBC,QAAA,CAASL,KAAA,CAAMM,MAAM,IAAkB;QACrEjC,OAAA,CAAQ2B,KAAA,EAAO;UAAE1B,IAAA,EAAM,KAAK;UAAE2B,QAAA,EAAU,IAAI;UAAEC,IAAA,EAAM;UAAsBF;QAAM;QAChF;QACA;QACAA,KAAA,CAAMO,eAAe;MACvB;IACF;IAEA,IAAIJ,GAAA,KAAQ/C,GAAA,EAAK;MACfiB,OAAA,CAAQ2B,KAAA,EAAO;QAAE1B,IAAA,EAAM,KAAK;QAAE2B,QAAA,EAAU,IAAI;QAAEC,IAAA,EAAM;QAAsBF;MAAM;IAClF;IAEAD,iBAAA,aAAAA,iBAAA,uBAAAA,iBAAA,CAAoBC,KAAA;EACtB;EAEA,OAAO;IACLR,MAAA;IACAC,SAAA;IACAe,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAA,IAAA,EAAMf;EACR;AACF"}
1
+ {"version":3,"sources":["useMenuPopover.ts"],"sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { dispatchMenuEnterEvent } from '../../utils/index';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n\n/**\n * Create the state required to render MenuPopover.\n *\n * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,\n * before being passed to renderMenuPopover_unstable.\n *\n * @param props - props from this instance of MenuPopover\n * @param ref - reference to root HTMLElement of MenuPopover\n */\nexport const useMenuPopover_unstable = (props: MenuPopoverProps, ref: React.Ref<HTMLElement>): MenuPopoverState => {\n const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const isSubmenu = useIsSubmenu();\n const canDispatchCustomEventRef = React.useRef(true);\n const throttleDispatchTimerRef = React.useRef(0);\n\n const { dir } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\n\n // use DOM listener since react events propagate up the react tree\n // no need to do `contains` logic as menus are all positioned in different portals\n const mouseOverListenerCallbackRef = React.useCallback(\n (node: HTMLElement) => {\n if (node) {\n // Dispatches the custom menu mouse enter event with throttling\n // Needs to trigger on mouseover to support keyboard + mouse together\n // i.e. keyboard opens submenus while cursor is still on the parent\n node.addEventListener('mouseover', e => {\n if (canDispatchCustomEventRef.current) {\n canDispatchCustomEventRef.current = false;\n dispatchMenuEnterEvent(popoverRef.current as HTMLElement, e);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore #16889 Node setTimeout type leaking\n throttleDispatchTimerRef.current = setTimeout(() => (canDispatchCustomEventRef.current = true), 250);\n }\n });\n }\n },\n [popoverRef, throttleDispatchTimerRef],\n );\n\n React.useEffect(() => {\n () => clearTimeout(throttleDispatchTimerRef.current);\n }, []);\n\n const inline = useMenuContext_unstable(context => context.inline) ?? false;\n const mountNode = useMenuContext_unstable(context => context.mountNode);\n\n const rootProps = getNativeElementProps('div', {\n role: 'presentation',\n ...props,\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef),\n });\n\n const { onMouseEnter: onMouseEnterOriginal, onKeyDown: onKeyDownOriginal } = rootProps;\n\n rootProps.onMouseEnter = useEventCallback((event: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(event, { open: true, keyboard: false, type: 'menuPopoverMouseEnter', event });\n }\n\n onMouseEnterOriginal?.(event);\n });\n\n rootProps.onKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLElement>) => {\n const key = event.key;\n\n if (key === Escape || (isSubmenu && key === CloseArrowKey)) {\n if (open && popoverRef.current?.contains(event.target as HTMLElement)) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover and Tooltip\n event.stopPropagation();\n }\n }\n\n if (key === Tab) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n }\n\n onKeyDownOriginal?.(event);\n });\n\n return {\n inline,\n mountNode,\n components: {\n root: 'div',\n },\n root: rootProps,\n };\n};\n"],"names":["React","ArrowLeft","Tab","ArrowRight","Escape","getNativeElementProps","useEventCallback","useMergedRefs","useMenuContext_unstable","dispatchMenuEnterEvent","useFluent_unstable","useFluent","useIsSubmenu","useMenuPopover_unstable","props","ref","popoverRef","context","menuPopoverRef","setOpen","open","openOnHover","isSubmenu","canDispatchCustomEventRef","useRef","throttleDispatchTimerRef","dir","CloseArrowKey","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","setTimeout","useEffect","clearTimeout","inline","mountNode","rootProps","role","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","event","keyboard","type","key","contains","target","stopPropagation","components","root"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"names":["shorthands","mergeClasses","__styles","tokens","typographyStyles","menuPopoverClassNames","root","useStyles","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","De3pzq","sj55zd","Bf4jedk","B2u0y6b","a9b677","E5pizo","z8tnut","z189sj","Byoj8tv","uwmqm3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useMenuPopoverStyles_unstable","state","styles","className"],"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.styles.ts"],"sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots> = {\n root: 'fui-MenuPopover',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n minWidth: '128px',\n maxWidth: '300px',\n width: 'max-content',\n boxShadow: `${tokens.shadow16}`,\n ...shorthands.padding('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles_unstable = (state: MenuPopoverState): MenuPopoverState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAAC,QAAA,QAAoB;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,qBAAA,GAA0D;EACrEC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYL,QAAA;EAAAI,IAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAalB;AAEA;;;AAGA,OAAO,MAAMC,6BAAA,GAAiCC,KAAA,IAA8C;EAC1F,MAAMC,MAAA,GAASlC,SAAA;EACfiC,KAAA,CAAMlC,IAAI,CAACoC,SAAS,GAAGzC,YAAA,CAAaI,qBAAA,CAAsBC,IAAI,EAAEmC,MAAA,CAAOnC,IAAI,EAAEkC,KAAA,CAAMlC,IAAI,CAACoC,SAAS;EACjG,OAAOF,KAAA;AACT"}
1
+ {"version":3,"names":["shorthands","mergeClasses","__styles","tokens","typographyStyles","menuPopoverClassNames","root","useStyles","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","De3pzq","sj55zd","Bf4jedk","B2u0y6b","a9b677","E5pizo","z8tnut","z189sj","Byoj8tv","uwmqm3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useMenuPopoverStyles_unstable","state","styles","className"],"sources":["useMenuPopoverStyles.styles.js"],"sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const menuPopoverClassNames = {\n root: 'fui-MenuPopover'\n};\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n minWidth: '128px',\n maxWidth: '300px',\n width: 'max-content',\n boxShadow: `${tokens.shadow16}`,\n ...shorthands.padding('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1\n }\n});\n/**\n * Apply styling to the Menu slots based on the state\n */ export const useMenuPopoverStyles_unstable = (state)=>{\n const styles = useStyles();\n state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAAC,QAAA,QAAoB,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,gBAAGL,QAAA;EAAAI,IAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAajB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,MAAMC,MAAM,GAAGlC,SAAS,CAAC,CAAC;EAC1BiC,KAAK,CAAClC,IAAI,CAACoC,SAAS,GAAGzC,YAAY,CAACI,qBAAqB,CAACC,IAAI,EAAEmC,MAAM,CAACnC,IAAI,EAAEkC,KAAK,CAAClC,IAAI,CAACoC,SAAS,CAAC;EAClG,OAAOF,KAAK;AAChB,CAAC"}
@@ -5,12 +5,10 @@ import { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styl
5
5
  import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
6
6
  /**
7
7
  * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
8
- */
9
- export const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = useMenuSplitGroup_unstable(props, ref);
11
- useMenuSplitGroupStyles_unstable(state);
12
- useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);
13
- return renderMenuSplitGroup_unstable(state);
8
+ */ export const MenuSplitGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{
9
+ const state = useMenuSplitGroup_unstable(props, ref);
10
+ useMenuSplitGroupStyles_unstable(state);
11
+ useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);
12
+ return renderMenuSplitGroup_unstable(state);
14
13
  });
15
14
  MenuSplitGroup.displayName = 'MenuSplitGroup';
16
- //# sourceMappingURL=MenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","MenuSplitGroup","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuSplitGroup/MenuSplitGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styles';\nimport type { MenuSplitGroupProps } from './MenuSplitGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps> = React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n\n useMenuSplitGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n\n return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,gCAAgC,QAAQ;AAGjD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,cAAA,gBAA2DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvG,MAAMC,KAAA,GAAQR,0BAAA,CAA2BM,KAAA,EAAOC,GAAA;EAEhDL,gCAAA,CAAiCM,KAAA;EAEjCL,2BAAA,CAA4B,oCAAoCK,KAAA;EAEhE,OAAOP,6BAAA,CAA8BO,KAAA;AACvC;AAEAJ,cAAA,CAAeK,WAAW,GAAG"}
1
+ {"version":3,"sources":["MenuSplitGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styles';\nimport type { MenuSplitGroupProps } from './MenuSplitGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps> = React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n\n useMenuSplitGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n\n return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","MenuSplitGroup","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvG,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,8BAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=MenuSplitGroup.types.js.map
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/MenuSplitGroup/MenuSplitGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuSplitGroupSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * MenuSplitGroup Props\n */\nexport type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots>;\n\n/**\n * State used in rendering MenuSplitGroup\n */\nexport type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots>;\n"],"mappings":"AAAA"}
1
+ {"version":3,"sources":["MenuSplitGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuSplitGroupSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * MenuSplitGroup Props\n */\nexport type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots>;\n\n/**\n * State used in rendering MenuSplitGroup\n */\nexport type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots>;\n"],"names":[],"mappings":"AAAA,WAcsE"}
@@ -3,4 +3,3 @@ export * from './MenuSplitGroup.types';
3
3
  export * from './renderMenuSplitGroup';
4
4
  export * from './useMenuSplitGroup';
5
5
  export * from './useMenuSplitGroupStyles.styles';
6
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/MenuSplitGroup/index.ts"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC"}
@@ -1,13 +1,8 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
2
2
  import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of MenuSplitGroup
5
- */
6
- export const renderMenuSplitGroup_unstable = state => {
7
- const {
8
- slots,
9
- slotProps
10
- } = getSlotsNext(state);
11
- return /*#__PURE__*/createElement(slots.root, slotProps.root);
5
+ */ export const renderMenuSplitGroup_unstable = (state)=>{
6
+ const { slots , slotProps } = getSlotsNext(state);
7
+ return /*#__PURE__*/ createElement(slots.root, slotProps.root);
12
8
  };
13
- //# sourceMappingURL=renderMenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createElement","getSlotsNext","renderMenuSplitGroup_unstable","state","slots","slotProps","root"],"sources":["../../../src/components/MenuSplitGroup/renderMenuSplitGroup.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { MenuSplitGroupState, MenuSplitGroupSlots } from './MenuSplitGroup.types';\n\n/**\n * Render the final JSX of MenuSplitGroup\n */\nexport const renderMenuSplitGroup_unstable = (state: MenuSplitGroupState) => {\n const { slots, slotProps } = getSlotsNext<MenuSplitGroupSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAC9B,SAASC,YAAY,QAAQ;AAG7B;;;AAGA,OAAO,MAAMC,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAAkCE,KAAA;EAE/D,oBAAOH,aAZT,CAYUI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI;AACvC"}
1
+ {"version":3,"sources":["renderMenuSplitGroup.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { MenuSplitGroupState, MenuSplitGroupSlots } from './MenuSplitGroup.types';\n\n/**\n * Render the final JSX of MenuSplitGroup\n */\nexport const renderMenuSplitGroup_unstable = (state: MenuSplitGroupState) => {\n const { slots, slotProps } = getSlotsNext<MenuSplitGroupSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"names":["createElement","getSlotsNext","renderMenuSplitGroup_unstable","state","slots","slotProps","root"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,YAAY,QAAQ,4BAA4B;AAGzD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC,QAA+B;IAC3E,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGJ,aAAkCE;IAE/D,qBAAO,AAZT,cAYUC,MAAME,IAAI,EAAKD,UAAUC,IAAI;AACvC,EAAE"}
@@ -11,51 +11,49 @@ import { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';
11
11
  *
12
12
  * @param props - props from this instance of MenuSplitGroup
13
13
  * @param ref - reference to root HTMLElement of MenuSplitGroup
14
- */
15
- export const useMenuSplitGroup_unstable = (props, ref) => {
16
- const innerRef = React.useRef();
17
- const {
18
- dir,
19
- targetDocument
20
- } = useFluent();
21
- const nextArrowKey = getRTLSafeKey(ArrowRight, dir);
22
- const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);
23
- const {
24
- findNextFocusable,
25
- findPrevFocusable
26
- } = useFocusFinders();
27
- const onKeyDown = React.useCallback(e => {
28
- var _innerRef_current;
29
- const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
30
- if (!activeElement) {
31
- return;
32
- }
33
- if (!((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement))) {
34
- return;
35
- }
36
- if (e.key === nextArrowKey) {
37
- const next = findNextFocusable(activeElement, {
38
- container: innerRef.current
39
- });
40
- next === null || next === void 0 ? void 0 : next.focus();
41
- }
42
- if (e.key === prevArrowKey) {
43
- const prev = findPrevFocusable(activeElement, {
44
- container: innerRef.current
45
- });
46
- prev === null || prev === void 0 ? void 0 : prev.focus();
47
- }
48
- }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);
49
- return {
50
- components: {
51
- root: 'div'
52
- },
53
- root: getNativeElementProps('div', {
54
- role: 'group',
55
- ref: useMergedRefs(ref, innerRef),
56
- onKeyDown,
57
- ...props
58
- })
59
- };
14
+ */ export const useMenuSplitGroup_unstable = (props, ref)=>{
15
+ const innerRef = React.useRef();
16
+ const { dir , targetDocument } = useFluent();
17
+ const nextArrowKey = getRTLSafeKey(ArrowRight, dir);
18
+ const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);
19
+ const { findNextFocusable , findPrevFocusable } = useFocusFinders();
20
+ const onKeyDown = React.useCallback((e)=>{
21
+ var _innerRef_current;
22
+ const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
23
+ if (!activeElement) {
24
+ return;
25
+ }
26
+ if (!((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement))) {
27
+ return;
28
+ }
29
+ if (e.key === nextArrowKey) {
30
+ const next = findNextFocusable(activeElement, {
31
+ container: innerRef.current
32
+ });
33
+ next === null || next === void 0 ? void 0 : next.focus();
34
+ }
35
+ if (e.key === prevArrowKey) {
36
+ const prev = findPrevFocusable(activeElement, {
37
+ container: innerRef.current
38
+ });
39
+ prev === null || prev === void 0 ? void 0 : prev.focus();
40
+ }
41
+ }, [
42
+ findNextFocusable,
43
+ findPrevFocusable,
44
+ targetDocument,
45
+ nextArrowKey,
46
+ prevArrowKey
47
+ ]);
48
+ return {
49
+ components: {
50
+ root: 'div'
51
+ },
52
+ root: getNativeElementProps('div', {
53
+ role: 'group',
54
+ ref: useMergedRefs(ref, innerRef),
55
+ onKeyDown,
56
+ ...props
57
+ })
58
+ };
60
59
  };
61
- //# sourceMappingURL=useMenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getNativeElementProps","getRTLSafeKey","useMergedRefs","useFocusFinders","useFluent_unstable","useFluent","ArrowRight","ArrowLeft","useMenuSplitGroup_unstable","props","ref","innerRef","useRef","dir","targetDocument","nextArrowKey","prevArrowKey","findNextFocusable","findPrevFocusable","onKeyDown","useCallback","e","_innerRef_current","activeElement","current","contains","key","next","container","focus","prev","components","root","role"],"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, getRTLSafeKey, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { MenuSplitGroupProps, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render MenuSplitGroup.\n *\n * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,\n * before being passed to renderMenuSplitGroup_unstable.\n *\n * @param props - props from this instance of MenuSplitGroup\n * @param ref - reference to root HTMLElement of MenuSplitGroup\n */\nexport const useMenuSplitGroup_unstable = (\n props: MenuSplitGroupProps,\n ref: React.Ref<HTMLElement>,\n): MenuSplitGroupState => {\n const innerRef = React.useRef<HTMLElement>();\n const { dir, targetDocument } = useFluent();\n\n const nextArrowKey = getRTLSafeKey(ArrowRight, dir);\n const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);\n\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const onKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n const activeElement = targetDocument?.activeElement;\n if (!activeElement) {\n return;\n }\n\n if (!innerRef.current?.contains(activeElement)) {\n return;\n }\n\n if (e.key === nextArrowKey) {\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n next?.focus();\n }\n\n if (e.key === prevArrowKey) {\n const prev = findPrevFocusable(activeElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n },\n [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey],\n );\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n role: 'group',\n ref: useMergedRefs(ref, innerRef),\n onKeyDown,\n ...props,\n }),\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACpE,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAEhD,SAASC,UAAU,EAAEC,SAAS,QAAQ;AAEtC;;;;;;;;;AASA,OAAO,MAAMC,0BAAA,GAA6BA,CACxCC,KAAA,EACAC,GAAA,KACwB;EACxB,MAAMC,QAAA,GAAWZ,KAAA,CAAMa,MAAM;EAC7B,MAAM;IAAEC,GAAA;IAAKC;EAAc,CAAE,GAAGT,SAAA;EAEhC,MAAMU,YAAA,GAAed,aAAA,CAAcK,UAAA,EAAYO,GAAA;EAC/C,MAAMG,YAAA,GAAef,aAAA,CAAcM,SAAA,EAAWM,GAAA;EAE9C,MAAM;IAAEI,iBAAA;IAAmBC;EAAiB,CAAE,GAAGf,eAAA;EAEjD,MAAMgB,SAAA,GAAYpB,KAAA,CAAMqB,WAAW,CAChCC,CAAA,IAAwC;QAMlCC,iBAAA;IALL,MAAMC,aAAA,GAAgBT,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBS,aAAa;IACnD,IAAI,CAACA,aAAA,EAAe;MAClB;IACF;IAEA,IAAI,EAAC,CAAAD,iBAAA,GAAAX,QAAA,CAASa,OAAO,cAAhBF,iBAAA,uBAAAA,iBAAA,CAAkBG,QAAA,CAASF,aAAA,IAAgB;MAC9C;IACF;IAEA,IAAIF,CAAA,CAAEK,GAAG,KAAKX,YAAA,EAAc;MAC1B,MAAMY,IAAA,GAAOV,iBAAA,CAAkBM,aAAA,EAA8B;QAAEK,SAAA,EAAWjB,QAAA,CAASa;MAAQ;MAC3FG,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAME,KAAK;IACb;IAEA,IAAIR,CAAA,CAAEK,GAAG,KAAKV,YAAA,EAAc;MAC1B,MAAMc,IAAA,GAAOZ,iBAAA,CAAkBK,aAAA,EAA8B;QAAEK,SAAA,EAAWjB,QAAA,CAASa;MAAQ;MAC3FM,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAMD,KAAK;IACb;EACF,GACA,CAACZ,iBAAA,EAAmBC,iBAAA,EAAmBJ,cAAA,EAAgBC,YAAA,EAAcC,YAAA,CAAa;EAGpF,OAAO;IACLe,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAA,IAAA,EAAMhC,qBAAA,CAAsB,OAAO;MACjCiC,IAAA,EAAM;MACNvB,GAAA,EAAKR,aAAA,CAAcQ,GAAA,EAAKC,QAAA;MACxBQ,SAAA;MACA,GAAGV;IACL;EACF;AACF"}
1
+ {"version":3,"sources":["useMenuSplitGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, getRTLSafeKey, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { MenuSplitGroupProps, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render MenuSplitGroup.\n *\n * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,\n * before being passed to renderMenuSplitGroup_unstable.\n *\n * @param props - props from this instance of MenuSplitGroup\n * @param ref - reference to root HTMLElement of MenuSplitGroup\n */\nexport const useMenuSplitGroup_unstable = (\n props: MenuSplitGroupProps,\n ref: React.Ref<HTMLElement>,\n): MenuSplitGroupState => {\n const innerRef = React.useRef<HTMLElement>();\n const { dir, targetDocument } = useFluent();\n\n const nextArrowKey = getRTLSafeKey(ArrowRight, dir);\n const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);\n\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const onKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n const activeElement = targetDocument?.activeElement;\n if (!activeElement) {\n return;\n }\n\n if (!innerRef.current?.contains(activeElement)) {\n return;\n }\n\n if (e.key === nextArrowKey) {\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n next?.focus();\n }\n\n if (e.key === prevArrowKey) {\n const prev = findPrevFocusable(activeElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n },\n [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey],\n );\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n role: 'group',\n ref: useMergedRefs(ref, innerRef),\n onKeyDown,\n ...props,\n }),\n };\n};\n"],"names":["React","getNativeElementProps","getRTLSafeKey","useMergedRefs","useFocusFinders","useFluent_unstable","useFluent","ArrowRight","ArrowLeft","useMenuSplitGroup_unstable","props","ref","innerRef","useRef","dir","targetDocument","nextArrowKey","prevArrowKey","findNextFocusable","findPrevFocusable","onKeyDown","useCallback","e","activeElement","current","contains","key","next","container","focus","prev","components","root","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,4BAA4B;AAChG,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAASC,UAAU,EAAEC,SAAS,QAAQ,0BAA0B;AAEhE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC,MACwB;IACxB,MAAMC,WAAWZ,MAAMa,MAAM;IAC7B,MAAM,EAAEC,IAAG,EAAEC,eAAc,EAAE,GAAGT;IAEhC,MAAMU,eAAed,cAAcK,YAAYO;IAC/C,MAAMG,eAAef,cAAcM,WAAWM;IAE9C,MAAM,EAAEI,kBAAiB,EAAEC,kBAAiB,EAAE,GAAGf;IAEjD,MAAMgB,YAAYpB,MAAMqB,WAAW,CACjC,CAACC,IAAwC;YAMlCV;QALL,MAAMW,gBAAgBR,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBQ,aAAa;QACnD,IAAI,CAACA,eAAe;YAClB;QACF,CAAC;QAED,IAAI,EAACX,CAAAA,oBAAAA,SAASY,OAAO,cAAhBZ,+BAAAA,KAAAA,IAAAA,kBAAkBa,SAASF,iBAAgB;YAC9C;QACF,CAAC;QAED,IAAID,EAAEI,GAAG,KAAKV,cAAc;YAC1B,MAAMW,OAAOT,kBAAkBK,eAA8B;gBAAEK,WAAWhB,SAASY,OAAO;YAAC;YAC3FG,iBAAAA,kBAAAA,KAAAA,IAAAA,KAAME,KAAK;QACb,CAAC;QAED,IAAIP,EAAEI,GAAG,KAAKT,cAAc;YAC1B,MAAMa,OAAOX,kBAAkBI,eAA8B;gBAAEK,WAAWhB,SAASY,OAAO;YAAC;YAC3FM,iBAAAA,kBAAAA,KAAAA,IAAAA,KAAMD,KAAK;QACb,CAAC;IACH,GACA;QAACX;QAAmBC;QAAmBJ;QAAgBC;QAAcC;KAAa;IAGpF,OAAO;QACLc,YAAY;YACVC,MAAM;QACR;QACAA,MAAM/B,sBAAsB,OAAO;YACjCgC,MAAM;YACNtB,KAAKR,cAAcQ,KAAKC;YACxBQ;YACA,GAAGV,KAAK;QACV;IACF;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tokens","menuItemClassNames","menuSplitGroupClassNames","root","useStyles","mc9l5x","u7v6m2","Bo1wru1","Bhkyaub","J9ixe0","rj29m3","B2knx3v","Bl7aesu","e82tai","Bnkcs84","d","useMenuSplitGroupStyles_unstable","state","styles","className"],"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';\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,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AACzC,SAASC,MAAM,QAAQ;AACvB,SAASC,kBAAkB,QAAQ;AAInC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AACA;;;AAGA,MAAMC,SAAA,gBAAYN,QAAA;EAAAK,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAmBlB;AAEA;;;AAGA,OAAO,MAAMC,gCAAA,GAAoCC,KAAA,IAAoD;EACnG,MAAMC,MAAA,GAASd,SAAA;EACfa,KAAA,CAAMd,IAAI,CAACgB,SAAS,GAAGpB,YAAA,CAAaG,wBAAA,CAAyBC,IAAI,EAAEe,MAAA,CAAOf,IAAI,EAAEc,KAAA,CAAMd,IAAI,CAACgB,SAAS;EACpG,OAAOF,KAAA;AACT"}
1
+ {"version":3,"names":["__styles","mergeClasses","tokens","menuItemClassNames","menuSplitGroupClassNames","root","useStyles","mc9l5x","u7v6m2","Bo1wru1","Bhkyaub","J9ixe0","rj29m3","B2knx3v","Bl7aesu","e82tai","Bnkcs84","d","useMenuSplitGroupStyles_unstable","state","styles","className"],"sources":["useMenuSplitGroupStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuSplitGroupClassNames = {\n root: 'fui-MenuSplitGroup'\n};\n/**\n * Styles for the root slot\n */ const 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 * Apply styling to the MenuSplitGroup slots based on the state\n */ export 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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGN,QAAA;EAAAK,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAmBrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,gCAAgC,GAAIC,KAAK,IAAG;EACzD,MAAMC,MAAM,GAAGd,SAAS,CAAC,CAAC;EAC1Ba,KAAK,CAACd,IAAI,CAACgB,SAAS,GAAGpB,YAAY,CAACG,wBAAwB,CAACC,IAAI,EAAEe,MAAM,CAACf,IAAI,EAAEc,KAAK,CAACd,IAAI,CAACgB,SAAS,CAAC;EACrG,OAAOF,KAAK;AAChB,CAAC"}
@@ -4,12 +4,10 @@ import { renderMenuTrigger_unstable } from './renderMenuTrigger';
4
4
  /**
5
5
  * Wraps a trigger element as an only child
6
6
  * and adds the necessary event handling to open a popup menu
7
- */
8
- export const MenuTrigger = props => {
9
- const state = useMenuTrigger_unstable(props);
10
- return renderMenuTrigger_unstable(state);
7
+ */ export const MenuTrigger = (props)=>{
8
+ const state = useMenuTrigger_unstable(props);
9
+ return renderMenuTrigger_unstable(state);
11
10
  };
12
11
  MenuTrigger.displayName = 'MenuTrigger';
13
12
  // type casting here is required to ensure internal type FluentTriggerComponent is not leaked
14
13
  MenuTrigger.isFluentTriggerComponent = true;
15
- //# sourceMappingURL=MenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMenuTrigger_unstable","renderMenuTrigger_unstable","MenuTrigger","props","state","displayName","isFluentTriggerComponent"],"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger.styles';\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":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAI3C;;;;AAIA,OAAO,MAAMC,WAAA,GAA0CC,KAAA,IAAS;EAC9D,MAAMC,KAAA,GAAQJ,uBAAA,CAAwBG,KAAA;EAEtC,OAAOF,0BAAA,CAA2BG,KAAA;AACpC;AAEAF,WAAA,CAAYG,WAAW,GAAG;AAC1B;AACCH,WAAA,CAAuCI,wBAAwB,GAAG,IAAI"}
1
+ {"version":3,"sources":["MenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger.styles';\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"],"names":["React","useMenuTrigger_unstable","renderMenuTrigger_unstable","MenuTrigger","props","state","displayName","isFluentTriggerComponent"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,0BAA0B,QAAQ,sBAAsB;AAIjE;;;CAGC,GACD,OAAO,MAAMC,cAA0CC,CAAAA,QAAS;IAC9D,MAAMC,QAAQJ,wBAAwBG;IAEtC,OAAOF,2BAA2BG;AACpC,EAAE;AAEFF,YAAYG,WAAW,GAAG;AAC1B,6FAA6F;AAC5FH,YAAuCI,wBAAwB,GAAG,IAAI"}
@@ -1,2 +1 @@
1
1
  import * as React from 'react';
2
- //# sourceMappingURL=MenuTrigger.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React"],"sources":["../../../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":"AAEA,YAAYA,KAAA,MAAW"}
1
+ {"version":3,"sources":["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"],"names":["React"],"mappings":"AAEA,YAAYA,WAAW,QAAQ"}
@@ -2,4 +2,3 @@ export * from './MenuTrigger';
2
2
  export * from './MenuTrigger.types';
3
3
  export * from './renderMenuTrigger';
4
4
  export * from './useMenuTrigger.styles';
5
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/MenuTrigger/index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger.styles';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,0BAA0B"}
@@ -4,10 +4,8 @@ import { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';
4
4
  * Render the final JSX of MenuTrigger
5
5
  *
6
6
  * Only renders children
7
- */
8
- export const renderMenuTrigger_unstable = state => {
9
- return /*#__PURE__*/React.createElement(MenuTriggerContextProvider, {
10
- value: state.isSubmenu
11
- }, state.children);
7
+ */ export const renderMenuTrigger_unstable = (state)=>{
8
+ return /*#__PURE__*/ React.createElement(MenuTriggerContextProvider, {
9
+ value: state.isSubmenu
10
+ }, state.children);
12
11
  };
13
- //# sourceMappingURL=renderMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","MenuTriggerContextProvider","renderMenuTrigger_unstable","state","createElement","value","isSubmenu","children"],"sources":["../../../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,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAG3C;;;;;AAKA,OAAO,MAAMC,0BAAA,GAA8BC,KAAA,IAA4B;EACrE,oBAAOH,KAAA,CAAAI,aAAA,CAACH,0BAAA;IAA2BI,KAAA,EAAOF,KAAA,CAAMG;KAAYH,KAAA,CAAMI,QAAQ;AAC5E"}
1
+ {"version":3,"sources":["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"],"names":["React","MenuTriggerContextProvider","renderMenuTrigger_unstable","state","value","isSubmenu","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,oCAAoC;AAG/E;;;;CAIC,GACD,OAAO,MAAMC,6BAA6B,CAACC,QAA4B;IACrE,qBAAO,oBAACF;QAA2BG,OAAOD,MAAME,SAAS;OAAGF,MAAMG,QAAQ;AAC5E,EAAE"}