@fluentui/react-menu 9.7.3 → 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 +139 -1
  3. package/CHANGELOG.md +38 -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 +1 @@
1
- {"version":3,"names":["React","require","keyboard_keys_1","react_utilities_1","menuContext_1","index_1","react_shared_contexts_1","useIsSubmenu_1","useMenuPopover_unstable","props","ref","popoverRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","openOnHover","isSubmenu","useIsSubmenu","canDispatchCustomEventRef","useRef","throttleDispatchTimerRef","dir","useFluent_unstable","CloseArrowKey","ArrowLeft","ArrowRight","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","dispatchMenuEnterEvent","setTimeout","useEffect","clearTimeout","inline","_a","mountNode","rootProps","getNativeElementProps","role","useMergedRefs","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","useEventCallback","event","keyboard","type","key","Escape","contains","target","stopPropagation","Tab","components","root","exports"],"sources":["../src/packages/react-components/react-menu/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,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,eAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AAEA,MAAAG,aAAA,gBAAAH,OAAA;AACA,MAAAI,OAAA,gBAAAJ,OAAA;AACA,MAAAK,uBAAA,gBAAAL,OAAA;AACA,MAAAM,cAAA,gBAAAN,OAAA;AAEA;;;;;;;;;AASO,MAAMO,uBA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,KAAKnD,eAAA,CAAAoD,MAAM,IAAKpC,SAAS,IAAImC,GAAG,KAAK5B,aAAc,EAAE;MAC1D,IAAIT,IAAI,KAAI,CAAAuB,EAAA,GAAA5B,UAAU,CAACsB,OAAO,cAAAM,EAAA,uBAAAA,EAAA,CAAEgB,QAAQ,CAACL,KAAK,CAACM,MAAqB,CAAC,GAAE;QACrEzC,OAAO,CAACmC,KAAK,EAAE;UAAElC,IAAI,EAAE,KAAK;UAAEmC,QAAQ,EAAE,IAAI;UAAEC,IAAI,EAAE,oBAAoB;UAAEF;QAAK,CAAE,CAAC;QAClF;QACA;QACAA,KAAK,CAACO,eAAe,EAAE;;;IAI3B,IAAIJ,GAAG,KAAKnD,eAAA,CAAAwD,GAAG,EAAE;MACf3C,OAAO,CAACmC,KAAK,EAAE;QAAElC,IAAI,EAAE,KAAK;QAAEmC,QAAQ,EAAE,IAAI;QAAEC,IAAI,EAAE,oBAAoB;QAAEF;MAAK,CAAE,CAAC;;IAGpFF,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAGE,KAAK,CAAC;EAC5B,CAAC,CAAC;EAEF,OAAO;IACLZ,MAAM;IACNE,SAAS;IACTmB,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAEnB;GACP;AACH,CAAC;AApFYoB,OAAA,CAAArD,uBAAuB,GAAAA,uBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuPopover/useMenuPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\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 * 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, ref) => {\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 const {\n dir\n } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\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(node => {\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, 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 }, [popoverRef, throttleDispatchTimerRef]);\n React.useEffect(() => {\n () => clearTimeout(throttleDispatchTimerRef.current);\n }, []);\n var _useMenuContext_unstable;\n const inline = (_useMenuContext_unstable = useMenuContext_unstable(context => context.inline)) !== null && _useMenuContext_unstable !== void 0 ? _useMenuContext_unstable : false;\n const mountNode = useMenuContext_unstable(context => context.mountNode);\n const rootProps = getNativeElementProps('div', {\n role: 'presentation',\n ...props,\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef)\n });\n const {\n onMouseEnter: onMouseEnterOriginal,\n onKeyDown: onKeyDownOriginal\n } = rootProps;\n rootProps.onMouseEnter = useEventCallback(event => {\n if (openOnHover) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuPopoverMouseEnter',\n event\n });\n }\n onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(event);\n });\n rootProps.onKeyDown = useEventCallback(event => {\n const key = event.key;\n if (key === Escape || isSubmenu && key === CloseArrowKey) {\n var _popoverRef_current;\n if (open && ((_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.contains(event.target))) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuPopoverKeyDown',\n event\n });\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 if (key === Tab) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuPopoverKeyDown',\n event\n });\n }\n onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(event);\n });\n return {\n inline,\n mountNode,\n components: {\n root: 'div'\n },\n root: rootProps\n };\n};\n//# sourceMappingURL=useMenuPopover.js.map"],"names":["useMenuPopover_unstable","props","ref","popoverRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","openOnHover","isSubmenu","useIsSubmenu","canDispatchCustomEventRef","React","useRef","throttleDispatchTimerRef","dir","useFluent","CloseArrowKey","ArrowLeft","ArrowRight","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","dispatchMenuEnterEvent","setTimeout","useEffect","clearTimeout","_useMenuContext_unstable","inline","mountNode","rootProps","getNativeElementProps","role","useMergedRefs","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","useEventCallback","event","keyboard","type","key","Escape","_popoverRef_current","contains","target","stopPropagation","Tab","components","root"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;8BAC4B;gCACoB;6BAC/B;uBACD;qCACS;8BACnB;AAUtB,MAAMA,0BAA0B,CAACC,OAAOC,MAAQ;IACr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,CAAC;QACDF,sBAAsB,IAAI,IAAIA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBE,MAAM;IAChG;IACA,OAAO;QACLX;QACAC;QACAoB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMpB;IACR;AACF,GACA,0CAA0C"}
@@ -1,57 +1,128 @@
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
+ menuPopoverClassNames: ()=>menuPopoverClassNames,
13
+ useMenuPopoverStyles_unstable: ()=>useMenuPopoverStyles_unstable
5
14
  });
