@fluentui/react-menu 0.0.0-nightly050f89bf0020211102.1 → 0.0.0-nightly442708a36520211209.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/CHANGELOG.json +238 -26
  2. package/CHANGELOG.md +66 -20
  3. package/dist/react-menu.d.ts +34 -7
  4. package/lib/components/Menu/Menu.js +3 -3
  5. package/lib/components/Menu/Menu.js.map +1 -1
  6. package/lib/components/Menu/renderMenu.js +1 -1
  7. package/lib/components/Menu/renderMenu.js.map +1 -1
  8. package/lib/components/Menu/useMenu.js +103 -117
  9. package/lib/components/Menu/useMenu.js.map +1 -1
  10. package/lib/components/Menu/useMenuContextValues.js +34 -32
  11. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  12. package/lib/components/MenuDivider/MenuDivider.js +2 -2
  13. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  14. package/lib/components/MenuDivider/renderMenuDivider.js +6 -7
  15. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  16. package/lib/components/MenuDivider/useMenuDivider.js +6 -7
  17. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  18. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
  19. package/lib/components/MenuDivider/useMenuDividerStyles.js +6 -5
  20. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  21. package/lib/components/MenuGroup/MenuGroup.js +5 -3
  22. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  23. package/lib/components/MenuGroup/index.d.ts +1 -0
  24. package/lib/components/MenuGroup/index.js +1 -0
  25. package/lib/components/MenuGroup/index.js.map +1 -1
  26. package/lib/components/MenuGroup/renderMenuGroup.js +6 -7
  27. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  28. package/lib/components/MenuGroup/useMenuGroup.js +6 -6
  29. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  30. package/lib/components/MenuGroup/useMenuGroupContextValues.js +7 -7
  31. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  32. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  33. package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
  34. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  35. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +2 -2
  36. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  37. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +6 -7
  38. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  39. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +8 -6
  40. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  41. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
  42. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +5 -4
  43. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  44. package/lib/components/MenuItem/MenuItem.js +2 -4
  45. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  46. package/lib/components/MenuItem/renderMenuItem.js +6 -7
  47. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  48. package/lib/components/MenuItem/useCharacterSearch.js +6 -6
  49. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  50. package/lib/components/MenuItem/useMenuItem.js +31 -36
  51. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  52. package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -0
  53. package/lib/components/MenuItem/useMenuItemStyles.js +16 -8
  54. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  55. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +4 -4
  56. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  57. package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
  58. package/lib/components/MenuItemCheckbox/index.js +1 -0
  59. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  60. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -7
  61. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  62. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +12 -13
  63. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  64. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  65. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +4 -1
  66. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  67. package/lib/components/MenuItemRadio/MenuItemRadio.js +2 -2
  68. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  69. package/lib/components/MenuItemRadio/index.d.ts +1 -0
  70. package/lib/components/MenuItemRadio/index.js +1 -0
  71. package/lib/components/MenuItemRadio/index.js.map +1 -1
  72. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -7
  73. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  74. package/lib/components/MenuItemRadio/useMenuItemRadio.js +12 -12
  75. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  76. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
  77. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +4 -1
  78. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  79. package/lib/components/MenuList/MenuList.js +3 -3
  80. package/lib/components/MenuList/MenuList.js.map +1 -1
  81. package/lib/components/MenuList/MenuList.types.d.ts +8 -6
  82. package/lib/components/MenuList/renderMenuList.js +6 -7
  83. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  84. package/lib/components/MenuList/useMenuList.js +66 -86
  85. package/lib/components/MenuList/useMenuList.js.map +1 -1
  86. package/lib/components/MenuList/useMenuListContextValues.js +18 -16
  87. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  88. package/lib/components/MenuList/useMenuListStyles.d.ts +1 -0
  89. package/lib/components/MenuList/useMenuListStyles.js +9 -7
  90. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  91. package/lib/components/MenuPopover/MenuPopover.js +2 -2
  92. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  93. package/lib/components/MenuPopover/renderMenuPopover.js +7 -7
  94. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  95. package/lib/components/MenuPopover/useMenuPopover.js +29 -38
  96. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  97. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
  98. package/lib/components/MenuPopover/useMenuPopoverStyles.js +12 -8
  99. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  100. package/lib/components/MenuTrigger/MenuTrigger.js +2 -2
  101. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  102. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  103. package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
  104. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  105. package/lib/components/MenuTrigger/useMenuTrigger.js +3 -4
  106. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  107. package/lib/components/MenuTrigger/useTriggerElement.js +57 -70
  108. package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
  109. package/lib/contexts/menuContext.js +5 -11
  110. package/lib/contexts/menuContext.js.map +1 -1
  111. package/lib/contexts/menuGroupContext.js +3 -5
  112. package/lib/contexts/menuGroupContext.js.map +1 -1
  113. package/lib/contexts/menuListContext.js +7 -17
  114. package/lib/contexts/menuListContext.js.map +1 -1
  115. package/lib/contexts/menuTriggerContext.js +3 -5
  116. package/lib/contexts/menuTriggerContext.js.map +1 -1
  117. package/lib/selectable/useCheckmarkStyles.js +3 -3
  118. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  119. package/lib/utils/useIsSubmenu.js +2 -4
  120. package/lib/utils/useIsSubmenu.js.map +1 -1
  121. package/lib/utils/useOnMenuEnter.js +16 -14
  122. package/lib/utils/useOnMenuEnter.js.map +1 -1
  123. package/lib-commonjs/Menu.js +1 -1
  124. package/lib-commonjs/MenuDivider.js +1 -1
  125. package/lib-commonjs/MenuGroup.js +1 -1
  126. package/lib-commonjs/MenuGroupHeader.js +1 -1
  127. package/lib-commonjs/MenuItem.js +1 -1
  128. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  129. package/lib-commonjs/MenuItemRadio.js +1 -1
  130. package/lib-commonjs/MenuList.js +1 -1
  131. package/lib-commonjs/MenuPopover.js +1 -1
  132. package/lib-commonjs/MenuTrigger.js +1 -1
  133. package/lib-commonjs/components/Menu/Menu.js +6 -6
  134. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  135. package/lib-commonjs/components/Menu/index.js +1 -1
  136. package/lib-commonjs/components/Menu/renderMenu.js +3 -3
  137. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  138. package/lib-commonjs/components/Menu/useMenu.js +112 -127
  139. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  140. package/lib-commonjs/components/Menu/useMenuContextValues.js +34 -32
  141. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  142. package/lib-commonjs/components/MenuDivider/MenuDivider.js +6 -6
  143. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  144. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  145. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +8 -10
  146. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  147. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +7 -9
  148. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  149. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
  150. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
  151. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  152. package/lib-commonjs/components/MenuGroup/MenuGroup.js +10 -7
  153. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  154. package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
  155. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  156. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  157. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +9 -11
  158. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  159. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +7 -8
  160. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  161. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +8 -8
  162. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  163. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  164. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
  165. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  166. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +6 -6
  167. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  168. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  169. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +8 -10
  170. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  171. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +10 -9
  172. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  173. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
  174. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
  175. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  176. package/lib-commonjs/components/MenuItem/MenuItem.js +6 -9
  177. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  178. package/lib-commonjs/components/MenuItem/index.js +1 -1
  179. package/lib-commonjs/components/MenuItem/renderMenuItem.js +9 -11
  180. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  181. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  182. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  183. package/lib-commonjs/components/MenuItem/useMenuItem.js +38 -44
  184. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  185. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -0
  186. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +20 -10
  187. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  188. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
  189. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  190. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +1 -0
  191. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  192. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  193. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +9 -11
  194. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  195. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +17 -19
  196. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  197. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  198. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +10 -5
  199. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  200. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +6 -6
  201. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  202. package/lib-commonjs/components/MenuItemRadio/index.d.ts +1 -0
  203. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  204. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  205. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +9 -11
  206. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  207. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +17 -18
  208. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  209. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
  210. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +9 -4
  211. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  212. package/lib-commonjs/components/MenuList/MenuList.js +8 -8
  213. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  214. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +8 -6
  215. package/lib-commonjs/components/MenuList/index.js +1 -1
  216. package/lib-commonjs/components/MenuList/renderMenuList.js +9 -11
  217. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  218. package/lib-commonjs/components/MenuList/useMenuList.js +72 -93
  219. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  220. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +18 -16
  221. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  222. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -0
  223. package/lib-commonjs/components/MenuList/useMenuListStyles.js +11 -8
  224. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  225. package/lib-commonjs/components/MenuPopover/MenuPopover.js +6 -6
  226. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  227. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  228. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +10 -11
  229. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  230. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +36 -46
  231. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  232. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
  233. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +14 -9
  234. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  235. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +4 -4
  236. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  237. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  238. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  239. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +3 -3
  240. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  241. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -6
  242. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  243. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +64 -78
  244. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
  245. package/lib-commonjs/components/index.js +1 -1
  246. package/lib-commonjs/contexts/menuContext.js +4 -10
  247. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  248. package/lib-commonjs/contexts/menuGroupContext.js +3 -5
  249. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  250. package/lib-commonjs/contexts/menuListContext.js +6 -16
  251. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  252. package/lib-commonjs/contexts/menuTriggerContext.js +3 -5
  253. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  254. package/lib-commonjs/index.js +1 -1
  255. package/lib-commonjs/selectable/index.js +1 -1
  256. package/lib-commonjs/selectable/useCheckmarkStyles.js +4 -4
  257. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  258. package/lib-commonjs/utils/index.js +1 -1
  259. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  260. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  261. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  262. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  263. package/package.json +16 -16
  264. package/lib/common/isConformant.d.ts +0 -4
  265. package/lib/common/isConformant.js +0 -12
  266. package/lib/common/isConformant.js.map +0 -1
  267. package/lib/common/mockUseMenuContext.d.ts +0 -7
  268. package/lib/common/mockUseMenuContext.js +0 -36
  269. package/lib/common/mockUseMenuContext.js.map +0 -1
  270. package/lib-commonjs/common/isConformant.d.ts +0 -4
  271. package/lib-commonjs/common/isConformant.js +0 -23
  272. package/lib-commonjs/common/isConformant.js.map +0 -1
  273. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  274. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  275. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
