@fluentui/react-menu 0.0.0-nightlyfc5cfdc52420220215.1 → 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (411) hide show
  1. package/CHANGELOG.json +816 -22
  2. package/CHANGELOG.md +345 -139
  3. package/dist/{react-menu.d.ts → index.d.ts} +138 -121
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Menu.js.map +1 -1
  6. package/lib/MenuDivider.js.map +1 -1
  7. package/lib/MenuGroup.js.map +1 -1
  8. package/lib/MenuGroupHeader.js.map +1 -1
  9. package/lib/MenuItem.js.map +1 -1
  10. package/lib/MenuItemCheckbox.js.map +1 -1
  11. package/lib/MenuItemRadio.js.map +1 -1
  12. package/lib/MenuList.js.map +1 -1
  13. package/lib/MenuPopover.js.map +1 -1
  14. package/lib/MenuSplitGroup.js.map +1 -1
  15. package/lib/MenuTrigger.js.map +1 -1
  16. package/lib/components/Menu/Menu.js.map +1 -1
  17. package/lib/components/Menu/Menu.types.js.map +1 -1
  18. package/lib/components/Menu/index.js.map +1 -1
  19. package/lib/components/Menu/renderMenu.js.map +1 -1
  20. package/lib/components/Menu/useMenu.js +21 -7
  21. package/lib/components/Menu/useMenu.js.map +1 -1
  22. package/lib/components/Menu/useMenuContextValues.js +20 -20
  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.map +1 -1
  28. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  29. package/lib/components/MenuDivider/useMenuDividerStyles.js +8 -5
  30. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  31. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  32. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  33. package/lib/components/MenuGroup/index.js.map +1 -1
  34. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  35. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  36. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  37. package/lib/components/MenuGroup/useMenuGroupStyles.js +4 -2
  38. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  39. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  40. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  41. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  42. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  43. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  44. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +4 -2
  45. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  46. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  47. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  48. package/lib/components/MenuItem/index.js.map +1 -1
  49. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  50. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  51. package/lib/components/MenuItem/useMenuItem.js +8 -3
  52. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  53. package/lib/components/MenuItem/useMenuItemStyles.js +62 -28
  54. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  55. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  56. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  57. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  58. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  59. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  60. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +25 -2
  61. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  62. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  63. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  64. package/lib/components/MenuItemRadio/index.js.map +1 -1
  65. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  66. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  67. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +25 -2
  68. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  69. package/lib/components/MenuList/MenuList.js.map +1 -1
  70. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  71. package/lib/components/MenuList/index.js +1 -0
  72. package/lib/components/MenuList/index.js.map +1 -1
  73. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  74. package/lib/components/MenuList/useMenuList.js +2 -2
  75. package/lib/components/MenuList/useMenuList.js.map +1 -1
  76. package/lib/components/MenuList/useMenuListContextValues.js +8 -8
  77. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  78. package/lib/components/MenuList/useMenuListStyles.js +4 -2
  79. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  80. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  81. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  82. package/lib/components/MenuPopover/index.js.map +1 -1
  83. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  84. package/lib/components/MenuPopover/useMenuPopover.js +1 -1
  85. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  86. package/lib/components/MenuPopover/useMenuPopoverStyles.js +4 -2
  87. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  88. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  89. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  90. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  91. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  92. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +1 -1
  93. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  94. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +10 -8
  95. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  96. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  97. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  98. package/lib/components/MenuTrigger/index.js.map +1 -1
  99. package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
  100. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  101. package/lib/components/MenuTrigger/useMenuTrigger.js +2 -1
  102. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  103. package/lib/components/index.js.map +1 -1
  104. package/lib/contexts/menuContext.js.map +1 -1
  105. package/lib/contexts/menuGroupContext.js.map +1 -1
  106. package/lib/contexts/menuListContext.js.map +1 -1
  107. package/lib/contexts/menuTriggerContext.js +1 -1
  108. package/lib/contexts/menuTriggerContext.js.map +1 -1
  109. package/lib/index.js +16 -16
  110. package/lib/index.js.map +1 -1
  111. package/lib/selectable/index.js.map +1 -1
  112. package/lib/selectable/types.js.map +1 -1
  113. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  114. package/lib/utils/index.js.map +1 -1
  115. package/lib/utils/useIsSubmenu.js.map +1 -1
  116. package/lib/utils/useOnMenuEnter.js.map +1 -1
  117. package/lib-commonjs/Menu.js.map +1 -1
  118. package/lib-commonjs/MenuDivider.js.map +1 -1
  119. package/lib-commonjs/MenuGroup.js.map +1 -1
  120. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  121. package/lib-commonjs/MenuItem.js.map +1 -1
  122. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  123. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  124. package/lib-commonjs/MenuList.js.map +1 -1
  125. package/lib-commonjs/MenuPopover.js.map +1 -1
  126. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  127. package/lib-commonjs/MenuTrigger.js.map +1 -1
  128. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  129. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  130. package/lib-commonjs/components/Menu/index.js.map +1 -1
  131. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  132. package/lib-commonjs/components/Menu/useMenu.js +19 -5
  133. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  134. package/lib-commonjs/components/Menu/useMenuContextValues.js +20 -20
  135. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  136. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  137. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  138. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  139. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  140. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  141. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +9 -6
  142. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  143. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  144. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  145. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  146. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  147. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  148. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  149. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +5 -3
  150. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  151. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  152. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  153. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  154. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  155. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  156. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +5 -3
  157. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  158. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  159. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  160. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  161. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  162. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  163. package/lib-commonjs/components/MenuItem/useMenuItem.js +9 -4
  164. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  165. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +64 -29
  166. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  167. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  168. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  169. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  170. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  171. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  172. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +26 -3
  173. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  174. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  175. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  176. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  177. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  178. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  179. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +26 -3
  180. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  181. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  182. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  183. package/lib-commonjs/components/MenuList/index.js +2 -0
  184. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  185. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  186. package/lib-commonjs/components/MenuList/useMenuList.js +2 -2
  187. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  188. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +8 -8
  189. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  190. package/lib-commonjs/components/MenuList/useMenuListStyles.js +5 -3
  191. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  192. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  193. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  194. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  195. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  196. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +1 -1
  197. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  198. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +5 -3
  199. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  200. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  201. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  202. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  203. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  204. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +1 -1
  205. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  206. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +10 -8
  207. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  208. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  209. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  210. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  211. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +1 -1
  212. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  213. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +2 -1
  214. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  215. package/lib-commonjs/components/index.js.map +1 -1
  216. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  217. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  218. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  219. package/lib-commonjs/contexts/menuTriggerContext.js +1 -1
  220. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  221. package/lib-commonjs/index.js +411 -17
  222. package/lib-commonjs/index.js.map +1 -1
  223. package/lib-commonjs/selectable/index.js.map +1 -1
  224. package/lib-commonjs/selectable/types.js.map +1 -1
  225. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  226. package/lib-commonjs/utils/index.js.map +1 -1
  227. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  228. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  229. package/package.json +28 -30
  230. package/lib/Menu.d.ts +0 -1
  231. package/lib/MenuDivider.d.ts +0 -1
  232. package/lib/MenuGroup.d.ts +0 -1
  233. package/lib/MenuGroupHeader.d.ts +0 -1
  234. package/lib/MenuItem.d.ts +0 -1
  235. package/lib/MenuItemCheckbox.d.ts +0 -1
  236. package/lib/MenuItemRadio.d.ts +0 -1
  237. package/lib/MenuList.d.ts +0 -1
  238. package/lib/MenuPopover.d.ts +0 -1
  239. package/lib/MenuSplitGroup.d.ts +0 -1
  240. package/lib/MenuTrigger.d.ts +0 -1
  241. package/lib/components/Menu/Menu.d.ts +0 -6
  242. package/lib/components/Menu/Menu.types.d.ts +0 -113
  243. package/lib/components/Menu/index.d.ts +0 -5
  244. package/lib/components/Menu/renderMenu.d.ts +0 -5
  245. package/lib/components/Menu/useMenu.d.ts +0 -10
  246. package/lib/components/Menu/useMenuContextValues.d.ts +0 -2
  247. package/lib/components/MenuDivider/MenuDivider.d.ts +0 -6
  248. package/lib/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  249. package/lib/components/MenuDivider/index.d.ts +0 -5
  250. package/lib/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  251. package/lib/components/MenuDivider/useMenuDivider.d.ts +0 -6
  252. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +0 -3
  253. package/lib/components/MenuGroup/MenuGroup.d.ts +0 -6
  254. package/lib/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  255. package/lib/components/MenuGroup/index.d.ts +0 -6
  256. package/lib/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  257. package/lib/components/MenuGroup/useMenuGroup.d.ts +0 -6
  258. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  259. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +0 -3
  260. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  261. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  262. package/lib/components/MenuGroupHeader/index.d.ts +0 -5
  263. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  264. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  265. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -3
  266. package/lib/components/MenuItem/MenuItem.d.ts +0 -6
  267. package/lib/components/MenuItem/MenuItem.types.d.ts +0 -43
  268. package/lib/components/MenuItem/index.d.ts +0 -5
  269. package/lib/components/MenuItem/renderMenuItem.d.ts +0 -5
  270. package/lib/components/MenuItem/useCharacterSearch.d.ts +0 -3
  271. package/lib/components/MenuItem/useMenuItem.d.ts +0 -6
  272. package/lib/components/MenuItem/useMenuItemStyles.d.ts +0 -4
  273. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  274. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  275. package/lib/components/MenuItemCheckbox/index.d.ts +0 -5
  276. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  277. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  278. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -3
  279. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  280. package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  281. package/lib/components/MenuItemRadio/index.d.ts +0 -5
  282. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  283. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  284. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -3
  285. package/lib/components/MenuList/MenuList.d.ts +0 -6
  286. package/lib/components/MenuList/MenuList.types.d.ts +0 -55
  287. package/lib/components/MenuList/index.d.ts +0 -6
  288. package/lib/components/MenuList/renderMenuList.d.ts +0 -5
  289. package/lib/components/MenuList/useMenuList.d.ts +0 -6
  290. package/lib/components/MenuList/useMenuListContextValues.d.ts +0 -2
  291. package/lib/components/MenuList/useMenuListStyles.d.ts +0 -6
  292. package/lib/components/MenuPopover/MenuPopover.d.ts +0 -6
  293. package/lib/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  294. package/lib/components/MenuPopover/index.d.ts +0 -5
  295. package/lib/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  296. package/lib/components/MenuPopover/useMenuPopover.d.ts +0 -12
  297. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -6
  298. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +0 -6
  299. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +0 -14
  300. package/lib/components/MenuSplitGroup/index.d.ts +0 -5
  301. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +0 -5
  302. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +0 -12
  303. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +0 -6
  304. package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -8
  305. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +0 -19
  306. package/lib/components/MenuTrigger/index.d.ts +0 -4
  307. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  308. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  309. package/lib/components/index.d.ts +0 -2
  310. package/lib/contexts/menuContext.d.ts +0 -16
  311. package/lib/contexts/menuGroupContext.d.ts +0 -13
  312. package/lib/contexts/menuListContext.d.ts +0 -15
  313. package/lib/contexts/menuTriggerContext.d.ts +0 -3
  314. package/lib/index.d.ts +0 -16
  315. package/lib/selectable/index.d.ts +0 -2
  316. package/lib/selectable/types.d.ts +0 -34
  317. package/lib/selectable/useCheckmarkStyles.d.ts +0 -8
  318. package/lib/utils/index.d.ts +0 -1
  319. package/lib/utils/useIsSubmenu.d.ts +0 -9
  320. package/lib/utils/useOnMenuEnter.d.ts +0 -23
  321. package/lib-commonjs/Menu.d.ts +0 -1
  322. package/lib-commonjs/MenuDivider.d.ts +0 -1
  323. package/lib-commonjs/MenuGroup.d.ts +0 -1
  324. package/lib-commonjs/MenuGroupHeader.d.ts +0 -1
  325. package/lib-commonjs/MenuItem.d.ts +0 -1
  326. package/lib-commonjs/MenuItemCheckbox.d.ts +0 -1
  327. package/lib-commonjs/MenuItemRadio.d.ts +0 -1
  328. package/lib-commonjs/MenuList.d.ts +0 -1
  329. package/lib-commonjs/MenuPopover.d.ts +0 -1
  330. package/lib-commonjs/MenuSplitGroup.d.ts +0 -1
  331. package/lib-commonjs/MenuTrigger.d.ts +0 -1
  332. package/lib-commonjs/components/Menu/Menu.d.ts +0 -6
  333. package/lib-commonjs/components/Menu/Menu.types.d.ts +0 -113
  334. package/lib-commonjs/components/Menu/index.d.ts +0 -5
  335. package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -5
  336. package/lib-commonjs/components/Menu/useMenu.d.ts +0 -10
  337. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +0 -2
  338. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +0 -6
  339. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  340. package/lib-commonjs/components/MenuDivider/index.d.ts +0 -5
  341. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  342. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +0 -6
  343. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +0 -3
  344. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +0 -6
  345. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  346. package/lib-commonjs/components/MenuGroup/index.d.ts +0 -6
  347. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  348. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +0 -6
  349. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  350. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +0 -3
  351. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  352. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  353. package/lib-commonjs/components/MenuGroupHeader/index.d.ts +0 -5
  354. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  355. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  356. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -3
  357. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -6
  358. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +0 -43
  359. package/lib-commonjs/components/MenuItem/index.d.ts +0 -5
  360. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +0 -5
  361. package/lib-commonjs/components/MenuItem/useCharacterSearch.d.ts +0 -3
  362. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +0 -6
  363. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +0 -4
  364. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  365. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  366. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +0 -5
  367. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  368. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  369. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -3
  370. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  371. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  372. package/lib-commonjs/components/MenuItemRadio/index.d.ts +0 -5
  373. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  374. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  375. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -3
  376. package/lib-commonjs/components/MenuList/MenuList.d.ts +0 -6
  377. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +0 -55
  378. package/lib-commonjs/components/MenuList/index.d.ts +0 -6
  379. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +0 -5
  380. package/lib-commonjs/components/MenuList/useMenuList.d.ts +0 -6
  381. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +0 -2
  382. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +0 -6
  383. package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +0 -6
  384. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  385. package/lib-commonjs/components/MenuPopover/index.d.ts +0 -5
  386. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  387. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +0 -12
  388. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -6
  389. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +0 -6
  390. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +0 -14
  391. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +0 -5
  392. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +0 -5
  393. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +0 -12
  394. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +0 -6
  395. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -8
  396. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +0 -19
  397. package/lib-commonjs/components/MenuTrigger/index.d.ts +0 -4
  398. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  399. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  400. package/lib-commonjs/components/index.d.ts +0 -2
  401. package/lib-commonjs/contexts/menuContext.d.ts +0 -16
  402. package/lib-commonjs/contexts/menuGroupContext.d.ts +0 -13
  403. package/lib-commonjs/contexts/menuListContext.d.ts +0 -15
  404. package/lib-commonjs/contexts/menuTriggerContext.d.ts +0 -3
  405. package/lib-commonjs/index.d.ts +0 -16
  406. package/lib-commonjs/selectable/index.d.ts +0 -2
  407. package/lib-commonjs/selectable/types.d.ts +0 -34
  408. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +0 -8
  409. package/lib-commonjs/utils/index.d.ts +0 -1
  410. package/lib-commonjs/utils/useIsSubmenu.d.ts +0 -9
  411. package/lib-commonjs/utils/useOnMenuEnter.d.ts +0 -23
