@fluentui/react-menu 9.12.11 → 9.12.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. package/CHANGELOG.json +133 -1
  2. package/CHANGELOG.md +37 -2
  3. package/lib/components/Menu/Menu.js.map +1 -1
  4. package/lib/components/Menu/renderMenu.js.map +1 -1
  5. package/lib/components/Menu/useMenu.js +13 -11
  6. package/lib/components/Menu/useMenu.js.map +1 -1
  7. package/lib/components/Menu/useMenuContextValues.js +1 -1
  8. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  9. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  10. package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
  11. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  12. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  13. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  14. package/lib/components/MenuGroup/renderMenuGroup.js +5 -4
  15. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  16. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  17. package/lib/components/MenuGroup/useMenuGroupContextValues.js +1 -1
  18. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  19. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  20. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
  21. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  22. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +1 -1
  23. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  24. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  25. package/lib/components/MenuItem/renderMenuItem.js +10 -2
  26. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  27. package/lib/components/MenuItem/useCharacterSearch.js +5 -4
  28. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  29. package/lib/components/MenuItem/useMenuItem.js +8 -8
  30. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  31. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  32. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +9 -2
  33. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  34. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +4 -4
  35. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  36. package/lib/components/MenuItemLink/MenuItemLink.js.map +1 -1
  37. package/lib/components/MenuItemLink/renderMenuItemLink.js +9 -2
  38. package/lib/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  39. package/lib/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  40. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  41. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +9 -2
  42. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  43. package/lib/components/MenuItemRadio/useMenuItemRadio.js +4 -4
  44. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  45. package/lib/components/MenuList/MenuList.js.map +1 -1
  46. package/lib/components/MenuList/renderMenuList.js +5 -4
  47. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  48. package/lib/components/MenuList/useMenuList.js +6 -4
  49. package/lib/components/MenuList/useMenuList.js.map +1 -1
  50. package/lib/components/MenuList/useMenuListContextValues.js +1 -1
  51. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  52. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  53. package/lib/components/MenuPopover/renderMenuPopover.js +6 -5
  54. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  55. package/lib/components/MenuPopover/useMenuPopover.js +6 -4
  56. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  57. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  58. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
  59. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  60. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +8 -6
  61. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  62. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  63. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  64. package/lib/components/MenuTrigger/useMenuTrigger.js +15 -13
  65. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  66. package/lib/contexts/menuContext.js.map +1 -1
  67. package/lib/contexts/menuGroupContext.js.map +1 -1
  68. package/lib/contexts/menuListContext.js.map +1 -1
  69. package/lib/contexts/menuTriggerContext.js.map +1 -1
  70. package/lib/utils/useIsSubmenu.js.map +1 -1
  71. package/lib/utils/useOnMenuEnter.js +1 -1
  72. package/lib/utils/useOnMenuEnter.js.map +1 -1
  73. package/lib-commonjs/Menu.js +2 -2
  74. package/lib-commonjs/Menu.js.map +1 -1
  75. package/lib-commonjs/MenuDivider.js +2 -2
  76. package/lib-commonjs/MenuDivider.js.map +1 -1
  77. package/lib-commonjs/MenuGroup.js +2 -2
  78. package/lib-commonjs/MenuGroup.js.map +1 -1
  79. package/lib-commonjs/MenuGroupHeader.js +2 -2
  80. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  81. package/lib-commonjs/MenuItem.js +2 -2
  82. package/lib-commonjs/MenuItem.js.map +1 -1
  83. package/lib-commonjs/MenuItemCheckbox.js +2 -2
  84. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  85. package/lib-commonjs/MenuItemLink.js +2 -2
  86. package/lib-commonjs/MenuItemLink.js.map +1 -1
  87. package/lib-commonjs/MenuItemRadio.js +2 -2
  88. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  89. package/lib-commonjs/MenuList.js +2 -2
  90. package/lib-commonjs/MenuList.js.map +1 -1
  91. package/lib-commonjs/MenuPopover.js +2 -2
  92. package/lib-commonjs/MenuPopover.js.map +1 -1
  93. package/lib-commonjs/MenuSplitGroup.js +2 -2
  94. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  95. package/lib-commonjs/MenuTrigger.js +2 -2
  96. package/lib-commonjs/MenuTrigger.js.map +1 -1
  97. package/lib-commonjs/components/Menu/Menu.js +5 -3
  98. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  99. package/lib-commonjs/components/Menu/Menu.types.js +2 -2
  100. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  101. package/lib-commonjs/components/Menu/index.js +6 -6
  102. package/lib-commonjs/components/Menu/index.js.map +1 -1
  103. package/lib-commonjs/components/Menu/renderMenu.js +5 -3
  104. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  105. package/lib-commonjs/components/Menu/useMenu.js +35 -31
  106. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  107. package/lib-commonjs/components/Menu/useMenuContextValues.js +4 -2
  108. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  109. package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -7
  110. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  111. package/lib-commonjs/components/MenuDivider/index.js +6 -6
  112. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  113. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +8 -6
  114. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  115. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +7 -5
  116. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  117. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js +7 -3
  118. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -1
  119. package/lib-commonjs/components/MenuGroup/MenuGroup.js +9 -7
  120. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  121. package/lib-commonjs/components/MenuGroup/index.js +7 -7
  122. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  123. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +11 -8
  124. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  125. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +8 -6
  126. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  127. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +6 -4
  128. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  129. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js +6 -2
  130. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -1
  131. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -7
  132. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  133. package/lib-commonjs/components/MenuGroupHeader/index.js +6 -6
  134. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  135. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +8 -6
  136. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  137. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +8 -6
  138. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  139. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js +7 -3
  140. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -1
  141. package/lib-commonjs/components/MenuItem/MenuItem.js +9 -7
  142. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  143. package/lib-commonjs/components/MenuItem/index.js +6 -6
  144. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  145. package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -6
  146. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  147. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +10 -7
  148. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  149. package/lib-commonjs/components/MenuItem/useMenuItem.js +31 -29
  150. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  151. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js +7 -3
  152. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  153. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -7
  154. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  155. package/lib-commonjs/components/MenuItemCheckbox/index.js +6 -6
  156. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  157. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -6
  158. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  159. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +13 -11
  160. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  161. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js +8 -4
  162. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -1
  163. package/lib-commonjs/components/MenuItemLink/MenuItemLink.js +7 -5
  164. package/lib-commonjs/components/MenuItemLink/MenuItemLink.js.map +1 -1
  165. package/lib-commonjs/components/MenuItemLink/index.js +6 -6
  166. package/lib-commonjs/components/MenuItemLink/index.js.map +1 -1
  167. package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js +15 -6
  168. package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  169. package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js +7 -5
  170. package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  171. package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js +9 -5
  172. package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js.map +1 -1
  173. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -7
  174. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  175. package/lib-commonjs/components/MenuItemRadio/index.js +6 -6
  176. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  177. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -6
  178. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  179. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +13 -11
  180. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  181. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js +8 -4
  182. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -1
  183. package/lib-commonjs/components/MenuList/MenuList.js +9 -7
  184. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  185. package/lib-commonjs/components/MenuList/MenuList.types.js +2 -2
  186. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  187. package/lib-commonjs/components/MenuList/index.js +7 -7
  188. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  189. package/lib-commonjs/components/MenuList/renderMenuList.js +11 -8
  190. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  191. package/lib-commonjs/components/MenuList/useMenuList.js +21 -17
  192. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  193. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +4 -2
  194. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  195. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js +7 -3
  196. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js.map +1 -1
  197. package/lib-commonjs/components/MenuPopover/MenuPopover.js +9 -7
  198. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  199. package/lib-commonjs/components/MenuPopover/index.js +6 -6
  200. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  201. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +13 -10
  202. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  203. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +23 -19
  204. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  205. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js +7 -3
  206. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -1
  207. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +9 -7
  208. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  209. package/lib-commonjs/components/MenuSplitGroup/index.js +6 -6
  210. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  211. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +8 -6
  212. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  213. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +21 -17
  214. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  215. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js +7 -3
  216. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -1
  217. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +5 -3
  218. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  219. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js +2 -2
  220. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  221. package/lib-commonjs/components/MenuTrigger/index.js +5 -5
  222. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  223. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +5 -3
  224. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  225. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +33 -29
  226. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  227. package/lib-commonjs/components/index.js +3 -3
  228. package/lib-commonjs/components/index.js.map +1 -1
  229. package/lib-commonjs/contexts/menuContext.js +14 -8
  230. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  231. package/lib-commonjs/contexts/menuGroupContext.js +8 -4
  232. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  233. package/lib-commonjs/contexts/menuListContext.js +14 -8
  234. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  235. package/lib-commonjs/contexts/menuTriggerContext.js +8 -4
  236. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  237. package/lib-commonjs/index.js +225 -83
  238. package/lib-commonjs/index.js.map +1 -1
  239. package/lib-commonjs/selectable/index.js +3 -3
  240. package/lib-commonjs/selectable/index.js.map +1 -1
  241. package/lib-commonjs/selectable/types.js +2 -2
  242. package/lib-commonjs/selectable/types.js.map +1 -1
  243. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js +4 -2
  244. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -1
  245. package/lib-commonjs/utils/index.js +2 -2
  246. package/lib-commonjs/utils/index.js.map +1 -1
  247. package/lib-commonjs/utils/useIsSubmenu.js +5 -3
  248. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  249. package/lib-commonjs/utils/useOnMenuEnter.js +16 -10
  250. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  251. package/package.json +16 -16
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/MenuSplitGroup/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/MenuSplitGroup/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuSplitGroup.js"],"sourcesContent":["export * from './components/MenuSplitGroup/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["MenuSplitGroup.js"],"sourcesContent":["export * from './components/MenuSplitGroup/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/MenuTrigger/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/MenuTrigger/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuTrigger.js"],"sourcesContent":["export * from './components/MenuTrigger/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["MenuTrigger.js"],"sourcesContent":["export * from './components/MenuTrigger/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "Menu", {
6
6
  enumerable: true,
7
- get: ()=>Menu
7
+ get: function() {
8
+ return Menu;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _useMenu = require("./useMenu");
12
14
  const _useMenuContextValues = require("./useMenuContextValues");
13
15
  const _renderMenu = require("./renderMenu");
@@ -1 +1 @@
1
- {"version":3,"sources":["Menu.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenu_unstable } from './useMenu';\nimport { useMenuContextValues_unstable } from './useMenuContextValues';\nimport { renderMenu_unstable } from './renderMenu';\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */ export const Menu = (props)=>{\n const state = useMenu_unstable(props);\n const contextValues = useMenuContextValues_unstable(state);\n return renderMenu_unstable(state, contextValues);\n};\nMenu.displayName = 'Menu';\n"],"names":["Menu","props","state","useMenu_unstable","contextValues","useMenuContextValues_unstable","renderMenu_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;yBACU;sCACa;4BACV;AAGzB,MAAMA,OAAO,CAACC,QAAQ;IAC7B,MAAMC,QAAQC,IAAAA,yBAAgB,EAACF;IAC/B,MAAMG,gBAAgBC,IAAAA,mDAA6B,EAACH;IACpD,OAAOI,IAAAA,+BAAmB,EAACJ,OAAOE;AACtC;AACAJ,KAAKO,WAAW,GAAG"}
1
+ {"version":3,"sources":["Menu.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenu_unstable } from './useMenu';\nimport { useMenuContextValues_unstable } from './useMenuContextValues';\nimport { renderMenu_unstable } from './renderMenu';\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */ export const Menu = (props)=>{\n const state = useMenu_unstable(props);\n const contextValues = useMenuContextValues_unstable(state);\n return renderMenu_unstable(state, contextValues);\n};\nMenu.displayName = 'Menu';\n"],"names":["Menu","props","state","useMenu_unstable","contextValues","useMenuContextValues_unstable","renderMenu_unstable","displayName"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;yBACU;sCACa;4BACV;AAGzB,MAAMA,OAAO,CAACC;IACrB,MAAMC,QAAQC,IAAAA,yBAAgB,EAACF;IAC/B,MAAMG,gBAAgBC,IAAAA,mDAA6B,EAACH;IACpD,OAAOI,IAAAA,+BAAmB,EAACJ,OAAOE;AACtC;AACAJ,KAAKO,WAAW,GAAG"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
5
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["Menu.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
1
+ {"version":3,"sources":["Menu.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./Menu"), exports);
7
- _exportStar(require("./Menu.types"), exports);
8
- _exportStar(require("./renderMenu"), exports);
9
- _exportStar(require("./useMenu"), exports);
10
- _exportStar(require("./useMenuContextValues"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./Menu"), exports);
7
+ _export_star._(require("./Menu.types"), exports);
8
+ _export_star._(require("./renderMenu"), exports);
9
+ _export_star._(require("./useMenu"), exports);
10
+ _export_star._(require("./useMenuContextValues"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Menu';\nexport * from './Menu.types';\nexport * from './renderMenu';\nexport * from './useMenu';\nexport * from './useMenuContextValues';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Menu';\nexport * from './Menu.types';\nexport * from './renderMenu';\nexport * from './useMenu';\nexport * from './useMenuContextValues';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "renderMenu_unstable", {
6
6
  enumerable: true,
7
- get: ()=>renderMenu_unstable
7
+ get: function() {
8
+ return renderMenu_unstable;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _menuContext = require("../../contexts/menuContext");
12
14
  const renderMenu_unstable = (state, contextValues)=>{
13
15
  return /*#__PURE__*/ _react.createElement(_menuContext.MenuProvider, {
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuProvider } from '../../contexts/menuContext';\n/**\n * Render the final JSX of Menu\n */ export const renderMenu_unstable = (state, contextValues)=>{\n return /*#__PURE__*/ React.createElement(MenuProvider, {\n value: contextValues.menu\n }, state.menuTrigger, state.open && state.menuPopover);\n};\n"],"names":["renderMenu_unstable","state","contextValues","React","createElement","MenuProvider","value","menu","menuTrigger","open","menuPopover"],"mappings":";;;;+BAIiBA;;aAAAA;;;6DAJM;6BACM;AAGlB,MAAMA,sBAAsB,CAACC,OAAOC,gBAAgB;IAC3D,OAAO,WAAW,GAAGC,OAAMC,aAAa,CAACC,yBAAY,EAAE;QACnDC,OAAOJ,cAAcK,IAAI;IAC7B,GAAGN,MAAMO,WAAW,EAAEP,MAAMQ,IAAI,IAAIR,MAAMS,WAAW;AACzD"}
1
+ {"version":3,"sources":["renderMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuProvider } from '../../contexts/menuContext';\n/**\n * Render the final JSX of Menu\n */ export const renderMenu_unstable = (state, contextValues)=>{\n return /*#__PURE__*/ React.createElement(MenuProvider, {\n value: contextValues.menu\n }, state.menuTrigger, state.open && state.menuPopover);\n};\n"],"names":["renderMenu_unstable","state","contextValues","React","createElement","MenuProvider","value","menu","menuTrigger","open","menuPopover"],"mappings":";;;;+BAIiBA;;;eAAAA;;;;iEAJM;6BACM;AAGlB,MAAMA,sBAAsB,CAACC,OAAOC;IAC3C,OAAO,WAAW,GAAGC,OAAMC,aAAa,CAACC,yBAAY,EAAE;QACnDC,OAAOJ,cAAcK,IAAI;IAC7B,GAAGN,MAAMO,WAAW,EAAEP,MAAMQ,IAAI,IAAIR,MAAMS,WAAW;AACzD"}
@@ -4,15 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "useMenu_unstable", {
6
6
  enumerable: true,
7
- get: ()=>useMenu_unstable
7
+ get: function() {
8
+ return useMenu_unstable;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
- const _reactPositioning = require("@fluentui/react-positioning");
12
- const _reactUtilities = require("@fluentui/react-utilities");
13
- const _reactSharedContexts = require("@fluentui/react-shared-contexts");
14
- const _reactPortal = require("@fluentui/react-portal");
15
- const _reactTabster = require("@fluentui/react-tabster");
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactpositioning = require("@fluentui/react-positioning");
14
+ const _reactutilities = require("@fluentui/react-utilities");
15
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
16
+ const _reactportal = require("@fluentui/react-portal");
17
+ const _reacttabster = require("@fluentui/react-tabster");
16
18
  const _menuContext = require("../../contexts/menuContext");
17
19
  const _index = require("../../utils/index");
18
20
  const _useIsSubmenu = require("../../utils/useIsSubmenu");
@@ -28,15 +30,15 @@ const submenuFallbackPositions = [
28
30
  ];
29
31
  const useMenu_unstable = (props)=>{
30
32
  const isSubmenu = (0, _useIsSubmenu.useIsSubmenu)();
31
- const { hoverDelay =500 , inline =false , hasCheckmarks =false , hasIcons =false , closeOnScroll =false , openOnContext =false , persistOnItemClick =false , openOnHover =isSubmenu , defaultCheckedValues , mountNode =null } = props;
32
- const triggerId = (0, _reactUtilities.useId)('menu');
33
- const [contextTarget, setContextTarget] = (0, _reactPositioning.usePositioningMouseTarget)();
33
+ const { hoverDelay = 500, inline = false, hasCheckmarks = false, hasIcons = false, closeOnScroll = false, openOnContext = false, persistOnItemClick = false, openOnHover = isSubmenu, defaultCheckedValues, mountNode = null } = props;
34
+ const triggerId = (0, _reactutilities.useId)('menu');
35
+ const [contextTarget, setContextTarget] = (0, _reactpositioning.usePositioningMouseTarget)();
34
36
  const positioningState = {
35
37
  position: isSubmenu ? 'after' : 'below',
36
38
  align: isSubmenu ? 'top' : 'start',
37
39
  target: props.openOnContext ? contextTarget : undefined,
38
40
  fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,
39
- ...(0, _reactPositioning.resolvePositioningShorthand)(props.positioning)
41
+ ...(0, _reactpositioning.resolvePositioningShorthand)(props.positioning)
40
42
  };
41
43
  const children = _react.Children.toArray(props.children);
42
44
  if (process.env.NODE_ENV !== 'production') {
@@ -57,7 +59,7 @@ const useMenu_unstable = (props)=>{
57
59
  } else if (children.length === 1) {
58
60
  menuPopover = children[0];
59
61
  }
60
- const { targetRef: triggerRef , containerRef: menuPopoverRef } = (0, _reactPositioning.usePositioning)(positioningState);
62
+ const { targetRef: triggerRef, containerRef: menuPopoverRef } = (0, _reactpositioning.usePositioning)(positioningState);
61
63
  // TODO Better way to narrow types ?
62
64
  const [open, setOpen] = useMenuOpenState({
63
65
  hoverDelay,
@@ -105,14 +107,14 @@ const useMenu_unstable = (props)=>{
105
107
  * Adds appropriate state values and handlers for selectable items
106
108
  * i.e checkboxes and radios
107
109
  */ const useMenuSelectableState = (props)=>{
108
- const [checkedValues, setCheckedValues] = (0, _reactUtilities.useControllableState)({
110
+ const [checkedValues, setCheckedValues] = (0, _reactutilities.useControllableState)({
109
111
  state: props.checkedValues,
110
112
  defaultState: props.defaultCheckedValues,
111
113
  initialState: {}
112
114
  });
113
- const onCheckedValueChange = (0, _reactUtilities.useEventCallback)((e, { name , checkedItems })=>{
114
- var _props_onCheckedValueChange;
115
- (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {
115
+ const onCheckedValueChange = (0, _reactutilities.useEventCallback)((e, { name, checkedItems })=>{
116
+ var _props_onCheckedValueChange, _props;
117
+ (_props_onCheckedValueChange = (_props = props).onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(_props, e, {
116
118
  name,
117
119
  checkedItems
118
120
  });
@@ -127,22 +129,23 @@ const useMenu_unstable = (props)=>{
127
129
  ];
128
130
  };
129
131
  const useMenuOpenState = (state)=>{
130
- const { targetDocument } = (0, _reactSharedContexts.useFluent_unstable)();
132
+ const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
131
133
  const parentSetOpen = (0, _menuContext.useMenuContext_unstable)((context)=>context.setOpen);
132
- const onOpenChange = (0, _reactUtilities.useEventCallback)((e, data)=>{
133
- var _state_onOpenChange;
134
- return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);
134
+ const onOpenChange = (0, _reactutilities.useEventCallback)((e, data)=>{
135
+ var _state_onOpenChange, _state;
136
+ return (_state_onOpenChange = (_state = state).onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(_state, e, data);
135
137
  });
136
138
  const setOpenTimeout = _react.useRef(0);
137
139
  const enteringTriggerRef = _react.useRef(false);
138
- const [open, setOpenState] = (0, _reactUtilities.useControllableState)({
140
+ const [open, setOpenState] = (0, _reactutilities.useControllableState)({
139
141
  state: state.open,
140
142
  defaultState: state.defaultOpen,
141
143
  initialState: false
142
144
  });
143
- const trySetOpen = (0, _reactUtilities.useEventCallback)((e, data)=>{
145
+ const trySetOpen = (0, _reactutilities.useEventCallback)((e, data)=>{
146
+ var _onOpenChange;
144
147
  const event = e instanceof CustomEvent && e.type === _index.MENU_ENTER_EVENT ? e.detail.nativeEvent : e;
145
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {
148
+ (_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(event, {
146
149
  ...data
147
150
  });
148
151
  if (data.open && e.type === 'contextmenu') {
@@ -158,7 +161,7 @@ const useMenuOpenState = (state)=>{
158
161
  }
159
162
  setOpenState(data.open);
160
163
  });
161
- const setOpen = (0, _reactUtilities.useEventCallback)((e, data)=>{
164
+ const setOpen = (0, _reactutilities.useEventCallback)((e, data)=>{
162
165
  clearTimeout(setOpenTimeout.current);
163
166
  if (!(e instanceof Event) && e.persist) {
164
167
  // < React 17 still uses pooled synthetic events
@@ -177,8 +180,8 @@ const useMenuOpenState = (state)=>{
177
180
  trySetOpen(e, data);
178
181
  }
179
182
  });
180
- (0, _reactUtilities.useOnClickOutside)({
181
- contains: _reactPortal.elementContains,
183
+ (0, _reactutilities.useOnClickOutside)({
184
+ contains: _reactportal.elementContains,
182
185
  disabled: !open,
183
186
  element: targetDocument,
184
187
  refs: [
@@ -193,8 +196,8 @@ const useMenuOpenState = (state)=>{
193
196
  });
194
197
  // only close on scroll for context, or when closeOnScroll is specified
195
198
  const closeOnScroll = state.openOnContext || state.closeOnScroll;
196
- (0, _reactUtilities.useOnScrollOutside)({
197
- contains: _reactPortal.elementContains,
199
+ (0, _reactutilities.useOnScrollOutside)({
200
+ contains: _reactportal.elementContains,
198
201
  element: targetDocument,
199
202
  callback: (event)=>setOpen(event, {
200
203
  open: false,
@@ -233,10 +236,11 @@ const useMenuOpenState = (state)=>{
233
236
  };
234
237
  }, []);
235
238
  // Manage focus for open state
236
- const { findFirstFocusable } = (0, _reactTabster.useFocusFinders)();
239
+ const { findFirstFocusable } = (0, _reacttabster.useFocusFinders)();
237
240
  const focusFirst = _react.useCallback(()=>{
241
+ var _firstFocusable;
238
242
  const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);
239
- firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
243
+ (_firstFocusable = firstFocusable) === null || _firstFocusable === void 0 ? void 0 : _firstFocusable.focus();
240
244
  }, [
241
245
  findFirstFocusable,
242
246
  state.menuPopoverRef
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = [\n 'after',\n 'after-bottom',\n 'before-top',\n 'before',\n 'before-bottom',\n 'above'\n];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */ export const useMenu_unstable = (props)=>{\n const isSubmenu = useIsSubmenu();\n const { hoverDelay =500 , inline =false , hasCheckmarks =false , hasIcons =false , closeOnScroll =false , openOnContext =false , persistOnItemClick =false , openOnHover =isSubmenu , defaultCheckedValues , mountNode =null } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const { targetRef: triggerRef , containerRef: menuPopoverRef } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */ const useMenuSelectableState = (props)=>{\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, { name , checkedItems })=>{\n var _props_onCheckedValueChange;\n (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {\n name,\n checkedItems\n });\n setCheckedValues((currentValue)=>({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [\n checkedValues,\n onCheckedValueChange\n ];\n};\nconst useMenuOpenState = (state)=>{\n const { targetDocument } = useFluent();\n const parentSetOpen = useMenuContext_unstable((context)=>context.setOpen);\n const onOpenChange = useEventCallback((e, data)=>{\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data)=>{\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data)=>{\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(()=>trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [\n state.menuPopoverRef,\n !state.openOnContext && state.triggerRef\n ].filter(Boolean),\n callback: (event)=>setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: (event)=>setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [\n state.menuPopoverRef,\n !state.openOnContext && state.triggerRef\n ].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: (event)=>{\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [\n state.menuPopoverRef\n ]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(()=>{\n return ()=>{\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [\n findFirstFocusable,\n state.menuPopoverRef\n ]);\n React.useEffect(()=>{\n if (open) {\n focusFirst();\n }\n }, [\n open,\n focusFirst\n ]);\n return [\n open,\n setOpen\n ];\n};\n"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","firstFocusable","focus"],"mappings":";;;;+BA0BiBA;;aAAAA;;;6DA1BM;kCACgE;gCACc;qCACrD;6BAChB;8BACA;6BACQ;uBACc;8BACzB;AAC7B,yEAAyE;AACzE,0CAA0C;AAC1C,MAAMC,2BAA2B;IAC7B;IACA;IACA;IACA;IACA;IACA;CACH;AAQU,MAAMD,mBAAmB,CAACE,QAAQ;IACzC,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EAAEC,YAAY,IAAG,EAAGC,QAAQ,KAAK,CAAA,EAAGC,eAAe,KAAK,CAAA,EAAGC,UAAU,KAAK,CAAA,EAAGC,eAAe,KAAK,CAAA,EAAGC,eAAe,KAAK,CAAA,EAAGC,oBAAoB,KAAK,CAAA,EAAGC,aAAaT,UAAS,EAAGU,qBAAoB,EAAGC,WAAW,IAAI,CAAA,EAAG,GAAGZ;IAClO,MAAMa,YAAYC,IAAAA,qBAAK,EAAC;IACxB,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,mBAAmB;QACrBC,UAAUlB,YAAY,UAAU,OAAO;QACvCmB,OAAOnB,YAAY,QAAQ,OAAO;QAClCoB,QAAQrB,MAAMQ,aAAa,GAAGO,gBAAgBO,SAAS;QACvDC,mBAAmBtB,YAAYF,2BAA2BuB,SAAS;QACnE,GAAGE,IAAAA,6CAA2B,EAACxB,MAAMyB,WAAW,CAAC;IACrD;IACA,MAAMC,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAAC7B,MAAM0B,QAAQ;IACtD,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,IAAIN,SAASO,MAAM,KAAK,GAAG;YACvB,sCAAsC;YACtCC,QAAQC,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,KAAK,IAAI,KAAK,IAAIA,eAAeC,KAAK,EAAE;IAC1F,GAAG;QACCL;QACA/C,MAAMb,cAAc;KACvB;IACDd,OAAMyE,SAAS,CAAC,IAAI;QAChB,IAAIzD,MAAM;YACN4D;QACJ,CAAC;IACL,GAAG;QACC5D;QACA4D;KACH;IACD,OAAO;QACH5D;QACAC;KACH;AACL"}
1
+ {"version":3,"sources":["useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = [\n 'after',\n 'after-bottom',\n 'before-top',\n 'before',\n 'before-bottom',\n 'above'\n];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */ export const useMenu_unstable = (props)=>{\n const isSubmenu = useIsSubmenu();\n const { hoverDelay = 500, inline = false, hasCheckmarks = false, hasIcons = false, closeOnScroll = false, openOnContext = false, persistOnItemClick = false, openOnHover = isSubmenu, defaultCheckedValues, mountNode = null } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const { targetRef: triggerRef, containerRef: menuPopoverRef } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */ const useMenuSelectableState = (props)=>{\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, { name, checkedItems })=>{\n var _props_onCheckedValueChange, _props;\n (_props_onCheckedValueChange = (_props = props).onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(_props, e, {\n name,\n checkedItems\n });\n setCheckedValues((currentValue)=>({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [\n checkedValues,\n onCheckedValueChange\n ];\n};\nconst useMenuOpenState = (state)=>{\n const { targetDocument } = useFluent();\n const parentSetOpen = useMenuContext_unstable((context)=>context.setOpen);\n const onOpenChange = useEventCallback((e, data)=>{\n var _state_onOpenChange, _state;\n return (_state_onOpenChange = (_state = state).onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(_state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data)=>{\n var _onOpenChange;\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n (_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data)=>{\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(()=>trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [\n state.menuPopoverRef,\n !state.openOnContext && state.triggerRef\n ].filter(Boolean),\n callback: (event)=>setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: (event)=>setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [\n state.menuPopoverRef,\n !state.openOnContext && state.triggerRef\n ].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: (event)=>{\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [\n state.menuPopoverRef\n ]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(()=>{\n return ()=>{\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n var _firstFocusable;\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n (_firstFocusable = firstFocusable) === null || _firstFocusable === void 0 ? void 0 : _firstFocusable.focus();\n }, [\n findFirstFocusable,\n state.menuPopoverRef\n ]);\n React.useEffect(()=>{\n if (open) {\n focusFirst();\n }\n }, [\n open,\n focusFirst\n ]);\n return [\n open,\n setOpen\n ];\n};\n"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","_props","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","_state","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","_onOpenChange","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","_firstFocusable","firstFocusable","focus"],"mappings":";;;;+BA0BiBA;;;eAAAA;;;;iEA1BM;kCACgE;gCACc;qCACrD;6BAChB;8BACA;6BACQ;uBACc;8BACzB;AAC7B,yEAAyE;AACzE,0CAA0C;AAC1C,MAAMC,2BAA2B;IAC7B;IACA;IACA;IACA;IACA;IACA;CACH;AAQU,MAAMD,mBAAmB,CAACE;IACjC,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EAAEC,aAAa,GAAG,EAAEC,SAAS,KAAK,EAAEC,gBAAgB,KAAK,EAAEC,WAAW,KAAK,EAAEC,gBAAgB,KAAK,EAAEC,gBAAgB,KAAK,EAAEC,qBAAqB,KAAK,EAAEC,cAAcT,SAAS,EAAEU,oBAAoB,EAAEC,YAAY,IAAI,EAAE,GAAGZ;IACjO,MAAMa,YAAYC,IAAAA,qBAAK,EAAC;IACxB,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,mBAAmB;QACrBC,UAAUlB,YAAY,UAAU;QAChCmB,OAAOnB,YAAY,QAAQ;QAC3BoB,QAAQrB,MAAMQ,aAAa,GAAGO,gBAAgBO;QAC9CC,mBAAmBtB,YAAYF,2BA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BAAe;IAC9C,MAAMC,aAAa/E,OAAMgF,WAAW,CAAC;QACjC,IAAIC;QACJ,MAAMC,iBAAiBL,mBAAmBlD,MAAMb,cAAc,CAAC8C,OAAO;QACrEqB,CAAAA,kBAAkBC,cAAa,MAAO,QAAQD,oBAAoB,KAAK,IAAI,KAAK,IAAIA,gBAAgBE,KAAK;IAC9G,GAAG;QACCN;QACAlD,MAAMb,cAAc;KACvB;IACDd,OAAM4E,SAAS,CAAC;QACZ,IAAI5D,MAAM;YACN+D;QACJ;IACJ,GAAG;QACC/D;QACA+D;KACH;IACD,OAAO;QACH/D;QACAC;KACH;AACL"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "useMenuContextValues_unstable", {
6
6
  enumerable: true,
7
- get: ()=>useMenuContextValues_unstable
7
+ get: function() {
8
+ return useMenuContextValues_unstable;
9
+ }
8
10
  });
9
11
  function useMenuContextValues_unstable(state) {
10
- const { checkedValues , hasCheckmarks , hasIcons , inline , isSubmenu , menuPopoverRef , mountNode , onCheckedValueChange , open , openOnContext , openOnHover , persistOnItemClick , setOpen , triggerId , triggerRef } = state;
12
+ const { checkedValues, hasCheckmarks, hasIcons, inline, isSubmenu, menuPopoverRef, mountNode, onCheckedValueChange, open, openOnContext, openOnHover, persistOnItemClick, setOpen, triggerId, triggerRef } = state;
11
13
  // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
12
14
  const menu = {
13
15
  checkedValues,
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuContextValues.js"],"sourcesContent":["export function useMenuContextValues_unstable(state) {\n const { checkedValues , hasCheckmarks , hasIcons , inline , isSubmenu , menuPopoverRef , mountNode , onCheckedValueChange , open , openOnContext , openOnHover , persistOnItemClick , setOpen , triggerId , triggerRef } = state;\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const menu = {\n checkedValues,\n hasCheckmarks,\n hasIcons,\n inline,\n isSubmenu,\n menuPopoverRef,\n mountNode,\n onCheckedValueChange,\n open,\n openOnContext,\n openOnHover,\n persistOnItemClick,\n setOpen,\n triggerId,\n triggerRef\n };\n return {\n menu\n };\n}\n"],"names":["useMenuContextValues_unstable","state","checkedValues","hasCheckmarks","hasIcons","inline","isSubmenu","menuPopoverRef","mountNode","onCheckedValueChange","open","openOnContext","openOnHover","persistOnItemClick","setOpen","triggerId","triggerRef","menu"],"mappings":";;;;+BAAgBA;;aAAAA;;AAAT,SAASA,8BAA8BC,KAAK,EAAE;IACjD,MAAM,EAAEC,cAAa,EAAGC,cAAa,EAAGC,SAAQ,EAAGC,OAAM,EAAGC,UAAS,EAAGC,eAAc,EAAGC,UAAS,EAAGC,qBAAoB,EAAGC,KAAI,EAAGC,cAAa,EAAGC,YAAW,EAAGC,mBAAkB,EAAGC,QAAO,EAAGC,UAAS,EAAGC,WAAU,EAAG,GAAGf;IAC5N,mGAAmG;IACnG,MAAMgB,OAAO;QACTf;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACJ;IACA,OAAO;QACHC;IACJ;AACJ"}
1
+ {"version":3,"sources":["useMenuContextValues.js"],"sourcesContent":["export function useMenuContextValues_unstable(state) {\n const { checkedValues, hasCheckmarks, hasIcons, inline, isSubmenu, menuPopoverRef, mountNode, onCheckedValueChange, open, openOnContext, openOnHover, persistOnItemClick, setOpen, triggerId, triggerRef } = state;\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const menu = {\n checkedValues,\n hasCheckmarks,\n hasIcons,\n inline,\n isSubmenu,\n menuPopoverRef,\n mountNode,\n onCheckedValueChange,\n open,\n openOnContext,\n openOnHover,\n persistOnItemClick,\n setOpen,\n triggerId,\n triggerRef\n };\n return {\n menu\n };\n}\n"],"names":["useMenuContextValues_unstable","state","checkedValues","hasCheckmarks","hasIcons","inline","isSubmenu","menuPopoverRef","mountNode","onCheckedValueChange","open","openOnContext","openOnHover","persistOnItemClick","setOpen","triggerId","triggerRef","menu"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,8BAA8BC,KAAK;IAC/C,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,EAAEC,cAAc,EAAEC,SAAS,EAAEC,oBAAoB,EAAEC,IAAI,EAAEC,aAAa,EAAEC,WAAW,EAAEC,kBAAkB,EAAEC,OAAO,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAGf;IAC7M,mGAAmG;IACnG,MAAMgB,OAAO;QACTf;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACJ;IACA,OAAO;QACHC;IACJ;AACJ"}
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "MenuDivider", {
6
6
  enumerable: true,
7
- get: ()=>MenuDivider
7
+ get: function() {
8
+ return MenuDivider;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _useMenuDivider = require("./useMenuDivider");
12
- const _useMenuDividerStylesStyles = require("./useMenuDividerStyles.styles");
14
+ const _useMenuDividerStylesstyles = require("./useMenuDividerStyles.styles");
13
15
  const _renderMenuDivider = require("./renderMenuDivider");
14
- const _reactSharedContexts = require("@fluentui/react-shared-contexts");
16
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
15
17
  const MenuDivider = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
18
  const state = (0, _useMenuDivider.useMenuDivider_unstable)(props, ref);
17
- (0, _useMenuDividerStylesStyles.useMenuDividerStyles_unstable)(state);
18
- (0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuDividerStyles_unstable')(state);
19
+ (0, _useMenuDividerStylesstyles.useMenuDividerStyles_unstable)(state);
20
+ (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useMenuDividerStyles_unstable')(state);
19
21
  return (0, _renderMenuDivider.renderMenuDivider_unstable)(state);
20
22
  });
21
23
  MenuDivider.displayName = 'MenuDivider';
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles.styles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.\n */ export const MenuDivider = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuDivider_unstable(props, ref);\n useMenuDividerStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);\n return renderMenuDivider_unstable(state);\n});\nMenuDivider.displayName = 'MenuDivider';\n"],"names":["MenuDivider","React","forwardRef","props","ref","state","useMenuDivider_unstable","useMenuDividerStyles_unstable","useCustomStyleHook_unstable","renderMenuDivider_unstable","displayName"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;gCACiB;4CACM;mCACH;qCACC;AAGjC,MAAMA,cAAc,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACxE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,yDAA6B,EAACF;IAC9BG,IAAAA,gDAA2B,EAAC,iCAAiCH;IAC7D,OAAOI,IAAAA,6CAA0B,EAACJ;AACtC;AACAL,YAAYU,WAAW,GAAG"}
1
+ {"version":3,"sources":["MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles.styles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.\n */ export const MenuDivider = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuDivider_unstable(props, ref);\n useMenuDividerStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);\n return renderMenuDivider_unstable(state);\n});\nMenuDivider.displayName = 'MenuDivider';\n"],"names":["MenuDivider","React","forwardRef","props","ref","state","useMenuDivider_unstable","useMenuDividerStyles_unstable","useCustomStyleHook_unstable","renderMenuDivider_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;gCACiB;4CACM;mCACH;qCACC;AAGjC,MAAMA,cAAc,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAClE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,yDAA6B,EAACF;IAC9BG,IAAAA,gDAA2B,EAAC,iCAAiCH;IAC7D,OAAOI,IAAAA,6CAA0B,EAACJ;AACtC;AACAL,YAAYU,WAAW,GAAG"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./MenuDivider.types"), exports);
7
- _exportStar(require("./MenuDivider"), exports);
8
- _exportStar(require("./renderMenuDivider"), exports);
9
- _exportStar(require("./useMenuDivider"), exports);
10
- _exportStar(require("./useMenuDividerStyles.styles"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./MenuDivider.types"), exports);
7
+ _export_star._(require("./MenuDivider"), exports);
8
+ _export_star._(require("./renderMenuDivider"), exports);
9
+ _export_star._(require("./useMenuDivider"), exports);
10
+ _export_star._(require("./useMenuDividerStyles.styles"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuDivider.types';\nexport * from './MenuDivider';\nexport * from './renderMenuDivider';\nexport * from './useMenuDivider';\nexport * from './useMenuDividerStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuDivider.types';\nexport * from './MenuDivider';\nexport * from './renderMenuDivider';\nexport * from './useMenuDivider';\nexport * from './useMenuDividerStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1,14 +1,16 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  Object.defineProperty(exports, "renderMenuDivider_unstable", {
6
6
  enumerable: true,
7
- get: ()=>renderMenuDivider_unstable
7
+ get: function() {
8
+ return renderMenuDivider_unstable;
9
+ }
8
10
  });
9
- const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
- const _reactUtilities = require("@fluentui/react-utilities");
11
+ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
+ const _reactutilities = require("@fluentui/react-utilities");
11
13
  const renderMenuDivider_unstable = (state)=>{
12
- (0, _reactUtilities.assertSlots)(state);
13
- return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null);
14
+ (0, _reactutilities.assertSlots)(state);
15
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
14
16
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuDivider.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Redefine the render function to add slots. Reuse the menudivider structure but add\n * slots to children.\n */ export const renderMenuDivider_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ createElement(state.root, null);\n};\n"],"names":["renderMenuDivider_unstable","state","assertSlots","createElement","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKjCA;;aAAAA;;iCALkE;gCACvD;AAIjB,MAAMA,6BAA6B,CAACC,QAAQ;IACnDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,8BAAa,EAACF,MAAMG,IAAI,EAAE,IAAI;AACvD"}
1
+ {"version":3,"sources":["renderMenuDivider.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Redefine the render function to add slots. Reuse the menudivider structure but add\n * slots to children.\n */ export const renderMenuDivider_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderMenuDivider_unstable","state","assertSlots","_jsx","root"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAK7DA;;;eAAAA;;;4BAL4F;gCACjF;AAIjB,MAAMA,6BAA6B,CAACC;IAC3CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "useMenuDivider_unstable", {
6
6
  enumerable: true,
7
- get: ()=>useMenuDivider_unstable
7
+ get: function() {
8
+ return useMenuDivider_unstable;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _reactUtilities = require("@fluentui/react-utilities");
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _reactutilities = require("@fluentui/react-utilities");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
12
14
  const useMenuDivider_unstable = (props, ref)=>{
13
15
  return {
14
16
  components: {
15
17
  root: 'div'
16
18
  },
17
- root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', {
19
+ root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
18
20
  role: 'presentation',
19
21
  'aria-hidden': true,
20
22
  ...props,
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuDivider.js"],"sourcesContent":["import { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n/**\n * Given user props, returns state and render function for a MenuDivider.\n */ export const useMenuDivider_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n role: 'presentation',\n 'aria-hidden': true,\n ...props,\n ref\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useMenuDivider_unstable","props","ref","components","root","slot","always","getNativeElementProps","role","elementType"],"mappings":";;;;+BAIiBA;;aAAAA;;;gCAJ2B;6DACrB;AAGZ,MAAMA,0BAA0B,CAACC,OAAOC,MAAM;IACrD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CC,MAAM;YACN,eAAe,IAAI;YACnB,GAAGP,KAAK;YACRC;QACJ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useMenuDivider.js"],"sourcesContent":["import { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n/**\n * Given user props, returns state and render function for a MenuDivider.\n */ export const useMenuDivider_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getNativeElementProps('div', {\n role: 'presentation',\n 'aria-hidden': true,\n ...props,\n ref\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useMenuDivider_unstable","props","ref","components","root","slot","always","getNativeElementProps","role","elementType"],"mappings":";;;;+BAIiBA;;;eAAAA;;;;gCAJ2B;iEACrB;AAGZ,MAAMA,0BAA0B,CAACC,OAAOC;IAC/C,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CC,MAAM;YACN,eAAe;YACf,GAAGP,KAAK;YACRC;QACJ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
@@ -9,14 +9,18 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- menuDividerClassNames: ()=>menuDividerClassNames,
13
- useMenuDividerStyles_unstable: ()=>useMenuDividerStyles_unstable
12
+ menuDividerClassNames: function() {
13
+ return menuDividerClassNames;
14
+ },
15
+ useMenuDividerStyles_unstable: function() {
16
+ return useMenuDividerStyles_unstable;
17
+ }
14
18
  });
15
19
  const _react = require("@griffel/react");
16
20
  const menuDividerClassNames = {
17
21
  root: 'fui-MenuDivider'
18
22
  };
19
- const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
23
+ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
20
24
  root: {
21
25
  B6of3ja: "fvjh0tl",
22
26
  t21cq0: [
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuDividerStyles.styles.js"],"sourcesContent":["import { shorthands, mergeClasses, __styles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const menuDividerClassNames = {\n root: 'fui-MenuDivider'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n B6of3ja: \"fvjh0tl\",\n t21cq0: [\"f1rnx978\", \"f1q7jvqi\"],\n jrapky: \"fd1gkq\",\n Frg6f3: [\"f1q7jvqi\", \"f1rnx978\"],\n a9b677: \"f14z66ap\",\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n }\n}, {\n d: [\".fvjh0tl{margin-top:4px;}\", \".f1rnx978{margin-right:-5px;}\", \".f1q7jvqi{margin-left:-5px;}\", \".fd1gkq{margin-bottom:4px;}\", \".f14z66ap{width:auto;}\", \".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}\", \".fg706s2{border-bottom-style:solid;}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\"]\n});\nexport const useMenuDividerStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuDividerClassNames.root, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuDividerStyles.styles.js.map"],"names":["menuDividerClassNames","useMenuDividerStyles_unstable","root","useStyles","__styles","B6of3ja","t21cq0","jrapky","Frg6f3","a9b677","Bn0qgzm","oivjwe","B9xav0g","d","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,qBAAqB,MAArBA;IAiBAC,6BAA6B,MAA7BA;;uBAnBsC;AAE5C,MAAMD,wBAAwB;IACnCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCF,MAAM;QACJG,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAA6B;QAAiC;QAAgC;QAA+B;QAA0B;QAA0D;QAAwC;KAA4D;AAC3T;AACO,MAAMZ,gCAAgCa,CAAAA,QAAS;IACpD,MAAMC,SAASZ;IACfW,MAAMZ,IAAI,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACjB,sBAAsBE,IAAI,EAAEa,OAAOb,IAAI,EAAEY,MAAMZ,IAAI,CAACc,SAAS;IACjG,OAAOF;AACT,GACA,uDAAuD"}
1
+ {"version":3,"sources":["useMenuDividerStyles.styles.js"],"sourcesContent":["import { shorthands, mergeClasses, __styles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const menuDividerClassNames = {\n root: 'fui-MenuDivider'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n B6of3ja: \"fvjh0tl\",\n t21cq0: [\"f1rnx978\", \"f1q7jvqi\"],\n jrapky: \"fd1gkq\",\n Frg6f3: [\"f1q7jvqi\", \"f1rnx978\"],\n a9b677: \"f14z66ap\",\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n }\n}, {\n d: [\".fvjh0tl{margin-top:4px;}\", \".f1rnx978{margin-right:-5px;}\", \".f1q7jvqi{margin-left:-5px;}\", \".fd1gkq{margin-bottom:4px;}\", \".f14z66ap{width:auto;}\", \".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}\", \".fg706s2{border-bottom-style:solid;}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\"]\n});\nexport const useMenuDividerStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuDividerClassNames.root, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuDividerStyles.styles.js.map"],"names":["menuDividerClassNames","useMenuDividerStyles_unstable","root","useStyles","__styles","B6of3ja","t21cq0","jrapky","Frg6f3","a9b677","Bn0qgzm","oivjwe","B9xav0g","d","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,qBAAqB;eAArBA;;IAiBAC,6BAA6B;eAA7BA;;;uBAnBsC;AAE5C,MAAMD,wBAAwB;IACnCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJG,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAA6B;QAAiC;QAAgC;QAA+B;QAA0B;QAA0D;QAAwC;KAA4D;AAC3T;AACO,MAAMZ,gCAAgCa,CAAAA;IAC3C,MAAMC,SAASZ;IACfW,MAAMZ,IAAI,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACjB,sBAAsBE,IAAI,EAAEa,OAAOb,IAAI,EAAEY,MAAMZ,IAAI,CAACc,SAAS;IACjG,OAAOF;AACT,GACA,uDAAuD"}
@@ -4,20 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "MenuGroup", {
6
6
  enumerable: true,
7
- get: ()=>MenuGroup
7
+ get: function() {
8
+ return MenuGroup;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _useMenuGroup = require("./useMenuGroup");
12
14
  const _renderMenuGroup = require("./renderMenuGroup");
13
15
  const _useMenuGroupContextValues = require("./useMenuGroupContextValues");
14
- const _useMenuGroupStylesStyles = require("./useMenuGroupStyles.styles");
15
- const _reactSharedContexts = require("@fluentui/react-shared-contexts");
16
+ const _useMenuGroupStylesstyles = require("./useMenuGroupStyles.styles");
17
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
16
18
  const MenuGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
19
  const state = (0, _useMenuGroup.useMenuGroup_unstable)(props, ref);
18
20
  const contextValues = (0, _useMenuGroupContextValues.useMenuGroupContextValues_unstable)(state);
19
- (0, _useMenuGroupStylesStyles.useMenuGroupStyles_unstable)(state);
20
- (0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuGroupStyles_unstable')(state);
21
+ (0, _useMenuGroupStylesstyles.useMenuGroupStyles_unstable)(state);
22
+ (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useMenuGroupStyles_unstable')(state);
21
23
  return (0, _renderMenuGroup.renderMenuGroup_unstable)(state, contextValues);
22
24
  });
23
25
  MenuGroup.displayName = 'MenuGroup';
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroup_unstable } from './useMenuGroup';\nimport { renderMenuGroup_unstable } from './renderMenuGroup';\nimport { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';\nimport { useMenuGroupStyles_unstable } from './useMenuGroupStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.\n */ export const MenuGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuGroup_unstable(props, ref);\n const contextValues = useMenuGroupContextValues_unstable(state);\n useMenuGroupStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuGroupStyles_unstable')(state);\n return renderMenuGroup_unstable(state, contextValues);\n});\nMenuGroup.displayName = 'MenuGroup';\n"],"names":["MenuGroup","React","forwardRef","props","ref","state","useMenuGroup_unstable","contextValues","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuGroup_unstable","displayName"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;8BACe;iCACG;2CACU;0CACP;qCACA;AAGjC,MAAMA,YAAY,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACtE,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3C,MAAMG,gBAAgBC,IAAAA,6DAAkC,EAACH;IACzDI,IAAAA,qDAA2B,EAACJ;IAC5BK,IAAAA,gDAA2B,EAAC,+BAA+BL;IAC3D,OAAOM,IAAAA,yCAAwB,EAACN,OAAOE;AAC3C;AACAP,UAAUY,WAAW,GAAG"}
1
+ {"version":3,"sources":["MenuGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroup_unstable } from './useMenuGroup';\nimport { renderMenuGroup_unstable } from './renderMenuGroup';\nimport { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';\nimport { useMenuGroupStyles_unstable } from './useMenuGroupStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.\n */ export const MenuGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuGroup_unstable(props, ref);\n const contextValues = useMenuGroupContextValues_unstable(state);\n useMenuGroupStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuGroupStyles_unstable')(state);\n return renderMenuGroup_unstable(state, contextValues);\n});\nMenuGroup.displayName = 'MenuGroup';\n"],"names":["MenuGroup","React","forwardRef","props","ref","state","useMenuGroup_unstable","contextValues","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuGroup_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;8BACe;iCACG;2CACU;0CACP;qCACA;AAGjC,MAAMA,YAAY,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAChE,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3C,MAAMG,gBAAgBC,IAAAA,6DAAkC,EAACH;IACzDI,IAAAA,qDAA2B,EAACJ;IAC5BK,IAAAA,gDAA2B,EAAC,+BAA+BL;IAC3D,OAAOM,IAAAA,yCAAwB,EAACN,OAAOE;AAC3C;AACAP,UAAUY,WAAW,GAAG"}