@fluentui/react-menu 9.0.0-nightly.b5b7401007.0 → 9.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (474) hide show
  1. package/CHANGELOG.json +520 -34
  2. package/CHANGELOG.md +120 -22
  3. package/Spec.md +21 -16
  4. package/dist/react-menu.d.ts +141 -71
  5. package/lib/Menu.js.map +1 -1
  6. package/lib/MenuDivider.js.map +1 -1
  7. package/lib/MenuGroup.js.map +1 -1
  8. package/lib/MenuGroupHeader.js.map +1 -1
  9. package/lib/MenuItem.js.map +1 -1
  10. package/lib/MenuItemCheckbox.js.map +1 -1
  11. package/lib/MenuItemRadio.js.map +1 -1
  12. package/lib/MenuList.js.map +1 -1
  13. package/lib/MenuPopover.js.map +1 -1
  14. package/lib/MenuSplitGroup.d.ts +1 -0
  15. package/lib/MenuSplitGroup.js +2 -0
  16. package/lib/MenuSplitGroup.js.map +1 -0
  17. package/lib/MenuTrigger.js.map +1 -1
  18. package/lib/components/Menu/Menu.js +7 -7
  19. package/lib/components/Menu/Menu.js.map +1 -1
  20. package/lib/components/Menu/Menu.types.d.ts +1 -1
  21. package/lib/components/Menu/Menu.types.js.map +1 -1
  22. package/lib/components/Menu/index.js.map +1 -1
  23. package/lib/components/Menu/renderMenu.d.ts +1 -1
  24. package/lib/components/Menu/renderMenu.js +1 -1
  25. package/lib/components/Menu/renderMenu.js.map +1 -1
  26. package/lib/components/Menu/useMenu.d.ts +2 -2
  27. package/lib/components/Menu/useMenu.js +119 -128
  28. package/lib/components/Menu/useMenu.js.map +1 -1
  29. package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
  30. package/lib/components/Menu/useMenuContextValues.js +35 -33
  31. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  32. package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
  33. package/lib/components/MenuDivider/MenuDivider.js +8 -8
  34. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  35. package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  36. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  37. package/lib/components/MenuDivider/index.js.map +1 -1
  38. package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  39. package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
  40. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  41. package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
  42. package/lib/components/MenuDivider/useMenuDivider.js +9 -7
  43. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  44. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
  45. package/lib/components/MenuDivider/useMenuDividerStyles.js +7 -5
  46. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  47. package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
  48. package/lib/components/MenuGroup/MenuGroup.js +10 -8
  49. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  50. package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  51. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  52. package/lib/components/MenuGroup/index.d.ts +1 -0
  53. package/lib/components/MenuGroup/index.js +1 -0
  54. package/lib/components/MenuGroup/index.js.map +1 -1
  55. package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  56. package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
  57. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  58. package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
  59. package/lib/components/MenuGroup/useMenuGroup.js +10 -7
  60. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  61. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  62. package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
  63. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  64. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  65. package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
  66. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  67. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  68. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
  69. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  70. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  71. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  72. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  73. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  74. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
  75. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  76. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  77. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
  78. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  79. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
  80. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +7 -5
  81. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  82. package/lib/components/MenuItem/MenuItem.d.ts +1 -1
  83. package/lib/components/MenuItem/MenuItem.js +8 -10
  84. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  85. package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
  86. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  87. package/lib/components/MenuItem/index.js.map +1 -1
  88. package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
  89. package/lib/components/MenuItem/renderMenuItem.js +12 -8
  90. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  91. package/lib/components/MenuItem/useCharacterSearch.js +7 -7
  92. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  93. package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
  94. package/lib/components/MenuItem/useMenuItem.js +37 -44
  95. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  96. package/lib/components/MenuItem/useMenuItemStyles.d.ts +2 -1
  97. package/lib/components/MenuItem/useMenuItemStyles.js +31 -27
  98. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  99. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  100. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
  101. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  102. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  103. package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
  104. package/lib/components/MenuItemCheckbox/index.js +1 -0
  105. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  106. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  107. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
  108. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  109. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  110. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
  111. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  112. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  113. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +8 -5
  114. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  115. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  116. package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
  117. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  118. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  119. package/lib/components/MenuItemRadio/index.d.ts +1 -0
  120. package/lib/components/MenuItemRadio/index.js +1 -0
  121. package/lib/components/MenuItemRadio/index.js.map +1 -1
  122. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  123. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
  124. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  125. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  126. package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
  127. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  128. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
  129. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +8 -5
  130. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  131. package/lib/components/MenuList/MenuList.d.ts +1 -1
  132. package/lib/components/MenuList/MenuList.js +10 -10
  133. package/lib/components/MenuList/MenuList.js.map +1 -1
  134. package/lib/components/MenuList/MenuList.types.d.ts +12 -10
  135. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  136. package/lib/components/MenuList/index.d.ts +1 -1
  137. package/lib/components/MenuList/index.js +0 -1
  138. package/lib/components/MenuList/index.js.map +1 -1
  139. package/lib/components/MenuList/renderMenuList.d.ts +1 -1
  140. package/lib/components/MenuList/renderMenuList.js +7 -7
  141. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  142. package/lib/components/MenuList/useMenuList.d.ts +1 -1
  143. package/lib/components/MenuList/useMenuList.js +70 -87
  144. package/lib/components/MenuList/useMenuList.js.map +1 -1
  145. package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
  146. package/lib/components/MenuList/useMenuListContextValues.js +19 -17
  147. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  148. package/lib/components/MenuList/useMenuListStyles.d.ts +2 -1
  149. package/lib/components/MenuList/useMenuListStyles.js +9 -7
  150. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  151. package/lib/components/MenuPopover/MenuPopover.js +7 -7
  152. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  153. package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  154. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  155. package/lib/components/MenuPopover/index.js.map +1 -1
  156. package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  157. package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
  158. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  159. package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
  160. package/lib/components/MenuPopover/useMenuPopover.js +35 -41
  161. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  162. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
  163. package/lib/components/MenuPopover/useMenuPopoverStyles.js +13 -8
  164. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  165. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  166. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  167. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  168. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  169. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  170. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  171. package/lib/components/MenuSplitGroup/index.d.ts +5 -0
  172. package/lib/components/MenuSplitGroup/index.js +6 -0
  173. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  174. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  175. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  176. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  177. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  178. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  179. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  180. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  181. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
  182. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  183. package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  184. package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
  185. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  186. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
  187. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  188. package/lib/components/MenuTrigger/index.js.map +1 -1
  189. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  190. package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
  191. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  192. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  193. package/lib/components/MenuTrigger/useMenuTrigger.js +167 -5
  194. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  195. package/lib/components/index.js.map +1 -1
  196. package/lib/contexts/menuContext.d.ts +1 -1
  197. package/lib/contexts/menuContext.js +5 -11
  198. package/lib/contexts/menuContext.js.map +1 -1
  199. package/lib/contexts/menuGroupContext.d.ts +1 -1
  200. package/lib/contexts/menuGroupContext.js +3 -5
  201. package/lib/contexts/menuGroupContext.js.map +1 -1
  202. package/lib/contexts/menuListContext.d.ts +1 -1
  203. package/lib/contexts/menuListContext.js +7 -17
  204. package/lib/contexts/menuListContext.js.map +1 -1
  205. package/lib/contexts/menuTriggerContext.d.ts +1 -1
  206. package/lib/contexts/menuTriggerContext.js +4 -6
  207. package/lib/contexts/menuTriggerContext.js.map +1 -1
  208. package/lib/index.d.ts +11 -10
  209. package/lib/index.js +11 -10
  210. package/lib/index.js.map +1 -1
  211. package/lib/selectable/index.js.map +1 -1
  212. package/lib/selectable/types.js.map +1 -1
  213. package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
  214. package/lib/selectable/useCheckmarkStyles.js +4 -4
  215. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  216. package/lib/utils/index.js.map +1 -1
  217. package/lib/utils/useIsSubmenu.js +3 -5
  218. package/lib/utils/useIsSubmenu.js.map +1 -1
  219. package/lib/utils/useOnMenuEnter.js +16 -14
  220. package/lib/utils/useOnMenuEnter.js.map +1 -1
  221. package/lib-commonjs/Menu.js +1 -1
  222. package/lib-commonjs/Menu.js.map +1 -1
  223. package/lib-commonjs/MenuDivider.js +1 -1
  224. package/lib-commonjs/MenuDivider.js.map +1 -1
  225. package/lib-commonjs/MenuGroup.js +1 -1
  226. package/lib-commonjs/MenuGroup.js.map +1 -1
  227. package/lib-commonjs/MenuGroupHeader.js +1 -1
  228. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  229. package/lib-commonjs/MenuItem.js +1 -1
  230. package/lib-commonjs/MenuItem.js.map +1 -1
  231. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  232. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  233. package/lib-commonjs/MenuItemRadio.js +1 -1
  234. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  235. package/lib-commonjs/MenuList.js +1 -1
  236. package/lib-commonjs/MenuList.js.map +1 -1
  237. package/lib-commonjs/MenuPopover.js +1 -1
  238. package/lib-commonjs/MenuPopover.js.map +1 -1
  239. package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
  240. package/lib-commonjs/MenuSplitGroup.js +10 -0
  241. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  242. package/lib-commonjs/MenuTrigger.js +1 -1
  243. package/lib-commonjs/MenuTrigger.js.map +1 -1
  244. package/lib-commonjs/components/Menu/Menu.js +7 -7
  245. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  246. package/lib-commonjs/components/Menu/Menu.types.d.ts +1 -1
  247. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  248. package/lib-commonjs/components/Menu/index.js +1 -1
  249. package/lib-commonjs/components/Menu/index.js.map +1 -1
  250. package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
  251. package/lib-commonjs/components/Menu/renderMenu.js +5 -5
  252. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  253. package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
  254. package/lib-commonjs/components/Menu/useMenu.js +130 -141
  255. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  256. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
  257. package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
  258. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  259. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
  260. package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
  261. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  262. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
  263. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  264. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  265. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  266. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +1 -1
  267. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
  268. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  269. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
  270. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
  271. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  272. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
  273. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +11 -7
  274. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  275. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
  276. package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
  277. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  278. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
  279. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  280. package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
  281. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  282. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  283. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +1 -1
  284. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
  285. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  286. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
  287. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
  288. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  289. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
  290. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
  291. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  292. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  293. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
  294. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  295. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
  296. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
  297. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  298. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
  299. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  300. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  301. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  302. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
  303. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
  304. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  305. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
  306. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
  307. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  308. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
  309. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +11 -7
  310. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  311. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
  312. package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
  313. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  314. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
  315. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  316. package/lib-commonjs/components/MenuItem/index.js +1 -1
  317. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  318. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +1 -1
  319. package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
  320. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  321. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  322. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  323. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +2 -6
  324. package/lib-commonjs/components/MenuItem/useMenuItem.js +45 -53
  325. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  326. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +2 -1
  327. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +40 -33
  328. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  329. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
  330. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
  331. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  332. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  333. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +1 -0
  334. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  335. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  336. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
  337. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
  338. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  339. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
  340. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
  341. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  342. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  343. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +12 -7
  344. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  345. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
  346. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
  347. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  348. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  349. package/lib-commonjs/components/MenuItemRadio/index.d.ts +1 -0
  350. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  351. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  352. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
  353. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
  354. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  355. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
  356. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
  357. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  358. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
  359. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +12 -7
  360. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  361. package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
  362. package/lib-commonjs/components/MenuList/MenuList.js +11 -11
  363. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  364. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +12 -10
  365. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  366. package/lib-commonjs/components/MenuList/index.d.ts +1 -1
  367. package/lib-commonjs/components/MenuList/index.js +1 -3
  368. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  369. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
  370. package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
  371. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  372. package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
  373. package/lib-commonjs/components/MenuList/useMenuList.js +77 -95
  374. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  375. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
  376. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
  377. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  378. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +2 -1
  379. package/lib-commonjs/components/MenuList/useMenuListStyles.js +12 -9
  380. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  381. package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
  382. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  383. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
  384. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  385. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  386. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  387. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +1 -1
  388. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
  389. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  390. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
  391. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
  392. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  393. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
  394. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +17 -10
  395. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  396. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  397. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  398. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  399. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
  400. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  401. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  402. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
  403. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  404. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  405. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  406. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  407. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  408. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  409. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  410. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  411. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  412. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
  413. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  414. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
  415. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
  416. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  417. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
  418. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  419. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  420. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  421. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
  422. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +6 -6
  423. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  424. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
  425. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +175 -7
  426. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  427. package/lib-commonjs/components/index.js +1 -1
  428. package/lib-commonjs/components/index.js.map +1 -1
  429. package/lib-commonjs/contexts/menuContext.d.ts +1 -1
  430. package/lib-commonjs/contexts/menuContext.js +6 -12
  431. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  432. package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
  433. package/lib-commonjs/contexts/menuGroupContext.js +5 -7
  434. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  435. package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
  436. package/lib-commonjs/contexts/menuListContext.js +8 -18
  437. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  438. package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
  439. package/lib-commonjs/contexts/menuTriggerContext.js +6 -8
  440. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  441. package/lib-commonjs/index.d.ts +11 -10
  442. package/lib-commonjs/index.js +17 -15
  443. package/lib-commonjs/index.js.map +1 -1
  444. package/lib-commonjs/selectable/index.js +1 -1
  445. package/lib-commonjs/selectable/index.js.map +1 -1
  446. package/lib-commonjs/selectable/types.js.map +1 -1
  447. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
  448. package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
  449. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  450. package/lib-commonjs/utils/index.js +1 -1
  451. package/lib-commonjs/utils/index.js.map +1 -1
  452. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  453. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  454. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  455. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  456. package/package.json +15 -17
  457. package/lib/common/isConformant.d.ts +0 -4
  458. package/lib/common/isConformant.js +0 -12
  459. package/lib/common/isConformant.js.map +0 -1
  460. package/lib/common/mockUseMenuContext.d.ts +0 -7
  461. package/lib/common/mockUseMenuContext.js +0 -36
  462. package/lib/common/mockUseMenuContext.js.map +0 -1
  463. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  464. package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
  465. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  466. package/lib-commonjs/common/isConformant.d.ts +0 -4
  467. package/lib-commonjs/common/isConformant.js +0 -23
  468. package/lib-commonjs/common/isConformant.js.map +0 -1
  469. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  470. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  471. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
  472. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  473. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
  474. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
