@fluentui/react-menu 0.0.0-nightlyd3bf09bf8120211201.1 → 0.0.0-nightlyd514b3e0ee20220121.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/CHANGELOG.json +142 -26
  2. package/CHANGELOG.md +31 -16
  3. package/Spec.md +21 -16
  4. package/dist/react-menu.d.ts +54 -12
  5. package/lib/MenuSplitGroup.d.ts +1 -0
  6. package/lib/MenuSplitGroup.js +2 -0
  7. package/lib/MenuSplitGroup.js.map +1 -0
  8. package/lib/components/Menu/useMenu.js +29 -21
  9. package/lib/components/Menu/useMenu.js.map +1 -1
  10. package/lib/components/MenuDivider/renderMenuDivider.js +2 -1
  11. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  12. package/lib/components/MenuDivider/useMenuDivider.js +3 -0
  13. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  14. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  15. package/lib/components/MenuDivider/useMenuDividerStyles.js +1 -0
  16. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  17. package/lib/components/MenuGroup/renderMenuGroup.js +2 -1
  18. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  19. package/lib/components/MenuGroup/useMenuGroup.js +3 -0
  20. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  21. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  22. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  23. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +3 -0
  24. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  25. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  26. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +1 -0
  27. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  28. package/lib/components/MenuItem/MenuItem.js +0 -2
  29. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  30. package/lib/components/MenuItem/MenuItem.types.d.ts +1 -1
  31. package/lib/components/MenuItem/renderMenuItem.js +8 -3
  32. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  33. package/lib/components/MenuItem/useMenuItem.d.ts +1 -5
  34. package/lib/components/MenuItem/useMenuItem.js +3 -8
  35. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  36. package/lib/components/MenuItem/useMenuItemStyles.js +19 -20
  37. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  38. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +7 -3
  39. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  40. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +7 -3
  41. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  42. package/lib/components/MenuList/renderMenuList.js +2 -1
  43. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  44. package/lib/components/MenuList/useMenuList.js +3 -0
  45. package/lib/components/MenuList/useMenuList.js.map +1 -1
  46. package/lib/components/MenuPopover/renderMenuPopover.js +4 -2
  47. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  48. package/lib/components/MenuPopover/useMenuPopover.js +3 -0
  49. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  50. package/lib/components/MenuPopover/useMenuPopoverStyles.js +1 -0
  51. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  52. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  53. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  54. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  55. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +13 -0
  56. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  57. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  58. package/lib/components/MenuSplitGroup/index.d.ts +5 -0
  59. package/lib/components/MenuSplitGroup/index.js +6 -0
  60. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  61. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  62. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
  63. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  64. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  65. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
  66. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  67. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  68. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
  69. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  70. package/lib/components/MenuTrigger/MenuTrigger.d.ts +1 -1
  71. package/lib/components/MenuTrigger/MenuTrigger.js +4 -3
  72. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  73. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +5 -2
  74. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -1
  75. package/lib/components/MenuTrigger/useMenuTrigger.js +177 -5
  76. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  77. package/lib/index.d.ts +11 -10
  78. package/lib/index.js +11 -10
  79. package/lib/index.js.map +1 -1
  80. package/lib/utils/useOnMenuEnter.js.map +1 -1
  81. package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
  82. package/lib-commonjs/MenuSplitGroup.js +10 -0
  83. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  84. package/lib-commonjs/components/Menu/useMenu.js +33 -26
  85. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  86. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -1
  87. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  88. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +3 -0
  89. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  90. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  91. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +2 -0
  92. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  93. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -1
  94. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  95. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +3 -0
  96. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  97. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  98. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  99. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +3 -0
  100. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  101. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  102. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +2 -0
  103. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  104. package/lib-commonjs/components/MenuItem/MenuItem.js +0 -3
  105. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  106. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +1 -1
  107. package/lib-commonjs/components/MenuItem/renderMenuItem.js +8 -4
  108. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  109. package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +1 -5
  110. package/lib-commonjs/components/MenuItem/useMenuItem.js +5 -10
  111. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  112. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +21 -20
  113. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  114. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +7 -4
  115. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  116. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +7 -4
  117. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  118. package/lib-commonjs/components/MenuList/renderMenuList.js +2 -1
  119. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  120. package/lib-commonjs/components/MenuList/useMenuList.js +3 -0
  121. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  122. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -2
  123. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  124. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +3 -0
  125. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  126. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +2 -0
  127. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  128. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  129. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  130. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  131. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +13 -0
  132. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  133. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  134. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
  135. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  136. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  137. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  138. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
  139. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  140. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
  141. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
  142. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  143. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  144. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
  145. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  146. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +1 -1
  147. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +5 -5
  148. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  149. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +5 -2
  150. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -1
  151. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +184 -5
  152. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  153. package/lib-commonjs/index.d.ts +11 -10
  154. package/lib-commonjs/index.js +16 -14
  155. package/lib-commonjs/index.js.map +1 -1
  156. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  157. package/package.json +15 -15
  158. package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  159. package/lib/components/MenuTrigger/useTriggerElement.js +0 -165
  160. package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
  161. package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
  162. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -180
  163. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":"AA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AACD,CAJM","sourceRoot":""}
