@fluentui/react-menu 9.14.9 → 9.14.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/lib/Menu.js.map +1 -1
  3. package/lib/MenuDivider.js.map +1 -1
  4. package/lib/MenuGroup.js.map +1 -1
  5. package/lib/MenuGroupHeader.js.map +1 -1
  6. package/lib/MenuItem.js.map +1 -1
  7. package/lib/MenuItemCheckbox.js.map +1 -1
  8. package/lib/MenuItemLink.js.map +1 -1
  9. package/lib/MenuItemRadio.js.map +1 -1
  10. package/lib/MenuItemSwitch.js.map +1 -1
  11. package/lib/MenuList.js.map +1 -1
  12. package/lib/MenuPopover.js.map +1 -1
  13. package/lib/MenuSplitGroup.js.map +1 -1
  14. package/lib/MenuTrigger.js.map +1 -1
  15. package/lib/components/Menu/Menu.js.map +1 -1
  16. package/lib/components/Menu/Menu.types.js.map +1 -1
  17. package/lib/components/Menu/index.js.map +1 -1
  18. package/lib/components/Menu/renderMenu.js.map +1 -1
  19. package/lib/components/Menu/useMenu.js.map +1 -1
  20. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  21. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  22. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  23. package/lib/components/MenuDivider/index.js.map +1 -1
  24. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  25. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  26. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  27. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  28. package/lib/components/MenuGroup/index.js.map +1 -1
  29. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  30. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  31. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  32. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  33. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  34. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  35. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  36. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  37. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  38. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  39. package/lib/components/MenuItem/index.js.map +1 -1
  40. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  41. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  42. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  43. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  44. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  45. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  46. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  47. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  48. package/lib/components/MenuItemLink/MenuItemLink.js.map +1 -1
  49. package/lib/components/MenuItemLink/MenuItemLink.types.js +3 -1
  50. package/lib/components/MenuItemLink/MenuItemLink.types.js.map +1 -1
  51. package/lib/components/MenuItemLink/index.js.map +1 -1
  52. package/lib/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  53. package/lib/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  54. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  55. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  56. package/lib/components/MenuItemRadio/index.js.map +1 -1
  57. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  58. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  59. package/lib/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -1
  60. package/lib/components/MenuItemSwitch/MenuItemSwitch.types.js +3 -1
  61. package/lib/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -1
  62. package/lib/components/MenuItemSwitch/index.js.map +1 -1
  63. package/lib/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -1
  64. package/lib/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -1
  65. package/lib/components/MenuList/MenuList.js.map +1 -1
  66. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  67. package/lib/components/MenuList/index.js.map +1 -1
  68. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  69. package/lib/components/MenuList/useMenuList.js.map +1 -1
  70. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  71. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  72. package/lib/components/MenuPopover/MenuPopover.types.js +3 -1
  73. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  74. package/lib/components/MenuPopover/index.js.map +1 -1
  75. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  76. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  77. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  78. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +3 -1
  79. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  80. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  81. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  82. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  83. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  84. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  85. package/lib/components/MenuTrigger/index.js.map +1 -1
  86. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  87. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  88. package/lib/components/index.js.map +1 -1
  89. package/lib/contexts/menuContext.js.map +1 -1
  90. package/lib/contexts/menuGroupContext.js.map +1 -1
  91. package/lib/contexts/menuListContext.js.map +1 -1
  92. package/lib/contexts/menuTriggerContext.js.map +1 -1
  93. package/lib/index.js.map +1 -1
  94. package/lib/selectable/index.js.map +1 -1
  95. package/lib/selectable/types.js.map +1 -1
  96. package/lib/utils/index.js.map +1 -1
  97. package/lib/utils/useIsSubmenu.js.map +1 -1
  98. package/lib/utils/useOnMenuEnter.js.map +1 -1
  99. package/lib-commonjs/Menu.js.map +1 -1
  100. package/lib-commonjs/MenuDivider.js.map +1 -1
  101. package/lib-commonjs/MenuGroup.js.map +1 -1
  102. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  103. package/lib-commonjs/MenuItem.js.map +1 -1
  104. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  105. package/lib-commonjs/MenuItemLink.js.map +1 -1
  106. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  107. package/lib-commonjs/MenuItemSwitch.js.map +1 -1
  108. package/lib-commonjs/MenuList.js.map +1 -1
  109. package/lib-commonjs/MenuPopover.js.map +1 -1
  110. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  111. package/lib-commonjs/MenuTrigger.js.map +1 -1
  112. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  113. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  114. package/lib-commonjs/components/Menu/index.js.map +1 -1
  115. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  116. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  117. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  118. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  119. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  120. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  121. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  122. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  123. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -1
  124. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  125. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  126. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  127. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  128. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  129. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  130. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -1
  131. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  132. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  133. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  134. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  135. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  136. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -1
  137. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  138. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  139. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  140. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  141. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  142. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  143. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  144. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  145. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  146. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  147. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  148. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  149. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -1
  150. package/lib-commonjs/components/MenuItemLink/MenuItemLink.js.map +1 -1
  151. package/lib-commonjs/components/MenuItemLink/MenuItemLink.types.js +3 -1
  152. package/lib-commonjs/components/MenuItemLink/MenuItemLink.types.js.map +1 -1
  153. package/lib-commonjs/components/MenuItemLink/index.js.map +1 -1
  154. package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  155. package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  156. package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js.map +1 -1
  157. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  158. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  159. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  160. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  161. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  162. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -1
  163. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -1
  164. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.types.js +3 -1
  165. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -1
  166. package/lib-commonjs/components/MenuItemSwitch/index.js.map +1 -1
  167. package/lib-commonjs/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -1
  168. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -1
  169. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +3 -3
  170. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js.map +1 -1
  171. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  172. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  173. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  174. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  175. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  176. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  177. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js.map +1 -1
  178. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  179. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js +3 -1
  180. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  181. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  182. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  183. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  184. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -1
  185. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  186. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +3 -1
  187. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  188. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  189. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  190. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  191. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -1
  192. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  193. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  194. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  195. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  196. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  197. package/lib-commonjs/components/index.js.map +1 -1
  198. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  199. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  200. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  201. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  202. package/lib-commonjs/index.js +136 -136
  203. package/lib-commonjs/index.js.map +1 -1
  204. package/lib-commonjs/selectable/index.js.map +1 -1
  205. package/lib-commonjs/selectable/types.js.map +1 -1
  206. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -1
  207. package/lib-commonjs/utils/index.js.map +1 -1
  208. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  209. package/lib-commonjs/utils/useOnMenuEnter.js +3 -3
  210. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  211. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuItemSwitchStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = /*#__PURE__*/__resetStyles(\"r1x31n8g\", \"rsmcm5v\", {\n r: [\".r1x31n8g{border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);line-height:0;box-sizing:border-box;fill:currentColor;flex-shrink:0;font-size:18px;height:20px;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;margin-right:var(--spacingHorizontalXS);color:var(--colorNeutralStrokeAccessible);}\", \".r1x31n8g:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r1x31n8g:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}\", \".rsmcm5v{border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);line-height:0;box-sizing:border-box;fill:currentColor;flex-shrink:0;font-size:18px;height:20px;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;margin-left:var(--spacingHorizontalXS);color:var(--colorNeutralStrokeAccessible);}\", \".rsmcm5v:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".rsmcm5v:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}\"],\n s: [\"@media screen and (prefers-reduced-motion: reduce){.r1x31n8g{transition-duration:0.01ms;}}\", \"@media screen and (prefers-reduced-motion: reduce){.r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}\", \"@media screen and (prefers-reduced-motion: reduce){.rsmcm5v{transition-duration:0.01ms;}}\", \"@media screen and (prefers-reduced-motion: reduce){.rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}\"]\n});\nconst useSwitchIndicatorStyles = /*#__PURE__*/__styles({\n checked: {\n G4r02d: [\"fdca5i2\", \"fk0rr1z\"],\n De3pzq: \"ftywsgz\",\n sj55zd: \"fqpbvvt\",\n g2u3we: \"fghlq4f\",\n h3c5rm: [\"f1gn591s\", \"fjscplz\"],\n B9xav0g: \"fb073pr\",\n zhjwy3: [\"fjscplz\", \"f1gn591s\"],\n Bi91k9c: \"fz46y8r\",\n Jwef8y: \"f1kjrvvj\",\n Bgoe8wy: \"fpa59ij\",\n Bwzppfd: [\"f1rhln42\", \"f1l1ogpg\"],\n oetu4i: \"fz67qlh\",\n gg5e9n: [\"f1l1ogpg\", \"f1rhln42\"],\n B2d53fq: \"frlnr8d\",\n iro3zm: \"fle2s0s\",\n b661bw: \"f1j8ziw4\",\n Bk6r4ia: [\"f1xzu9i0\", \"f1jlpvxk\"],\n B9zn80p: \"f1i1ccxp\",\n Bpld233: [\"f1jlpvxk\", \"f1xzu9i0\"]\n }\n}, {\n d: [\".fdca5i2 .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(20px);}\", \".fk0rr1z .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(-20px);}\", \".ftywsgz{background-color:var(--colorCompoundBrandBackground);}\", \".fqpbvvt{color:var(--colorNeutralForegroundInverted);}\", \".fghlq4f{border-top-color:var(--colorTransparentStroke);}\", \".f1gn591s{border-right-color:var(--colorTransparentStroke);}\", \".fjscplz{border-left-color:var(--colorTransparentStroke);}\", \".fb073pr{border-bottom-color:var(--colorTransparentStroke);}\"],\n h: [\".fz46y8r:hover{color:var(--colorNeutralForegroundInverted);}\", \".f1kjrvvj:hover{background-color:var(--colorCompoundBrandBackgroundHover);}\", \".fpa59ij:hover{border-top-color:var(--colorTransparentStrokeInteractive);}\", \".f1rhln42:hover{border-right-color:var(--colorTransparentStrokeInteractive);}\", \".f1l1ogpg:hover{border-left-color:var(--colorTransparentStrokeInteractive);}\", \".fz67qlh:hover{border-bottom-color:var(--colorTransparentStrokeInteractive);}\", \".frlnr8d:hover:active{color:var(--colorNeutralForegroundInverted);}\", \".fle2s0s:hover:active{background-color:var(--colorCompoundBrandBackgroundPressed);}\", \".f1j8ziw4:hover:active{border-top-color:var(--colorTransparentStrokeInteractive);}\", \".f1xzu9i0:hover:active{border-right-color:var(--colorTransparentStrokeInteractive);}\", \".f1jlpvxk:hover:active{border-left-color:var(--colorTransparentStrokeInteractive);}\", \".f1i1ccxp:hover:active{border-bottom-color:var(--colorTransparentStrokeInteractive);}\"]\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = state => {\n 'use no memo';\n\n const {\n checked\n } = state;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.switchIndicator) {\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span'\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n persistOnClick: true\n });\n return state;\n};\n//# sourceMappingURL=useMenuItemSwitchStyles.styles.js.map"],"names":["menuItemSwitchClassNames","circleFilledClassName","useMenuItemSwitchStyles_unstable","root","icon","content","secondaryContent","switchIndicator","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","__resetStyles","r","s","useSwitchIndicatorStyles","__styles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","state","switchIndicatorStyles","switchIndicatorBaseStyles","className","mergeClasses","useMenuItemStyles_unstable","components","checkmark","submenuIndicator","undefined","hasSubmenu","persistOnClick"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB;eAAxBA;;IAOAC,qBAAqB;eAArBA;;IAuCAC,gCAAgC;eAAhCA;;;uBAjDqD;yCAEvB;AACpC,MAAMF,2BAA2B;IACtCG,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;AACnB;AACO,MAAMN,wBAAwB;AACrC,+CAA+C;AAC/C,MAAMO,4BAA4B;AAClC,MAAMC,cAAc;AACpB,MAAMC,aAAa;AACnB,MAAMC,YAAYF,cAAcD;AAChC,MAAMI,kCAAkC,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,WAAW;IACxFC,GAAG;QAAC;QAAmc;QAA0H;QAAqI;QAA0L;QAAic;QAAyH;QAAoI;KAAwL;IACtvDC,GAAG;QAAC;QAA8F;QAAiJ;QAA6F;KAA+I;AACje;AACA,MAAMC,2BAA2B,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACrDC,SAAS;QACPC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,SAAS;YAAC;YAAY;SAAW;QACjCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;YAAC;YAAY;SAAW;QACjCC,SAAS;QACTC,SAAS;YAAC;YAAY;SAAW;IACnC;AACF,GAAG;IACDC,GAAG;QAAC;QAA4F;QAA6F;QAAmE;QAA0D;QAA6D;QAAgE;QAA8D;KAA+D;IACpjBC,GAAG;QAAC;QAAgE;QAA+E;QAA8E;QAAiF;QAA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itchStyles.styles.js"],"sourcesContent":["import { makeStyles, makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n },\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover\n },\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n }\n});\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`\n },\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n },\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n }\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */ export const useMenuItemSwitchStyles_unstable = (state)=>{\n 'use no memo';\n const { checked } = state;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.switchIndicator) {\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span'\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n persistOnClick: true\n });\n return state;\n};\n"],"names":["circleFilledClassName","menuItemSwitchClassNames","useMenuItemSwitchStyles_unstable","root","icon","content","secondaryContent","switchIndicator","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","__resetStyles","r","s","useSwitchIndicatorStyles","__styles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","state","switchIndicatorStyles","switchIndicatorBaseStyles","className","mergeClasses","useMenuItemStyles_unstable","components","checkmark","submenuIndicator","undefined","hasSubmenu","persistOnClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAUaA,qBAAqB;eAArBA;;IAPAC,wBAAwB;eAAxBA;;IAsEIC,gCAAgC;eAAhCA;;;uBAzEqD;yCAE3B;AACpC,MAAMD,2BAA2B;IACpCE,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;AACrB;AACO,MAAMP,wBAAwB;AACrC,+CAAA;AACA,MAAMQ,4BAA4B;AAClC,MAAMC,cAAc;AACpB,MAAMC,aAAa;AACnB,MAAMC,YAAYF,cAAcD;AAChC,MAAMI,kCAA+B,WAAA,GAAGC,IAAAA,oBAAA,EAAA,YAAA,WAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAmCxC,MAAMC,2BAAwB,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,SAAA;QAAAC,QAAA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GAAGC,IAAAA,mBAAY,EAAC3C,yBAAyBM,eAAe,EAAEmC,2BAA2BxB,WAAWuB,sBAAsBvB,OAAO,EAAEsB,MAAMjC,eAAe,CAACoC,SAAS;IACjM;IACAE,IAAAA,mDAA0B,EAAC;QACvB,GAAGL,KAAK;QACRM,YAAY;YACR,GAAGN,MAAMM,UAAU;YACnBC,WAAW;YACXC,kBAAkB;QACtB;QACAD,WAAWE;QACXD,kBAAkBC;QAClBC,YAAY;QACZC,gBAAgB;IACpB;IACA,OAAOX;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuList.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuList, using the `useMenuList_unstable` hook.\n */ export const MenuList = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuList_unstable(props, ref);\n const contextValues = useMenuListContextValues_unstable(state);\n useMenuListStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);\n return renderMenuList_unstable(state, contextValues);\n});\nMenuList.displayName = 'MenuList';\n"],"names":["MenuList","React","forwardRef","props","ref","state","useMenuList_unstable","contextValues","useMenuListContextValues_unstable","useMenuListStyles_unstable","useCustomStyleHook_unstable","renderMenuList_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;6BACc;gCACG;0CACU;yCACP;qCACC;AAGjC,MAAMA,WAAW,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/D,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1C,MAAMG,gBAAgBC,IAAAA,2DAAiC,EAACH;IACxDI,IAAAA,mDAA0B,EAACJ;IAC3BK,IAAAA,gDAA2B,EAAC,8BAA8BL;IAC1D,OAAOM,IAAAA,uCAAuB,EAACN,OAAOE;AAC1C;AACAP,SAASY,WAAW,GAAG"}
1
+ {"version":3,"sources":["MenuList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles.styles';\nimport type { MenuListProps } from './MenuList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuList, using the `useMenuList_unstable` hook.\n */\nexport const MenuList: ForwardRefComponent<MenuListProps> = React.forwardRef((props, ref) => {\n const state = useMenuList_unstable(props, ref);\n const contextValues = useMenuListContextValues_unstable(state);\n\n useMenuListStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);\n\n return renderMenuList_unstable(state, contextValues);\n});\n\nMenuList.displayName = 'MenuList';\n"],"names":["MenuList","React","forwardRef","props","ref","state","useMenuList_unstable","contextValues","useMenuListContextValues_unstable","useMenuListStyles_unstable","useCustomStyleHook_unstable","renderMenuList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;6BACc;gCACG;0CACU;yCACP;qCAGC;AAKrC,MAAMA,WAAAA,WAAAA,GAA+CC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQC,IAAAA,iCAAAA,EAAqBH,OAAOC;IAC1C,MAAMG,gBAAgBC,IAAAA,2DAAAA,EAAkCH;IAExDI,IAAAA,mDAAAA,EAA2BJ;IAE3BK,IAAAA,gDAAAA,EAA4B,8BAA8BL;IAE1D,OAAOM,IAAAA,uCAAAA,EAAwBN,OAAOE;AACxC;AAEAP,SAASY,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuList.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["MenuList.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { MenuListContextValue } from '../../contexts/menuListContext';\nimport type { SelectableHandler } from '../../selectable/index';\n\nexport type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;\n\nexport type MenuCheckedValueChangeData = {\n /** The items for this value that are checked */\n checkedItems: string[];\n /** The name of the value */\n name: string;\n};\n\nexport type MenuListSlots = {\n root: Slot<'div'>;\n};\n\nexport type MenuListProps = ComponentProps<MenuListSlots> & {\n /**\n * Map of all checked values\n */\n checkedValues?: Record<string, string[]>;\n\n /**\n * Default values to be checked on mount\n */\n defaultCheckedValues?: Record<string, string[]>;\n\n /**\n * States that menu items can contain selectable items and reserve slots for item alignment\n */\n hasCheckmarks?: boolean;\n\n /**\n * States that menu items can contain icons and reserve slots for item alignment\n */\n hasIcons?: boolean;\n\n /**\n * Callback when checked items change for value with a name\n *\n * @param event - React's original SyntheticEvent\n * @param data - A data object with relevant information\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;\n};\n\nexport type MenuListState = ComponentState<MenuListSlots> &\n Required<Pick<MenuListProps, 'checkedValues' | 'hasCheckmarks' | 'hasIcons'>> &\n Pick<MenuListProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {\n /**\n * Selects a radio item, will de-select the currently selected ratio item\n */\n selectRadio: SelectableHandler;\n\n /**\n * Callback to set focus on the next menu item by first character\n */\n setFocusByFirstCharacter: NonNullable<MenuListContextValue['setFocusByFirstCharacter']>;\n\n /*\n * Toggles the state of a checkbox item\n */\n toggleCheckbox: SelectableHandler;\n\n /**\n * States if the MenuList is inside MenuContext\n */\n hasMenuContext?: boolean;\n };\n\nexport type MenuListContextValues = {\n menuList: MenuListContextValue;\n};\n\n/**\n * @deprecated this type is not being used internally anymore\n */\nexport type UninitializedMenuListState = Omit<\n MenuListState,\n 'checkedValues' | 'selectRadio' | 'setFocusByFirstCharacter' | 'toggleCheckbox'\n> &\n Partial<Pick<MenuListState, 'checkedValues'>>;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuList';\nexport * from './MenuList.types';\nexport * from './renderMenuList';\nexport * from './useMenuList';\nexport * from './useMenuListStyles.styles';\nexport * from './useMenuListContextValues';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuList';\nexport * from './MenuList.types';\nexport * from './renderMenuList';\nexport * from './useMenuList';\nexport * from './useMenuListStyles.styles';\nexport * from './useMenuListContextValues';\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuList.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { MenuListProvider } from '../../contexts/menuListContext';\n/**\n * Function that renders the final JSX of the component\n */ export const renderMenuList_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(MenuListProvider, {\n value: contextValues.menuList,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderMenuList_unstable","state","contextValues","assertSlots","_jsx","MenuListProvider","value","menuList","children","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;iCACK;AAGtB,MAAMA,0BAA0B,CAACC,OAAOC;IAC/CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,iCAAgB,EAAE;QACxCC,OAAOJ,cAAcK,QAAQ;QAC7BC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACH,MAAMQ,IAAI,EAAE,CAAC;IAC9C;AACJ"}
1
+ {"version":3,"sources":["renderMenuList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { MenuListContextValues, MenuListSlots, MenuListState } from './MenuList.types';\nimport { MenuListProvider } from '../../contexts/menuListContext';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuList_unstable = (state: MenuListState, contextValues: MenuListContextValues) => {\n assertSlots<MenuListSlots>(state);\n\n return (\n <MenuListProvider value={contextValues.menuList}>\n <state.root />\n </MenuListProvider>\n );\n};\n"],"names":["renderMenuList_unstable","state","contextValues","assertSlots","_jsx","MenuListProvider","value","menuList","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAC4B;iCAEK;AAK1B,MAAMA,0BAA0B,CAACC,OAAsBC;IAC5DC,IAAAA,2BAAAA,EAA2BF;IAE3B,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,iCAAAA,EAAAA;QAAiBC,OAAOJ,cAAcK,QAAQ;kBAC7C,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMO,IAAI,EAAA,CAAA;;AAGjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuList.js"],"sourcesContent":["import * as React from 'react';\nimport { useMergedRefs, useEventCallback, useControllableState, getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup, useFocusFinders, TabsterMoveFocusEventName } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MenuContext } from '../../contexts/menuContext';\n/**\n * Returns the props and state required to render the component\n */ export const useMenuList_unstable = (props, ref)=>{\n const { findAllFocusable } = useFocusFinders();\n const { targetDocument } = useFluent();\n const menuContext = useMenuContextSelectors();\n const hasMenuContext = useHasParentContext(MenuContext);\n const focusAttributes = useArrowNavigationGroup({\n circular: true\n });\n if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {\n // TODO throw warnings in development safely\n // eslint-disable-next-line no-console\n console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');\n }\n const innerRef = React.useRef(null);\n React.useEffect(()=>{\n const element = innerRef.current;\n if (hasMenuContext && targetDocument && element) {\n const onTabsterMoveFocus = (e)=>{\n const nextElement = e.detail.next;\n if (nextElement && element.contains(targetDocument.activeElement) && !element.contains(nextElement)) {\n // Preventing Tabster from handling Tab press, useMenuPopover will handle it.\n e.preventDefault();\n }\n };\n targetDocument.addEventListener(TabsterMoveFocusEventName, onTabsterMoveFocus);\n return ()=>{\n targetDocument.removeEventListener(TabsterMoveFocusEventName, onTabsterMoveFocus);\n };\n }\n }, [\n innerRef,\n targetDocument,\n hasMenuContext\n ]);\n const setFocusByFirstCharacter = React.useCallback((e, itemEl)=>{\n // TODO use some kind of children registration to reduce dependency on DOM roles\n const acceptedRoles = [\n 'menuitem',\n 'menuitemcheckbox',\n 'menuitemradio'\n ];\n if (!innerRef.current) {\n return;\n }\n const menuItems = findAllFocusable(innerRef.current, (el)=>el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1);\n let startIndex = menuItems.indexOf(itemEl) + 1;\n if (startIndex === menuItems.length) {\n startIndex = 0;\n }\n const firstChars = menuItems.map((menuItem)=>{\n var _menuItem_textContent;\n return (_menuItem_textContent = menuItem.textContent) === null || _menuItem_textContent === void 0 ? void 0 : _menuItem_textContent.charAt(0).toLowerCase();\n });\n const char = e.key.toLowerCase();\n const getIndexFirstChars = (start, firstChar)=>{\n for(let i = start; i < firstChars.length; i++){\n if (char === firstChars[i]) {\n return i;\n }\n }\n return -1;\n };\n // Check remaining slots in the menu\n let index = getIndexFirstChars(startIndex, char);\n // If not found in remaining slots, check from beginning\n if (index === -1) {\n index = getIndexFirstChars(0, char);\n }\n // If match was found...\n if (index > -1) {\n menuItems[index].focus();\n }\n }, [\n findAllFocusable\n ]);\n var _props_checkedValues;\n const [checkedValues, setCheckedValues] = useControllableState({\n state: (_props_checkedValues = props.checkedValues) !== null && _props_checkedValues !== void 0 ? _props_checkedValues : hasMenuContext ? menuContext.checkedValues : undefined,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n var _props_onCheckedValueChange;\n const handleCheckedValueChange = (_props_onCheckedValueChange = props.onCheckedValueChange) !== null && _props_onCheckedValueChange !== void 0 ? _props_onCheckedValueChange : hasMenuContext ? menuContext.onCheckedValueChange : undefined;\n const toggleCheckbox = useEventCallback((e, name, value, checked)=>{\n const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];\n const newCheckedItems = [\n ...checkedItems\n ];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n handleCheckedValueChange === null || handleCheckedValueChange === void 0 ? void 0 : handleCheckedValueChange(e, {\n name,\n checkedItems: newCheckedItems\n });\n setCheckedValues((s)=>({\n ...s,\n [name]: newCheckedItems\n }));\n });\n const selectRadio = useEventCallback((e, name, value)=>{\n const newCheckedItems = [\n value\n ];\n setCheckedValues((s)=>({\n ...s,\n [name]: newCheckedItems\n }));\n handleCheckedValueChange === null || handleCheckedValueChange === void 0 ? void 0 : handleCheckedValueChange(e, {\n name,\n checkedItems: newCheckedItems\n });\n });\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, innerRef),\n role: 'menu',\n 'aria-labelledby': menuContext.triggerId,\n ...focusAttributes,\n ...props\n }), {\n elementType: 'div'\n }),\n hasIcons: menuContext.hasIcons || false,\n hasCheckmarks: menuContext.hasCheckmarks || false,\n checkedValues,\n hasMenuContext,\n setFocusByFirstCharacter,\n selectRadio,\n toggleCheckbox\n };\n};\n/**\n * Adds some sugar to fetching multiple context selector values\n */ const useMenuContextSelectors = ()=>{\n const checkedValues = useMenuContext_unstable((context)=>context.checkedValues);\n const onCheckedValueChange = useMenuContext_unstable((context)=>context.onCheckedValueChange);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const hasIcons = useMenuContext_unstable((context)=>context.hasIcons);\n const hasCheckmarks = useMenuContext_unstable((context)=>context.hasCheckmarks);\n return {\n checkedValues,\n onCheckedValueChange,\n triggerId,\n hasIcons,\n hasCheckmarks\n };\n};\n/**\n * Helper function to detect if props and MenuContext values are both used\n */ const usingPropsAndMenuContext = (props, contextValue, hasMenuContext)=>{\n let isUsingPropsAndContext = false;\n for(const val in contextValue){\n if (props[val]) {\n isUsingPropsAndContext = true;\n }\n }\n return hasMenuContext && isUsingPropsAndContext;\n};\n"],"names":["useMenuList_unstable","props","ref","findAllFocusable","useFocusFinders","targetDocument","useFluent","menuContext","useMenuContextSelectors","hasMenuContext","useHasParentContext","MenuContext","focusAttributes","useArrowNavigationGroup","circular","usingPropsAndMenuContext","console","warn","innerRef","React","useRef","useEffect","element","current","onTabsterMoveFocus","e","nextElement","detail","next","contains","activeElement","preventDefault","addEventListener","TabsterMoveFocusEventName","removeEventListener","setFocusByFirstCharacter","useCallback","itemEl","acceptedRoles","menuItems","el","hasAttribute","indexOf","getAttribute","startIndex","length","firstChars","map","menuItem","_menuItem_textContent","textContent","charAt","toLowerCase","char","key","getIndexFirstChars","start","firstChar","i","index","focus","_props_checkedValues","checkedValues","setCheckedValues","useControllableState","state","undefined","defaultState","defaultCheckedValues","initialState","_props_onCheckedValueChange","handleCheckedValueChange","onCheckedValueChange","toggleCheckbox","useEventCallback","name","value","checked","checkedItems","newCheckedItems","splice","push","s","selectRadio","components","root","slot","always","getIntrinsicElementProps","useMergedRefs","role","triggerId","elementType","hasIcons","hasCheckmarks","useMenuContext_unstable","context","contextValue","isUsingPropsAndContext","val"],"mappings":";;;;+BASiBA;;;eAAAA;;;;iEATM;gCAC+E;8BAClB;qCACpC;sCACZ;6BACI;AAI7B,MAAMA,uBAAuB,CAACC,OAAOC;IAC5C,MAAM,EAAEC,gBAAgB,EAAE,GAAGC,IAAAA,6BAAe;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,cAAcC;IACpB,MAAMC,iBAAiBC,IAAAA,yCAAmB,EAACC,wBAAW;IACtD,MAAMC,kBAAkBC,IAAAA,qCAAuB,EAAC;QAC5CC,UAAU;IACd;IACA,IAAIC,yBAAyBd,OAAOM,aAAaE,iBAAiB;QAC9D,4CAA4C;QAC5C,sCAAsC;QACtCO,QAAQC,IAAI,CAAC;IACjB;IACA,MAAMC,WAAWC,OAAMC,MAAM,CAAC;IAC9BD,OAAME,SAAS,CAAC;QACZ,MAAMC,UAAUJ,SAASK,OAAO;QAChC,IAAId,kBAAkBJ,kBAAkBiB,SAAS;YAC7C,MAAME,qBAAqB,CAACC;gBACxB,MAAMC,cAAcD,EAAEE,MAAM,CAACC,IAAI;gBACjC,IAAIF,eAAeJ,QAAQO,QAAQ,CAACxB,eAAeyB,aAAa,KAAK,CAACR,QAAQO,QAAQ,CAACH,cAAc;oBACjG,6EAA6E;oBAC7ED,EAAEM,cAAc;gBACpB;YACJ;YACA1B,eAAe2B,gBAAgB,CAACC,uCAAyB,EAAET;YAC3D,OAAO;gBACHnB,eAAe6B,mBAAmB,CAACD,uCAAyB,EAAET;YAClE;QACJ;IACJ,GAAG;QACCN;QACAb;QACAI;KACH;IACD,MAAM0B,2BAA2BhB,OAAMiB,WAAW,CAAC,CAACX,GAAGY;QACnD,gFAAgF;QAChF,MAAMC,gBAAgB;YAClB;YACA;YACA;SACH;QACD,IAAI,CAACpB,SAASK,OA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AmBnF,YAAYoF,SAAS;YACxC,GAAG/E,eAAe;YAClB,GAAGX,KAAK;QACZ,IAAI;YACA2F,aAAa;QACjB;QACAC,UAAUtF,YAAYsF,QAAQ,IAAI;QAClCC,eAAevF,YAAYuF,aAAa,IAAI;QAC5ChC;QACArD;QACA0B;QACAgD;QACAV;IACJ;AACJ;AACA;;CAEC,GAAG,MAAMjE,0BAA0B;IAChC,MAAMsD,gBAAgBiC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQlC,aAAa;IAC9E,MAAMU,uBAAuBuB,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQxB,oBAAoB;IAC5F,MAAMmB,YAAYI,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQL,SAAS;IACtE,MAAME,WAAWE,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQH,QAAQ;IACpE,MAAMC,gBAAgBC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQF,aAAa;IAC9E,OAAO;QACHhC;QACAU;QACAmB;QACAE;QACAC;IACJ;AACJ;AACA;;CAEC,GAAG,MAAM/E,2BAA2B,CAACd,OAAOgG,cAAcxF;IACvD,IAAIyF,yBAAyB;IAC7B,IAAI,MAAMC,OAAOF,aAAa;QAC1B,IAAIhG,KAAK,CAACkG,IAAI,EAAE;YACZD,yBAAyB;QAC7B;IACJ;IACA,OAAOzF,kBAAkByF;AAC7B"}
1
+ {"version":3,"sources":["useMenuList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useMergedRefs,\n useEventCallback,\n useControllableState,\n getIntrinsicElementProps,\n slot,\n} from '@fluentui/react-utilities';\nimport {\n useArrowNavigationGroup,\n useFocusFinders,\n TabsterMoveFocusEventName,\n type TabsterMoveFocusEvent,\n} from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MenuContext } from '../../contexts/menuContext';\nimport type { MenuListProps, MenuListState } from './MenuList.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuList_unstable = (props: MenuListProps, ref: React.Ref<HTMLElement>): MenuListState => {\n const { findAllFocusable } = useFocusFinders();\n const { targetDocument } = useFluent();\n const menuContext = useMenuContextSelectors();\n const hasMenuContext = useHasParentContext(MenuContext);\n const focusAttributes = useArrowNavigationGroup({ circular: true });\n\n if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {\n // TODO throw warnings in development safely\n // eslint-disable-next-line no-console\n console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');\n }\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n React.useEffect(() => {\n const element = innerRef.current;\n\n if (hasMenuContext && targetDocument && element) {\n const onTabsterMoveFocus = (e: TabsterMoveFocusEvent) => {\n const nextElement = e.detail.next;\n\n if (nextElement && element.contains(targetDocument.activeElement) && !element.contains(nextElement)) {\n // Preventing Tabster from handling Tab press, useMenuPopover will handle it.\n e.preventDefault();\n }\n };\n\n targetDocument.addEventListener(TabsterMoveFocusEventName, onTabsterMoveFocus);\n\n return () => {\n targetDocument.removeEventListener(TabsterMoveFocusEventName, onTabsterMoveFocus);\n };\n }\n }, [innerRef, targetDocument, hasMenuContext]);\n\n const setFocusByFirstCharacter = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => {\n // TODO use some kind of children registration to reduce dependency on DOM roles\n const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];\n if (!innerRef.current) {\n return;\n }\n\n const menuItems = findAllFocusable(\n innerRef.current,\n (el: HTMLElement) => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')!) !== -1,\n );\n\n let startIndex = menuItems.indexOf(itemEl) + 1;\n if (startIndex === menuItems.length) {\n startIndex = 0;\n }\n\n const firstChars = menuItems.map(menuItem => menuItem.textContent?.charAt(0).toLowerCase());\n const char = e.key.toLowerCase();\n\n const getIndexFirstChars = (start: number, firstChar: string) => {\n for (let i = start; i < firstChars.length; i++) {\n if (char === firstChars[i]) {\n return i;\n }\n }\n return -1;\n };\n\n // Check remaining slots in the menu\n let index = getIndexFirstChars(startIndex, char);\n\n // If not found in remaining slots, check from beginning\n if (index === -1) {\n index = getIndexFirstChars(0, char);\n }\n\n // If match was found...\n if (index > -1) {\n menuItems[index].focus();\n }\n },\n [findAllFocusable],\n );\n\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues ?? (hasMenuContext ? menuContext.checkedValues : undefined),\n defaultState: props.defaultCheckedValues,\n initialState: {},\n });\n\n const handleCheckedValueChange =\n props.onCheckedValueChange ?? (hasMenuContext ? menuContext.onCheckedValueChange : undefined);\n\n const toggleCheckbox = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked: boolean) => {\n const checkedItems = checkedValues?.[name] || [];\n const newCheckedItems = [...checkedItems];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n\n handleCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n setCheckedValues(s => ({ ...s, [name]: newCheckedItems }));\n },\n );\n\n const selectRadio = useEventCallback((e: React.MouseEvent | React.KeyboardEvent, name: string, value: string) => {\n const newCheckedItems = [value];\n setCheckedValues(s => ({ ...s, [name]: newCheckedItems }));\n handleCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n });\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,\n role: 'menu',\n 'aria-labelledby': menuContext.triggerId,\n ...focusAttributes,\n ...props,\n }),\n { elementType: 'div' },\n ),\n hasIcons: menuContext.hasIcons || false,\n hasCheckmarks: menuContext.hasCheckmarks || false,\n checkedValues,\n hasMenuContext,\n setFocusByFirstCharacter,\n selectRadio,\n toggleCheckbox,\n };\n};\n\n/**\n * Adds some sugar to fetching multiple context selector values\n */\nconst useMenuContextSelectors = () => {\n const checkedValues = useMenuContext_unstable(context => context.checkedValues);\n const onCheckedValueChange = useMenuContext_unstable(context => context.onCheckedValueChange);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const hasIcons = useMenuContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuContext_unstable(context => context.hasCheckmarks);\n\n return {\n checkedValues,\n onCheckedValueChange,\n triggerId,\n hasIcons,\n hasCheckmarks,\n };\n};\n\n/**\n * Helper function to detect if props and MenuContext values are both used\n */\nconst usingPropsAndMenuContext = (\n props: MenuListProps,\n contextValue: ReturnType<typeof useMenuContextSelectors>,\n hasMenuContext: boolean,\n) => {\n let isUsingPropsAndContext = false;\n for (const val in contextValue) {\n if (props[val as keyof Omit<typeof contextValue, 'hasMenuContext' | 'onCheckedValueChange' | 'triggerId'>]) {\n isUsingPropsAndContext = true;\n }\n }\n\n return hasMenuContext && isUsingPropsAndContext;\n};\n"],"names":["useMenuList_unstable","props","ref","findAllFocusable","useFocusFinders","targetDocument","useFluent","menuContext","useMenuContextSelectors","hasMenuContext","useHasParentContext","MenuContext","focusAttributes","useArrowNavigationGroup","circular","usingPropsAndMenuContext","console","warn","innerRef","React","useRef","useEffect","element","current","onTabsterMoveFocus","e","nextElement","detail","next","contains","activeElement","preventDefault","addEventListener","TabsterMoveFocusEventName","removeEventListener","setFocusByFirstCharacter","useCallback","itemEl","acceptedRoles","menuItems","el","hasAttribute","indexOf","getAttribute","startIndex","length","firstChars","map","menuItem","textContent","charAt","toLowerCase","char","key","getIndexFirstChars","start","firstChar","i","index","focus","checkedValues","setCheckedValues","useControllableState","state","undefined","defaultState","defaultCheckedValues","initialState","handleCheckedValueChange","onCheckedValueChange","toggleCheckbox","useEventCallback","name","value","checked","checkedItems","newCheckedItems","splice","push","s","selectRadio","components","root","slot","always","getIntrinsicElementProps","useMergedRefs","role","triggerId","elementType","hasIcons","hasCheckmarks","useMenuContext_unstable","context","contextValue","isUsingPropsAndContext","val"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;gCAOhB;8BAMA;qCACyC;sCACZ;6BACI;AAOjC,MAAMA,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EAAEC,gBAAgB,EAAE,GAAGC,IAAAA,6BAAAA;IAC7B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAC3B,MAAMC,cAAcC;IACpB,MAAMC,iBAAiBC,IAAAA,yCAAAA,EAAoBC,wBAAAA;IAC3C,MAAMC,kBAAkBC,IAAAA,qCAAAA,EAAwB;QAAEC,UAAU;IAAK;IAEjE,IAAIC,yBAAyBd,OAAOM,aAAaE,iBAAiB;QAChE,4CAA4C;QAC5C,sCAAsC;QACtCO,QAAQC,IAAI,CAAC;IACf;IAEA,MAAMC,WAAWC,OAAMC,MAAM,CAAc;IAE3CD,OAAME,SAAS,CAAC;QACd,MAAMC,UAAUJ,SAASK,OAAO;QAEhC,IAAId,kBAAkBJ,kBAAkBiB,SAAS;YAC/C,MAAME,qBAAqB,CAACC;gBAC1B,MAAMC,cAAcD,EAAEE,MAAM,CAACC,IAAI;gBAEjC,IAAIF,eAAeJ,QAAQO,QAAQ,CAACxB,eAAeyB,aAAa,KAAK,CAACR,QAAQO,QAAQ,CAACH,cAAc;oBACnG,6EAA6E;oBAC7ED,EAAEM,cAAc;gBAClB;YACF;YAEA1B,eAAe2B,gBAAgB,CAACC,uCAAAA,EAA2BT;YAE3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useMenuListContextValues_unstable(state) {\n const { checkedValues, hasCheckmarks, hasIcons, selectRadio, setFocusByFirstCharacter, toggleCheckbox } = state;\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const menuList = {\n checkedValues,\n hasCheckmarks,\n hasIcons,\n selectRadio,\n setFocusByFirstCharacter,\n toggleCheckbox\n };\n return {\n menuList\n };\n}\n"],"names":["useMenuListContextValues_unstable","state","checkedValues","hasCheckmarks","hasIcons","selectRadio","setFocusByFirstCharacter","toggleCheckbox","menuList"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAAK;IACnD,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAE,GAAGN;IAC1G,mGAAmG;IACnG,MAAMO,WAAW;QACbN;QACAC;QACAC;QACAC;QACAC;QACAC;IACJ;IACA,OAAO;QACHC;IACJ;AACJ"}
1
+ {"version":3,"sources":["useMenuListContextValues.ts"],"sourcesContent":["import type { MenuListContextValues, MenuListState } from './MenuList.types';\n\nexport function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues {\n const { checkedValues, hasCheckmarks, hasIcons, selectRadio, setFocusByFirstCharacter, toggleCheckbox } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const menuList = {\n checkedValues,\n hasCheckmarks,\n hasIcons,\n selectRadio,\n setFocusByFirstCharacter,\n toggleCheckbox,\n };\n\n return { menuList };\n}\n"],"names":["useMenuListContextValues_unstable","state","checkedValues","hasCheckmarks","hasIcons","selectRadio","setFocusByFirstCharacter","toggleCheckbox","menuList"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAAoB;IACpE,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAE,GAAGN;IAE1G,mGAAmG;IACnG,MAAMO,WAAW;QACfN;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAS;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuListStyles.styles.js"],"sourcesContent":["import { mergeClasses, __styles } from '@griffel/react';\nexport const menuListClassNames = {\n root: 'fui-MenuList'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n Beiy3e4: \"f1vx9l62\",\n i8kkvl: 0,\n Belr9w4: 0,\n rmohyg: \"f1t6b6ee\"\n },\n hasMenuContext: {\n Bqenvij: \"f1l02sjl\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f1vx9l62{flex-direction:column;}\", [\".f1t6b6ee{gap:2px;}\", {\n p: -1\n }], \".f1l02sjl{height:100%;}\"]\n});\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuListStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(menuListClassNames.root, styles.root, state.hasMenuContext && styles.hasMenuContext, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuListStyles.styles.js.map"],"names":["menuListClassNames","useMenuListStyles_unstable","root","useStyles","__styles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","rmohyg","hasMenuContext","Bqenvij","d","p","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IAsBAC,0BAA0B;eAA1BA;;;uBAvB0B;AAChC,MAAMD,qBAAqB;IAChCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;IACAC,gBAAgB;QACdC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAA2B;QAAqC;YAAC;YAAuB;gBAC1FC,GAAG,CAAC;YACN;SAAE;QAAE;KAA0B;AAChC;AAIO,MAAMZ,6BAA6Ba,CAAAA;IACxC;IAEA,MAAMC,SAASZ;IACfW,MAAMZ,IAAI,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACjB,mBAAmBE,IAAI,EAAEa,OAAOb,IAAI,EAAEY,MAAMJ,cAAc,IAAIK,OAAOL,cAAc,EAAEI,MAAMZ,IAAI,CAACc,SAAS;IAC7I,OAAOF;AACT,GACA,oDAAoD"}
1
+ {"version":3,"sources":["useMenuListStyles.styles.js"],"sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nexport const menuListClassNames = {\n root: 'fui-MenuList'\n};\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: '2px'\n },\n hasMenuContext: {\n height: '100%'\n }\n});\n/**\n * Apply styling to the Menu slots based on the state\n */ export const useMenuListStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(menuListClassNames.root, styles.root, state.hasMenuContext && styles.hasMenuContext, state.root.className);\n return state;\n};\n"],"names":["menuListClassNames","useMenuListStyles_unstable","root","useStyles","__styles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","rmohyg","hasMenuContext","Bqenvij","d","p","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IAeIC,0BAA0B;eAA1BA;;;uBAhBwB;AAClC,MAAMD,qBAAqB;IAC9BE,MAAM;AACV;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAF,MAAA;QAAAG,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAC,gBAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;KAAA;AAAA;AAYP,MAAMZ,6BAA8Ba,CAAAA;IAC3C;IACA,MAAMC,SAASZ;IACfW,MAAMZ,IAAI,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACjB,mBAAmBE,IAAI,EAAEa,OAAOb,IAAI,EAAEY,MAAMJ,cAAc,IAAIK,OAAOL,cAAc,EAAEI,MAAMZ,IAAI,CAACc,SAAS;IAC7I,OAAOF;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles.styles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus\n */ export const MenuPopover = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuPopover_unstable(props, ref);\n useMenuPopoverStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);\n return renderMenuPopover_unstable(state);\n});\nMenuPopover.displayName = 'MenuPopover';\n"],"names":["MenuPopover","React","forwardRef","props","ref","state","useMenuPopover_unstable","useMenuPopoverStyles_unstable","useCustomStyleHook_unstable","renderMenuPopover_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"}
1
+ {"version":3,"sources":["MenuPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles.styles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport type { MenuPopoverProps } from './MenuPopover.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus\n */\nexport const MenuPopover: ForwardRefComponent<MenuPopoverProps> = React.forwardRef((props, ref) => {\n const state = useMenuPopover_unstable(props, ref);\n\n useMenuPopoverStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);\n\n return renderMenuPopover_unstable(state);\n});\n\nMenuPopover.displayName = 'MenuPopover';\n"],"names":["MenuPopover","React","forwardRef","props","ref","state","useMenuPopover_unstable","useMenuPopoverStyles_unstable","useCustomStyleHook_unstable","renderMenuPopover_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACiB;4CACM;mCACH;qCAGC;AAKrC,MAAMA,cAAAA,WAAAA,GAAqDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBH,OAAOC;IAE7CG,IAAAA,yDAAAA,EAA8BF;IAE9BG,IAAAA,gDAAAA,EAA4B,iCAAiCH;IAE7D,OAAOI,IAAAA,6CAAAA,EAA2BJ;AACpC;AAEAL,YAAYU,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * State used in rendering MenuPopover
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["MenuPopover.types.ts"],"sourcesContent":["import type { PortalProps } from '@fluentui/react-portal';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuPopoverSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * MenuPopover Props\n */\nexport type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;\n\n/**\n * State used in rendering MenuPopover\n */\nexport type MenuPopoverState = ComponentState<MenuPopoverSlots> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n */\n inline: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAYA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuPopover';\nexport * from './MenuPopover.types';\nexport * from './renderMenuPopover';\nexport * from './useMenuPopover';\nexport * from './useMenuPopoverStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuPopover';\nexport * from './MenuPopover.types';\nexport * from './renderMenuPopover';\nexport * from './useMenuPopover';\nexport * from './useMenuPopoverStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuPopover.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\n/**\n * Render the final JSX of MenuPopover\n */ export const renderMenuPopover_unstable = (state)=>{\n assertSlots(state);\n if (state.inline) {\n return /*#__PURE__*/ _jsx(state.root, {});\n }\n return /*#__PURE__*/ _jsx(Portal, {\n mountNode: state.mountNode,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderMenuPopover_unstable","state","assertSlots","inline","_jsx","root","Portal","mountNode","children"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;6BACL;AAGZ,MAAMA,6BAA6B,CAACC;IAC3CC,IAAAA,2BAAW,EAACD;IACZ,IAAIA,MAAME,MAAM,EAAE;QACd,OAAO,WAAW,GAAGC,IAAAA,eAAI,EAACH,MAAMI,IAAI,EAAE,CAAC;IAC3C;IACA,OAAO,WAAW,GAAGD,IAAAA,eAAI,EAACE,mBAAM,EAAE;QAC9BC,WAAWN,MAAMM,SAAS;QAC1BC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACH,MAAMI,IAAI,EAAE,CAAC;IAC9C;AACJ"}
1
+ {"version":3,"sources":["renderMenuPopover.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of MenuPopover\n */\nexport const renderMenuPopover_unstable = (state: MenuPopoverState) => {\n assertSlots<MenuPopoverSlots>(state);\n\n if (state.inline) {\n return <state.root />;\n }\n\n return (\n <Portal mountNode={state.mountNode}>\n <state.root />\n </Portal>\n );\n};\n"],"names":["renderMenuPopover_unstable","state","assertSlots","inline","_jsx","root","Portal","mountNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAC4B;6BAEL;AAKhB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAE9B,IAAIA,MAAME,MAAM,EAAE;QAChB,OAAA,WAAA,GAAOC,IAAAA,eAAA,EAACH,MAAMI,IAAI,EAAA,CAAA;IACpB;IAEA,OAAA,WAAA,GACED,IAAAA,eAAA,EAACE,mBAAAA,EAAAA;QAAOC,WAAWN,MAAMM,SAAS;kBAChC,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMI,IAAI,EAAA,CAAA;;AAGjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot, useTimeout } from '@fluentui/react-utilities';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { dispatchMenuEnterEvent } from '../../utils/index';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useRestoreFocusSource } from '@fluentui/react-tabster';\n/**\n * Create the state required to render MenuPopover.\n *\n * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,\n * before being passed to renderMenuPopover_unstable.\n *\n * @param props - props from this instance of MenuPopover\n * @param ref - reference to root HTMLElement of MenuPopover\n */ export const useMenuPopover_unstable = (props, ref)=>{\n 'use no memo';\n const popoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const isSubmenu = useIsSubmenu();\n const canDispatchCustomEventRef = React.useRef(true);\n const restoreFocusSourceAttributes = useRestoreFocusSource();\n const [setThrottleTimeout, clearThrottleTimeout] = useTimeout();\n const { dir } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\n // use DOM listener since react events propagate up the react tree\n // no need to do `contains` logic as menus are all positioned in different portals\n const mouseOverListenerCallbackRef = React.useCallback((node)=>{\n if (node) {\n // Dispatches the custom menu mouse enter event with throttling\n // Needs to trigger on mouseover to support keyboard + mouse together\n // i.e. keyboard opens submenus while cursor is still on the parent\n node.addEventListener('mouseover', (e)=>{\n if (canDispatchCustomEventRef.current) {\n canDispatchCustomEventRef.current = false;\n dispatchMenuEnterEvent(popoverRef.current, e);\n setThrottleTimeout(()=>canDispatchCustomEventRef.current = true, 250);\n }\n });\n }\n }, [\n popoverRef,\n setThrottleTimeout\n ]);\n React.useEffect(()=>{\n ()=>clearThrottleTimeout();\n }, [\n clearThrottleTimeout\n ]);\n var _useMenuContext_unstable;\n const inline = (_useMenuContext_unstable = useMenuContext_unstable((context)=>context.inline)) !== null && _useMenuContext_unstable !== void 0 ? _useMenuContext_unstable : false;\n const mountNode = useMenuContext_unstable((context)=>context.mountNode);\n const rootProps = slot.always(getIntrinsicElementProps('div', {\n role: 'presentation',\n ...restoreFocusSourceAttributes,\n ...props,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef)\n }), {\n elementType: 'div'\n });\n const { onMouseEnter: onMouseEnterOriginal, onKeyDown: onKeyDownOriginal } = rootProps;\n rootProps.onMouseEnter = useEventCallback((event)=>{\n if (openOnHover || isSubmenu) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuPopoverMouseEnter',\n event\n });\n }\n onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(event);\n });\n rootProps.onKeyDown = useEventCallback((event)=>{\n const key = event.key;\n if (key === Escape || isSubmenu && key === CloseArrowKey) {\n var _popoverRef_current;\n if (open && ((_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.contains(event.target)) && !event.isDefaultPrevented()) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuPopoverKeyDown',\n event\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover, Menu and Tooltip\n event.preventDefault();\n }\n }\n if (key === Tab) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuPopoverKeyDown',\n event\n });\n if (!isSubmenu) {\n var _triggerRef_current;\n (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }\n }\n onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(event);\n });\n return {\n inline,\n mountNode,\n components: {\n root: 'div'\n },\n root: rootProps\n };\n};\n"],"names":["useMenuPopover_unstable","props","ref","popoverRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","openOnHover","triggerRef","isSubmenu","useIsSubmenu","canDispatchCustomEventRef","React","useRef","restoreFocusSourceAttributes","useRestoreFocusSource","setThrottleTimeout","clearThrottleTimeout","useTimeout","dir","useFluent","CloseArrowKey","ArrowLeft","ArrowRight","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","dispatchMenuEnterEvent","useEffect","_useMenuContext_unstable","inline","mountNode","rootProps","slot","always","getIntrinsicElementProps","role","useMergedRefs","elementType","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","useEventCallback","event","keyboard","type","key","Escape","_popoverRef_current","contains","target","isDefaultPrevented","preventDefault","Tab","_triggerRef_current","focus","components","root"],"mappings":";;;;+BAgBiBA;;;eAAAA;;;;iEAhBM;8BAC4B;gCACyC;6BACpD;uBACD;qCACS;8BACnB;8BACS;AAS3B,MAAMA,0BAA0B,CAACC,OAAOC;IAC/C;IACA,MAAMC,aAAaC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQC,cAAc;IAC5E,MAAMC,UAAUH,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQE,OAAO;IAClE,MAAMC,OAAOJ,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQG,IAAI;IAC5D,MAAMC,cAAcL,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQI,WAAW;IAC1E,MAAMC,aAAaN,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQK,UAAU;IACxE,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAMC,4BAA4BC,OAAMC,MAAM,CAAC;IAC/C,MAAMC,+BAA+BC,IAAAA,mCAAqB;IAC1D,MAAM,CAACC,oBAAoBC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AAIxC,eAAeE,WAAW;YAC1BJ,QAAQ0C,OAAO;gBACXzC,MAAM;gBACN0C,UAAU;gBACVC,MAAM;gBACNF;YACJ;QACJ;QACAJ,yBAAyB,QAAQA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBI;IACrG;IACAZ,UAAUS,SAAS,GAAGE,IAAAA,gCAAgB,EAAC,CAACC;QACpC,MAAMG,MAAMH,MAAMG,GAAG;QACrB,IAAIA,QAAQC,oBAAM,IAAI1C,aAAayC,QAAQ7B,eAAe;YACtD,IAAI+B;YACJ,IAAI9C,QAAS,CAAA,AAAC8C,CAAAA,sBAAsBnD,WAAW4B,OAAO,AAAD,MAAO,QAAQuB,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBC,QAAQ,CAACN,MAAMO,MAAM,CAAA,KAAM,CAACP,MAAMQ,kBAAkB,IAAI;gBACtLlD,QAAQ0C,OAAO;oBACXzC,MAAM;oBACN0C,UAAU;oBACVC,MAAM;oBACNF;gBACJ;gBACA,qFAAqF;gBACrF,yCAAyC;gBACzCA,MAAMS,cAAc;YACxB;QACJ;QACA,IAAIN,QAAQO,iBAAG,EAAE;YACbpD,QAAQ0C,OAAO;gBACXzC,MAAM;gBACN0C,UAAU;gBACVC,MAAM;gBACNF;YACJ;YACA,IAAI,CAACtC,WAAW;gBACZ,IAAIiD;gBACHA,CAAAA,sBAAsBlD,WAAWqB,OAAO,AAAD,MAAO,QAAQ6B,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBC,KAAK;YAC9H;QACJ;QACAd,sBAAsB,QAAQA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBE;IAC5F;IACA,OAAO;QACHd;QACAC;QACA0B,YAAY;YACRC,MAAM;QACV;QACAA,MAAM1B;IACV;AACJ"}
1
+ {"version":3,"sources":["useMenuPopover.ts"],"sourcesContent":["import * as React from 'react';\nimport { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys';\nimport { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot, useTimeout } from '@fluentui/react-utilities';\nimport { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { dispatchMenuEnterEvent } from '../../utils/index';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useRestoreFocusSource } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render MenuPopover.\n *\n * The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,\n * before being passed to renderMenuPopover_unstable.\n *\n * @param props - props from this instance of MenuPopover\n * @param ref - reference to root HTMLElement of MenuPopover\n */\nexport const useMenuPopover_unstable = (props: MenuPopoverProps, ref: React.Ref<HTMLElement>): MenuPopoverState => {\n 'use no memo';\n\n const popoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const isSubmenu = useIsSubmenu();\n const canDispatchCustomEventRef = React.useRef(true);\n const restoreFocusSourceAttributes = useRestoreFocusSource();\n const [setThrottleTimeout, clearThrottleTimeout] = useTimeout();\n\n const { dir } = useFluent();\n const CloseArrowKey = dir === 'ltr' ? ArrowLeft : ArrowRight;\n\n // use DOM listener since react events propagate up the react tree\n // no need to do `contains` logic as menus are all positioned in different portals\n const mouseOverListenerCallbackRef = React.useCallback(\n (node: HTMLElement) => {\n if (node) {\n // Dispatches the custom menu mouse enter event with throttling\n // Needs to trigger on mouseover to support keyboard + mouse together\n // i.e. keyboard opens submenus while cursor is still on the parent\n node.addEventListener('mouseover', e => {\n if (canDispatchCustomEventRef.current) {\n canDispatchCustomEventRef.current = false;\n dispatchMenuEnterEvent(popoverRef.current as HTMLElement, e);\n setThrottleTimeout(() => (canDispatchCustomEventRef.current = true), 250);\n }\n });\n }\n },\n [popoverRef, setThrottleTimeout],\n );\n\n React.useEffect(() => {\n () => clearThrottleTimeout();\n }, [clearThrottleTimeout]);\n\n const inline = useMenuContext_unstable(context => context.inline) ?? false;\n const mountNode = useMenuContext_unstable(context => context.mountNode);\n\n const rootProps = slot.always(\n getIntrinsicElementProps('div', {\n role: 'presentation',\n ...restoreFocusSourceAttributes,\n ...props,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, popoverRef, mouseOverListenerCallbackRef) as React.Ref<HTMLDivElement>,\n }),\n { elementType: 'div' },\n );\n const { onMouseEnter: onMouseEnterOriginal, onKeyDown: onKeyDownOriginal } = rootProps;\n rootProps.onMouseEnter = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover || isSubmenu) {\n setOpen(event, { open: true, keyboard: false, type: 'menuPopoverMouseEnter', event });\n }\n onMouseEnterOriginal?.(event);\n });\n rootProps.onKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n const key = event.key;\n if (key === Escape || (isSubmenu && key === CloseArrowKey)) {\n if (open && popoverRef.current?.contains(event.target as HTMLElement) && !event.isDefaultPrevented()) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover, Menu and Tooltip\n event.preventDefault();\n }\n }\n if (key === Tab) {\n setOpen(event, { open: false, keyboard: true, type: 'menuPopoverKeyDown', event });\n if (!isSubmenu) {\n triggerRef.current?.focus();\n }\n }\n onKeyDownOriginal?.(event);\n });\n return { inline, mountNode, components: { root: 'div' }, root: rootProps };\n};\n"],"names":["useMenuPopover_unstable","props","ref","popoverRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","openOnHover","triggerRef","isSubmenu","useIsSubmenu","canDispatchCustomEventRef","React","useRef","restoreFocusSourceAttributes","useRestoreFocusSource","setThrottleTimeout","clearThrottleTimeout","useTimeout","dir","useFluent","CloseArrowKey","ArrowLeft","ArrowRight","mouseOverListenerCallbackRef","useCallback","node","addEventListener","e","current","dispatchMenuEnterEvent","useEffect","inline","mountNode","rootProps","slot","always","getIntrinsicElementProps","role","useMergedRefs","elementType","onMouseEnter","onMouseEnterOriginal","onKeyDown","onKeyDownOriginal","useEventCallback","event","keyboard","type","key","Escape","contains","target","isDefaultPrevented","preventDefault","Tab","focus","components","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBaA;;;eAAAA;;;;iEAnBU;8BAC4B;gCACyC;6BAEpD;uBACD;qCACS;8BACnB;8BACS;AAW/B,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D;IAEA,MAAMC,aAAaC,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQC,cAAc;IAC5E,MAAMC,UAAUH,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQE,OAAO;IAClE,MAAMC,OAAOJ,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQG,IAAI;IAC5D,MAAMC,cAAcL,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQI,WAAW;IAC1E,MAAMC,aAAaN,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQK,UAAU;IACxE,MAAMC,YAAYC,IAAAA,0BAAAA;IAClB,MAAMC,4BAA4BC,OAAMC,MAAM,CAAC;IAC/C,MAAMC,+BAA+BC,IAAAA,mCAAAA;IACrC,MAAM,CAACC,oBAAoBC,qBAAqB,GAAGC,IAAAA,0BAAAA;IAEnD,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAAA,uCAAAA;IAChB,MAAMC,gBAAgBF,QAAQ,QA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AAyBF;YAAM;QACrF;QACAJ,yBAAAA,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAuBI;IACzB;IACAZ,UAAUS,SAAS,GAAGE,IAAAA,gCAAAA,EAAiB,CAACC;QACtC,MAAMG,MAAMH,MAAMG,GAAG;QACrB,IAAIA,QAAQC,oBAAAA,IAAWzC,aAAawC,QAAQ5B,eAAgB;gBAC9CpB;YAAZ,IAAIK,QAAAA,CAAAA,AAAQL,CAAAA,sBAAAA,WAAW4B,OAAO,AAAPA,MAAO,QAAlB5B,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBkD,QAAQ,CAACL,MAAMM,MAAM,CAAA,KAAoB,CAACN,MAAMO,kBAAkB,IAAI;gBACpGhD,QAAQyC,OAAO;oBAAExC,MAAM;oBAAOyC,UAAU;oBAAMC,MAAM;oBAAsBF;gBAAM;gBAChF,qFAAqF;gBACrF,yCAAyC;gBACzCA,MAAMQ,cAAc;YACtB;QACF;QACA,IAAIL,QAAQM,iBAAAA,EAAK;YACflD,QAAQyC,OAAO;gBAAExC,MAAM;gBAAOyC,UAAU;gBAAMC,MAAM;gBAAsBF;YAAM;YAChF,IAAI,CAACrC,WAAW;oBACdD;gBAAAA,CAAAA,sBAAAA,WAAWqB,OAAO,AAAPA,MAAO,QAAlBrB,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBgD,KAAK;YAC3B;QACF;QACAZ,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBE;IACtB;IACA,OAAO;QAAEd;QAAQC;QAAWwB,YAAY;YAAEC,MAAM;QAAM;QAAGA,MAAMxB;IAAU;AAC3E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuPopoverStyles.styles.js"],"sourcesContent":["import { mergeClasses, __styles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { createSlideStyles } from '@fluentui/react-positioning';\nexport const menuPopoverClassNames = {\n root: 'fui-MenuPopover'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n Beyfa6y: 0,\n Bbmb7ep: 0,\n Btl43ni: 0,\n B7oj6ja: 0,\n Dimara: \"ft85np5\",\n De3pzq: \"fxugw4r\",\n sj55zd: \"f19n0e5\",\n B7ck84d: \"f1ewtqcl\",\n Bf4jedk: \"fl8fusi\",\n B2u0y6b: \"f1kaai3v\",\n B68tc82: \"f1p9o1ba\",\n a9b677: \"f1ahpp82\",\n E5pizo: \"f1hg901r\",\n Byoj8tv: 0,\n uwmqm3: 0,\n z189sj: 0,\n z8tnut: 0,\n B0ocmuz: \"fd3pd8h\",\n Bgfg5da: 0,\n B9xav0g: 0,\n oivjwe: 0,\n Bn0qgzm: 0,\n B4g9neb: 0,\n zhjwy3: 0,\n wvpqe5: 0,\n ibv6hh: 0,\n u1mtju: 0,\n h3c5rm: 0,\n vrafjx: 0,\n Bekrc4i: 0,\n i8vvqc: 0,\n g2u3we: 0,\n icvyot: 0,\n B4j52fo: 0,\n irswps: \"f9ggezi\",\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\",\n B93otf3: \"f18k4bn6\",\n vin17d: \"fo1kyvf\",\n Ezkn3b: \"fetxo7e\",\n nyiy2g: \"f8x1vz1\",\n swvrvq: \"f8g0anz\",\n Bkovbt3: \"fezwn9i\",\n hgjdhn: \"fz5efge\",\n fsy9dk: \"f1ydixl4\",\n B3ogreh: \"f8dgqj5\",\n jv49x5: \"fnyfnr8\",\n Bk7o48c: \"fgw77r4\",\n Bv12yb3: \"ftje0s4\",\n z0t1cu: \"fi19xcv\",\n Bks05zx: \"f1mzajhk\",\n Bvtglag: \"fjp4h9y\"\n }\n}, {\n d: [[\".ft85np5{border-radius:var(--borderRadiusMedium);}\", {\n p: -1\n }], \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1ewtqcl{box-sizing:border-box;}\", \".fl8fusi{min-width:138px;}\", \".f1kaai3v{max-width:300px;}\", \".f1p9o1ba{overflow-x:hidden;}\", \".f1ahpp82{width:max-content;}\", \".f1hg901r{box-shadow:var(--shadow16);}\", [\".fd3pd8h{padding:4px;}\", {\n p: -1\n }], [\".f9ggezi{border:1px solid var(--colorTransparentStroke);}\", {\n p: -2\n }], \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\", \".f18k4bn6{animation-composition:accumulate;}\", \".fo1kyvf{animation-duration:var(--durationSlower);}\", \".fetxo7e{animation-timing-function:var(--curveDecelerateMid);}\", \".f8x1vz1{--fui-positioning-slide-distance-x:0px;}\", \".f8g0anz{--fui-positioning-slide-distance-y:10px;}\", \".fezwn9i[data-popper-placement^=right]{--fui-positioning-slide-distance-x:-10px;}\", \".fz5efge[data-popper-placement^=right]{--fui-positioning-slide-distance-y:0px;}\", \".f1ydixl4[data-popper-placement^=bottom]{--fui-positioning-slide-distance-x:0px;}\", \".f8dgqj5[data-popper-placement^=bottom]{--fui-positioning-slide-distance-y:-10px;}\", \".fnyfnr8[data-popper-placement^=left]{--fui-positioning-slide-distance-x:10px;}\", \".fgw77r4[data-popper-placement^=left]{--fui-positioning-slide-distance-y:0px;}\", \".ftje0s4{animation-name:f5j8bii,f79suad;}\"],\n k: [\"@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}\", \"@keyframes f79suad{from{transform:translate(var(--fui-positioning-slide-distance-x), var(--fui-positioning-slide-distance-y));}}\"],\n m: [[\"@media (prefers-reduced-motion){.fi19xcv[data-popper-placement]{animation-duration:1ms;}}\", {\n m: \"(prefers-reduced-motion)\"\n }], [\"@media (prefers-reduced-motion){.f1mzajhk[data-popper-placement]{animation-name:f5j8bii;}}\", {\n m: \"(prefers-reduced-motion)\"\n }]],\n t: [\"@supports not (animation-composition: accumulate){.fjp4h9y[data-popper-placement]{animation-name:f5j8bii;}}\"]\n});\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuPopoverStyles.styles.js.map"],"names":["menuPopoverClassNames","useMenuPopoverStyles_unstable","root","useStyles","__styles","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","De3pzq","sj55zd","B7ck84d","Bf4jedk","B2u0y6b","B68tc82","a9b677","E5pizo","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","B93otf3","vin17d","Ezkn3b","nyiy2g","swvrvq","Bkovbt3","hgjdhn","fsy9dk","B3ogreh","jv49x5","Bk7o48c","Bv12yb3","z0t1cu","Bks05zx","Bvtglag","d","p","k","m","t","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,qBAAqB;eAArBA;;IA+EAC,6BAA6B;eAA7BA;;;uBAlF0B;AAGhC,MAAMD,wBAAwB;IACnCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJG,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,S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{ mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { createSlideStyles } from '@fluentui/react-positioning';\nexport const menuPopoverClassNames = {\n root: 'fui-MenuPopover'\n};\nconst useStyles = makeStyles({\n root: {\n borderRadius: tokens.borderRadiusMedium,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n minWidth: '138px',\n maxWidth: '300px',\n overflowX: 'hidden',\n width: 'max-content',\n boxShadow: `${tokens.shadow16}`,\n padding: '4px',\n border: `1px solid ${tokens.colorTransparentStroke}`,\n ...typographyStyles.body1,\n ...createSlideStyles(10)\n }\n});\n/**\n * Apply styling to the Menu slots based on the state\n */ export const useMenuPopoverStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["menuPopoverClassNames","useMenuPopoverStyles_unstable","root","useStyles","__styles","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","De3pzq","sj55zd","B7ck84d","Bf4jedk","B2u0y6b","B68tc82","a9b677","E5pizo","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","B93otf3","vin17d","Ezkn3b","nyiy2g","swvrvq","Bkovbt3","hgjdhn","fsy9dk","B3ogreh","jv49x5","Bk7o48c","Bv12yb3","z0t1cu","Bks05zx","Bvtglag","d","p","k","m","t","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA;YAAA;SAAA;KAAA;IAAAC,GAAA;QAAA;KAAA;AAAA;AAmBP,MAAM9D,gCAAiC+D,CAAAA;IAC9C;IACA,MAAMC,SAAS9D;IACf6D,MAAM9D,IAAI,CAACgE,SAAS,GAAGC,IAAAA,mBAAY,EAACnE,sBAAsBE,IAAI,EAAE+D,OAAO/D,IAAI,EAAE8D,MAAM9D,IAAI,CAACgE,SAAS;IACjG,OAAOF;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */ export const MenuSplitGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuSplitGroup_unstable(props, ref);\n useMenuSplitGroupStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n return renderMenuSplitGroup_unstable(state);\n});\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"names":["MenuSplitGroup","React","forwardRef","props","ref","state","useMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuSplitGroup_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;mCACoB;sCACG;+CACG;qCACL;AAGjC,MAAMA,iBAAiB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjCG,IAAAA,gDAA2B,EAAC,oCAAoCH;IAChE,OAAOI,IAAAA,mDAA6B,EAACJ;AACzC;AACAL,eAAeU,WAAW,GAAG"}
1
+ {"version":3,"sources":["MenuSplitGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styles';\nimport type { MenuSplitGroupProps } from './MenuSplitGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps> = React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n\n useMenuSplitGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n\n return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"names":["MenuSplitGroup","React","forwardRef","props","ref","state","useMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuSplitGroup_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;mCACoB;sCACG;+CACG;qCAGL;AAKrC,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAEhDG,IAAAA,+DAAAA,EAAiCF;IAEjCG,IAAAA,gDAAAA,EAA4B,oCAAoCH;IAEhE,OAAOI,IAAAA,mDAAAA,EAA8BJ;AACvC;AAEAL,eAAeU,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * State used in rendering MenuSplitGroup
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["MenuSplitGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuSplitGroupSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * MenuSplitGroup Props\n */\nexport type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots>;\n\n/**\n * State used in rendering MenuSplitGroup\n */\nexport type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAWA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuSplitGroup.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of MenuSplitGroup\n */ export const renderMenuSplitGroup_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderMenuSplitGroup_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,gCAAgC,CAACC;IAC9CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
1
+ {"version":3,"sources":["renderMenuSplitGroup.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuSplitGroupState, MenuSplitGroupSlots } from './MenuSplitGroup.types';\n\n/**\n * Render the final JSX of MenuSplitGroup\n */\nexport const renderMenuSplitGroup_unstable = (state: MenuSplitGroupState) => {\n assertSlots<MenuSplitGroupSlots>(state);\n\n return <state.root />;\n};\n"],"names":["renderMenuSplitGroup_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAC4B;AAMrB,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,2BAAAA,EAAiCD;IAEjC,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, getRTLSafeKey, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';\n/**\n * Create the state required to render MenuSplitGroup.\n *\n * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,\n * before being passed to renderMenuSplitGroup_unstable.\n *\n * @param props - props from this instance of MenuSplitGroup\n * @param ref - reference to root HTMLElement of MenuSplitGroup\n */ export const useMenuSplitGroup_unstable = (props, ref)=>{\n const innerRef = React.useRef();\n const { dir, targetDocument } = useFluent();\n const nextArrowKey = getRTLSafeKey(ArrowRight, dir);\n const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n const onKeyDown = React.useCallback((e)=>{\n var _innerRef_current;\n const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n if (!activeElement) {\n return;\n }\n if (!((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement))) {\n return;\n }\n if (e.key === nextArrowKey) {\n const next = findNextFocusable(activeElement, {\n container: innerRef.current\n });\n next === null || next === void 0 ? void 0 : next.focus();\n }\n if (e.key === prevArrowKey) {\n const prev = findPrevFocusable(activeElement, {\n container: innerRef.current\n });\n prev === null || prev === void 0 ? void 0 : prev.focus();\n }\n }, [\n findNextFocusable,\n findPrevFocusable,\n targetDocument,\n nextArrowKey,\n prevArrowKey\n ]);\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n role: 'group',\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, innerRef),\n onKeyDown,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useMenuSplitGroup_unstable","props","ref","innerRef","React","useRef","dir","targetDocument","useFluent","nextArrowKey","getRTLSafeKey","ArrowRight","prevArrowKey","ArrowLeft","findNextFocusable","findPrevFocusable","useFocusFinders","onKeyDown","useCallback","e","_innerRef_current","activeElement","current","contains","key","next","container","focus","prev","components","root","slot","always","getIntrinsicElementProps","role","useMergedRefs","elementType"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACsD;8BAC7C;qCACgB;8BACV;AAS3B,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAMC,WAAWC,OAAMC,MAAM;IA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GhB,KAAK;QACZ,IAAI;YACAmC,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useMenuSplitGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, getRTLSafeKey, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { MenuSplitGroupProps, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render MenuSplitGroup.\n *\n * The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,\n * before being passed to renderMenuSplitGroup_unstable.\n *\n * @param props - props from this instance of MenuSplitGroup\n * @param ref - reference to root HTMLElement of MenuSplitGroup\n */\nexport const useMenuSplitGroup_unstable = (\n props: MenuSplitGroupProps,\n ref: React.Ref<HTMLElement>,\n): MenuSplitGroupState => {\n const innerRef = React.useRef<HTMLElement>();\n const { dir, targetDocument } = useFluent();\n\n const nextArrowKey = getRTLSafeKey(ArrowRight, dir);\n const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);\n\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const onKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n const activeElement = targetDocument?.activeElement;\n if (!activeElement) {\n return;\n }\n\n if (!innerRef.current?.contains(activeElement)) {\n return;\n }\n\n if (e.key === nextArrowKey) {\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n next?.focus();\n }\n\n if (e.key === prevArrowKey) {\n const prev = findPrevFocusable(activeElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n },\n [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey],\n );\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n role: 'group',\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,\n onKeyDown,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["useMenuSplitGroup_unstable","props","ref","innerRef","React","useRef","dir","targetDocument","useFluent","nextArrowKey","getRTLSafeKey","ArrowRight","prevArrowKey","ArrowLeft","findNextFocusable","findPrevFocusable","useFocusFinders","onKeyDown","useCallback","e","activeElement","current","contains","key","next","container","focus","prev","components","root","slot","always","getIntrinsicElementProps","role","useMergedRefs","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;gCACsD;8BAC7C;qCACgB;8BAEV;AAW/B,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,WAAWC,OAAMC,MAAM;IAC7B,MAAM,EAAEC,GAAG,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAEhC,MAAMC,eAAeC,IAAAA,6BAAAA,EAAcC,wBAAAA,EAAYL;IAC/C,MAAMM,eAAeF,IAAAA,6BAAAA,EAAcG,uBAAAA,EAAWP;IAE9C,MAAM,EAAEQ,iBAAiB,EAAEC,iBAAiB,EAAE,GAAGC,IAAAA,6BAAAA;IAEjD,MAAMC,YAAYb,OAAMc,WAAW,CACjC,CAACC;YAMMhB;QALL,MAAMiB,gBAAgBb,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBa,aAAa;QACnD,IAAI,CAACA,eAAe;YAClB;QACF;QAEA,IAAI,CAAA,CAAA,AAACjB,CAAAA,oBAAAA,SAASkB,OAAO,AAAPA,MAAO,QAAhBlB,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAkBmB,QAAQ,CAACF,cAAAA,GAAgB;YAC9C;QACF;QAEA,IAAID,EAAEI,GAAG,KAAKd,cAAc;YAC1B,MAAMe,OAAOV,kBAAkBM,eAA8B;gBAAEK,WAAWtB,SAASkB,OAAO;YAAC;YAC3FG,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAME,KAAK;QACb;QAEA,IAAIP,EAAEI,GAAG,KAAKX,cAAc;YAC1B,MAAMe,OAAOZ,kBAAkBK,eAA8B;gBAAEK,WAAWtB,SAASkB,OAAO;YAAC;YAC3FM,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAMD,KAAK;QACb;IACF,GACA;QAACZ;QAAmBC;QAAmBR;QAAgBE;QAAcG;KAAa;IAGpF,OAAO;QACLgB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9BC,MAAM;YACN,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5F/B,KAAKgC,IAAAA,6BAAAA,EAAchC,KAAKC;YACxBc;YACA,GAAGhB,KAAK;QACV,IACA;YAAEkC,aAAa;QAAM;IAEzB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuSplitGroupStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuSplitGroupClassNames = {\n root: 'fui-MenuSplitGroup'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n oe75ve: \"f1mvlx34\",\n Bu15iap: [\"fsdyxoe\", \"fuk6rhi\"],\n B71tm0z: [\"fn8z6db\", \"f1be8c1t\"],\n Gjs4sj: [\"f1vtn0lh\", \"f8hq2kl\"],\n foni4y: \"f7j48hl\",\n Ie9k5m: \"f13du8c1\",\n f30fub: \"fe64lw1\",\n Jberyy: \"f92oj5h\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f1mvlx34>.fui-MenuItem:nth-of-type(1){flex-grow:1;}\", \".fsdyxoe>.fui-MenuItem:nth-of-type(2){border-top-left-radius:0;}\", \".fuk6rhi>.fui-MenuItem:nth-of-type(2){border-top-right-radius:0;}\", \".fn8z6db>.fui-MenuItem:nth-of-type(2){border-bottom-left-radius:0;}\", \".f1be8c1t>.fui-MenuItem:nth-of-type(2){border-bottom-right-radius:0;}\", \".f1vtn0lh>.fui-MenuItem:nth-of-type(2){padding-left:0;}\", \".f8hq2kl>.fui-MenuItem:nth-of-type(2){padding-right:0;}\", \".f7j48hl>.fui-MenuItem:nth-of-type(2)::before{content:\\\"\\\";}\", \".f13du8c1>.fui-MenuItem:nth-of-type(2)::before{width:var(--strokeWidthThin);}\", \".fe64lw1>.fui-MenuItem:nth-of-type(2)::before{height:20px;}\", \".f92oj5h>.fui-MenuItem:nth-of-type(2)::before{background-color:var(--colorNeutralStroke1);}\"]\n});\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useMenuSplitGroupStyles.styles.js.map"],"names":["menuSplitGroupClassNames","useMenuSplitGroupStyles_unstable","root","useStyles","__styles","mc9l5x","oe75ve","Bu15iap","B71tm0z","Gjs4sj","foni4y","Ie9k5m","f30fub","Jberyy","d","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB;eAAxBA;;IAwBAC,gCAAgC;eAAhCA;;;uBA3B0B;AAGhC,MAAMD,2BAA2B;IACtCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,QAAQ;QACRC,SAAS;YAAC;YAAW;SAAU;QAC/BC,SAAS;YAAC;YAAW;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA2B;QAAwD;QAAoE;QAAqE;QAAuE;QAAyE;QAA2D;QAA2D;QAAgE;QAAiF;QAA+D;KAA8F;AACtxB;AAIO,MAAMb,mCAAmCc,CAAAA;IAC9C;IAEA,MAAMC,SAASb;IACfY,MAAMb,IAAI,CAACe,SAAS,GAAGC,IAAAA,mBAAY,EAAClB,yBAAyBE,IAAI,EAAEc,OAAOd,IAAI,EAAEa,MAAMb,IAAI,CAACe,SAAS;IACpG,OAAOF;AACT,GACA,0DAA0D"}
1
+ {"version":3,"sources":["useMenuSplitGroupStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuSplitGroupClassNames = {\n root: 'fui-MenuSplitGroup'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n [`& > .${menuItemClassNames.root}:nth-of-type(1)`]: {\n flexGrow: 1\n },\n [`& > .${menuItemClassNames.root}:nth-of-type(2)`]: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n paddingLeft: 0,\n '::before': {\n content: '\"\"',\n width: tokens.strokeWidthThin,\n height: '20px',\n backgroundColor: tokens.colorNeutralStroke1\n }\n }\n }\n});\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */ export const useMenuSplitGroupStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["menuSplitGroupClassNames","useMenuSplitGroupStyles_unstable","root","useStyles","__styles","mc9l5x","oe75ve","Bu15iap","B71tm0z","Gjs4sj","foni4y","Ie9k5m","f30fub","Jberyy","d","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,wBAAwB;eAAxBA;;IA0BIC,gCAAgC;eAAhCA;;;uBA7BwB;AAGlC,MAAMD,2BAA2B;IACpCE,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAF,MAAA;QAAAG,QAAA;QAAAC,QAAA;QAAAC,SAAA;YAAA;YAAA;SAAA;QAAAC,SAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAqBX,MAAMb,mCAAoCc,CAAAA;IACjD;IACA,MAAMC,SAASb;IACfY,MAAMb,IAAI,CAACe,SAAS,GAAGC,IAAAA,mBAAY,EAAClB,yBAAyBE,IAAI,EAAEc,OAAOd,IAAI,EAAEa,MAAMb,IAAI,CAACe,SAAS;IACpG,OAAOF;AACX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger';\nimport { renderMenuTrigger_unstable } from './renderMenuTrigger';\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */ export const MenuTrigger = (props)=>{\n const state = useMenuTrigger_unstable(props);\n return renderMenuTrigger_unstable(state);\n};\nMenuTrigger.displayName = 'MenuTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\nMenuTrigger.isFluentTriggerComponent = true;\n"],"names":["MenuTrigger","props","state","useMenuTrigger_unstable","renderMenuTrigger_unstable","displayName","isFluentTriggerComponent"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;gCACiB;mCACG;AAIhC,MAAMA,cAAc,CAACC;IAC5B,MAAMC,QAAQC,IAAAA,uCAAuB,EAACF;IACtC,OAAOG,IAAAA,6CAA0B,EAACF;AACtC;AACAF,YAAYK,WAAW,GAAG;AAC1B,6FAA6F;AAC7FL,YAAYM,wBAAwB,GAAG"}
1
+ {"version":3,"sources":["MenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger';\nimport { renderMenuTrigger_unstable } from './renderMenuTrigger';\nimport type { MenuTriggerProps } from './MenuTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */\nexport const MenuTrigger: React.FC<MenuTriggerProps> = props => {\n const state = useMenuTrigger_unstable(props);\n\n return renderMenuTrigger_unstable(state);\n};\n\nMenuTrigger.displayName = 'MenuTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(MenuTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"names":["MenuTrigger","props","state","useMenuTrigger_unstable","renderMenuTrigger_unstable","displayName","isFluentTriggerComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;gCACiB;mCACG;AAQpC,MAAMA,cAA0CC,CAAAA;IACrD,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBF;IAEtC,OAAOG,IAAAA,6CAAAA,EAA2BF;AACpC;AAEAF,YAAYK,WAAW,GAAG;AAC1B,6FAA6F;AAC5FL,YAAuCM,wBAAwB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuTrigger.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["MenuTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type MenuTriggerProps = TriggerProps<MenuTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu\n */\nexport type MenuTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'menu';\n 'aria-expanded'?: boolean;\n id: string;\n ref: React.Ref<never>;\n /* eslint-disable @nx/workspace-consistent-callback-type -- can't change type of existing callback */\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseMove: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n /* eslint-enable @nx/workspace-consistent-callback-type */\n }\n>;\n\nexport type MenuTriggerState = {\n children: React.ReactElement | null;\n isSubmenu: boolean;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAEuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"names":[],"rangeMappings":";;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderMenuTrigger_unstable = (state)=>{\n return /*#__PURE__*/ React.createElement(MenuTriggerContextProvider, {\n value: state.isSubmenu\n }, state.children);\n};\n"],"names":["renderMenuTrigger_unstable","state","React","createElement","MenuTriggerContextProvider","value","isSubmenu","children"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;oCACoB;AAKhC,MAAMA,6BAA6B,CAACC;IAC3C,OAAO,WAAW,GAAGC,OAAMC,aAAa,CAACC,8CAA0B,EAAE;QACjEC,OAAOJ,MAAMK,SAAS;IAC1B,GAAGL,MAAMM,QAAQ;AACrB"}
1
+ {"version":3,"sources":["renderMenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\nimport type { MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderMenuTrigger_unstable = (state: MenuTriggerState) => {\n return <MenuTriggerContextProvider value={state.isSubmenu}>{state.children}</MenuTriggerContextProvider>;\n};\n"],"names":["renderMenuTrigger_unstable","state","React","createElement","MenuTriggerContextProvider","value","isSubmenu","children"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;oCACoB;AAQpC,MAAMA,6BAA6B,CAACC;IACzC,OAAA,WAAA,GAAOC,OAAAC,aAAA,CAACC,8CAAAA,EAAAA;QAA2BC,OAAOJ,MAAMK,SAAS;OAAGL,MAAMM,QAAQ;AAC5E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { applyTriggerPropsToChildren, getTriggerChild, isHTMLElement, mergeCallbacks, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */ export const useMenuTrigger_unstable = (props)=>{\n const { children, disableButtonEnhancement = false } = props;\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const openOnContext = useMenuContext_unstable((context)=>context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [\n findFirstFocusable,\n menuPopoverRef\n ]);\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n const child = getTriggerChild(children);\n const onContextMenu = (event)=>{\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerContextMenu',\n event\n });\n }\n };\n const onClick = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (!openOnContext) {\n setOpen(event, {\n open: !open,\n keyboard: openedWithKeyboardRef.current,\n type: 'menuTriggerClick',\n event\n });\n openedWithKeyboardRef.current = false;\n }\n };\n const onKeyDown = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n const key = event.key;\n if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {\n setOpen(event, {\n open: true,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n if (key === Escape && !isSubmenu) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n const onMouseEnter = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseEnter',\n event\n });\n }\n };\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseMove',\n event\n });\n hasMouseMoved.current = true;\n }\n };\n const onMouseLeave = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, {\n open: false,\n keyboard: false,\n type: 'menuTriggerMouseLeave',\n event\n });\n }\n };\n const contextMenuProps = {\n id: triggerId,\n ...restoreFocusTargetAttribute,\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))\n };\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\nconst isTargetDisabled = (event)=>{\n const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target","currentTarget"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;6BACiB;8BACX;8BAC0B;qCACP;8BACS;gCACoE;2BAC1F;AAMxB,MAAMA,0BAA0B,CAACC;IACxC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAMG,aAAaC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQF,UAAU;IACxE,MAAMG,iBAAiBF,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQC,cAAc;IAChF,MAAMC,UAAUH,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQE,OAAO;IAClE,MAAMC,OAAOJ,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQG,IAAI;IAC5D,MAAMC,YAAYL,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQI,SAAS;IACtE,MAAMC,cAAcN,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQK,WAAW;IAC1E,MAAMC,gBAAgBP,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQM,aAAa;IAC9E,MAAMC,8BAA8BC,IAAAA,mCAAqB;IACzD,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,IAAAA,6BAAe;IAC9C,MAAMC,aAAaC,OAAMC,WAAW,CAAC;QACjC,MAAMC,iBAAiBL,mBAAmBV,eAAegB,OAAO;QAChED,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeE,KAAK;IACxF,GAAG;QACCP;QACAV;KACH;IACD,MAAMkB,wBAAwBL,OAAMM,MAAM,CAAC;IAC3C,MAAMC,gBAAgBP,OAAMM,MAAM,CAAC;IACnC,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,uCAAS;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from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n isHTMLElement,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n\n const isSubmenu = useIsSubmenu();\n\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = getTriggerChild(children);\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n const key = event.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n\n const onMouseEnter = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n }\n };\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMoved.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...restoreFocusTargetAttribute,\n ...child?.props,\n ref: useMergedRefs(triggerRef, child?.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (event: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target","currentTarget"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;6BAEiB;8BACX;8BAC0B;qCACP;8BACS;gCAQlD;2BAC4B;AAQ5B,MAAMA,0BAA0B,CAACC;IACtC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IAEvD,MAAMG,aAAaC,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQF,UAAU;IACxE,MAAMG,iBAAiBF,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQC,cAAc;IAChF,MAAMC,UAAUH,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQE,OAAO;IAClE,MAAMC,OAAOJ,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQG,IAAI;IAC5D,MAAMC,YAAYL,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQI,SAAS;IACtE,MAAMC,cAAcN,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQK,WAAW;IAC1E,MAAMC,gBAAgBP,IAAAA,oCAAAA,EAAwBC,CAAAA,U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A,IAAAA,MAAOQ,IAAI,AAAJA,MAAS,MAAMR,MAAMQ,IAAI,GAAG,OAC/De;IAGF,OAAO;QACLzC;QACAb,UAAU0D,IAAAA,2CAAAA,EACR1D,UACAU,gBAAgBsC,mBAAmB/C,2BAA2BqD,oBAAoBE;IAEtF;AACF;AAEA,MAAMrB,mBAAmB,CAACD;IACxB,MAAMyB,aAAa,CAACC,KAClBA,GAAGC,YAAY,CAAC,eAAgBD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IAC3G,IAAIC,IAAAA,6BAAAA,EAAc7B,MAAM8B,MAAM,KAAKL,WAAWzB,MAAM8B,MAAM,GAAG;QAC3D,OAAO;IACT;IAEA,OAAOD,IAAAA,6BAAAA,EAAc7B,MAAM+B,aAAa,KAAKN,WAAWzB,MAAM+B,aAAa;AAC7E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}