@@ -3,27 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuGroupHeader = void 0;
6
+ exports.useMenuGroupHeader_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const menuGroupContext_1 = /*#__PURE__*/require("../../contexts/menuGroupContext");
9
9
 
10
- var menuGroupContext_1 = /*#__PURE__*/require("../../contexts/menuGroupContext");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
11
  /**
14
12
  * Given user props, returns state and render function for a MenuGroupHeader.
15
13
  */
16
14
 
17
15
 
18
- function useMenuGroupHeader(props, ref) {
19
- var id = menuGroupContext_1.useMenuGroupContext().headerId;
16
+ function useMenuGroupHeader_unstable(props, ref) {
17
+ const {
18
+ headerId: id
19
+ } = menuGroupContext_1.useMenuGroupContext_unstable();
20
20
  return {
21
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({
22
- ref: ref,
23
- id: id
24
- }, props))
21
+ components: {
22
+ root: 'div'
23
+ },
24
+ root: react_utilities_1.getNativeElementProps('div', {
25
+ ref,
26
+ id,
27
+ ...props
28
+ })
25
29
  };
26
30
  }
27
31
 
28
- exports.useMenuGroupHeader = useMenuGroupHeader;
32
+ exports.useMenuGroupHeader_unstable = useMenuGroupHeader_unstable;
29
33
  //# sourceMappingURL=useMenuGroupHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuGroupHeader/useMenuGroupHeader.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,kBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACH,SAAgB,kBAAhB,CAAmC,KAAnC,EAAgE,GAAhE,EAA2F;AACjF,MAAU,EAAE,GAAK,kBAAA,CAAA,mBAAA,GAAL,QAAZ;AAER,SAAO;AACL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA2B,OAAA,CAAA,QAAA,CAAA;AAC/B,MAAA,GAAG,EAAA,GAD4B;AAE/B,MAAA,EAAE,EAAA;AAF6B,KAAA,EAG5B,KAH4B,CAA3B;AADD,GAAP;AAOD;;AAVD,OAAA,CAAA,kBAAA,GAAA,kBAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuGroupHeader/useMenuGroupHeader.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACH,SAAgB,2BAAhB,CACE,KADF,EAEE,GAFF,EAE6B;AAE3B,QAAM;AAAE,IAAA,QAAQ,EAAE;AAAZ,MAAmB,kBAAA,CAAA,4BAAA,EAAzB;AAEA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KADP;AAIL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AACjC,MAAA,GADiC;AAEjC,MAAA,EAFiC;AAGjC,SAAG;AAH8B,KAA7B;AAJD,GAAP;AAUD;;AAhBD,OAAA,CAAA,2BAAA,GAAA,2BAAA","sourcesContent":["import * as React from 'react';\nimport { useMenuGroupContext_unstable } from '../../contexts/menuGroupContext';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { MenuGroupHeaderProps, MenuGroupHeaderState } from './MenuGroupHeader.types';\n\n/**\n * Given user props, returns state and render function for a MenuGroupHeader.\n */\nexport function useMenuGroupHeader_unstable(\n props: MenuGroupHeaderProps,\n ref: React.Ref<HTMLElement>,\n): MenuGroupHeaderState {\n const { headerId: id } = useMenuGroupContext_unstable();\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n id,\n ...props,\n }),\n };\n}\n"],"sourceRoot":"../src/"}