@@ -1,13 +1,15 @@
1
- import { ComponentProps } from '@fluentui/react-utilities';
2
- import { ComponentState } from '@fluentui/react-utilities';
3
- import type { Context } from '@fluentui/react-context-selector';
1
+ /// <reference types="react" />
2
+
3
+ import type { ComponentProps } from '@fluentui/react-utilities';
4
+ import type { ComponentState } from '@fluentui/react-utilities';
4
5
  import type { ContextSelector } from '@fluentui/react-context-selector';
5
6
  import type { FluentTriggerComponent } from '@fluentui/react-utilities';
6
7
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
7
- import { PositioningShorthand } from '@fluentui/react-positioning';
8
+ import type { PositioningShorthand } from '@fluentui/react-positioning';
8
9
  import * as React_2 from 'react';
9
10
  import type { Slot } from '@fluentui/react-utilities';
10
- import { usePopperMouseTarget } from '@fluentui/react-positioning';
11
+ import type { SlotClassNames } from '@fluentui/react-utilities';
12
+ import { usePositioningMouseTarget } from '@fluentui/react-positioning';
11
13
 
12
14
  /**
13
15
  * Wrapper component that manages state for a popup MenuList and a MenuTrigger
@@ -15,50 +17,14 @@ import { usePopperMouseTarget } from '@fluentui/react-positioning';
15
17
  export declare const Menu: React_2.FC<MenuProps>;
16
18
 
17
19
  export declare type MenuCheckedValueChangeData = {
18
- /** The name of the value */
19
- name: string;
20
20
  /** The items for this value that are checked */
