@fluentui/react-menu 0.0.0-nightlyf8be6a7c6520220106.1 → 0.0.0-nightlyff78d1e27a20220217.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. package/CHANGELOG.json +204 -33
  2. package/CHANGELOG.md +47 -16
  3. package/dist/react-menu.d.ts +73 -80
  4. package/lib/Menu.js.map +1 -1
  5. package/lib/MenuDivider.js.map +1 -1
  6. package/lib/MenuGroup.js.map +1 -1
  7. package/lib/MenuGroupHeader.js.map +1 -1
  8. package/lib/MenuItem.js.map +1 -1
  9. package/lib/MenuItemCheckbox.js.map +1 -1
  10. package/lib/MenuItemRadio.js.map +1 -1
  11. package/lib/MenuList.js.map +1 -1
  12. package/lib/MenuPopover.js.map +1 -1
  13. package/lib/MenuSplitGroup.js.map +1 -1
  14. package/lib/MenuTrigger.js.map +1 -1
  15. package/lib/components/Menu/Menu.js +6 -6
  16. package/lib/components/Menu/Menu.js.map +1 -1
  17. package/lib/components/Menu/Menu.types.d.ts +1 -1
  18. package/lib/components/Menu/Menu.types.js.map +1 -1
  19. package/lib/components/Menu/index.js.map +1 -1
  20. package/lib/components/Menu/renderMenu.d.ts +1 -1
  21. package/lib/components/Menu/renderMenu.js +1 -1
  22. package/lib/components/Menu/renderMenu.js.map +1 -1
  23. package/lib/components/Menu/useMenu.d.ts +2 -2
  24. package/lib/components/Menu/useMenu.js +6 -5
  25. package/lib/components/Menu/useMenu.js.map +1 -1
  26. package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
  27. package/lib/components/Menu/useMenuContextValues.js +1 -1
  28. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  29. package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
  30. package/lib/components/MenuDivider/MenuDivider.js +7 -7
  31. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  32. package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  33. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  34. package/lib/components/MenuDivider/index.js.map +1 -1
  35. package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  36. package/lib/components/MenuDivider/renderMenuDivider.js +1 -1
  37. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  38. package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
  39. package/lib/components/MenuDivider/useMenuDivider.js +4 -1
  40. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  41. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  42. package/lib/components/MenuDivider/useMenuDividerStyles.js +3 -2
  43. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  44. package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
  45. package/lib/components/MenuGroup/MenuGroup.js +9 -9
  46. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  47. package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  48. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  49. package/lib/components/MenuGroup/index.js.map +1 -1
  50. package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  51. package/lib/components/MenuGroup/renderMenuGroup.js +1 -1
  52. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  53. package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
  54. package/lib/components/MenuGroup/useMenuGroup.js +4 -1
  55. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  56. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  57. package/lib/components/MenuGroup/useMenuGroupContextValues.js +1 -1
  58. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  59. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
  60. package/lib/components/MenuGroup/useMenuGroupStyles.js +2 -2
  61. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  62. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  63. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +7 -7
  64. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  65. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  66. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  67. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  68. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  69. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +1 -1
  70. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  71. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  72. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +6 -3
  73. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  74. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  75. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +3 -2
  76. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  77. package/lib/components/MenuItem/MenuItem.d.ts +1 -1
  78. package/lib/components/MenuItem/MenuItem.js +7 -7
  79. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  80. package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
  81. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  82. package/lib/components/MenuItem/index.js.map +1 -1
  83. package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
  84. package/lib/components/MenuItem/renderMenuItem.js +7 -8
  85. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  86. package/lib/components/MenuItem/useCharacterSearch.js +2 -2
  87. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  88. package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
  89. package/lib/components/MenuItem/useMenuItem.js +10 -15
  90. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  91. package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -1
  92. package/lib/components/MenuItem/useMenuItemStyles.js +12 -7
  93. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  94. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  95. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
  96. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  97. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  98. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  99. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  100. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -7
  101. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  102. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  103. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +6 -6
  104. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  105. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
  106. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +6 -6
  107. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  108. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  109. package/lib/components/MenuItemRadio/MenuItemRadio.js +7 -7
  110. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  111. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  112. package/lib/components/MenuItemRadio/index.js.map +1 -1
  113. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  114. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -7
  115. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  116. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  117. package/lib/components/MenuItemRadio/useMenuItemRadio.js +6 -6
  118. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  119. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
  120. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +6 -6
  121. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  122. package/lib/components/MenuList/MenuList.d.ts +1 -1
  123. package/lib/components/MenuList/MenuList.js +9 -9
  124. package/lib/components/MenuList/MenuList.js.map +1 -1
  125. package/lib/components/MenuList/MenuList.types.d.ts +4 -4
  126. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  127. package/lib/components/MenuList/index.d.ts +1 -1
  128. package/lib/components/MenuList/index.js +0 -1
  129. package/lib/components/MenuList/index.js.map +1 -1
  130. package/lib/components/MenuList/renderMenuList.d.ts +1 -1
  131. package/lib/components/MenuList/renderMenuList.js +1 -1
  132. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  133. package/lib/components/MenuList/useMenuList.d.ts +1 -1
  134. package/lib/components/MenuList/useMenuList.js +11 -8
  135. package/lib/components/MenuList/useMenuList.js.map +1 -1
  136. package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
  137. package/lib/components/MenuList/useMenuListContextValues.js +1 -1
  138. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  139. package/lib/components/MenuList/useMenuListStyles.d.ts +1 -1
  140. package/lib/components/MenuList/useMenuListStyles.js +2 -2
  141. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  142. package/lib/components/MenuPopover/MenuPopover.js +6 -6
  143. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  144. package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  145. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  146. package/lib/components/MenuPopover/index.js.map +1 -1
  147. package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  148. package/lib/components/MenuPopover/renderMenuPopover.js +1 -1
  149. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  150. package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
  151. package/lib/components/MenuPopover/useMenuPopover.js +11 -8
  152. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  153. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
  154. package/lib/components/MenuPopover/useMenuPopoverStyles.js +3 -2
  155. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  156. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +6 -6
  157. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  158. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +4 -3
  159. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  160. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  161. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +1 -1
  162. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -3
  163. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  164. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +4 -8
  165. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +3 -8
  166. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  167. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +1 -1
  168. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +3 -2
  169. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  170. package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  171. package/lib/components/MenuTrigger/MenuTrigger.js +5 -4
  172. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  173. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +5 -3
  174. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  175. package/lib/components/MenuTrigger/index.js.map +1 -1
  176. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  177. package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
  178. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  179. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  180. package/lib/components/MenuTrigger/useMenuTrigger.js +167 -5
  181. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  182. package/lib/components/index.js.map +1 -1
  183. package/lib/contexts/menuContext.d.ts +1 -1
  184. package/lib/contexts/menuContext.js +1 -1
  185. package/lib/contexts/menuContext.js.map +1 -1
  186. package/lib/contexts/menuGroupContext.d.ts +1 -1
  187. package/lib/contexts/menuGroupContext.js +1 -1
  188. package/lib/contexts/menuGroupContext.js.map +1 -1
  189. package/lib/contexts/menuListContext.d.ts +1 -1
  190. package/lib/contexts/menuListContext.js +1 -1
  191. package/lib/contexts/menuListContext.js.map +1 -1
  192. package/lib/contexts/menuTriggerContext.d.ts +1 -1
  193. package/lib/contexts/menuTriggerContext.js +1 -1
  194. package/lib/contexts/menuTriggerContext.js.map +1 -1
  195. package/lib/index.js.map +1 -1
  196. package/lib/selectable/index.js.map +1 -1
  197. package/lib/selectable/types.js.map +1 -1
  198. package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
  199. package/lib/selectable/useCheckmarkStyles.js +2 -2
  200. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  201. package/lib/utils/index.js.map +1 -1
  202. package/lib/utils/useIsSubmenu.js +2 -2
  203. package/lib/utils/useIsSubmenu.js.map +1 -1
  204. package/lib/utils/useOnMenuEnter.js.map +1 -1
  205. package/lib-commonjs/Menu.js.map +1 -1
  206. package/lib-commonjs/MenuDivider.js.map +1 -1
  207. package/lib-commonjs/MenuGroup.js.map +1 -1
  208. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  209. package/lib-commonjs/MenuItem.js.map +1 -1
  210. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  211. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  212. package/lib-commonjs/MenuList.js.map +1 -1
  213. package/lib-commonjs/MenuPopover.js.map +1 -1
  214. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  215. package/lib-commonjs/MenuTrigger.js.map +1 -1
  216. package/lib-commonjs/components/Menu/Menu.js +3 -3
  217. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  218. package/lib-commonjs/components/Menu/Menu.types.d.ts +1 -1
  219. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  220. package/lib-commonjs/components/Menu/index.js.map +1 -1
  221. package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
  222. package/lib-commonjs/components/Menu/renderMenu.js +3 -3
  223. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  224. package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
  225. package/lib-commonjs/components/Menu/useMenu.js +7 -6
  226. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  227. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
  228. package/lib-commonjs/components/Menu/useMenuContextValues.js +3 -3
  229. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  230. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
  231. package/lib-commonjs/components/MenuDivider/MenuDivider.js +4 -4
  232. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  233. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  234. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  235. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  236. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  237. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +3 -3
  238. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  239. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
  240. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +6 -3
  241. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  242. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  243. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
  244. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  245. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
  246. package/lib-commonjs/components/MenuGroup/MenuGroup.js +5 -5
  247. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  248. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  249. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  250. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  251. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  252. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +3 -3
  253. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  254. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
  255. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +6 -3
  256. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  257. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  258. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +3 -3
  259. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  260. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
  261. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +5 -5
  262. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  263. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  264. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +4 -4
  265. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  266. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  267. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  268. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  269. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  270. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +3 -3
  271. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  272. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  273. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +7 -4
  274. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  275. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  276. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
  277. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  278. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
  279. package/lib-commonjs/components/MenuItem/MenuItem.js +4 -4
  280. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  281. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
  282. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  283. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  284. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +1 -1
  285. package/lib-commonjs/components/MenuItem/renderMenuItem.js +9 -11
  286. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  287. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +1 -1
  288. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  289. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +2 -6
  290. package/lib-commonjs/components/MenuItem/useMenuItem.js +10 -15
  291. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  292. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -1
  293. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +20 -14
  294. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  295. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  296. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +4 -4
  297. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  298. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  299. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  300. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  301. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +8 -10
  302. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  303. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  304. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +6 -6
  305. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  306. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
  307. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +7 -7
  308. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  309. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  310. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +4 -4
  311. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  312. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  313. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  314. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  315. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +8 -10
  316. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  317. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  318. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +6 -6
  319. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  320. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
  321. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +7 -7
  322. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  323. package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
  324. package/lib-commonjs/components/MenuList/MenuList.js +5 -5
  325. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  326. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +4 -4
  327. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  328. package/lib-commonjs/components/MenuList/index.d.ts +1 -1
  329. package/lib-commonjs/components/MenuList/index.js +0 -2
  330. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  331. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
  332. package/lib-commonjs/components/MenuList/renderMenuList.js +3 -3
  333. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  334. package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
  335. package/lib-commonjs/components/MenuList/useMenuList.js +12 -9
  336. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  337. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
  338. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +3 -3
  339. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  340. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -1
  341. package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -6
  342. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  343. package/lib-commonjs/components/MenuPopover/MenuPopover.js +3 -3
  344. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  345. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  346. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  347. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  348. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  349. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +3 -3
  350. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  351. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
  352. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +12 -9
  353. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  354. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
  355. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +8 -6
  356. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  357. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +3 -3
  358. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  359. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +4 -3
  360. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  361. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  362. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +1 -1
  363. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +4 -6
  364. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  365. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +4 -8
  366. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +6 -11
  367. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  368. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +1 -1
  369. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +8 -6
  370. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  371. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  372. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +3 -2
  373. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  374. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +5 -3
  375. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  376. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  377. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  378. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +3 -3
  379. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  380. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  381. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +176 -7
  382. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  383. package/lib-commonjs/components/index.js.map +1 -1
  384. package/lib-commonjs/contexts/menuContext.d.ts +1 -1
  385. package/lib-commonjs/contexts/menuContext.js +3 -3
  386. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  387. package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
  388. package/lib-commonjs/contexts/menuGroupContext.js +3 -3
  389. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  390. package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
  391. package/lib-commonjs/contexts/menuListContext.js +3 -3
  392. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  393. package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
  394. package/lib-commonjs/contexts/menuTriggerContext.js +3 -3
  395. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  396. package/lib-commonjs/index.js.map +1 -1
  397. package/lib-commonjs/selectable/index.js.map +1 -1
  398. package/lib-commonjs/selectable/types.js.map +1 -1
  399. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
  400. package/lib-commonjs/selectable/useCheckmarkStyles.js +6 -6
  401. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  402. package/lib-commonjs/utils/index.js.map +1 -1
  403. package/lib-commonjs/utils/useIsSubmenu.js +1 -1
  404. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  405. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  406. package/package.json +13 -15
  407. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  408. package/lib/components/MenuTrigger/useTriggerElement.js +0 -166
  409. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  410. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  411. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -181
  412. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuItemRadio = void 0;