@@ -1,2 +1,3 @@
1
1
  import type { MenuGroupHeaderState } from './MenuGroupHeader.types';
2
- export declare const useMenuGroupHeaderStyles: (state: MenuGroupHeaderState) => import("@fluentui/react-utilities").ComponentState<import("./MenuGroupHeader.types").MenuGroupHeaderSlots>;
2
+ export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
3
+ export declare const useMenuGroupHeaderStyles_unstable: (state: MenuGroupHeaderState) => MenuGroupHeaderState;
@@ -3,11 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuGroupHeaderStyles = void 0;
6
+ exports.useMenuGroupHeaderStyles_unstable = exports.menuGroupHeaderClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
+
12
+ exports.menuGroupHeaderClassName = 'fui-MenuGroupHeader';
13
+
14
+ const useStyles = /*#__PURE__*/react_1.__styles({
11
15
  "root": {
12
16
  "Be2twd7": "fy9rknc",
13
17
  "sj55zd": "f11d4kpn",
@@ -22,11 +26,11 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
22
26
  "d": [".fy9rknc{font-size:var(--fontSizeBase200);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fjlbh76{padding-left:12px;}", ".f11qrl6u{padding-right:12px;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1d2rq10{height:32px;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}"]
23
27
  });
24
28
 
25
- var useMenuGroupHeaderStyles = function (state) {
26
- var styles = useStyles();
27
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.root.className);
29
+ const useMenuGroupHeaderStyles_unstable = state => {
30
+ const styles = useStyles();
31
+ state.root.className = react_1.mergeClasses(exports.menuGroupHeaderClassName, styles.root, state.root.className);
28
32
  return state;
29
33
  };
30
34
 
31
- exports.useMenuGroupHeaderStyles = useMenuGroupHeaderStyles;
35
+ exports.useMenuGroupHeaderStyles_unstable = useMenuGroupHeaderStyles_unstable;
32
36
  //# sourceMappingURL=useMenuGroupHeaderStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuGroupHeader/useMenuGroupHeaderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAaO,IAAM,wBAAwB,GAAG,UAAC,KAAD,EAA4B;AAClE,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,MAAM,CAAC,IAApB,EAA0B,KAAK,CAAC,IAAN,CAAW,SAArC,CAAvB;AAEA,SAAO,KAAP;AACD,CALM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuGroupHeader/useMenuGroupHeaderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAGa,OAAA,CAAA,wBAAA,GAA2B,qBAA3B;;AAEb,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAaO,MAAM,iCAAiC,GAAI,KAAD,IAAgC;AAC/E,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,wBAAb,EAAuC,MAAM,CAAC,IAA9C,EAAoD,KAAK,CAAC,IAAN,CAAW,SAA/D,CAAvB;AAEA,SAAO,KAAP;AACD,CALM;;AAAM,OAAA,CAAA,iCAAA,GAAiC,iCAAjC","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { MenuGroupHeaderState } from './MenuGroupHeader.types';\n\nexport const menuGroupHeaderClassName = 'fui-MenuGroupHeader';\n\nconst useStyles = makeStyles({\n root: {\n fontSize: tokens.fontSizeBase200,\n color: tokens.colorNeutralForeground3,\n paddingLeft: '12px',\n paddingRight: '12px',\n fontWeight: tokens.fontWeightSemibold,\n height: '32px',\n display: 'flex',\n alignItems: 'center',\n },\n});\n\nexport const useMenuGroupHeaderStyles_unstable = (state: MenuGroupHeaderState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuGroupHeaderClassName, styles.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,6 @@
1
1
  import type { MenuItemProps } from './MenuItem.types';
2
2
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * Define a styled MenuItem, using the `useMenuItem` and `useMenuItemStyles` hook.
4
+ * Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
5
5
  */
6
6
  export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
@@ -5,25 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MenuItem = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var useMenuItem_1 = /*#__PURE__*/require("./useMenuItem");
10
+ const useMenuItem_1 = /*#__PURE__*/require("./useMenuItem");
11
11
 
12
- var renderMenuItem_1 = /*#__PURE__*/require("./renderMenuItem");
12
+ const renderMenuItem_1 = /*#__PURE__*/require("./renderMenuItem");
13
13
 
14
- var useMenuItemStyles_1 = /*#__PURE__*/require("./useMenuItemStyles");
15
-
16
- var index_1 = /*#__PURE__*/require("../../selectable/index");
14
+ const useMenuItemStyles_1 = /*#__PURE__*/require("./useMenuItemStyles");
17
15
  /**
18
- * Define a styled MenuItem, using the `useMenuItem` and `useMenuItemStyles` hook.
16
+ * Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
19
17
  */
20
18
 
21
19
 
22
- exports.MenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
23
- var state = useMenuItem_1.useMenuItem(props, ref);
24
- useMenuItemStyles_1.useMenuItemStyles(state);
25
- index_1.useCheckmarkStyles(state);
26
- return renderMenuItem_1.renderMenuItem(state);
20
+ exports.MenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useMenuItem_1.useMenuItem_unstable(props, ref);
22
+ useMenuItemStyles_1.useMenuItemStyles_unstable(state);
23
+ return renderMenuItem_1.renderMenuItem_unstable(state);
27
24
  });
