@fluentui/react-menu 0.0.0-nightlyebf02572f720211207.1 → 0.0.0-nightlyf3017f159620220222.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. package/CHANGELOG.json +313 -29
  2. package/CHANGELOG.md +71 -16
  3. package/Spec.md +21 -16
  4. package/dist/react-menu.d.ts +112 -68
  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.d.ts +1 -0
  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 +6 -6
  19. package/lib/components/Menu/Menu.js.map +1 -1
  20. package/lib/components/Menu/Menu.types.d.ts +1 -1
  21. package/lib/components/Menu/Menu.types.js.map +1 -1
  22. package/lib/components/Menu/index.js.map +1 -1
  23. package/lib/components/Menu/renderMenu.d.ts +1 -1
  24. package/lib/components/Menu/renderMenu.js +1 -1
  25. package/lib/components/Menu/renderMenu.js.map +1 -1
  26. package/lib/components/Menu/useMenu.d.ts +2 -2
  27. package/lib/components/Menu/useMenu.js +33 -25
  28. package/lib/components/Menu/useMenu.js.map +1 -1
  29. package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
  30. package/lib/components/Menu/useMenuContextValues.js +1 -1
  31. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  32. package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
  33. package/lib/components/MenuDivider/MenuDivider.js +7 -7
  34. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  35. package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  36. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  37. package/lib/components/MenuDivider/index.js.map +1 -1
  38. package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  39. package/lib/components/MenuDivider/renderMenuDivider.js +3 -2
  40. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  41. package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
  42. package/lib/components/MenuDivider/useMenuDivider.js +4 -1
  43. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  44. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  45. package/lib/components/MenuDivider/useMenuDividerStyles.js +3 -2
  46. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  47. package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
  48. package/lib/components/MenuGroup/MenuGroup.js +9 -9
  49. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  50. package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  51. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  52. package/lib/components/MenuGroup/index.js.map +1 -1
  53. package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  54. package/lib/components/MenuGroup/renderMenuGroup.js +3 -2
  55. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  56. package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
  57. package/lib/components/MenuGroup/useMenuGroup.js +4 -1
  58. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  59. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  60. package/lib/components/MenuGroup/useMenuGroupContextValues.js +1 -1
  61. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  62. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
  63. package/lib/components/MenuGroup/useMenuGroupStyles.js +2 -2
  64. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  65. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  66. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +7 -7
  67. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  68. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  69. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  70. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  71. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  72. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +3 -2
  73. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  74. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  75. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +6 -3
  76. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  77. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  78. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +3 -2
  79. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  80. package/lib/components/MenuItem/MenuItem.d.ts +1 -1
  81. package/lib/components/MenuItem/MenuItem.js +7 -9
  82. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  83. package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
  84. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  85. package/lib/components/MenuItem/index.js.map +1 -1
  86. package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
  87. package/lib/components/MenuItem/renderMenuItem.js +9 -4
  88. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  89. package/lib/components/MenuItem/useCharacterSearch.js +2 -2
  90. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  91. package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
  92. package/lib/components/MenuItem/useMenuItem.js +14 -16
  93. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  94. package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -1
  95. package/lib/components/MenuItem/useMenuItemStyles.js +21 -22
  96. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  97. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  98. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
  99. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  100. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  101. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  102. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  103. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +8 -4
  104. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  105. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  106. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +6 -6
  107. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  108. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
  109. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +6 -6
  110. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  111. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  112. package/lib/components/MenuItemRadio/MenuItemRadio.js +7 -7
  113. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  114. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  115. package/lib/components/MenuItemRadio/index.js.map +1 -1
  116. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  117. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +8 -4
  118. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  119. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  120. package/lib/components/MenuItemRadio/useMenuItemRadio.js +6 -6
  121. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  122. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
  123. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +6 -6
  124. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  125. package/lib/components/MenuList/MenuList.d.ts +1 -1
  126. package/lib/components/MenuList/MenuList.js +9 -9
  127. package/lib/components/MenuList/MenuList.js.map +1 -1
  128. package/lib/components/MenuList/MenuList.types.d.ts +4 -4
  129. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  130. package/lib/components/MenuList/index.d.ts +1 -1
  131. package/lib/components/MenuList/index.js +0 -1
  132. package/lib/components/MenuList/index.js.map +1 -1
  133. package/lib/components/MenuList/renderMenuList.d.ts +1 -1
  134. package/lib/components/MenuList/renderMenuList.js +3 -2
  135. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  136. package/lib/components/MenuList/useMenuList.d.ts +1 -1
  137. package/lib/components/MenuList/useMenuList.js +11 -8
  138. package/lib/components/MenuList/useMenuList.js.map +1 -1
  139. package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
  140. package/lib/components/MenuList/useMenuListContextValues.js +1 -1
  141. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  142. package/lib/components/MenuList/useMenuListStyles.d.ts +1 -1
  143. package/lib/components/MenuList/useMenuListStyles.js +2 -2
  144. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  145. package/lib/components/MenuPopover/MenuPopover.js +6 -6
  146. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  147. package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  148. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  149. package/lib/components/MenuPopover/index.js.map +1 -1
  150. package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  151. package/lib/components/MenuPopover/renderMenuPopover.js +5 -3
  152. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  153. package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
  154. package/lib/components/MenuPopover/useMenuPopover.js +11 -8
  155. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  156. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
  157. package/lib/components/MenuPopover/useMenuPopoverStyles.js +3 -2
  158. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  159. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  160. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  161. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  162. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  163. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  164. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  165. package/lib/components/MenuSplitGroup/index.d.ts +5 -0
  166. package/lib/components/MenuSplitGroup/index.js +6 -0
  167. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  168. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  169. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  170. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  171. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  172. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  173. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  174. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  175. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
  176. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  177. package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  178. package/lib/components/MenuTrigger/MenuTrigger.js +5 -4
  179. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  180. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
  181. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  182. package/lib/components/MenuTrigger/index.js.map +1 -1
  183. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  184. package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
  185. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  186. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  187. package/lib/components/MenuTrigger/useMenuTrigger.js +168 -5
  188. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  189. package/lib/components/index.js.map +1 -1
  190. package/lib/contexts/menuContext.d.ts +1 -1
  191. package/lib/contexts/menuContext.js +1 -1
  192. package/lib/contexts/menuContext.js.map +1 -1
  193. package/lib/contexts/menuGroupContext.d.ts +1 -1
  194. package/lib/contexts/menuGroupContext.js +1 -1
  195. package/lib/contexts/menuGroupContext.js.map +1 -1
  196. package/lib/contexts/menuListContext.d.ts +1 -1
  197. package/lib/contexts/menuListContext.js +1 -1
  198. package/lib/contexts/menuListContext.js.map +1 -1
  199. package/lib/contexts/menuTriggerContext.d.ts +1 -1
  200. package/lib/contexts/menuTriggerContext.js +2 -2
  201. package/lib/contexts/menuTriggerContext.js.map +1 -1
  202. package/lib/index.d.ts +11 -10
  203. package/lib/index.js +11 -10
  204. package/lib/index.js.map +1 -1
  205. package/lib/selectable/index.js.map +1 -1
  206. package/lib/selectable/types.js.map +1 -1
  207. package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
  208. package/lib/selectable/useCheckmarkStyles.js +2 -2
  209. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  210. package/lib/utils/index.js.map +1 -1
  211. package/lib/utils/useIsSubmenu.js +2 -2
  212. package/lib/utils/useIsSubmenu.js.map +1 -1
  213. package/lib/utils/useOnMenuEnter.js.map +1 -1
  214. package/lib-commonjs/Menu.js.map +1 -1
  215. package/lib-commonjs/MenuDivider.js.map +1 -1
  216. package/lib-commonjs/MenuGroup.js.map +1 -1
  217. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  218. package/lib-commonjs/MenuItem.js.map +1 -1
  219. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  220. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  221. package/lib-commonjs/MenuList.js.map +1 -1
  222. package/lib-commonjs/MenuPopover.js.map +1 -1
  223. package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
  224. package/lib-commonjs/MenuSplitGroup.js +10 -0
  225. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  226. package/lib-commonjs/MenuTrigger.js.map +1 -1
  227. package/lib-commonjs/components/Menu/Menu.js +3 -3
  228. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  229. package/lib-commonjs/components/Menu/Menu.types.d.ts +1 -1
  230. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  231. package/lib-commonjs/components/Menu/index.js.map +1 -1
  232. package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
  233. package/lib-commonjs/components/Menu/renderMenu.js +3 -3
  234. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  235. package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
  236. package/lib-commonjs/components/Menu/useMenu.js +38 -31
  237. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  238. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
  239. package/lib-commonjs/components/Menu/useMenuContextValues.js +3 -3
  240. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  241. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
  242. package/lib-commonjs/components/MenuDivider/MenuDivider.js +4 -4
  243. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  244. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  245. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  246. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  247. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  248. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +5 -4
  249. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  250. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
  251. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +6 -3
  252. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  253. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  254. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
  255. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  256. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
  257. package/lib-commonjs/components/MenuGroup/MenuGroup.js +5 -5
  258. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  259. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  260. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  261. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  262. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  263. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +5 -4
  264. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  265. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
  266. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +6 -3
  267. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  268. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  269. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +3 -3
  270. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  271. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
  272. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +5 -5
  273. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  274. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  275. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +4 -4
  276. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  277. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  278. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  279. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  280. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  281. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +5 -4
  282. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  283. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  284. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +7 -4
  285. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  286. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  287. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
  288. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  289. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
  290. package/lib-commonjs/components/MenuItem/MenuItem.js +4 -7
  291. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  292. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
  293. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  294. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  295. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +1 -1
  296. package/lib-commonjs/components/MenuItem/renderMenuItem.js +11 -7
  297. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  298. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +1 -1
  299. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  300. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +2 -6
  301. package/lib-commonjs/components/MenuItem/useMenuItem.js +13 -15
  302. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  303. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -1
  304. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +30 -29
  305. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  306. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  307. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +4 -4
  308. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  309. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  310. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  311. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  312. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -7
  313. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  314. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  315. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +6 -6
  316. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  317. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
  318. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +7 -7
  319. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  320. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  321. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +4 -4
  322. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  323. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  324. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  325. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  326. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -7
  327. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  328. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  329. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +6 -6
  330. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  331. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
  332. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +7 -7
  333. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  334. package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
  335. package/lib-commonjs/components/MenuList/MenuList.js +5 -5
  336. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  337. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +4 -4
  338. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  339. package/lib-commonjs/components/MenuList/index.d.ts +1 -1
  340. package/lib-commonjs/components/MenuList/index.js +0 -2
  341. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  342. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
  343. package/lib-commonjs/components/MenuList/renderMenuList.js +5 -4
  344. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  345. package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
  346. package/lib-commonjs/components/MenuList/useMenuList.js +12 -9
  347. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  348. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
  349. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +3 -3
  350. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  351. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -1
  352. package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -6
  353. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  354. package/lib-commonjs/components/MenuPopover/MenuPopover.js +3 -3
  355. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  356. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  357. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  358. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  359. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  360. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +7 -5
  361. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  362. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
  363. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +12 -9
  364. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  365. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
  366. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +8 -6
  367. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  368. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  369. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  370. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  371. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  372. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  373. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  374. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
  375. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  376. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  377. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  378. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  379. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  380. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  381. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  382. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  383. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  384. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
  385. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  386. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  387. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +3 -2
  388. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  389. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
  390. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  391. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  392. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  393. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +4 -4
  394. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  395. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  396. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +177 -7
  397. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  398. package/lib-commonjs/components/index.js.map +1 -1
  399. package/lib-commonjs/contexts/menuContext.d.ts +1 -1
  400. package/lib-commonjs/contexts/menuContext.js +3 -3
  401. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  402. package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
  403. package/lib-commonjs/contexts/menuGroupContext.js +3 -3
  404. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  405. package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
  406. package/lib-commonjs/contexts/menuListContext.js +3 -3
  407. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  408. package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
  409. package/lib-commonjs/contexts/menuTriggerContext.js +4 -4
  410. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  411. package/lib-commonjs/index.d.ts +11 -10
  412. package/lib-commonjs/index.js +16 -14
  413. package/lib-commonjs/index.js.map +1 -1
  414. package/lib-commonjs/selectable/index.js.map +1 -1
  415. package/lib-commonjs/selectable/types.js.map +1 -1
  416. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
  417. package/lib-commonjs/selectable/useCheckmarkStyles.js +6 -6
  418. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  419. package/lib-commonjs/utils/index.js.map +1 -1
  420. package/lib-commonjs/utils/useIsSubmenu.js +1 -1
  421. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  422. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  423. package/package.json +13 -15
  424. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  425. package/lib/components/MenuTrigger/useTriggerElement.js +0 -165
  426. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  427. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  428. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -180
  429. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MenuPopover.types.js","sourceRoot":"","sources":["../../../src/components/MenuPopover/MenuPopover.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"MenuPopover.types.js","sourceRoot":"../src/","sources":["components/MenuPopover/MenuPopover.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuPopoverSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * MenuPopover Props\n */\nexport type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;\n\n/**\n * State used in rendering MenuPopover\n */\nexport type MenuPopoverState = ComponentState<MenuPopoverSlots> & {\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 inline: boolean;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuPopover/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuPopover/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './MenuPopover';\nexport * from './MenuPopover.types';\nexport * from './renderMenuPopover';\nexport * from './useMenuPopover';\nexport * from './useMenuPopoverStyles';\n"]}