6
- exports.useMenuPopoverStyles_unstable = exports.menuPopoverClassNames = void 0;
7
- const react_1 = /*#__PURE__*/require("@griffel/react");
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
- exports.menuPopoverClassNames = {
10
- root: 'fui-MenuPopover'
15
+ const _react = require("@griffel/react");
16
+ const menuPopoverClassNames = {
17
+ root: 'fui-MenuPopover'
11
18
  };
12
- const useStyles = /*#__PURE__*/react_1.__styles({
13
- root: {
14
- Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
15
- Beyfa6y: ["f16jpd5f", "f1aa9q02"],
16
- B7oj6ja: ["f1jar5jt", "fyu767a"],
17
- Btl43ni: ["fyu767a", "f1jar5jt"],
18
- De3pzq: "fxugw4r",
19
- sj55zd: "f19n0e5",
20
- Bf4jedk: "fkqu4gx",
21
- B2u0y6b: "f1kaai3v",
22
- a9b677: "f1ahpp82",
23
- E5pizo: "f1hg901r",
24
- z8tnut: "f10ra9hq",
25
- z189sj: ["f8wuabp", "fycuoez"],
26
- Byoj8tv: "f1y2xyjm",
27
- uwmqm3: ["fycuoez", "f8wuabp"],
28
- B4j52fo: "f5ogflp",
29
- Bekrc4i: ["f1hqa2wf", "finvdd3"],
30
- Bn0qgzm: "f1f09k3d",
31
- ibv6hh: ["finvdd3", "f1hqa2wf"],
32
- icvyot: "fzkkow9",
33
- vrafjx: ["fcdblym", "fjik90z"],
34
- oivjwe: "fg706s2",
35
- wvpqe5: ["fjik90z", "fcdblym"],
36
- g2u3we: "fghlq4f",
37
- h3c5rm: ["f1gn591s", "fjscplz"],
38
- B9xav0g: "fb073pr",
39
- zhjwy3: ["fjscplz", "f1gn591s"],
40
- Bahqtrf: "fk6fouc",
41
- Be2twd7: "fkhj508",
42
- Bhrd7zp: "figsok6",
43
- Bg96gwp: "f1i3iumi"
44
- }
19
+ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
20
+ root: {
21
+ Bbmb7ep: [
22
+ "f1aa9q02",
23
+ "f16jpd5f"
24
+ ],
25
+ Beyfa6y: [
26
+ "f16jpd5f",
27
+ "f1aa9q02"
28
+ ],
29
+ B7oj6ja: [
30
+ "f1jar5jt",
31
+ "fyu767a"
32
+ ],
33
+ Btl43ni: [
34
+ "fyu767a",
35
+ "f1jar5jt"
36
+ ],
37
+ De3pzq: "fxugw4r",
38
+ sj55zd: "f19n0e5",
39
+ Bf4jedk: "fkqu4gx",
40
+ B2u0y6b: "f1kaai3v",
41
+ a9b677: "f1ahpp82",
42
+ E5pizo: "f1hg901r",
43
+ z8tnut: "f10ra9hq",
44
+ z189sj: [
45
+ "f8wuabp",
46
+ "fycuoez"
47
+ ],
48
+ Byoj8tv: "f1y2xyjm",
49
+ uwmqm3: [
50
+ "fycuoez",
51
+ "f8wuabp"
52
+ ],
53
+ B4j52fo: "f5ogflp",
54
+ Bekrc4i: [
55
+ "f1hqa2wf",
56
+ "finvdd3"
57
+ ],
58
+ Bn0qgzm: "f1f09k3d",
59
+ ibv6hh: [
60
+ "finvdd3",
61
+ "f1hqa2wf"
62
+ ],
63
+ icvyot: "fzkkow9",
64
+ vrafjx: [
65
+ "fcdblym",
66
+ "fjik90z"
67
+ ],
68
+ oivjwe: "fg706s2",
69
+ wvpqe5: [
70
+ "fjik90z",
71
+ "fcdblym"
72
+ ],
73
+ g2u3we: "fghlq4f",
74
+ h3c5rm: [
75
+ "f1gn591s",
76
+ "fjscplz"
77
+ ],
78
+ B9xav0g: "fb073pr",
79
+ zhjwy3: [
80
+ "fjscplz",
81
+ "f1gn591s"
82
+ ],
83
+ Bahqtrf: "fk6fouc",
84
+ Be2twd7: "fkhj508",
85
+ Bhrd7zp: "figsok6",
86
+ Bg96gwp: "f1i3iumi"
87
+ }
45
88
  }, {
46
- d: [".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fkqu4gx{min-width:128px;}", ".f1kaai3v{max-width:300px;}", ".f1ahpp82{width:-webkit-max-content;width:-moz-max-content;width:max-content;}", ".f1hg901r{box-shadow:var(--shadow16);}", ".f10ra9hq{padding-top:4px;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1y2xyjm{padding-bottom:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
89
+ d: [
90
+ ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
91
+ ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
92
+ ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}",
93
+ ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}",
94
+ ".fxugw4r{background-color:var(--colorNeutralBackground1);}",
95
+ ".f19n0e5{color:var(--colorNeutralForeground1);}",
96
+ ".fkqu4gx{min-width:128px;}",
97
+ ".f1kaai3v{max-width:300px;}",
98
+ ".f1ahpp82{width:-webkit-max-content;width:-moz-max-content;width:max-content;}",
99
+ ".f1hg901r{box-shadow:var(--shadow16);}",
100
+ ".f10ra9hq{padding-top:4px;}",
101
+ ".f8wuabp{padding-right:4px;}",
102
+ ".fycuoez{padding-left:4px;}",
103
+ ".f1y2xyjm{padding-bottom:4px;}",
104
+ ".f5ogflp{border-top-width:1px;}",
105
+ ".f1hqa2wf{border-right-width:1px;}",
106
+ ".finvdd3{border-left-width:1px;}",
107
+ ".f1f09k3d{border-bottom-width:1px;}",
108
+ ".fzkkow9{border-top-style:solid;}",
109
+ ".fcdblym{border-right-style:solid;}",
110
+ ".fjik90z{border-left-style:solid;}",
111
+ ".fg706s2{border-bottom-style:solid;}",
112
+ ".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
113
+ ".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
114
+ ".fjscplz{border-left-color:var(--colorTransparentStroke);}",
115
+ ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}",
116
+ ".fk6fouc{font-family:var(--fontFamilyBase);}",
117
+ ".fkhj508{font-size:var(--fontSizeBase300);}",
118
+ ".figsok6{font-weight:var(--fontWeightRegular);}",
119
+ ".f1i3iumi{line-height:var(--lineHeightBase300);}"
120
+ ]
47
121
  });