28
25
  exports.MenuItem.displayName = 'MenuItem';
29
26
  //# sourceMappingURL=MenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/MenuItem.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAKA;;AAEG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AACtF,MAAM,KAAK,GAAG,aAAA,CAAA,WAAA,CAAY,KAAZ,EAAmB,GAAnB,CAAd;AAEA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AACA,EAAA,OAAA,CAAA,kBAAA,CAAmB,KAAnB;AACA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,CAAP;AACD,CAN2D,CAA/C;AAQb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItem/MenuItem.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,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;AAEA,EAAA,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;AACA,SAAO,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAP;AACD,CAL2D,CAA/C;AAOb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourcesContent":["import * as React from 'react';\nimport { useMenuItem_unstable } from './useMenuItem';\nimport { renderMenuItem_unstable } from './renderMenuItem';\nimport { useMenuItemStyles_unstable } from './useMenuItemStyles';\nimport type { MenuItemProps } from './MenuItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.\n */\nexport const MenuItem: ForwardRefComponent<MenuItemProps> = React.forwardRef((props, ref) => {\n const state = useMenuItem_unstable(props, ref);\n\n useMenuItemStyles_unstable(state);\n return renderMenuItem_unstable(state);\n});\n\nMenuItem.displayName = 'MenuItem';\n"],"sourceRoot":"../src/"}
