@fluentui/react-menu 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (512) hide show
  1. package/CHANGELOG.json +981 -32
  2. package/CHANGELOG.md +354 -138
  3. package/Spec.md +21 -16
  4. package/dist/{react-menu.d.ts → index.d.ts} +295 -166
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/Menu.js.map +1 -1
  7. package/lib/MenuDivider.js.map +1 -1
  8. package/lib/MenuGroup.js.map +1 -1
  9. package/lib/MenuGroupHeader.js.map +1 -1
  10. package/lib/MenuItem.js.map +1 -1
  11. package/lib/MenuItemCheckbox.js.map +1 -1
  12. package/lib/MenuItemRadio.js.map +1 -1
  13. package/lib/MenuList.js.map +1 -1
  14. package/lib/MenuPopover.js.map +1 -1
  15. package/lib/MenuSplitGroup.js +2 -0
  16. package/lib/MenuSplitGroup.js.map +1 -0
  17. package/lib/MenuTrigger.js.map +1 -1
  18. package/lib/components/Menu/Menu.js +7 -7
  19. package/lib/components/Menu/Menu.js.map +1 -1
  20. package/lib/components/Menu/Menu.types.js.map +1 -1
  21. package/lib/components/Menu/index.js.map +1 -1
  22. package/lib/components/Menu/renderMenu.js +1 -1
  23. package/lib/components/Menu/renderMenu.js.map +1 -1
  24. package/lib/components/Menu/useMenu.js +120 -129
  25. package/lib/components/Menu/useMenu.js.map +1 -1
  26. package/lib/components/Menu/useMenuContextValues.js +35 -33
  27. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  28. package/lib/components/MenuDivider/MenuDivider.js +8 -8
  29. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  30. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  31. package/lib/components/MenuDivider/index.js.map +1 -1
  32. package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
  33. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  34. package/lib/components/MenuDivider/useMenuDivider.js +9 -7
  35. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  36. package/lib/components/MenuDivider/useMenuDividerStyles.js +14 -5
  37. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  38. package/lib/components/MenuGroup/MenuGroup.js +10 -8
  39. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  40. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  41. package/lib/components/MenuGroup/index.js +1 -0
  42. package/lib/components/MenuGroup/index.js.map +1 -1
  43. package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
  44. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  45. package/lib/components/MenuGroup/useMenuGroup.js +10 -7
  46. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  47. package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
  48. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  49. package/lib/components/MenuGroup/useMenuGroupStyles.js +14 -0
  50. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  51. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
  52. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  53. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  54. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  55. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
  56. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  57. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
  58. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  59. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +14 -5
  60. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  61. package/lib/components/MenuItem/MenuItem.js +8 -10
  62. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  63. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  64. package/lib/components/MenuItem/index.js.map +1 -1
  65. package/lib/components/MenuItem/renderMenuItem.js +12 -8
  66. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  67. package/lib/components/MenuItem/useCharacterSearch.js +7 -7
  68. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  69. package/lib/components/MenuItem/useMenuItem.js +37 -44
  70. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  71. package/lib/components/MenuItem/useMenuItemStyles.js +61 -17
  72. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  73. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
  74. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  75. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  76. package/lib/components/MenuItemCheckbox/index.js +1 -0
  77. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  78. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
  79. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  80. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
  81. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  82. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +36 -5
  83. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  84. package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
  85. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  86. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  87. package/lib/components/MenuItemRadio/index.js +1 -0
  88. package/lib/components/MenuItemRadio/index.js.map +1 -1
  89. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
  90. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  91. package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
  92. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  93. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +36 -5
  94. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  95. package/lib/components/MenuList/MenuList.js +10 -10
  96. package/lib/components/MenuList/MenuList.js.map +1 -1
  97. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  98. package/lib/components/MenuList/index.js.map +1 -1
  99. package/lib/components/MenuList/renderMenuList.js +7 -7
  100. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  101. package/lib/components/MenuList/useMenuList.js +71 -88
  102. package/lib/components/MenuList/useMenuList.js.map +1 -1
  103. package/lib/components/MenuList/useMenuListContextValues.js +19 -17
  104. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  105. package/lib/components/MenuList/useMenuListStyles.js +16 -7
  106. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  107. package/lib/components/MenuPopover/MenuPopover.js +7 -7
  108. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  109. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  110. package/lib/components/MenuPopover/index.js.map +1 -1
  111. package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
  112. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  113. package/lib/components/MenuPopover/useMenuPopover.js +35 -41
  114. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  115. package/lib/components/MenuPopover/useMenuPopoverStyles.js +20 -8
  116. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  117. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  118. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  119. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  120. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  121. package/lib/components/MenuSplitGroup/index.js +6 -0
  122. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  123. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  124. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  125. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  126. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  127. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +42 -0
  128. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  129. package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
  130. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  131. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  132. package/lib/components/MenuTrigger/index.js.map +1 -1
  133. package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
  134. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  135. package/lib/components/MenuTrigger/useMenuTrigger.js +167 -5
  136. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  137. package/lib/components/index.js.map +1 -1
  138. package/lib/contexts/menuContext.js +5 -11
  139. package/lib/contexts/menuContext.js.map +1 -1
  140. package/lib/contexts/menuGroupContext.js +3 -5
  141. package/lib/contexts/menuGroupContext.js.map +1 -1
  142. package/lib/contexts/menuListContext.js +7 -17
  143. package/lib/contexts/menuListContext.js.map +1 -1
  144. package/lib/contexts/menuTriggerContext.js +4 -6
  145. package/lib/contexts/menuTriggerContext.js.map +1 -1
  146. package/lib/index.js +25 -15
  147. package/lib/index.js.map +1 -1
  148. package/lib/selectable/index.js.map +1 -1
  149. package/lib/selectable/types.js.map +1 -1
  150. package/lib/selectable/useCheckmarkStyles.js +4 -4
  151. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  152. package/lib/utils/index.js.map +1 -1
  153. package/lib/utils/useIsSubmenu.js +3 -5
  154. package/lib/utils/useIsSubmenu.js.map +1 -1
  155. package/lib/utils/useOnMenuEnter.js +16 -14
  156. package/lib/utils/useOnMenuEnter.js.map +1 -1
  157. package/lib-commonjs/Menu.js +1 -1
  158. package/lib-commonjs/Menu.js.map +1 -1
  159. package/lib-commonjs/MenuDivider.js +1 -1
  160. package/lib-commonjs/MenuDivider.js.map +1 -1
  161. package/lib-commonjs/MenuGroup.js +1 -1
  162. package/lib-commonjs/MenuGroup.js.map +1 -1
  163. package/lib-commonjs/MenuGroupHeader.js +1 -1
  164. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  165. package/lib-commonjs/MenuItem.js +1 -1
  166. package/lib-commonjs/MenuItem.js.map +1 -1
  167. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  168. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  169. package/lib-commonjs/MenuItemRadio.js +1 -1
  170. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  171. package/lib-commonjs/MenuList.js +1 -1
  172. package/lib-commonjs/MenuList.js.map +1 -1
  173. package/lib-commonjs/MenuPopover.js +1 -1
  174. package/lib-commonjs/MenuPopover.js.map +1 -1
  175. package/lib-commonjs/MenuSplitGroup.js +10 -0
  176. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  177. package/lib-commonjs/MenuTrigger.js +1 -1
  178. package/lib-commonjs/MenuTrigger.js.map +1 -1
  179. package/lib-commonjs/components/Menu/Menu.js +7 -7
  180. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  181. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  182. package/lib-commonjs/components/Menu/index.js +1 -1
  183. package/lib-commonjs/components/Menu/index.js.map +1 -1
  184. package/lib-commonjs/components/Menu/renderMenu.js +5 -5
  185. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  186. package/lib-commonjs/components/Menu/useMenu.js +131 -142
  187. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  188. package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
  189. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  190. package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
  191. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  192. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  193. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  194. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  195. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
  196. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  197. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
  198. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  199. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +18 -7
  200. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  201. package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
  202. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  203. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  204. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  205. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  206. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
  207. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  208. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
  209. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  210. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
  211. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  212. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +25 -0
  213. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  214. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
  215. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  216. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  217. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  218. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  219. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
  220. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  221. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
  222. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  223. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +18 -7
  224. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  225. package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
  226. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  227. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  228. package/lib-commonjs/components/MenuItem/index.js +1 -1
  229. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  230. package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
  231. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  232. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  233. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  234. package/lib-commonjs/components/MenuItem/useMenuItem.js +45 -53
  235. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  236. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +68 -20
  237. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  238. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
  239. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  240. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  241. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  242. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  243. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
  244. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  245. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
  246. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  247. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +40 -7
  248. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  249. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
  250. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  251. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  252. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  253. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  254. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
  255. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  256. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
  257. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  258. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +40 -7
  259. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  260. package/lib-commonjs/components/MenuList/MenuList.js +11 -11
  261. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  262. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  263. package/lib-commonjs/components/MenuList/index.js +1 -1
  264. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  265. package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
  266. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  267. package/lib-commonjs/components/MenuList/useMenuList.js +78 -96
  268. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  269. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
  270. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  271. package/lib-commonjs/components/MenuList/useMenuListStyles.js +19 -9
  272. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  273. package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
  274. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  275. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  276. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  277. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  278. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
  279. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  280. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
  281. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  282. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +24 -10
  283. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  284. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  285. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  286. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  287. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  288. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  289. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  290. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  291. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  292. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  293. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  294. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +54 -0
  295. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  296. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
  297. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  298. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  299. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  300. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  301. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +6 -6
  302. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  303. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +175 -7
  304. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  305. package/lib-commonjs/components/index.js +1 -1
  306. package/lib-commonjs/components/index.js.map +1 -1
  307. package/lib-commonjs/contexts/menuContext.js +6 -12
  308. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  309. package/lib-commonjs/contexts/menuGroupContext.js +5 -7
  310. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  311. package/lib-commonjs/contexts/menuListContext.js +8 -18
  312. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  313. package/lib-commonjs/contexts/menuTriggerContext.js +6 -8
  314. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  315. package/lib-commonjs/index.js +487 -16
  316. package/lib-commonjs/index.js.map +1 -1
  317. package/lib-commonjs/selectable/index.js +1 -1
  318. package/lib-commonjs/selectable/index.js.map +1 -1
  319. package/lib-commonjs/selectable/types.js.map +1 -1
  320. package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
  321. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  322. package/lib-commonjs/utils/index.js +1 -1
  323. package/lib-commonjs/utils/index.js.map +1 -1
  324. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  325. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  326. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  327. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  328. package/package.json +25 -29
  329. package/lib/Menu.d.ts +0 -1
  330. package/lib/MenuDivider.d.ts +0 -1
  331. package/lib/MenuGroup.d.ts +0 -1
  332. package/lib/MenuGroupHeader.d.ts +0 -1
  333. package/lib/MenuItem.d.ts +0 -1
  334. package/lib/MenuItemCheckbox.d.ts +0 -1
  335. package/lib/MenuItemRadio.d.ts +0 -1
  336. package/lib/MenuList.d.ts +0 -1
  337. package/lib/MenuPopover.d.ts +0 -1
  338. package/lib/MenuTrigger.d.ts +0 -1
  339. package/lib/common/isConformant.d.ts +0 -4
  340. package/lib/common/isConformant.js +0 -12
  341. package/lib/common/isConformant.js.map +0 -1
  342. package/lib/common/mockUseMenuContext.d.ts +0 -7
  343. package/lib/common/mockUseMenuContext.js +0 -36
  344. package/lib/common/mockUseMenuContext.js.map +0 -1
  345. package/lib/components/Menu/Menu.d.ts +0 -6
  346. package/lib/components/Menu/Menu.types.d.ts +0 -112
  347. package/lib/components/Menu/index.d.ts +0 -5
  348. package/lib/components/Menu/renderMenu.d.ts +0 -5
  349. package/lib/components/Menu/useMenu.d.ts +0 -10
  350. package/lib/components/Menu/useMenuContextValues.d.ts +0 -2
  351. package/lib/components/MenuDivider/MenuDivider.d.ts +0 -6
  352. package/lib/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  353. package/lib/components/MenuDivider/index.d.ts +0 -5
  354. package/lib/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  355. package/lib/components/MenuDivider/useMenuDivider.d.ts +0 -6
  356. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
  357. package/lib/components/MenuGroup/MenuGroup.d.ts +0 -6
  358. package/lib/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  359. package/lib/components/MenuGroup/index.d.ts +0 -5
  360. package/lib/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  361. package/lib/components/MenuGroup/useMenuGroup.d.ts +0 -6
  362. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  363. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  364. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  365. package/lib/components/MenuGroupHeader/index.d.ts +0 -5
  366. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  367. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  368. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
  369. package/lib/components/MenuItem/MenuItem.d.ts +0 -6
  370. package/lib/components/MenuItem/MenuItem.types.d.ts +0 -43
  371. package/lib/components/MenuItem/index.d.ts +0 -5
  372. package/lib/components/MenuItem/renderMenuItem.d.ts +0 -5
  373. package/lib/components/MenuItem/useCharacterSearch.d.ts +0 -3
  374. package/lib/components/MenuItem/useMenuItem.d.ts +0 -10
  375. package/lib/components/MenuItem/useMenuItemStyles.d.ts +0 -3
  376. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  377. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  378. package/lib/components/MenuItemCheckbox/index.d.ts +0 -4
  379. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  380. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  381. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
  382. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  383. package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  384. package/lib/components/MenuItemRadio/index.d.ts +0 -4
  385. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  386. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  387. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
  388. package/lib/components/MenuList/MenuList.d.ts +0 -6
  389. package/lib/components/MenuList/MenuList.types.d.ts +0 -53
  390. package/lib/components/MenuList/index.d.ts +0 -6
  391. package/lib/components/MenuList/renderMenuList.d.ts +0 -5
  392. package/lib/components/MenuList/useMenuList.d.ts +0 -6
  393. package/lib/components/MenuList/useMenuListContextValues.d.ts +0 -2
  394. package/lib/components/MenuList/useMenuListStyles.d.ts +0 -5
  395. package/lib/components/MenuPopover/MenuPopover.d.ts +0 -6
  396. package/lib/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  397. package/lib/components/MenuPopover/index.d.ts +0 -5
  398. package/lib/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  399. package/lib/components/MenuPopover/useMenuPopover.d.ts +0 -12
  400. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
  401. package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -7
  402. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
  403. package/lib/components/MenuTrigger/index.d.ts +0 -4
  404. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  405. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  406. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  407. package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
  408. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  409. package/lib/components/index.d.ts +0 -2
  410. package/lib/contexts/menuContext.d.ts +0 -16
  411. package/lib/contexts/menuGroupContext.d.ts +0 -13
  412. package/lib/contexts/menuListContext.d.ts +0 -15
  413. package/lib/contexts/menuTriggerContext.d.ts +0 -3
  414. package/lib/index.d.ts +0 -15
  415. package/lib/selectable/index.d.ts +0 -2
  416. package/lib/selectable/types.d.ts +0 -34
  417. package/lib/selectable/useCheckmarkStyles.d.ts +0 -8
  418. package/lib/utils/index.d.ts +0 -1
  419. package/lib/utils/useIsSubmenu.d.ts +0 -9
  420. package/lib/utils/useOnMenuEnter.d.ts +0 -23
  421. package/lib-commonjs/Menu.d.ts +0 -1
  422. package/lib-commonjs/MenuDivider.d.ts +0 -1
  423. package/lib-commonjs/MenuGroup.d.ts +0 -1
  424. package/lib-commonjs/MenuGroupHeader.d.ts +0 -1
  425. package/lib-commonjs/MenuItem.d.ts +0 -1
  426. package/lib-commonjs/MenuItemCheckbox.d.ts +0 -1
  427. package/lib-commonjs/MenuItemRadio.d.ts +0 -1
  428. package/lib-commonjs/MenuList.d.ts +0 -1
  429. package/lib-commonjs/MenuPopover.d.ts +0 -1
  430. package/lib-commonjs/MenuTrigger.d.ts +0 -1
  431. package/lib-commonjs/common/isConformant.d.ts +0 -4
  432. package/lib-commonjs/common/isConformant.js +0 -23
  433. package/lib-commonjs/common/isConformant.js.map +0 -1
  434. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  435. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  436. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
  437. package/lib-commonjs/components/Menu/Menu.d.ts +0 -6
  438. package/lib-commonjs/components/Menu/Menu.types.d.ts +0 -112
  439. package/lib-commonjs/components/Menu/index.d.ts +0 -5
  440. package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -5
  441. package/lib-commonjs/components/Menu/useMenu.d.ts +0 -10
  442. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +0 -2
  443. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +0 -6
  444. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  445. package/lib-commonjs/components/MenuDivider/index.d.ts +0 -5
  446. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  447. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +0 -6
  448. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
  449. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +0 -6
  450. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  451. package/lib-commonjs/components/MenuGroup/index.d.ts +0 -5
  452. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  453. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +0 -6
  454. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  455. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  456. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  457. package/lib-commonjs/components/MenuGroupHeader/index.d.ts +0 -5
  458. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  459. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  460. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
  461. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -6
  462. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +0 -43
  463. package/lib-commonjs/components/MenuItem/index.d.ts +0 -5
  464. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +0 -5
  465. package/lib-commonjs/components/MenuItem/useCharacterSearch.d.ts +0 -3
  466. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +0 -10
  467. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +0 -3
  468. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  469. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  470. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +0 -4
  471. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  472. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  473. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
  474. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  475. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  476. package/lib-commonjs/components/MenuItemRadio/index.d.ts +0 -4
  477. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  478. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  479. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
  480. package/lib-commonjs/components/MenuList/MenuList.d.ts +0 -6
  481. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +0 -53
  482. package/lib-commonjs/components/MenuList/index.d.ts +0 -6
  483. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +0 -5
  484. package/lib-commonjs/components/MenuList/useMenuList.d.ts +0 -6
  485. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +0 -2
  486. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +0 -5
  487. package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +0 -6
  488. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  489. package/lib-commonjs/components/MenuPopover/index.d.ts +0 -5
  490. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  491. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +0 -12
  492. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
  493. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -7
  494. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
  495. package/lib-commonjs/components/MenuTrigger/index.d.ts +0 -4
  496. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  497. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  498. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  499. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
  500. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
  501. package/lib-commonjs/components/index.d.ts +0 -2
  502. package/lib-commonjs/contexts/menuContext.d.ts +0 -16
  503. package/lib-commonjs/contexts/menuGroupContext.d.ts +0 -13
  504. package/lib-commonjs/contexts/menuListContext.d.ts +0 -15
  505. package/lib-commonjs/contexts/menuTriggerContext.d.ts +0 -3
  506. package/lib-commonjs/index.d.ts +0 -15
  507. package/lib-commonjs/selectable/index.d.ts +0 -2
  508. package/lib-commonjs/selectable/types.d.ts +0 -34
  509. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +0 -8
  510. package/lib-commonjs/utils/index.d.ts +0 -1
  511. package/lib-commonjs/utils/useIsSubmenu.d.ts +0 -9
  512. package/lib-commonjs/utils/useOnMenuEnter.d.ts +0 -23