48
- /**
49
- * Apply styling to the Menu slots based on the state
50
- */
51
- const useMenuPopoverStyles_unstable = state => {
52
- const styles = useStyles();
53
- state.root.className = react_1.mergeClasses(exports.menuPopoverClassNames.root, styles.root, state.root.className);
54
- return state;
55
- };
56
- exports.useMenuPopoverStyles_unstable = useMenuPopoverStyles_unstable;
122
+ const useMenuPopoverStyles_unstable = (state)=>{
123
+ const styles = useStyles();
124
+ state.root.className = (0, _react.mergeClasses)(menuPopoverClassNames.root, styles.root, state.root.className);
125
+ return state;
126
+ }; //# sourceMappingURL=useMenuPopoverStyles.js.map
127
+
57
128
  //# sourceMappingURL=useMenuPopoverStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_1","require","react_theme_1","exports","menuPopoverClassNames","root","useStyles","__styles","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","mergeClasses"],"sources":["../src/packages/react-components/react-menu/src/components/MenuPopover/useMenuPopoverStyles.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,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AAIaE,OAAA,CAAAC,qBAAqB,GAAqC;EACrEC,IAAI,EAAE;CACP;AAED,MAAMC,SAAS,gBAAGN,OAAA,CAAAO,QAAU;EAAAF,IAAA;IAAAG,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,EAa1B;AAEF;;;AAGO,MAAMC,6BAA6B,GAAIC,KAAuB,IAAsB;EACzF,MAAMC,MAAM,GAAGnC,SAAS,EAAE;EAC1BkC,KAAK,CAACnC,IAAI,CAACqC,SAAS,GAAG1C,OAAA,CAAA2C,YAAY,CAACxC,OAAA,CAAAC,qBAAqB,CAACC,IAAI,EAAEoC,MAAM,CAACpC,IAAI,EAAEmC,KAAK,CAACnC,IAAI,CAACqC,SAAS,CAAC;EAClG,OAAOF,KAAK;AACd,CAAC;AAJYrC,OAAA,CAAAoC,6BAA6B,GAAAA,6BAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuPopover/useMenuPopoverStyles.js"],"sourcesContent":["import { shorthands, mergeClasses, __styles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const menuPopoverClassNames = {\n root: 'fui-MenuPopover'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n Bbmb7ep: [\"f1aa9q02\", \"f16jpd5f\"],\n Beyfa6y: [\"f16jpd5f\", \"f1aa9q02\"],\n B7oj6ja: [\"f1jar5jt\", \"fyu767a\"],\n Btl43ni: [\"fyu767a\", \"f1jar5jt\"],\n De3pzq: \"fxugw4r\",\n sj55zd: \"f19n0e5\",\n Bf4jedk: \"fkqu4gx\",\n B2u0y6b: \"f1kaai3v\",\n a9b677: \"f1ahpp82\",\n E5pizo: \"f1hg901r\",\n z8tnut: \"f10ra9hq\",\n z189sj: [\"f8wuabp\", \"fycuoez\"],\n Byoj8tv: \"f1y2xyjm\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"],\n B4j52fo: \"f5ogflp\",\n Bekrc4i: [\"f1hqa2wf\", \"finvdd3\"],\n Bn0qgzm: \"f1f09k3d\",\n ibv6hh: [\"finvdd3\", \"f1hqa2wf\"],\n icvyot: \"fzkkow9\",\n vrafjx: [\"fcdblym\", \"fjik90z\"],\n oivjwe: \"fg706s2\",\n wvpqe5: [\"fjik90z\", \"fcdblym\"],\n g2u3we: \"fghlq4f\",\n h3c5rm: [\"f1gn591s\", \"fjscplz\"],\n B9xav0g: \"fb073pr\",\n zhjwy3: [\"fjscplz\", \"f1gn591s\"],\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n }\n}, {\n d: [\".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}\", \".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".fkqu4gx{min-width:128px;}\", \".f1kaai3v{max-width:300px;}\", \".f1ahpp82{width:-webkit-max-content;width:-moz-max-content;width:max-content;}\", \".f1hg901r{box-shadow:var(--shadow16);}\", \".f10ra9hq{padding-top:4px;}\", \".f8wuabp{padding-right:4px;}\", \".fycuoez{padding-left:4px;}\", \".f1y2xyjm{padding-bottom:4px;}\", \".f5ogflp{border-top-width:1px;}\", \".f1hqa2wf{border-right-width:1px;}\", \".finvdd3{border-left-width:1px;}\", \".f1f09k3d{border-bottom-width:1px;}\", \".fzkkow9{border-top-style:solid;}\", \".fcdblym{border-right-style:solid;}\", \".fjik90z{border-left-style:solid;}\", \".fg706s2{border-bottom-style:solid;}\", \".fghlq4f{border-top-color:var(--colorTransparentStroke);}\", \".f1gn591s{border-right-color:var(--colorTransparentStroke);}\", \".fjscplz{border-left-color:var(--colorTransparentStroke);}\", \".fb073pr{border-bottom-color:var(--colorTransparentStroke);}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\"]\n});\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport 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//# sourceMappingURL=useMenuPopoverStyles.js.map"],"names":["menuPopoverClassNames","useMenuPopoverStyles_unstable","root","useStyles","__styles","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","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;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C,SAAS;IACjG,OAAOF;AACT,GACA,gDAAgD"}
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "MenuSplitGroup", {
6
+ enumerable: true,
7
+ get: ()=>MenuSplitGroup
5
8
  });