6
+ exports.useMenuItemRadio_unstable = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
@@ -19,11 +19,11 @@ const useMenuItem_1 = /*#__PURE__*/require("../MenuItem/useMenuItem");
19
19
  */
20
20
 
21
21
 
22
- const useMenuItemRadio = (props, ref) => {
22
+ const useMenuItemRadio_unstable = (props, ref) => {
23
23
  const radioProps = {
24
24
  role: 'menuitemradio'
25
25
  };
26
- const state = useMenuItem_1.useMenuItem({ ...radioProps,
26
+ const state = useMenuItem_1.useMenuItem_unstable({ ...radioProps,
27
27
  ...props,
28
28
  checkmark: react_utilities_1.resolveShorthand(props.checkmark, {
29
29
  defaultProps: {
@@ -32,11 +32,11 @@ const useMenuItemRadio = (props, ref) => {
32
32
  required: true
33
33
  })
34
34
  }, ref);
35
- const selectRadio = menuListContext_1.useMenuListContext(context => context.selectRadio);
35
+ const selectRadio = menuListContext_1.useMenuListContext_unstable(context => context.selectRadio);
36
36
  const {
37
37
  onClick: onClickOriginal
38
38
  } = state.root;
39
- const checked = menuListContext_1.useMenuListContext(context => {
39
+ const checked = menuListContext_1.useMenuListContext_unstable(context => {
40
40
  var _a;
41
41
 
42
42
  const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
@@ -59,5 +59,5 @@ const useMenuItemRadio = (props, ref) => {
59
59
  return state;
60
60
  };
61
61
 
62
- exports.useMenuItemRadio = useMenuItemRadio;
62
+ exports.useMenuItemRadio_unstable = useMenuItemRadio_unstable;
63
63
  //# sourceMappingURL=useMenuItemRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadio.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAD,EAA4B,GAA5B,KAA+E;AAC7G,QAAM,UAAU,GAAG;AACjB,IAAA,IAAI,EAAE;AADW,GAAnB;AAIA,QAAM,KAAK,GAAG,aAAA,CAAA,WAAA,CACZ,EACE,GAAG,UADL;AAEE,OAAG,KAFL;AAGE,IAAA,SAAS,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,SAAvB,EAAkC;AAC3C,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,EAA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AA,CAArB,GAAqB,KAAA,CAArB,GAAqB,EAAA,CAAG,KAAK,CAAC,IAAT,CAArB,KAAuC,EAA5D;AACA,WAAO,YAAY,CAAC,OAAb,CAAqB,KAAK,CAAC,KAA3B,MAAsC,CAAC,CAA9C;AACD,GAHe,CAAhB;AAKA,EAAA,KAAK,CAAC,OAAN,GAAgB,OAAhB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,cAAX,IAA6B,KAAK,CAAC,OAAnC,CAzBsB,CA2BtB;;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAqB,CAAC,IAAG;AACvB,QAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,MAAA,CAAC,CAAC,cAAF;AACA,MAAA,CAAC,CAAC,eAAF;AACA;AACD;;AAED,IAAA,WAAW,KAAA,IAAX,IAAA,WAAW,KAAA,KAAA,CAAX,GAAW,KAAA,CAAX,GAAA,WAAW,CAAG,CAAH,EAAM,KAAK,CAAC,IAAZ,EAAkB,KAAK,CAAC,KAAxB,EAA+B,KAAK,CAAC,OAArC,CAAX;AACA,IAAA,eAAe,KAAA,IAAf,IAAA,eAAe,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAA,eAAe,CAAG,CAAH,CAAf;AACD,GATD;;AAWA,SAAO,KAAP;AACD,CA3CM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { Checkmark16Filled } from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuItem_unstable } from '../MenuItem/useMenuItem';\nimport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio.types';\n\n/**\n * Given user props, returns state and render function for a MenuItemRadio.\n */\nexport const useMenuItemRadio_unstable = (\n props: MenuItemRadioProps,\n ref: React.Ref<HTMLElement>,\n): MenuItemRadioState => {\n const radioProps = {\n role: 'menuitemradio',\n };\n\n const state = useMenuItem_unstable(\n {\n ...radioProps,\n ...props,\n checkmark: resolveShorthand(props.checkmark, {\n defaultProps: { children: <Checkmark16Filled /> },\n required: true,\n }),\n },\n ref,\n ) as MenuItemRadioState;\n\n const selectRadio = useMenuListContext_unstable(context => context.selectRadio);\n const { onClick: onClickOriginal } = state.root;\n const checked = useMenuListContext_unstable(context => {\n const checkedItems = context.checkedValues?.[state.name] || [];\n return checkedItems.indexOf(state.value) !== -1;\n });\n\n state.checked = checked;\n state.root['aria-checked'] = state.checked;\n\n // MenuItem state already transforms keyDown to click events\n state.root.onClick = e => {\n if (state.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n selectRadio?.(e, state.name, state.value, state.checked);\n onClickOriginal?.(e);\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,3 +1,3 @@
1
1
  import type { MenuItemRadioState } from './MenuItemRadio.types';
2
2
  export declare const menuItemRadioClassName = "fui-MenuItemRadio";
3
- export declare const useMenuItemRadioStyles: (state: MenuItemRadioState) => void;
3
+ export declare const useMenuItemRadioStyles_unstable: (state: MenuItemRadioState) => void;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuItemRadioStyles = exports.menuItemRadioClassName = void 0;
6
+ exports.useMenuItemRadioStyles_unstable = exports.menuItemRadioClassName = void 0;
7
7
 
8
- const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const index_1 = /*#__PURE__*/require("../../selectable/index");
11
11
 
@@ -13,11 +13,11 @@ const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles"
13
13
 
14
14
  exports.menuItemRadioClassName = 'fui-MenuItemRadio';
15
15
 
16
- const useMenuItemRadioStyles = state => {
17
- state.root.className = react_make_styles_1.mergeClasses(exports.menuItemRadioClassName, state.root.className);
18
- useMenuItemStyles_1.useMenuItemStyles(state);
19
- index_1.useCheckmarkStyles(state);
16
+ const useMenuItemRadioStyles_unstable = state => {
17
+ state.root.className = react_1.mergeClasses(exports.menuItemRadioClassName, state.root.className);
18
+ useMenuItemStyles_1.useMenuItemStyles_unstable(state);
19
+ index_1.useCheckmarkStyles_unstable(state);
20
20
  };
21
21
 
22
- exports.useMenuItemRadioStyles = useMenuItemRadioStyles;
22
+ exports.useMenuItemRadioStyles_unstable = useMenuItemRadioStyles_unstable;
23
23
  //# sourceMappingURL=useMenuItemRadioStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAGa,OAAA,CAAA,sBAAA,GAAyB,mBAAzB;;AAEN,MAAM,sBAAsB,GAAI,KAAD,IAA8B;AAClE,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,OAAA,CAAA,sBAAb,EAAqC,KAAK,CAAC,IAAN,CAAW,SAAhD,CAAvB;AAEA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AACA,EAAA,OAAA,CAAA,kBAAA,CAAmB,KAAnB;AACD,CALM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAGa,OAAA,CAAA,sBAAA,GAAyB,mBAAzB;;AAEN,MAAM,+BAA+B,GAAI,KAAD,IAA8B;AAC3E,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,sBAAb,EAAqC,KAAK,CAAC,IAAN,CAAW,SAAhD,CAAvB;AAEA,EAAA,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;AACA,EAAA,OAAA,CAAA,2BAAA,CAA4B,KAA5B;AACD,CALM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';\nimport type { MenuItemRadioState } from './MenuItemRadio.types';\n\nexport const menuItemRadioClassName = 'fui-MenuItemRadio';\n\nexport const useMenuItemRadioStyles_unstable = (state: MenuItemRadioState) => {\n state.root.className = mergeClasses(menuItemRadioClassName, state.root.className);\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,6 @@
1
1
  import type { MenuListProps } from './MenuList.types';
2
2
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled MenuList, using the `useMenuList` hook.
4
+ * Define a styled MenuList, using the `useMenuList_unstable` hook.
5
5
  */
6
6
  export declare const MenuList: ForwardRefComponent<MenuListProps>;
@@ -15,15 +15,15 @@ const useMenuListContextValues_1 = /*#__PURE__*/require("./useMenuListContextVal
15
15
 
16
16
  const useMenuListStyles_1 = /*#__PURE__*/require("./useMenuListStyles");
17
17
  /**
18
- * Define a styled MenuList, using the `useMenuList` hook.
18
+ * Define a styled MenuList, using the `useMenuList_unstable` hook.
19
19
  */
20
20
 
21
21
 
22
22
  exports.MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
23
- const state = useMenuList_1.useMenuList(props, ref);
24
- const contextValues = useMenuListContextValues_1.useMenuListContextValues(state);
25
- useMenuListStyles_1.useMenuListStyles(state);
26
- return renderMenuList_1.renderMenuList(state, contextValues);
23
+ const state = useMenuList_1.useMenuList_unstable(props, ref);
24
+ const contextValues = useMenuListContextValues_1.useMenuListContextValues_unstable(state);
25
+ useMenuListStyles_1.useMenuListStyles_unstable(state);
26
+ return renderMenuList_1.renderMenuList_unstable(state, contextValues);
27
27
  });
28
28
  exports.MenuList.displayName = 'MenuList';
29
29
  //# sourceMappingURL=MenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,0BAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,aAAA,CAAA,WAAA,CAAY,KAAZ,EAAmB,GAAnB,CAAd;AACA,QAAM,aAAa,GAAG,0BAAA,CAAA,wBAAA,CAAyB,KAAzB,CAAtB;AACA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AAEA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,aAAtB,CAAP;AACD,CAN2D,CAA/C;AAQb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,0BAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,aAAA,CAAA,oBAAA,CAAqB,KAArB,EAA4B,GAA5B,CAAd;AACA,QAAM,aAAa,GAAG,0BAAA,CAAA,iCAAA,CAAkC,KAAlC,CAAtB;AACA,EAAA,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;AAEA,SAAO,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,aAA/B,CAAP;AACD,CAN2D,CAA/C;AAQb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles';\nimport type { MenuListProps } from './MenuList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled MenuList, using the `useMenuList_unstable` hook.\n */\nexport const MenuList: ForwardRefComponent<MenuListProps> = React.forwardRef((props, ref) => {\n const state = useMenuList_unstable(props, ref);\n const contextValues = useMenuListContextValues_unstable(state);\n useMenuListStyles_unstable(state);\n\n return renderMenuList_unstable(state, contextValues);\n});\n\nMenuList.displayName = 'MenuList';\n"],"sourceRoot":"../src/"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
3
- import { MenuListContextValue } from '../../contexts/menuListContext';
4
- import { SelectableHandler } from '../../selectable/index';
2
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
+ import type { MenuListContextValue } from '../../contexts/menuListContext';
4
+ import type { SelectableHandler } from '../../selectable/index';
5
5
  export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
6
6
  export declare type MenuCheckedValueChangeData = {
7
7
  /** The name of the value */
@@ -35,7 +35,7 @@ export declare type MenuListCommons = {
35
35
  hasCheckmarks?: boolean;
36
36
  };
37
37
  export declare type MenuListSlots = {
38
- root: IntrinsicShorthandProps<'div'>;
38
+ root: Slot<'div'>;
39
39
  };
40
40
  export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
41
41
  export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -1,5 +1,5 @@
1
1
  export * from './MenuList';
2
- export * from './MenuList.types';
2
+ export type { MenuCheckedValueChangeData, MenuCheckedValueChangeEvent, MenuListContextValues, MenuListProps, MenuListSlots, MenuListState, UninitializedMenuListState, } from './MenuList.types';
3
3
  export * from './renderMenuList';
4
4
  export * from './useMenuList';
5
5
  export * from './useMenuListStyles';
@@ -8,8 +8,6 @@ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./MenuList"), exports);
10
10
 
11
- tslib_1.__exportStar(require("./MenuList.types"), exports);
12
-
13
11
  tslib_1.__exportStar(require("./renderMenuList"), exports);
14
12
 
15
13
  tslib_1.__exportStar(require("./useMenuList"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuList/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AAWA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './MenuList';\n// Explicit exports to omit MenuListCommons\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n UninitializedMenuListState,\n} from './MenuList.types';\nexport * from './renderMenuList';\nexport * from './useMenuList';\nexport * from './useMenuListStyles';\nexport * from './useMenuListContextValues';\n"],"sourceRoot":"../src/"}
@@ -2,4 +2,4 @@ import { MenuListContextValues, MenuListState } from './MenuList.types';
2
2
  /**
3
3
  * Function that renders the final JSX of the component
4
4
  */
5
- export declare const renderMenuList: (state: MenuListState, contextValues: MenuListContextValues) => JSX.Element;
5
+ export declare const renderMenuList_unstable: (state: MenuListState, contextValues: MenuListContextValues) => JSX.Element;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderMenuList = void 0;
6
+ exports.renderMenuList_unstable = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
@@ -15,7 +15,7 @@ const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext")
15
15
  */
16
16
 
17
17
 
18
- const renderMenuList = (state, contextValues) => {
18
+ const renderMenuList_unstable = (state, contextValues) => {
19
19
  const {
20
20
  slots,
21
21
  slotProps
@@ -26,5 +26,5 @@ const renderMenuList = (state, contextValues) => {
26
26
  }));
27
27
  };
28
28
 
29
- exports.renderMenuList = renderMenuList;
29
+ exports.renderMenuList_unstable = renderMenuList_unstable;
30
30
  //# sourceMappingURL=renderMenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,cAAc,GAAG,CAAC,KAAD,EAAuB,aAAvB,KAA+D;AAC3F,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,iBAAA,CAAA,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuList/renderMenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAAuB,aAAvB,KAA+D;AACpG,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,iBAAA,CAAA,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuListContextValues, MenuListSlots, MenuListState } from './MenuList.types';\nimport { MenuListProvider } from '../../contexts/menuListContext';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuList_unstable = (state: MenuListState, contextValues: MenuListContextValues) => {\n const { slots, slotProps } = getSlots<MenuListSlots>(state);\n\n return (\n <MenuListProvider value={contextValues.menuList}>\n <slots.root {...slotProps.root} />\n </MenuListProvider>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,4 +3,4 @@ import type { MenuListProps, MenuListState } from './MenuList.types';
3
3
  /**
4
4
  * Returns the props and state required to render the component
5
5
  */
6
- export declare const useMenuList: (props: MenuListProps, ref: React.Ref<HTMLElement>) => MenuListState;
6
+ export declare const useMenuList_unstable: (props: MenuListProps, ref: React.Ref<HTMLElement>) => MenuListState;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuList = void 0;
6
+ exports.useMenuList_unstable = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
@@ -21,7 +21,7 @@ const menuContext_2 = /*#__PURE__*/require("../../contexts/menuContext");
21
21
  */
22
22
 
23
23
 
24
- const useMenuList = (props, ref) => {
24
+ const useMenuList_unstable = (props, ref) => {
25
25
  const focusAttributes = react_tabster_1.useArrowNavigationGroup({
26
26
  circular: true
27
27
  });
@@ -39,6 +39,9 @@ const useMenuList = (props, ref) => {
39
39
 
40
40
  const innerRef = React.useRef(null);
41
41
  const initialState = {
42
+ components: {
43
+ root: 'div'
44
+ },
42
45
  root: react_utilities_1.getNativeElementProps('div', {
43
46
  ref: react_utilities_1.useMergedRefs(ref, innerRef),
44
47
  role: 'menu',
@@ -140,18 +143,18 @@ const useMenuList = (props, ref) => {
140
143
  return state;
141
144
  };
142
145
 
143
- exports.useMenuList = useMenuList;
146
+ exports.useMenuList_unstable = useMenuList_unstable;
144
147
  /**
145
148
  * Adds some sugar to fetching multiple context selector values
146
149
  */
147
150
 
148
151
  const useMenuContextSelectors = () => {
149
- const checkedValues = menuContext_1.useMenuContext(context => context.checkedValues);
150
- const onCheckedValueChange = menuContext_1.useMenuContext(context => context.onCheckedValueChange);
151
- const defaultCheckedValues = menuContext_1.useMenuContext(context => context.defaultCheckedValues);
152
- const triggerId = menuContext_1.useMenuContext(context => context.triggerId);
153
- const hasIcons = menuContext_1.useMenuContext(context => context.hasIcons);
154
- const hasCheckmarks = menuContext_1.useMenuContext(context => context.hasCheckmarks);
152
+ const checkedValues = menuContext_1.useMenuContext_unstable(context => context.checkedValues);
153
+ const onCheckedValueChange = menuContext_1.useMenuContext_unstable(context => context.onCheckedValueChange);
154
+ const defaultCheckedValues = menuContext_1.useMenuContext_unstable(context => context.defaultCheckedValues);
155
+ const triggerId = menuContext_1.useMenuContext_unstable(context => context.triggerId);
156
+ const hasIcons = menuContext_1.useMenuContext_unstable(context => context.hasIcons);
157
+ const hasCheckmarks = menuContext_1.useMenuContext_unstable(context => context.hasCheckmarks);
155
158
  return {
156
159
  checkedValues,
157
160
  onCheckedValueChange,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuList.ts"],"names":[],"mappings":";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HK;AAIL,IAAA,SAJK;AAKL,IAAA,QALK;AAML,IAAA;AANK,GAAP;AAQD,CAhBD;AAkBA;;AAEG;;;AACH,MAAM,wBAAwB,GAAG,CAC/B,KAD+B,EAE/B,YAF+B,EAG/B,cAH+B,KAI7B;AACF,MAAI,sBAAsB,GAAG,KAA7B;;AACA,OAAK,MAAM,GAAX,IAAkB,YAAlB,EAAgC;AAC9B,QAAI,KAAK,CAAC,GAAD,CAAT,EAA4G;AAC1G,MAAA,sBAAsB,GAAG,IAAzB;AACD;AACF;;AAED,SAAO,cAAc,IAAI,sBAAzB;AACD,CAbD","sourcesContent":["import * as React from 'react';\nimport {\n useMergedRefs,\n useEventCallback,\n useControllableState,\n getNativeElementProps,\n} from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MenuContext } from '../../contexts/menuContext';\nimport type { MenuListProps, MenuListState, UninitializedMenuListState } from './MenuList.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuList_unstable = (props: MenuListProps, ref: React.Ref<HTMLElement>): MenuListState => {\n const focusAttributes = useArrowNavigationGroup({ circular: true });\n const { findAllFocusable } = useFocusFinders();\n const menuContext = useMenuContextSelectors();\n const hasMenuContext = useHasParentContext(MenuContext);\n\n if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {\n // TODO throw warnings in development safely\n // eslint-disable-next-line no-console\n console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');\n }\n\n const innerRef = React.useRef<HTMLElement>(null);\n const initialState: UninitializedMenuListState = {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, innerRef),\n role: 'menu',\n 'aria-labelledby': menuContext.triggerId,\n ...focusAttributes,\n ...props,\n }),\n hasIcons: menuContext.hasIcons,\n hasCheckmarks: menuContext.hasCheckmarks,\n ...(hasMenuContext && menuContext),\n ...props,\n };\n\n const setFocusByFirstCharacter = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => {\n // TODO use some kind of children registration to reduce dependency on DOM roles\n const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];\n if (!innerRef.current) {\n return;\n }\n\n const menuItems = findAllFocusable(\n innerRef.current,\n (el: HTMLElement) => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')!) !== -1,\n );\n\n let startIndex = menuItems.indexOf(itemEl) + 1;\n if (startIndex === menuItems.length) {\n startIndex = 0;\n }\n\n const firstChars = menuItems.map(menuItem => menuItem.textContent?.charAt(0).toLowerCase());\n const char = e.key.toLowerCase();\n\n const getIndexFirstChars = (start: number, firstChar: string) => {\n for (let i = start; i < firstChars.length; i++) {\n if (char === firstChars[i]) {\n return i;\n }\n }\n return -1;\n };\n\n // Check remaining slots in the menu\n let index = getIndexFirstChars(startIndex, char);\n\n // If not found in remaining slots, check from beginning\n if (index === -1) {\n index = getIndexFirstChars(0, char);\n }\n\n // If match was found...\n if (index > -1) {\n menuItems[index].focus();\n }\n },\n [findAllFocusable],\n );\n\n const [checkedValues, setCheckedValues] = useControllableState({\n state: initialState.checkedValues,\n defaultState: initialState.defaultCheckedValues,\n initialState: {},\n });\n\n const { onCheckedValueChange } = initialState;\n const toggleCheckbox = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked: boolean) => {\n const checkedItems = checkedValues?.[name] || [];\n const newCheckedItems = [...checkedItems];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n\n onCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n setCheckedValues(s => ({ ...s, [name]: newCheckedItems }));\n },\n );\n\n const selectRadio = useEventCallback((e: React.MouseEvent | React.KeyboardEvent, name: string, value: string) => {\n const newCheckedItems = [value];\n setCheckedValues(s => ({ ...s, [name]: newCheckedItems }));\n onCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n });\n\n const state = {\n ...initialState,\n setFocusByFirstCharacter,\n selectRadio,\n toggleCheckbox,\n checkedValues: checkedValues ?? {},\n };\n\n return state;\n};\n\n/**\n * Adds some sugar to fetching multiple context selector values\n */\nconst useMenuContextSelectors = () => {\n const checkedValues = useMenuContext_unstable(context => context.checkedValues);\n const onCheckedValueChange = useMenuContext_unstable(context => context.onCheckedValueChange);\n const defaultCheckedValues = useMenuContext_unstable(context => context.defaultCheckedValues);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const hasIcons = useMenuContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuContext_unstable(context => context.hasCheckmarks);\n\n return {\n checkedValues,\n onCheckedValueChange,\n defaultCheckedValues,\n triggerId,\n hasIcons,\n hasCheckmarks,\n };\n};\n\n/**\n * Helper function to detect if props and MenuContext values are both used\n */\nconst usingPropsAndMenuContext = (\n props: MenuListProps,\n contextValue: ReturnType<typeof useMenuContextSelectors>,\n hasMenuContext: boolean,\n) => {\n let isUsingPropsAndContext = false;\n for (const val in contextValue) {\n if (props[val as keyof Omit<typeof contextValue, 'hasMenuContext' | 'onCheckedValueChange' | 'triggerId'>]) {\n isUsingPropsAndContext = true;\n }\n }\n\n return hasMenuContext && isUsingPropsAndContext;\n};\n"],"sourceRoot":"../src/"}
@@ -1,2 +1,2 @@
1
1
  import type { MenuListContextValues, MenuListState } from './MenuList.types';
2
- export declare function useMenuListContextValues(state: MenuListState): MenuListContextValues;
2
+ export declare function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuListContextValues = void 0;
6
+ exports.useMenuListContextValues_unstable = void 0;
7
7
 
8
- function useMenuListContextValues(state) {
8
+ function useMenuListContextValues_unstable(state) {
9
9
  const {
10
10
  onCheckedValueChange,
11
11
  checkedValues,
@@ -30,5 +30,5 @@ function useMenuListContextValues(state) {
30
30
  };
31
31
  }
32
32
 
33
- exports.useMenuListContextValues = useMenuListContextValues;
33
+ exports.useMenuListContextValues_unstable = useMenuListContextValues_unstable;
34
34
  //# sourceMappingURL=useMenuListContextValues.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuListContextValues.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,wBAAhB,CAAyC,KAAzC,EAA6D;AAC3D,QAAM;AACJ,IAAA,oBADI;AAEJ,IAAA,aAFI;AAGJ,IAAA,cAHI;AAIJ,IAAA,WAJI;AAKJ,IAAA,wBALI;AAMJ,IAAA,QANI;AAOJ,IAAA;AAPI,MAQF,KARJ,CAD2D,CAW3D;;AACA,QAAM,QAAQ,GAAG;AACf,IAAA,oBADe;AAEf,IAAA,aAFe;AAGf,IAAA,cAHe;AAIf,IAAA,WAJe;AAKf,IAAA,wBALe;AAMf,IAAA,QANe;AAOf,IAAA;AAPe,GAAjB;AAUA,SAAO;AAAE,IAAA;AAAF,GAAP;AACD;;AAvBD,OAAA,CAAA,wBAAA,GAAA,wBAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuList/useMenuListContextValues.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,iCAAhB,CAAkD,KAAlD,EAAsE;AACpE,QAAM;AACJ,IAAA,oBADI;AAEJ,IAAA,aAFI;AAGJ,IAAA,cAHI;AAIJ,IAAA,WAJI;AAKJ,IAAA,wBALI;AAMJ,IAAA,QANI;AAOJ,IAAA;AAPI,MAQF,KARJ,CADoE,CAWpE;;AACA,QAAM,QAAQ,GAAG;AACf,IAAA,oBADe;AAEf,IAAA,aAFe;AAGf,IAAA,cAHe;AAIf,IAAA,WAJe;AAKf,IAAA,wBALe;AAMf,IAAA,QANe;AAOf,IAAA;AAPe,GAAjB;AAUA,SAAO;AAAE,IAAA;AAAF,GAAP;AACD;;AAvBD,OAAA,CAAA,iCAAA,GAAA,iCAAA","sourcesContent":["import type { MenuListContextValues, MenuListState } from './MenuList.types';\n\nexport function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues {\n const {\n onCheckedValueChange,\n checkedValues,\n toggleCheckbox,\n selectRadio,\n setFocusByFirstCharacter,\n hasIcons,\n hasCheckmarks,\n } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const menuList = {\n onCheckedValueChange,\n checkedValues,\n toggleCheckbox,\n selectRadio,\n setFocusByFirstCharacter,\n hasIcons,\n hasCheckmarks,\n };\n\n return { menuList };\n}\n"],"sourceRoot":"../src/"}
@@ -3,4 +3,4 @@ export declare const menuListClassName = "fui-MenuList";
3
3
  /**
4
4
  * Apply styling to the Menu slots based on the state
5
5
  */
6
- export declare const useMenuListStyles: (state: MenuListState) => MenuListState;
6
+ export declare const useMenuListStyles_unstable: (state: MenuListState) => MenuListState;
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuListStyles = exports.menuListClassName = void 0;
6
+ exports.useMenuListStyles_unstable = exports.menuListClassName = void 0;
7
7
 
8
- const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  exports.menuListClassName = 'fui-MenuList';
11
11
 
12
- const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
12
+ const useStyles = /*#__PURE__*/react_1.__styles({
13
13
  "root": {
14
14
  "mc9l5x": "f22iagw",
15
15
  "Beiy3e4": "f1vx9l62",
@@ -24,11 +24,11 @@ const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
24
24
  */
25
25
 
26
26
 
27
- const useMenuListStyles = state => {
27
+ const useMenuListStyles_unstable = state => {
28
28
  const styles = useStyles();
29
- state.root.className = react_make_styles_1.mergeClasses(exports.menuListClassName, styles.root, state.root.className);
29
+ state.root.className = react_1.mergeClasses(exports.menuListClassName, styles.root, state.root.className);
30
30
  return state;
31
31
  };
32
32
 
33
- exports.useMenuListStyles = useMenuListStyles;
33
+ exports.useMenuListStyles_unstable = useMenuListStyles_unstable;
34
34
  //# sourceMappingURL=useMenuListStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuListStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAoB,cAApB;;AAEb,MAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAQA;;AAEG;;;AACI,MAAM,iBAAiB,GAAI,KAAD,IAAwC;AACvE,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,OAAA,CAAA,iBAAb,EAAgC,MAAM,CAAC,IAAvC,EAA6C,KAAK,CAAC,IAAN,CAAW,SAAxD,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuList/useMenuListStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAoB,cAApB;;AAEb,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAQA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAAwC;AAChF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,iBAAb,EAAgC,MAAM,CAAC,IAAvC,EAA6C,KAAK,CAAC,IAAN,CAAW,SAAxD,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport type { MenuListState } from './MenuList.types';\n\nexport const menuListClassName = 'fui-MenuList';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.gap('2px'),\n },\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuListStyles_unstable = (state: MenuListState): MenuListState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuListClassName, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -18,9 +18,9 @@ const renderMenuPopover_1 = /*#__PURE__*/require("./renderMenuPopover");
18
18
 
19
19
 
20
20
  exports.MenuPopover = /*#__PURE__*/React.forwardRef((props, ref) => {
21
- const state = useMenuPopover_1.useMenuPopover(props, ref);
22
- useMenuPopoverStyles_1.useMenuPopoverStyles(state);
23
- return renderMenuPopover_1.renderMenuPopover(state);
21
+ const state = useMenuPopover_1.useMenuPopover_unstable(props, ref);
22
+ useMenuPopoverStyles_1.useMenuPopoverStyles_unstable(state);
23
+ return renderMenuPopover_1.renderMenuPopover_unstable(state);
24
24
  });
25
25
  exports.MenuPopover.displayName = 'MenuPopover';
26
26
  //# sourceMappingURL=MenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAChG,QAAM,KAAK,GAAG,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,GAAtB,CAAd;AAEA,EAAA,sBAAA,CAAA,oBAAA,CAAqB,KAArB;AACA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CALiE,CAArD;AAOb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAChG,QAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,GAA/B,CAAd;AAEA,EAAA,sBAAA,CAAA,6BAAA,CAA8B,KAA9B;AACA,SAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CALiE,CAArD;AAOb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport type { MenuPopoverProps } from './MenuPopover.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus\n */\nexport const MenuPopover: ForwardRefComponent<MenuPopoverProps> = React.forwardRef((props, ref) => {\n const state = useMenuPopover_unstable(props, ref);\n\n useMenuPopoverStyles_unstable(state);\n return renderMenuPopover_unstable(state);\n});\n\nMenuPopover.displayName = 'MenuPopover';\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,6 @@
1
- import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
2
  export declare type MenuPopoverSlots = {
3
- root: IntrinsicShorthandProps<'div'>;
3
+ root: Slot<'div'>;
4
4
  };
5
5
  /**
6
6
  * MenuPopover Props
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuPopover/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './MenuPopover';\nexport * from './MenuPopover.types';\nexport * from './renderMenuPopover';\nexport * from './useMenuPopover';\nexport * from './useMenuPopoverStyles';\n"],"sourceRoot":"../src/"}
@@ -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;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderMenuPopover = void 0;
6
+ exports.renderMenuPopover_unstable = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
@@ -15,7 +15,7 @@ const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
15
15
  */
16
16
 
17
17
 
18
- const renderMenuPopover = state => {
18
+ const renderMenuPopover_unstable = state => {
19
19
  const {
20
20
  slots,
21
21
  slotProps
@@ -30,5 +30,5 @@ const renderMenuPopover = state => {
30
30
  }));
31
31
  };
32
32
 
33
- exports.renderMenuPopover = renderMenuPopover;
33
+ exports.renderMenuPopover_unstable = renderMenuPopover_unstable;
34
34
  //# sourceMappingURL=renderMenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/renderMenuPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,iBAAiB,GAAI,KAAD,IAA4B;AAC3D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;;AAEA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,WAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,KAAX,CAAP;AACD;;AAED,SACE,KAAA,CAAA,aAAA,CAAC,cAAA,CAAA,MAAD,EAAO,IAAP,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CAZM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuPopover/renderMenuPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;;AAEA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,WAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,KAAX,CAAP;AACD;;AAED,SACE,KAAA,CAAA,aAAA,CAAC,cAAA,CAAA,MAAD,EAAO,IAAP,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CAZM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuPopover = void 0;
6
+ exports.useMenuPopover_unstable = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
@@ -21,20 +21,20 @@ const useIsSubmenu_1 = /*#__PURE__*/require("../../utils/useIsSubmenu");
21
21
  /**
22
22
  * Create the state required to render MenuPopover.
23
23
  *
24
- * The returned state can be modified with hooks such as useMenuPopoverStyles,
25
- * before being passed to renderMenuPopover.
24
+ * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
25
+ * before being passed to renderMenuPopover_unstable.
26
26
  *
27
27
  * @param props - props from this instance of MenuPopover
28
28
  * @param ref - reference to root HTMLElement of MenuPopover
29
29
  */
30
30
 
31
31
 
32
- const useMenuPopover = (props, ref) => {
32
+ const useMenuPopover_unstable = (props, ref) => {
33
33
  var _a;
34
34
 
35
- const popoverRef = menuContext_1.useMenuContext(context => context.menuPopoverRef);
36
- const setOpen = menuContext_1.useMenuContext(context => context.setOpen);
37
- const openOnHover = menuContext_1.useMenuContext(context => context.openOnHover);
35
+ const popoverRef = menuContext_1.useMenuContext_unstable(context => context.menuPopoverRef);
36
+ const setOpen = menuContext_1.useMenuContext_unstable(context => context.setOpen);
37
+ const openOnHover = menuContext_1.useMenuContext_unstable(context => context.openOnHover);
38
38
  const isSubmenu = useIsSubmenu_1.useIsSubmenu();
39
39
  const canDispatchCustomEventRef = React.useRef(true);
40
40
  const throttleDispatchTimerRef = React.useRef(0);
@@ -63,7 +63,7 @@ const useMenuPopover = (props, ref) => {
63
63
  React.useEffect(() => {
64
64
  () => clearTimeout(throttleDispatchTimerRef.current);
65
65
  }, []);
66
- const inline = (_a = menuContext_1.useMenuContext(context => context.inline)) !== null && _a !== void 0 ? _a : false;
66
+ const inline = (_a = menuContext_1.useMenuContext_unstable(context => context.inline)) !== null && _a !== void 0 ? _a : false;
67
67
  const rootProps = react_utilities_1.getNativeElementProps('div', {
68
68
  role: 'presentation',
69
69
  ...props,
@@ -109,9 +109,12 @@ const useMenuPopover = (props, ref) => {
109
109
  });
110
110
  return {
111
111
  inline,
112
+ components: {
113
+ root: 'div'
114
+ },
112
115
  root: rootProps
113
116
  };
114
117
  };
115
118
 
116
- exports.useMenuPopover = useMenuPopover;
119
+ exports.useMenuPopover_unstable = useMenuPopover_unstable;
117
120
  //# sourceMappingURL=useMenuPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopover.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CA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EAAA,GAAA,UAAU,CAAC,OAAX,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,QAAF,CAAW,CAAC,CAAC,MAAb,CAAtB,EAA2D;AACzD,QAAA,OAAO,CAAC,CAAD,EAAI;AAAE,UAAA,IAAI,EAAE,KAAR;AAAe,UAAA,QAAQ,EAAE;AAAzB,SAAJ,CAAP;AACD;AACF;;AAED,QAAI,GAAG,KAAK,eAAA,CAAA,GAAZ,EAAiB;AACf,MAAA,OAAO,CAAC,CAAD,EAAI;AAAE,QAAA,IAAI,EAAE,KAAR;AAAe,QAAA,QAAQ,EAAE;AAAzB,OAAJ,CAAP;AACA,MAAA,CAAC,CAAC,cAAF;AACD;;AAED,IAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAA,iBAAiB,CAAG,CAAH,CAAjB;AACD,GAfqB,CAAtB;AAiBA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAFP;AAKL,IAAA,IAAI,EAAE;AALD,GAAP;AAOD,CA9EM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { dispatchMenuEnterEvent } from '../../utils/index';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n\n/**\n * Create the state required to render MenuPopover.\n *\n * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,\n * before being passed to renderMenuPopover_unstable.\n *\n * @param props - props from this instance of MenuPopover\n * @param ref - reference to root HTMLElement of MenuPopover\n */\nexport const useMenuPopover_unstable = (props: MenuPopoverProps, ref: React.Ref<HTMLElement>): MenuPopoverState => {\n const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const isSubmenu = useIsSubmenu();\n const canDispatchCustomEventRef = React.useRef(true);\n const throttleDispatchTimerRef = React.useRef(0);\n\n const { dir } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\n\n // use DOM listener since react events propagate up the react tree\n // no need to do `contains` logic as menus are all positioned in different portals\n const mouseOverListenerCallbackRef = React.useCallback(\n (node: HTMLElement) => {\n if (node) {\n // Dispatches the custom menu mouse enter event with throttling\n // Needs to trigger on mouseover to support keyboard + mouse together\n // i.e. keyboard opens submenus while cursor is still on the parent\n node.addEventListener('mouseover', e => {\n if (canDispatchCustomEventRef.current) {\n canDispatchCustomEventRef.current = false;\n dispatchMenuEnterEvent(popoverRef.current as HTMLElement, e);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore #16889 Node setTimeout type leaking\n throttleDispatchTimerRef.current = setTimeout(() => (canDispatchCustomEventRef.current = true), 250);\n }\n });\n }\n },\n [popoverRef, throttleDispatchTimerRef],\n );\n\n React.useEffect(() => {\n () => clearTimeout(throttleDispatchTimerRef.current);\n }, []);\n\n const inline = useMenuContext_unstable(context => context.inline) ?? false;\n const rootProps = getNativeElementProps('div', {\n role: 'presentation',\n ...props,\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef),\n });\n\n const { onMouseEnter: onMouseEnterOriginal, onKeyDown: onKeyDownOriginal } = rootProps;\n\n rootProps.onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, { open: true, keyboard: false });\n }\n\n onMouseEnterOriginal?.(e);\n });\n\n rootProps.onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLElement>) => {\n const key = e.key;\n\n if (key === Escape || (isSubmenu && key === CloseArrowKey)) {\n if (popoverRef.current?.contains(e.target as HTMLElement)) {\n setOpen(e, { open: false, keyboard: true });\n }\n }\n\n if (key === Tab) {\n setOpen(e, { open: false, keyboard: true });\n e.preventDefault();\n }\n\n onKeyDownOriginal?.(e);\n });\n\n return {\n inline,\n components: {\n root: 'div',\n },\n root: rootProps,\n };\n};\n"],"sourceRoot":"../src/"}