@@ -1,28 +1,28 @@
1
- import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
2
  export declare type MenuItemSlots = {
3
- root: IntrinsicShorthandProps<'div'>;
3
+ root: Slot<'div'>;
4
4
  /**
5
5
  * Icon slot rendered before children content
6
6
  */
7
- icon?: IntrinsicShorthandProps<'span'>;
7
+ icon?: Slot<'span'>;
8
8
  /**
9
9
  * A helper slot for alignment when a menu item is used with selectable menuitems
10
10
  * Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
11
11
  */
12
- checkmark?: IntrinsicShorthandProps<'span'>;
12
+ checkmark?: Slot<'span'>;
13
13
  /**
14
14
  * Icon slot that shows the indicator for a submenu
15
15
  */
16
- submenuIndicator?: IntrinsicShorthandProps<'span'>;
16
+ submenuIndicator?: Slot<'span'>;
17
17
  /**
18
18
  * Component children are placed in this slot
19
19
  * Avoid using the `children` property in this slot in favour of Component children whenever possible
20
20
  */
21
- content: IntrinsicShorthandProps<'span'>;
21
+ content?: Slot<'span'>;
22
22
  /**
23
23
  * Secondary content rendered opposite the primary content (e.g Shortcut text)
24
24
  */
25
- secondaryContent?: IntrinsicShorthandProps<'span'>;
25
+ secondaryContent?: Slot<'span'>;
26
26
  };
27
27
  declare type MenuItemCommons = {
28
28
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./MenuItem"), exports);
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/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","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItem/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","sourcesContent":["export * from './MenuItem';\nexport * from './MenuItem.types';\nexport * from './renderMenuItem';\nexport * from './useMenuItem';\nexport * from './useMenuItemStyles';\n"],"sourceRoot":"../src/"}
@@ -2,4 +2,4 @@ import type { MenuItemState } from './MenuItem.types';
2
2
  /**
3
3
  * Function that renders the final JSX of the component
4
4
  */
5
- export declare const renderMenuItem: (state: MenuItemState) => JSX.Element;
5
+ export declare const renderMenuItem_unstable: (state: MenuItemState) => JSX.Element;
@@ -3,27 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderMenuItem = void 0;
6
+ exports.renderMenuItem_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
-
14
- var useMenuItem_1 = /*#__PURE__*/require("./useMenuItem");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
11
  /**
16
12
  * Function that renders the final JSX of the component
17
13
  */
18
14
 
19
15
 
20
- var renderMenuItem = function (state) {
21
- var _a = react_utilities_1.getSlots(state, useMenuItem_1.menuItemSlots),
22
- slots = _a.slots,
23
- slotProps = _a.slotProps;
24
-
25
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), React.createElement(slots.checkmark, tslib_1.__assign({}, slotProps.checkmark)), React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), React.createElement(slots.content, tslib_1.__assign({}, slotProps.content)), React.createElement(slots.secondaryContent, tslib_1.__assign({}, slotProps.secondaryContent)), React.createElement(slots.submenuIndicator, tslib_1.__assign({}, slotProps.submenuIndicator)));
16
+ const renderMenuItem_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ return React.createElement(slots.root, { ...slotProps.root
22
+ }, slots.checkmark && React.createElement(slots.checkmark, { ...slotProps.checkmark
23
+ }), slots.icon && React.createElement(slots.icon, { ...slotProps.icon
24
+ }), slots.content && React.createElement(slots.content, { ...slotProps.content
25
+ }), slots.secondaryContent && React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
26
+ }), slots.submenuIndicator && React.createElement(slots.submenuIndicator, { ...slotProps.submenuIndicator
27
+ }));
26
28
  };
27
29
 