6
- exports.MenuSplitGroup = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const useMenuSplitGroup_1 = /*#__PURE__*/require("./useMenuSplitGroup");
9
- const renderMenuSplitGroup_1 = /*#__PURE__*/require("./renderMenuSplitGroup");
10
- const useMenuSplitGroupStyles_1 = /*#__PURE__*/require("./useMenuSplitGroupStyles");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- /**
13
- * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
14
- */
15
- exports.MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = useMenuSplitGroup_1.useMenuSplitGroup_unstable(props, ref);
17
- useMenuSplitGroupStyles_1.useMenuSplitGroupStyles_unstable(state);
18
- const {
19
- useMenuSplitGroupStyles_unstable: useCustomStyles
20
- } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
- useCustomStyles(state);
22
- return renderMenuSplitGroup_1.renderMenuSplitGroup_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useMenuSplitGroup = require("./useMenuSplitGroup");
12
+ const _renderMenuSplitGroup = require("./renderMenuSplitGroup");
13
+ const _useMenuSplitGroupStyles = require("./useMenuSplitGroupStyles");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const MenuSplitGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
+ const state = (0, _useMenuSplitGroup.useMenuSplitGroup_unstable)(props, ref);
17
+ (0, _useMenuSplitGroupStyles.useMenuSplitGroupStyles_unstable)(state);
18
+ const { useMenuSplitGroupStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
19
+ useCustomStyles(state);
20
+ return (0, _renderMenuSplitGroup.renderMenuSplitGroup_unstable)(state);
23
21
  });