@@ -3,87 +3,77 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuPopover = void 0;
6
+ exports.useMenuPopover_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
11
11
 
12
- var keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
12
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
13
 
14
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
14
+ const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
15
15
 
16
- var menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
16
+ const index_1 = /*#__PURE__*/require("../../utils/index");
17
17
 
18
- var index_1 = /*#__PURE__*/require("../../utils/index");
18
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
19
19
 
20
- var react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
21
-
22
- var useIsSubmenu_1 = /*#__PURE__*/require("../../utils/useIsSubmenu");
20
+ const useIsSubmenu_1 = /*#__PURE__*/require("../../utils/useIsSubmenu");
23
21
  /**
24
22
  * Create the state required to render MenuPopover.
25
23
  *
26
- * The returned state can be modified with hooks such as useMenuPopoverStyles,
27
- * before being passed to renderMenuPopover.
24
+ * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
25
+ * before being passed to renderMenuPopover_unstable.
28
26
  *
29
27
  * @param props - props from this instance of MenuPopover
30
28
  * @param ref - reference to root HTMLElement of MenuPopover
31
29
  */
32
30
 
33
31
 
34
- var useMenuPopover = function (props, ref) {
32
+ const useMenuPopover_unstable = (props, ref) => {
35
33
  var _a;
36
34
 
37
- var popoverRef = menuContext_1.useMenuContext(function (context) {
38
- return context.menuPopoverRef;
39
- });
40
- var setOpen = menuContext_1.useMenuContext(function (context) {
41
- return context.setOpen;
42
- });
43
- var openOnHover = menuContext_1.useMenuContext(function (context) {
44
- return context.openOnHover;
45
- });
46
- var isSubmenu = useIsSubmenu_1.useIsSubmenu();
47
- var canDispatchCustomEventRef = React.useRef(true);
48
- var throttleDispatchTimerRef = React.useRef(0);
49
- var dir = react_shared_contexts_1.useFluent().dir;
50
- var CloseArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowLeft : keyboard_keys_1.ArrowRight; // use DOM listener since react events propagate up the react tree
35
+ const popoverRef = menuContext_1.useMenuContext_unstable(context => context.menuPopoverRef);
36
+ const setOpen = menuContext_1.useMenuContext_unstable(context => context.setOpen);
37
+ const openOnHover = menuContext_1.useMenuContext_unstable(context => context.openOnHover);
38
+ const isSubmenu = useIsSubmenu_1.useIsSubmenu();
39
+ const canDispatchCustomEventRef = React.useRef(true);
40
+ const throttleDispatchTimerRef = React.useRef(0);
41
+ const {
42
+ dir
43
+ } = react_shared_contexts_1.useFluent();
44
+ const CloseArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowLeft : keyboard_keys_1.ArrowRight; // use DOM listener since react events propagate up the react tree
51
45
  // no need to do `contains` logic as menus are all positioned in different portals
52
46
 
53
- var mouseOverListenerCallbackRef = React.useCallback(function (node) {
47
+ const mouseOverListenerCallbackRef = React.useCallback(node => {
54
48
  if (node) {
55
49
  // Dispatches the custom menu mouse enter event with throttling
56
50
  // Needs to trigger on mouseover to support keyboard + mouse together
57
51
  // i.e. keyboard opens submenus while cursor is still on the parent
58
- node.addEventListener('mouseover', function (e) {
52
+ node.addEventListener('mouseover', e => {
59
53
  if (canDispatchCustomEventRef.current) {
60
54
  canDispatchCustomEventRef.current = false;
61
55
  index_1.dispatchMenuEnterEvent(popoverRef.current, e); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62
56
  // @ts-ignore #16889 Node setTimeout type leaking
63
57
 
64
- throttleDispatchTimerRef.current = setTimeout(function () {
65
- return canDispatchCustomEventRef.current = true;
66
- }, 250);
58
+ throttleDispatchTimerRef.current = setTimeout(() => canDispatchCustomEventRef.current = true, 250);
67
59
  }
68
60
  });
69
61
  }
70
62
  }, [popoverRef, throttleDispatchTimerRef]);
71
- React.useEffect(function () {
72
- (function () {
73
- return clearTimeout(throttleDispatchTimerRef.current);
74
- });
63
+ React.useEffect(() => {
64
+ () => clearTimeout(throttleDispatchTimerRef.current);
75
65
  }, []);
76
- var inline = (_a = menuContext_1.useMenuContext(function (context) {
77
- return context.inline;
78
- })) !== null && _a !== void 0 ? _a : false;
79
- var rootProps = react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({
80
- role: 'presentation'
81
- }, props), {
66
+ const inline = (_a = menuContext_1.useMenuContext_unstable(context => context.inline)) !== null && _a !== void 0 ? _a : false;
67
+ const rootProps = react_utilities_1.getNativeElementProps('div', {
68
+ role: 'presentation',
69
+ ...props,
82
70
  ref: react_utilities_1.useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef)
83
- }));
84
- var onMouseEnterOriginal = rootProps.onMouseEnter,
85
- onKeyDownOriginal = rootProps.onKeyDown;
86
- rootProps.onMouseEnter = react_utilities_1.useEventCallback(function (e) {
71
+ });
72
+ const {
73
+ onMouseEnter: onMouseEnterOriginal,
74
+ onKeyDown: onKeyDownOriginal
75
+ } = rootProps;
76
+ rootProps.onMouseEnter = react_utilities_1.useEventCallback(e => {
87
77
  if (openOnHover) {
88
78
  setOpen(e, {
89
79
  open: true,
@@ -93,10 +83,10 @@ var useMenuPopover = function (props, ref) {
93
83
 
94
84
  onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
95
85
  });
96
- rootProps.onKeyDown = react_utilities_1.useEventCallback(function (e) {
86
+ rootProps.onKeyDown = react_utilities_1.useEventCallback(e => {
97
87
  var _a;
98
88
 
99
- var key = e.key;
89
+ const key = e.key;
100
90
 
101
91
  if (key === keyboard_keys_1.Escape || isSubmenu && key === CloseArrowKey) {
102
92
  if ((_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
@@ -118,10 +108,13 @@ var useMenuPopover = function (props, ref) {
118
108
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
119
109
  });
120
110
  return {
121
- inline: inline,
111
+ inline,
112
+ components: {
113
+ root: 'div'
114
+ },
122
115
  root: rootProps
123
116
  };
124
117
  };
125
118
 
126
- exports.useMenuPopover = useMenuPopover;
119
+ exports.useMenuPopover_unstable = useMenuPopover_unstable;
127
120
  //# sourceMappingURL=useMenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopover.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA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AA,CAAA,gBAAA,CAAkB,CAAD,IAAwC;;;AAC7E,UAAM,GAAG,GAAG,CAAC,CAAC,GAAd;;AAEA,QAAI,GAAG,KAAK,eAAA,CAAA,MAAR,IAAmB,SAAS,IAAI,GAAG,KAAK,aAA5C,EAA4D;AAC1D,UAAI,CAAA,EAAA,GAAA,UAAU,CAAC,OAAX,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,QAAF,CAAW,CAAC,CAAC,MAAb,CAAtB,EAA2D;AACzD,QAAA,OAAO,CAAC,CAAD,EAAI;AAAE,UAAA,IAAI,EAAE,KAAR;AAAe,UAAA,QAAQ,EAAE;AAAzB,SAAJ,CAAP;AACD;AACF;;AAED,QAAI,GAAG,KAAK,eAAA,CAAA,GAAZ,EAAiB;AACf,MAAA,OAAO,CAAC,CAAD,EAAI;AAAE,QAAA,IAAI,EAAE,KAAR;AAAe,QAAA,QAAQ,EAAE;AAAzB,OAAJ,CAAP;AACA,MAAA,CAAC,CAAC,cAAF;AACD;;AAED,IAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAA,iBAAiB,CAAG,CAAH,CAAjB;AACD,GAfqB,CAAtB;AAiBA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAFP;AAKL,IAAA,IAAI,EAAE;AALD,GAAP;AAOD,CA9EM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","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 } 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 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 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((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, { open: true, keyboard: false });\n }\n\n onMouseEnterOriginal?.(e);\n });\n\n rootProps.onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLElement>) => {\n const key = e.key;\n\n if (key === Escape || (isSubmenu && key === CloseArrowKey)) {\n if (popoverRef.current?.contains(e.target as HTMLElement)) {\n setOpen(e, { open: false, keyboard: true });\n }\n }\n\n if (key === Tab) {\n setOpen(e, { open: false, keyboard: true });\n e.preventDefault();\n }\n\n onKeyDownOriginal?.(e);\n });\n\n return {\n inline,\n components: {\n root: 'div',\n },\n root: rootProps,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -3,18 +3,32 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuPopoverStyles = void 0;
6
+ exports.useMenuPopoverStyles_unstable = exports.menuPopoverClassNames = exports.menuPopoverClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
+ /**
12
+ * @deprecated Use `menuPopoverClassNames.root` instead.
13
+ */
14
+
15
+
16
+ exports.menuPopoverClassName = 'fui-MenuPopover';
17
+ exports.menuPopoverClassNames = {
18
+ root: 'fui-MenuPopover'
19
+ };
20
+
21
+ const useStyles = /*#__PURE__*/react_1.__styles({
11
22
  "root": {
12
- "Dimara": "ft85np5",
23
+ "Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
24
+ "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
25
+ "B7oj6ja": ["f1jar5jt", "fyu767a"],
26
+ "Btl43ni": ["fyu767a", "f1jar5jt"],
13
27
  "De3pzq": "fxugw4r",
14
28
  "Bf4jedk": "fkqu4gx",
15
29
  "B2u0y6b": "f1kaai3v",
16
30
  "a9b677": "f1ahpp82",
17
- "E5pizo": ["f1hg901r", "f136t921"],
31
+ "E5pizo": "f1hg901r",
18
32
  "z8tnut": "f10ra9hq",
19
33
  "z189sj": ["f8wuabp", "fycuoez"],
20
34
  "Byoj8tv": "f1y2xyjm",
@@ -33,18 +47,18 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
33
47
  "zhjwy3": ["fjscplz", "f1gn591s"]
34
48
  }
35
49
  }, {
36
- "d": [".ft85np5{border-radius:var(--borderRadiusMedium);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".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);}", ".f136t921{box-shadow:var(--shadow-16);}", ".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);}"]
50
+ "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);}", ".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);}"]
37
51
  });
38
52
  /**
39
53
  * Apply styling to the Menu slots based on the state
40
54
  */
41
55
 
42
56
 
43
- var useMenuPopoverStyles = function (state) {
44
- var styles = useStyles();
45
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.root.className);
57
+ const useMenuPopoverStyles_unstable = state => {
58
+ const styles = useStyles();
59
+ state.root.className = react_1.mergeClasses(exports.menuPopoverClassNames.root, styles.root, state.root.className);
46
60
  return state;
47
61
  };
48
62
 
49
- exports.useMenuPopoverStyles = useMenuPopoverStyles;
63
+ exports.useMenuPopoverStyles_unstable = useMenuPopoverStyles_unstable;
50
64
  //# sourceMappingURL=useMenuPopoverStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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BAAA,GAA6B,6BAA7B","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `menuPopoverClassNames.root` instead.\n */\nexport const menuPopoverClassName = 'fui-MenuPopover';\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 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 },\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"],"sourceRoot":"../src/"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MenuSplitGroup = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const useMenuSplitGroup_1 = /*#__PURE__*/require("./useMenuSplitGroup");
11
+
12
+ const renderMenuSplitGroup_1 = /*#__PURE__*/require("./renderMenuSplitGroup");
13
+
14
+ const useMenuSplitGroupStyles_1 = /*#__PURE__*/require("./useMenuSplitGroupStyles");
15
+ /**
16
+ * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
17
+ */
18
+
19
+
20
+ exports.MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useMenuSplitGroup_1.useMenuSplitGroup_unstable(props, ref);
22
+ useMenuSplitGroupStyles_1.useMenuSplitGroupStyles_unstable(state);
23
+ return renderMenuSplitGroup_1.renderMenuSplitGroup_unstable(state);
24
+ });
25
+ exports.MenuSplitGroup.displayName = 'MenuSplitGroup';
26
+ //# sourceMappingURL=MenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/MenuSplitGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,EAAkC,GAAlC,CAAd;AAEA,EAAA,yBAAA,CAAA,gCAAA,CAAiC,KAAjC;AACA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CALuE,CAA3D;AAOb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","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';\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 return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=MenuSplitGroup.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./MenuSplitGroup"), exports);
10
+
11
+ tslib_1.__exportStar(require("./MenuSplitGroup.types"), exports);
12
+
13
+ tslib_1.__exportStar(require("./renderMenuSplitGroup"), exports);
14
+
15
+ tslib_1.__exportStar(require("./useMenuSplitGroup"), exports);
16
+
17
+ tslib_1.__exportStar(require("./useMenuSplitGroupStyles"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderMenuSplitGroup_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+ /**
12
+ * Render the final JSX of MenuSplitGroup
13
+ */
14
+
15
+
16
+ const renderMenuSplitGroup_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ return React.createElement(slots.root, { ...slotProps.root
22
+ });
23
+ };
24
+
25
+ exports.renderMenuSplitGroup_unstable = renderMenuSplitGroup_unstable;
26
+ //# sourceMappingURL=renderMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/renderMenuSplitGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA8B,KAA9B,CAA7B;AAEA,SAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","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"],"sourceRoot":"../src/"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMenuSplitGroup_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
+
14
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
15
+
16
+ const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
17
+ /**
18
+ * Create the state required to render MenuSplitGroup.
19
+ *
20
+ * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
21
+ * before being passed to renderMenuSplitGroup_unstable.
22
+ *
23
+ * @param props - props from this instance of MenuSplitGroup
24
+ * @param ref - reference to root HTMLElement of MenuSplitGroup
25
+ */
26
+
27
+
28
+ const useMenuSplitGroup_unstable = (props, ref) => {
29
+ const innerRef = React.useRef();
30
+ const {
31
+ dir,
32
+ targetDocument
33
+ } = react_shared_contexts_1.useFluent();
34
+ const nextArrowKey = react_utilities_1.getRTLSafeKey(keyboard_keys_1.ArrowRight, dir);
35
+ const prevArrowKey = react_utilities_1.getRTLSafeKey(keyboard_keys_1.ArrowLeft, dir);
36
+ const {
37
+ findNextFocusable,
38
+ findPrevFocusable
39
+ } = react_tabster_1.useFocusFinders();
40
+ const onKeyDown = React.useCallback(e => {
41
+ var _a;
42
+
43
+ const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
44
+
45
+ if (!activeElement) {
46
+ return;
47
+ }
48
+
49
+ if (!((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.contains(activeElement))) {
50
+ return;
51
+ }
52
+
53
+ if (e.key === nextArrowKey) {
54
+ const next = findNextFocusable(activeElement, {
55
+ container: innerRef.current
56
+ });
57
+ next === null || next === void 0 ? void 0 : next.focus();
58
+ }
59
+
60
+ if (e.key === prevArrowKey) {
61
+ const prev = findPrevFocusable(activeElement, {
62
+ container: innerRef.current
63
+ });
64
+ prev === null || prev === void 0 ? void 0 : prev.focus();
65
+ }
66
+ }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);
67
+ return {
68
+ components: {
69
+ root: 'div'
70
+ },
71
+ root: react_utilities_1.getNativeElementProps('div', {
72
+ role: 'group',
73
+ ref: react_utilities_1.useMergedRefs(ref, innerRef),
74
+ onKeyDown,
75
+ ...props
76
+ })
77
+ };
78
+ };
79
+
80
+ exports.useMenuSplitGroup_unstable = useMenuSplitGroup_unstable;
81
+ //# sourceMappingURL=useMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/useMenuSplitGroup.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AAEA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,0BAA0B,GAAG,CACxC,KADwC,EAExC,GAFwC,KAGjB;AACvB,QAAM,QAAQ,GAAG,KAAK,CAAC,MAAN,EAAjB;AACA,QAAM;AAAE,IAAA,GAAF;AAAO,IAAA;AAAP,MAA0B,uBAAA,CAAA,SAAA,EAAhC;AAEA,QAAM,YAAY,GAAG,iBAAA,CAAA,aAAA,CAAc,eAAA,CAAA,UAAd,EAA0B,GAA1B,CAArB;AACA,QAAM,YAAY,GAAG,iBAAA,CAAA,aAAA,CAAc,eAAA,CAAA,SAAd,EAAyB,GAAzB,CAArB;AAEA,QAAM;AAAE,IAAA,iBAAF;AAAqB,IAAA;AAArB,MAA2C,eAAA,CAAA,eAAA,EAAjD;AAEA,QAAM,SAAS,GAAG,KAAK,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iBAAA,CAAA,aAAA,CAAc,GAAd,EAAmB,QAAnB,CAF4B;AAGjC,MAAA,SAHiC;AAIjC,SAAG;AAJ8B,KAA7B;AAJD,GAAP;AAWD,CA/CM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, getRTLSafeKey, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { 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"],"sourceRoot":"../src/"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMenuSplitGroupStyles_unstable = exports.menuSplitGroupClassNames = exports.menuSplitGroupClassName = void 0;
7
+
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
+
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
+
12
+ const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
13
+ /**
14
+ * @deprecated Use `menuSplitGroupClassNames.root` instead.
15
+ */
16
+
17
+
18
+ exports.menuSplitGroupClassName = 'fui-MenuSplitGroup';
19
+ exports.menuSplitGroupClassNames = {
20
+ root: 'fui-MenuSplitGroup'
21
+ };
22
+ /**
23
+ * Styles for the root slot
24
+ */
25
+
26
+ const useStyles = /*#__PURE__*/react_1.__styles({
27
+ "root": {
28
+ "mc9l5x": "f22iagw",
29
+ "u7v6m2": "f168awwq",
30
+ "Bo1wru1": ["f1om2jlk", "fcyhg04"],
31
+ "Bhkyaub": ["fgqgg70", "fqo1hry"],
32
+ "J9ixe0": ["fh1zedf", "f1auaj6e"],
33
+ "rj29m3": ["fokbbcd", "f1xlvh9o"],
34
+ "lispf9": "f1et5qag",
35
+ "B9hwub1": "f13ngu1f",
36
+ "dvf9w6": "f1db9j62",
37
+ "Hjn5ok": "f92z21p"
38
+ }
39
+ }, {
40
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f168awwq>.fui-MenuItem:nth-child(1){width:100%;}", ".f1om2jlk>.fui-MenuItem:nth-child(2){border-top-left-radius:0;}", ".fcyhg04>.fui-MenuItem:nth-child(2){border-top-right-radius:0;}", ".fgqgg70>.fui-MenuItem:nth-child(2){border-bottom-left-radius:0;}", ".fqo1hry>.fui-MenuItem:nth-child(2){border-bottom-right-radius:0;}", ".fh1zedf>.fui-MenuItem:nth-child(2){padding-left:0;}", ".f1auaj6e>.fui-MenuItem:nth-child(2){padding-right:0;}", ".fokbbcd>.fui-MenuItem:nth-child(2){margin-left:auto;}", ".f1xlvh9o>.fui-MenuItem:nth-child(2){margin-right:auto;}", ".f1et5qag>.fui-MenuItem:nth-child(2):before{content:\"\";}", ".f13ngu1f>.fui-MenuItem:nth-child(2):before{width:var(--strokeWidthThin);}", ".f1db9j62>.fui-MenuItem:nth-child(2):before{height:24px;}", ".f92z21p>.fui-MenuItem:nth-child(2):before{background-color:var(--colorNeutralStroke1);}"]
41
+ });
42
+ /**
43
+ * Apply styling to the MenuSplitGroup slots based on the state
44
+ */
45
+
46
+
47
+ const useMenuSplitGroupStyles_unstable = state => {
48
+ const styles = useStyles();
49
+ state.root.className = react_1.mergeClasses(exports.menuSplitGroupClassNames.root, styles.root, state.root.className);
50
+ return state;
51
+ };
52
+
53
+ exports.useMenuSplitGroupStyles_unstable = useMenuSplitGroupStyles_unstable;
54
+ //# sourceMappingURL=useMenuSplitGroupStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/useMenuSplitGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,uBAAA,GAA0B,oBAA1B;AACA,OAAA,CAAA,wBAAA,GAAgE;AAC3E,EAAA,IAAI,EAAE;AADqE,CAAhE;AAGb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqBA;;AAEG;;;AACI,MAAM,gCAAgC,GAAI,KAAD,IAAoD;AAClG,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,wBAAA,CAAyB,IAAtC,EAA4C,MAAM,CAAC,IAAnD,EAAyD,KAAK,CAAC,IAAN,CAAW,SAApE,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles';\nimport type { MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `menuSplitGroupClassNames.root` instead.\n */\nexport const menuSplitGroupClassName = 'fui-MenuSplitGroup';\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"],"sourceRoot":"../src/"}
@@ -5,20 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MenuTrigger = void 0;
7
7
 
8
- var useMenuTrigger_1 = /*#__PURE__*/require("./useMenuTrigger");
8
+ const useMenuTrigger_1 = /*#__PURE__*/require("./useMenuTrigger");
9
9
 
10
- var renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
10
+ const renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
11
11
  /**
12
12
  * Wraps a trigger element as an only child
13
13
  * and adds the necessary event handling to open a popup menu
14
14
  */
15
15
 
16
16
 
17
- var MenuTrigger = function (props) {
18
- var state = useMenuTrigger_1.useMenuTrigger(props);
19
- return renderMenuTrigger_1.renderMenuTrigger(state);
17
+ const MenuTrigger = props => {
18
+ const state = useMenuTrigger_1.useMenuTrigger_unstable(props);
19
+ return renderMenuTrigger_1.renderMenuTrigger_unstable(state);
20
20
  };
21
21
 
22
22
  exports.MenuTrigger = MenuTrigger;
23
23
  exports.MenuTrigger.displayName = 'MenuTrigger';
24
+ exports.MenuTrigger.isFluentTriggerComponent = true;
24
25
  //# sourceMappingURL=MenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;AAGG;;;AACI,IAAM,WAAW,GAA+B,UAAA,KAAA,EAAK;AAC1D,MAAM,KAAK,GAAG,gBAAA,CAAA,cAAA,CAAe,KAAf,CAAd;AAEA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;;AAGG;;;AACI,MAAM,WAAW,GAAwD,KAAK,IAAG;AACtF,QAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAd;AAEA,SAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B;AACA,OAAA,CAAA,WAAA,CAAY,wBAAZ,GAAuC,IAAvC","sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger';\nimport { renderMenuTrigger_unstable } from './renderMenuTrigger';\nimport type { MenuTriggerProps } from './MenuTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */\nexport const MenuTrigger: React.FC<MenuTriggerProps> & FluentTriggerComponent = props => {\n const state = useMenuTrigger_unstable(props);\n\n return renderMenuTrigger_unstable(state);\n};\n\nMenuTrigger.displayName = 'MenuTrigger';\nMenuTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./MenuTrigger"), exports);
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"sourceRoot":"../src/"}
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderMenuTrigger = void 0;
6
+ exports.renderMenuTrigger_unstable = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
10
+ const menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
11
11
  /**
12
12
  * Render the final JSX of MenuTrigger
13
13
  *
@@ -15,11 +15,11 @@ var menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerConte
15
15
  */
16
16
 
17
17
 
18
- var renderMenuTrigger = function (state) {
18
+ const renderMenuTrigger_unstable = state => {
19
19
  return React.createElement(menuTriggerContext_1.MenuTriggerContextProvider, {
20
- value: true
20
+ value: state.isSubmenu
21
21
  }, state.children);
22
22
  };
23
23
 
24
- exports.renderMenuTrigger = renderMenuTrigger;
24
+ exports.renderMenuTrigger_unstable = renderMenuTrigger_unstable;
25
25
  //# sourceMappingURL=renderMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;AAGA;;;;AAIG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACvD,SAAO,KAAA,CAAA,aAAA,CAAC,oBAAA,CAAA,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE;AAAR,GAA3B,EAA0C,KAAK,CAAC,QAAhD,CAAP;AACD,CAFM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,SAAO,KAAA,CAAA,aAAA,CAAC,oBAAA,CAAA,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE,KAAK,CAAC;AAAd,GAA3B,EAAqD,KAAK,CAAC,QAA3D,CAAP;AACD,CAFM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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"],"sourceRoot":"../src/"}