@fluentui/react-menu 9.0.0-nightly.46b9ea7036.0 → 9.0.0-rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (414) hide show
  1. package/CHANGELOG.json +451 -34
  2. package/CHANGELOG.md +102 -22
  3. package/Spec.md +21 -16
  4. package/dist/react-menu.d.ts +140 -71
  5. package/lib/MenuSplitGroup.d.ts +1 -0
  6. package/lib/MenuSplitGroup.js +2 -0
  7. package/lib/MenuSplitGroup.js.map +1 -0
  8. package/lib/components/Menu/Menu.js +7 -7
  9. package/lib/components/Menu/Menu.js.map +1 -1
  10. package/lib/components/Menu/Menu.types.d.ts +1 -1
  11. package/lib/components/Menu/renderMenu.d.ts +1 -1
  12. package/lib/components/Menu/renderMenu.js +1 -1
  13. package/lib/components/Menu/renderMenu.js.map +1 -1
  14. package/lib/components/Menu/useMenu.d.ts +2 -2
  15. package/lib/components/Menu/useMenu.js +119 -128
  16. package/lib/components/Menu/useMenu.js.map +1 -1
  17. package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
  18. package/lib/components/Menu/useMenuContextValues.js +35 -33
  19. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  20. package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
  21. package/lib/components/MenuDivider/MenuDivider.js +8 -8
  22. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  23. package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  24. package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  25. package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
  26. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  27. package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
  28. package/lib/components/MenuDivider/useMenuDivider.js +9 -7
  29. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  30. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
  31. package/lib/components/MenuDivider/useMenuDividerStyles.js +7 -5
  32. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  33. package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
  34. package/lib/components/MenuGroup/MenuGroup.js +10 -8
  35. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  36. package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  37. package/lib/components/MenuGroup/index.d.ts +1 -0
  38. package/lib/components/MenuGroup/index.js +1 -0
  39. package/lib/components/MenuGroup/index.js.map +1 -1
  40. package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  41. package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
  42. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  43. package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
  44. package/lib/components/MenuGroup/useMenuGroup.js +10 -7
  45. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  46. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  47. package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
  48. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  49. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  50. package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
  51. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  52. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  53. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
  54. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  55. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  56. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  57. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
  58. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  59. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  60. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
  61. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  62. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
  63. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +7 -5
  64. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  65. package/lib/components/MenuItem/MenuItem.d.ts +1 -1
  66. package/lib/components/MenuItem/MenuItem.js +8 -10
  67. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  68. package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
  69. package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
  70. package/lib/components/MenuItem/renderMenuItem.js +12 -8
  71. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  72. package/lib/components/MenuItem/useCharacterSearch.js +7 -7
  73. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  74. package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
  75. package/lib/components/MenuItem/useMenuItem.js +35 -45
  76. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  77. package/lib/components/MenuItem/useMenuItemStyles.d.ts +2 -1
  78. package/lib/components/MenuItem/useMenuItemStyles.js +31 -27
  79. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  80. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  81. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
  82. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  83. package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
  84. package/lib/components/MenuItemCheckbox/index.js +1 -0
  85. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  86. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  87. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
  88. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  89. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  90. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
  91. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  92. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  93. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +8 -5
  94. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  95. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  96. package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
  97. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  98. package/lib/components/MenuItemRadio/index.d.ts +1 -0
  99. package/lib/components/MenuItemRadio/index.js +1 -0
  100. package/lib/components/MenuItemRadio/index.js.map +1 -1
  101. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  102. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
  103. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  104. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  105. package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
  106. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  107. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
  108. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +8 -5
  109. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  110. package/lib/components/MenuList/MenuList.d.ts +1 -1
  111. package/lib/components/MenuList/MenuList.js +10 -10
  112. package/lib/components/MenuList/MenuList.js.map +1 -1
  113. package/lib/components/MenuList/MenuList.types.d.ts +12 -10
  114. package/lib/components/MenuList/index.d.ts +1 -1
  115. package/lib/components/MenuList/index.js +0 -1
  116. package/lib/components/MenuList/index.js.map +1 -1
  117. package/lib/components/MenuList/renderMenuList.d.ts +1 -1
  118. package/lib/components/MenuList/renderMenuList.js +7 -7
  119. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  120. package/lib/components/MenuList/useMenuList.d.ts +1 -1
  121. package/lib/components/MenuList/useMenuList.js +70 -87
  122. package/lib/components/MenuList/useMenuList.js.map +1 -1
  123. package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
  124. package/lib/components/MenuList/useMenuListContextValues.js +19 -17
  125. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  126. package/lib/components/MenuList/useMenuListStyles.d.ts +2 -1
  127. package/lib/components/MenuList/useMenuListStyles.js +9 -7
  128. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  129. package/lib/components/MenuPopover/MenuPopover.js +7 -7
  130. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  131. package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  132. package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  133. package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
  134. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  135. package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
  136. package/lib/components/MenuPopover/useMenuPopover.js +35 -41
  137. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  138. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
  139. package/lib/components/MenuPopover/useMenuPopoverStyles.js +13 -8
  140. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  141. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  142. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  143. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  144. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  145. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  146. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  147. package/lib/components/MenuSplitGroup/index.d.ts +5 -0
  148. package/lib/components/MenuSplitGroup/index.js +6 -0
  149. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  150. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  151. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  152. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  153. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  154. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  155. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  156. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  157. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
  158. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  159. package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  160. package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
  161. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  162. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
  163. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  164. package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
  165. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  166. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  167. package/lib/components/MenuTrigger/useMenuTrigger.js +166 -5
  168. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  169. package/lib/contexts/menuContext.d.ts +1 -1
  170. package/lib/contexts/menuContext.js +5 -11
  171. package/lib/contexts/menuContext.js.map +1 -1
  172. package/lib/contexts/menuGroupContext.d.ts +1 -1
  173. package/lib/contexts/menuGroupContext.js +3 -5
  174. package/lib/contexts/menuGroupContext.js.map +1 -1
  175. package/lib/contexts/menuListContext.d.ts +1 -1
  176. package/lib/contexts/menuListContext.js +7 -17
  177. package/lib/contexts/menuListContext.js.map +1 -1
  178. package/lib/contexts/menuTriggerContext.d.ts +1 -1
  179. package/lib/contexts/menuTriggerContext.js +3 -5
  180. package/lib/contexts/menuTriggerContext.js.map +1 -1
  181. package/lib/index.d.ts +11 -10
  182. package/lib/index.js +11 -10
  183. package/lib/index.js.map +1 -1
  184. package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
  185. package/lib/selectable/useCheckmarkStyles.js +4 -4
  186. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  187. package/lib/utils/useIsSubmenu.js +3 -5
  188. package/lib/utils/useIsSubmenu.js.map +1 -1
  189. package/lib/utils/useOnMenuEnter.js +16 -14
  190. package/lib/utils/useOnMenuEnter.js.map +1 -1
  191. package/lib-commonjs/Menu.js +1 -1
  192. package/lib-commonjs/MenuDivider.js +1 -1
  193. package/lib-commonjs/MenuGroup.js +1 -1
  194. package/lib-commonjs/MenuGroupHeader.js +1 -1
  195. package/lib-commonjs/MenuItem.js +1 -1
  196. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  197. package/lib-commonjs/MenuItemRadio.js +1 -1
  198. package/lib-commonjs/MenuList.js +1 -1
  199. package/lib-commonjs/MenuPopover.js +1 -1
  200. package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
  201. package/lib-commonjs/MenuSplitGroup.js +10 -0
  202. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  203. package/lib-commonjs/MenuTrigger.js +1 -1
  204. package/lib-commonjs/components/Menu/Menu.js +7 -7
  205. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  206. package/lib-commonjs/components/Menu/Menu.types.d.ts +1 -1
  207. package/lib-commonjs/components/Menu/index.js +1 -1
  208. package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
  209. package/lib-commonjs/components/Menu/renderMenu.js +5 -5
  210. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  211. package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
  212. package/lib-commonjs/components/Menu/useMenu.js +130 -141
  213. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  214. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
  215. package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
  216. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  217. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
  218. package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
  219. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  220. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  221. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  222. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  223. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
  224. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  225. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
  226. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
  227. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  228. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
  229. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +11 -7
  230. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  231. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
  232. package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
  233. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  234. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  235. package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
  236. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  237. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  238. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  239. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
  240. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  241. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
  242. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
  243. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  244. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  245. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
  246. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  247. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  248. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
  249. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  250. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  251. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
  252. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  253. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  254. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  255. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  256. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
  257. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  258. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  259. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
  260. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  261. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
  262. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +11 -7
  263. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  264. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
  265. package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
  266. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  267. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
  268. package/lib-commonjs/components/MenuItem/index.js +1 -1
  269. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +1 -1
  270. package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
  271. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  272. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  273. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  274. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +2 -6
  275. package/lib-commonjs/components/MenuItem/useMenuItem.js +42 -53
  276. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  277. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +2 -1
  278. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +40 -33
  279. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  280. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  281. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
  282. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  283. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +1 -0
  284. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  285. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  286. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  287. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
  288. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  289. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  290. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
  291. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  292. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  293. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +12 -7
  294. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  295. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  296. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
  297. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  298. package/lib-commonjs/components/MenuItemRadio/index.d.ts +1 -0
  299. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  300. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  301. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  302. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
  303. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  304. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  305. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
  306. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  307. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
  308. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +12 -7
  309. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  310. package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
  311. package/lib-commonjs/components/MenuList/MenuList.js +11 -11
  312. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  313. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +12 -10
  314. package/lib-commonjs/components/MenuList/index.d.ts +1 -1
  315. package/lib-commonjs/components/MenuList/index.js +1 -3
  316. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  317. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
  318. package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
  319. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  320. package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
  321. package/lib-commonjs/components/MenuList/useMenuList.js +77 -95
  322. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  323. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
  324. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
  325. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  326. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +2 -1
  327. package/lib-commonjs/components/MenuList/useMenuListStyles.js +12 -9
  328. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  329. package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
  330. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  331. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  332. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  333. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  334. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
  335. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  336. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
  337. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
  338. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  339. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
  340. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +17 -10
  341. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  342. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  343. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  344. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  345. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  346. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  347. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  348. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
  349. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  350. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  351. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  352. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  353. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  354. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  355. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  356. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  357. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  358. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
  359. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  360. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  361. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
  362. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  363. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
  364. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  365. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  366. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +5 -5
  367. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  368. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  369. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +174 -7
  370. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  371. package/lib-commonjs/components/index.js +1 -1
  372. package/lib-commonjs/contexts/menuContext.d.ts +1 -1
  373. package/lib-commonjs/contexts/menuContext.js +6 -12
  374. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  375. package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
  376. package/lib-commonjs/contexts/menuGroupContext.js +5 -7
  377. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  378. package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
  379. package/lib-commonjs/contexts/menuListContext.js +8 -18
  380. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  381. package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
  382. package/lib-commonjs/contexts/menuTriggerContext.js +5 -7
  383. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  384. package/lib-commonjs/index.d.ts +11 -10
  385. package/lib-commonjs/index.js +17 -15
  386. package/lib-commonjs/index.js.map +1 -1
  387. package/lib-commonjs/selectable/index.js +1 -1
  388. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
  389. package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
  390. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  391. package/lib-commonjs/utils/index.js +1 -1
  392. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  393. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  394. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  395. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  396. package/package.json +15 -17
  397. package/lib/common/isConformant.d.ts +0 -4
  398. package/lib/common/isConformant.js +0 -12
  399. package/lib/common/isConformant.js.map +0 -1
  400. package/lib/common/mockUseMenuContext.d.ts +0 -7
  401. package/lib/common/mockUseMenuContext.js +0 -36
  402. package/lib/common/mockUseMenuContext.js.map +0 -1
  403. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  404. package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
  405. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  406. package/lib-commonjs/common/isConformant.d.ts +0 -4
  407. package/lib-commonjs/common/isConformant.js +0 -23
  408. package/lib-commonjs/common/isConformant.js.map +0 -1
  409. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  410. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  411. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
  412. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  413. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
  414. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