@@ -0,0 +1,6 @@
1
+ import type { MenuSplitGroupProps } from './MenuSplitGroup.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
+ /**
4
+ * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
5
+ */
6
+ export declare const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { useMenuSplitGroup } from './useMenuSplitGroup';
3
+ import { renderMenuSplitGroup } from './renderMenuSplitGroup';
4
+ import { useMenuSplitGroupStyles } from './useMenuSplitGroupStyles';
5
+ /**
6
+ * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
7
+ */
8
+
9
+ export const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuSplitGroup(props, ref);
11
+ useMenuSplitGroupStyles(state);
12
+ return renderMenuSplitGroup(state);
13
+ });
14
+ MenuSplitGroup.displayName = 'MenuSplitGroup';
15
+ //# sourceMappingURL=MenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MenuSplitGroup/MenuSplitGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,oBAAT,QAAqC,wBAArC;AACA,SAAS,uBAAT,QAAwC,2BAAxC;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;AAEA,EAAA,uBAAuB,CAAC,KAAD,CAAvB;AACA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALuE,CAAjE;AAOP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourceRoot":""}
@@ -0,0 +1,13 @@
1
+ import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
2
+ export declare type MenuSplitGroupSlots = {
3
+ root: IntrinsicShorthandProps<'div'>;
4
+ };
5
+ export declare type MenuSplitGroupCommons = {};
6
+ /**
7
+ * MenuSplitGroup Props
8
+ */
9
+ export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;
10
+ /**
11
+ * State used in rendering MenuSplitGroup
12
+ */
13
+ export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots> & MenuSplitGroupCommons;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MenuSplitGroup.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuSplitGroup.types.js","sourceRoot":"","sources":["../../../src/components/MenuSplitGroup/MenuSplitGroup.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './MenuSplitGroup';
2
+ export * from './MenuSplitGroup.types';
3
+ export * from './renderMenuSplitGroup';
4
+ export * from './useMenuSplitGroup';
5
+ export * from './useMenuSplitGroupStyles';
@@ -0,0 +1,6 @@
1
+ export * from './MenuSplitGroup';
2
+ export * from './MenuSplitGroup.types';
3
+ export * from './renderMenuSplitGroup';
4
+ export * from './useMenuSplitGroup';
5
+ export * from './useMenuSplitGroupStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuSplitGroup/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { MenuSplitGroupState } from './MenuSplitGroup.types';
2
+ /**
3
+ * Render the final JSX of MenuSplitGroup
4
+ */
5
+ export declare const renderMenuSplitGroup: (state: MenuSplitGroupState) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of MenuSplitGroup
5
+ */
6
+
7
+ export const renderMenuSplitGroup = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ });
14
+ };
15
+ //# sourceMappingURL=renderMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MenuSplitGroup/renderMenuSplitGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAA+B;AACjE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,CAArC;AAEA,sBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAAP;AACD,CAJM","sourceRoot":""}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import type { MenuSplitGroupProps, MenuSplitGroupState } from './MenuSplitGroup.types';
3
+ /**
4
+ * Create the state required to render MenuSplitGroup.
5
+ *
6
+ * The returned state can be modified with hooks such as useMenuSplitGroupStyles,
7
+ * before being passed to renderMenuSplitGroup.
8
+ *
9
+ * @param props - props from this instance of MenuSplitGroup
10
+ * @param ref - reference to root HTMLElement of MenuSplitGroup
11
+ */
12
+ export declare const useMenuSplitGroup: (props: MenuSplitGroupProps, ref: React.Ref<HTMLElement>) => MenuSplitGroupState;
@@ -0,0 +1,67 @@
1
+ import * as React from 'react';
2
+ import { getNativeElementProps, getRTLSafeKey, useMergedRefs } from '@fluentui/react-utilities';
3
+ import { useFocusFinders } from '@fluentui/react-tabster';
4
+ import { useFluent } from '@fluentui/react-shared-contexts';
5
+ import { ArrowRight, ArrowLeft } from '@fluentui/keyboard-keys';
6
+ /**
7
+ * Create the state required to render MenuSplitGroup.
8
+ *
9
+ * The returned state can be modified with hooks such as useMenuSplitGroupStyles,
10
+ * before being passed to renderMenuSplitGroup.
11
+ *
12
+ * @param props - props from this instance of MenuSplitGroup
13
+ * @param ref - reference to root HTMLElement of MenuSplitGroup
14
+ */
15
+
16
+ export const useMenuSplitGroup = (props, ref) => {
17
+ const innerRef = React.useRef();
18
+ const {
19
+ dir,
20
+ targetDocument
21
+ } = useFluent();
22
+ const nextArrowKey = getRTLSafeKey(ArrowRight, dir);
23
+ const prevArrowKey = getRTLSafeKey(ArrowLeft, dir);
24
+ const {
25
+ findNextFocusable,
26
+ findPrevFocusable
27
+ } = useFocusFinders();
28
+ const onKeyDown = React.useCallback(e => {
29
+ var _a;
30
+
31
+ const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
32
+
33
+ if (!activeElement) {
34
+ return;
35
+ }
36
+
37
+ if (!((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.contains(activeElement))) {
38
+ return;
39
+ }
40
+
41
+ if (e.key === nextArrowKey) {
42
+ const next = findNextFocusable(activeElement, {
43
+ container: innerRef.current
44
+ });
45
+ next === null || next === void 0 ? void 0 : next.focus();
46
+ }
47
+
48
+ if (e.key === prevArrowKey) {
49
+ const prev = findPrevFocusable(activeElement, {
50
+ container: innerRef.current
51
+ });
52
+ prev === null || prev === void 0 ? void 0 : prev.focus();
53
+ }
54
+ }, [findNextFocusable, findPrevFocusable, targetDocument, nextArrowKey, prevArrowKey]);
55
+ return {
56
+ components: {
57
+ root: 'div'
58
+ },
59
+ root: getNativeElementProps('div', {
60
+ role: 'group',
61
+ ref: useMergedRefs(ref, innerRef),
62
+ onKeyDown,
63
+ ...props
64
+ })
65
+ };
66
+ };
67
+ //# sourceMappingURL=useMenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../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A9B;AACA,MAAA,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,KAAN,EAAA;AACD;;AAED,QAAI,CAAC,CAAC,GAAF,KAAU,YAAd,EAA4B;AAC1B,YAAM,IAAI,GAAG,iBAAiB,CAAC,aAAD,EAA+B;AAAE,QAAA,SAAS,EAAE,QAAQ,CAAC;AAAtB,OAA/B,CAA9B;AACA,MAAA,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,KAAN,EAAA;AACD;AACF,GApBe,EAqBhB,CAAC,iBAAD,EAAoB,iBAApB,EAAuC,cAAvC,EAAuD,YAAvD,EAAqE,YAArE,CArBgB,CAAlB;AAwBA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KADP;AAIL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,IAAI,EAAE,OAD2B;AAEjC,MAAA,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,QAAN,CAFe;AAGjC,MAAA,SAHiC;AAIjC,SAAG;AAJ8B,KAAR;AAJtB,GAAP;AAWD,CA5CM","sourceRoot":""}
@@ -0,0 +1,6 @@
1
+ import type { MenuSplitGroupState } from './MenuSplitGroup.types';
2
+ export declare const menuSplitGroupClassName = "fui-MenuSplitGroup";
3
+ /**
4
+ * Apply styling to the MenuSplitGroup slots based on the state
5
+ */
6
+ export declare const useMenuSplitGroupStyles: (state: MenuSplitGroupState) => MenuSplitGroupState;
@@ -0,0 +1,35 @@
1
+ import { __styles, mergeClasses } from '@fluentui/react-make-styles';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { menuItemClassName } from '../MenuItem/useMenuItemStyles';
4
+ export const menuSplitGroupClassName = 'fui-MenuSplitGroup';
5
+ /**
6
+ * Styles for the root slot
7
+ */
8
+
9
+ const useStyles = /*#__PURE__*/__styles({
10
+ "root": {
11
+ "mc9l5x": "f22iagw",
12
+ "u7v6m2": "f168awwq",
13
+ "Bo1wru1": ["f1om2jlk", "fcyhg04"],
14
+ "Bhkyaub": ["fgqgg70", "fqo1hry"],
15
+ "J9ixe0": ["fh1zedf", "f1auaj6e"],
16
+ "rj29m3": ["fokbbcd", "f1xlvh9o"],
17
+ "lispf9": "f1et5qag",
18
+ "B9hwub1": "f13ngu1f",
19
+ "dvf9w6": "f1db9j62",
20
+ "Hjn5ok": "f92z21p"
21
+ }
22
+ }, {
23
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f168awwq>.fui-MenuItem:nth-child(1){width:100%;}", ".f1om2jlk>.fui-MenuItem:nth-child(2){border-top-left-radius:0;}", ".fcyhg04>.fui-MenuItem:nth-child(2){border-top-right-radius:0;}", ".fgqgg70>.fui-MenuItem:nth-child(2){border-bottom-left-radius:0;}", ".fqo1hry>.fui-MenuItem:nth-child(2){border-bottom-right-radius:0;}", ".fh1zedf>.fui-MenuItem:nth-child(2){padding-left:0;}", ".f1auaj6e>.fui-MenuItem:nth-child(2){padding-right:0;}", ".fokbbcd>.fui-MenuItem:nth-child(2){margin-left:auto;}", ".f1xlvh9o>.fui-MenuItem:nth-child(2){margin-right:auto;}", ".f1et5qag>.fui-MenuItem:nth-child(2):before{content:\"\";}", ".f13ngu1f>.fui-MenuItem:nth-child(2):before{width:var(--strokeWidthThin);}", ".f1db9j62>.fui-MenuItem:nth-child(2):before{height:24px;}", ".f92z21p>.fui-MenuItem:nth-child(2):before{background-color:var(--colorNeutralStroke1);}"]
24
+ });
25
+ /**
26
+ * Apply styling to the MenuSplitGroup slots based on the state
27
+ */
28
+
29
+
30
+ export const useMenuSplitGroupStyles = state => {
31
+ const styles = useStyles();
32
+ state.root.className = mergeClasses(menuSplitGroupClassName, styles.root, state.root.className);
33
+ return state;
34
+ };
35
+ //# sourceMappingURL=useMenuSplitGroupStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroupStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,iBAAT,QAAkC,+BAAlC;AAGA,OAAO,MAAM,uBAAuB,GAAG,oBAAhC;AAEP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqBA;;AAEG;;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAoD;AACzF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAD,EAA0B,MAAM,CAAC,IAAjC,EAAuC,KAAK,CAAC,IAAN,CAAW,SAAlD,CAAnC;AACA,SAAO,KAAP;AACD,CAJM","sourceRoot":""}
@@ -4,4 +4,4 @@ import type { MenuTriggerProps } from './MenuTrigger.types';
4
4
  * Wraps a trigger element as an only child
5
5
  * and adds the necessary event handling to open a popup menu
6
6
  */
7
- export declare const MenuTrigger: React.FC<MenuTriggerProps>;
7
+ export declare const MenuTrigger: React.ForwardRefExoticComponent<MenuTriggerProps & React.RefAttributes<HTMLElement>>;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { useMenuTrigger } from './useMenuTrigger';
2
3
  import { renderMenuTrigger } from './renderMenuTrigger';
3
4
  /**
@@ -5,9 +6,9 @@ import { renderMenuTrigger } from './renderMenuTrigger';
5
6
  * and adds the necessary event handling to open a popup menu
6
7
  */
7
8
 
8
- export const MenuTrigger = props => {
9
- const state = useMenuTrigger(props);
9
+ export const MenuTrigger = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuTrigger(props, ref);
10
11
  return renderMenuTrigger(state);
11
- };
12
+ });
12
13
  MenuTrigger.displayName = 'MenuTrigger';