@@ -1,14 +1,13 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  import { menuItemSlots } from '../MenuItem/index';
5
4
  /** Function that renders the final JSX of the component */
6
5
 
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)));
6
+ export const renderMenuItemCheckbox = state => {
7
+ const {
8
+ slots,
9
+ slotProps
10
+ } = getSlots(state, menuItemSlots);
11
+ return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.checkmark, Object.assign({}, slotProps.checkmark)), /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)), /*#__PURE__*/React.createElement(slots.content, Object.assign({}, slotProps.content)), /*#__PURE__*/React.createElement(slots.secondaryContent, Object.assign({}, slotProps.secondaryContent)));
13
12
  };
14
13
  //# 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,KAAD,EAA6B;AAC3D,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,EAAA,EAAK,SAAS,CAAC,OAAf,CAAd,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,gBAAf,CAAvB,CAJF,CADF;AAQD,CAXM","sourceRoot":""}
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,MAAM,sBAAsB,GAAI,KAAD,IAAiC;AACrE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,EAAuB,aAAvB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,SAAf,CAAhB,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAFF,eAGE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,OAAf,CAAd,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,gBAAf,CAAvB,CAJF,CADF;AAQD,CAXM","sourceRoot":""}
@@ -1,4 +1,3 @@
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';
@@ -6,32 +5,32 @@ import { useMenuListContext } from '../../contexts/menuListContext';
6
5
  import { useMenuItem } 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 = (props, ref) => {
9
+ const state = useMenuItem({
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(context => context.toggleCheckbox);
21
+ const {
22
+ onClick: onClickOriginal
23
+ } = state.root;
24
+ const checked = useMenuListContext(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,K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;AAC3C,UAAM,YAAY,GAAG,CAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAR,MAAqB,IAArB,IAAqB,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,GAHiC,CAAlC;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","sourceRoot":""}
@@ -1,2 +1,3 @@
1
1
  import type { MenuItemCheckboxState } from './MenuItemCheckbox.types';
2
- export declare const useMenuItemCheckBoxStyles: (state: MenuItemCheckboxState) => void;
2
+ export declare const menuItemCheckboxClassName = "fui-MenuItemCheckbox";
3
+ export declare const useMenuItemCheckboxStyles: (state: MenuItemCheckboxState) => void;
@@ -1,6 +1,9 @@
1
+ import { mergeClasses } from '@fluentui/react-make-styles';
1
2
  import { useCheckmarkStyles } from '../../selectable/index';
2
3
  import { useMenuItemStyles } from '../MenuItem/useMenuItemStyles';
3
- export var useMenuItemCheckBoxStyles = function (state) {
4
+ export const menuItemCheckboxClassName = 'fui-MenuItemCheckbox';
5
+ export const useMenuItemCheckboxStyles = state => {
6
+ state.root.className = mergeClasses(menuItemCheckboxClassName, state.root.className);
4
7
  useMenuItemStyles(state);
5
8
  useCheckmarkStyles(state);
6
9
  };
@@ -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":["../../../src/components/MenuItemCheckbox/useMenuItemCheckboxStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,6BAA7B;AACA,SAAS,kBAAT,QAAmC,wBAAnC;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,MAAM,yBAAyB,GAAG,sBAAlC;AAEP,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAiC;AACxE,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,yBAAD,EAA4B,KAAK,CAAC,IAAN,CAAW,SAAvC,CAAnC;AAEA,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AACA,EAAA,kBAAkB,CAAC,KAAD,CAAlB;AACD,CALM","sourceRoot":""}
@@ -6,8 +6,8 @@ import { useMenuItemRadioStyles } from './useMenuItemRadioStyles';
6
6
  * Define a styled MenuItemRadio, using the `useMenuItemRadio` hook.
7
7
  */
8
8
 
9
- export var MenuItemRadio = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var state = useMenuItemRadio(props, ref);
9
+ export const MenuItemRadio = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuItemRadio(props, ref);
11
11
  useMenuItemRadioStyles(state);
12
12
  return renderMenuItemRadio(state);
13
13
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/MenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,SAAS,sBAAT,QAAuC,0BAAvC;AAIA;;AAEG;;AACH,OAAO,IAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChG,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;AACA,EAAA,sBAAsB,CAAC,KAAD,CAAtB;AAEA,SAAO,mBAAmB,CAAC,KAAD,CAA1B;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuItemRadio/MenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,SAAS,sBAAT,QAAuC,0BAAvC;AAIA;;AAEG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpG,QAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;AACA,EAAA,sBAAsB,CAAC,KAAD,CAAtB;AAEA,SAAO,mBAAmB,CAAC,KAAD,CAA1B;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourceRoot":""}
@@ -2,3 +2,4 @@ export * from './MenuItemRadio.types';
2
2
  export * from './MenuItemRadio';
3
3
  export * from './renderMenuItemRadio';
4
4
  export * from './useMenuItemRadio';
5
+ export * from './useMenuItemRadioStyles';
@@ -2,4 +2,5 @@ export * from './MenuItemRadio.types';
2
2
  export * from './MenuItemRadio';
3
3
  export * from './renderMenuItemRadio';
4
4
  export * from './useMenuItemRadio';
5
+ export * from './useMenuItemRadioStyles';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuItemRadio/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuItemRadio/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
@@ -1,4 +1,3 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  import { menuItemSlots } from '../MenuItem/index';
@@ -7,11 +6,11 @@ import { menuItemSlots } from '../MenuItem/index';
7
6
  * slots to children.
8
7
  */
9
8
 
10
- export var renderMenuItemRadio = function (state) {
11
- var _a = getSlots(state, menuItemSlots),
12
- slots = _a.slots,
13
- slotProps = _a.slotProps;
14
-
15
- 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)));
9
+ export const renderMenuItemRadio = state => {
10
+ const {
11
+ slots,
12
+ slotProps
13
+ } = getSlots(state, menuItemSlots);
14
+ return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.checkmark, Object.assign({}, slotProps.checkmark)), /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)), /*#__PURE__*/React.createElement(slots.content, Object.assign({}, slotProps.content)), /*#__PURE__*/React.createElement(slots.secondaryContent, Object.assign({}, slotProps.secondaryContent)));
16
15
  };
