@fluentui/react-menu 9.14.18 → 9.14.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/CHANGELOG.md +22 -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/MenuDivider/useMenuDividerStyles.styles.js +1 -2
  27. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  28. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  29. package/lib/components/MenuGroup/index.js.map +1 -1
  30. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  31. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  32. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  33. package/lib/components/MenuGroup/useMenuGroupStyles.styles.js +1 -2
  34. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  35. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  36. package/lib/components/MenuGroupHeader/index.js.map +1 -1
  37. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  38. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  39. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js +1 -2
  40. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  41. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  42. package/lib/components/MenuItem/index.js.map +1 -1
  43. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  44. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  45. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  46. package/lib/components/MenuItem/useMenuItemStyles.styles.js +2 -3
  47. package/lib/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  48. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  49. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  50. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  51. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  52. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  53. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js +1 -2
  54. package/lib/components/MenuItemLink/MenuItemLink.js.map +1 -1
  55. package/lib/components/MenuItemLink/MenuItemLink.types.js.map +1 -1
  56. package/lib/components/MenuItemLink/index.js.map +1 -1
  57. package/lib/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  58. package/lib/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  59. package/lib/components/MenuItemLink/useMenuItemLinkStyles.styles.js +1 -2
  60. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  61. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  62. package/lib/components/MenuItemRadio/index.js.map +1 -1
  63. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  64. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  65. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.js +1 -2
  66. package/lib/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -1
  67. package/lib/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -1
  68. package/lib/components/MenuItemSwitch/index.js.map +1 -1
  69. package/lib/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -1
  70. package/lib/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -1
  71. package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +1 -2
  72. package/lib/components/MenuList/MenuList.js.map +1 -1
  73. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  74. package/lib/components/MenuList/index.js.map +1 -1
  75. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  76. package/lib/components/MenuList/useMenuList.js.map +1 -1
  77. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  78. package/lib/components/MenuList/useMenuListStyles.styles.js +1 -2
  79. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  80. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  81. package/lib/components/MenuPopover/index.js.map +1 -1
  82. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  83. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  84. package/lib/components/MenuPopover/useMenuPopoverStyles.styles.js +1 -2
  85. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  86. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  87. package/lib/components/MenuSplitGroup/index.js.map +1 -1
  88. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  89. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  90. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js +1 -2
  91. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  92. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  93. package/lib/components/MenuTrigger/index.js.map +1 -1
  94. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  95. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  96. package/lib/components/index.js.map +1 -1
  97. package/lib/contexts/menuContext.js.map +1 -1
  98. package/lib/contexts/menuGroupContext.js.map +1 -1
  99. package/lib/contexts/menuListContext.js.map +1 -1
  100. package/lib/contexts/menuTriggerContext.js.map +1 -1
  101. package/lib/index.js.map +1 -1
  102. package/lib/selectable/index.js.map +1 -1
  103. package/lib/selectable/types.js.map +1 -1
  104. package/lib/selectable/useCheckmarkStyles.styles.js +6 -5
  105. package/lib/selectable/useCheckmarkStyles.styles.js.map +1 -1
  106. package/lib/utils/index.js.map +1 -1
  107. package/lib/utils/useIsSubmenu.js.map +1 -1
  108. package/lib/utils/useOnMenuEnter.js.map +1 -1
  109. package/lib-commonjs/Menu.js.map +1 -1
  110. package/lib-commonjs/MenuDivider.js.map +1 -1
  111. package/lib-commonjs/MenuGroup.js.map +1 -1
  112. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  113. package/lib-commonjs/MenuItem.js.map +1 -1
  114. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  115. package/lib-commonjs/MenuItemLink.js.map +1 -1
  116. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  117. package/lib-commonjs/MenuItemSwitch.js.map +1 -1
  118. package/lib-commonjs/MenuList.js.map +1 -1
  119. package/lib-commonjs/MenuPopover.js.map +1 -1
  120. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  121. package/lib-commonjs/MenuTrigger.js.map +1 -1
  122. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  123. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  124. package/lib-commonjs/components/Menu/index.js.map +1 -1
  125. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  126. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  127. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  128. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  129. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  130. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  131. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  132. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  133. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js +1 -1
  134. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  135. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  136. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  137. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  138. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  139. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  140. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js +1 -1
  141. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  142. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  143. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  144. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  145. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  146. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js +1 -1
  147. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  148. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  149. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  150. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  151. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  152. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  153. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js +3 -3
  154. package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
  155. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  156. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  157. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  158. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  159. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  160. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js +1 -1
  161. package/lib-commonjs/components/MenuItemLink/MenuItemLink.js.map +1 -1
  162. package/lib-commonjs/components/MenuItemLink/MenuItemLink.types.js.map +1 -1
  163. package/lib-commonjs/components/MenuItemLink/index.js.map +1 -1
  164. package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
  165. package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js.map +1 -1
  166. package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js +1 -1
  167. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  168. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  169. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  170. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  171. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  172. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js +1 -1
  173. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -1
  174. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -1
  175. package/lib-commonjs/components/MenuItemSwitch/index.js.map +1 -1
  176. package/lib-commonjs/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -1
  177. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -1
  178. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +1 -1
  179. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  180. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  181. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  182. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  183. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  184. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  185. package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js +1 -1
  186. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  187. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  188. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  189. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  190. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  191. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js +1 -1
  192. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  193. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  194. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  195. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  196. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  197. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js +1 -1
  198. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  199. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  200. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  201. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  202. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  203. package/lib-commonjs/components/index.js.map +1 -1
  204. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  205. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  206. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  207. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  208. package/lib-commonjs/index.js.map +1 -1
  209. package/lib-commonjs/selectable/index.js.map +1 -1
  210. package/lib-commonjs/selectable/types.js.map +1 -1
  211. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js +6 -3
  212. package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -1
  213. package/lib-commonjs/utils/index.js.map +1 -1
  214. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  215. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  216. package/package.json +12 -28
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuItemSwitch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { MenuItemSlots } from '../MenuItem/MenuItem.types';\nimport { MenuItemSelectableState } from '../../selectable/types';\nimport { MenuItemCheckboxProps } from '../MenuItemCheckbox/MenuItemCheckbox.types';\n\nexport type MenuItemSwitchSlots = Pick<MenuItemSlots, 'root' | 'content' | 'secondaryContent' | 'icon'> & {\n switchIndicator?: Slot<'span'>;\n};\n\n/**\n * MenuItemSwitch Props\n */\nexport type MenuItemSwitchProps = ComponentProps<MenuItemSwitchSlots> &\n Pick<MenuItemCheckboxProps, 'disabled' | 'persistOnClick' | 'name' | 'value'>;\n\n/**\n * State used in rendering MenuItemSwitch\n */\nexport type MenuItemSwitchState = ComponentState<MenuItemSwitchSlots> &\n MenuItemSelectableState &\n Required<Pick<MenuItemSwitchProps, 'disabled'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAeA;;CAEC"}
1
+ {"version":3,"sources":["../src/components/MenuItemSwitch/MenuItemSwitch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { MenuItemSlots } from '../MenuItem/MenuItem.types';\nimport { MenuItemSelectableState } from '../../selectable/types';\nimport { MenuItemCheckboxProps } from '../MenuItemCheckbox/MenuItemCheckbox.types';\n\nexport type MenuItemSwitchSlots = Pick<MenuItemSlots, 'root' | 'content' | 'secondaryContent' | 'icon'> & {\n switchIndicator?: Slot<'span'>;\n};\n\n/**\n * MenuItemSwitch Props\n */\nexport type MenuItemSwitchProps = ComponentProps<MenuItemSwitchSlots> &\n Pick<MenuItemCheckboxProps, 'disabled' | 'persistOnClick' | 'name' | 'value'>;\n\n/**\n * State used in rendering MenuItemSwitch\n */\nexport type MenuItemSwitchState = ComponentState<MenuItemSwitchSlots> &\n MenuItemSelectableState &\n Required<Pick<MenuItemSwitchProps, 'disabled'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAeA;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuItemSwitch';\nexport * from './MenuItemSwitch.types';\nexport * from './renderMenuItemSwitch';\nexport * from './useMenuItemSwitch';\nexport * from './useMenuItemSwitchStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["../src/components/MenuItemSwitch/index.ts"],"sourcesContent":["export * from './MenuItemSwitch';\nexport * from './MenuItemSwitch.types';\nexport * from './renderMenuItemSwitch';\nexport * from './useMenuItemSwitch';\nexport * from './useMenuItemSwitchStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderMenuItemSwitch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItemSwitch_unstable = (state: MenuItemSwitchState) => {\n assertSlots<MenuItemSwitchSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.content && <state.content />}\n {state.secondaryContent && <state.secondaryContent />}\n {state.switchIndicator && <state.switchIndicator />}\n </state.root>\n );\n};\n"],"names":["renderMenuItemSwitch_unstable","state","assertSlots","_jsxs","root","icon","_jsx","content","secondaryContent","switchIndicator"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAC4B;AAMrB,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,2BAAAA,EAAiCD;IAEjC,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,IAAI,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,IAAI,EAAA,CAAA;YACzBJ,MAAMM,OAAO,IAAA,WAAA,GAAID,IAAAA,eAAA,EAACL,MAAMM,OAAO,EAAA,CAAA;YAC/BN,MAAMO,gBAAgB,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACL,MAAMO,gBAAgB,EAAA,CAAA;YACjDP,MAAMQ,eAAe,IAAA,WAAA,GAAIH,IAAAA,eAAA,EAACL,MAAMQ,eAAe,EAAA,CAAA;;;AAGtD"}
1
+ {"version":3,"sources":["../src/components/MenuItemSwitch/renderMenuItemSwitch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItemSwitch_unstable = (state: MenuItemSwitchState) => {\n assertSlots<MenuItemSwitchSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.content && <state.content />}\n {state.secondaryContent && <state.secondaryContent />}\n {state.switchIndicator && <state.switchIndicator />}\n </state.root>\n );\n};\n"],"names":["renderMenuItemSwitch_unstable","state","assertSlots","_jsxs","root","icon","_jsx","content","secondaryContent","switchIndicator"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAC4B;AAMrB,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,2BAAAA,EAAiCD;IAEjC,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,IAAI,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,IAAI,EAAA,CAAA;YACzBJ,MAAMM,OAAO,IAAA,WAAA,GAAID,IAAAA,eAAA,EAACL,MAAMM,OAAO,EAAA,CAAA;YAC/BN,MAAMO,gBAAgB,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACL,MAAMO,gBAAgB,EAAA,CAAA;YACjDP,MAAMQ,eAAe,IAAA,WAAA,GAAIH,IAAAA,eAAA,EAACL,MAAMQ,eAAe,EAAA,CAAA;;;AAGtD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useMenuItemSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchProps, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemCheckbox_unstable } from '../MenuItemCheckbox/useMenuItemCheckbox';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { circleFilledClassName } from './useMenuItemSwitchStyles.styles';\n\n/**\n * Create the state required to render MenuItemSwitch.\n *\n * The returned state can be modified with hooks such as useMenuItemSwitchStyles_unstable,\n * before being passed to renderMenuItemSwitch_unstable.\n *\n * @param props - props from this instance of MenuItemSwitch\n * @param ref - reference to root HTMLDivElement of MenuItemSwitch\n */\nexport const useMenuItemSwitch_unstable = (\n props: MenuItemSwitchProps,\n ref: React.Ref<HTMLDivElement>,\n): MenuItemSwitchState => {\n const baseState = useMenuItemCheckbox_unstable(props, ref);\n return {\n ...baseState,\n switchIndicator: slot.optional(props.switchIndicator, {\n renderByDefault: true,\n elementType: 'span',\n defaultProps: {\n children: <CircleFilled className={circleFilledClassName} />,\n },\n }),\n components: {\n ...baseState.components,\n switchIndicator: 'span',\n },\n };\n};\n"],"names":["useMenuItemSwitch_unstable","props","ref","baseState","useMenuItemCheckbox_unstable","switchIndicator","slot","optional","renderByDefault","elementType","defaultProps","children","React","createElement","CircleFilled","className","circleFilledClassName","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;gCACF;qCAEwB;4BAChB;+CACS;AAW/B,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,YAAYC,IAAAA,iDAAAA,EAA6BH,OAAOC;IACtD,OAAO;QACL,GAAGC,SAAS;QACZE,iBAAiBC,oBAAAA,CAAKC,QAAQ,CAACN,MAAMI,eAAe,EAAE;YACpDG,iBAAiB;YACjBC,aAAa;YACbC,cAAc;gBACZC,UAAAA,WAAAA,GAAUC,OAAAC,aAAA,CAACC,wBAAAA,EAAAA;oBAAaC,WAAWC,oDAAAA;;YACrC;QACF;QACAC,YAAY;YACV,GAAGd,UAAUc,UAAU;YACvBZ,iBAAiB;QACnB;IACF;AACF"}
1
+ {"version":3,"sources":["../src/components/MenuItemSwitch/useMenuItemSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchProps, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemCheckbox_unstable } from '../MenuItemCheckbox/useMenuItemCheckbox';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { circleFilledClassName } from './useMenuItemSwitchStyles.styles';\n\n/**\n * Create the state required to render MenuItemSwitch.\n *\n * The returned state can be modified with hooks such as useMenuItemSwitchStyles_unstable,\n * before being passed to renderMenuItemSwitch_unstable.\n *\n * @param props - props from this instance of MenuItemSwitch\n * @param ref - reference to root HTMLDivElement of MenuItemSwitch\n */\nexport const useMenuItemSwitch_unstable = (\n props: MenuItemSwitchProps,\n ref: React.Ref<HTMLDivElement>,\n): MenuItemSwitchState => {\n const baseState = useMenuItemCheckbox_unstable(props, ref);\n return {\n ...baseState,\n switchIndicator: slot.optional(props.switchIndicator, {\n renderByDefault: true,\n elementType: 'span',\n defaultProps: {\n children: <CircleFilled className={circleFilledClassName} />,\n },\n }),\n components: {\n ...baseState.components,\n switchIndicator: 'span',\n },\n };\n};\n"],"names":["useMenuItemSwitch_unstable","props","ref","baseState","useMenuItemCheckbox_unstable","switchIndicator","slot","optional","renderByDefault","elementType","defaultProps","children","React","createElement","CircleFilled","className","circleFilledClassName","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;gCACF;qCAEwB;4BAChB;+CACS;AAW/B,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,YAAYC,IAAAA,iDAAAA,EAA6BH,OAAOC;IACtD,OAAO;QACL,GAAGC,SAAS;QACZE,iBAAiBC,oBAAAA,CAAKC,QAAQ,CAACN,MAAMI,eAAe,EAAE;YACpDG,iBAAiB;YACjBC,aAAa;YACbC,cAAc;gBACZC,UAAAA,WAAAA,GAAUC,OAAAC,aAAA,CAACC,wBAAAA,EAAAA;oBAAaC,WAAWC,oDAAAA;;YACrC;QACF;QACAC,YAAY;YACV,GAAGd,UAAUc,UAAU;YACvBZ,iBAAiB;QACnB;IACF;AACF"}
@@ -152,4 +152,4 @@ const useMenuItemSwitchStyles_unstable = (state)=>{
152
152
  persistOnClick: true
153
153
  });
154
154
  return state;
155
- }; //# sourceMappingURL=useMenuItemSwitchStyles.styles.js.map
155
+ };
@@ -1 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuList/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.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
+ {"version":3,"sources":["../src/components/MenuList/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.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
+ {"version":3,"sources":["../src/components/MenuList/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.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
+ {"version":3,"sources":["../src/components/MenuList/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.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,CAAC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AyB;QAC3B;IACF;IAEA,OAAOtF,kBAAkBsF;AAC3B"}
1
+ {"version":3,"sources":["../src/components/MenuList/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;IAE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;IACpE,MAAMC,gBAAgBC,IAAAA,oCAAAA,EAAwBC,CAAAA,UAAWA,QAAQF,aAAa;IAE9E,OAAO;QACL/B;QACAS;QACAmB;QACAE;QACAC;IACF;AACF;AAEA;;CAEC,GACD,MAAM5E,2BAA2B,CAC/Bd,OACA6F,cACArF;IAEA,IAAIsF,yBAAyB;IAC7B,IAAK,MAAMC,OAAOF,aAAc;QAC9B,IAAI7F,KAAK,CAAC+F,IAAgG,EAAE;YAC1GD,yBAAyB;QAC3B;IACF;IAEA,OAAOtF,kBAAkBsF;AAC3B"}
@@ -1 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuList/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"}
@@ -49,4 +49,4 @@ const useMenuListStyles_unstable = (state)=>{
49
49
  const styles = useStyles();
50
50
  state.root.className = (0, _react.mergeClasses)(menuListClassNames.root, styles.root, state.hasMenuContext && styles.hasMenuContext, state.root.className);
51
51
  return state;
52
- }; //# sourceMappingURL=useMenuListStyles.styles.js.map
52
+ };
@@ -1 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuPopover/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 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuPopover/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.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
+ {"version":3,"sources":["../src/components/MenuPopover/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.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
+ {"version":3,"sources":["../src/components/MenuPopover/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.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,QAAQG,uBAAAA,GAA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F;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
+ {"version":3,"sources":["../src/components/MenuPopover/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,QAAQG,uBAAAA,GAAYC,wBAAAA;IAElD,kEAAkE;IAClE,kFAAkF;IAClF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A,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"}
@@ -149,4 +149,4 @@ const useMenuPopoverStyles_unstable = (state)=>{
149
149
  const styles = useStyles();
150
150
  state.root.className = (0, _react.mergeClasses)(menuPopoverClassNames.root, styles.root, state.root.className);
151
151
  return state;
152
- }; //# sourceMappingURL=useMenuPopoverStyles.styles.js.map
152
+ };
@@ -1 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuSplitGroup/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 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuSplitGroup/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.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
+ {"version":3,"sources":["../src/components/MenuSplitGroup/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.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
+ {"version":3,"sources":["../src/components/MenuSplitGroup/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.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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VC,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
+ {"version":3,"sources":["../src/components/MenuSplitGroup/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"}
@@ -64,4 +64,4 @@ const useMenuSplitGroupStyles_unstable = (state)=>{
64
64
  const styles = useStyles();
65
65
  state.root.className = (0, _react.mergeClasses)(menuSplitGroupClassNames.root, styles.root, state.root.className);
66
66
  return state;
67
- }; //# sourceMappingURL=useMenuSplitGroupStyles.styles.js.map
67
+ };
@@ -1 +1 @@
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
+ {"version":3,"sources":["../src/components/MenuTrigger/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.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
+ {"version":3,"sources":["../src/components/MenuTrigger/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.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"names":[],"rangeMappings":";;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["../src/components/MenuTrigger/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.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
+ {"version":3,"sources":["../src/components/MenuTrigger/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.ts"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders } 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\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 ...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","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;8BACG;qCACgB;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,gBAAg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,MAAS,MAAMR,MAAMQ,IAAI,GAAG,OAC/De;IAGF,OAAO;QACLzC;QACAX,UAAUwD,IAAAA,2CAAAA,EACRxD,UACAU,gBAAgBoC,mBAAmB7C,2BAA2BmD,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
+ {"version":3,"sources":["../src/components/MenuTrigger/useMenuTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders } 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\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 ...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","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;8BACG;qCACgB;8BACS;gCAQlD;2BAC4B;AAQ5B,MAAMA,0BAA0B,CAACC;IACtC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAG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AetB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAO9B,KAAK,CAACuC,OAAO,EAAEA;QAC/DC,WAAWW,IAAAA,gCAAAA,EAAiBC,IAAAA,8BAAAA,EAAetB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAO9B,KAAK,CAACwC,SAAS,EAAEA;IACrE;IAEA,MAAMe,8BAA8BC,IAAAA,6BAAAA,EAClC1B,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAJA,MAAS,YAAYR,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAJA,MAAS,MAAMR,MAAMQ,IAAI,GAAG,OAC/De;IAGF,OAAO;QACLzC;QACAX,UAAUwD,IAAAA,2CAAAA,EACRxD,UACAU,gBAAgBoC,mBAAmB7C,2BAA2BmD,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.ts"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
1
+ {"version":3,"sources":["../src/components/index.ts"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["menuContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { MenuState } from '../components/Menu/index';\n\nexport const MenuContext: Context<MenuContextValue> = createContext<MenuContextValue | undefined>(\n undefined,\n) as Context<MenuContextValue>;\n\nconst menuContextDefaultValue: MenuContextValue = {\n open: false,\n setOpen: () => false,\n checkedValues: {},\n onCheckedValueChange: () => null,\n isSubmenu: false,\n triggerRef: { current: null } as unknown as React.MutableRefObject<HTMLElement>,\n menuPopoverRef: { current: null } as unknown as React.MutableRefObject<HTMLElement>,\n mountNode: null,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n inline: false,\n persistOnItemClick: false,\n};\n\n/**\n * Context shared between Menu and its children components\n *\n * Extends and drills down MenuList props to simplify API\n */\nexport type MenuContextValue = Pick<\n MenuState,\n | 'openOnHover'\n | 'openOnContext'\n | 'triggerRef'\n | 'menuPopoverRef'\n | 'setOpen'\n | 'isSubmenu'\n | 'mountNode'\n | 'triggerId'\n | 'hasIcons'\n | 'hasCheckmarks'\n | 'persistOnItemClick'\n | 'inline'\n | 'checkedValues'\n | 'onCheckedValueChange'\n> & {\n open: boolean;\n triggerId: string;\n /**\n * Default values to be checked on mount\n * @deprecated this property is not used internally anymore,\n * the signature remains just to avoid breaking changes\n */\n defaultCheckedValues?: Record<string, string[]>;\n};\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext_unstable = <T>(selector: ContextSelector<MenuContextValue, T>) =>\n useContextSelector(MenuContext, (ctx = menuContextDefaultValue) => selector(ctx));\n"],"names":["MenuContext","MenuProvider","useMenuContext_unstable","createContext","undefined","menuContextDefaultValue","open","setOpen","checkedValues","onCheckedValueChange","isSubmenu","triggerRef","current","menuPopoverRef","mountNode","triggerId","openOnContext","openOnHover","hasIcons","hasCheckmarks","inline","persistOnItemClick","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,WAAAA;eAAAA;;IAsDAC,YAAAA;eAAAA;;IAEAC,uBAAAA;eAAAA;;;;iEA7DU;sCAC2B;AAI3C,MAAMF,cAAyCG,IAAAA,mCAAAA,EACpDC;AAGF,MAAMC,0BAA4C;IAChDC,MAAM;IACNC,SAAS,IAAM;IACfC,eAAe,CAAC;IAChBC,sBAAsB,IAAM;IAC5BC,WAAW;IACXC,YAAY;QAAEC,SAAS;IAAK;IAC5BC,gBAAgB;QAAED,SAAS;IAAK;IAChCE,WAAW;IACXC,WAAW;IACXC,eAAe;IACfC,aAAa;IACbC,UAAU;IACVC,eAAe;IACfC,QAAQ;IACRC,oBAAoB;AACtB;AAkCO,MAAMpB,eAAeD,YAAYsB,QAAQ;AAEzC,MAAMpB,0BAA0B,CAAIqB,WACzCC,IAAAA,wCAAAA,EAAmBxB,aAAa,CAACyB,MAAMpB,uBAAuB,GAAKkB,SAASE"}
1
+ {"version":3,"sources":["../src/contexts/menuContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { MenuState } from '../components/Menu/index';\n\nexport const MenuContext: Context<MenuContextValue> = createContext<MenuContextValue | undefined>(\n undefined,\n) as Context<MenuContextValue>;\n\nconst menuContextDefaultValue: MenuContextValue = {\n open: false,\n setOpen: () => false,\n checkedValues: {},\n onCheckedValueChange: () => null,\n isSubmenu: false,\n triggerRef: { current: null } as unknown as React.MutableRefObject<HTMLElement>,\n menuPopoverRef: { current: null } as unknown as React.MutableRefObject<HTMLElement>,\n mountNode: null,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n inline: false,\n persistOnItemClick: false,\n};\n\n/**\n * Context shared between Menu and its children components\n *\n * Extends and drills down MenuList props to simplify API\n */\nexport type MenuContextValue = Pick<\n MenuState,\n | 'openOnHover'\n | 'openOnContext'\n | 'triggerRef'\n | 'menuPopoverRef'\n | 'setOpen'\n | 'isSubmenu'\n | 'mountNode'\n | 'triggerId'\n | 'hasIcons'\n | 'hasCheckmarks'\n | 'persistOnItemClick'\n | 'inline'\n | 'checkedValues'\n | 'onCheckedValueChange'\n> & {\n open: boolean;\n triggerId: string;\n /**\n * Default values to be checked on mount\n * @deprecated this property is not used internally anymore,\n * the signature remains just to avoid breaking changes\n */\n defaultCheckedValues?: Record<string, string[]>;\n};\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext_unstable = <T>(selector: ContextSelector<MenuContextValue, T>) =>\n useContextSelector(MenuContext, (ctx = menuContextDefaultValue) => selector(ctx));\n"],"names":["MenuContext","MenuProvider","useMenuContext_unstable","createContext","undefined","menuContextDefaultValue","open","setOpen","checkedValues","onCheckedValueChange","isSubmenu","triggerRef","current","menuPopoverRef","mountNode","triggerId","openOnContext","openOnHover","hasIcons","hasCheckmarks","inline","persistOnItemClick","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,WAAAA;eAAAA;;IAsDAC,YAAAA;eAAAA;;IAEAC,uBAAAA;eAAAA;;;;iEA7DU;sCAC2B;AAI3C,MAAMF,cAAyCG,IAAAA,mCAAAA,EACpDC;AAGF,MAAMC,0BAA4C;IAChDC,MAAM;IACNC,SAAS,IAAM;IACfC,eAAe,CAAC;IAChBC,sBAAsB,IAAM;IAC5BC,WAAW;IACXC,YAAY;QAAEC,SAAS;IAAK;IAC5BC,gBAAgB;QAAED,SAAS;IAAK;IAChCE,WAAW;IACXC,WAAW;IACXC,eAAe;IACfC,aAAa;IACbC,UAAU;IACVC,eAAe;IACfC,QAAQ;IACRC,oBAAoB;AACtB;AAkCO,MAAMpB,eAAeD,YAAYsB,QAAQ;AAEzC,MAAMpB,0BAA0B,CAAIqB,WACzCC,IAAAA,wCAAAA,EAAmBxB,aAAa,CAACyB,MAAMpB,uBAAuB,GAAKkB,SAASE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["menuGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue | undefined>(\n undefined,\n) as React.Context<MenuGroupContextValue>;\n\nconst menuGroupContextDefaultValue: MenuGroupContextValue = {\n headerId: '',\n};\n\n/**\n * Context used to guarantee correct aria-relationship between header\n * and group information\n */\nexport type MenuGroupContextValue = {\n /**\n * Element id applied to the `MenuGroupHeader` component\n */\n headerId: string;\n};\n\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nexport const useMenuGroupContext_unstable = () => React.useContext(MenuGroupContext) ?? menuGroupContextDefaultValue;\n"],"names":["MenuGroupContextProvider","useMenuGroupContext_unstable","MenuGroupContext","React","createContext","undefined","menuGroupContextDefaultValue","headerId","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAqBaA,wBAAAA;eAAAA;;IACAC,4BAAAA;eAAAA;;;;iEAtBU;AAEvB,MAAMC,iCAAmBC,OAAMC,aAAa,CAC1CC;AAGF,MAAMC,+BAAsD;IAC1DC,UAAU;AACZ;AAaO,MAAMP,2BAA2BE,iBAAiBM,QAAQ;AAC1D,MAAMP,+BAA+B;QAAME;WAAAA,CAAAA,oBAAAA,OAAMM,UAAU,CAACP,iBAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAsCG;AAA2B"}
1
+ {"version":3,"sources":["../src/contexts/menuGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue | undefined>(\n undefined,\n) as React.Context<MenuGroupContextValue>;\n\nconst menuGroupContextDefaultValue: MenuGroupContextValue = {\n headerId: '',\n};\n\n/**\n * Context used to guarantee correct aria-relationship between header\n * and group information\n */\nexport type MenuGroupContextValue = {\n /**\n * Element id applied to the `MenuGroupHeader` component\n */\n headerId: string;\n};\n\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nexport const useMenuGroupContext_unstable = () => React.useContext(MenuGroupContext) ?? menuGroupContextDefaultValue;\n"],"names":["MenuGroupContextProvider","useMenuGroupContext_unstable","MenuGroupContext","React","createContext","undefined","menuGroupContextDefaultValue","headerId","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAqBaA,wBAAAA;eAAAA;;IACAC,4BAAAA;eAAAA;;;;iEAtBU;AAEvB,MAAMC,iCAAmBC,OAAMC,aAAa,CAC1CC;AAGF,MAAMC,+BAAsD;IAC1DC,UAAU;AACZ;AAaO,MAAMP,2BAA2BE,iBAAiBM,QAAQ;AAC1D,MAAMP,+BAA+B;QAAME;WAAAA,CAAAA,oBAAAA,OAAMM,UAAU,CAACP,iBAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAsCG;AAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["menuListContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SelectableHandler } from '../selectable/index';\nimport type { MenuCheckedValueChangeData, MenuCheckedValueChangeEvent, MenuListProps } from '../components/index';\n\nexport const MenuListContext: Context<MenuListContextValue> = createContext<MenuListContextValue | undefined>(\n undefined,\n) as Context<MenuListContextValue>;\n\nconst menuListContextDefaultValue: MenuListContextValue = {\n checkedValues: {},\n setFocusByFirstCharacter: () => null,\n toggleCheckbox: () => null,\n selectRadio: () => null,\n hasIcons: false,\n hasCheckmarks: false,\n};\n\n/**\n * Context shared between MenuList and its children components\n */\nexport type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'hasIcons' | 'hasCheckmarks'> & {\n setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;\n toggleCheckbox?: SelectableHandler;\n selectRadio?: SelectableHandler;\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 * @deprecated this property is not used internally anymore,\n * the signature remains just to avoid breaking changes\n */\n onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;\n};\n\nexport const MenuListProvider = MenuListContext.Provider;\n\nexport const useMenuListContext_unstable = <T,>(selector: ContextSelector<MenuListContextValue, T>) =>\n useContextSelector(MenuListContext, (ctx = menuListContextDefaultValue) => selector(ctx));\n"],"names":["MenuListContext","MenuListProvider","useMenuListContext_unstable","createContext","undefined","menuListContextDefaultValue","checkedValues","setFocusByFirstCharacter","toggleCheckbox","selectRadio","hasIcons","hasCheckmarks","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,eAAAA;eAAAA;;IAgCAC,gBAAAA;eAAAA;;IAEAC,2BAAAA;eAAAA;;;;iEAxCU;sCAC2B;AAK3C,MAAMF,kBAAiDG,IAAAA,mCAAAA,EAC5DC;AAGF,MAAMC,8BAAoD;IACxDC,eAAe,CAAC;IAChBC,0BAA0B,IAAM;IAChCC,gBAAgB,IAAM;IACtBC,aAAa,IAAM;IACnBC,UAAU;IACVC,eAAe;AACjB;AAqBO,MAAMV,mBAAmBD,gBAAgBY,QAAQ;AAEjD,MAAMV,8BAA8B,CAAKW,WAC9CC,IAAAA,wCAAAA,EAAmBd,iBAAiB,CAACe,MAAMV,2BAA2B,GAAKQ,SAASE"}
1
+ {"version":3,"sources":["../src/contexts/menuListContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SelectableHandler } from '../selectable/index';\nimport type { MenuCheckedValueChangeData, MenuCheckedValueChangeEvent, MenuListProps } from '../components/index';\n\nexport const MenuListContext: Context<MenuListContextValue> = createContext<MenuListContextValue | undefined>(\n undefined,\n) as Context<MenuListContextValue>;\n\nconst menuListContextDefaultValue: MenuListContextValue = {\n checkedValues: {},\n setFocusByFirstCharacter: () => null,\n toggleCheckbox: () => null,\n selectRadio: () => null,\n hasIcons: false,\n hasCheckmarks: false,\n};\n\n/**\n * Context shared between MenuList and its children components\n */\nexport type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'hasIcons' | 'hasCheckmarks'> & {\n setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;\n toggleCheckbox?: SelectableHandler;\n selectRadio?: SelectableHandler;\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 * @deprecated this property is not used internally anymore,\n * the signature remains just to avoid breaking changes\n */\n onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;\n};\n\nexport const MenuListProvider = MenuListContext.Provider;\n\nexport const useMenuListContext_unstable = <T,>(selector: ContextSelector<MenuListContextValue, T>) =>\n useContextSelector(MenuListContext, (ctx = menuListContextDefaultValue) => selector(ctx));\n"],"names":["MenuListContext","MenuListProvider","useMenuListContext_unstable","createContext","undefined","menuListContextDefaultValue","checkedValues","setFocusByFirstCharacter","toggleCheckbox","selectRadio","hasIcons","hasCheckmarks","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,eAAAA;eAAAA;;IAgCAC,gBAAAA;eAAAA;;IAEAC,2BAAAA;eAAAA;;;;iEAxCU;sCAC2B;AAK3C,MAAMF,kBAAiDG,IAAAA,mCAAAA,EAC5DC;AAGF,MAAMC,8BAAoD;IACxDC,eAAe,CAAC;IAChBC,0BAA0B,IAAM;IAChCC,gBAAgB,IAAM;IACtBC,aAAa,IAAM;IACnBC,UAAU;IACVC,eAAe;AACjB;AAqBO,MAAMV,mBAAmBD,gBAAgBY,QAAQ;AAEjD,MAAMV,8BAA8B,CAAKW,WAC9CC,IAAAA,wCAAAA,EAAmBd,iBAAiB,CAACe,MAAMV,2BAA2B,GAAKQ,SAASE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["menuTriggerContext.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Context used communicate with a child menu item that it is a trigger for a submenu\n */\nconst MenuTriggerContext = React.createContext<boolean | undefined>(undefined) as React.Context<boolean>;\n\nconst menuTriggerContextDefaultValue = false;\n\nexport const MenuTriggerContextProvider = MenuTriggerContext.Provider;\nexport const useMenuTriggerContext_unstable = () =>\n React.useContext(MenuTriggerContext) ?? menuTriggerContextDefaultValue;\n"],"names":["MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuTriggerContext","React","createContext","undefined","menuTriggerContextDefaultValue","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IASaA,0BAAAA;eAAAA;;IACAC,8BAAAA;eAAAA;;;;iEAVU;AAEvB;;CAEC,GACD,MAAMC,mCAAqBC,OAAMC,aAAa,CAAsBC;AAEpE,MAAMC,iCAAiC;AAEhC,MAAMN,6BAA6BE,mBAAmBK,QAAQ;AAC9D,MAAMN,iCAAiC;QAC5CE;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,mBAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAwCG;AAA6B"}
1
+ {"version":3,"sources":["../src/contexts/menuTriggerContext.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Context used communicate with a child menu item that it is a trigger for a submenu\n */\nconst MenuTriggerContext = React.createContext<boolean | undefined>(undefined) as React.Context<boolean>;\n\nconst menuTriggerContextDefaultValue = false;\n\nexport const MenuTriggerContextProvider = MenuTriggerContext.Provider;\nexport const useMenuTriggerContext_unstable = () =>\n React.useContext(MenuTriggerContext) ?? menuTriggerContextDefaultValue;\n"],"names":["MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuTriggerContext","React","createContext","undefined","menuTriggerContextDefaultValue","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IASaA,0BAAAA;eAAAA;;IACAC,8BAAAA;eAAAA;;;;iEAVU;AAEvB;;CAEC,GACD,MAAMC,mCAAqBC,OAAMC,aAAa,CAAsBC;AAEpE,MAAMC,iCAAiC;AAEhC,MAAMN,6BAA6BE,mBAAmBK,QAAQ;AAC9D,MAAMN,iCAAiC;QAC5CE;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,mBAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAwCG;AAA6B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type {\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // MenuOpenEvents is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n // UninitializedMenuListState is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n\nexport {\n MenuItemLink,\n menuItemLinkClassNames,\n renderMenuItemLink_unstable,\n useMenuItemLinkStyles_unstable,\n useMenuItemLink_unstable,\n} from './MenuItemLink';\nexport type { MenuItemLinkProps, MenuItemLinkSlots, MenuItemLinkState } from './MenuItemLink';\n\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\nexport {\n MenuItemSwitch,\n useMenuItemSwitch_unstable,\n useMenuItemSwitchStyles_unstable,\n renderMenuItemSwitch_unstable,\n menuItemSwitchClassNames,\n} from './MenuItemSwitch';\n\nexport type { MenuItemSwitchProps, MenuItemSwitchState, MenuItemSwitchSlots } from './MenuItemSwitch';\n"],"names":["MENU_ENTER_EVENT","Menu","MenuDivider","MenuGroup","MenuGroupContextProvider","MenuGroupHeader","MenuItem","MenuItemCheckbox","MenuItemLink","MenuItemRadio","MenuItemSwitch","MenuList","MenuListProvider","MenuPopover","MenuProvider","MenuSplitGroup","MenuTrigger","MenuTriggerContextProvider","dispatchMenuEnterEvent","menuDividerClassNames","menuGroupClassNames","menuGroupHeaderClassNames","menuItemCheckboxClassNames","menuItemClassNames","menuItemLinkClassNames","menuItemRadioClassNames","menuItemSwitchClassNames","menuListClassNames","menuPopoverClassNames","menuSplitGroupClassNames","renderMenuDivider_unstable","renderMenuGroupHeader_unstable","renderMenuGroup_unstable","renderMenuItemCheckbox_unstable","renderMenuItemLink_unstable","renderMenuItemRadio_unstable","renderMenuItemSwitch_unstable","renderMenuItem_unstable","renderMenuList_unstable","renderMenuPopover_unstable","renderMenuSplitGroup_unstable","renderMenuTrigger_unstable","renderMenu_unstable","useCheckmarkStyles_unstable","useMenuContextValues_unstable","useMenuContext_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","useMenuGroupContextValues_unstable","useMenuGroupContext_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","useMenuItemStyles_unstable","useMenuItemSwitchStyles_unstable","useMenuItemSwitch_unstable","useMenuItem_unstable","useMenuListContextValues_unstable","useMenuListContext_unstable","useMenuListStyles_unstable","useMenuList_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","useMenuTriggerContext_unstable","useMenuTrigger_unstable","useMenu_unstable","useOnMenuMouseEnter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAuHSA,gBAAgB;eAAhBA,uBAAgB;;IA/GhBC,IAAI;eAAJA,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eAAvBA,oCAAuB;;IAhGNC,gBAAgB;eAAhBA,sBAAgB;;IA+GhCC,mBAAmB;eAAnBA,0BAAmB;;;6BAvHhB;oCAEqB;kCACJ;iCAET;sBAG6B;6BAkBpF;2BASA;iCAQA;0BAQA;kCAQA;+BAQA;0BASA;6BAkBA;gCAQA;6BAE0E;uBAGrC;8BASrC;uBAGuE;gCAOvE"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type {\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // MenuOpenEvents is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n // UninitializedMenuListState is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n\nexport {\n MenuItemLink,\n menuItemLinkClassNames,\n renderMenuItemLink_unstable,\n useMenuItemLinkStyles_unstable,\n useMenuItemLink_unstable,\n} from './MenuItemLink';\nexport type { MenuItemLinkProps, MenuItemLinkSlots, MenuItemLinkState } from './MenuItemLink';\n\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\nexport {\n MenuItemSwitch,\n useMenuItemSwitch_unstable,\n useMenuItemSwitchStyles_unstable,\n renderMenuItemSwitch_unstable,\n menuItemSwitchClassNames,\n} from './MenuItemSwitch';\n\nexport type { MenuItemSwitchProps, MenuItemSwitchState, MenuItemSwitchSlots } from './MenuItemSwitch';\n"],"names":["MENU_ENTER_EVENT","Menu","MenuDivider","MenuGroup","MenuGroupContextProvider","MenuGroupHeader","MenuItem","MenuItemCheckbox","MenuItemLink","MenuItemRadio","MenuItemSwitch","MenuList","MenuListProvider","MenuPopover","MenuProvider","MenuSplitGroup","MenuTrigger","MenuTriggerContextProvider","dispatchMenuEnterEvent","menuDividerClassNames","menuGroupClassNames","menuGroupHeaderClassNames","menuItemCheckboxClassNames","menuItemClassNames","menuItemLinkClassNames","menuItemRadioClassNames","menuItemSwitchClassNames","menuListClassNames","menuPopoverClassNames","menuSplitGroupClassNames","renderMenuDivider_unstable","renderMenuGroupHeader_unstable","renderMenuGroup_unstable","renderMenuItemCheckbox_unstable","renderMenuItemLink_unstable","renderMenuItemRadio_unstable","renderMenuItemSwitch_unstable","renderMenuItem_unstable","renderMenuList_unstable","renderMenuPopover_unstable","renderMenuSplitGroup_unstable","renderMenuTrigger_unstable","renderMenu_unstable","useCheckmarkStyles_unstable","useMenuContextValues_unstable","useMenuContext_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","useMenuGroupContextValues_unstable","useMenuGroupContext_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","useMenuItemStyles_unstable","useMenuItemSwitchStyles_unstable","useMenuItemSwitch_unstable","useMenuItem_unstable","useMenuListContextValues_unstable","useMenuListContext_unstable","useMenuListStyles_unstable","useMenuList_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","useMenuTriggerContext_unstable","useMenuTrigger_unstable","useMenu_unstable","useOnMenuMouseEnter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAuHSA,gBAAgB;eAAhBA,uBAAgB;;IA/GhBC,IAAI;eAAJA,UAAI;;IAaXC,WAAW;eAAXA,wBAAW;;IAQXC,SAAS;eAATA,oBAAS;;IA1BFC,wBAAwB;eAAxBA,0CAAwB;;IAmC/BC,eAAe;eAAfA,gCAAe;;IAQfC,QAAQ;eAARA,kBAAQ;;IAQRC,gBAAgB;eAAhBA,kCAAgB;;IAyDhBC,YAAY;eAAZA,0BAAY;;IAjDZC,aAAa;eAAbA,4BAAa;;IA2DbC,cAAc;eAAdA,8BAAc;;IAnDdC,QAAQ;eA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yles.styles';\nexport * from './types';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
1
+ {"version":3,"sources":["../src/selectable/index.ts"],"sourcesContent":["export * from './useCheckmarkStyles.styles';\nexport * from './types';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}