24
- exports.MenuSplitGroup.displayName = 'MenuSplitGroup';
22
+ MenuSplitGroup.displayName = 'MenuSplitGroup'; //# sourceMappingURL=MenuSplitGroup.js.map
23
+
25
24
  //# sourceMappingURL=MenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","useMenuSplitGroup_1","renderMenuSplitGroup_1","useMenuSplitGroupStyles_1","react_shared_contexts_1","exports","MenuSplitGroup","forwardRef","props","ref","state","useMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderMenuSplitGroup_unstable","displayName"],"sources":["../src/packages/react-components/react-menu/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';\nimport type { MenuSplitGroupProps } from './MenuSplitGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_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 const { useMenuSplitGroupStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,mBAAA,gBAAAD,OAAA;AACA,MAAAE,sBAAA,gBAAAF,OAAA;AACA,MAAAG,yBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,cAAc,gBAA6CP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACtG,MAAMC,KAAK,GAAGT,mBAAA,CAAAU,0BAA0B,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEpDN,yBAAA,CAAAS,gCAAgC,CAACF,KAAK,CAAC;EAEvC,MAAM;IAAEE,gCAAgC,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EAC5FD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,sBAAA,CAAAa,6BAA6B,CAACL,KAAK,CAAC;AAC7C,CAAC,CAAC;AAEFL,OAAA,CAAAC,cAAc,CAACU,WAAW,GAAG,gBAAgB"}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/MenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n useMenuSplitGroupStyles_unstable(state);\n const {\n useMenuSplitGroupStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderMenuSplitGroup_unstable(state);\n});\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n//# sourceMappingURL=MenuSplitGroup.js.map"],"names":["MenuSplitGroup","React","forwardRef","props","ref","state","useMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderMenuSplitGroup_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;mCACoB;sCACG;yCACG;qCACJ;AAItC,MAAMA,iBAAiB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC1E,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,yDAAgC,EAACF;IACjC,MAAM,EACJE,kCAAkCC,gBAAe,EAClD,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,mDAA6B,EAACL;AACvC;AACAL,eAAeW,WAAW,GAAG,kBAC7B,0CAA0C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ //# sourceMappingURL=MenuSplitGroup.types.js.map
6
+
6
7
  //# sourceMappingURL=MenuSplitGroup.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-menu/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":""}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/MenuSplitGroup.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=MenuSplitGroup.types.js.map"],"names":[],"mappings":";;;;CACA,gDAAgD"}
@@ -1,12 +1,13 @@
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("./MenuSplitGroup"), exports);
8
- tslib_1.__exportStar(require("./MenuSplitGroup.types"), exports);
9
- tslib_1.__exportStar(require("./renderMenuSplitGroup"), exports);
10
- tslib_1.__exportStar(require("./useMenuSplitGroup"), exports);
11
- tslib_1.__exportStar(require("./useMenuSplitGroupStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./MenuSplitGroup"), exports);
7
+ _exportStar(require("./MenuSplitGroup.types"), exports);
8
+ _exportStar(require("./renderMenuSplitGroup"), exports);
9
+ _exportStar(require("./useMenuSplitGroup"), exports);
10
+ _exportStar(require("./useMenuSplitGroupStyles"), exports);
11
+ //# sourceMappingURL=index.js.map
12
+
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-menu/src/components/MenuSplitGroup/index.ts"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,+BAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/index.js"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderMenuSplitGroup_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderMenuSplitGroup_unstable
5
8
  });