13
14
  //# sourceMappingURL=MenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AAGA;;;AAGG;;AACH,OAAO,MAAM,WAAW,GAA+B,KAAK,IAAG;AAC7D,QAAM,KAAK,GAAG,cAAc,CAAC,KAAD,CAA5B;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB;AACD,CAJM;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AAGA;;;AAGG;;AACH,OAAO,MAAM,WAAW,gBAAG,KAAK,CAAC,UAAN,CAAgD,CAAC,KAAD,EAAQ,GAAR,KAAe;AACxF,QAAM,KAAK,GAAG,cAAc,CAAC,KAAD,EAAQ,GAAR,CAA5B;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB;AACD,CAJ0B,CAApB;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
@@ -10,7 +10,10 @@ export declare type MenuTriggerProps = {
10
10
  /**
11
11
  * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
12
12
  */
13
- export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'>> & {
13
+ export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseMove' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'id'>> & {
14
14
  ref?: React.Ref<never>;
15
+ 'aria-expanded': boolean | undefined;
16
+ };
17
+ export declare type MenuTriggerState = {
18
+ children: React.ReactNode;
15
19
  };
16
- export declare type MenuTriggerState = MenuTriggerProps;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
2
3
  /**
3
4
  * Create the state required to render MenuTrigger.
@@ -5,4 +6,4 @@ import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
5
6
  *
6
7
  * @param props - props from this instance of MenuTrigger
7
8
  */