@@ -2,4 +2,4 @@ import { MenuPopoverState } from './MenuPopover.types';
2
2
  /**
3
3
  * Render the final JSX of MenuPopover
4
4
  */
5
- export declare const renderMenuPopover: (state: MenuPopoverState) => JSX.Element;
5
+ export declare const renderMenuPopover_unstable: (state: MenuPopoverState) => JSX.Element;
@@ -5,16 +5,18 @@ import { Portal } from '@fluentui/react-portal';
5
5
  * Render the final JSX of MenuPopover
6
6
  */
7
7
 
8
- export const renderMenuPopover = state => {
8
+ export const renderMenuPopover_unstable = state => {
9
9
  const {
10
10
  slots,
11
11
  slotProps
12
12
  } = getSlots(state);
13
13
 
14
14
  if (state.inline) {
15
- return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root));
15
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
16
+ });
16
17
  }
17
18
 
18
- return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root)));
19
+ return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
20
+ }));
19
21
  };
20
22
  //# sourceMappingURL=renderMenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/renderMenuPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,MAAT,QAAuB,wBAAvB;AAEA;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAI,KAAD,IAA4B;AAC3D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAmB,KAAnB,CAArC;;AAEA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,wBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAAP;AACD;;AAED,sBACE,KAAA,CAAA,aAAA,CAAC,MAAD,EAAO,IAAP,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,CADF;AAKD,CAZM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuPopover/renderMenuPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,MAAT,QAAuB,wBAAvB;AAEA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAmB,KAAnB,CAArC;;AAEA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,wBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,KAAX,CAAP;AACD;;AAED,sBACE,KAAA,CAAA,aAAA,CAAC,MAAD,EAAO,IAAP,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CAZM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of MenuPopover\n */\nexport const renderMenuPopover_unstable = (state: MenuPopoverState) => {\n const { slots, slotProps } = getSlots<MenuPopoverSlots>(state);\n\n if (state.inline) {\n return <slots.root {...slotProps.root} />;\n }\n\n return (\n <Portal>\n <slots.root {...slotProps.root} />\n </Portal>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,10 +3,10 @@ import { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';