21
21
  checkedItems: string[];
22
+ /** The name of the value */
23
+ name: string;
22
24
  };
23
25
 
24
26
  export declare type MenuCheckedValueChangeEvent = React_2.MouseEvent | React_2.KeyboardEvent;
25
27
 
26
- declare type MenuCommons = MenuListCommons & {
27
- /**
28
- * Whether the popup is open
29
- */
30
- open: boolean;
31
- /**
32
- * Call back when the component requests to change value
33
- * The `open` value is used as a hint when directly controlling the component
34
- */
35
- onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
36
- /**
37
- * Whether the popup is open by default
38
- */
39
- defaultOpen?: boolean;
40
- openOnHover: boolean;
41
- /**
42
- * Opens the menu on right click (context menu), removes all other menu open interactions
43
- */
44
- openOnContext?: boolean;
45
- /**
46
- * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
47
- * This option is disregarded for submenus
48
- */
49
- inline?: boolean;
50
- /**
51
- * Do not dismiss the menu when a menu item is clicked
52
- */
53
- persistOnItemClick?: boolean;
54
- /**
55
- * Sets the delay for mouse open/close for the popover one mouse enter/leave
56
- */
57
- hoverDelay?: number;
58
- };
59
-
60
- export declare const MenuContext: Context<MenuContextValue>;
61
-
62
28
  /**
63
29
  * Context shared between Menu and its children components
64
30
  *
@@ -78,7 +44,7 @@ export declare type MenuContextValues = {
78
44
  */