6
- exports.renderMenuSplitGroup_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Render the final JSX of MenuSplitGroup
11
- */
12
- const renderMenuSplitGroup_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, {
18
- ...slotProps.root
19
- });
20
- };
21
- exports.renderMenuSplitGroup_unstable = renderMenuSplitGroup_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const renderMenuSplitGroup_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root);
15
+ }; //# sourceMappingURL=renderMenuSplitGroup.js.map
16
+
22
17
  //# sourceMappingURL=renderMenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderMenuSplitGroup_unstable","state","slots","slotProps","getSlots","createElement","root","exports"],"sources":["../src/packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 } = getSlots<MenuSplitGroupSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,6BAA6B,GAAIC,KAA0B,IAAI;EAC1E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAsBH,KAAK,CAAC;EAEjE,OAAOJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,EAAI;AAC3C,CAAC;AAJYC,OAAA,CAAAP,6BAA6B,GAAAA,6BAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/renderMenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of MenuSplitGroup\n */\nexport const renderMenuSplitGroup_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root);\n};\n//# sourceMappingURL=renderMenuSplitGroup.js.map"],"names":["renderMenuSplitGroup_unstable","state","slots","slotProps","getSlots","React","createElement","root"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,gCAAgCC,CAAAA,QAAS;IACpD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI;AACpE,GACA,gDAAgD"}
@@ -1,68 +1,62 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useMenuSplitGroup_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useMenuSplitGroup_unstable
5
8
  });