17
16
  //# sourceMappingURL=renderMenuItemRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,aAAT,QAA8B,mBAA9B;AAIA;;;AAGG;;AACH,OAAO,IAAM,mBAAmB,GAAG,UAAC,KAAD,EAA0B;AACrD,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,EAAA,EAAK,SAAS,CAAC,OAAf,CAAd,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,gBAAf,CAAvB,CAJF,CADF;AAQD,CAXM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,aAAT,QAA8B,mBAA9B;AAIA;;;AAGG;;AACH,OAAO,MAAM,mBAAmB,GAAI,KAAD,IAA8B;AAC/D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,EAAuB,aAAvB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,SAAf,CAAhB,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAFF,eAGE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,OAAf,CAAd,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,gBAAf,CAAvB,CAJF,CADF;AAQD,CAXM","sourceRoot":""}
@@ -1,4 +1,3 @@
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';
@@ -8,32 +7,33 @@ import { useMenuItem } from '../MenuItem/useMenuItem';
8
7
  * Given user props, returns state and render function for a MenuItemRadio.
9
8
  */
10
9
 
11
- export var useMenuItemRadio = function (props, ref) {
12
- var radioProps = {
10
+ export const useMenuItemRadio = (props, ref) => {
11
+ const radioProps = {
13
12
  role: 'menuitemradio'
14
13
  };
15
- var state = useMenuItem(__assign(__assign(__assign({}, radioProps), props), {
14
+ const state = useMenuItem({ ...radioProps,
15
+ ...props,
16
16
  checkmark: resolveShorthand(props.checkmark, {
17
17
  defaultProps: {
18
18
  children: /*#__PURE__*/React.createElement(Checkmark16Filled, null)
19
19
  },
20
20
  required: true
21
21
  })
22
- }), ref);
23
- var selectRadio = useMenuListContext(function (context) {
24
- return context.selectRadio;
25
- });
26
- var onClickOriginal = state.root.onClick;
27
- var checked = useMenuListContext(function (context) {
22
+ }, ref);
23
+ const selectRadio = useMenuListContext(context => context.selectRadio);
24
+ const {
25
+ onClick: onClickOriginal
26
+ } = state.root;
27
+ const checked = useMenuListContext(context => {
28
28
  var _a;
29
29
 
30
- var checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
30
+ const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
31
31
  return checkedItems.indexOf(state.value) !== -1;
32
32
  });
33
33
  state.checked = checked;
34
34
  state.root['aria-checked'] = state.checked; // MenuItem state already transforms keyDown to click events
35
35
 
36
- state.root.onClick = function (e) {
36
+ state.root.onClick = e => {
37
37
  if (state.disabled) {
38
38
  e.preventDefault();
39
39
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadio.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;;AAEG;;AACH,OAAO,IAAM,gB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AAC,IAA3C;AACA,QAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,IAAG;;;AAC3C,UAAM,YAAY,GAAG,CAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAR,MAAqB,IAArB,IAAqB,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,GAHiC,CAAlC;AAKA,EAAA,KAAK,CAAC,OAAN,GAAgB,OAAhB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,cAAX,IAA6B,KAAK,CAAC,OAAnC,CAzB6G,CA2B7G;;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAqB,CAAC,IAAG;AACvB,QAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,MAAA,CAAC,CAAC,cAAF;AACA,MAAA,CAAC,CAAC,eAAF;AACA;AACD;;AAED,IAAA,WAAW,KAAA,IAAX,IAAA,WAAW,KAAA,KAAA,CAAX,GAAW,KAAA,CAAX,GAAA,WAAW,CAAG,CAAH,EAAM,KAAK,CAAC,IAAZ,EAAkB,KAAK,CAAC,KAAxB,EAA+B,KAAK,CAAC,OAArC,CAAX;AACA,IAAA,eAAe,KAAA,IAAf,IAAA,eAAe,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAA,eAAe,CAAG,CAAH,CAAf;AACD,GATD;;AAWA,SAAO,KAAP;AACD,CAxCM","sourceRoot":""}
@@ -1,2 +1,3 @@
1
1
  import type { MenuItemRadioState } from './MenuItemRadio.types';
2
+ export declare const menuItemRadioClassName = "fui-MenuItemRadio";
2
3
  export declare const useMenuItemRadioStyles: (state: MenuItemRadioState) => void;
@@ -1,6 +1,9 @@
1
+ import { mergeClasses } from '@fluentui/react-make-styles';
1
2
  import { useCheckmarkStyles } from '../../selectable/index';
2
3
  import { useMenuItemStyles } from '../MenuItem/useMenuItemStyles';
3
- export var useMenuItemRadioStyles = function (state) {
4
+ export const menuItemRadioClassName = 'fui-MenuItemRadio';
5
+ export const useMenuItemRadioStyles = state => {
6
+ state.root.className = mergeClasses(menuItemRadioClassName, state.root.className);
4
7
  useMenuItemStyles(state);
5
8
  useCheckmarkStyles(state);
6
9
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":"AAAA,SAAS,kBAAT,QAAmC,wBAAnC;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,IAAM,sBAAsB,GAAG,UAAC,KAAD,EAA0B;AAC9D,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AACA,EAAA,kBAAkB,CAAC,KAAD,CAAlB;AACD,CAHM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,6BAA7B;AACA,SAAS,kBAAT,QAAmC,wBAAnC;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,MAAM,sBAAsB,GAAG,mBAA/B;AAEP,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAA8B;AAClE,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,sBAAD,EAAyB,KAAK,CAAC,IAAN,CAAW,SAApC,CAAnC;AAEA,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AACA,EAAA,kBAAkB,CAAC,KAAD,CAAlB;AACD,CALM","sourceRoot":""}
@@ -7,9 +7,9 @@ import { useMenuListStyles } from './useMenuListStyles';
7
7
  * Define a styled MenuList, using the `useMenuList` hook.
8
8
  */
9
9
 
10
- export var MenuList = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
- var state = useMenuList(props, ref);
12
- var contextValues = useMenuListContextValues(state);
10
+ export const MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const state = useMenuList(props, ref);
12
+ const contextValues = useMenuListContextValues(state);
13
13
  useMenuListStyles(state);
14
14
  return renderMenuList(state, contextValues);
15
15
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,WAAT,QAA4B,eAA5B;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,wBAAT,QAAyC,4BAAzC;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AAIA;;AAEG;;AACH,OAAO,IAAM,QAAQ,gBAAuC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AACtF,MAAM,KAAK,GAAG,WAAW,CAAC,KAAD,EAAQ,GAAR,CAAzB;AACA,MAAM,aAAa,GAAG,wBAAwB,CAAC,KAAD,CAA9C;AACA,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AAEA,SAAO,cAAc,CAAC,KAAD,EAAQ,aAAR,CAArB;AACD,CAN2D,CAArD;AAQP,QAAQ,CAAC,WAAT,GAAuB,UAAvB","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,WAAT,QAA4B,eAA5B;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,wBAAT,QAAyC,4BAAzC;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AAIA;;AAEG;;AACH,OAAO,MAAM,QAAQ,gBAAuC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,WAAW,CAAC,KAAD,EAAQ,GAAR,CAAzB;AACA,QAAM,aAAa,GAAG,wBAAwB,CAAC,KAAD,CAA9C;AACA,EAAA,iBAAiB,CAAC,KAAD,CAAjB;AAEA,SAAO,cAAc,CAAC,KAAD,EAAQ,aAAR,CAArB;AACD,CAN2D,CAArD;AAQP,QAAQ,CAAC,WAAT,GAAuB,UAAvB","sourceRoot":""}
@@ -2,6 +2,13 @@ import * as React from 'react';
2
2
  import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
3
3
  import { MenuListContextValue } from '../../contexts/menuListContext';
4
4
  import { SelectableHandler } from '../../selectable/index';
5
+ export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
6
+ export declare type MenuCheckedValueChangeData = {
7
+ /** The name of the value */
8
+ name: string;
9
+ /** The items for this value that are checked */
10
+ checkedItems: string[];
11
+ };
5
12
  export declare type MenuListCommons = {
6
13
  /**
7
14
  * Callback when checked items change for value with a name
@@ -9,12 +16,7 @@ export declare type MenuListCommons = {
9
16
  * @param event - React's original SyntheticEvent
10
17
  * @param data - A data object with relevant information
11
18
  */
12
- onCheckedValueChange?: (e: React.MouseEvent | React.KeyboardEvent, data: {
13
- /** The name of the value */
14
- name: string;
15
- /** The items for this value that are checked */
16
- checkedItems: string[];
17
- }) => void;
19
+ onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
18
20
  /**
19
21
  * Map of all checked values
20
22
  */
@@ -1,4 +1,3 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  import { MenuListProvider } from '../../contexts/menuListContext';
@@ -6,13 +5,13 @@ import { MenuListProvider } from '../../contexts/menuListContext';
6
5
  * Function that renders the final JSX of the component
7
6
  */
8
7
 
9
- export var renderMenuList = function (state, contextValues) {
10
- var _a = getSlots(state),
11
- slots = _a.slots,
12
- slotProps = _a.slotProps;
13
-
8
+ export const renderMenuList = (state, contextValues) => {
9
+ const {
10
+ slots,
11
+ slotProps
12
+ } = getSlots(state);
14
13
  return /*#__PURE__*/React.createElement(MenuListProvider, {
15
14
  value: contextValues.menuList
16
- }, /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root)));
15
+ }, /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root)));
17
16
  };
18
17
  //# sourceMappingURL=renderMenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,gBAAT,QAAiC,gCAAjC;AAEA;;AAEG;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAuB,aAAvB,EAA2D;AACjF,MAAA,EAAA,GAAuB,QAAQ,CAAgB,KAAhB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,CADF;AAKD,CARM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,gBAAT,QAAiC,gCAAjC;AAEA;;AAEG;;AACH,OAAO,MAAM,cAAc,GAAG,CAAC,KAAD,EAAuB,aAAvB,KAA+D;AAC3F,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,CADF;AAKD,CARM","sourceRoot":""}
@@ -1,4 +1,3 @@
1
- import { __assign, __spreadArrays } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { useMergedRefs, useEventCallback, useControllableState, getNativeElementProps } from '@fluentui/react-utilities';
4
3
  import { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';
@@ -9,13 +8,15 @@ import { MenuContext } from '../../contexts/menuContext';
9
8
  * Returns the props and state required to render the component
10
9
  */
11
10
 
12
- export var useMenuList = function (props, ref) {
13
- var focusAttributes = useArrowNavigationGroup({
11
+ export const useMenuList = (props, ref) => {
12
+ const focusAttributes = useArrowNavigationGroup({
14
13
  circular: true
15
14
  });
16
- var findAllFocusable = useFocusFinders().findAllFocusable;
17
- var menuContext = useMenuContextSelectors();
18
- var hasMenuContext = useHasParentContext(MenuContext);
15
+ const {
16
+ findAllFocusable
17
+ } = useFocusFinders();
18
+ const menuContext = useMenuContextSelectors();
19
+ const hasMenuContext = useHasParentContext(MenuContext);
19
20
 
20
21
  if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {
21
22
  // TODO throw warnings in development safely
@@ -23,44 +24,44 @@ export var useMenuList = function (props, ref) {
23
24
  console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');
24
25
  }
25
26
 
26
- var innerRef = React.useRef(null);
27
-
28
- var initialState = __assign(__assign({
29
- root: getNativeElementProps('div', __assign(__assign({
27
+ const innerRef = React.useRef(null);
28
+ const initialState = {
29
+ root: getNativeElementProps('div', {
30
30
  ref: useMergedRefs(ref, innerRef),
31
31
  role: 'menu',
32
- 'aria-labelledby': menuContext.triggerId
33
- }, focusAttributes), props)),
32
+ 'aria-labelledby': menuContext.triggerId,
33
+ ...focusAttributes,
34
+ ...props
35
+ }),
34
36
  hasIcons: menuContext.hasIcons,
35
- hasCheckmarks: menuContext.hasCheckmarks
36
- }, hasMenuContext && menuContext), props);
37
-
38
- var setFocusByFirstCharacter = React.useCallback(function (e, itemEl) {
37
+ hasCheckmarks: menuContext.hasCheckmarks,
38
+ ...(hasMenuContext && menuContext),
39
+ ...props
40
+ };
41
+ const setFocusByFirstCharacter = React.useCallback((e, itemEl) => {
39
42
  // TODO use some kind of children registration to reduce dependency on DOM roles
40
- var acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
43
+ const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
41
44
 
42
45
  if (!innerRef.current) {
43
46
  return;
44
47
  }
45
48
 
46
- var menuItems = findAllFocusable(innerRef.current, function (el) {
47
- return el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1;
48
- });
49
- var startIndex = menuItems.indexOf(itemEl) + 1;
49
+ const menuItems = findAllFocusable(innerRef.current, el => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1);
50
+ let startIndex = menuItems.indexOf(itemEl) + 1;
50
51
 
51
52
  if (startIndex === menuItems.length) {
52
53
  startIndex = 0;
53
54
  }
54
55
 
55
- var firstChars = menuItems.map(function (menuItem) {
56
+ const firstChars = menuItems.map(menuItem => {
56
57
  var _a;
57
58
 
58
59
  return (_a = menuItem.textContent) === null || _a === void 0 ? void 0 : _a.charAt(0).toLowerCase();
59
60
  });
60
- var char = e.key.toLowerCase();
61
+ const char = e.key.toLowerCase();
61
62
 
62
- var getIndexFirstChars = function (start, firstChar) {
63
- for (var i = start; i < firstChars.length; i++) {
63
+ const getIndexFirstChars = (start, firstChar) => {
64
+ for (let i = start; i < firstChars.length; i++) {
64
65
  if (char === firstChars[i]) {
65
66
  return i;
66
67
  }
@@ -70,7 +71,7 @@ export var useMenuList = function (props, ref) {
70
71
  }; // Check remaining slots in the menu
71
72
 
72
73
 
73
- var index = getIndexFirstChars(startIndex, char); // If not found in remaining slots, check from beginning
74
+ let index = getIndexFirstChars(startIndex, char); // If not found in remaining slots, check from beginning
74
75
 
75
76
  if (index === -1) {
76
77
  index = getIndexFirstChars(0, char);
@@ -81,20 +82,17 @@ export var useMenuList = function (props, ref) {
81
82
  menuItems[index].focus();
82
83
  }
83
84
  }, [findAllFocusable]);
84
-
85
- var _a = useControllableState({
85
+ const [checkedValues, setCheckedValues] = useControllableState({
86
86
  state: initialState.checkedValues,
87
87
  defaultState: initialState.defaultCheckedValues,
88
88
  initialState: {}
89
- }),
90
- checkedValues = _a[0],
91
- setCheckedValues = _a[1];
92
-
93
- var onCheckedValueChange = initialState.onCheckedValueChange;
94
- var toggleCheckbox = useEventCallback(function (e, name, value, checked) {
95
- var checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
96
-
97
- var newCheckedItems = __spreadArrays(checkedItems);
89
+ });
90
+ const {
91
+ onCheckedValueChange
92
+ } = initialState;
93
+ const toggleCheckbox = useEventCallback((e, name, value, checked) => {
94
+ const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
95
+ const newCheckedItems = [...checkedItems];
98
96
 
99
97
  if (checked) {
100
98
  newCheckedItems.splice(newCheckedItems.indexOf(value), 1);
@@ -103,67 +101,49 @@ export var useMenuList = function (props, ref) {
103
101
  }
104
102
 
105
103
  onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
106
- name: name,
104
+ name,
107
105
  checkedItems: newCheckedItems
108
106
  });
109
- setCheckedValues(function (s) {
110
- var _a;
111
-
112
- return __assign(__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
113
- });
107
+ setCheckedValues(s => ({ ...s,
108
+ [name]: newCheckedItems
109
+ }));
114
110
  });
115
- var selectRadio = useEventCallback(function (e, name, value) {
116
- var newCheckedItems = [value];
117
- setCheckedValues(function (s) {
118
- var _a;
119
-
120
- return __assign(__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
121
- });
111
+ const selectRadio = useEventCallback((e, name, value) => {
112
+ const newCheckedItems = [value];
113
+ setCheckedValues(s => ({ ...s,
114
+ [name]: newCheckedItems
115
+ }));
122
116
  onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
123
- name: name,
117
+ name,
124
118
  checkedItems: newCheckedItems
125
119
  });
126
120
  });
127
-
128
- var state = __assign(__assign({}, initialState), {
129
- setFocusByFirstCharacter: setFocusByFirstCharacter,
130
- selectRadio: selectRadio,
131
- toggleCheckbox: toggleCheckbox,
121
+ const state = { ...initialState,
122
+ setFocusByFirstCharacter,
123
+ selectRadio,
124
+ toggleCheckbox,
132
125
  checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}
133
- });
134
-
126
+ };
135
127
  return state;
136
128
  };
137
129
  /**
138
130
  * Adds some sugar to fetching multiple context selector values
139
131
  */
140
132
 
141
- var useMenuContextSelectors = function () {
142
- var checkedValues = useMenuContext(function (context) {
143
- return context.checkedValues;
144
- });
145
- var onCheckedValueChange = useMenuContext(function (context) {
146
- return context.onCheckedValueChange;
147
- });
148
- var defaultCheckedValues = useMenuContext(function (context) {
149
- return context.defaultCheckedValues;
150
- });
151
- var triggerId = useMenuContext(function (context) {
152
- return context.triggerId;
153
- });
154
- var hasIcons = useMenuContext(function (context) {
155
- return context.hasIcons;
156
- });
157
- var hasCheckmarks = useMenuContext(function (context) {
158
- return context.hasCheckmarks;
159
- });
133
+ const useMenuContextSelectors = () => {
134
+ const checkedValues = useMenuContext(context => context.checkedValues);
135
+ const onCheckedValueChange = useMenuContext(context => context.onCheckedValueChange);
136
+ const defaultCheckedValues = useMenuContext(context => context.defaultCheckedValues);
137
+ const triggerId = useMenuContext(context => context.triggerId);
138
+ const hasIcons = useMenuContext(context => context.hasIcons);
139
+ const hasCheckmarks = useMenuContext(context => context.hasCheckmarks);
160
140
  return {
161
- checkedValues: checkedValues,
162
- onCheckedValueChange: onCheckedValueChange,
163
- defaultCheckedValues: defaultCheckedValues,
164
- triggerId: triggerId,
165
- hasIcons: hasIcons,
166
- hasCheckmarks: hasCheckmarks
141
+ checkedValues,
142
+ onCheckedValueChange,
143
+ defaultCheckedValues,
144
+ triggerId,
145
+ hasIcons,
146
+ hasCheckmarks
167
147
  };
168
148
  };
169
149
  /**
@@ -171,10 +151,10 @@ var useMenuContextSelectors = function () {
171
151
  */
172
152
 
173
153
 
174
- var usingPropsAndMenuContext = function (props, contextValue, hasMenuContext) {
175
- var isUsingPropsAndContext = false;
154
+ const usingPropsAndMenuContext = (props, contextValue, hasMenuContext) => {
155
+ let isUsingPropsAndContext = false;
176
156
 
177
- for (var val in contextValue) {
157
+ for (const val in contextValue) {
178
158
  if (props[val]) {
179
159
  isUsingPropsAndContext = true;
180
160
  }