79
45
  export declare const MenuDivider: ForwardRefComponent<MenuDividerProps>;
80
46
 
81
- export declare const menuDividerClassName = "fui-MenuDivider";
47
+ export declare const menuDividerClassNames: SlotClassNames<MenuDividerSlots>;
82
48
 
83
49
  export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
84
50
 
@@ -93,7 +59,7 @@ export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
93
59
  */
94
60
  export declare const MenuGroup: ForwardRefComponent<MenuGroupProps>;
95
61
 
96
- export declare const menuGroupClassName = "fui-MenuGroup";
62
+ export declare const menuGroupClassNames: SlotClassNames<MenuGroupSlots>;
97
63
 
98
64
  export declare const MenuGroupContextProvider: React_2.Provider<MenuGroupContextValue>;
99
65
 
@@ -117,7 +83,7 @@ export declare type MenuGroupContextValues = {
117
83
  */
118
84
  export declare const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>;
119
85
 
120
- export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
86
+ export declare const menuGroupHeaderClassNames: SlotClassNames<MenuGroupHeaderSlots>;
121
87
 
122
88
  export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
123
89
 
@@ -150,37 +116,41 @@ export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
150
116
  */
151
117
  export declare const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>;
152
118
 
153
- export declare const menuItemCheckboxClassName = "fui-MenuItemCheckbox";
119
+ export declare const menuItemCheckboxClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>>;
154
120
 
155
121
  export declare type MenuItemCheckboxProps = MenuItemProps & MenuItemSelectableProps;
156
122
 
157
123
  export declare type MenuItemCheckboxState = MenuItemState & MenuItemSelectableState;
158
124
 
159
- export declare const menuItemClassName = "fui-MenuItem";
125
+ export declare const menuItemClassNames: SlotClassNames<MenuItemSlots>;
160
126
 
161
- declare type MenuItemCommons = {
162
- /**
163
- * If the menu item is a trigger for a submenu
164
- */
165
- hasSubmenu?: boolean;
127
+ export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & {
166
128
  /**
167
129
  * Applies disabled styles to menu item but remains focusable
130
+ *
131
+ * @default false
168
132
  */
169
133
  disabled?: boolean;
134
+ /**
135
+ * If the menu item is a trigger for a submenu
136
+ *
137
+ * @default false
138
+ */
139
+ hasSubmenu?: boolean;
170
140
  /**
171
141
  * Clicking on the menu item will not dismiss an open menu
142
+ *
143
+ * @default false
172
144
  */
173
145
  persistOnClick?: boolean;
174
146
  };
175
147
 
176
- export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & MenuItemCommons;
177
-
178
148
  /**
179
149
  * Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
180
150
  */
181
151
  export declare const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>;
182
152
 
183
- export declare const menuItemRadioClassName = "fui-MenuItemRadio";
153
+ export declare const menuItemRadioClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>>;
184
154
 
185
155
  export declare type MenuItemRadioProps = MenuItemProps & MenuItemSelectableProps;
186
156
 
@@ -246,102 +216,98 @@ export declare type MenuItemSlots = {
246
216
  secondaryContent?: Slot<'span'>;
247
217
  };
248
218
 
249
- export declare type MenuItemState = ComponentState<MenuItemSlots> & MenuItemCommons;
219
+ export declare type MenuItemState = ComponentState<MenuItemSlots> & Pick<MenuItemProps, 'disabled' | 'hasSubmenu' | 'persistOnClick'>;
250
220
 
251
221
  /**
252
222
  * Define a styled MenuList, using the `useMenuList_unstable` hook.
253
223
  */
254
224
  export declare const MenuList: ForwardRefComponent<MenuListProps>;
255
225
 
256
- export declare const menuListClassName = "fui-MenuList";
226
+ export declare const menuListClassNames: SlotClassNames<MenuListSlots>;
257
227
 
258
- declare type MenuListCommons = {
259
- /**
260
- * Callback when checked items change for value with a name
261
- *
262
- * @param event - React's original SyntheticEvent
263
- * @param data - A data object with relevant information
264
- */
265
- onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
228
+ /**
229
+ * Context shared between MenuList and its children components
230
+ */
231
+ export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
232
+ setFocusByFirstCharacter?: (e: React_2.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
233
+ toggleCheckbox?: SelectableHandler;
234
+ selectRadio?: SelectableHandler;
235
+ };
236
+
237
+ export declare type MenuListContextValues = {
238
+ menuList: MenuListContextValue;
239
+ };
240
+
241
+ export declare type MenuListProps = ComponentProps<MenuListSlots> & {
266
242
  /**
267
243
  * Map of all checked values
268
244
  */
269
- checkedValues: Record<string, string[]>;
245
+ checkedValues?: Record<string, string[]>;
270
246
  /**
271
247
  * Default values to be checked on mount
272
248
  */
273
249
  defaultCheckedValues?: Record<string, string[]>;
250
+ /**
251
+ * States that menu items can contain selectable items and reserve slots for item alignment
252
+ */
253
+ hasCheckmarks?: boolean;
274
254
  /**
275
255
  * States that menu items can contain icons and reserve slots for item alignment
276
256
  */
277
257
  hasIcons?: boolean;
278
258
  /**
279
- * States that menu items can contain selectable items and reserve slots for item alignment
259
+ * Callback when checked items change for value with a name
260
+ *
261
+ * @param event - React's original SyntheticEvent
262
+ * @param data - A data object with relevant information
280
263
  */
281
- hasCheckmarks?: boolean;
282
- };
283
-
284
- export declare const MenuListContext: Context<MenuListContextValue>;
285
-
286
- /**
287
- * Context shared between MenuList and its children components
288
- */
289
- export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
290
- setFocusByFirstCharacter?: (e: React_2.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
291
- toggleCheckbox?: SelectableHandler;
292
- selectRadio?: SelectableHandler;
293
- };
294
-
295
- export declare type MenuListContextValues = {
296
- menuList: MenuListContextValue;
264
+ onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
297
265
  };
298
266
 
299
- export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
300
-
301
267
  export declare const MenuListProvider: React_2.Provider<MenuListContextValue> & React_2.FC<React_2.ProviderProps<MenuListContextValue>>;
302
268
 
303
269
  export declare type MenuListSlots = {
304
270
  root: Slot<'div'>;
305
271
  };
306
272
 
307
- export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
273
+ export declare type MenuListState = ComponentState<MenuListSlots> & Pick<MenuListProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & Required<Pick<MenuListProps, 'checkedValues' | 'hasCheckmarks' | 'hasIcons'>> & {
274
+ /**
275
+ * Selects a radio item, will de-select the currently selected ratio item
276
+ */
277
+ selectRadio: SelectableHandler;
308
278
  /**
309
279
  * Callback to set focus on the next menu item by first character
310
280
  */
311
281
  setFocusByFirstCharacter: NonNullable<MenuListContextValue['setFocusByFirstCharacter']>;
312
282
  toggleCheckbox: SelectableHandler;
313
- /**
314
- * Selects a radio item, will de-select the currently selected ratio item
315
- */
316
- selectRadio: SelectableHandler;
317
283
  };
318
284
 
319
285
  /**
320
286
  * Data attached to open/close events
321
287
  */
322
288
  export declare type MenuOpenChangeData = {
323
- open: boolean;
324
- /**
325
- * Indicates whether the change of state was a keyboard interaction
326
- */
327
- keyboard?: boolean;
328
289
  /**
329
290
  * indicates whether the request for the open state was bubbled from a nested menu
330
291
  */
331
292
  bubble?: boolean;
293
+ /**
294
+ * Indicates whether the change of state was a keyboard interaction
295
+ */
296
+ keyboard?: boolean;
297
+ open: boolean;
332
298
  };
333
299
 
334
300
  /**
335
301
  * The supported events that will trigger open/close of the menu
336
302
  */
337
- export declare type MenuOpenEvents = MouseEvent | TouchEvent | React_2.MouseEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.FocusEvent<HTMLElement>;
303
+ export declare type MenuOpenEvents = MouseEvent | TouchEvent | React_2.FocusEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement>;
338
304
 
339
305
  /**
340
306
  * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
341
307
  */
342
308
  export declare const MenuPopover: ForwardRefComponent<MenuPopoverProps>;
343
309
 
344
- export declare const menuPopoverClassName = "fui-MenuPopover";
310
+ export declare const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots>;
345
311
 
346
312
  /**
347
313
  * MenuPopover Props
@@ -366,16 +332,68 @@ export declare type MenuPopoverState = ComponentState<MenuPopoverSlots> & {
366
332
  /**
367
333
  * Extends and drills down Menulist props to simplify API
368
334
  */
369
- export declare type MenuProps = Partial<MenuCommons> & ComponentProps<MenuSlots> & {
335
+ export declare type MenuProps = ComponentProps<MenuSlots> & Pick<MenuListProps, 'checkedValues' | 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'onCheckedValueChange'> & {
370
336
  /**
371
337
  * Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.
372
338
  * Alternatively can only contain {@link MenuPopover} if using a custom `target`.
373
339
  */
374
340
  children: [JSX.Element, JSX.Element] | JSX.Element;
341
+ /**
342
+ * Whether the popup is open by default
343
+ *
344
+ * @default false
345
+ */
346
+ defaultOpen?: boolean;
347
+ /**
348
+ * Sets the delay for mouse open/close for the popover one mouse enter/leave
349
+ */
350
+ hoverDelay?: number;
351
+ /**
352
+ * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
353
+ * This option is disregarded for submenus
354
+ *
355
+ * @default false
356
+ */
357
+ inline?: boolean;
358
+ /**
359
+ * Call back when the component requests to change value
360
+ * The `open` value is used as a hint when directly controlling the component
361
+ */
362
+ onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
363
+ /**
364
+ * Whether the popup is open
365
+ *
366
+ * @default false
367
+ */
368
+ open?: boolean;
369
+ /**
370
+ * Opens the menu on right click (context menu), removes all other menu open interactions
371
+ *
372
+ * @default false
373
+ */
374
+ openOnContext?: boolean;
375
+ /**
376
+ * Opens the menu on hover
377
+ *
378
+ * @default false
379
+ */
380
+ openOnHover?: boolean;
381
+ /**
382
+ * Do not dismiss the menu when a menu item is clicked
383
+ *
384
+ * @default false
385
+ */
386
+ persistOnItemClick?: boolean;
375
387
  /**
376
388
  * Configures the positioned menu
377
389
  */
378
390
  positioning?: PositioningShorthand;
391
+ /**
392
+ * Close when scroll outside of it
393
+ *
394
+ * @default false
395
+ */
396
+ closeOnScroll?: boolean;
379
397
  };
380
398
 
381
399
  export declare const MenuProvider: React_2.Provider<MenuContextValue> & React_2.FC<React_2.ProviderProps<MenuContextValue>>;
@@ -387,14 +405,12 @@ export declare type MenuSlots = {};
387
405
  */
388
406
  export declare const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>;
389
407
 
390
- export declare const menuSplitGroupClassName = "fui-MenuSplitGroup";
391
-
392
- declare type MenuSplitGroupCommons = {};
408
+ export declare const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots>;
393
409
 
394
410
  /**
395
411
  * MenuSplitGroup Props
396
412
  */
397
- export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;
413
+ export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots>;
398
414
 
399
415
  export declare type MenuSplitGroupSlots = {
400
416
  root: Slot<'div'>;
@@ -403,45 +419,45 @@ export declare type MenuSplitGroupSlots = {
403
419
  /**
404
420
  * State used in rendering MenuSplitGroup
405
421
  */
406
- export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots> & MenuSplitGroupCommons;
422
+ export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots>;
407
423
 
408
- export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
424
+ export declare type MenuState = ComponentState<MenuSlots> & Pick<MenuProps, 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'inline' | 'onOpenChange' | 'openOnContext' | 'persistOnItemClick'> & Required<Pick<MenuProps, 'checkedValues' | 'onCheckedValueChange' | 'open' | 'openOnHover' | 'closeOnScroll'>> & {
409
425
  /**
410
- * Callback to open/close the popup
426
+ * Anchors the popper to the mouse click for context events
411
427
  */
412
- setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
428
+ contextTarget: ReturnType<typeof usePositioningMouseTarget>[0];
413
429
  /**
414
- * Internal react node that just simplifies handling children
430
+ * Whether this menu is a submenu
415
431
  */
416
- menuPopover: React_2.ReactNode;
432
+ isSubmenu: boolean;
417
433
  /**
418
434
  * Internal react node that just simplifies handling children
419
435
  */
420
- menuTrigger: React_2.ReactNode;
436
+ menuPopover: React_2.ReactNode;
421
437
  /**
422
438
  * The ref for the popup
423
439
  */
424
440
  menuPopoverRef: React_2.MutableRefObject<HTMLElement>;
425
441
  /**
426
- * The ref for the MenuTrigger, used for popup positioning
442
+ * Internal react node that just simplifies handling children
427
443
  */
428
- triggerRef: React_2.MutableRefObject<HTMLElement>;
444
+ menuTrigger: React_2.ReactNode;
429
445
  /**
430
- * Id for the MenuTrigger element for aria relationship
446
+ * A callback to set the target of the popper to the mouse click for context events
431
447
  */
432
- triggerId: string;
448
+ setContextTarget: ReturnType<typeof usePositioningMouseTarget>[1];
433
449
  /**
434
- * Whether this menu is a submenu
450
+ * Callback to open/close the popup
435
451
  */
436
- isSubmenu: boolean;
452
+ setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
437
453
  /**
438
- * Anchors the popper to the mouse click for context events
454
+ * Id for the MenuTrigger element for aria relationship
439
455
  */
440
- contextTarget: ReturnType<typeof usePopperMouseTarget>[0];
456
+ triggerId: string;
441
457
  /**
442
- * A callback to set the target of the popper to the mouse click for context events
458
+ * The ref for the MenuTrigger, used for popup positioning
443
459
  */
444
- setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];
460
+ triggerRef: React_2.MutableRefObject<HTMLElement>;
445
461
  };
446
462
 
447
463
  /**
@@ -471,6 +487,7 @@ export declare type MenuTriggerProps = {
471
487
 
472
488
  export declare type MenuTriggerState = {
473
489
  children: React_2.ReactElement | null;
490
+ isSubmenu: boolean;
474
491
  };
475
492
 
476
493
  /**
@@ -534,7 +551,7 @@ export declare const renderMenuTrigger_unstable: (state: MenuTriggerState) => JS
534
551
 
535
552
  export declare type SelectableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked: boolean) => void;
536
553
 
537
- export declare type UninitializedMenuListState = Omit<MenuListState, 'setFocusByFirstCharacter' | 'toggleCheckbox' | 'selectRadio' | 'checkedValues'> & Partial<Pick<MenuListState, 'checkedValues'>>;
554
+ export declare type UninitializedMenuListState = Omit<MenuListState, 'checkedValues' | 'selectRadio' | 'setFocusByFirstCharacter' | 'toggleCheckbox'> & Partial<Pick<MenuListState, 'checkedValues'>>;
538
555
 
539
556
  /**
540
557
  * Applies styles to a checkmark slot for selectable menu items
File without changes
package/lib/Menu.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"../src/","sources":["Menu.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Menu/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuDivider.js","sourceRoot":"","sources":["../src/MenuDivider.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"MenuDivider.js","sourceRoot":"../src/","sources":["MenuDivider.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuDivider/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["../src/MenuGroup.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"MenuGroup.js","sourceRoot":"../src/","sources":["MenuGroup.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './components/MenuGroup/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuGroupHeader.js","sourceRoot":"","sources":["../src/MenuGroupHeader.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"MenuGroupHeader.js","sourceRoot":"../src/","sources":["MenuGroupHeader.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/MenuGroupHeader/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"MenuItem.js","sourceRoot":"../src/","sources":["MenuItem.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/MenuItem/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemCheckbox.js","sourceRoot":"","sources":["../src/MenuItemCheckbox.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"MenuItemCheckbox.js","sourceRoot":"../src/","sources":["MenuItemCheckbox.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC","sourcesContent":["export * from './components/MenuItemCheckbox/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemRadio.js","sourceRoot":"","sources":["../src/MenuItemRadio.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"MenuItemRadio.js","sourceRoot":"../src/","sources":["MenuItemRadio.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/MenuItemRadio/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../src/MenuList.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"MenuList.js","sourceRoot":"../src/","sources":["MenuList.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/MenuList/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuPopover.js","sourceRoot":"","sources":["../src/MenuPopover.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"MenuPopover.js","sourceRoot":"../src/","sources":["MenuPopover.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuPopover/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSplitGroup.js","sourceRoot":"","sources":["../src/MenuSplitGroup.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"MenuSplitGroup.js","sourceRoot":"../src/","sources":["MenuSplitGroup.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/MenuSplitGroup/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.js","sourceRoot":"","sources":["../src/MenuTrigger.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"MenuTrigger.js","sourceRoot":"../src/","sources":["MenuTrigger.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuTrigger/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,mBAAT,QAAoC,cAApC;AAGA;;AAEG;;AACH,OAAO,MAAM,IAAI,GAAwB,KAAK,IAAG;AAC/C,QAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,CAA9B;AACA,QAAM,aAAa,GAAG,6BAA6B,CAAC,KAAD,CAAnD;AAEA,SAAO,mBAAmB,CAAC,KAAD,EAAQ,aAAR,CAA1B;AACD,CALM;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","sourceRoot":""}
1
+ {"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,mBAAT,QAAoC,cAApC;AAGA;;AAEG;;AACH,OAAO,MAAM,IAAI,GAAwB,KAAK,IAAG;EAC/C,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,CAA9B;EACA,MAAM,aAAa,GAAG,6BAA6B,CAAC,KAAD,CAAnD;EAEA,OAAO,mBAAmB,CAAC,KAAD,EAAQ,aAAR,CAA1B;AACD,CALM;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","sourcesContent":["import * as React from 'react';\nimport { useMenu_unstable } from './useMenu';\nimport { useMenuContextValues_unstable } from './useMenuContextValues';\nimport { renderMenu_unstable } from './renderMenu';\nimport type { MenuProps } from './Menu.types';\n\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */\nexport const Menu: React.FC<MenuProps> = props => {\n const state = useMenu_unstable(props);\n const contextValues = useMenuContextValues_unstable(state);\n\n return renderMenu_unstable(state, contextValues);\n};\n\nMenu.displayName = 'Menu';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.types.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Menu.types.js","sourceRoot":"../src/","sources":["components/Menu/Menu.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport type { PositioningShorthand } from '@fluentui/react-positioning';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { MenuContextValue } from '../../contexts/menuContext';\nimport type { MenuListProps } from '../MenuList/MenuList.types';\n\nexport type MenuSlots = {};\n\n/**\n * Extends and drills down Menulist props to simplify API\n */\nexport type MenuProps = ComponentProps<MenuSlots> &\n Pick<\n MenuListProps,\n 'checkedValues' | 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'onCheckedValueChange'\n > & {\n /**\n * Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.\n * Alternatively can only contain {@link MenuPopover} if using a custom `target`.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n\n /**\n * Whether the popup is open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Sets the delay for mouse open/close for the popover one mouse enter/leave\n */\n hoverDelay?: number;\n\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Call back when the component requests to change value\n * The `open` value is used as a hint when directly controlling the component\n */\n onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Whether the popup is open\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Opens the menu on right click (context menu), removes all other menu open interactions\n *\n * @default false\n */\n openOnContext?: boolean;\n\n /**\n * Opens the menu on hover\n *\n * @default false\n */\n openOnHover?: boolean;\n\n /**\n * Do not dismiss the menu when a menu item is clicked\n *\n * @default false\n */\n persistOnItemClick?: boolean;\n\n /**\n * Configures the positioned menu\n */\n positioning?: PositioningShorthand;\n\n /**\n * Close when scroll outside of it\n *\n * @default false\n */\n closeOnScroll?: boolean;\n };\n\nexport type MenuState = ComponentState<MenuSlots> &\n Pick<\n MenuProps,\n | 'defaultCheckedValues'\n | 'hasCheckmarks'\n | 'hasIcons'\n | 'inline'\n | 'onOpenChange'\n | 'openOnContext'\n | 'persistOnItemClick'\n > &\n Required<Pick<MenuProps, 'checkedValues' | 'onCheckedValueChange' | 'open' | 'openOnHover' | 'closeOnScroll'>> & {\n /**\n * Anchors the popper to the mouse click for context events\n */\n contextTarget: ReturnType<typeof usePositioningMouseTarget>[0];\n\n /**\n * Whether this menu is a submenu\n */\n isSubmenu: boolean;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuPopover: React.ReactNode;\n\n /**\n * The ref for the popup\n */\n menuPopoverRef: React.MutableRefObject<HTMLElement>;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuTrigger: React.ReactNode;\n\n /**\n * A callback to set the target of the popper to the mouse click for context events\n */\n setContextTarget: ReturnType<typeof usePositioningMouseTarget>[1];\n\n /**\n * Callback to open/close the popup\n */\n setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Id for the MenuTrigger element for aria relationship\n */\n triggerId: string;\n\n /**\n * The ref for the MenuTrigger, used for popup positioning\n */\n triggerRef: React.MutableRefObject<HTMLElement>;\n };\n\n/**\n * Data attached to open/close events\n */\nexport type MenuOpenChangeData = {\n /**\n * indicates whether the request for the open state was bubbled from a nested menu\n */\n bubble?: boolean;\n /**\n * Indicates whether the change of state was a keyboard interaction\n */\n keyboard?: boolean;\n open: boolean;\n};\n\nexport type MenuContextValues = {\n menu: MenuContextValue;\n};\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type MenuOpenEvents =\n | MouseEvent\n | TouchEvent\n | React.FocusEvent<HTMLElement>\n | React.KeyboardEvent<HTMLElement>\n | React.MouseEvent<HTMLElement>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './Menu';\nexport * from './Menu.types';\nexport * from './renderMenu';\nexport * from './useMenu';\nexport * from './useMenuContextValues';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAmB,aAAnB,KAAuD;AACxF,sBACE,KAAA,CAAA,aAAA,CAAC,YAAD,EAAa;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAb,EACG,KAAK,CAAC,WADT,EAEG,KAAK,CAAC,IAAN,IAAc,KAAK,CAAC,WAFvB,CADF;AAMD,CAPM","sourceRoot":""}
1
+ {"version":3,"sources":["components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAmB,aAAnB,KAAuD;EACxF,oBACE,KAAA,CAAA,aAAA,CAAC,YAAD,EAAa;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAb,EACG,KAAK,CAAC,WADT,EAEG,KAAK,CAAC,IAAN,IAAc,KAAK,CAAC,WAFvB,CADF;AAMD,CAPM","sourcesContent":["import * as React from 'react';\nimport { MenuProvider } from '../../contexts/menuContext';\nimport type { MenuContextValues, MenuState } from './Menu.types';\n\n/**\n * Render the final JSX of Menu\n */\nexport const renderMenu_unstable = (state: MenuState, contextValues: MenuContextValues) => {\n return (\n <MenuProvider value={contextValues.menu}>\n {state.menuTrigger}\n {state.open && state.menuPopover}\n </MenuProvider>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { usePopperMouseTarget, usePopper, resolvePositioningShorthand } from '@fluentui/react-positioning';
3
- import { useControllableState, useId, useOnClickOutside, useEventCallback } from '@fluentui/react-utilities';
4
- import { useFluent } from '@fluentui/react-shared-contexts';
2
+ import { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';
3
+ import { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside } from '@fluentui/react-utilities';
4
+ import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
5
5
  import { elementContains } from '@fluentui/react-portal';
6
6
  import { useFocusFinders } from '@fluentui/react-tabster';
7
7
  import { useMenuContext_unstable } from '../../contexts/menuContext';
@@ -17,10 +17,12 @@ import { useIsSubmenu } from '../../utils/useIsSubmenu';
17
17
  */
18
18
 
19
19
  export const useMenu_unstable = props => {
20
+ var _a;
21
+
20
22
  const triggerId = useId('menu');
21
23
  const isSubmenu = useIsSubmenu();
22
- const [contextTarget, setContextTarget] = usePopperMouseTarget();
23
- const popperState = {
24
+ const [contextTarget, setContextTarget] = usePositioningMouseTarget();
25
+ const positioningState = {
24
26
  position: isSubmenu ? 'after' : 'below',
25
27
  align: isSubmenu ? 'top' : 'start',
26
28
  target: props.openOnContext ? contextTarget : undefined,
@@ -53,7 +55,7 @@ export const useMenu_unstable = props => {
53
55
  const {
54
56
  targetRef: triggerRef,
55
57
  containerRef: menuPopoverRef
56
- } = usePopper(popperState);
58
+ } = usePositioning(positioningState);
57
59
  const initialState = {
58
60
  hoverDelay: 500,
59
61
  triggerId,
@@ -62,6 +64,7 @@ export const useMenu_unstable = props => {
62
64
  contextTarget,
63
65
  setContextTarget,
64
66
  ...props,
67
+ closeOnScroll: (_a = props.closeOnScroll) !== null && _a !== void 0 ? _a : false,
65
68
  menuTrigger,
66
69
  menuPopover,
67
70
  triggerRef,
@@ -187,10 +190,21 @@ const useMenuOpenState = state => {
187
190
  contains: elementContains,
188
191
  disabled: !open,
189
192
  element: targetDocument,
190
- refs: [state.menuPopoverRef, state.triggerRef],
193
+ refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),
191
194
  callback: e => setOpen(e, {
192
195
  open: false
193
196
  })
197
+ }); // only close on scroll for context, or when closeOnScroll is specified
198
+
199
+ const closeOnScroll = state.openOnContext || state.closeOnScroll;
200
+ useOnScrollOutside({
201
+ contains: elementContains,
202
+ element: targetDocument,
203
+ callback: ev => setOpen(ev, {
204
+ open: false
205
+ }),
206
+ refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),
207
+ disabled: !open || !closeOnScroll
194
208
  });
195
209
  useOnMenuMouseEnter({
196
210
  element: targetDocument,