6
- exports.useMenuSplitGroup_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
10
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
11
- const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
12
- /**
13
- * Create the state required to render MenuSplitGroup.
14
- *
15
- * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
16
- * before being passed to renderMenuSplitGroup_unstable.
17
- *
18
- * @param props - props from this instance of MenuSplitGroup
19
- * @param ref - reference to root HTMLElement of MenuSplitGroup
20
- */
21
- const useMenuSplitGroup_unstable = (props, ref) => {
22
- const innerRef = React.useRef();
23
- const {
24
- dir,
25
- targetDocument
26
- } = react_shared_contexts_1.useFluent_unstable();
27
- const nextArrowKey = react_utilities_1.getRTLSafeKey(keyboard_keys_1.ArrowRight, dir);
28
- const prevArrowKey = react_utilities_1.getRTLSafeKey(keyboard_keys_1.ArrowLeft, dir);
29
- const {
30
- findNextFocusable,
31
- findPrevFocusable
32
- } = react_tabster_1.useFocusFinders();
33
- const onKeyDown = React.useCallback(e => {
34
- var _a;
35
- const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
36
- if (!activeElement) {
37
- return;
38
- }
39
- if (!((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.contains(activeElement))) {
40
- return;
41
- }
42
- if (e.key === nextArrowKey) {
43
- const next = findNextFocusable(activeElement, {
44
- container: innerRef.current
45
- });
46
- next === null || next === void 0 ? void 0 : next.focus();
47
- }
48
- if (e.key === prevArrowKey) {
49
- const prev = findPrevFocusable(activeElement, {
50
- container: innerRef.current
51
- });
52
- prev === null || prev === void 0 ? void 0 : prev.focus();
53
- }
54
- }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);
55
- return {
56
- components: {
57
- root: 'div'
58
- },
59
- root: react_utilities_1.getNativeElementProps('div', {
60
- role: 'group',
61
- ref: react_utilities_1.useMergedRefs(ref, innerRef),
62
- onKeyDown,
63
- ...props
64
- })
65
- };
66
- };
67
- exports.useMenuSplitGroup_unstable = useMenuSplitGroup_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _reactTabster = require("@fluentui/react-tabster");
13
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
14
+ const _keyboardKeys = require("@fluentui/keyboard-keys");
15
+ const useMenuSplitGroup_unstable = (props, ref)=>{
16
+ const innerRef = _react.useRef();
17
+ const { dir , targetDocument } = (0, _reactSharedContexts.useFluent_unstable)();
18
+ const nextArrowKey = (0, _reactUtilities.getRTLSafeKey)(_keyboardKeys.ArrowRight, dir);
19
+ const prevArrowKey = (0, _reactUtilities.getRTLSafeKey)(_keyboardKeys.ArrowLeft, dir);
20
+ const { findNextFocusable , findPrevFocusable } = (0, _reactTabster.useFocusFinders)();
21
+ const onKeyDown = _react.useCallback((e)=>{
22
+ var _innerRef_current;
23
+ const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
24
+ if (!activeElement) {
25
+ return;
26
+ }
27
+ if (!((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement))) {
28
+ return;
29
+ }
30
+ if (e.key === nextArrowKey) {
31
+ const next = findNextFocusable(activeElement, {
32
+ container: innerRef.current
33
+ });
34
+ next === null || next === void 0 ? void 0 : next.focus();
35
+ }
36
+ if (e.key === prevArrowKey) {
37
+ const prev = findPrevFocusable(activeElement, {
38
+ container: innerRef.current
39
+ });
40
+ prev === null || prev === void 0 ? void 0 : prev.focus();
41
+ }
42
+ }, [
43
+ findNextFocusable,
44
+ findPrevFocusable,
45
+ targetDocument,
46
+ nextArrowKey,
47
+ prevArrowKey
48
+ ]);
49
+ return {
50
+ components: {
51
+ root: 'div'
52
+ },
53
+ root: (0, _reactUtilities.getNativeElementProps)('div', {
54
+ role: 'group',
55
+ ref: (0, _reactUtilities.useMergedRefs)(ref, innerRef),
56
+ onKeyDown,
57
+ ...props
58
+ })
59
+ };
60
+ }; //# sourceMappingURL=useMenuSplitGroup.js.map
61
+
68
62
  //# sourceMappingURL=useMenuSplitGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","react_tabster_1","react_shared_contexts_1","keyboard_keys_1","useMenuSplitGroup_unstable","props","ref","innerRef","useRef","dir","targetDocument","useFluent_unstable","nextArrowKey","getRTLSafeKey","ArrowRight","prevArrowKey","ArrowLeft","findNextFocusable","findPrevFocusable","useFocusFinders","onKeyDown","useCallback","e","activeElement","_a","current","contains","key","next","container","focus","prev","components","root","getNativeElementProps","role","useMergedRefs","exports"],"sources":["../src/packages/react-components/react-menu/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,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,uBAAA,gBAAAH,OAAA;AAEA,MAAAI,eAAA,gBAAAJ,OAAA;AAEA;;;;;;;;;AASO,MAAMK,0BAA0B,GAAGA,CACxCC,KAA0B,EAC1BC,GAA2B,KACJ;EACvB,MAAMC,QAAQ,GAAGT,KAAK,CAACU,MAAM,EAAe;EAC5C,MAAM;IAAEC,GAAG;IAAEC;EAAc,CAAE,GAAGR,uBAAA,CAAAS,kBAAS,EAAE;EAE3C,MAAMC,YAAY,GAAGZ,iBAAA,CAAAa,aAAa,CAACV,eAAA,CAAAW,UAAU,EAAEL,GAAG,CAAC;EACnD,MAAMM,YAAY,GAAGf,iBAAA,CAAAa,aAAa,CAACV,eAAA,CAAAa,SAAS,EAAEP,GAAG,CAAC;EAElD,MAAM;IAAEQ,iBAAiB;IAAEC;EAAiB,CAAE,GAAGjB,eAAA,CAAAkB,eAAe,EAAE;EAElE,MAAMC,SAAS,GAAGtB,KAAK,CAACuB,WAAW,CAChCC,CAAmC,IAAI;;IACtC,MAAMC,aAAa,GAAGb,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEa,aAAa;IACnD,IAAI,CAACA,aAAa,EAAE;MAClB;;IAGF,IAAI,EAAC,CAAAC,EAAA,GAAAjB,QAAQ,CAACkB,OAAO,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,QAAQ,CAACH,aAAa,CAAC,GAAE;MAC9C;;IAGF,IAAID,CAAC,CAACK,GAAG,KAAKf,YAAY,EAAE;MAC1B,MAAMgB,IAAI,GAAGX,iBAAiB,CAACM,aAA4B,EAAE;QAAEM,SAAS,EAAEtB,QAAQ,CAACkB;MAAO,CAAE,CAAC;MAC7FG,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEE,KAAK,EAAE;;IAGf,IAAIR,CAAC,CAACK,GAAG,KAAKZ,YAAY,EAAE;MAC1B,MAAMgB,IAAI,GAAGb,iBAAiB,CAACK,aAA4B,EAAE;QAAEM,SAAS,EAAEtB,QAAQ,CAACkB;MAAO,CAAE,CAAC;MAC7FM,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAED,KAAK,EAAE;;EAEjB,CAAC,EACD,CAACb,iBAAiB,EAAEC,iBAAiB,EAAER,cAAc,EAAEE,YAAY,EAAEG,YAAY,CAAC,CACnF;EAED,OAAO;IACLiB,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAEjC,iBAAA,CAAAkC,qBAAqB,CAAC,KAAK,EAAE;MACjCC,IAAI,EAAE,OAAO;MACb7B,GAAG,EAAEN,iBAAA,CAAAoC,aAAa,CAAC9B,GAAG,EAAEC,QAAQ,CAAC;MACjCa,SAAS;MACT,GAAGf;KACJ;GACF;AACH,CAAC;AA/CYgC,OAAA,CAAAjC,0BAA0B,GAAAA,0BAAA"}
1
+ {"version":3,"sources":["../../../lib/components/MenuSplitGroup/useMenuSplitGroup.js"],"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 { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';\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 = (props, ref) => {\n const innerRef = React.useRef();\n const {\n dir,\n targetDocument\n } = useFluent();\n const nextArrowKey = getRTLSafeKey(ArrowRight, dir);\n const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);\n const {\n findNextFocusable,\n findPrevFocusable\n } = useFocusFinders();\n const onKeyDown = React.useCallback(e => {\n var _innerRef_current;\n const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n if (!activeElement) {\n return;\n }\n if (!((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement))) {\n return;\n }\n if (e.key === nextArrowKey) {\n const next = findNextFocusable(activeElement, {\n container: innerRef.current\n });\n next === null || next === void 0 ? void 0 : next.focus();\n }\n if (e.key === prevArrowKey) {\n const prev = findPrevFocusable(activeElement, {\n container: innerRef.current\n });\n prev === null || prev === void 0 ? void 0 : prev.focus();\n }\n }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);\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//# sourceMappingURL=useMenuSplitGroup.js.map"],"names":["useMenuSplitGroup_unstable","props","ref","innerRef","React","useRef","dir","targetDocument","useFluent","nextArrowKey","getRTLSafeKey","ArrowRight","prevArrowKey","ArrowLeft","findNextFocusable","findPrevFocusable","useFocusFinders","onKeyDown","useCallback","e","_innerRef_current","activeElement","current","contains","key","next","container","focus","prev","components","root","getNativeElementProps","role","useMergedRefs"],"mappings":";;;;+BAcaA;;aAAAA;;;6DAdU;gCAC6C;8BACpC;qCACgB;8BACV;AAU/B,MAAMA,6BAA6B,CAACC,OAAOC,MAAQ;IACxD,MAAMC,WAAWC,OAAMC,MAAM;IAC7B,MAAM,EACJC,IAAG,EACHC,eAAc,EACf,GAAGC,IAAAA,uCAAS;IACb,MAAMC,eAAeC,IAAAA,6BAAa,EAACC,wBAAU,EAAEL;IAC/C,MAAMM,eAAeF,IAAAA,6BAAa,EAACG,uBAAS,EAAEP;IAC9C,MAAM,EACJQ,kBAAiB,EACjBC,kBAAiB,EAClB,GAAGC,IAAAA,6BAAe;IACnB,MAAMC,YAAYb,OAAMc,WAAW,CAACC,CAAAA,IAAK;QACvC,IAAIC;QACJ,MAAMC,gBAAgBd,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAec,aAAa;QAClH,IAAI,CAACA,eAAe;YAClB;QACF,CAAC;QACD,IAAI,CAAE,CAAA,AAACD,CAAAA,oBAAoBjB,SAASmB,OAAO,AAAD,MAAO,IAAI,IAAIF,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBG,QAAQ,CAACF,cAAc,AAAD,GAAI;YAC3I;QACF,CAAC;QACD,IAAIF,EAAEK,GAAG,KAAKf,cAAc;YAC1B,MAAMgB,OAAOX,kBAAkBO,eAAe;gBAC5CK,WAAWvB,SAASmB,OAAO;YAC7B;YACAG,SAAS,IAAI,IAAIA,SAAS,KAAK,IAAI,KAAK,IAAIA,KAAKE,KAAK,EAAE;QAC1D,CAAC;QACD,IAAIR,EAAEK,GAAG,KAAKZ,cAAc;YAC1B,MAAMgB,OAAOb,kBAAkBM,eAAe;gBAC5CK,WAAWvB,SAASmB,OAAO;YAC7B;YACAM,SAAS,IAAI,IAAIA,SAAS,KAAK,IAA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