@@ -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,IAAM,WAAW,GAA+B,UAAA,KAAA,EAAK;AAC1D,MAAM,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":["../../../src/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","sourceRoot":""}
@@ -5,12 +5,15 @@ 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;
15
19
  };
16
- export declare type MenuTriggerState = MenuTriggerProps;
@@ -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,7 +6,7 @@ import { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';
6
6
  * Only renders children
7
7
  */
8
8
 
9
- export var renderMenuTrigger = function (state) {
9
+ export const renderMenuTrigger_unstable = state => {
10
10
  return /*#__PURE__*/React.createElement(MenuTriggerContextProvider, {
11
11
  value: true
12
12
  }, state.children);
@@ -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,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACvD,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":["../../../src/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;AAAR,GAA3B,EAA0C,KAAK,CAAC,QAAhD,CAAP;AACD,CAFM","sourceRoot":""}
@@ -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;
@@ -1,5 +1,11 @@
1
- import { __assign } from "tslib";
2
- import { useTriggerElement } from './useTriggerElement';
1
+ import * as React from 'react';
2
+ import { useMenuContext_unstable } from '../../contexts/menuContext';
3
+ import { useIsSubmenu } from '../../utils/useIsSubmenu';
4
+ import { useFocusFinders } from '@fluentui/react-tabster';
5
+ import { useFluent } from '@fluentui/react-shared-contexts';
6
+ import { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';
7
+ import { applyTriggerPropsToChildren, getTriggerChild, useMergedEventCallbacks, useMergedRefs } from '@fluentui/react-utilities';
8
+ import { shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';
3
9
  /**
4
10
  * Create the state required to render MenuTrigger.
5
11
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
@@ -7,10 +13,165 @@ import { useTriggerElement } from './useTriggerElement';
7
13
  * @param props - props from this instance of MenuTrigger
8
14
  */
9
15
 
10
- export var useMenuTrigger = function (props) {
11
- var state = __assign({}, props); // TODO just move the contents of this hook here
16
+ export const useMenuTrigger_unstable = props => {
17
+ var _a, _b, _c, _d, _e, _f;
12
18
 
19
+ const {
20
+ children
21
+ } = props;
22
+ const triggerRef = useMenuContext_unstable(context => context.triggerRef);
23
+ const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);
24
+ const setOpen = useMenuContext_unstable(context => context.setOpen);
25
+ const open = useMenuContext_unstable(context => context.open);
26
+ const triggerId = useMenuContext_unstable(context => context.triggerId);
27
+ const openOnHover = useMenuContext_unstable(context => context.openOnHover);
28
+ const openOnContext = useMenuContext_unstable(context => context.openOnContext);
29
+ const isSubmenu = useIsSubmenu();
30
+ const {
31
+ findFirstFocusable
32
+ } = useFocusFinders();
33
+ const focusFirst = React.useCallback(() => {
34
+ const firstFocusable = findFirstFocusable(menuPopoverRef.current);
35
+ firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
36
+ }, [findFirstFocusable, menuPopoverRef]);
37
+ const openedWithKeyboardRef = React.useRef(false);
38
+ const hasMouseMoved = React.useRef(false);
39
+ const {
40
+ dir
41
+ } = useFluent();
42
+ const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
43
+ const child = /*#__PURE__*/React.isValidElement(children) ? getTriggerChild(children) : undefined;
13
44
 
14
- return useTriggerElement(state);
45
+ const onContextMenu = e => {
46
+ if (isTargetDisabled(e)) {
47
+ return;
48
+ }
49
+
50
+ if (openOnContext) {
51
+ e.preventDefault();
52
+ setOpen(e, {
53
+ open: true,
54
+ keyboard: false
55
+ });
56
+ }
57
+ };
58
+
59
+ const onClick = e => {
60
+ if (isTargetDisabled(e)) {
61
+ return;
62
+ }
63
+
64
+ if (!openOnContext) {
65
+ setOpen(e, {
66
+ open: !open,
67
+ keyboard: openedWithKeyboardRef.current
68
+ });
69
+ openedWithKeyboardRef.current = false;
70
+ }
71
+ };
72
+
73
+ const onKeyDown = e => {
74
+ var _a;
75
+
76
+ if (isTargetDisabled(e)) {
77
+ return;
78
+ }
79
+
80
+ if (shouldPreventDefaultOnKeyDown(e)) {
81
+ e.preventDefault();
82
+ openedWithKeyboardRef.current = true;
83
+ (_a = e.target) === null || _a === void 0 ? void 0 : _a.click();
84
+ }
85
+
86
+ const key = e.key;
87
+
88
+ if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {
89
+ setOpen(e, {
90
+ open: true,
91
+ keyboard: true
92
+ });
93
+ }
94
+
95
+ if (key === Escape && !isSubmenu) {
96
+ setOpen(e, {
97
+ open: false,
98
+ keyboard: true
99
+ });
100
+ } // if menu is already open, can't rely on effects to focus
101
+
102
+
103
+ if (open && key === OpenArrowKey && isSubmenu) {
104
+ focusFirst();
105
+ }
106
+ };
107
+
108
+ const onMouseEnter = e => {
109
+ if (isTargetDisabled(e)) {
110
+ return;
111
+ }
112
+
113
+ if (openOnHover && hasMouseMoved.current) {
114
+ setOpen(e, {
115
+ open: true,
116
+ keyboard: false
117
+ });
118
+ }
119
+ }; // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
120
+ // First time open the mouse using mousemove and then continue with mouseenter
121
+ // Only use once to determine that the user is using the mouse since it is an expensive event to handle
122
+
123
+
124
+ const onMouseMove = e => {
125
+ if (isTargetDisabled(e)) {
126
+ return;
127
+ }
128
+
129
+ if (openOnHover && !hasMouseMoved.current) {
130
+ setOpen(e, {
131
+ open: true,
132
+ keyboard: false
133
+ });
134
+ hasMouseMoved.current = true;
135
+ }
136
+ };
137
+
138
+ const onMouseLeave = e => {
139
+ if (isTargetDisabled(e)) {
140
+ return;
141
+ }
142
+
143
+ if (openOnHover) {
144
+ setOpen(e, {
145
+ open: false,
146
+ keyboard: false
147
+ });
148
+ }
149
+ };
150
+
151
+ return {
152
+ children: applyTriggerPropsToChildren(children, {
153
+ 'aria-haspopup': 'menu',
154
+ 'aria-expanded': !open && !isSubmenu ? undefined : open,
155
+ id: triggerId,
156
+ ...(child === null || child === void 0 ? void 0 : child.props),
157
+ ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
158
+ onClick: useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
159
+ onMouseEnter: useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
160
+ onMouseLeave: useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onMouseLeave, onMouseLeave),
161
+ onKeyDown: useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onKeyDown, onKeyDown),
162
+ onContextMenu: useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
163
+ onMouseMove: useMergedEventCallbacks((_f = child === null || child === void 0 ? void 0 : child.props) === null || _f === void 0 ? void 0 : _f.onMouseMove, onMouseMove)
164
+ })
165
+ };
166
+ };
167
+
168
+ const isTargetDisabled = e => {
169
+ const isDisabled = el => el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';
170
+
171
+ if (e.target instanceof HTMLElement && isDisabled(e.target)) {
172
+ return true;
173
+ }
174
+
175
+ return e.currentTarget instanceof HTMLElement && isDisabled(e.currentTarget);
15
176
  };
16
177
  //# sourceMappingURL=useMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";AAAA,SAAS,iBAAT,QAAkC,qBAAlC;AAGA;;;;;AAKG;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAwB;AACpD,MAAM,KAAK,GAAA,QAAA,CAAA,EAAA,EAAQ,KAAR,CAAX,CADoD,CAGpD;;;AACA,SAAO,iBAAiB,CAAC,KAAD,CAAxB;AACD,CALM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,uBAAT,QAAwC,4BAAxC;AACA,SAAS,YAAT,QAA6B,0BAA7B;AACA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,MAAhC,EAAwC,SAAxC,QAAyD,yBAAzD;AACA,SACE,2BADF,EAEE,eAFF,EAGE,uBAHF,EAIE,aAJF,QAKO,2BALP;AAMA,SAAS,6BAAT,QAA8C,2BAA9C;AAEA;;;;;AAKG;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAA8C;;;AACnF,QAAM;AAAE,IAAA;AAAF,MAAe,KAArB;AAEA,QAAM,UAAU,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,UAApB,CAA1C;AACA,QAAM,cAAc,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,cAApB,CAA9C;AACA,QAAM,OAAO,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,OAApB,CAAvC;AACA,QAAM,IAAI,GAAG,uBAAuB,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AA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,aAAf,EAA8B,aAA9B,CAV+B;AAWrE,MAAA,WAAW,EAAE,uBAAuB,CAAC,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,WAAf,EAA4B,WAA5B;AAXiC,KAAlC;AADhC,GAAP;AAeD,CA1HM;;AA4HP,MAAM,gBAAgB,GAAI,CAAD,IAAoC;AAC3D,QAAM,UAAU,GAAI,EAAD,IACjB,EAAE,CAAC,YAAH,CAAgB,UAAhB,KAAgC,EAAE,CAAC,YAAH,CAAgB,eAAhB,KAAoC,EAAE,CAAC,YAAH,CAAgB,eAAhB,MAAqC,MAD3G;;AAEA,MAAI,CAAC,CAAC,MAAF,YAAoB,WAApB,IAAmC,UAAU,CAAC,CAAC,CAAC,MAAH,CAAjD,EAA6D;AAC3D,WAAO,IAAP;AACD;;AAED,SAAO,CAAC,CAAC,aAAF,YAA2B,WAA3B,IAA0C,UAAU,CAAC,CAAC,CAAC,aAAH,CAA3D;AACD,CARD","sourceRoot":""}
@@ -13,4 +13,4 @@ export declare type MenuContextValue = MenuListProps & Pick<MenuState, 'openOnHo
13
13
  triggerId: string;
14
14
  };
15
15
  export declare const MenuProvider: React.Provider<MenuContextValue> & React.FC<React.ProviderProps<MenuContextValue>>;
16
- export declare const useMenuContext: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
16
+ export declare const useMenuContext_unstable: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
@@ -1,13 +1,9 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
- export var MenuContext = /*#__PURE__*/createContext({
2
+ export const MenuContext = /*#__PURE__*/createContext({
3
3
  open: false,
4
- setOpen: function () {
5
- return false;
6
- },
4
+ setOpen: () => false,
7
5
  checkedValues: {},
8
- onCheckedValueChange: function () {
9
- return null;
10
- },
6
+ onCheckedValueChange: () => null,
11
7
  defaultCheckedValues: {},
12
8
  isSubmenu: false,
13
9
  triggerRef: {
@@ -22,8 +18,6 @@ export var MenuContext = /*#__PURE__*/createContext({
22
18
  hasIcons: false,
23
19
  hasCheckmarks: false
24
20
  });
25
- export var MenuProvider = MenuContext.Provider;
26
- export var useMenuContext = function (selector) {
27
- return useContextSelector(MenuContext, selector);
28
- };
21
+ export const MenuProvider = MenuContext.Provider;
22
+ export const useMenuContext_unstable = selector => useContextSelector(MenuContext, selector);
29
23
  //# sourceMappingURL=menuContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/menuContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,IAAM,WAAW,gBAA8B,aAAa,CAAmB;AACpF,EAAA,IAAI,EAAE,KAD8E;AAEpF,EAAA,OAAO,EAAE,YAAA;AAAM,WAAA,KAAA;AAAK,GAFgE;AAGpF,EAAA,aAAa,EAAE,EAHqE;AAIpF,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJoD;AAKpF,EAAA,oBAAoB,EAAE,EAL8D;AAMpF,EAAA,SAAS,EAAE,KANyE;AAOpF,EAAA,UAAU,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GAPuE;AAQpF,EAAA,cAAc,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GARmE;AASpF,EAAA,SAAS,EAAE,EATyE;AAUpF,EAAA,aAAa,EAAE,KAVqE;AAWpF,EAAA,WAAW,EAAE,KAXuE;AAYpF,EAAA,QAAQ,EAAE,KAZ0E;AAapF,EAAA,aAAa,EAAE;AAbqE,CAAnB,CAA5D;AAwCP,OAAO,IAAM,YAAY,GAAG,WAAW,CAAC,QAAjC;AAEP,OAAO,IAAM,cAAc,GAAG,UAAI,QAAJ,EAAkD;AAC9E,SAAA,kBAAkB,CAAC,WAAD,EAAc,QAAd,CAAlB;AAAyC,CADpC","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/contexts/menuContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,MAAM,WAAW,gBAA8B,aAAa,CAAmB;AACpF,EAAA,IAAI,EAAE,KAD8E;AAEpF,EAAA,OAAO,EAAE,MAAM,KAFqE;AAGpF,EAAA,aAAa,EAAE,EAHqE;AAIpF,EAAA,oBAAoB,EAAE,MAAM,IAJwD;AAKpF,EAAA,oBAAoB,EAAE,EAL8D;AAMpF,EAAA,SAAS,EAAE,KANyE;AAOpF,EAAA,UAAU,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GAPuE;AAQpF,EAAA,cAAc,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GARmE;AASpF,EAAA,SAAS,EAAE,EATyE;AAUpF,EAAA,aAAa,EAAE,KAVqE;AAWpF,EAAA,WAAW,EAAE,KAXuE;AAYpF,EAAA,QAAQ,EAAE,KAZ0E;AAapF,EAAA,aAAa,EAAE;AAbqE,CAAnB,CAA5D;AAwCP,OAAO,MAAM,YAAY,GAAG,WAAW,CAAC,QAAjC;AAEP,OAAO,MAAM,uBAAuB,GAAO,QAAJ,IACrC,kBAAkB,CAAC,WAAD,EAAc,QAAd,CADb","sourceRoot":""}
@@ -10,4 +10,4 @@ export declare type MenuGroupContextValue = {
10
10
  headerId: string;
11
11
  };
12
12
  export declare const MenuGroupContextProvider: React.Provider<MenuGroupContextValue>;
13
- export declare const useMenuGroupContext: () => MenuGroupContextValue;
13
+ export declare const useMenuGroupContext_unstable: () => MenuGroupContextValue;
@@ -1,9 +1,7 @@
1
1
  import * as React from 'react';
2
- var MenuGroupContext = /*#__PURE__*/React.createContext({
2
+ const MenuGroupContext = /*#__PURE__*/React.createContext({
3
3
  headerId: ''
4
4
  });
5
- export var MenuGroupContextProvider = MenuGroupContext.Provider;
6
- export var useMenuGroupContext = function () {
7
- return React.useContext(MenuGroupContext);
8
- };
5
+ export const MenuGroupContextProvider = MenuGroupContext.Provider;
6
+ export const useMenuGroupContext_unstable = () => React.useContext(MenuGroupContext);
9
7
  //# sourceMappingURL=menuGroupContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/menuGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,IAAM,gBAAgB,gBAAG,KAAK,CAAC,aAAN,CAA2C;AAAE,EAAA,QAAQ,EAAE;AAAZ,CAA3C,CAAzB;AAaA,OAAO,IAAM,wBAAwB,GAAG,gBAAgB,CAAC,QAAlD;AACP,OAAO,IAAM,mBAAmB,GAAG,YAAA;AAAM,SAAA,KAAK,CAAC,UAAN,CAAA,gBAAA,CAAA;AAAkC,CAApE","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/contexts/menuGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,MAAM,gBAAgB,gBAAG,KAAK,CAAC,aAAN,CAA2C;AAAE,EAAA,QAAQ,EAAE;AAAZ,CAA3C,CAAzB;AAaA,OAAO,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,QAAlD;AACP,OAAO,MAAM,4BAA4B,GAAG,MAAM,KAAK,CAAC,UAAN,CAAiB,gBAAjB,CAA3C","sourceRoot":""}
@@ -12,4 +12,4 @@ export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' |
12
12
  selectRadio?: SelectableHandler;
13
13
  };
14
14
  export declare const MenuListProvider: React.Provider<MenuListContextValue> & React.FC<React.ProviderProps<MenuListContextValue>>;
15
- export declare const useMenuListContext: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
15
+ export declare const useMenuListContext_unstable: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
@@ -1,23 +1,13 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
- export var MenuListContext = /*#__PURE__*/createContext({
2
+ export const MenuListContext = /*#__PURE__*/createContext({
3
3
  checkedValues: {},
4
- onCheckedValueChange: function () {
5
- return null;
6
- },
7
- setFocusByFirstCharacter: function () {
8
- return null;
9
- },
10
- toggleCheckbox: function () {
11
- return null;
12
- },
13
- selectRadio: function () {
14
- return null;
15
- },
4
+ onCheckedValueChange: () => null,
5
+ setFocusByFirstCharacter: () => null,
6
+ toggleCheckbox: () => null,
7
+ selectRadio: () => null,
16
8
  hasIcons: false,
17
9
  hasCheckmarks: false
18
10
  });
19
- export var MenuListProvider = MenuListContext.Provider;
20
- export var useMenuListContext = function (selector) {
21
- return useContextSelector(MenuListContext, selector);
22
- };
11
+ export const MenuListProvider = MenuListContext.Provider;
12
+ export const useMenuListContext_unstable = selector => useContextSelector(MenuListContext, selector);
23
13
  //# sourceMappingURL=menuListContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/menuListContext.tsx"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,IAAM,eAAe,gBAAkC,aAAa,CAAuB;AAChG,EAAA,aAAa,EAAE,EADiF;AAEhG,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAFgE;AAGhG,EAAA,wBAAwB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAH4D;AAIhG,EAAA,cAAc,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJsE;AAKhG,EAAA,WAAW,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GALyE;AAMhG,EAAA,QAAQ,EAAE,KANsF;AAOhG,EAAA,aAAa,EAAE;AAPiF,CAAvB,CAApE;AAsBP,OAAO,IAAM,gBAAgB,GAAG,eAAe,CAAC,QAAzC;AAEP,OAAO,IAAM,kBAAkB,GAAG,UAAK,QAAL,EAAuD;AACvF,SAAA,kBAAkB,CAAC,eAAD,EAAkB,QAAlB,CAAlB;AAA6C,CADxC","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/contexts/menuListContext.tsx"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,MAAM,eAAe,gBAAkC,aAAa,CAAuB;AAChG,EAAA,aAAa,EAAE,EADiF;AAEhG,EAAA,oBAAoB,EAAE,MAAM,IAFoE;AAGhG,EAAA,wBAAwB,EAAE,MAAM,IAHgE;AAIhG,EAAA,cAAc,EAAE,MAAM,IAJ0E;AAKhG,EAAA,WAAW,EAAE,MAAM,IAL6E;AAMhG,EAAA,QAAQ,EAAE,KANsF;AAOhG,EAAA,aAAa,EAAE;AAPiF,CAAvB,CAApE;AAsBP,OAAO,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAzC;AAEP,OAAO,MAAM,2BAA2B,GAAQ,QAAL,IACzC,kBAAkB,CAAC,eAAD,EAAkB,QAAlB,CADb","sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  export declare const MenuTriggerContextProvider: React.Provider<boolean>;
3
- export declare const useMenuTriggerContext: () => boolean;
3
+ export declare const useMenuTriggerContext_unstable: () => boolean;
@@ -3,9 +3,7 @@ import * as React from 'react';
3
3
  * Context used communicate with child that it is a trigger for a menu
4
4
  */
5
5
 
6
- var MenuTriggerContext = /*#__PURE__*/React.createContext(false);
7
- export var MenuTriggerContextProvider = MenuTriggerContext.Provider;
8
- export var useMenuTriggerContext = function () {
9
- return React.useContext(MenuTriggerContext);
10
- };
6
+ const MenuTriggerContext = /*#__PURE__*/React.createContext(false);
7
+ export const MenuTriggerContextProvider = MenuTriggerContext.Provider;
8
+ export const useMenuTriggerContext_unstable = () => React.useContext(MenuTriggerContext);
11
9
  //# sourceMappingURL=menuTriggerContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/menuTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA;;AAEG;;AACH,IAAM,kBAAkB,gBAAG,KAAK,CAAC,aAAN,CAA6B,KAA7B,CAA3B;AAEA,OAAO,IAAM,0BAA0B,GAAG,kBAAkB,CAAC,QAAtD;AACP,OAAO,IAAM,qBAAqB,GAAG,YAAA;AAAM,SAAA,KAAK,CAAC,UAAN,CAAA,kBAAA,CAAA;AAAoC,CAAxE","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/contexts/menuTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA;;AAEG;;AACH,MAAM,kBAAkB,gBAAG,KAAK,CAAC,aAAN,CAA6B,KAA7B,CAA3B;AAEA,OAAO,MAAM,0BAA0B,GAAG,kBAAkB,CAAC,QAAtD;AACP,OAAO,MAAM,8BAA8B,GAAG,MAAM,KAAK,CAAC,UAAN,CAAiB,kBAAjB,CAA7C","sourceRoot":""}
package/lib/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- export * from './MenuItem';
2
- export * from './MenuList';
3
- export * from './MenuItemCheckbox';
4
- export * from './MenuItemRadio';
5
- export * from './MenuDivider';
6
- export * from './MenuGroupHeader';
7
- export * from './MenuGroup';
8
- export * from './selectable/index';
9
- export * from './MenuTrigger';
10
- export * from './Menu';
11
1
  export * from './contexts/menuContext';
12
2
  export * from './contexts/menuTriggerContext';
13
3
  export * from './contexts/menuGroupContext';
14
4
  export * from './contexts/menuListContext';
5
+ export * from './Menu';
6
+ export * from './MenuDivider';
7
+ export * from './MenuGroup';
8
+ export * from './MenuGroupHeader';
9
+ export * from './MenuItem';
10
+ export * from './MenuItemCheckbox';
11
+ export * from './MenuItemRadio';
12
+ export * from './MenuList';
15
13
  export * from './MenuPopover';
14
+ export * from './MenuSplitGroup';
15
+ export * from './MenuTrigger';
16
+ export * from './selectable/index';
package/lib/index.js CHANGED
@@ -1,16 +1,17 @@
1
- export * from './MenuItem';
2
- export * from './MenuList';
3
- export * from './MenuItemCheckbox';
4
- export * from './MenuItemRadio';
5
- export * from './MenuDivider';
6
- export * from './MenuGroupHeader';
7
- export * from './MenuGroup';
8
- export * from './selectable/index';
9
- export * from './MenuTrigger';
10
- export * from './Menu';
11
1
  export * from './contexts/menuContext';
12
2
  export * from './contexts/menuTriggerContext';
13
3
  export * from './contexts/menuGroupContext';
14
4
  export * from './contexts/menuListContext';
5
+ export * from './Menu';
6
+ export * from './MenuDivider';
7
+ export * from './MenuGroup';
8
+ export * from './MenuGroupHeader';
9
+ export * from './MenuItem';
10
+ export * from './MenuItemCheckbox';
11
+ export * from './MenuItemRadio';
12
+ export * from './MenuList';
15
13
  export * from './MenuPopover';
14
+ export * from './MenuSplitGroup';
15
+ export * from './MenuTrigger';
16
+ export * from './selectable/index';
16
17
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAE9B,cAAc,oBAAoB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { MenuItemSelectableState } from './types';
2
- import type { MenuItemSlots } from '../components/MenuItem/MenuItem.types';
2
+ import type { MenuItemState } from '../components/MenuItem/MenuItem.types';
3
3
  /**
4
4
  * Applies styles to a checkmark slot for selectable menu items
5
5
  *
6
6
  * @param state - should contain a `checkmark` slot
7
7
  */
8
- export declare const useCheckmarkStyles: (state: MenuItemSelectableState & Pick<MenuItemSlots, 'checkmark'>) => void;
8
+ export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
@@ -1,6 +1,6 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
1
+ import { mergeClasses, __styles } from '@griffel/react';
2
2
 
3
- var useStyles = /*#__PURE__*/__styles({
3
+ const useStyles = /*#__PURE__*/__styles({
4
4
  "root": {
5
5
  "a9b677": "fjw5fx7",
6
6
  "Bqenvij": "fd461yt",
@@ -19,8 +19,8 @@ var useStyles = /*#__PURE__*/__styles({
19
19
  */
20
20
 
21
21
 
22
- export var useCheckmarkStyles = function (state) {
23
- var styles = useStyles();
22
+ export const useCheckmarkStyles_unstable = state => {
23
+ const styles = useStyles();
24
24
 
25
25
  if (state.checkmark) {
26
26
  state.checkmark.className = mergeClasses(styles.root, state.checked && styles.rootChecked, state.checkmark.className);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/selectable/useCheckmarkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;;AAIA,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;;;AAIG;;;AACH,OAAO,IAAM,kBAAkB,GAAG,UAAC,KAAD,EAAkE;AAClG,MAAM,MAAM,GAAG,SAAS,EAAxB;;AACA,MAAI,KAAK,CAAC,SAAV,EAAqB;AACnB,IAAA,KAAK,CAAC,SAAN,CAAgB,SAAhB,GAA4B,YAAY,CACtC,MAAM,CAAC,IAD+B,EAEtC,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,WAFc,EAGtC,KAAK,CAAC,SAAN,CAAgB,SAHsB,CAAxC;AAKD;AACF,CATM","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/selectable/useCheckmarkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,gBAAzC;;AAIA,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;;;AAIG;;;AACH,OAAO,MAAM,2BAA2B,GAAI,KAAD,IAAsE;AAC/G,QAAM,MAAM,GAAG,SAAS,EAAxB;;AACA,MAAI,KAAK,CAAC,SAAV,EAAqB;AACnB,IAAA,KAAK,CAAC,SAAN,CAAgB,SAAhB,GAA4B,YAAY,CACtC,MAAM,CAAC,IAD+B,EAEtC,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,WAFc,EAGtC,KAAK,CAAC,SAAN,CAAgB,SAHsB,CAAxC;AAKD;AACF,CATM","sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  import { useHasParentContext } from '@fluentui/react-context-selector';
2
- import { useMenuContext } from '../contexts/menuContext';
2
+ import { useMenuContext_unstable } from '../contexts/menuContext';
3
3
  import { MenuListContext } from '../contexts/menuListContext';
4
4
  /**
5
5
  * A component can be a part of a submenu whether its menu context `isSubmenu` flag is true
@@ -11,10 +11,8 @@ import { MenuListContext } from '../contexts/menuListContext';
11
11
  */
12
12
 
13
13
  export function useIsSubmenu() {
14
- var menuContextValue = useMenuContext(function (context) {
15
- return context.isSubmenu;
16
- });
17
- var hasMenuListContext = useHasParentContext(MenuListContext);
14
+ const menuContextValue = useMenuContext_unstable(context => context.isSubmenu);
15
+ const hasMenuListContext = useHasParentContext(MenuListContext);
18
16
  return menuContextValue || hasMenuListContext;
19
17
  }
20
18
  //# sourceMappingURL=useIsSubmenu.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/useIsSubmenu.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAAoC,kCAApC;AACA,SAAS,cAAT,QAA+B,yBAA/B;AACA,SAAS,eAAT,QAAgC,6BAAhC;AAEA;;;;;;;AAOG;;AACH,OAAM,SAAU,YAAV,GAAsB;AAC1B,MAAM,gBAAgB,GAAG,cAAc,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,SAAA;AAAiB,GAA7B,CAAvC;AACA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,eAAD,CAA9C;AAEA,SAAO,gBAAgB,IAAI,kBAA3B;AACD","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/utils/useIsSubmenu.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAAoC,kCAApC;AACA,SAAS,uBAAT,QAAwC,yBAAxC;AACA,SAAS,eAAT,QAAgC,6BAAhC;AAEA;;;;;;;AAOG;;AACH,OAAM,SAAU,YAAV,GAAsB;AAC1B,QAAM,gBAAgB,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,SAApB,CAAhD;AACA,QAAM,kBAAkB,GAAG,mBAAmB,CAAC,eAAD,CAA9C;AAEA,SAAO,gBAAgB,IAAI,kBAA3B;AACD","sourceRoot":""}
@@ -5,7 +5,7 @@ import { elementContains } from '@fluentui/react-portal';
5
5
  * Name of the custom event
6
6
  */
7
7
 
8
- export var MENU_ENTER_EVENT = 'fuimenuenter';
8
+ export const MENU_ENTER_EVENT = 'fuimenuenter';
9
9
  /**
10
10
  * This hook works similarly to @see {useOnClickOutside}
11
11
  *
@@ -18,27 +18,29 @@ export var MENU_ENTER_EVENT = 'fuimenuenter';
18
18
  * Each nested menu can use the listener to check if the event is from a child or parent menu
19
19
  */
20
20
 
21
- export var useOnMenuMouseEnter = function (options) {
22
- var refs = options.refs,
23
- callback = options.callback,
24
- element = options.element,
25
- disabled = options.disabled; // Keep mouse event here because this is essentially a custom 'mouseenter' event
21
+ export const useOnMenuMouseEnter = options => {
22
+ const {
23
+ refs,
24
+ callback,
25
+ element,
26
+ disabled
27
+ } = options; // Keep mouse event here because this is essentially a custom 'mouseenter' event
26
28
 
27
- var listener = useEventCallback(function (ev) {
29
+ const listener = useEventCallback(ev => {
28
30
  var _a;
29
31
 
30
- var popoverRef = refs[0];
31
- var someMenuPopover = ev.target; // someMenu is a child -> will always be contained because of vParents
32
+ const popoverRef = refs[0];
33
+ const someMenuPopover = ev.target; // someMenu is a child -> will always be contained because of vParents
32
34
  // someMenu is a parent -> will always not be contained because no vParent
33
35
  // someMenu is the current popover -> it will contain itself
34
36
 
35
- var isOutsidePopover = !elementContains((_a = popoverRef.current) !== null && _a !== void 0 ? _a : null, someMenuPopover);
37
+ const isOutsidePopover = !elementContains((_a = popoverRef.current) !== null && _a !== void 0 ? _a : null, someMenuPopover);
36
38
 
37
39
  if (isOutsidePopover && !disabled) {
38
40
  callback(ev);
39
41
  }
40
42
  });
41
- React.useEffect(function () {
43
+ React.useEffect(() => {
42
44
  // eslint-disable-next-line eqeqeq
43
45
  if (element == null) {
44
46
  return;
@@ -48,7 +50,7 @@ export var useOnMenuMouseEnter = function (options) {
48
50
  element.addEventListener(MENU_ENTER_EVENT, listener);
49
51
  }
50
52
 
51
- return function () {
53
+ return () => {
52
54
  element.removeEventListener(MENU_ENTER_EVENT, listener);
53
55
  };
54
56
  }, [listener, element, disabled]);
@@ -59,11 +61,11 @@ export var useOnMenuMouseEnter = function (options) {
59
61
  * @param nativeEvent the native mouse event this is mapped to
60
62
  */
61
63
 
62
- export var dispatchMenuEnterEvent = function (el, nativeEvent) {
64
+ export const dispatchMenuEnterEvent = (el, nativeEvent) => {
63
65
  el.dispatchEvent(new CustomEvent(MENU_ENTER_EVENT, {
64
66
  bubbles: true,
65
67
  detail: {
66
- nativeEvent: nativeEvent
68
+ nativeEvent
67
69
  }
68
70
  }));
69
71
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/useOnMenuEnter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,eAAT,QAAgC,wBAAhC;AAGA;;AAEG;;AACH,OAAO,IAAM,gBAAgB,GAAG,cAAzB;AAEP;;;;;;;;;;AAUG;;AACH,OAAO,IAAM,mBAAmB,GAAG,UAAC,OAAD,EAA0C;AACnE,MAAA,IAAI,GAAkC,OAAO,CAAzC,IAAJ;AAAA,MAAM,QAAQ,GAAwB,OAAO,CAA/B,QAAd;AAAA,MAAgB,OAAO,GAAe,OAAO,CAAtB,OAAvB;AAAA,MAAyB,QAAQ,GAAK,OAAO,CAAZ,QAAjC,CADmE,CAG3E;;AACA,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAC,EAAD,EAAe;;;AAC/C,QAAM,UAAU,GAAG,IAAI,CAAC,CAAD,CAAvB;AACA,QAAM,eAAe,GAAG,EAAE,CAAC,MAA3B,CAF+C,CAI/C;AACA;AACA;;AACA,QAAM,gBAAgB,GAAG,CAAC,eAAe,CAAA,CAAA,EAAA,GAAC,UAAU,CAAC,OAAZ,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,EAAnB,GAAuB,IAAvB,EAA6B,eAA7B,CAAzC;;AACA,QAAI,gBAAgB,IAAI,CAAC,QAAzB,EAAmC;AACjC,MAAA,QAAQ,CA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3B,CAFmD,CAInD;AACA;AACA;;AACA,UAAM,gBAAgB,GAAG,CAAC,eAAe,CAAC,CAAA,EAAA,GAAA,UAAU,CAAC,OAAX,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,EAAlB,GAAsB,IAAvB,EAA6B,eAA7B,CAAzC;;AACA,QAAI,gBAAgB,IAAI,CAAC,QAAzB,EAAmC;AACjC,MAAA,QAAQ,CAAC,EAAD,CAAR;AACD;AACF,GAXgC,CAAjC;AAaA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB;AACA,QAAI,OAAO,IAAI,IAAf,EAAqB;AACnB;AACD;;AAUD,QAAI,CAAC,QAAL,EAAe;AACb,MAAA,OAAO,CAAC,gBAAR,CAAyB,gBAAzB,EAA2C,QAA3C;AACD;;AAED,WAAO,MAAK;AACV,MAAA,OAAO,CAAC,mBAAR,CAA4B,gBAA5B,EAA8C,QAA9C;AACD,KAFD;AAGD,GArBD,EAqBG,CAAC,QAAD,EAAW,OAAX,EAAoB,QAApB,CArBH;AAsBD,CAvCM;AAyCP;;;;AAIG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,EAAD,EAAkB,WAAlB,KAA6C;AACjF,EAAA,EAAE,CAAC,aAAH,CAAiB,IAAI,WAAJ,CAAgB,gBAAhB,EAAkC;AAAE,IAAA,OAAO,EAAE,IAAX;AAAiB,IAAA,MAAM,EAAE;AAAE,MAAA;AAAF;AAAzB,GAAlC,CAAjB;AACD,CAFM","sourceRoot":""}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./components/Menu/index"), exports);
10
10
  //# sourceMappingURL=Menu.js.map