@fluentui/react-menu 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (512) hide show
  1. package/CHANGELOG.json +981 -32
  2. package/CHANGELOG.md +354 -138
  3. package/Spec.md +21 -16
  4. package/dist/{react-menu.d.ts → index.d.ts} +295 -166
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/Menu.js.map +1 -1
  7. package/lib/MenuDivider.js.map +1 -1
  8. package/lib/MenuGroup.js.map +1 -1
  9. package/lib/MenuGroupHeader.js.map +1 -1
  10. package/lib/MenuItem.js.map +1 -1
  11. package/lib/MenuItemCheckbox.js.map +1 -1
  12. package/lib/MenuItemRadio.js.map +1 -1
  13. package/lib/MenuList.js.map +1 -1
  14. package/lib/MenuPopover.js.map +1 -1
  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.js.map +1 -1
  21. package/lib/components/Menu/index.js.map +1 -1
  22. package/lib/components/Menu/renderMenu.js +1 -1
  23. package/lib/components/Menu/renderMenu.js.map +1 -1
  24. package/lib/components/Menu/useMenu.js +120 -129
  25. package/lib/components/Menu/useMenu.js.map +1 -1
  26. package/lib/components/Menu/useMenuContextValues.js +35 -33
  27. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  28. package/lib/components/MenuDivider/MenuDivider.js +8 -8
  29. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  30. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  31. package/lib/components/MenuDivider/index.js.map +1 -1
  32. package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
  33. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  34. package/lib/components/MenuDivider/useMenuDivider.js +9 -7
  35. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  36. package/lib/components/MenuDivider/useMenuDividerStyles.js +14 -5
  37. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  38. package/lib/components/MenuGroup/MenuGroup.js +10 -8
  39. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  40. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  41. package/lib/components/MenuGroup/index.js +1 -0
  42. package/lib/components/MenuGroup/index.js.map +1 -1
  43. package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
  44. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  45. package/lib/components/MenuGroup/useMenuGroup.js +10 -7
  46. package/lib/components/MenuGroup/useMenuGroup.js.map +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.js +14 -0
  50. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  51. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
  52. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  53. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  54. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  55. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
  56. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  57. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
  58. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  59. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +14 -5
  60. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  61. package/lib/components/MenuItem/MenuItem.js +8 -10
  62. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  63. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  64. package/lib/components/MenuItem/index.js.map +1 -1
  65. package/lib/components/MenuItem/renderMenuItem.js +12 -8
  66. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  67. package/lib/components/MenuItem/useCharacterSearch.js +7 -7
  68. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  69. package/lib/components/MenuItem/useMenuItem.js +37 -44
  70. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  71. package/lib/components/MenuItem/useMenuItemStyles.js +61 -17
  72. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  73. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
  74. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  75. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  76. package/lib/components/MenuItemCheckbox/index.js +1 -0
  77. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  78. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
  79. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  80. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
  81. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  82. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +36 -5
  83. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  84. package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
  85. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  86. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  87. package/lib/components/MenuItemRadio/index.js +1 -0
  88. package/lib/components/MenuItemRadio/index.js.map +1 -1
  89. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
  90. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  91. package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
  92. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  93. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +36 -5
  94. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  95. package/lib/components/MenuList/MenuList.js +10 -10
  96. package/lib/components/MenuList/MenuList.js.map +1 -1
  97. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  98. package/lib/components/MenuList/index.js.map +1 -1
  99. package/lib/components/MenuList/renderMenuList.js +7 -7
  100. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  101. package/lib/components/MenuList/useMenuList.js +71 -88
  102. package/lib/components/MenuList/useMenuList.js.map +1 -1
  103. package/lib/components/MenuList/useMenuListContextValues.js +19 -17
  104. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  105. package/lib/components/MenuList/useMenuListStyles.js +16 -7
  106. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  107. package/lib/components/MenuPopover/MenuPopover.js +7 -7
  108. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  109. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  110. package/lib/components/MenuPopover/index.js.map +1 -1
  111. package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
  112. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  113. package/lib/components/MenuPopover/useMenuPopover.js +35 -41
  114. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  115. package/lib/components/MenuPopover/useMenuPopoverStyles.js +20 -8
  116. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  117. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  118. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  119. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  120. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  121. package/lib/components/MenuSplitGroup/index.js +6 -0
  122. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  123. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  124. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  125. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  126. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  127. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +42 -0
  128. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  129. package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
  130. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  131. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  132. package/lib/components/MenuTrigger/index.js.map +1 -1
  133. package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
  134. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  135. package/lib/components/MenuTrigger/useMenuTrigger.js +167 -5
  136. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  137. package/lib/components/index.js.map +1 -1
  138. package/lib/contexts/menuContext.js +5 -11
  139. package/lib/contexts/menuContext.js.map +1 -1
  140. package/lib/contexts/menuGroupContext.js +3 -5
  141. package/lib/contexts/menuGroupContext.js.map +1 -1
  142. package/lib/contexts/menuListContext.js +7 -17
  143. package/lib/contexts/menuListContext.js.map +1 -1
  144. package/lib/contexts/menuTriggerContext.js +4 -6
  145. package/lib/contexts/menuTriggerContext.js.map +1 -1
  146. package/lib/index.js +25 -15
  147. package/lib/index.js.map +1 -1
  148. package/lib/selectable/index.js.map +1 -1
  149. package/lib/selectable/types.js.map +1 -1
  150. package/lib/selectable/useCheckmarkStyles.js +4 -4
  151. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  152. package/lib/utils/index.js.map +1 -1
  153. package/lib/utils/useIsSubmenu.js +3 -5
  154. package/lib/utils/useIsSubmenu.js.map +1 -1
  155. package/lib/utils/useOnMenuEnter.js +16 -14
  156. package/lib/utils/useOnMenuEnter.js.map +1 -1
  157. package/lib-commonjs/Menu.js +1 -1
  158. package/lib-commonjs/Menu.js.map +1 -1
  159. package/lib-commonjs/MenuDivider.js +1 -1
  160. package/lib-commonjs/MenuDivider.js.map +1 -1
  161. package/lib-commonjs/MenuGroup.js +1 -1
  162. package/lib-commonjs/MenuGroup.js.map +1 -1
  163. package/lib-commonjs/MenuGroupHeader.js +1 -1
  164. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  165. package/lib-commonjs/MenuItem.js +1 -1
  166. package/lib-commonjs/MenuItem.js.map +1 -1
  167. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  168. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  169. package/lib-commonjs/MenuItemRadio.js +1 -1
  170. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  171. package/lib-commonjs/MenuList.js +1 -1
  172. package/lib-commonjs/MenuList.js.map +1 -1
  173. package/lib-commonjs/MenuPopover.js +1 -1
  174. package/lib-commonjs/MenuPopover.js.map +1 -1
  175. package/lib-commonjs/MenuSplitGroup.js +10 -0
  176. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  177. package/lib-commonjs/MenuTrigger.js +1 -1
  178. package/lib-commonjs/MenuTrigger.js.map +1 -1
  179. package/lib-commonjs/components/Menu/Menu.js +7 -7
  180. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  181. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  182. package/lib-commonjs/components/Menu/index.js +1 -1
  183. package/lib-commonjs/components/Menu/index.js.map +1 -1
  184. package/lib-commonjs/components/Menu/renderMenu.js +5 -5
  185. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  186. package/lib-commonjs/components/Menu/useMenu.js +131 -142
  187. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  188. package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
  189. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  190. package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
  191. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  192. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  193. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  194. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  195. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
  196. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  197. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
  198. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  199. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +18 -7
  200. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  201. package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
  202. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  203. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  204. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  205. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  206. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
  207. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  208. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
  209. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  210. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
  211. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  212. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +25 -0
  213. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  214. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
  215. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  216. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  217. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  218. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  219. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
  220. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  221. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
  222. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  223. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +18 -7
  224. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  225. package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
  226. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  227. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  228. package/lib-commonjs/components/MenuItem/index.js +1 -1
  229. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  230. package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
  231. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  232. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  233. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  234. package/lib-commonjs/components/MenuItem/useMenuItem.js +45 -53
  235. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  236. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +68 -20
  237. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  238. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
  239. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  240. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  241. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  242. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  243. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
  244. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  245. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
  246. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  247. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +40 -7
  248. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  249. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
  250. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  251. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  252. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  253. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  254. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
  255. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  256. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
  257. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  258. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +40 -7
  259. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  260. package/lib-commonjs/components/MenuList/MenuList.js +11 -11
  261. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  262. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  263. package/lib-commonjs/components/MenuList/index.js +1 -1
  264. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  265. package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
  266. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  267. package/lib-commonjs/components/MenuList/useMenuList.js +78 -96
  268. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  269. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
  270. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  271. package/lib-commonjs/components/MenuList/useMenuListStyles.js +19 -9
  272. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  273. package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
  274. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  275. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  276. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  277. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  278. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
  279. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  280. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
  281. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  282. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +24 -10
  283. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  284. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  285. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  286. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  287. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  288. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  289. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  290. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  291. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  292. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  293. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  294. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +54 -0
  295. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  296. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
  297. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  298. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  299. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  300. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  301. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +6 -6
  302. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  303. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +175 -7
  304. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  305. package/lib-commonjs/components/index.js +1 -1
  306. package/lib-commonjs/components/index.js.map +1 -1
  307. package/lib-commonjs/contexts/menuContext.js +6 -12
  308. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  309. package/lib-commonjs/contexts/menuGroupContext.js +5 -7
  310. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  311. package/lib-commonjs/contexts/menuListContext.js +8 -18
  312. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  313. package/lib-commonjs/contexts/menuTriggerContext.js +6 -8
  314. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  315. package/lib-commonjs/index.js +487 -16
  316. package/lib-commonjs/index.js.map +1 -1
  317. package/lib-commonjs/selectable/index.js +1 -1
  318. package/lib-commonjs/selectable/index.js.map +1 -1
  319. package/lib-commonjs/selectable/types.js.map +1 -1
  320. package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
  321. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  322. package/lib-commonjs/utils/index.js +1 -1
  323. package/lib-commonjs/utils/index.js.map +1 -1
  324. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  325. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  326. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  327. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  328. package/package.json +25 -29
  329. package/lib/Menu.d.ts +0 -1
  330. package/lib/MenuDivider.d.ts +0 -1
  331. package/lib/MenuGroup.d.ts +0 -1
  332. package/lib/MenuGroupHeader.d.ts +0 -1
  333. package/lib/MenuItem.d.ts +0 -1
  334. package/lib/MenuItemCheckbox.d.ts +0 -1
  335. package/lib/MenuItemRadio.d.ts +0 -1
  336. package/lib/MenuList.d.ts +0 -1
  337. package/lib/MenuPopover.d.ts +0 -1
  338. package/lib/MenuTrigger.d.ts +0 -1
  339. package/lib/common/isConformant.d.ts +0 -4
  340. package/lib/common/isConformant.js +0 -12
  341. package/lib/common/isConformant.js.map +0 -1
  342. package/lib/common/mockUseMenuContext.d.ts +0 -7
  343. package/lib/common/mockUseMenuContext.js +0 -36
  344. package/lib/common/mockUseMenuContext.js.map +0 -1
  345. package/lib/components/Menu/Menu.d.ts +0 -6
  346. package/lib/components/Menu/Menu.types.d.ts +0 -112
  347. package/lib/components/Menu/index.d.ts +0 -5
  348. package/lib/components/Menu/renderMenu.d.ts +0 -5
  349. package/lib/components/Menu/useMenu.d.ts +0 -10
  350. package/lib/components/Menu/useMenuContextValues.d.ts +0 -2
  351. package/lib/components/MenuDivider/MenuDivider.d.ts +0 -6
  352. package/lib/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  353. package/lib/components/MenuDivider/index.d.ts +0 -5
  354. package/lib/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  355. package/lib/components/MenuDivider/useMenuDivider.d.ts +0 -6
  356. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
  357. package/lib/components/MenuGroup/MenuGroup.d.ts +0 -6
  358. package/lib/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  359. package/lib/components/MenuGroup/index.d.ts +0 -5
  360. package/lib/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  361. package/lib/components/MenuGroup/useMenuGroup.d.ts +0 -6
  362. package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  363. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  364. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  365. package/lib/components/MenuGroupHeader/index.d.ts +0 -5
  366. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  367. package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  368. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
  369. package/lib/components/MenuItem/MenuItem.d.ts +0 -6
  370. package/lib/components/MenuItem/MenuItem.types.d.ts +0 -43
  371. package/lib/components/MenuItem/index.d.ts +0 -5
  372. package/lib/components/MenuItem/renderMenuItem.d.ts +0 -5
  373. package/lib/components/MenuItem/useCharacterSearch.d.ts +0 -3
  374. package/lib/components/MenuItem/useMenuItem.d.ts +0 -10
  375. package/lib/components/MenuItem/useMenuItemStyles.d.ts +0 -3
  376. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  377. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  378. package/lib/components/MenuItemCheckbox/index.d.ts +0 -4
  379. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  380. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  381. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
  382. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  383. package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  384. package/lib/components/MenuItemRadio/index.d.ts +0 -4
  385. package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  386. package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  387. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
  388. package/lib/components/MenuList/MenuList.d.ts +0 -6
  389. package/lib/components/MenuList/MenuList.types.d.ts +0 -53
  390. package/lib/components/MenuList/index.d.ts +0 -6
  391. package/lib/components/MenuList/renderMenuList.d.ts +0 -5
  392. package/lib/components/MenuList/useMenuList.d.ts +0 -6
  393. package/lib/components/MenuList/useMenuListContextValues.d.ts +0 -2
  394. package/lib/components/MenuList/useMenuListStyles.d.ts +0 -5
  395. package/lib/components/MenuPopover/MenuPopover.d.ts +0 -6
  396. package/lib/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  397. package/lib/components/MenuPopover/index.d.ts +0 -5
  398. package/lib/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  399. package/lib/components/MenuPopover/useMenuPopover.d.ts +0 -12
  400. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
  401. package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -7
  402. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
  403. package/lib/components/MenuTrigger/index.d.ts +0 -4
  404. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  405. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  406. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  407. package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
  408. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  409. package/lib/components/index.d.ts +0 -2
  410. package/lib/contexts/menuContext.d.ts +0 -16
  411. package/lib/contexts/menuGroupContext.d.ts +0 -13
  412. package/lib/contexts/menuListContext.d.ts +0 -15
  413. package/lib/contexts/menuTriggerContext.d.ts +0 -3
  414. package/lib/index.d.ts +0 -15
  415. package/lib/selectable/index.d.ts +0 -2
  416. package/lib/selectable/types.d.ts +0 -34
  417. package/lib/selectable/useCheckmarkStyles.d.ts +0 -8
  418. package/lib/utils/index.d.ts +0 -1
  419. package/lib/utils/useIsSubmenu.d.ts +0 -9
  420. package/lib/utils/useOnMenuEnter.d.ts +0 -23
  421. package/lib-commonjs/Menu.d.ts +0 -1
  422. package/lib-commonjs/MenuDivider.d.ts +0 -1
  423. package/lib-commonjs/MenuGroup.d.ts +0 -1
  424. package/lib-commonjs/MenuGroupHeader.d.ts +0 -1
  425. package/lib-commonjs/MenuItem.d.ts +0 -1
  426. package/lib-commonjs/MenuItemCheckbox.d.ts +0 -1
  427. package/lib-commonjs/MenuItemRadio.d.ts +0 -1
  428. package/lib-commonjs/MenuList.d.ts +0 -1
  429. package/lib-commonjs/MenuPopover.d.ts +0 -1
  430. package/lib-commonjs/MenuTrigger.d.ts +0 -1
  431. package/lib-commonjs/common/isConformant.d.ts +0 -4
  432. package/lib-commonjs/common/isConformant.js +0 -23
  433. package/lib-commonjs/common/isConformant.js.map +0 -1
  434. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  435. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  436. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
  437. package/lib-commonjs/components/Menu/Menu.d.ts +0 -6
  438. package/lib-commonjs/components/Menu/Menu.types.d.ts +0 -112
  439. package/lib-commonjs/components/Menu/index.d.ts +0 -5
  440. package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -5
  441. package/lib-commonjs/components/Menu/useMenu.d.ts +0 -10
  442. package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +0 -2
  443. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +0 -6
  444. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +0 -6
  445. package/lib-commonjs/components/MenuDivider/index.d.ts +0 -5
  446. package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +0 -6
  447. package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +0 -6
  448. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
  449. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +0 -6
  450. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +0 -15
  451. package/lib-commonjs/components/MenuGroup/index.d.ts +0 -5
  452. package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +0 -6
  453. package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +0 -6
  454. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
  455. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
  456. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
  457. package/lib-commonjs/components/MenuGroupHeader/index.d.ts +0 -5
  458. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
  459. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
  460. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
  461. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -6
  462. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +0 -43
  463. package/lib-commonjs/components/MenuItem/index.d.ts +0 -5
  464. package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +0 -5
  465. package/lib-commonjs/components/MenuItem/useCharacterSearch.d.ts +0 -3
  466. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +0 -10
  467. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +0 -3
  468. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
  469. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
  470. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +0 -4
  471. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
  472. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
  473. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
  474. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
  475. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
  476. package/lib-commonjs/components/MenuItemRadio/index.d.ts +0 -4
  477. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
  478. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
  479. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
  480. package/lib-commonjs/components/MenuList/MenuList.d.ts +0 -6
  481. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +0 -53
  482. package/lib-commonjs/components/MenuList/index.d.ts +0 -6
  483. package/lib-commonjs/components/MenuList/renderMenuList.d.ts +0 -5
  484. package/lib-commonjs/components/MenuList/useMenuList.d.ts +0 -6
  485. package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +0 -2
  486. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +0 -5
  487. package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +0 -6
  488. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +0 -18
  489. package/lib-commonjs/components/MenuPopover/index.d.ts +0 -5
  490. package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +0 -5
  491. package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +0 -12
  492. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
  493. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -7
  494. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
  495. package/lib-commonjs/components/MenuTrigger/index.d.ts +0 -4
  496. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
  497. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
  498. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  499. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
  500. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
  501. package/lib-commonjs/components/index.d.ts +0 -2
  502. package/lib-commonjs/contexts/menuContext.d.ts +0 -16
  503. package/lib-commonjs/contexts/menuGroupContext.d.ts +0 -13
  504. package/lib-commonjs/contexts/menuListContext.d.ts +0 -15
  505. package/lib-commonjs/contexts/menuTriggerContext.d.ts +0 -3
  506. package/lib-commonjs/index.d.ts +0 -15
  507. package/lib-commonjs/selectable/index.d.ts +0 -2
  508. package/lib-commonjs/selectable/types.d.ts +0 -34
  509. package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +0 -8
  510. package/lib-commonjs/utils/index.d.ts +0 -1
  511. package/lib-commonjs/utils/useIsSubmenu.d.ts +0 -9
  512. package/lib-commonjs/utils/useOnMenuEnter.d.ts +0 -23
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,aAAT,QAA8B,eAA9B;AAGA;;AAEG;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAqB;AAC3C,MAAA,EAAA,GAAuB,QAAQ,CAAgB,KAAhB,EAAuB,aAAvB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,SAAf,CAAhB,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAFF,eAGE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,QAAA,CAAA,EA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BAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAL7B,CADF;AASD,CAZM","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/"}
@@ -1,11 +1,11 @@
1
- import { useMenuListContext } from '../../contexts/menuListContext';
2
- export var useCharacterSearch = function (state, ref) {
3
- var setFocusByFirstCharacter = useMenuListContext(function (context) {
4
- return context.setFocusByFirstCharacter;
5
- });
6
- var onKeyDownBase = state.root.onKeyDown;
1
+ import { useMenuListContext_unstable } from '../../contexts/menuListContext';
2
+ export const useCharacterSearch = (state, ref) => {
3
+ const setFocusByFirstCharacter = useMenuListContext_unstable(context => context.setFocusByFirstCharacter);
4
+ const {
5
+ onKeyDown: onKeyDownBase
6
+ } = state.root;
7
7
 
8
- state.root.onKeyDown = function (e) {
8
+ state.root.onKeyDown = e => {
9
9
  var _a;
10
10
 
11
11
  if (onKeyDownBase) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/useCharacterSearch.ts"],"names":[],"mappings":"AACA,SAAS,kBAAT,QAAmC,gCAAnC;AAGA,OAAO,IAAM,kBAAkB,GAAG,UAAC,KAAD,EAAuB,GAAvB,EAAwD;AACxF,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,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B;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","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,42 +1,32 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { useEventCallback, shouldPreventDefaultOnKeyDown, resolveShorthand, useMergedRefs, getNativeElementProps } from '@fluentui/react-utilities';
4
3
  import { useFluent } from '@fluentui/react-shared-contexts';
5
4
  import { useCharacterSearch } from './useCharacterSearch';
6
- import { useMenuTriggerContext } from '../../contexts/menuTriggerContext';
7
- import { ChevronRight20Regular as ChevronRightIcon, ChevronLeft20Regular as ChevronLeftIcon } from '@fluentui/react-icons';
8
- import { useMenuListContext } from '../../contexts/menuListContext';
9
- import { useMenuContext } from '../../contexts/menuContext';
10
- /**
11
- * Consts listing which props are shorthand props.
12
- */
13
-
14
- export var menuItemSlots = ['root', 'icon', 'submenuIndicator', 'content', 'secondaryContent', 'checkmark'];
5
+ import { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';
6
+ import { ChevronRightRegular as ChevronRightIcon, ChevronLeftRegular as ChevronLeftIcon } from '@fluentui/react-icons';
7
+ import { useMenuListContext_unstable } from '../../contexts/menuListContext';
8
+ import { useMenuContext_unstable } from '../../contexts/menuContext';
15
9
  /**
16
10
  * Returns the props and state required to render the component
17
11
  */
18
12
 
19
- export var useMenuItem = function (props, ref) {
20
- var hasSubmenu = useMenuTriggerContext();
21
- var hasIcons = useMenuListContext(function (context) {
22
- return context.hasIcons;
23
- });
24
- var hasCheckmarks = useMenuListContext(function (context) {
25
- return context.hasCheckmarks;
26
- });
27
- var setOpen = useMenuContext(function (context) {
28
- return context.setOpen;
29
- });
30
- var persistOnClickContext = useMenuContext(function (context) {
31
- return context.persistOnItemClick;
32
- });
33
- var dismissedWithKeyboardRef = React.useRef(false);
34
- var dir = useFluent().dir;
35
- var innerRef = React.useRef(null);
13
+ export const useMenuItem_unstable = (props, ref) => {
14
+ var _a;
36
15
 
37
- var state = __assign(__assign({
38
- hasSubmenu: hasSubmenu
39
- }, props), {
16
+ const hasIcons = useMenuListContext_unstable(context => context.hasIcons);
17
+ const hasCheckmarks = useMenuListContext_unstable(context => context.hasCheckmarks);
18
+ const setOpen = useMenuContext_unstable(context => context.setOpen);
19
+ const persistOnClickContext = useMenuContext_unstable(context => context.persistOnItemClick);
20
+ const dismissedWithKeyboardRef = React.useRef(false);
21
+ const isSubmenuTrigger = useMenuTriggerContext_unstable();
22
+ const hasSubmenu = (_a = props.hasSubmenu) !== null && _a !== void 0 ? _a : isSubmenuTrigger;
23
+ const {
24
+ dir
25
+ } = useFluent();
26
+ const innerRef = React.useRef(null);
27
+ const state = {
28
+ hasSubmenu,
29
+ ...props,
40
30
  components: {
41
31
  root: 'div',
42
32
  icon: 'span',
@@ -45,12 +35,13 @@ export var useMenuItem = function (props, ref) {
45
35
  content: 'span',
46
36
  secondaryContent: 'span'
47
37
  },
48
- root: getNativeElementProps('div', __assign({
38
+ root: getNativeElementProps('div', {
49
39
  ref: useMergedRefs(ref, innerRef),
50
40
  role: 'menuitem',
51
41
  tabIndex: 0,
52
- 'aria-disabled': props.disabled
53
- }, props)),
42
+ 'aria-disabled': props.disabled,
43
+ ...props
44
+ }),
54
45
  icon: resolveShorthand(props.icon, {
55
46
  required: hasIcons
56
47
  }),
@@ -64,19 +55,19 @@ export var useMenuItem = function (props, ref) {
64
55
  }
65
56
  }),
66
57
  content: resolveShorthand(props.content, {
67
- required: true,
58
+ required: !!props.children,
68
59
  defaultProps: {
69
60
  children: props.children
70
61
  }
71
62
  }),
72
63
  secondaryContent: resolveShorthand(props.secondaryContent)
73
- });
74
-
75
- var _a = state.root,
76
- onClickOriginal = _a.onClick,
77
- onKeyDownOriginal = _a.onKeyDown;
64
+ };
65
+ const {
66
+ onClick: onClickOriginal,
67
+ onKeyDown: onKeyDownOriginal
68
+ } = state.root;
78
69
 
79
- state.root.onKeyDown = function (e) {
70
+ state.root.onKeyDown = e => {
80
71
  var _a;
81
72
 
82
73
  if (shouldPreventDefaultOnKeyDown(e)) {
@@ -94,14 +85,14 @@ export var useMenuItem = function (props, ref) {
94
85
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
95
86
  };
96
87
 
97
- state.root.onClick = function (e) {
88
+ state.root.onClick = e => {
98
89
  if (state.disabled) {
99
90
  e.preventDefault();
100
91
  e.stopPropagation();
101
92
  return;
102
93
  }
103
94
 
104
- var shouldPersist = persistOnClickContext; // prop wins over context;
95
+ let shouldPersist = persistOnClickContext; // prop wins over context;
105
96
 
106
97
  if (state.persistOnClick !== undefined && persistOnClickContext !== state.persistOnClick) {
107
98
  shouldPersist = state.persistOnClick;
@@ -119,8 +110,10 @@ export var useMenuItem = function (props, ref) {
119
110
  onClickOriginal === null || onClickOriginal === void 0 ? void 0 : onClickOriginal(e);
120
111
  };
121
112
 
122
- var onMouseEnterOriginal = state.root.onMouseEnter;
123
- state.root.onMouseEnter = useEventCallback(function (e) {
113
+ const {
114
+ onMouseEnter: onMouseEnterOriginal
115
+ } = state.root;
116
+ state.root.onMouseEnter = useEventCallback(e => {
124
117
  var _a;
125
118
 
126
119
  (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItem/useMenuItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SACE,gBADF,EAEE,6BAFF,EAGE,gBAHF,EAIE,aAJF,EAKE,qBALF,QAMO,2BANP;AAOA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AACA,SAAS,qBAAT,QAAsC,mCAAtC;AACA,SACE,qBAAqB,IAAI,gBAD3B,EAEE,oBAAoB,IAAI,eAF1B,QAGO,uBAHP;AAIA,SAAS,kBAAT,QAAmC,gCAAnC;AACA,SAAS,cAAT,QAA+B,4BAA/B;AAGA;;AAEG;;AACH,OAAO,IAAM,aAAa,GAA+B,CACvD,MADuD,EAEvD,MAFuD,EAGvD,kBAHuD,EAIvD,SAJuD,EAKvD,kBALuD,EAMvD,WANuD,CAAlD;AASP;;AAEG;;AACH,OAAO,IAAM,WAAW,GAAG,UAAC,KAAD,EAAuB,GAAvB,EAAkD;AAC3E,MAAM,UAAU,GAAG,qBAAqB,EAAxC;AACA,MAAM,QAAQ,GAAG,kBAAkB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,QAAA;AAAgB,GAA5B,CAAnC;AACA,MAAM,aAAa,GAAG,kBAAkB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,aAAA;AAAqB,GAAjC,CAAxC;AACA,MAAM,OAAO,GAAG,cAAc,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,OAAA;AAAe,GAA3B,CAA9B;AACA,MAAM,qBAAqB,GAAG,cAAc,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,kBAAA;AAA0B,GAAtC,CAA5C;AACA,MAAM,wBAAwB,GAAG,KAAK,CAAC,MAAN,C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D;;AAqBA,QAAM;AAAE,IAAA,YAAY,EAAE;AAAhB,MAAyC,KAAK,CAAC,IAArD;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,YAAX,GAA0B,gBAAgB,CAAC,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,GAJyC,CAA1C;AAMA,EAAA,kBAAkB,CAAC,KAAD,EAAQ,QAAR,CAAlB;AACA,SAAO,KAAP;AACD,CA7FM","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,7 +1,23 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
1
+ import { mergeClasses, __styles, shorthands } from '@griffel/react';
2
+ import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
2
3
  import { createFocusOutlineStyle } from '@fluentui/react-tabster';
4
+ import { tokens } from '@fluentui/react-theme';
5
+ import { useCheckmarkStyles_unstable } from '../../selectable/index';
6
+ /**
7
+ * @deprecated Use `menuItemClassNames.root` instead.
8
+ */
3
9
 
4
- var useStyles = /*#__PURE__*/__styles({
10
+ export const menuItemClassName = 'fui-MenuItem';
11
+ export const menuItemClassNames = {
12
+ root: 'fui-MenuItem',
13
+ icon: 'fui-MenuItem__icon',
14
+ checkmark: 'fui-MenuItem__checkmark',
15
+ submenuIndicator: 'fui-MenuItem__submenuIndicator',
16
+ content: 'fui-MenuItem__content',
17
+ secondaryContent: 'fui-MenuItem__secondaryContent'
18
+ };
19
+
20
+ const useStyles = /*#__PURE__*/__styles({
5
21
  "focusIndicator": {
6
22
  "B486eqv": "f2hkw1w",
7
23
  "Bnmjwt4": "flfsvnh",
@@ -11,7 +27,6 @@ var useStyles = /*#__PURE__*/__styles({
11
27
  "e8izhr": "f1pxpxw8",
12
28
  "in3gf6": "f1149fnl",
13
29
  "B1i23sz": "fd1orka",
14
- "ln9as": "fgtqheg",
15
30
  "Bfgg0yq": "fq7mjg8",
16
31
  "B7231uf": "fmqgchs",
17
32
  "Bxoolf0": ["f1lv6wi8", "famjx04"],
@@ -21,7 +36,10 @@ var useStyles = /*#__PURE__*/__styles({
21
36
  "ge3ubn": ["f13az7yk", "f14kwzu1"],
22
37
  "F41yt0": "fneogx5",
23
38
  "Bxrdl85": ["f14kwzu1", "f13az7yk"],
24
- "B9sa02e": "f1ha6shg",
39
+ "Bb63s14": ["f1f0b0sl", "flsib9d"],
40
+ "Ikxprv": ["flsib9d", "f1f0b0sl"],
41
+ "Bhxvgo6": ["fbewl49", "fs55jlu"],
42
+ "J01dyq": ["fs55jlu", "fbewl49"],
25
43
  "hzsgvt": "f1f43d5r",
26
44
  "Ba9tnbb": ["f1ib27sc", "f14s7j5v"],
27
45
  "Fpkomr": "f13oqbgc",
@@ -32,7 +50,10 @@ var useStyles = /*#__PURE__*/__styles({
32
50
  "B1a67j7": ["f12y1wz2", "fvabyfg"]
33
51
  },
34
52
  "root": {
35
- "Dimara": "ft85np5",
53
+ "Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
54
+ "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
55
+ "B7oj6ja": ["f1jar5jt", "fyu767a"],
56
+ "Btl43ni": ["fyu767a", "f1jar5jt"],
36
57
  "qhf8xq": "f10pi13n",
37
58
  "sj55zd": "f19n0e5",
38
59
  "De3pzq": "fxugw4r",
@@ -43,9 +64,13 @@ var useStyles = /*#__PURE__*/__styles({
43
64
  "Bt984gj": "f122n59",
44
65
  "Be2twd7": "fkhj508",
45
66
  "Bceei9c": "f1k6fduh",
46
- "rmohyg": "f4xv25i",
67
+ "i8kkvl": "f1q8lukm",
68
+ "Belr9w4": "f1ma2n7n",
47
69
  "Jwef8y": "f1knas48",
48
70
  "Bi91k9c": "fnwyq0v",
71
+ "Bk3fhr4": "ft1hn21",
72
+ "I6i3kg": "f1y6u72f",
73
+ "Bmfj8id": "fuxngvv",
49
74
  "famaaq": "f1xqy1su"
50
75
  },
51
76
  "content": {
@@ -63,11 +88,21 @@ var useStyles = /*#__PURE__*/__styles({
63
88
  },
64
89
  "icon": {
65
90
  "a9b677": "f64fuq3",
66
- "Bqenvij": "fjamq6b"
91
+ "Bqenvij": "fjamq6b",
92
+ "Be2twd7": "fe5j1ua",
93
+ "Bg96gwp": "fez10in",
94
+ "Bt984gj": "f122n59",
95
+ "mc9l5x": "ftuwxu6",
96
+ "Brf1p80": "f4d9j23"
67
97
  },
68
98
  "submenuIndicator": {
69
99
  "a9b677": "f64fuq3",
70
- "Bqenvij": "fjamq6b"
100
+ "Bqenvij": "fjamq6b",
101
+ "Be2twd7": "fe5j1ua",
102
+ "Bg96gwp": "fez10in",
103
+ "Bt984gj": "f122n59",
104
+ "mc9l5x": "ftuwxu6",
105
+ "Brf1p80": "f4d9j23"
71
106
  },
72
107
  "disabled": {
73
108
  "sj55zd": "f1s2aq7o",
@@ -76,28 +111,37 @@ var useStyles = /*#__PURE__*/__styles({
76
111
  }
77
112
  }, {
78
113
  "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
79
- "d": ["[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .f1pxpxw8:focus:after{content:\"\";}", "[data-keyboard-nav] .f1149fnl:focus:after{position:absolute;}", "[data-keyboard-nav] .fd1orka:focus:after{pointer-events:none;}", "[data-keyboard-nav] .fgtqheg:focus:after{box-sizing:outline-box;}", "[data-keyboard-nav] .fq7mjg8:focus:after{z-index:1;}", "[data-keyboard-nav] .fmqgchs:focus:after{border-top-style:solid;}", "[data-keyboard-nav] .f1lv6wi8:focus:after{border-right-style:solid;}", "[data-keyboard-nav] .famjx04:focus:after{border-left-style:solid;}", "[data-keyboard-nav] .f1nbyjd2:focus:after{border-bottom-style:solid;}", "[data-keyboard-nav] .f5n18is:focus:after{border-top-width:2px;}", "[data-keyboard-nav] .f13az7yk:focus:after{border-right-width:2px;}", "[data-keyboard-nav] .f14kwzu1:focus:after{border-left-width:2px;}", "[data-keyboard-nav] .fneogx5:focus:after{border-bottom-width:2px;}", "[data-keyboard-nav] .f1ha6shg:focus:after{border-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f1f43d5r:focus:after{border-top-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1ib27sc:focus:after{border-right-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f14s7j5v:focus:after{border-left-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f13oqbgc:focus:after{border-bottom-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1284xzw:focus:after{top:-2px;}", "[data-keyboard-nav] .f14dru39:focus:after{bottom:-2px;}", "[data-keyboard-nav] .fvabyfg:focus:after{left:-2px;}", "[data-keyboard-nav] .f12y1wz2:focus:after{right:-2px;}", ".ft85np5{border-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".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;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1k6fduh{cursor:pointer;}", ".f4xv25i{gap:4px;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}", ".f3rmtva{background-color:transparent;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"],
80
- "h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"],
114
+ "d": ["[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .f1pxpxw8:focus:after{content:\"\";}", "[data-keyboard-nav] .f1149fnl:focus:after{position:absolute;}", "[data-keyboard-nav] .fd1orka:focus:after{pointer-events:none;}", "[data-keyboard-nav] .fq7mjg8:focus:after{z-index:1;}", "[data-keyboard-nav] .fmqgchs:focus:after{border-top-style:solid;}", "[data-keyboard-nav] .f1lv6wi8:focus:after{border-right-style:solid;}", "[data-keyboard-nav] .famjx04:focus:after{border-left-style:solid;}", "[data-keyboard-nav] .f1nbyjd2:focus:after{border-bottom-style:solid;}", "[data-keyboard-nav] .f5n18is:focus:after{border-top-width:2px;}", "[data-keyboard-nav] .f13az7yk:focus:after{border-right-width:2px;}", "[data-keyboard-nav] .f14kwzu1:focus:after{border-left-width:2px;}", "[data-keyboard-nav] .fneogx5:focus:after{border-bottom-width:2px;}", "[data-keyboard-nav] .f1f0b0sl:focus:after{border-bottom-right-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .flsib9d:focus:after{border-bottom-left-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .fbewl49:focus:after{border-top-right-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .fs55jlu:focus:after{border-top-left-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f1f43d5r:focus:after{border-top-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1ib27sc:focus:after{border-right-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f14s7j5v:focus:after{border-left-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f13oqbgc:focus:after{border-bottom-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1284xzw:focus:after{top:-2px;}", "[data-keyboard-nav] .f14dru39:focus:after{bottom:-2px;}", "[data-keyboard-nav] .fvabyfg:focus:after{left:-2px;}", "[data-keyboard-nav] .f12y1wz2:focus:after{right:-2px;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".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;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1k6fduh{cursor:pointer;}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}", ".f3rmtva{background-color:transparent;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fe5j1ua{font-size:20px;}", ".fez10in{line-height:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"],
115
+ "h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".ft1hn21:hover .fui-Icon-filled{display:inline;}", ".f1y6u72f:hover .fui-Icon-filled{color:var(--colorNeutralForeground2BrandSelected);}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"],
81
116
  "f": [".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}", ".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}"]
82
117
  });
83
118
  /** Applies style classnames to slots */
84
119
 
85
120
 
86
- export var useMenuItemStyles = function (state) {
87
- var styles = useStyles();
88
- state.root.className = mergeClasses(styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);
89
- state.content.className = mergeClasses(styles.content, state.content.className);
121
+ export const useMenuItemStyles_unstable = state => {
122
+ const styles = useStyles();
123
+ state.root.className = mergeClasses(menuItemClassNames.root, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);
124
+
125
+ if (state.content) {
126
+ state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);
127
+ }
128
+
129
+ if (state.checkmark) {
130
+ state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);
131
+ }
90
132
 
91
133
  if (state.secondaryContent) {
92
- state.secondaryContent.className = mergeClasses(!state.disabled && styles.secondaryContent, state.secondaryContent.className);
134
+ state.secondaryContent.className = mergeClasses(menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);
93
135
  }
94
136
 
95
137
  if (state.icon) {
96
- state.icon.className = mergeClasses(styles.icon, state.icon.className);
138
+ state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);
97
139
  }
98
140
 
99
141
  if (state.submenuIndicator) {
100
- state.submenuIndicator.className = mergeClasses(styles.submenuIndicator, state.submenuIndicator.className);
142
+ state.submenuIndicator.className = mergeClasses(menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);
101
143
  }
144
+
145
+ useCheckmarkStyles_unstable(state);
102
146
  };
103
147
  //# sourceMappingURL=useMenuItemStyles.js.map
@@ -1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AK,CAAC,gBAAN,CAAuB,SAHsB,CAA/C;AAKD;;AAED,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,kBAAkB,CAAC,IAApB,EAA0B,MAAM,CAAC,IAAjC,EAAuC,KAAK,CAAC,IAAN,CAAW,SAAlD,CAAnC;AACD;;AAED,MAAI,KAAK,CAAC,gBAAV,EAA4B;AAC1B,IAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAC7C,kBAAkB,CAAC,gBAD0B,EAE7C,MAAM,CAAC,gBAFsC,EAG7C,KAAK,CAAC,gBAAN,CAAuB,SAHsB,CAA/C;AAKD;;AACD,EAAA,2BAA2B,CAAC,KAAD,CAA3B;AACD,CAtCM","sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { MenuItemCheckboxState } from '../MenuItemCheckbox/index';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `menuItemClassNames.root` instead.\n */\nexport const menuItemClassName = 'fui-MenuItem';\nexport const menuItemClassNames: SlotClassNames<MenuItemSlots> = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createFocusOutlineStyle(),\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n position: 'relative',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n paddingRight: '10px',\n paddingLeft: '10px',\n height: '32px',\n display: 'flex',\n alignItems: 'center',\n fontSize: tokens.fontSizeBase300,\n cursor: 'pointer',\n ...shorthands.gap('4px'),\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n\n userSelect: 'none',\n },\n content: {\n paddingLeft: '2px',\n paddingRight: '2px',\n backgroundColor: 'transparent',\n flexGrow: 1,\n },\n secondaryContent: {\n paddingLeft: '2px',\n paddingRight: '2px',\n color: tokens.colorNeutralForeground3,\n ':hover': {\n color: tokens.colorNeutralForeground3Hover,\n },\n ':focus': {\n color: tokens.colorNeutralForeground3Hover,\n },\n },\n icon: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n submenuIndicator: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n ':hover': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':focus': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/** Applies style classnames to slots */\nexport const useMenuItemStyles_unstable = (state: MenuItemState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n menuItemClassNames.root,\n styles.root,\n styles.focusIndicator,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemClassNames.secondaryContent,\n !state.disabled && styles.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(\n menuItemClassNames.submenuIndicator,\n styles.submenuIndicator,\n state.submenuIndicator.className,\n );\n }\n useCheckmarkStyles_unstable(state as MenuItemCheckboxState);\n};\n"],"sourceRoot":"../src/"}
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { useMenuItemCheckbox } from './useMenuItemCheckbox';
3
- import { renderMenuItemCheckbox } from './renderMenuItemCheckbox';
4
- import { useMenuItemCheckBoxStyles } from './useMenuItemCheckboxStyles';
2
+ import { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';
3
+ import { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';
4
+ import { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';
5
5
  /**
6
- * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox` hook.
6
+ * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.
7
7
  */
8
8
 
9
- export var MenuItemCheckbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var state = useMenuItemCheckbox(props, ref);
11
- useMenuItemCheckBoxStyles(state);
12
- return renderMenuItemCheckbox(state);
9
+ export const MenuItemCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuItemCheckbox_unstable(props, ref);
11
+ useMenuItemCheckboxStyles_unstable(state);
12
+ return renderMenuItemCheckbox_unstable(state);
13
13
  });
14
14
  MenuItemCheckbox.displayName = 'MenuItemCheckbox';
15
15
  //# sourceMappingURL=MenuItemCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemCheckbox/MenuItemCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,SAAS,sBAAT,QAAuC,0BAAvC;AACA,SAAS,yBAAT,QAA0C,6BAA1C;AAIA;;AAEG;;AACH,OAAO,IAAM,gBAAgB,gBAA+C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AACtG,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;AACA,EAAA,yBAAyB,CAAC,KAAD,CAAzB;AAEA,SAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CAL2E,CAArE;AAOP,gBAAgB,CAAC,WAAjB,GAA+B,kBAA/B","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItemCheckbox/MenuItemCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AACA,SAAS,kCAAT,QAAmD,6BAAnD;AAIA;;AAEG;;AACH,OAAO,MAAM,gBAAgB,gBAA+C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1G,QAAM,KAAK,GAAG,4BAA4B,CAAC,KAAD,EAAQ,GAAR,CAA1C;AACA,EAAA,kCAAkC,CAAC,KAAD,CAAlC;AAEA,SAAO,+BAA+B,CAAC,KAAD,CAAtC;AACD,CAL2E,CAArE;AAOP,gBAAgB,CAAC,WAAjB,GAA+B,kBAA/B","sourcesContent":["import * as React from 'react';\nimport { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';\nimport { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';\nimport { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';\nimport type { MenuItemCheckboxProps } from './MenuItemCheckbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.\n */\nexport const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemCheckbox_unstable(props, ref);\n useMenuItemCheckboxStyles_unstable(state);\n\n return renderMenuItemCheckbox_unstable(state);\n});\n\nMenuItemCheckbox.displayName = 'MenuItemCheckbox';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemCheckbox.types.js","sourceRoot":"","sources":["../../../src/components/MenuItemCheckbox/MenuItemCheckbox.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"MenuItemCheckbox.types.js","sourceRoot":"../src/","sources":["components/MenuItemCheckbox/MenuItemCheckbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MenuItemSelectableProps, MenuItemSelectableState } from '../../selectable/index';\nimport type { MenuItemProps, MenuItemState } from '../MenuItem/MenuItem.types';\n\nexport type MenuItemCheckboxProps = MenuItemProps & MenuItemSelectableProps;\n\nexport type MenuItemCheckboxState = MenuItemState & MenuItemSelectableState;\n"]}
@@ -2,4 +2,5 @@ export * from './MenuItemCheckbox.types';
2
2
  export * from './MenuItemCheckbox';
3
3
  export * from './renderMenuItemCheckbox';
4
4
  export * from './useMenuItemCheckbox';
5
+ export * from './useMenuItemCheckboxStyles';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuItemCheckbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuItemCheckbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './MenuItemCheckbox.types';\nexport * from './MenuItemCheckbox';\nexport * from './renderMenuItemCheckbox';\nexport * from './useMenuItemCheckbox';\nexport * from './useMenuItemCheckboxStyles';\n"]}
@@ -1,14 +1,17 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
- import { menuItemSlots } from '../MenuItem/index';
5
3
  /** Function that renders the final JSX of the component */
6
4
 
7
- export var renderMenuItemCheckbox = function (state) {
8
- var _a = getSlots(state, menuItemSlots),
9
- slots = _a.slots,
10
- slotProps = _a.slotProps;
11
-
12
- return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.checkmark, __assign({}, slotProps.checkmark)), /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), /*#__PURE__*/React.createElement(slots.content, __assign({}, slotProps.content)), /*#__PURE__*/React.createElement(slots.secondaryContent, __assign({}, slotProps.secondaryContent)));
5
+ export const renderMenuItemCheckbox_unstable = state => {
6
+ const {
7
+ slots,
8
+ slotProps
9
+ } = getSlots(state);
10
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
11
+ }, slots.checkmark && /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
12
+ }), slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
13
+ }), slots.content && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
14
+ }), slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
15
+ }));
13
16
  };
14
17
  //# sourceMappingURL=renderMenuItemCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,aAAT,QAA8B,mBAA9B;AAIA;;AACA,OAAO,IAAM,sBAAsB,GAAG,UAAC,KAA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CADtB,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,iBAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,CADF;AAQD,CAXM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemCheckboxState } from './MenuItemCheckbox.types';\nimport type { MenuItemSlots } from '../MenuItem/MenuItem.types';\n\n/** Function that renders the final JSX of the component */\nexport const renderMenuItemCheckbox_unstable = (state: MenuItemCheckboxState) => {\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.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,37 +1,36 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { resolveShorthand } from '@fluentui/react-utilities';
4
3
  import { Checkmark16Filled } from '@fluentui/react-icons';
5
- import { useMenuListContext } from '../../contexts/menuListContext';
6
- import { useMenuItem } from '../MenuItem/useMenuItem';
4
+ import { useMenuListContext_unstable } from '../../contexts/menuListContext';
5
+ import { useMenuItem_unstable } from '../MenuItem/useMenuItem';
7
6
  /** Returns the props and state required to render the component */
8
7
 
9
- export var useMenuItemCheckbox = function (props, ref) {
10
- var state = useMenuItem(__assign(__assign({
8
+ export const useMenuItemCheckbox_unstable = (props, ref) => {
9
+ const state = useMenuItem_unstable({
11
10
  role: 'menuitemcheckbox',
12
- persistOnClick: true
13
- }, props), {
11
+ persistOnClick: true,
12
+ ...props,
14
13
  checkmark: resolveShorthand(props.checkmark, {
15
14
  defaultProps: {
16
15
  children: /*#__PURE__*/React.createElement(Checkmark16Filled, null)
17
16
  },
18
17
  required: true
19
18
  })
20
- }), ref);
21
- var toggleCheckbox = useMenuListContext(function (context) {
22
- return context.toggleCheckbox;
23
- });
24
- var onClickOriginal = state.root.onClick;
25
- var checked = useMenuListContext(function (context) {
19
+ }, ref);
20
+ const toggleCheckbox = useMenuListContext_unstable(context => context.toggleCheckbox);
21
+ const {
22
+ onClick: onClickOriginal
23
+ } = state.root;
24
+ const checked = useMenuListContext_unstable(context => {
26
25
  var _a;
27
26
 
28
- var checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
27
+ const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
29
28
  return checkedItems.indexOf(state.value) !== -1;
30
29
  });
31
30
  state.checked = checked;
32
31
  state.root['aria-checked'] = state.checked; // MenuItem state already transforms keyDown to click events
33
32
 
34
- state.root.onClick = function (e) {
33
+ state.root.onClick = e => {
35
34
  if (state.disabled) {
36
35
  e.preventDefault();
37
36
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemCheckbox/useMenuItemCheckbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,iBAAT,QAAkC,uBAAlC;AACA,SAAS,kBAAT,QAAmC,gCAAnC;AACA,SAAS,WAAT,QAA4B,yBAA5B;AAGA;;AACA,OAAO,IAAM,mBAAmB,GAAG,UACjC,KADiC,EAEjC,GAFiC,EAEN;AAE3B,MAAM,KAAK,GAAG,WAAW,CAAA,QAAA,CAAA,QAAA,C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AAqB,EAAA,KAAA,KAAA,CAArB,GAAqB,KAAA,CAArB,GAAqB,EAAA,CAAG,KAAK,CAAC,IAAT,CAArB,KAAuC,EAA5D;AACA,WAAO,YAAY,CAAC,OAAb,CAAqB,KAAK,CAAC,KAA3B,MAAsC,CAAC,CAA9C;AACD,GAH0C,CAA3C;AAKA,EAAA,KAAK,CAAC,OAAN,GAAgB,OAAhB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,cAAX,IAA6B,KAAK,CAAC,OAAnC,CAtByB,CAwBzB;;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAqB,CAAC,IAAG;AACvB,QAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,MAAA,CAAC,CAAC,cAAF;AACA,MAAA,CAAC,CAAC,eAAF;AACA;AACD;;AAED,IAAA,cAAc,KAAA,IAAd,IAAA,cAAc,KAAA,KAAA,CAAd,GAAc,KAAA,CAAd,GAAA,cAAc,CAAG,CAAH,EAAM,KAAK,CAAC,IAAZ,EAAkB,KAAK,CAAC,KAAxB,EAA+B,KAAK,CAAC,OAArC,CAAd;AACA,IAAA,eAAe,KAAA,IAAf,IAAA,eAAe,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAA,eAAe,CAAG,CAAH,CAAf;AACD,GATD;;AAWA,SAAO,KAAP;AACD,CAxCM","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { Checkmark16Filled } from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuItem_unstable } from '../MenuItem/useMenuItem';\nimport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox.types';\n\n/** Returns the props and state required to render the component */\nexport const useMenuItemCheckbox_unstable = (\n props: MenuItemCheckboxProps,\n ref: React.Ref<HTMLElement>,\n): MenuItemCheckboxState => {\n const state = useMenuItem_unstable(\n {\n role: 'menuitemcheckbox',\n persistOnClick: true,\n ...props,\n checkmark: resolveShorthand(props.checkmark, {\n defaultProps: { children: <Checkmark16Filled /> },\n required: true,\n }),\n },\n ref,\n ) as MenuItemCheckboxState;\n\n const toggleCheckbox = useMenuListContext_unstable(context => context.toggleCheckbox);\n const { onClick: onClickOriginal } = state.root;\n const checked = useMenuListContext_unstable(context => {\n const checkedItems = context.checkedValues?.[state.name] || [];\n return checkedItems.indexOf(state.value) !== -1;\n });\n\n state.checked = checked;\n state.root['aria-checked'] = state.checked;\n\n // MenuItem state already transforms keyDown to click events\n state.root.onClick = e => {\n if (state.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n toggleCheckbox?.(e, state.name, state.value, state.checked);\n onClickOriginal?.(e);\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,7 +1,38 @@
1
- import { useCheckmarkStyles } from '../../selectable/index';
2
- import { useMenuItemStyles } from '../MenuItem/useMenuItemStyles';
3
- export var useMenuItemCheckBoxStyles = function (state) {
4
- useMenuItemStyles(state);
5
- useCheckmarkStyles(state);
1
+ import { mergeClasses } from '@griffel/react';
2
+ import { useCheckmarkStyles_unstable } from '../../selectable/index';
3
+ import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';
4
+ /**
5
+ * @deprecated Use `menuItemCheckboxClassNames.root` instead.
6
+ */
7
+
8
+ export const menuItemCheckboxClassName = 'fui-MenuItemCheckbox';
9
+ export const menuItemCheckboxClassNames = {
10
+ root: 'fui-MenuItemCheckbox',
11
+ icon: 'fui-MenuItemCheckbox__icon',
12
+ checkmark: 'fui-MenuItemCheckbox__checkmark',
13
+ content: 'fui-MenuItemCheckbox__content',
14
+ secondaryContent: 'fui-MenuItemCheckbox__secondaryContent'
15
+ };
16
+ export const useMenuItemCheckboxStyles_unstable = state => {
17
+ state.root.className = mergeClasses(menuItemCheckboxClassNames.root, state.root.className);
18
+
19
+ if (state.content) {
20
+ state.content.className = mergeClasses(menuItemCheckboxClassNames.content, state.content.className);
21
+ }
22
+
23
+ if (state.secondaryContent) {
24
+ state.secondaryContent.className = mergeClasses(menuItemCheckboxClassNames.secondaryContent, state.secondaryContent.className);
25
+ }
26
+
27
+ if (state.icon) {
28
+ state.icon.className = mergeClasses(menuItemCheckboxClassNames.icon, state.icon.className);
29
+ }
30
+
31
+ if (state.checkmark) {
32
+ state.checkmark.className = mergeClasses(menuItemCheckboxClassNames.checkmark, state.checkmark.className);
33
+ }
34
+
35
+ useMenuItemStyles_unstable(state);
36
+ useCheckmarkStyles_unstable(state);
6
37
  };
7
38
  //# sourceMappingURL=useMenuItemCheckboxStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemCheckbox/useMenuItemCheckboxStyles.ts"],"names":[],"mappings":"AAAA,SAAS,kBAAT,QAAmC,wBAAnC;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,IAAM,yBAAyB,GAAG,UAAC,KAAD,EAA6B;AACpE,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AACA,EAAA,kBAAkB,CAAC,KAAD,CAAlB;AACD,CAHM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuItemCheckbox/useMenuItemCheckboxStyles.ts"],"names":[],"mappings":"AACA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,2BAAT,QAA4C,wBAA5C;AAEA,SAAS,0BAAT,QAA2C,+BAA3C;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAG,sBAAlC;AACP,OAAO,MAAM,0BAA0B,GAA4D;AACjG,EAAA,IAAI,EAAE,sBAD2F;AAEjG,EAAA,IAAI,EAAE,4BAF2F;AAGjG,EAAA,SAAS,EAAE,iCAHsF;AAIjG,EAAA,OAAO,EAAE,+BAJwF;AAKjG,EAAA,gBAAgB,EAAE;AAL+E,CAA5F;AAQP,OAAO,MAAM,kCAAkC,GAAI,KAAD,IAAiC;AACjF,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,0BAA0B,CAAC,IAA5B,EAAkC,KAAK,CAAC,IAAN,CAAW,SAA7C,CAAnC;;AAEA,MAAI,KAAK,CAAC,OAAV,EAAmB;AACjB,IAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CAAC,0BAA0B,CAAC,OAA5B,EAAqC,KAAK,CAAC,OAAN,CAAc,SAAnD,CAAtC;AACD;;AAED,MAAI,KAAK,CAAC,gBAAV,EAA4B;AAC1B,IAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAC7C,0BAA0B,CAAC,gBADkB,EAE7C,KAAK,CAAC,gBAAN,CAAuB,SAFsB,CAA/C;AAID;;AAED,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,0BAA0B,CAAC,IAA5B,EAAkC,KAAK,CAAC,IAAN,CAAW,SAA7C,CAAnC;AACD;;AAED,MAAI,KAAK,CAAC,SAAV,EAAqB;AACnB,IAAA,KAAK,CAAC,SAAN,CAAgB,SAAhB,GAA4B,YAAY,CAAC,0BAA0B,CAAC,SAA5B,EAAuC,KAAK,CAAC,SAAN,CAAgB,SAAvD,CAAxC;AACD;;AAED,EAAA,0BAA0B,CAAC,KAAD,CAA1B;AACA,EAAA,2BAA2B,CAAC,KAAD,CAA3B;AACD,CAxBM","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { MenuItemSlots } from '../index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';\nimport type { MenuItemCheckboxState } from './MenuItemCheckbox.types';\n\n/**\n * @deprecated Use `menuItemCheckboxClassNames.root` instead.\n */\nexport const menuItemCheckboxClassName = 'fui-MenuItemCheckbox';\nexport const menuItemCheckboxClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>> = {\n root: 'fui-MenuItemCheckbox',\n icon: 'fui-MenuItemCheckbox__icon',\n checkmark: 'fui-MenuItemCheckbox__checkmark',\n content: 'fui-MenuItemCheckbox__content',\n secondaryContent: 'fui-MenuItemCheckbox__secondaryContent',\n};\n\nexport const useMenuItemCheckboxStyles_unstable = (state: MenuItemCheckboxState) => {\n state.root.className = mergeClasses(menuItemCheckboxClassNames.root, state.root.className);\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemCheckboxClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemCheckboxClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemCheckboxClassNames.icon, state.icon.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemCheckboxClassNames.checkmark, state.checkmark.className);\n }\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"],"sourceRoot":"../src/"}