8
- export declare const useMenuTrigger: (props: MenuTriggerProps) => MenuTriggerState;
9
+ export declare const useMenuTrigger: (props: MenuTriggerProps, ref: React.Ref<HTMLElement>) => MenuTriggerState;
@@ -1,4 +1,11 @@
1
- import { useTriggerElement } from './useTriggerElement';
1
+ import * as React from 'react';
2
+ import { useMenuContext } from '../../contexts/menuContext';
3
+ import { useIsSubmenu } from '../../utils/useIsSubmenu';
4
+ import { useFocusFinders } from '@fluentui/react-tabster';
5
+ import { useFluent } from '@fluentui/react-shared-contexts';
6
+ import { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';
7
+ import { onlyChild, useMergedRefs, useTriggerElement } from '@fluentui/react-utilities';
8
+ import { shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';
2
9
  /**
3
10
  * Create the state required to render MenuTrigger.
4
11
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
@@ -6,10 +13,175 @@ import { useTriggerElement } from './useTriggerElement';
6
13
  * @param props - props from this instance of MenuTrigger
7
14
  */
8
15
 
9
- export const useMenuTrigger = props => {
10
- const state = { ...props
11
- }; // TODO just move the contents of this hook here
16
+ export const useMenuTrigger = (props, ref) => {
17
+ var _a;
12
18
 
13
- return useTriggerElement(state);
19
+ const {
20
+ children,
21
+ ...rest
22
+ } = props;
23
+ const triggerRef = useMenuContext(context => context.triggerRef);
24
+ const menuPopoverRef = useMenuContext(context => context.menuPopoverRef);
25
+ const setOpen = useMenuContext(context => context.setOpen);
26
+ const open = useMenuContext(context => context.open);
27
+ const triggerId = useMenuContext(context => context.triggerId);
28
+ const openOnHover = useMenuContext(context => context.openOnHover);
29
+ const openOnContext = useMenuContext(context => context.openOnContext);
30
+ const isSubmenu = useIsSubmenu();
31
+ const {
32
+ findFirstFocusable
33
+ } = useFocusFinders();
34
+ const focusFirst = React.useCallback(() => {
35
+ const firstFocusable = findFirstFocusable(menuPopoverRef.current);
36
+ firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
37
+ }, [findFirstFocusable, menuPopoverRef]);
38
+ const openedWithKeyboardRef = React.useRef(false);
39
+ const hasMouseMoved = React.useRef(false);
40
+ const {
41
+ dir
42
+ } = useFluent();
43
+ const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
44
+ const child = /*#__PURE__*/React.isValidElement(children) ? onlyChild(children) : undefined;
45
+
46
+ const onContextMenu = e => {
47
+ if (isTargetDisabled(e)) {
48
+ return;
49
+ }
50
+
51
+ if (openOnContext) {
52
+ e.preventDefault();
53
+ setOpen(e, {
54
+ open: true,
55
+ keyboard: false
56
+ });
57
+ }
58
+ };
59
+
60
+ const onClick = e => {
61
+ if (isTargetDisabled(e)) {
62
+ return;
63
+ }
64
+
65
+ if (!openOnContext) {
66
+ setOpen(e, {
67
+ open: !open,
68
+ keyboard: openedWithKeyboardRef.current
69
+ });
70
+ openedWithKeyboardRef.current = false;
71
+ }
72
+ };
73
+
74
+ const onKeyDown = e => {
75
+ var _a;
76
+
77
+ if (isTargetDisabled(e)) {
78
+ return;
79
+ }
80
+
81
+ if (shouldPreventDefaultOnKeyDown(e)) {
82
+ e.preventDefault();
83
+ openedWithKeyboardRef.current = true;
84
+ (_a = e.target) === null || _a === void 0 ? void 0 : _a.click();
85
+ }
86
+
87
+ const key = e.key;
88
+
89
+ if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {
90
+ setOpen(e, {
91
+ open: true,
92
+ keyboard: true
93
+ });
94
+ }
95
+
96
+ if (key === Escape && !isSubmenu) {
97
+ setOpen(e, {
98
+ open: false,
99
+ keyboard: true
100
+ });
101
+ } // if menu is already open, can't rely on effects to focus
102
+
103
+
104
+ if (open && key === OpenArrowKey && isSubmenu) {
105
+ focusFirst();
106
+ }
107
+ };
108
+
109
+ const onMouseEnter = e => {
110
+ if (isTargetDisabled(e)) {
111
+ return;
112
+ }
113
+
114
+ if (openOnHover && hasMouseMoved.current) {
115
+ setOpen(e, {
116
+ open: true,
117
+ keyboard: false
118
+ });
119
+ }
120
+ }; // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
121
+ // First time open the mouse using mousemove and then continue with mouseenter
122
+ // Only use once to determine that the user is using the mouse since it is an expensive event to handle
123
+
124
+
125
+ const onMouseMove = e => {
126
+ if (isTargetDisabled(e)) {
127
+ return;
128
+ }
129
+
130
+ if (openOnHover && !hasMouseMoved.current) {
131
+ setOpen(e, {
132
+ open: true,
133
+ keyboard: false
134
+ });
135
+ hasMouseMoved.current = true;
136
+ }
137
+ };
138
+
139
+ const onMouseLeave = e => {
140
+ if (isTargetDisabled(e)) {
141
+ return;
142
+ }
143
+
144
+ if (openOnHover) {
145
+ setOpen(e, {
146
+ open: false,
147
+ keyboard: false
148
+ });
149
+ }
150
+ };
151
+
152
+ const overrideProps = {
153
+ 'aria-haspopup': 'menu',
154
+ 'aria-expanded': open,
155
+ id: ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.id) || triggerId,
156
+ onClick,
157
+ onMouseEnter,
158
+ onMouseLeave,
159
+ onKeyDown,
160
+ onContextMenu,
161
+ onMouseMove
162
+ };
163
+
164
+ if (!open && !isSubmenu) {
165
+ overrideProps['aria-expanded'] = undefined;
166
+ }
167
+
168
+ return {
169
+ children: useTriggerElement({
170
+ children,
171
+ ref: useMergedRefs(triggerRef, ref),
172
+ outerProps: rest,
173
+ overrideProps
174
+ })
175
+ };
176
+ };
177
+
178
+ const isTargetDisabled = e => {
179
+ const isDisabled = el => el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';
180
+
181
+ if (e.target instanceof HTMLElement && isDisabled(e.target)) {
182
+ return true;
183
+ }
184
+
185
+ return e.currentTarget instanceof HTMLElement && isDisabled(e.currentTarget);
14
186
  };
15
187
  //# sourceMappingURL=useMenuTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":"AAAA,SAAS,iBAAT,QAAkC,qBAAlC;AAGA;;;;;AAKG;;AACH,OAAO,MAAM,cAAc,GAAI,KAAD,IAA8C;AAC1E,QAAM,KAAK,GAAG,EAAE,GAAG;AAAL,GAAd,CAD0E,CAG1E;;AACA,SAAO,iBAAiB,CAAC,KAAD,CAAxB;AACD,CALM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,cAAT,QAA+B,4BAA/B;AACA,SAAS,YAAT,QAA6B,0BAA7B;AACA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,MAAhC,EAAwC,SAAxC,QAAyD,yBAAzD;AACA,SAAS,SAAT,EAAoB,aAApB,EAAmC,iBAAnC,QAA4D,2BAA5D;AACA,SAAS,6BAAT,QAA8C,2BAA9C;AAEA;;;;;AAKG;;AACH,OAAO,MAAM,cAAc,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;;;AACvG,QAAM;AAAE,IAAA,QAAF;AAAY,OAAG;AAAf,MAAwB,KAA9B;AAEA,QAAM,UAAU,GAAG,cAAc,CAAC,OAAO,IAAI,OAA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AA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,EAAd,KAAoB,SAHmB;AAI3C,IAAA,OAJ2C;AAK3C,IAAA,YAL2C;AAM3C,IAAA,YAN2C;AAO3C,IAAA,SAP2C;AAQ3C,IAAA,aAR2C;AAS3C,IAAA;AAT2C,GAA7C;;AAYA,MAAI,CAAC,IAAD,IAAS,CAAC,SAAd,EAAyB;AACvB,IAAA,aAAa,CAAC,eAAD,CAAb,GAAiC,SAAjC;AACD;;AAED,SAAO;AACL,IAAA,QAAQ,EAAE,iBAAiB,CAAC;AAC1B,MAAA,QAD0B;AAE1B,MAAA,GAAG,EAAE,aAAa,CAAC,UAAD,EAAa,GAAb,CAFQ;AAG1B,MAAA,UAAU,EAAE,IAHc;AAI1B,MAAA;AAJ0B,KAAD;AADtB,GAAP;AAQD,CAnIM;;AAqIP,MAAM,gBAAgB,GAAI,CAAD,IAAoC;AAC3D,QAAM,UAAU,GAAI,EAAD,IACjB,EAAE,CAAC,YAAH,CAAgB,UAAhB,KAAgC,EAAE,CAAC,YAAH,CAAgB,eAAhB,KAAoC,EAAE,CAAC,YAAH,CAAgB,eAAhB,MAAqC,MAD3G;;AAEA,MAAI,CAAC,CAAC,MAAF,YAAoB,WAApB,IAAmC,UAAU,CAAC,CAAC,CAAC,MAAH,CAAjD,EAA6D;AAC3D,WAAO,IAAP;AACD;;AAED,SAAO,CAAC,CAAC,aAAF,YAA2B,WAA3B,IAA0C,UAAU,CAAC,CAAC,CAAC,aAAH,CAA3D;AACD,CARD","sourceRoot":""}
package/lib/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- export * from './MenuItem';
2
- export * from './MenuList';
3
- export * from './MenuItemCheckbox';
4
- export * from './MenuItemRadio';
5
- export * from './MenuDivider';
6
- export * from './MenuGroupHeader';
7
- export * from './MenuGroup';
8
- export * from './selectable/index';
9
- export * from './MenuTrigger';
10
- export * from './Menu';
11
1
  export * from './contexts/menuContext';
12
2
  export * from './contexts/menuTriggerContext';
13
3
  export * from './contexts/menuGroupContext';
14
4
  export * from './contexts/menuListContext';
5
+ export * from './Menu';
6
+ export * from './MenuDivider';
7
+ export * from './MenuGroup';
8
+ export * from './MenuGroupHeader';
9
+ export * from './MenuItem';
10
+ export * from './MenuItemCheckbox';
11
+ export * from './MenuItemRadio';
12
+ export * from './MenuList';
15
13
  export * from './MenuPopover';
14
+ export * from './MenuSplitGroup';
15
+ export * from './MenuTrigger';
16
+ export * from './selectable/index';
package/lib/index.js CHANGED
@@ -1,16 +1,17 @@
1
- export * from './MenuItem';
2
- export * from './MenuList';
3
- export * from './MenuItemCheckbox';
4
- export * from './MenuItemRadio';
5
- export * from './MenuDivider';
6
- export * from './MenuGroupHeader';
7
- export * from './MenuGroup';
8
- export * from './selectable/index';
9
- export * from './MenuTrigger';
10
- export * from './Menu';
11
1
  export * from './contexts/menuContext';
12
2
  export * from './contexts/menuTriggerContext';
13
3
  export * from './contexts/menuGroupContext';
14
4
  export * from './contexts/menuListContext';
5
+ export * from './Menu';
6
+ export * from './MenuDivider';
7
+ export * from './MenuGroup';
8
+ export * from './MenuGroupHeader';
9
+ export * from './MenuItem';
10
+ export * from './MenuItemCheckbox';
11
+ export * from './MenuItemRadio';
12
+ export * from './MenuList';
15
13
  export * from './MenuPopover';
14
+ export * from './MenuSplitGroup';
15
+ export * from './MenuTrigger';
16
+ export * from './selectable/index';
16
17
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAE9B,cAAc,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/useOnMenuEnter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,eAAT,QAAgC,wBAAhC;AAGA;;AAEG;;AACH,OAAO,MAAM,gBAAgB,GAAG,cAAzB;AAEP;;;;;;;;;;AAUG;;AACH,OAAO,MAAM,mBAAmB,GAAI,OAAD,IAA8C;AAC/E,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA,QAAR;AAAkB,IAAA,OAAlB;AAA2B,IAAA;AAA3B,MAAwC,OAA9C,CAD+E,CAG/E;;AACA,QAAM,QAAQ,GAAG,gBAAgB,CAAE,EAAD,IAAmB;;;AACnD,U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MAAA;AAAF;AAAzB,GAAlC,CAAjB;AACD,CAFM","sourceRoot":""}
@@ -0,0 +1 @@
1
+ export * from './components/MenuSplitGroup/index';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./components/MenuSplitGroup/index"), exports);
10
+ //# sourceMappingURL=MenuSplitGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/MenuSplitGroup.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourceRoot":""}