@fluentui/react-menu 9.7.10 → 9.7.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +109 -2
- package/CHANGELOG.md +26 -3
- package/lib/components/Menu/useMenu.js +3 -1
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +3 -6
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/index.js +1 -1
- package/lib/components/MenuDivider/index.js.map +1 -1
- package/lib/components/MenuDivider/{useMenuDividerStyles.js → useMenuDividerStyles.styles.js} +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -0
- package/lib/components/MenuGroup/MenuGroup.js +3 -6
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/index.js +1 -1
- package/lib/components/MenuGroup/index.js.map +1 -1
- package/lib/components/MenuGroup/{useMenuGroupStyles.js → useMenuGroupStyles.styles.js} +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -0
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +3 -6
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/index.js +1 -1
- package/lib/components/MenuGroupHeader/index.js.map +1 -1
- package/lib/components/MenuGroupHeader/{useMenuGroupHeaderStyles.js → useMenuGroupHeaderStyles.styles.js} +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -0
- package/lib/components/MenuItem/MenuItem.js +3 -6
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/index.js +1 -1
- package/lib/components/MenuItem/index.js.map +1 -1
- package/lib/components/MenuItem/{useMenuItemStyles.js → useMenuItemStyles.styles.js} +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.styles.js.map +1 -0
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +3 -6
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/index.js +1 -1
- package/lib/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib/components/MenuItemCheckbox/{useMenuItemCheckboxStyles.js → useMenuItemCheckboxStyles.styles.js} +2 -2
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -0
- package/lib/components/MenuItemRadio/MenuItemRadio.js +3 -6
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/index.js +1 -1
- package/lib/components/MenuItemRadio/index.js.map +1 -1
- package/lib/components/MenuItemRadio/{useMenuItemRadioStyles.js → useMenuItemRadioStyles.styles.js} +2 -2
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -0
- package/lib/components/MenuList/MenuList.js +3 -6
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/index.js +1 -1
- package/lib/components/MenuList/index.js.map +1 -1
- package/lib/components/MenuList/{useMenuListStyles.js → useMenuListStyles.styles.js} +1 -1
- package/lib/components/MenuList/useMenuListStyles.styles.js.map +1 -0
- package/lib/components/MenuPopover/MenuPopover.js +3 -6
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/index.js +1 -1
- package/lib/components/MenuPopover/index.js.map +1 -1
- package/lib/components/MenuPopover/{useMenuPopoverStyles.js → useMenuPopoverStyles.styles.js} +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +3 -6
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/index.js +1 -1
- package/lib/components/MenuSplitGroup/index.js.map +1 -1
- package/lib/components/MenuSplitGroup/{useMenuSplitGroupStyles.js → useMenuSplitGroupStyles.styles.js} +2 -2
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -0
- package/lib/components/MenuTrigger/MenuTrigger.js +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/index.js +1 -1
- package/lib/components/MenuTrigger/index.js.map +1 -1
- package/lib/components/MenuTrigger/{useMenuTrigger.js → useMenuTrigger.styles.js} +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.styles.js.map +1 -0
- package/lib/selectable/index.js +1 -1
- package/lib/selectable/index.js.map +1 -1
- package/lib/selectable/{useCheckmarkStyles.js → useCheckmarkStyles.styles.js} +1 -1
- package/lib/selectable/useCheckmarkStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Menu/useMenu.js +2 -1
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +3 -4
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +1 -1
- package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/{useMenuDividerStyles.js → useMenuDividerStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +3 -4
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.js +1 -1
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/{useMenuGroupStyles.js → useMenuGroupStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +3 -4
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/{useMenuGroupHeaderStyles.js → useMenuGroupHeaderStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuItem/MenuItem.js +3 -4
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +1 -1
- package/lib-commonjs/components/MenuItem/index.js.map +1 -1
- package/lib-commonjs/components/MenuItem/{useMenuItemStyles.js → useMenuItemStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +3 -4
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/{useMenuItemCheckboxStyles.js → useMenuItemCheckboxStyles.styles.js} +4 -4
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +3 -4
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/{useMenuItemRadioStyles.js → useMenuItemRadioStyles.styles.js} +4 -4
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuList/MenuList.js +3 -4
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +1 -1
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/{useMenuListStyles.js → useMenuListStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +3 -4
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +1 -1
- package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/{useMenuPopoverStyles.js → useMenuPopoverStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +3 -4
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/{useMenuSplitGroupStyles.js → useMenuSplitGroupStyles.styles.js} +2 -2
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +2 -2
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/{useMenuTrigger.js → useMenuTrigger.styles.js} +2 -2
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.styles.js.map +1 -0
- package/lib-commonjs/selectable/index.js +1 -1
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/{useCheckmarkStyles.js → useCheckmarkStyles.styles.js} +2 -2
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -0
- package/package.json +12 -12
- package/.swcrc +0 -30
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +0 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +0 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +0 -1
- package/lib/components/MenuItem/useMenuItemStyles.js.map +0 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +0 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +0 -1
- package/lib/components/MenuList/useMenuListStyles.js.map +0 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +0 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +0 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +0 -1
- package/lib/selectable/useCheckmarkStyles.js.map +0 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +0 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +0 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +0 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +0 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +0 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +0 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +0 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +0 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +0 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +0 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuItemCheckbox/index.ts"],"sourcesContent":["export * from './MenuItemCheckbox.types';\nexport * from './MenuItemCheckbox';\nexport * from './renderMenuItemCheckbox';\nexport * from './useMenuItemCheckbox';\nexport * from './useMenuItemCheckboxStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/MenuItemCheckbox/index.ts"],"sourcesContent":["export * from './MenuItemCheckbox.types';\nexport * from './MenuItemCheckbox';\nexport * from './renderMenuItemCheckbox';\nexport * from './useMenuItemCheckbox';\nexport * from './useMenuItemCheckboxStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { mergeClasses } from '@griffel/react';
|
2
2
|
import { useCheckmarkStyles_unstable } from '../../selectable/index';
|
3
|
-
import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';
|
3
|
+
import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';
|
4
4
|
export const menuItemCheckboxClassNames = {
|
5
5
|
root: 'fui-MenuItemCheckbox',
|
6
6
|
icon: 'fui-MenuItemCheckbox__icon',
|
@@ -25,4 +25,4 @@ export const useMenuItemCheckboxStyles_unstable = state => {
|
|
25
25
|
useMenuItemStyles_unstable(state);
|
26
26
|
useCheckmarkStyles_unstable(state);
|
27
27
|
};
|
28
|
-
//# sourceMappingURL=useMenuItemCheckboxStyles.js.map
|
28
|
+
//# sourceMappingURL=useMenuItemCheckboxStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["mergeClasses","useCheckmarkStyles_unstable","useMenuItemStyles_unstable","menuItemCheckboxClassNames","root","icon","checkmark","content","secondaryContent","useMenuItemCheckboxStyles_unstable","state","className"],"sources":["../../../src/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSlots } from '../index';\nimport type { MenuItemCheckboxState } from './MenuItemCheckbox.types';\n\nexport const menuItemCheckboxClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>> = {\n root: 'fui-MenuItemCheckbox',\n icon: 'fui-MenuItemCheckbox__icon',\n checkmark: 'fui-MenuItemCheckbox__checkmark',\n content: 'fui-MenuItemCheckbox__content',\n secondaryContent: 'fui-MenuItemCheckbox__secondaryContent',\n};\n\nexport const useMenuItemCheckboxStyles_unstable = (state: MenuItemCheckboxState) => {\n state.root.className = mergeClasses(menuItemCheckboxClassNames.root, state.root.className);\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemCheckboxClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemCheckboxClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemCheckboxClassNames.icon, state.icon.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemCheckboxClassNames.checkmark, state.checkmark.className);\n }\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ;AAC7B,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,0BAA0B,QAAQ;AAK3C,OAAO,MAAMC,0BAAA,GAAsF;EACjGC,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,SAAA,EAAW;EACXC,OAAA,EAAS;EACTC,gBAAA,EAAkB;AACpB;AAEA,OAAO,MAAMC,kCAAA,GAAsCC,KAAA,IAAiC;EAClFA,KAAA,CAAMN,IAAI,CAACO,SAAS,GAAGX,YAAA,CAAaG,0BAAA,CAA2BC,IAAI,EAAEM,KAAA,CAAMN,IAAI,CAACO,SAAS;EAEzF,IAAID,KAAA,CAAMH,OAAO,EAAE;IACjBG,KAAA,CAAMH,OAAO,CAACI,SAAS,GAAGX,YAAA,CAAaG,0BAAA,CAA2BI,OAAO,EAAEG,KAAA,CAAMH,OAAO,CAACI,SAAS;EACpG;EAEA,IAAID,KAAA,CAAMF,gBAAgB,EAAE;IAC1BE,KAAA,CAAMF,gBAAgB,CAACG,SAAS,GAAGX,YAAA,CACjCG,0BAAA,CAA2BK,gBAAgB,EAC3CE,KAAA,CAAMF,gBAAgB,CAACG,SAAS;EAEpC;EAEA,IAAID,KAAA,CAAML,IAAI,EAAE;IACdK,KAAA,CAAML,IAAI,CAACM,SAAS,GAAGX,YAAA,CAAaG,0BAAA,CAA2BE,IAAI,EAAEK,KAAA,CAAML,IAAI,CAACM,SAAS;EAC3F;EAEA,IAAID,KAAA,CAAMJ,SAAS,EAAE;IACnBI,KAAA,CAAMJ,SAAS,CAACK,SAAS,GAAGX,YAAA,CAAaG,0BAAA,CAA2BG,SAAS,EAAEI,KAAA,CAAMJ,SAAS,CAACK,SAAS;EAC1G;EAEAT,0BAAA,CAA2BQ,KAAA;EAC3BT,2BAAA,CAA4BS,KAAA;AAC9B"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { useMenuItemRadio_unstable } from './useMenuItemRadio';
|
3
3
|
import { renderMenuItemRadio_unstable } from './renderMenuItemRadio';
|
4
|
-
import { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles';
|
5
|
-
import {
|
4
|
+
import { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles.styles';
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
8
8
|
*/
|
9
9
|
export const MenuItemRadio = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
10
|
const state = useMenuItemRadio_unstable(props, ref);
|
11
11
|
useMenuItemRadioStyles_unstable(state);
|
12
|
-
|
13
|
-
useMenuItemRadioStyles_unstable: useCustomStyles
|
14
|
-
} = useCustomStyleHooks_unstable();
|
15
|
-
useCustomStyles(state);
|
12
|
+
useCustomStyleHook_unstable('useMenuItemRadioStyles_unstable')(state);
|
16
13
|
return renderMenuItemRadio_unstable(state);
|
17
14
|
});
|
18
15
|
MenuItemRadio.displayName = 'MenuItemRadio';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useMenuItemRadio_unstable","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","
|
1
|
+
{"version":3,"names":["React","useMenuItemRadio_unstable","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useCustomStyleHook_unstable","MenuItemRadio","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuItemRadio/MenuItemRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemRadio_unstable } from './useMenuItemRadio';\nimport { renderMenuItemRadio_unstable } from './renderMenuItemRadio';\nimport { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles.styles';\nimport type { MenuItemRadioProps } from './MenuItemRadio.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.\n */\nexport const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemRadio_unstable(props, ref);\n\n useMenuItemRadioStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuItemRadioStyles_unstable')(state);\n\n return renderMenuItemRadio_unstable(state);\n});\n\nMenuItemRadio.displayName = 'MenuItemRadio';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,+BAA+B,QAAQ;AAGhD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,aAAA,gBAAyDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACrG,MAAMC,KAAA,GAAQR,yBAAA,CAA0BM,KAAA,EAAOC,GAAA;EAE/CL,+BAAA,CAAgCM,KAAA;EAEhCL,2BAAA,CAA4B,mCAAmCK,KAAA;EAE/D,OAAOP,4BAAA,CAA6BO,KAAA;AACtC;AAEAJ,aAAA,CAAcK,WAAW,GAAG"}
|
@@ -2,5 +2,5 @@ export * from './MenuItemRadio.types';
|
|
2
2
|
export * from './MenuItemRadio';
|
3
3
|
export * from './renderMenuItemRadio';
|
4
4
|
export * from './useMenuItemRadio';
|
5
|
-
export * from './useMenuItemRadioStyles';
|
5
|
+
export * from './useMenuItemRadioStyles.styles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuItemRadio/index.ts"],"sourcesContent":["export * from './MenuItemRadio.types';\nexport * from './MenuItemRadio';\nexport * from './renderMenuItemRadio';\nexport * from './useMenuItemRadio';\nexport * from './useMenuItemRadioStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/MenuItemRadio/index.ts"],"sourcesContent":["export * from './MenuItemRadio.types';\nexport * from './MenuItemRadio';\nexport * from './renderMenuItemRadio';\nexport * from './useMenuItemRadio';\nexport * from './useMenuItemRadioStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
package/lib/components/MenuItemRadio/{useMenuItemRadioStyles.js → useMenuItemRadioStyles.styles.js}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { mergeClasses } from '@griffel/react';
|
2
2
|
import { useCheckmarkStyles_unstable } from '../../selectable/index';
|
3
|
-
import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';
|
3
|
+
import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';
|
4
4
|
export const menuItemRadioClassNames = {
|
5
5
|
root: 'fui-MenuItemRadio',
|
6
6
|
icon: 'fui-MenuItemRadio__icon',
|
@@ -25,4 +25,4 @@ export const useMenuItemRadioStyles_unstable = state => {
|
|
25
25
|
useMenuItemStyles_unstable(state);
|
26
26
|
useCheckmarkStyles_unstable(state);
|
27
27
|
};
|
28
|
-
//# sourceMappingURL=useMenuItemRadioStyles.js.map
|
28
|
+
//# sourceMappingURL=useMenuItemRadioStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["mergeClasses","useCheckmarkStyles_unstable","useMenuItemStyles_unstable","menuItemRadioClassNames","root","icon","checkmark","content","secondaryContent","useMenuItemRadioStyles_unstable","state","className"],"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.styles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSlots } from '../index';\nimport type { MenuItemRadioState } from './MenuItemRadio.types';\n\nexport const menuItemRadioClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>> = {\n root: 'fui-MenuItemRadio',\n icon: 'fui-MenuItemRadio__icon',\n checkmark: 'fui-MenuItemRadio__checkmark',\n content: 'fui-MenuItemRadio__content',\n secondaryContent: 'fui-MenuItemRadio__secondaryContent',\n};\n\nexport const useMenuItemRadioStyles_unstable = (state: MenuItemRadioState) => {\n state.root.className = mergeClasses(menuItemRadioClassNames.root, state.root.className);\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemRadioClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemRadioClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemRadioClassNames.icon, state.icon.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemRadioClassNames.checkmark, state.checkmark.className);\n }\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ;AAC7B,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,0BAA0B,QAAQ;AAK3C,OAAO,MAAMC,uBAAA,GAAmF;EAC9FC,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,SAAA,EAAW;EACXC,OAAA,EAAS;EACTC,gBAAA,EAAkB;AACpB;AAEA,OAAO,MAAMC,+BAAA,GAAmCC,KAAA,IAA8B;EAC5EA,KAAA,CAAMN,IAAI,CAACO,SAAS,GAAGX,YAAA,CAAaG,uBAAA,CAAwBC,IAAI,EAAEM,KAAA,CAAMN,IAAI,CAACO,SAAS;EAEtF,IAAID,KAAA,CAAMH,OAAO,EAAE;IACjBG,KAAA,CAAMH,OAAO,CAACI,SAAS,GAAGX,YAAA,CAAaG,uBAAA,CAAwBI,OAAO,EAAEG,KAAA,CAAMH,OAAO,CAACI,SAAS;EACjG;EAEA,IAAID,KAAA,CAAMF,gBAAgB,EAAE;IAC1BE,KAAA,CAAMF,gBAAgB,CAACG,SAAS,GAAGX,YAAA,CACjCG,uBAAA,CAAwBK,gBAAgB,EACxCE,KAAA,CAAMF,gBAAgB,CAACG,SAAS;EAEpC;EAEA,IAAID,KAAA,CAAML,IAAI,EAAE;IACdK,KAAA,CAAML,IAAI,CAACM,SAAS,GAAGX,YAAA,CAAaG,uBAAA,CAAwBE,IAAI,EAAEK,KAAA,CAAML,IAAI,CAACM,SAAS;EACxF;EAEA,IAAID,KAAA,CAAMJ,SAAS,EAAE;IACnBI,KAAA,CAAMJ,SAAS,CAACK,SAAS,GAAGX,YAAA,CAAaG,uBAAA,CAAwBG,SAAS,EAAEI,KAAA,CAAMJ,SAAS,CAACK,SAAS;EACvG;EAEAT,0BAAA,CAA2BQ,KAAA;EAC3BT,2BAAA,CAA4BS,KAAA;AAC9B"}
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
2
2
|
import { useMenuList_unstable } from './useMenuList';
|
3
3
|
import { renderMenuList_unstable } from './renderMenuList';
|
4
4
|
import { useMenuListContextValues_unstable } from './useMenuListContextValues';
|
5
|
-
import { useMenuListStyles_unstable } from './useMenuListStyles';
|
6
|
-
import {
|
5
|
+
import { useMenuListStyles_unstable } from './useMenuListStyles.styles';
|
6
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
7
7
|
/**
|
8
8
|
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
9
9
|
*/
|
@@ -11,10 +11,7 @@ export const MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
11
|
const state = useMenuList_unstable(props, ref);
|
12
12
|
const contextValues = useMenuListContextValues_unstable(state);
|
13
13
|
useMenuListStyles_unstable(state);
|
14
|
-
|
15
|
-
useMenuListStyles_unstable: useCustomStyles
|
16
|
-
} = useCustomStyleHooks_unstable();
|
17
|
-
useCustomStyles(state);
|
14
|
+
useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);
|
18
15
|
return renderMenuList_unstable(state, contextValues);
|
19
16
|
});
|
20
17
|
MenuList.displayName = 'MenuList';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useMenuList_unstable","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","
|
1
|
+
{"version":3,"names":["React","useMenuList_unstable","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useCustomStyleHook_unstable","MenuList","forwardRef","props","ref","state","contextValues","displayName"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,QAAA,gBAA+CN,KAAA,CAAMO,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3F,MAAMC,KAAA,GAAQT,oBAAA,CAAqBO,KAAA,EAAOC,GAAA;EAC1C,MAAME,aAAA,GAAgBR,iCAAA,CAAkCO,KAAA;EAExDN,0BAAA,CAA2BM,KAAA;EAE3BL,2BAAA,CAA4B,8BAA8BK,KAAA;EAE1D,OAAOR,uBAAA,CAAwBQ,KAAA,EAAOC,aAAA;AACxC;AAEAL,QAAA,CAASM,WAAW,GAAG"}
|
@@ -2,6 +2,6 @@ export * from './MenuList';
|
|
2
2
|
export * from './MenuList.types';
|
3
3
|
export * from './renderMenuList';
|
4
4
|
export * from './useMenuList';
|
5
|
-
export * from './useMenuListStyles';
|
5
|
+
export * from './useMenuListStyles.styles';
|
6
6
|
export * from './useMenuListContextValues';
|
7
7
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuList/index.ts"],"sourcesContent":["export * from './MenuList';\nexport * from './MenuList.types';\nexport * from './renderMenuList';\nexport * from './useMenuList';\nexport * from './useMenuListStyles';\nexport * from './useMenuListContextValues';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"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"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -20,4 +20,4 @@ export const useMenuListStyles_unstable = state => {
|
|
20
20
|
state.root.className = mergeClasses(menuListClassNames.root, styles.root, state.root.className);
|
21
21
|
return state;
|
22
22
|
};
|
23
|
-
//# sourceMappingURL=useMenuListStyles.js.map
|
23
|
+
//# sourceMappingURL=useMenuListStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["mergeClasses","__styles","shorthands","menuListClassNames","root","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","d","useMenuListStyles_unstable","state","styles","className"],"sources":["../../../src/components/MenuList/useMenuListStyles.styles.ts"],"sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport type { MenuListSlots, MenuListState } from './MenuList.types';\n\nexport const menuListClassNames: SlotClassNames<MenuListSlots> = {\n root: 'fui-MenuList',\n};\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.gap('2px'),\n },\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuListStyles_unstable = (state: MenuListState): MenuListState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuListClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AACA,SAASA,YAAY,EAAAC,QAAA,EAAcC,UAAU,QAAQ;AAGrD,OAAO,MAAMC,kBAAA,GAAoD;EAC/DC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAMlB;AAEA;;;AAGA,OAAO,MAAMC,0BAAA,GAA8BC,KAAA,IAAwC;EACjF,MAAMC,MAAA,GAASR,SAAA;EACfO,KAAA,CAAMR,IAAI,CAACU,SAAS,GAAGd,YAAA,CAAaG,kBAAA,CAAmBC,IAAI,EAAES,MAAA,CAAOT,IAAI,EAAEQ,KAAA,CAAMR,IAAI,CAACU,SAAS;EAC9F,OAAOF,KAAA;AACT"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { useMenuPopover_unstable } from './useMenuPopover';
|
3
|
-
import { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';
|
3
|
+
import { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles.styles';
|
4
4
|
import { renderMenuPopover_unstable } from './renderMenuPopover';
|
5
|
-
import {
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
|
8
8
|
*/
|
9
9
|
export const MenuPopover = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
10
|
const state = useMenuPopover_unstable(props, ref);
|
11
11
|
useMenuPopoverStyles_unstable(state);
|
12
|
-
|
13
|
-
useMenuPopoverStyles_unstable: useCustomStyles
|
14
|
-
} = useCustomStyleHooks_unstable();
|
15
|
-
useCustomStyles(state);
|
12
|
+
useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);
|
16
13
|
return renderMenuPopover_unstable(state);
|
17
14
|
});
|
18
15
|
MenuPopover.displayName = 'MenuPopover';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useMenuPopover_unstable","useMenuPopoverStyles_unstable","renderMenuPopover_unstable","
|
1
|
+
{"version":3,"names":["React","useMenuPopover_unstable","useMenuPopoverStyles_unstable","renderMenuPopover_unstable","useCustomStyleHook_unstable","MenuPopover","forwardRef","props","ref","state","displayName"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,WAAA,gBAAqDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACjG,MAAMC,KAAA,GAAQR,uBAAA,CAAwBM,KAAA,EAAOC,GAAA;EAE7CN,6BAAA,CAA8BO,KAAA;EAE9BL,2BAAA,CAA4B,iCAAiCK,KAAA;EAE7D,OAAON,0BAAA,CAA2BM,KAAA;AACpC;AAEAJ,WAAA,CAAYK,WAAW,GAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuPopover/index.ts"],"sourcesContent":["export * from './MenuPopover';\nexport * from './MenuPopover.types';\nexport * from './renderMenuPopover';\nexport * from './useMenuPopover';\nexport * from './useMenuPopoverStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"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"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
package/lib/components/MenuPopover/{useMenuPopoverStyles.js → useMenuPopoverStyles.styles.js}
RENAMED
@@ -47,4 +47,4 @@ export const useMenuPopoverStyles_unstable = state => {
|
|
47
47
|
state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);
|
48
48
|
return state;
|
49
49
|
};
|
50
|
-
//# sourceMappingURL=useMenuPopoverStyles.js.map
|
50
|
+
//# sourceMappingURL=useMenuPopoverStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["shorthands","mergeClasses","__styles","tokens","typographyStyles","menuPopoverClassNames","root","useStyles","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","De3pzq","sj55zd","Bf4jedk","B2u0y6b","a9b677","E5pizo","z8tnut","z189sj","Byoj8tv","uwmqm3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useMenuPopoverStyles_unstable","state","styles","className"],"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.styles.ts"],"sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots> = {\n root: 'fui-MenuPopover',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n minWidth: '128px',\n maxWidth: '300px',\n width: 'max-content',\n boxShadow: `${tokens.shadow16}`,\n ...shorthands.padding('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles_unstable = (state: MenuPopoverState): MenuPopoverState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAAC,QAAA,QAAoB;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,qBAAA,GAA0D;EACrEC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYL,QAAA;EAAAI,IAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAalB;AAEA;;;AAGA,OAAO,MAAMC,6BAAA,GAAiCC,KAAA,IAA8C;EAC1F,MAAMC,MAAA,GAASlC,SAAA;EACfiC,KAAA,CAAMlC,IAAI,CAACoC,SAAS,GAAGzC,YAAA,CAAaI,qBAAA,CAAsBC,IAAI,EAAEmC,MAAA,CAAOnC,IAAI,EAAEkC,KAAA,CAAMlC,IAAI,CAACoC,SAAS;EACjG,OAAOF,KAAA;AACT"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { useMenuSplitGroup_unstable } from './useMenuSplitGroup';
|
3
3
|
import { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';
|
4
|
-
import { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';
|
5
|
-
import {
|
4
|
+
import { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles.styles';
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
|
8
8
|
*/
|
9
9
|
export const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
10
|
const state = useMenuSplitGroup_unstable(props, ref);
|
11
11
|
useMenuSplitGroupStyles_unstable(state);
|
12
|
-
|
13
|
-
useMenuSplitGroupStyles_unstable: useCustomStyles
|
14
|
-
} = useCustomStyleHooks_unstable();
|
15
|
-
useCustomStyles(state);
|
12
|
+
useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);
|
16
13
|
return renderMenuSplitGroup_unstable(state);
|
17
14
|
});
|
18
15
|
MenuSplitGroup.displayName = 'MenuSplitGroup';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","
|
1
|
+
{"version":3,"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","MenuSplitGroup","forwardRef","props","ref","state","displayName"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,gCAAgC,QAAQ;AAGjD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,cAAA,gBAA2DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvG,MAAMC,KAAA,GAAQR,0BAAA,CAA2BM,KAAA,EAAOC,GAAA;EAEhDL,gCAAA,CAAiCM,KAAA;EAEjCL,2BAAA,CAA4B,oCAAoCK,KAAA;EAEhE,OAAOP,6BAAA,CAA8BO,KAAA;AACvC;AAEAJ,cAAA,CAAeK,WAAW,GAAG"}
|
@@ -2,5 +2,5 @@ export * from './MenuSplitGroup';
|
|
2
2
|
export * from './MenuSplitGroup.types';
|
3
3
|
export * from './renderMenuSplitGroup';
|
4
4
|
export * from './useMenuSplitGroup';
|
5
|
-
export * from './useMenuSplitGroupStyles';
|
5
|
+
export * from './useMenuSplitGroupStyles.styles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuSplitGroup/index.ts"],"sourcesContent":["export * from './MenuSplitGroup';\nexport * from './MenuSplitGroup.types';\nexport * from './renderMenuSplitGroup';\nexport * from './useMenuSplitGroup';\nexport * from './useMenuSplitGroupStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"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"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __styles, mergeClasses } from '@griffel/react';
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
3
|
-
import { menuItemClassNames } from '../MenuItem/useMenuItemStyles';
|
3
|
+
import { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';
|
4
4
|
export const menuSplitGroupClassNames = {
|
5
5
|
root: 'fui-MenuSplitGroup'
|
6
6
|
};
|
@@ -31,4 +31,4 @@ export const useMenuSplitGroupStyles_unstable = state => {
|
|
31
31
|
state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);
|
32
32
|
return state;
|
33
33
|
};
|
34
|
-
//# sourceMappingURL=useMenuSplitGroupStyles.js.map
|
34
|
+
//# sourceMappingURL=useMenuSplitGroupStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tokens","menuItemClassNames","menuSplitGroupClassNames","root","useStyles","mc9l5x","u7v6m2","Bo1wru1","Bhkyaub","J9ixe0","rj29m3","B2knx3v","Bl7aesu","e82tai","Bnkcs84","d","useMenuSplitGroupStyles_unstable","state","styles","className"],"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { menuItemClassNames } from '../MenuItem/useMenuItemStyles.styles';\nimport type { MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots> = {\n root: 'fui-MenuSplitGroup',\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n [`& > .${menuItemClassNames.root}:nth-child(1)`]: {\n width: '100%',\n },\n [`& > .${menuItemClassNames.root}:nth-child(2)`]: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n paddingLeft: 0,\n marginLeft: 'auto',\n '::before': {\n content: '\"\"',\n width: tokens.strokeWidthThin,\n height: '24px',\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n});\n\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = (state: MenuSplitGroupState): MenuSplitGroupState => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AACzC,SAASC,MAAM,QAAQ;AACvB,SAASC,kBAAkB,QAAQ;AAInC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AACA;;;AAGA,MAAMC,SAAA,gBAAYN,QAAA;EAAAK,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAmBlB;AAEA;;;AAGA,OAAO,MAAMC,gCAAA,GAAoCC,KAAA,IAAoD;EACnG,MAAMC,MAAA,GAASd,SAAA;EACfa,KAAA,CAAMd,IAAI,CAACgB,SAAS,GAAGpB,YAAA,CAAaG,wBAAA,CAAyBC,IAAI,EAAEe,MAAA,CAAOf,IAAI,EAAEc,KAAA,CAAMd,IAAI,CAACgB,SAAS;EACpG,OAAOF,KAAA;AACT"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { useMenuTrigger_unstable } from './useMenuTrigger';
|
2
|
+
import { useMenuTrigger_unstable } from './useMenuTrigger.styles';
|
3
3
|
import { renderMenuTrigger_unstable } from './renderMenuTrigger';
|
4
4
|
/**
|
5
5
|
* Wraps a trigger element as an only child
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useMenuTrigger_unstable","renderMenuTrigger_unstable","MenuTrigger","props","state","displayName","isFluentTriggerComponent"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAI3C;;;;AAIA,OAAO,MAAMC,WAAA,GAA0CC,KAAA,IAAS;EAC9D,MAAMC,KAAA,GAAQJ,uBAAA,CAAwBG,KAAA;EAEtC,OAAOF,0BAAA,CAA2BG,KAAA;AACpC;AAEAF,WAAA,CAAYG,WAAW,GAAG;AAC1B;AACCH,WAAA,CAAuCI,wBAAwB,GAAG,IAAI"}
|
1
|
+
{"version":3,"names":["React","useMenuTrigger_unstable","renderMenuTrigger_unstable","MenuTrigger","props","state","displayName","isFluentTriggerComponent"],"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger_unstable } from './useMenuTrigger.styles';\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAI3C;;;;AAIA,OAAO,MAAMC,WAAA,GAA0CC,KAAA,IAAS;EAC9D,MAAMC,KAAA,GAAQJ,uBAAA,CAAwBG,KAAA;EAEtC,OAAOF,0BAAA,CAA2BG,KAAA;AACpC;AAEAF,WAAA,CAAYG,WAAW,GAAG;AAC1B;AACCH,WAAA,CAAuCI,wBAAwB,GAAG,IAAI"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/components/MenuTrigger/index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/MenuTrigger/index.ts"],"sourcesContent":["export * from './MenuTrigger';\nexport * from './MenuTrigger.types';\nexport * from './renderMenuTrigger';\nexport * from './useMenuTrigger.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","useMenuContext_unstable","useIsSubmenu","useFocusFinders","useFluent_unstable","useFluent","ArrowRight","ArrowLeft","Escape","ArrowDown","applyTriggerPropsToChildren","getTriggerChild","isHTMLElement","mergeCallbacks","useEventCallback","useMergedRefs","useARIAButtonProps","useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","isSubmenu","findFirstFocusable","focusFirst","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","OpenArrowKey","child","onContextMenu","event","isTargetDisabled","preventDefault","keyboard","type","onClick","onKeyDown","key","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","triggerChildProps","undefined","ariaButtonTriggerChildProps","isDisabled","el","hasAttribute","getAttribute","target","currentTarget"],"sources":["../../../src/components/MenuTrigger/useMenuTrigger.styles.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)) {\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAEvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,YAAY,QAAQ;AAC7B,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,SAAS,QAAQ;AACzD,SACEC,2BAA2B,EAC3BC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,QACR;AACP,SAASC,kBAAkB,QAAQ;AAEnC;;;;;;AAMA,OAAO,MAAMC,uBAAA,GAA2BC,KAAA,IAA8C;EACpF,MAAM;IAAEC,QAAA;IAAUC,wBAAA,GAA2B;EAAK,CAAE,GAAGF,KAAA;EAEvD,MAAMG,UAAA,GAAapB,uBAAA,CAAwBqB,OAAA,IAAWA,OAAA,CAAQD,UAAU;EACxE,MAAME,cAAA,GAAiBtB,uBAAA,CAAwBqB,OAAA,IAAWA,OAAA,CAAQC,cAAc;EAChF,MAAMC,OAAA,GAAUvB,uBAAA,CAAwBqB,OAAA,IAAWA,OAAA,CAAQE,OAAO;EAClE,MAAMC,IAAA,GAAOxB,uBAAA,CAAwBqB,OAAA,IAAWA,OAAA,CAAQG,IAAI;EAC5D,MAAMC,SAAA,GAAYzB,uBAAA,CAAwBqB,OAAA,IAAWA,OAAA,CAAQI,SAAS;EACtE,MAAMC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AA,GAAY6B,SAAA,GAAYjC,IAAI;IACvD,GAAG6B,gBAAgB;IACnBN,OAAA,EAASlC,gBAAA,CAAiBD,cAAA,CAAe4B,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOvB,KAAK,CAAC8B,OAAO,EAAEA,OAAA;IAC/DC,SAAA,EAAWnC,gBAAA,CAAiBD,cAAA,CAAe4B,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOvB,KAAK,CAAC+B,SAAS,EAAEA,SAAA;EACrE;EAEA,MAAMU,2BAAA,GAA8B3C,kBAAA,CAClC,CAAAyB,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOM,IAAI,MAAK,YAAY,CAAAN,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOM,IAAI,MAAK,MAAMN,KAAA,CAAMM,IAAI,GAAG,KAAK,EACpEU,iBAAA;EAGF,OAAO;IACL5B,SAAA;IACAV,QAAA,EAAUT,2BAAA,CACRS,QAAA,EACAS,aAAA,GAAgB0B,gBAAA,GAAmBlC,wBAAA,GAA2BqC,iBAAA,GAAoBE,2BAA2B;EAEjH;AACF;AAEA,MAAMf,gBAAA,GAAoBD,KAAA,IAAwC;EAChE,MAAMiB,UAAA,GAAcC,EAAA,IAClBA,EAAA,CAAGC,YAAY,CAAC,eAAgBD,EAAA,CAAGC,YAAY,CAAC,oBAAoBD,EAAA,CAAGE,YAAY,CAAC,qBAAqB;EAC3G,IAAInD,aAAA,CAAc+B,KAAA,CAAMqB,MAAM,KAAKJ,UAAA,CAAWjB,KAAA,CAAMqB,MAAM,GAAG;IAC3D,OAAO,IAAI;EACb;EAEA,OAAOpD,aAAA,CAAc+B,KAAA,CAAMsB,aAAa,KAAKL,UAAA,CAAWjB,KAAA,CAAMsB,aAAa;AAC7E"}
|
package/lib/selectable/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/selectable/index.ts"],"sourcesContent":["export * from './useCheckmarkStyles';\nexport * from './types';\n"],"mappings":"AAAA,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"sources":["../../src/selectable/index.ts"],"sourcesContent":["export * from './useCheckmarkStyles.styles';\nexport * from './types';\n"],"mappings":"AAAA,cAAc;AACd,cAAc"}
|
@@ -22,4 +22,4 @@ export const useCheckmarkStyles_unstable = state => {
|
|
22
22
|
state.checkmark.className = mergeClasses(styles.root, state.checked && styles.rootChecked, state.checkmark.className);
|
23
23
|
}
|
24
24
|
};
|
25
|
-
//# sourceMappingURL=useCheckmarkStyles.js.map
|
25
|
+
//# sourceMappingURL=useCheckmarkStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["mergeClasses","__styles","useStyles","root","a9b677","Bqenvij","Bcdw1i0","rootChecked","d","useCheckmarkStyles_unstable","state","styles","checkmark","className","checked"],"sources":["../../src/selectable/useCheckmarkStyles.styles.ts"],"sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport type { MenuItemSelectableState } from './types';\nimport type { MenuItemState } from '../components/MenuItem/MenuItem.types';\n\nconst useStyles = makeStyles({\n root: {\n width: '16px',\n height: '16px',\n visibility: 'hidden',\n },\n rootChecked: {\n visibility: 'visible',\n },\n});\n\n/**\n * Applies styles to a checkmark slot for selectable menu items\n *\n * @param state - should contain a `checkmark` slot\n */\nexport const useCheckmarkStyles_unstable = (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => {\n const styles = useStyles();\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(\n styles.root,\n state.checked && styles.rootChecked,\n state.checkmark.className,\n );\n }\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAAC,QAAA,QAAoB;AAIzC,MAAMC,SAAA,gBAAYD,QAAA;EAAAE,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,WAAA;IAAAD,OAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,EASlB;AAEA;;;;;AAKA,OAAO,MAAMC,2BAAA,GAA+BC,KAAA,IAAsE;EAChH,MAAMC,MAAA,GAAST,SAAA;EACf,IAAIQ,KAAA,CAAME,SAAS,EAAE;IACnBF,KAAA,CAAME,SAAS,CAACC,SAAS,GAAGb,YAAA,CAC1BW,MAAA,CAAOR,IAAI,EACXO,KAAA,CAAMI,OAAO,IAAIH,MAAA,CAAOJ,WAAW,EACnCG,KAAA,CAAME,SAAS,CAACC,SAAS;EAE7B;AACF"}
|
@@ -259,12 +259,13 @@ const useMenuOpenState = (state)=>{
|
|
259
259
|
}
|
260
260
|
}
|
261
261
|
}
|
262
|
+
// firstMount change should not re-run this effect
|
263
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
262
264
|
}, [
|
263
265
|
state.triggerRef,
|
264
266
|
state.isSubmenu,
|
265
267
|
open,
|
266
268
|
focusFirst,
|
267
|
-
firstMount,
|
268
269
|
targetDocument,
|
269
270
|
state.menuPopoverRef
|
270
271
|
]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Menu/useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside, useFirstMount } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = ['after', 'after-bottom', 'before-top', 'before', 'before-bottom', 'above'];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = props => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const {\n targetRef: triggerRef,\n containerRef: menuPopoverRef\n } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = props => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, {\n name,\n checkedItems\n }) => {\n var _props_onCheckedValueChange;\n (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {\n name,\n checkedItems\n });\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [checkedValues, onCheckedValueChange];\n};\nconst useMenuOpenState = state => {\n const {\n targetDocument\n } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n callback: event => setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const {\n findFirstFocusable\n } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.body)) {\n var\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n _state_triggerRef_current;\n (_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.focus();\n }\n }\n }\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, firstMount, targetDocument, state.menuPopoverRef]);\n return [open, setOpen];\n};\n//# sourceMappingURL=useMenu.js.map"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","firstFocusable","focus","firstMount","useFirst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QACpB,IAAIzD,MAAM;YACR4D;QACF,OAAO;YACL,IAAI,CAACI,YAAY;gBACf,IAAI,AAAC3C,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAe6C,aAAa,AAAD,MAAQ7C,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAe8C,IAAI,AAAD,GAAI;oBAC5L,IACA,mEAAmE;oBACnE,4EAA4E;oBAC5E,6EAA6E;oBAC7E,0EAA0E;oBAC1E,yEAAyE;oBACzE,gFAAgF;oBAChFvB;oBACCA,CAAAA,4BAA4BjC,MAAMf,UAAU,CAAC6C,OAAO,AAAD,MAAO,IAAI,IAAIG,8BAA8B,KAAK,IAAI,KAAK,IAAIA,0BAA0BmB,KAAK,EAAE;gBACtJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,GAAG;QAACpD,MAAMf,UAAU;QAAEe,MAAMrD,SAAS;QAAE0C;QAAM4D;QAAYI;QAAY3C;QAAgBV,MAAMb,cAAc;KAAC;IAC1G,OAAO;QAACE;QAAMC;KAAQ;AACxB,GACA,mCAAmC"}
|
1
|
+
{"version":3,"sources":["../../../lib/components/Menu/useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside, useFirstMount } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = ['after', 'after-bottom', 'before-top', 'before', 'before-bottom', 'above'];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = props => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const {\n targetRef: triggerRef,\n containerRef: menuPopoverRef\n } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = props => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, {\n name,\n checkedItems\n }) => {\n var _props_onCheckedValueChange;\n (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {\n name,\n checkedItems\n });\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [checkedValues, onCheckedValueChange];\n};\nconst useMenuOpenState = state => {\n const {\n targetDocument\n } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n callback: event => setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const {\n findFirstFocusable\n } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.body)) {\n var\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n _state_triggerRef_current;\n (_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.focus();\n }\n }\n }\n // firstMount change should not re-run this effect\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, targetDocument, state.menuPopoverRef]);\n return [open, setOpen];\n};\n//# sourceMappingURL=useMenu.js.map"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","firstFocusable","focus","firstMount","useFirstMount","activeElement","body"],"mappings":";;;;+BAoBaA;;aAAAA;;;6DApBU;kCACgE;gCAC6B;qCACpE;6BAChB;8BACA;6BACQ;uBACc;8BACzB;AAC7B,yEAAyE;AACzE,0CAA0C;AAC1C,MAAMC,2BAA2B;IAAC;IAAS;IAAgB;IAAc;IAAU;IAAiB;CAAQ;AASrG,MAAMD,mBAAmBE,CAAAA,QAAS;IACvC,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EACJC,YAAa,IAAG,EAChBC,QAAS,KAAK,CAAA,EACdC,eAAgB,KAAK,CAAA,EACrBC,UAAW,KAAK,CAAA,EAChBC,eAAgB,KAAK,CAAA,EACrBC,eAAgB,KAAK,CAAA,EACrBC,oBAAqB,KAAK,CAAA,EAC1BC,aAAcT,UAAS,EACvBU,qBAAoB,EACpBC,WAAY,IAAI,CAAA,EACjB,GAAGZ;IACJ,MAAMa,YAAYC,IAAAA,qBAAK,EAAC;IACxB,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,mBAAmB;QACvBC,UAAUlB,YAAY,UAAU,OAAO;QACvCmB,OAAOnB,YAAY,QAAQ,OAAO;QAClCoB,QAAQrB,MAAMQ,aAAa,GAAGO,gBAAgBO,SAAS;QACvDC,mBAAmBtB,YAAYF,2BAA2BuB,SAAS;QACnE,GAAGE,IAAAA,6CAA2B,EAACxB,MAAMyB,WAAW,CAAC;IACnD;IACA,MAAMC,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAAC7B,MAAM0B,QAAQ;IACtD,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,SAASO,MAAM,KAAK,GAAG;YACzB,sCAAsC;YACtCC,QAAQC,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AI,KAAK,IAAIA,eAAeC,KAAK,EAAE;IACxF,GAAG;QAACL;QAAoB/C,MAAMb,cAAc;KAAC;IAC7C,MAAMkE,aAAaC,IAAAA,6BAAa;IAChCjF,OAAMyE,SAAS,CAAC,IAAM;QACpB,IAAIzD,MAAM;YACR4D;QACF,OAAO;YACL,IAAI,CAACI,YAAY;gBACf,IAAI,AAAC3C,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAe6C,aAAa,AAAD,MAAQ7C,CAAAA,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAe8C,IAAI,AAAD,GAAI;oBAC5L,IACA,mEAAmE;oBACnE,4EAA4E;oBAC5E,6EAA6E;oBAC7E,0EAA0E;oBAC1E,yEAAyE;oBACzE,gFAAgF;oBAChFvB;oBACCA,CAAAA,4BAA4BjC,MAAMf,UAAU,CAAC6C,OAAO,AAAD,MAAO,IAAI,IAAIG,8BAA8B,KAAK,IAAI,KAAK,IAAIA,0BAA0BmB,KAAK,EAAE;gBACtJ,CAAC;YACH,CAAC;QACH,CAAC;IACD,kDAAkD;IAClD,uDAAuD;IACzD,GAAG;QAACpD,MAAMf,UAAU;QAAEe,MAAMrD,SAAS;QAAE0C;QAAM4D;QAAYvC;QAAgBV,MAAMb,cAAc;KAAC;IAC9F,OAAO;QAACE;QAAMC;KAAQ;AACxB,GACA,mCAAmC"}
|
@@ -9,14 +9,13 @@ Object.defineProperty(exports, "MenuDivider", {
|
|
9
9
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
11
|
const _useMenuDivider = require("./useMenuDivider");
|
12
|
-
const
|
12
|
+
const _useMenuDividerStylesStyles = require("./useMenuDividerStyles.styles");
|
13
13
|
const _renderMenuDivider = require("./renderMenuDivider");
|
14
14
|
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
15
15
|
const MenuDivider = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
16
16
|
const state = (0, _useMenuDivider.useMenuDivider_unstable)(props, ref);
|
17
|
-
(0,
|
18
|
-
|
19
|
-
useCustomStyles(state);
|
17
|
+
(0, _useMenuDividerStylesStyles.useMenuDividerStyles_unstable)(state);
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuDividerStyles_unstable')(state);
|
20
19
|
return (0, _renderMenuDivider.renderMenuDivider_unstable)(state);
|
21
20
|
});
|
22
21
|
MenuDivider.displayName = 'MenuDivider'; //# sourceMappingURL=MenuDivider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuDivider/MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport {
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuDivider/MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles.styles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.\n */\nexport const MenuDivider = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuDivider_unstable(props, ref);\n useMenuDividerStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);\n return renderMenuDivider_unstable(state);\n});\nMenuDivider.displayName = 'MenuDivider';\n//# sourceMappingURL=MenuDivider.js.map"],"names":["MenuDivider","React","forwardRef","props","ref","state","useMenuDivider_unstable","useMenuDividerStyles_unstable","useCustomStyleHook_unstable","renderMenuDivider_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACiB;4CACM;mCACH;qCACC;AAIrC,MAAMA,cAAc,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,yDAA6B,EAACF;IAC9BG,IAAAA,gDAA2B,EAAC,iCAAiCH;IAC7D,OAAOI,IAAAA,6CAA0B,EAACJ;AACpC;AACAL,YAAYU,WAAW,GAAG,eAC1B,uCAAuC"}
|
@@ -7,7 +7,7 @@ _exportStar(require("./MenuDivider.types"), exports);
|
|
7
7
|
_exportStar(require("./MenuDivider"), exports);
|
8
8
|
_exportStar(require("./renderMenuDivider"), exports);
|
9
9
|
_exportStar(require("./useMenuDivider"), exports);
|
10
|
-
_exportStar(require("./useMenuDividerStyles"), exports);
|
10
|
+
_exportStar(require("./useMenuDividerStyles.styles"), exports);
|
11
11
|
//# sourceMappingURL=index.js.map
|
12
12
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuDivider/index.js"],"sourcesContent":["export * from './MenuDivider.types';\nexport * from './MenuDivider';\nexport * from './renderMenuDivider';\nexport * from './useMenuDivider';\nexport * from './useMenuDividerStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuDivider/index.js"],"sourcesContent":["export * from './MenuDivider.types';\nexport * from './MenuDivider';\nexport * from './renderMenuDivider';\nexport * from './useMenuDivider';\nexport * from './useMenuDividerStyles.styles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -49,6 +49,6 @@ const useMenuDividerStyles_unstable = (state)=>{
|
|
49
49
|
const styles = useStyles();
|
50
50
|
state.root.className = (0, _react.mergeClasses)(menuDividerClassNames.root, styles.root, state.root.className);
|
51
51
|
return state;
|
52
|
-
}; //# sourceMappingURL=useMenuDividerStyles.js.map
|
52
|
+
}; //# sourceMappingURL=useMenuDividerStyles.styles.js.map
|
53
53
|
|
54
|
-
//# sourceMappingURL=useMenuDividerStyles.js.map
|
54
|
+
//# sourceMappingURL=useMenuDividerStyles.styles.js.map
|