28
- exports.renderMenuItem = renderMenuItem;
30
+ exports.renderMenuItem_unstable = renderMenuItem_unstable;
29
31
  //# sourceMappingURL=renderMenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAqB;AAC3C,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,EAA+B,aAAA,CAAA,aAA/B,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,SAAf,CAAhB,CADF,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAFF,EAG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N,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,EAKG,KAAK,CAAC,gBAAN,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAL7B,CADF;AASD,CAZM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItem_unstable = (state: MenuItemState) => {\n const { slots, slotProps } = getSlots<MenuItemSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.checkmark && <slots.checkmark {...slotProps.checkmark} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.content && <slots.content {...slotProps.content} />}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n {slots.submenuIndicator && <slots.submenuIndicator {...slotProps.submenuIndicator} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useCharacterSearch = void 0;
7
7
 
8
- var menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
8
+ const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
9
9
 
10
- var useCharacterSearch = function (state, ref) {
11
- var setFocusByFirstCharacter = menuListContext_1.useMenuListContext(function (context) {
12
- return context.setFocusByFirstCharacter;
13
- });
14
- var onKeyDownBase = state.root.onKeyDown;
10
+ const useCharacterSearch = (state, ref) => {
11
+ const setFocusByFirstCharacter = menuListContext_1.useMenuListContext_unstable(context => context.setFocusByFirstCharacter);
12
+ const {
13
+ onKeyDown: onKeyDownBase
14
+ } = state.root;
15
15
 
16
- state.root.onKeyDown = function (e) {
16
+ state.root.onKeyDown = e => {
17
17
  var _a;
18
18
 
19
19
  if (onKeyDownBase) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/useCharacterSearch.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AAGO,IAAM,kBAAkB,GAAG,UAAC,KAAD,EAAuB,GAAvB,EAAwD;AACxF,MAAM,wBAAwB,GAAG,iBAAA,CAAA,kBAAA,CAAmB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,wBAAA;AAAgC,GAA9D,CAAjC;AAEQ,MAAW,aAAa,GAAK,KAAK,CAAC,IAAN,CAAL,SAAxB;;AACR,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,UAAA,CAAA,EAAC;;;AACtB,QAAI,aAAJ,EAAmB;AACjB,MAAA,aAAa,CAAC,CAAD,CAAb;AACD;;AAED,QAAI,CAAA,CAAA,EAAA,GAAA,CAAC,CAAC,GAAF,MAAK,IAAL,IAAK,EAAA,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAK,EAAA,CAAE,MAAP,IAAgB,CAApB,EAAuB;AACrB;AACD;;AAED,QAAI,GAAG,CAAC,OAAR,EAAiB;AACf,MAAA,wBAAwB,KAAA,IAAxB,IAAA,wBAAwB,KAAA,KAAA,CAAxB,GAAwB,KAAA,CAAxB,GAAA,wBAAwB,CAAG,CAAH,EAAM,GAAG,CAAC,OAAV,CAAxB;AACD;AACF,GAZD;;AAcA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItem/useCharacterSearch.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AAGO,MAAM,kBAAkB,GAAG,CAAC,KAAD,EAAuB,GAAvB,KAA4D;AAC5F,QAAM,wBAAwB,GAAG,iBAAA,CAAA,2BAAA,CAA4B,OAAO,IAAI,OAAO,CAAC,wBAA/C,CAAjC;AAEA,QAAM;AAAE,IAAA,SAAS,EAAE;AAAb,MAA+B,KAAK,CAAC,IAA3C;;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,CAAC,IAAG;;;AACzB,QAAI,aAAJ,EAAmB;AACjB,MAAA,aAAa,CAAC,CAAD,CAAb;AACD;;AAED,QAAI,CAAA,CAAA,EAAA,GAAA,CAAC,CAAC,GAAF,MAAK,IAAL,IAAK,EAAA,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAK,EAAA,CAAE,MAAP,IAAgB,CAApB,EAAuB;AACrB;AACD;;AAED,QAAI,GAAG,CAAC,OAAR,EAAiB;AACf,MAAA,wBAAwB,KAAA,IAAxB,IAAA,wBAAwB,KAAA,KAAA,CAAxB,GAAwB,KAAA,CAAxB,GAAA,wBAAwB,CAAG,CAAH,EAAM,GAAG,CAAC,OAAV,CAAxB;AACD;AACF,GAZD;;AAcA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import * as React from 'react';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport type { MenuItemState } from '../../components/index';\n\nexport const useCharacterSearch = (state: MenuItemState, ref: React.RefObject<HTMLElement>) => {\n const setFocusByFirstCharacter = useMenuListContext_unstable(context => context.setFocusByFirstCharacter);\n\n const { onKeyDown: onKeyDownBase } = state.root;\n state.root.onKeyDown = e => {\n if (onKeyDownBase) {\n onKeyDownBase(e);\n }\n\n if (e.key?.length > 1) {\n return;\n }\n\n if (ref.current) {\n setFocusByFirstCharacter?.(e, ref.current);\n }\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,10 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem.types';
3
- /**
4
- * Consts listing which props are shorthand props.
5
- */
6
- export declare const menuItemSlots: Array<keyof MenuItemSlots>;
2
+ import type { MenuItemProps, MenuItemState } from './MenuItem.types';
7
3
  /**
8
4
  * Returns the props and state required to render the component
9
5
  */
10
- export declare const useMenuItem: (props: MenuItemProps, ref: React.Ref<HTMLElement>) => MenuItemState;
6
+ export declare const useMenuItem_unstable: (props: MenuItemProps, ref: React.Ref<HTMLElement>) => MenuItemState;
@@ -3,56 +3,45 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuItem = exports.menuItemSlots = void 0;
6
+ exports.useMenuItem_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
13
13
 
14
- var react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
14
+ const useCharacterSearch_1 = /*#__PURE__*/require("./useCharacterSearch");
15
15
 
16
- var useCharacterSearch_1 = /*#__PURE__*/require("./useCharacterSearch");
16
+ const menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
17
17
 
18
- var menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
18
+ const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
19
19
 
20
- var react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
20
+ const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
21
21
 
22
- var menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
23
-
24
- var menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
25
- /**
26
- * Consts listing which props are shorthand props.
27
- */
28
-
29
-
30
- exports.menuItemSlots = ['root', 'icon', 'submenuIndicator', 'content', 'secondaryContent', 'checkmark'];
22
+ const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
31
23
  /**
32
24
  * Returns the props and state required to render the component
33
25
  */
34
26
 
35
- var useMenuItem = function (props, ref) {
36
- var hasSubmenu = menuTriggerContext_1.useMenuTriggerContext();
37
- var hasIcons = menuListContext_1.useMenuListContext(function (context) {
38
- return context.hasIcons;
39
- });
40
- var hasCheckmarks = menuListContext_1.useMenuListContext(function (context) {
41
- return context.hasCheckmarks;
42
- });
43
- var setOpen = menuContext_1.useMenuContext(function (context) {
44
- return context.setOpen;
45
- });
46
- var persistOnClickContext = menuContext_1.useMenuContext(function (context) {
47
- return context.persistOnItemClick;
48
- });
49
- var dismissedWithKeyboardRef = React.useRef(false);
50
- var dir = react_shared_contexts_1.useFluent().dir;
51
- var innerRef = React.useRef(null);
52
27
 
53
- var state = tslib_1.__assign(tslib_1.__assign({
54
- hasSubmenu: hasSubmenu
55
- }, props), {
28
+ const useMenuItem_unstable = (props, ref) => {
29
+ var _a;
30
+
31
+ const hasIcons = menuListContext_1.useMenuListContext_unstable(context => context.hasIcons);
32
+ const hasCheckmarks = menuListContext_1.useMenuListContext_unstable(context => context.hasCheckmarks);
33
+ const setOpen = menuContext_1.useMenuContext_unstable(context => context.setOpen);
34
+ const persistOnClickContext = menuContext_1.useMenuContext_unstable(context => context.persistOnItemClick);
35
+ const dismissedWithKeyboardRef = React.useRef(false);
36
+ const isSubmenuTrigger = menuTriggerContext_1.useMenuTriggerContext_unstable();
37
+ const hasSubmenu = (_a = props.hasSubmenu) !== null && _a !== void 0 ? _a : isSubmenuTrigger;
38
+ const {
39
+ dir
40
+ } = react_shared_contexts_1.useFluent();
41
+ const innerRef = React.useRef(null);
42
+ const state = {
43
+ hasSubmenu,
44
+ ...props,
56
45
  components: {
57
46
  root: 'div',
58
47
  icon: 'span',
@@ -61,12 +50,13 @@ var useMenuItem = function (props, ref) {
61
50
  content: 'span',
62
51
  secondaryContent: 'span'
63
52
  },
64
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({
53
+ root: react_utilities_1.getNativeElementProps('div', {
65
54
  ref: react_utilities_1.useMergedRefs(ref, innerRef),
66
55
  role: 'menuitem',
67
56
  tabIndex: 0,
68
- 'aria-disabled': props.disabled
69
- }, props)),
57
+ 'aria-disabled': props.disabled,
58
+ ...props
59
+ }),
70
60
  icon: react_utilities_1.resolveShorthand(props.icon, {
71
61
  required: hasIcons
72
62
  }),
@@ -76,23 +66,23 @@ var useMenuItem = function (props, ref) {
76
66
  submenuIndicator: react_utilities_1.resolveShorthand(props.submenuIndicator, {
77
67
  required: hasSubmenu,
78
68
  defaultProps: {
79
- children: dir === 'ltr' ? React.createElement(react_icons_1.ChevronRight20Regular, null) : React.createElement(react_icons_1.ChevronLeft20Regular, null)
69
+ children: dir === 'ltr' ? React.createElement(react_icons_1.ChevronRightRegular, null) : React.createElement(react_icons_1.ChevronLeftRegular, null)
80
70
  }
81
71
  }),
82
72
  content: react_utilities_1.resolveShorthand(props.content, {
83
- required: true,
73
+ required: !!props.children,
84
74
  defaultProps: {
85
75
  children: props.children
86
76
  }
87
77
  }),
88
78
  secondaryContent: react_utilities_1.resolveShorthand(props.secondaryContent)
89
- });
90
-
91
- var _a = state.root,
92
- onClickOriginal = _a.onClick,
93
- onKeyDownOriginal = _a.onKeyDown;
79
+ };
80
+ const {
81
+ onClick: onClickOriginal,
82
+ onKeyDown: onKeyDownOriginal
83
+ } = state.root;
94
84
 
95
- state.root.onKeyDown = function (e) {
85
+ state.root.onKeyDown = e => {
96
86
  var _a;
97
87
 
98
88
  if (react_utilities_1.shouldPreventDefaultOnKeyDown(e)) {
@@ -110,14 +100,14 @@ var useMenuItem = function (props, ref) {
110
100
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
111
101
  };
112
102
 
113
- state.root.onClick = function (e) {
103
+ state.root.onClick = e => {
114
104
  if (state.disabled) {
115
105
  e.preventDefault();
116
106
  e.stopPropagation();
117
107
  return;
118
108
  }
119
109
 
120
- var shouldPersist = persistOnClickContext; // prop wins over context;
110
+ let shouldPersist = persistOnClickContext; // prop wins over context;
121
111
 
122
112
  if (state.persistOnClick !== undefined && persistOnClickContext !== state.persistOnClick) {
123
113
  shouldPersist = state.persistOnClick;
@@ -135,8 +125,10 @@ var useMenuItem = function (props, ref) {
135
125
  onClickOriginal === null || onClickOriginal === void 0 ? void 0 : onClickOriginal(e);
136
126
  };
137
127
 
138
- var onMouseEnterOriginal = state.root.onMouseEnter;
139
- state.root.onMouseEnter = react_utilities_1.useEventCallback(function (e) {
128
+ const {
129
+ onMouseEnter: onMouseEnterOriginal
130
+ } = state.root;
131
+ state.root.onMouseEnter = react_utilities_1.useEventCallback(e => {
140
132
  var _a;
141
133
 
142
134
  (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
@@ -146,5 +138,5 @@ var useMenuItem = function (props, ref) {
146
138
  return state;
147
139
  };
148
140
 
149
- exports.useMenuItem = useMenuItem;
141
+ exports.useMenuItem_unstable = useMenuItem_unstable;
150
142
  //# sourceMappingURL=useMenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/useMenuItem.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAOA,IAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIA,IAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;AAGA;;AAEG;;;AACU,OAAA,CAAA,aAAA,G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AAA,eAAe,CAAG,CAAH,CAAf;AACD,GAnBD;;AAqBA,QAAM;AAAE,IAAA,YAAY,EAAE;AAAhB,MAAyC,KAAK,CAAC,IAArD;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,YAAX,GAA0B,iBAAA,CAAA,gBAAA,CAAiB,CAAC,IAAG;;;AAC7C,KAAA,EAAA,GAAA,QAAQ,CAAC,OAAT,MAAgB,IAAhB,IAAgB,EAAA,KAAA,KAAA,CAAhB,GAAgB,KAAA,CAAhB,GAAgB,EAAA,CAAE,KAAF,EAAhB;AAEA,IAAA,oBAAoB,KAAA,IAApB,IAAA,oBAAoB,KAAA,KAAA,CAApB,GAAoB,KAAA,CAApB,GAAA,oBAAoB,CAAG,CAAH,CAApB;AACD,GAJyB,CAA1B;AAMA,EAAA,oBAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,QAA1B;AACA,SAAO,KAAP;AACD,CA7FM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import * as React from 'react';\nimport {\n useEventCallback,\n shouldPreventDefaultOnKeyDown,\n resolveShorthand,\n useMergedRefs,\n getNativeElementProps,\n} from '@fluentui/react-utilities';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport { useCharacterSearch } from './useCharacterSearch';\nimport { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';\nimport { ChevronRightRegular as ChevronRightIcon, ChevronLeftRegular as ChevronLeftIcon } from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport type { MenuItemProps, MenuItemState } from './MenuItem.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuItem_unstable = (props: MenuItemProps, ref: React.Ref<HTMLElement>): MenuItemState => {\n const hasIcons = useMenuListContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuListContext_unstable(context => context.hasCheckmarks);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const persistOnClickContext = useMenuContext_unstable(context => context.persistOnItemClick);\n const dismissedWithKeyboardRef = React.useRef(false);\n\n const isSubmenuTrigger = useMenuTriggerContext_unstable();\n const hasSubmenu = props.hasSubmenu ?? isSubmenuTrigger;\n\n const { dir } = useFluent();\n const innerRef = React.useRef<HTMLElement>(null);\n\n const state: MenuItemState = {\n hasSubmenu,\n ...props,\n components: {\n root: 'div',\n icon: 'span',\n checkmark: 'span',\n submenuIndicator: 'span',\n content: 'span',\n secondaryContent: 'span',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, innerRef),\n role: 'menuitem',\n tabIndex: 0,\n 'aria-disabled': props.disabled,\n ...props,\n }),\n icon: resolveShorthand(props.icon, { required: hasIcons }),\n checkmark: resolveShorthand(props.checkmark, { required: hasCheckmarks }),\n submenuIndicator: resolveShorthand(props.submenuIndicator, {\n required: hasSubmenu,\n defaultProps: {\n children: dir === 'ltr' ? <ChevronRightIcon /> : <ChevronLeftIcon />,\n },\n }),\n content: resolveShorthand(props.content, {\n required: !!props.children,\n defaultProps: { children: props.children },\n }),\n secondaryContent: resolveShorthand(props.secondaryContent),\n };\n\n const { onClick: onClickOriginal, onKeyDown: onKeyDownOriginal } = state.root;\n state.root.onKeyDown = e => {\n if (shouldPreventDefaultOnKeyDown(e)) {\n if (state.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n dismissedWithKeyboardRef.current = true;\n e.preventDefault();\n (e.target as HTMLElement)?.click();\n }\n\n onKeyDownOriginal?.(e);\n };\n\n state.root.onClick = e => {\n if (state.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n let shouldPersist = persistOnClickContext;\n // prop wins over context;\n if (state.persistOnClick !== undefined && persistOnClickContext !== state.persistOnClick) {\n shouldPersist = state.persistOnClick;\n }\n\n if (!hasSubmenu && !shouldPersist) {\n setOpen(e, { open: false, keyboard: dismissedWithKeyboardRef.current, bubble: true });\n dismissedWithKeyboardRef.current = false;\n }\n\n onClickOriginal?.(e);\n };\n\n const { onMouseEnter: onMouseEnterOriginal } = state.root;\n state.root.onMouseEnter = useEventCallback(e => {\n innerRef.current?.focus();\n\n onMouseEnterOriginal?.(e);\n });\n\n useCharacterSearch(state, innerRef);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,3 +1,4 @@
1
1
  import type { MenuItemState } from './MenuItem.types';
2
+ export declare const menuItemClassName = "fui-MenuItem";
2
3
  /** Applies style classnames to slots */
3
- export declare const useMenuItemStyles: (state: MenuItemState) => void;
4
+ export declare const useMenuItemStyles_unstable: (state: MenuItemState) => void;