3
3
  /**
4
4
  * Create the state required to render MenuPopover.
5
5
  *
6
- * The returned state can be modified with hooks such as useMenuPopoverStyles,
7
- * before being passed to renderMenuPopover.
6
+ * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
7
+ * before being passed to renderMenuPopover_unstable.
8
8
  *
9
9
  * @param props - props from this instance of MenuPopover
10
10
  * @param ref - reference to root HTMLElement of MenuPopover
11
11
  */
12
- export declare const useMenuPopover: (props: MenuPopoverProps, ref: React.Ref<HTMLElement>) => MenuPopoverState;
12
+ export declare const useMenuPopover_unstable: (props: MenuPopoverProps, ref: React.Ref<HTMLElement>) => MenuPopoverState;
@@ -1,26 +1,26 @@
1
1
  import * as React from 'react';
2
2
  import { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';
3
3
  import { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
4
- import { useMenuContext } from '../../contexts/menuContext';
4
+ import { useMenuContext_unstable } from '../../contexts/menuContext';
5
5
  import { dispatchMenuEnterEvent } from '../../utils/index';
6
6
  import { useFluent } from '@fluentui/react-shared-contexts';
7
7
  import { useIsSubmenu } from '../../utils/useIsSubmenu';
8
8
  /**
9
9
  * Create the state required to render MenuPopover.
10
10
  *
11
- * The returned state can be modified with hooks such as useMenuPopoverStyles,
12
- * before being passed to renderMenuPopover.
11
+ * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
12
+ * before being passed to renderMenuPopover_unstable.
13
13
  *
14
14
  * @param props - props from this instance of MenuPopover
15
15
  * @param ref - reference to root HTMLElement of MenuPopover
16
16
  */
17
17
 
18
- export const useMenuPopover = (props, ref) => {
18
+ export const useMenuPopover_unstable = (props, ref) => {
19
19
  var _a;
20
20
 
21
- const popoverRef = useMenuContext(context => context.menuPopoverRef);
22
- const setOpen = useMenuContext(context => context.setOpen);
23
- const openOnHover = useMenuContext(context => context.openOnHover);
21
+ const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);
22
+ const setOpen = useMenuContext_unstable(context => context.setOpen);
23
+ const openOnHover = useMenuContext_unstable(context => context.openOnHover);
24
24
  const isSubmenu = useIsSubmenu();
25
25
  const canDispatchCustomEventRef = React.useRef(true);
26
26
  const throttleDispatchTimerRef = React.useRef(0);
@@ -49,7 +49,7 @@ export const useMenuPopover = (props, ref) => {
49
49
  React.useEffect(() => {
50
50
  () => clearTimeout(throttleDispatchTimerRef.current);
51
51
  }, []);
52
- const inline = (_a = useMenuContext(context => context.inline)) !== null && _a !== void 0 ? _a : false;
52
+ const inline = (_a = useMenuContext_unstable(context => context.inline)) !== null && _a !== void 0 ? _a : false;
53
53
  const rootProps = getNativeElementProps('div', {
54
54
  role: 'presentation',
55
55
  ...props,
@@ -95,6 +95,9 @@ export const useMenuPopover = (props, ref) => {
95
95
  });
96
96
  return {
97
97
  inline,
98
+ components: {
99
+ root: 'div'
100
+ },
98
101
  root: rootProps
99
102
  };
100
103
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,SAAT,EAAoB,GAApB,EAAyB,UAAzB,EAAqC,MAArC,QAAmD,yBAAnD;AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,aAAlD,QAAuE,2BAAvE;AAEA,SAAS,cAAT,QAA+B,4BAA/B;AACA,SAAS,sBAAT,QAAuC,mBAAvC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,YAAT,QAA6B,0BAA7B;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,cAAc,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;;;AACvG,QAAM,UAAU,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,cAApB,CAAjC;AACA,QAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,OAApB,CAA9B;AACA,QAAM,WAAW,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,WAApB,CAAlC;AACA,QAAM,SAAS,GAAG,YAAY,EAA9B;AACA,QAAM,yBAAyB,GAAG,KAAK,CAAC,MAAN,CAAa,IAAb,CAAlC;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A,CAApB,GAAA,oBAAoB,CAAG,CAAH,CAApB;AACD,GANwC,CAAzC;AAQA,EAAA,SAAS,CAAC,SAAV,GAAsB,gBAAgB,CAAE,CAAD,IAAwC;;;AAC7E,UAAM,GAAG,GAAG,CAAC,CAAC,GAAd;;AAEA,QAAI,GAAG,KAAK,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,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,GAfqC,CAAtC;AAiBA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAFP;AAKL,IAAA,IAAI,EAAE;AALD,GAAP;AAOD,CA9EM","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,4 +3,4 @@ export declare const menuPopoverClassName = "fui-MenuPopover";
3
3
  /**
4
4
  * Apply styling to the Menu slots based on the state
5
5
  */
6
- export declare const useMenuPopoverStyles: (state: MenuPopoverState) => MenuPopoverState;
6
+ export declare const useMenuPopoverStyles_unstable: (state: MenuPopoverState) => MenuPopoverState;
@@ -1,4 +1,5 @@
1
- import { shorthands, mergeClasses, __styles } from '@fluentui/react-make-styles';
1
+ import { shorthands, mergeClasses, __styles } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
2
3
  export const menuPopoverClassName = 'fui-MenuPopover';
3
4
 
4
5
  const useStyles = /*#__PURE__*/__styles({
@@ -37,7 +38,7 @@ const useStyles = /*#__PURE__*/__styles({
37
38
  */
38
39
 
39
40
 
40
- export const useMenuPopoverStyles = state => {
41
+ export const useMenuPopoverStyles_unstable = state => {
41
42
  const styles = useStyles();
42
43
  state.root.className = mergeClasses(menuPopoverClassName, styles.root, state.root.className);
43
44
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,6BAArD;AAGA,OAAO,MAAM,oBAAoB,GAAG,iBAA7B;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAaA;;AAEG;;;AACH,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAA8C;AAChF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAD,EAAuB,MAAM,CAAC,IAA9B,EAAoC,KAAK,CAAC,IAAN,CAAW,SAA/C,CAAnC;AACA,SAAO,KAAP;AACD,CAJM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAGA,OAAO,MAAM,oBAAoB,GAAG,iBAA7B;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAaA;;AAEG;;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;AACzF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAD,EAAuB,MAAM,CAAC,IAA9B,EAAoC,KAAK,CAAC,IAAN,CAAW,SAA/C,CAAnC;AACA,SAAO,KAAP;AACD,CAJM","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { MenuPopoverState } from './MenuPopover.types';\n\nexport const menuPopoverClassName = 'fui-MenuPopover';\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(menuPopoverClassName, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ import type { MenuSplitGroupProps } from './MenuSplitGroup.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
+ /**
4
+ * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
5
+ */
6
+ export declare const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { useMenuSplitGroup_unstable } from './useMenuSplitGroup';
3
+ import { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';
4
+ import { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';
5
+ /**
6
+ * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
7
+ */
8
+
9
+ export const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuSplitGroup_unstable(props, ref);
11
+ useMenuSplitGroupStyles_unstable(state);
12
+ return renderMenuSplitGroup_unstable(state);
13
+ });
14
+ MenuSplitGroup.displayName = 'MenuSplitGroup';
15
+ //# sourceMappingURL=MenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/MenuSplitGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,gCAAT,QAAiD,2BAAjD;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,0BAA0B,CAAC,KAAD,EAAQ,GAAR,CAAxC;AAEA,EAAA,gCAAgC,CAAC,KAAD,CAAhC;AACA,SAAO,6BAA6B,CAAC,KAAD,CAApC;AACD,CALuE,CAAjE;AAOP,cAAc,CAAC,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,14 @@
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
+ export declare type MenuSplitGroupSlots = {
3
+ root: Slot<'div'>;
4
+ };
5
+ declare type MenuSplitGroupCommons = {};
6
+ /**
7
+ * MenuSplitGroup Props
8
+ */
9
+ export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;
10
+ /**
11
+ * State used in rendering MenuSplitGroup
12
+ */
13
+ export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots> & MenuSplitGroupCommons;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MenuSplitGroup.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuSplitGroup.types.js","sourceRoot":"../src/","sources":["components/MenuSplitGroup/MenuSplitGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuSplitGroupSlots = {\n root: Slot<'div'>;\n};\n\ntype MenuSplitGroupCommons = {};\n\n/**\n * MenuSplitGroup Props\n */\nexport type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;\n\n/**\n * State used in rendering MenuSplitGroup\n */\nexport type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots> & MenuSplitGroupCommons;\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './MenuSplitGroup';
2
+ export * from './MenuSplitGroup.types';
3
+ export * from './renderMenuSplitGroup';
4
+ export * from './useMenuSplitGroup';
5
+ export * from './useMenuSplitGroupStyles';
@@ -0,0 +1,6 @@
1
+ export * from './MenuSplitGroup';
2
+ export * from './MenuSplitGroup.types';
3
+ export * from './renderMenuSplitGroup';
4
+ export * from './useMenuSplitGroup';
5
+ export * from './useMenuSplitGroupStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuSplitGroup/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC","sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles';\n"]}
@@ -0,0 +1,5 @@
1
+ import type { MenuSplitGroupState } from './MenuSplitGroup.types';
2
+ /**
3
+ * Render the final JSX of MenuSplitGroup
4
+ */
5
+ export declare const renderMenuSplitGroup_unstable: (state: MenuSplitGroupState) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of MenuSplitGroup
5
+ */
6
+
7
+ export const renderMenuSplitGroup_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ });
14
+ };
15
+ //# sourceMappingURL=renderMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/renderMenuSplitGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,CAArC;AAEA,sBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAAP;AACD,CAJM","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,12 @@
1
+ import * as React from 'react';
2
+ import type { MenuSplitGroupProps, MenuSplitGroupState } from './MenuSplitGroup.types';
3
+ /**
4
+ * Create the state required to render MenuSplitGroup.
5
+ *
6
+ * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
7
+ * before being passed to renderMenuSplitGroup_unstable.
8
+ *
9
+ * @param props - props from this instance of MenuSplitGroup
10
+ * @param ref - reference to root HTMLElement of MenuSplitGroup
11
+ */
12
+ export declare const useMenuSplitGroup_unstable: (props: MenuSplitGroupProps, ref: React.Ref<HTMLElement>) => MenuSplitGroupState;
@@ -0,0 +1,67 @@
1
+ import * as React from 'react';
2
+ import { getNativeElementProps, getRTLSafeKey, useMergedRefs } from '@fluentui/react-utilities';
3
+ import { useFocusFinders } from '@fluentui/react-tabster';
4
+ import { useFluent } from '@fluentui/react-shared-contexts';
5
+ import { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';
6
+ /**
7
+ * Create the state required to render MenuSplitGroup.
8
+ *
9
+ * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
10
+ * before being passed to renderMenuSplitGroup_unstable.
11
+ *
12
+ * @param props - props from this instance of MenuSplitGroup
13
+ * @param ref - reference to root HTMLElement of MenuSplitGroup
14
+ */
15
+
16
+ export const useMenuSplitGroup_unstable = (props, ref) => {
17
+ const innerRef = React.useRef();
18
+ const {
19
+ dir,
20
+ targetDocument
21
+ } = useFluent();
22
+ const nextArrowKey = getRTLSafeKey(ArrowRight, dir);
23
+ const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);
24
+ const {
25
+ findNextFocusable,
26
+ findPrevFocusable
27
+ } = useFocusFinders();
28
+ const onKeyDown = React.useCallback(e => {
29
+ var _a;
30
+
31
+ const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
32
+
33
+ if (!activeElement) {
34
+ return;
35
+ }
36
+
37
+ if (!((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.contains(activeElement))) {
38
+ return;
39
+ }
40
+
41
+ if (e.key === nextArrowKey) {
42
+ const next = findNextFocusable(activeElement, {
43
+ container: innerRef.current
44
+ });
45
+ next === null || next === void 0 ? void 0 : next.focus();
46
+ }
47
+
48
+ if (e.key === prevArrowKey) {
49
+ const prev = findPrevFocusable(activeElement, {
50
+ container: innerRef.current
51
+ });
52
+ prev === null || prev === void 0 ? void 0 : prev.focus();
53
+ }
54
+ }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);
55
+ return {
56
+ components: {
57
+ root: 'div'
58
+ },
59
+ root: getNativeElementProps('div', {
60
+ role: 'group',
61
+ ref: useMergedRefs(ref, innerRef),
62
+ onKeyDown,
63
+ ...props
64
+ })
65
+ };
66
+ };
67
+ //# sourceMappingURL=useMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/useMenuSplitGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,aAAhC,EAA+C,aAA/C,QAAoE,2BAApE;AACA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AAEA,SAAS,UAAT,EAAqB,SAArB,QAAsC,yBAAtC;AAEA;;;;;;;;AAQG;;AACH,OAAO,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,SAAS,EAAzC;AAEA,QAAM,YAAY,GAAG,aAAa,CAAC,UAAD,EAAa,GAAb,CAAlC;AACA,QAAM,YAAY,GAAG,aAAa,CAAC,SAAD,EAAY,GAAZ,CAAlC;AAEA,QAAM;AAAE,IAAA,iBAAF;AAAqB,IAAA;AAArB,MAA2C,eAAe,EAAhE;AAEA,QAAM,SAAS,GAAG,KAAK,CAAC,WAAN,CACf,CAAD,IAAwC;;;AACtC,UAAM,aAAa,GAAG,cAAc,KAAA,IAAd,IAAA,cAAc,KAAA,KA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","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,6 @@
1
+ import type { MenuSplitGroupState } from './MenuSplitGroup.types';
2
+ export declare const menuSplitGroupClassName = "fui-MenuSplitGroup";
3
+ /**
4
+ * Apply styling to the MenuSplitGroup slots based on the state
5
+ */
6
+ export declare const useMenuSplitGroupStyles_unstable: (state: MenuSplitGroupState) => MenuSplitGroupState;
@@ -0,0 +1,35 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { menuItemClassName } from '../MenuItem/useMenuItemStyles';
4
+ export const menuSplitGroupClassName = 'fui-MenuSplitGroup';
5
+ /**
6
+ * Styles for the root slot
7
+ */
8
+
9
+ const useStyles = /*#__PURE__*/__styles({
10
+ "root": {
11
+ "mc9l5x": "f22iagw",
12
+ "u7v6m2": "f168awwq",
13
+ "Bo1wru1": ["f1om2jlk", "fcyhg04"],
14
+ "Bhkyaub": ["fgqgg70", "fqo1hry"],
15
+ "J9ixe0": ["fh1zedf", "f1auaj6e"],
16
+ "rj29m3": ["fokbbcd", "f1xlvh9o"],
17
+ "lispf9": "f1et5qag",
18
+ "B9hwub1": "f13ngu1f",
19
+ "dvf9w6": "f1db9j62",
20
+ "Hjn5ok": "f92z21p"
21
+ }
22
+ }, {
23
+ "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);}"]
24
+ });
25
+ /**
26
+ * Apply styling to the MenuSplitGroup slots based on the state
27
+ */
28
+
29
+
30
+ export const useMenuSplitGroupStyles_unstable = state => {
31
+ const styles = useStyles();
32
+ state.root.className = mergeClasses(menuSplitGroupClassName, styles.root, state.root.className);
33
+ return state;
34
+ };
35
+ //# sourceMappingURL=useMenuSplitGroupStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/MenuSplitGroup/useMenuSplitGroupStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,MAAM,uBAAuB,GAAG,oBAAhC;AAEP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqBA;;AAEG;;;AACH,OAAO,MAAM,gCAAgC,GAAI,KAAD,IAAoD;AAClG,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAD,EAA0B,MAAM,CAAC,IAAjC,EAAuC,KAAK,CAAC,IAAN,CAAW,SAAlD,CAAnC;AACA,SAAO,KAAP;AACD,CAJM","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassName } from '../MenuItem/useMenuItemStyles';\nimport type { MenuSplitGroupState } from './MenuSplitGroup.types';\n\nexport const menuSplitGroupClassName = 'fui-MenuSplitGroup';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n [`& > .${menuItemClassName}:nth-child(1)`]: {\n width: '100%',\n },\n [`& > .${menuItemClassName}: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(menuSplitGroupClassName, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import type { MenuTriggerProps } from './MenuTrigger.types';
3
+ import type { FluentTriggerComponent } from '@fluentui/react-utilities';
3
4
  /**
4
5
  * Wraps a trigger element as an only child
5
6
  * and adds the necessary event handling to open a popup menu
6
7
  */
7
- export declare const MenuTrigger: React.FC<MenuTriggerProps>;
8
+ export declare const MenuTrigger: React.FC<MenuTriggerProps> & FluentTriggerComponent;
@@ -1,13 +1,14 @@
1
- import { useMenuTrigger } from './useMenuTrigger';
2
- import { renderMenuTrigger } from './renderMenuTrigger';
1
+ import { useMenuTrigger_unstable } from './useMenuTrigger';
2
+ import { renderMenuTrigger_unstable } from './renderMenuTrigger';
3
3
  /**
4
4
  * Wraps a trigger element as an only child
5
5
  * and adds the necessary event handling to open a popup menu
6
6
  */
7
7
 
8
8
  export const MenuTrigger = props => {
9
- const state = useMenuTrigger(props);
10
- return renderMenuTrigger(state);
9
+ const state = useMenuTrigger_unstable(props);
10
+ return renderMenuTrigger_unstable(state);
11
11
  };
12
12
  MenuTrigger.displayName = 'MenuTrigger';
13
+ MenuTrigger.isFluentTriggerComponent = true;
13
14
  //# sourceMappingURL=MenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AAGA;;;AAGG;;AACH,OAAO,MAAM,WAAW,GAA+B,KAAK,IAAG;AAC7D,QAAM,KAAK,GAAG,cAAc,CAAC,KAAD,CAA5B;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB;AACD,CAJM;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AAIA;;;AAGG;;AACH,OAAO,MAAM,WAAW,GAAwD,KAAK,IAAG;AACtF,QAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,CAArC;AAEA,SAAO,0BAA0B,CAAC,KAAD,CAAjC;AACD,CAJM;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B;AACA,WAAW,CAAC,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/"}
@@ -5,12 +5,16 @@ export declare type MenuTriggerProps = {
5
5
  */
6
6
  children: (React.ReactElement & {
7
7
  ref?: React.Ref<unknown>;
8
- }) | ((props: MenuTriggerChildProps) => React.ReactNode);
8
+ }) | ((props: MenuTriggerChildProps) => React.ReactElement | null);
9
9
  };
10
10
  /**
11
11
  * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
12
12
  */
13
- export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'>> & {
13
+ export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseMove' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'id'>> & {
14
14
  ref?: React.Ref<never>;
15
+ 'aria-expanded': boolean | undefined;
16
+ };
17
+ export declare type MenuTriggerState = {
18
+ children: React.ReactElement | null;
19
+ isSubmenu: boolean;
15
20
  };
16
- export declare type MenuTriggerState = MenuTriggerProps;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.types.js","sourceRoot":"","sources":["../../../src/components/MenuTrigger/MenuTrigger.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"MenuTrigger.types.js","sourceRoot":"../src/","sources":["components/MenuTrigger/MenuTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type MenuTriggerProps = {\n /**\n * Explicitly require single child or render function\n */\n children:\n | (React.ReactElement & { ref?: React.Ref<unknown> })\n | ((props: MenuTriggerChildProps) => React.ReactElement | null);\n};\n\n/**\n * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu\n */\nexport type MenuTriggerChildProps = Required<\n Pick<\n React.HTMLAttributes<HTMLElement>,\n 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseMove' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'id'\n >\n> & {\n ref?: React.Ref<never>;\n // aria-expanded should only be present when the menu when it is not a submenu\n 'aria-expanded': boolean | undefined;\n};\n\nexport type MenuTriggerState = {\n children: React.ReactElement | null;\n isSubmenu: boolean;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"]}
@@ -4,4 +4,4 @@ import type { MenuTriggerState } from './MenuTrigger.types';
4
4
  *
5
5
  * Only renders children
6
6
  */
7
- export declare const renderMenuTrigger: (state: MenuTriggerState) => JSX.Element;
7
+ export declare const renderMenuTrigger_unstable: (state: MenuTriggerState) => JSX.Element;
@@ -6,9 +6,9 @@ import { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';
6
6
  * Only renders children
7
7
  */
8
8
 
9
- export const renderMenuTrigger = state => {
9
+ export const renderMenuTrigger_unstable = state => {
10
10
  return /*#__PURE__*/React.createElement(MenuTriggerContextProvider, {
11
- value: true
11
+ value: state.isSubmenu
12
12
  }, state.children);
13
13
  };
14
14
  //# sourceMappingURL=renderMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,0BAAT,QAA2C,mCAA3C;AAGA;;;;AAIG;;AACH,OAAO,MAAM,iBAAiB,GAAI,KAAD,IAA4B;AAC3D,sBAAO,KAAA,CAAA,aAAA,CAAC,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE;AAAR,GAA3B,EAA0C,KAAK,CAAC,QAAhD,CAAP;AACD,CAFM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,0BAAT,QAA2C,mCAA3C;AAGA;;;;AAIG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,sBAAO,KAAA,CAAA,aAAA,CAAC,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE,KAAK,CAAC;AAAd,GAA3B,EAAqD,KAAK,CAAC,QAA3D,CAAP;AACD,CAFM","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/"}
@@ -1,8 +1,8 @@
1
- import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
1
+ import { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
2
2
  /**
3
3
  * Create the state required to render MenuTrigger.
4
4
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
5
5
  *
6
6
  * @param props - props from this instance of MenuTrigger
7
7
  */
8
- export declare const useMenuTrigger: (props: MenuTriggerProps) => MenuTriggerState;
8
+ export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;