@fluentui/react-menu 9.5.3 → 9.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +139 -1
- package/CHANGELOG.md +37 -2
- package/dist/index.d.ts +9 -19
- package/lib/components/Menu/Menu.js +0 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/renderMenu.js +0 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +16 -34
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +2 -2
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +0 -1
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +0 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +10 -12
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +0 -1
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +2 -2
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +0 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -12
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +0 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +12 -7
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +0 -5
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +34 -47
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +108 -117
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -6
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -4
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +0 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +10 -6
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +3 -4
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.js +0 -1
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js +2 -2
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +13 -29
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +2 -2
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +6 -9
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +0 -1
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +4 -5
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +6 -13
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +32 -35
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +0 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +0 -6
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -15
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +2 -3
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +0 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +4 -24
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js +0 -1
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js +0 -2
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.js +7 -11
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +0 -1
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +4 -11
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-amd/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib-amd/components/MenuItem/useMenuItem.js +26 -30
- package/lib-amd/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-amd/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-amd/components/MenuList/useMenuList.js +5 -4
- package/lib-amd/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/Menu.js +0 -2
- package/lib-commonjs/Menu.js.map +1 -1
- package/lib-commonjs/MenuDivider.js +0 -2
- package/lib-commonjs/MenuDivider.js.map +1 -1
- package/lib-commonjs/MenuGroup.js +0 -2
- package/lib-commonjs/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroupHeader.js +0 -2
- package/lib-commonjs/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/MenuItem.js +0 -2
- package/lib-commonjs/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +0 -2
- package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/MenuItemRadio.js +0 -2
- package/lib-commonjs/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/MenuList.js +0 -2
- package/lib-commonjs/MenuList.js.map +1 -1
- package/lib-commonjs/MenuPopover.js +0 -2
- package/lib-commonjs/MenuPopover.js.map +1 -1
- package/lib-commonjs/MenuSplitGroup.js +0 -2
- package/lib-commonjs/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/MenuTrigger.js +0 -2
- package/lib-commonjs/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js +0 -6
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +0 -6
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +0 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +16 -46
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +2 -4
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +0 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +0 -6
- package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -6
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +0 -4
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +10 -16
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +0 -7
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.js +0 -7
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -7
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +0 -3
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -6
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +0 -5
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -16
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +0 -6
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +0 -6
- package/lib-commonjs/components/MenuItem/index.js.map +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +12 -11
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +0 -8
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +33 -58
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +108 -124
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -10
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -10
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +3 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +0 -7
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +0 -7
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +2 -7
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +13 -37
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +2 -4
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -12
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +0 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +0 -6
- package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -10
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +6 -22
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +32 -39
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -6
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +0 -13
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -20
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +2 -7
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js +0 -5
- package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +0 -5
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -34
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +0 -3
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js +0 -4
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +0 -5
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +0 -4
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +0 -6
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -32
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +0 -3
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/types.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -13
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +0 -6
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +4 -17
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +10 -10
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,uBAAuB,GAAIC,KAAoB,IAAI;EAC9D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAgBH,KAAK,CAAC;EAE3D,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BJ,KAAK,CAACK,SAAS,IAAIF,oBAACH,KAAK,CAACK,SAAS;IAAA,GAAKJ,SAAS,CAACI;EAAS,EAAI,EAC/DL,KAAK,CAACM,IAAI,IAAIH,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,EAChDN,KAAK,CAACO,OAAO,IAAIJ,oBAACH,KAAK,CAACO,OAAO;IAAA,GAAKN,SAAS,CAACM;EAAO,EAAI,EACzDP,KAAK,CAACQ,gBAAgB,IAAIL,oBAACH,KAAK,CAACQ,gBAAgB;IAAA,GAAKP,SAAS,CAACO;EAAgB,EAAI,EACpFR,KAAK,CAACS,gBAAgB,IAAIN,oBAACH,KAAK,CAACS,gBAAgB;IAAA,GAAKR,SAAS,CAACQ;EAAgB,EAAI,CAC1E;AAEjB,CAAC;AAZYC,+BAAuB","names":["renderMenuItem_unstable","state","slots","slotProps","react_utilities_1","React","root","checkmark","icon","content","secondaryContent","submenuIndicator","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItem_unstable = (state: MenuItemState) => {\n const { slots, slotProps } = getSlots<MenuItemSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.checkmark && <slots.checkmark {...slotProps.checkmark} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.content && <slots.content {...slotProps.content} />}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n {slots.submenuIndicator && <slots.submenuIndicator {...slotProps.submenuIndicator} />}\n </slots.root>\n );\n};\n"]}
|
@@ -4,31 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useCharacterSearch = void 0;
|
7
|
-
|
8
7
|
const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
|
9
|
-
|
10
8
|
const useCharacterSearch = (state, ref) => {
|
11
9
|
const setFocusByFirstCharacter = menuListContext_1.useMenuListContext_unstable(context => context.setFocusByFirstCharacter);
|
12
10
|
const {
|
13
11
|
onKeyDown: originalOnKeyDown
|
14
12
|
} = state.root;
|
15
|
-
|
16
13
|
state.root.onKeyDown = e => {
|
17
14
|
var _a;
|
18
|
-
|
19
15
|
originalOnKeyDown === null || originalOnKeyDown === void 0 ? void 0 : originalOnKeyDown(e);
|
20
|
-
|
21
16
|
if (((_a = e.key) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
22
17
|
return;
|
23
18
|
}
|
24
|
-
|
25
19
|
if (ref.current) {
|
26
20
|
setFocusByFirstCharacter === null || setFocusByFirstCharacter === void 0 ? void 0 : setFocusByFirstCharacter(e, ref.current);
|
27
21
|
}
|
28
22
|
};
|
29
|
-
|
30
23
|
return state;
|
31
24
|
};
|
32
|
-
|
33
25
|
exports.useCharacterSearch = useCharacterSearch;
|
34
26
|
//# sourceMappingURL=useCharacterSearch.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AAIO,MAAMA,kBAAkB,GAAG,CAACC,KAAoB,EAAEC,GAAiC,KAAI;EAC5F,MAAMC,wBAAwB,GAAGC,6CAA2B,CAACC,OAAO,IAAIA,OAAO,CAACF,wBAAwB,CAAC;EAEzG,MAAM;IAAEG,SAAS,EAAEC;EAAiB,CAAE,GAAGN,KAAK,CAACO,IAAI;EAEnDP,KAAK,CAACO,IAAI,CAACF,SAAS,GAAIG,CAAqD,IAAI;;IAC/EF,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAGE,CAAC,CAAC;IAEtB,IAAI,QAAC,CAACC,GAAG,0CAAEC,MAAM,IAAG,CAAC,EAAE;MACrB;;IAGF,IAAIT,GAAG,CAACU,OAAO,EAAE;MACfT,wBAAwB,aAAxBA,wBAAwB,uBAAxBA,wBAAwB,CAAGM,CAAC,EAAEP,GAAG,CAACU,OAAO,CAAC;;EAE9C,CAAC;EAED,OAAOX,KAAK;AACd,CAAC;AAlBYY,0BAAkB","names":["useCharacterSearch","state","ref","setFocusByFirstCharacter","menuListContext_1","context","onKeyDown","originalOnKeyDown","root","e","key","length","current","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/useCharacterSearch.ts"],"sourcesContent":["import * as React from 'react';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport type { MenuItemState } from '../../components/index';\nimport type { ARIAButtonElementIntersection } from '@fluentui/react-aria';\n\nexport const useCharacterSearch = (state: MenuItemState, ref: React.RefObject<HTMLElement>) => {\n const setFocusByFirstCharacter = useMenuListContext_unstable(context => context.setFocusByFirstCharacter);\n\n const { onKeyDown: originalOnKeyDown } = state.root;\n\n state.root.onKeyDown = (e: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n originalOnKeyDown?.(e);\n\n if (e.key?.length > 1) {\n return;\n }\n\n if (ref.current) {\n setFocusByFirstCharacter?.(e, ref.current);\n }\n };\n\n return state;\n};\n"]}
|
@@ -4,40 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItem_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
9
|
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
13
|
-
|
14
10
|
const useCharacterSearch_1 = /*#__PURE__*/require("./useCharacterSearch");
|
15
|
-
|
16
11
|
const menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerContext");
|
17
|
-
|
18
12
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
19
|
-
|
20
13
|
const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
|
21
|
-
|
22
14
|
const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
|
23
|
-
|
24
15
|
const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
|
25
|
-
|
26
16
|
const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
|
27
|
-
|
28
17
|
const ChevronRightIcon = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.ChevronRightFilled, react_icons_1.ChevronRightRegular);
|
29
18
|
const ChevronLeftIcon = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.ChevronLeftFilled, react_icons_1.ChevronLeftRegular);
|
30
19
|
/**
|
31
20
|
* Returns the props and state required to render the component
|
32
21
|
*/
|
33
|
-
|
34
22
|
const useMenuItem_unstable = (props, ref) => {
|
35
23
|
const isSubmenuTrigger = menuTriggerContext_1.useMenuTriggerContext_unstable();
|
36
24
|
const persistOnClickContext = menuContext_1.useMenuContext_unstable(context => context.persistOnItemClick);
|
37
25
|
const {
|
38
26
|
as = 'div',
|
39
|
-
disabled,
|
40
|
-
disabledFocusable,
|
27
|
+
disabled = false,
|
41
28
|
hasSubmenu = isSubmenuTrigger,
|
42
29
|
persistOnClick = persistOnClickContext
|
43
30
|
} = props;
|
@@ -49,10 +36,9 @@ const useMenuItem_unstable = (props, ref) => {
|
|
49
36
|
} = react_shared_contexts_1.useFluent_unstable();
|
50
37
|
const innerRef = React.useRef(null);
|
51
38
|
const dismissedWithKeyboardRef = React.useRef(false);
|
52
|
-
const isDisabled = Boolean(disabled || disabledFocusable);
|
53
39
|
const state = {
|
54
40
|
hasSubmenu,
|
55
|
-
disabled
|
41
|
+
disabled,
|
56
42
|
persistOnClick,
|
57
43
|
components: {
|
58
44
|
root: 'div',
|
@@ -63,48 +49,38 @@ const useMenuItem_unstable = (props, ref) => {
|
|
63
49
|
secondaryContent: 'span'
|
64
50
|
},
|
65
51
|
isNativeButton: as === 'button',
|
66
|
-
root: react_utilities_1.getNativeElementProps(as, react_aria_1.
|
52
|
+
root: react_utilities_1.getNativeElementProps(as, react_aria_1.useARIAButtonProps(as, {
|
53
|
+
role: 'menuitem',
|
54
|
+
...props,
|
67
55
|
disabled: false,
|
68
|
-
disabledFocusable:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
open: false,
|
97
|
-
keyboard: dismissedWithKeyboardRef.current,
|
98
|
-
bubble: true,
|
99
|
-
type: 'menuItemClick',
|
100
|
-
event
|
101
|
-
});
|
102
|
-
dismissedWithKeyboardRef.current = false;
|
103
|
-
}
|
104
|
-
|
105
|
-
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
106
|
-
})
|
107
|
-
}
|
56
|
+
disabledFocusable: disabled,
|
57
|
+
ref: react_utilities_1.useMergedRefs(ref, innerRef),
|
58
|
+
onKeyDown: react_utilities_1.useEventCallback(event => {
|
59
|
+
var _a;
|
60
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
61
|
+
if (!event.isDefaultPrevented() && (event.key === keyboard_keys_1.Space || event.key === keyboard_keys_1.Enter)) {
|
62
|
+
dismissedWithKeyboardRef.current = true;
|
63
|
+
}
|
64
|
+
}),
|
65
|
+
onMouseEnter: react_utilities_1.useEventCallback(event => {
|
66
|
+
var _a, _b;
|
67
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
68
|
+
(_b = props.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(props, event);
|
69
|
+
}),
|
70
|
+
onClick: react_utilities_1.useEventCallback(event => {
|
71
|
+
var _a;
|
72
|
+
if (!hasSubmenu && !persistOnClick) {
|
73
|
+
setOpen(event, {
|
74
|
+
open: false,
|
75
|
+
keyboard: dismissedWithKeyboardRef.current,
|
76
|
+
bubble: true,
|
77
|
+
type: 'menuItemClick',
|
78
|
+
event
|
79
|
+
});
|
80
|
+
dismissedWithKeyboardRef.current = false;
|
81
|
+
}
|
82
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
83
|
+
})
|
108
84
|
})),
|
109
85
|
icon: react_utilities_1.resolveShorthand(props.icon, {
|
110
86
|
required: hasIcons
|
@@ -129,6 +105,5 @@ const useMenuItem_unstable = (props, ref) => {
|
|
129
105
|
useCharacterSearch_1.useCharacterSearch(state, innerRef);
|
130
106
|
return state;
|
131
107
|
};
|
132
|
-
|
133
108
|
exports.useMenuItem_unstable = useMenuItem_unstable;
|
134
109
|
//# sourceMappingURL=useMenuItem.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"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","names":["ChevronRightIcon","react_icons_1","ChevronLeftIcon","useMenuItem_unstable","props","ref","isSubmenuTrigger","menuTriggerContext_1","persistOnClickContext","menuContext_1","context","persistOnItemClick","as","disabled","hasSubmenu","persistOnClick","hasIcons","menuListContext_1","hasCheckmarks","setOpen","dir","react_shared_contexts_1","innerRef","React","useRef","dismissedWithKeyboardRef","state","components","root","icon","checkmark","submenuIndicator","content","secondaryContent","isNativeButton","react_utilities_1","react_aria_1","role","disabledFocusable","onKeyDown","event","isDefaultPrevented","key","keyboard_keys_1","current","onMouseEnter","focus","onClick","open","keyboard","bubble","type","required","defaultProps","children","useCharacterSearch_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/useMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, resolveShorthand, useMergedRefs, getNativeElementProps } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useCharacterSearch } from './useCharacterSearch';\nimport { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';\nimport {\n ChevronRightFilled,\n ChevronRightRegular,\n ChevronLeftFilled,\n ChevronLeftRegular,\n bundleIcon,\n} from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport type { MenuItemProps, MenuItemState } from './MenuItem.types';\nimport { ARIAButtonElement, ARIAButtonElementIntersection, useARIAButtonProps } from '@fluentui/react-aria';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n\nconst ChevronRightIcon = bundleIcon(ChevronRightFilled, ChevronRightRegular);\nconst ChevronLeftIcon = bundleIcon(ChevronLeftFilled, ChevronLeftRegular);\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuItem_unstable = (props: MenuItemProps, ref: React.Ref<ARIAButtonElement<'div'>>): MenuItemState => {\n const isSubmenuTrigger = useMenuTriggerContext_unstable();\n const persistOnClickContext = useMenuContext_unstable(context => context.persistOnItemClick);\n const { as = 'div', disabled = false, hasSubmenu = isSubmenuTrigger, persistOnClick = persistOnClickContext } = props;\n const hasIcons = useMenuListContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuListContext_unstable(context => context.hasCheckmarks);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n\n const { dir } = useFluent();\n const innerRef = React.useRef<ARIAButtonElementIntersection<'div'>>(null);\n const dismissedWithKeyboardRef = React.useRef(false);\n\n const state: MenuItemState = {\n hasSubmenu,\n disabled,\n persistOnClick,\n components: {\n root: 'div',\n icon: 'span',\n checkmark: 'span',\n submenuIndicator: 'span',\n content: 'span',\n secondaryContent: 'span',\n },\n isNativeButton: as === 'button',\n root: getNativeElementProps(\n as,\n useARIAButtonProps(as, {\n role: 'menuitem',\n ...props,\n disabled: false,\n disabledFocusable: disabled,\n ref: useMergedRefs(ref, innerRef) as React.Ref<ARIAButtonElementIntersection<'div'>>,\n onKeyDown: useEventCallback(event => {\n props.onKeyDown?.(event);\n if (!event.isDefaultPrevented() && (event.key === Space || event.key === Enter)) {\n dismissedWithKeyboardRef.current = true;\n }\n }),\n onMouseEnter: useEventCallback(event => {\n innerRef.current?.focus();\n\n props.onMouseEnter?.(event);\n }),\n onClick: useEventCallback(event => {\n if (!hasSubmenu && !persistOnClick) {\n setOpen(event, {\n open: false,\n keyboard: dismissedWithKeyboardRef.current,\n bubble: true,\n type: 'menuItemClick',\n event,\n });\n dismissedWithKeyboardRef.current = false;\n }\n\n props.onClick?.(event);\n }),\n }),\n ),\n icon: resolveShorthand(props.icon, { required: hasIcons }),\n checkmark: resolveShorthand(props.checkmark, { required: hasCheckmarks }),\n submenuIndicator: resolveShorthand(props.submenuIndicator, {\n required: hasSubmenu,\n defaultProps: {\n children: dir === 'ltr' ? <ChevronRightIcon /> : <ChevronLeftIcon />,\n },\n }),\n content: resolveShorthand(props.content, {\n required: !!props.children,\n defaultProps: { children: props.children },\n }),\n secondaryContent: resolveShorthand(props.secondaryContent),\n };\n useCharacterSearch(state, innerRef);\n return state;\n};\n"]}
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemStyles_unstable = exports.menuItemClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
11
|
-
|
12
9
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
|
-
|
14
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
15
|
-
|
16
11
|
const index_1 = /*#__PURE__*/require("../../selectable/index");
|
17
|
-
|
18
12
|
exports.menuItemClassNames = {
|
19
13
|
root: 'fui-MenuItem',
|
20
14
|
icon: 'fui-MenuItem__icon',
|
@@ -23,155 +17,145 @@ exports.menuItemClassNames = {
|
|
23
17
|
content: 'fui-MenuItem__content',
|
24
18
|
secondaryContent: 'fui-MenuItem__secondaryContent'
|
25
19
|
};
|
26
|
-
|
27
20
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
21
|
+
focusIndicator: {
|
22
|
+
Brovlpu: "ftqa4ok",
|
23
|
+
B486eqv: "f2hkw1w",
|
24
|
+
B8q5s1w: "f8hki3x",
|
25
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
26
|
+
n8qw10: "f1bjia2o",
|
27
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
28
|
+
Bm4h7ae: "f15bsgw9",
|
29
|
+
B7ys5i9: "f14e48fq",
|
30
|
+
Busjfv9: "f18yb2kv",
|
31
|
+
Bhk32uz: "fd6o370",
|
32
|
+
Bf4ptjt: "fh1cnn4",
|
33
|
+
kclons: ["fy7oxxb", "f184ne2d"],
|
34
|
+
Bhdgwq3: "fpukqih",
|
35
|
+
Blkhhs4: ["f184ne2d", "fy7oxxb"],
|
36
|
+
Bqtpl0w: "frrh606",
|
37
|
+
clg4pj: ["f1v5zibi", "fo2hd23"],
|
38
|
+
hgwjuy: "ful5kiu",
|
39
|
+
Bonggc9: ["fo2hd23", "f1v5zibi"],
|
40
|
+
B1tsrr9: ["f1jqcqds", "ftffrms"],
|
41
|
+
Dah5zi: ["ftffrms", "f1jqcqds"],
|
42
|
+
Bkh64rk: ["f2e7qr6", "fsr1zz6"],
|
43
|
+
qqdqy8: ["fsr1zz6", "f2e7qr6"],
|
44
|
+
B6dhp37: "f1dvezut",
|
45
|
+
i03rao: ["fd0oaoj", "f1cwg4i8"],
|
46
|
+
Boxcth7: "fjvm52t",
|
47
|
+
Bsom6fd: ["f1cwg4i8", "fd0oaoj"],
|
48
|
+
J0r882: "fdiulkx",
|
49
|
+
Bjwuhne: "f1yalx80",
|
50
|
+
Ghsupd: ["fq22d5a", "f1jw7pan"],
|
51
|
+
Bule8hv: ["f1jw7pan", "fq22d5a"]
|
59
52
|
},
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
53
|
+
resetButton: {
|
54
|
+
B7ck84d: "f1e4lqlz",
|
55
|
+
De3pzq: "f1u2r49w",
|
56
|
+
sj55zd: "f1ym3bx4",
|
57
|
+
Bahqtrf: "f1mo0ibp",
|
58
|
+
Be2twd7: "fjoy568",
|
59
|
+
Bg96gwp: "fytdu2e",
|
60
|
+
g2u3we: "f1p3nwhy",
|
61
|
+
h3c5rm: ["f11589ue", "f1pdflbu"],
|
62
|
+
B9xav0g: "f1q5o8ev",
|
63
|
+
zhjwy3: ["f1pdflbu", "f11589ue"],
|
64
|
+
B68tc82: "f1mtd64y",
|
65
|
+
Bmxbyg5: "f1y7q3j9",
|
66
|
+
z8tnut: "f1g0x7ka",
|
67
|
+
z189sj: ["fhxju0i", "f1cnd47f"],
|
68
|
+
Byoj8tv: "f1qch9an",
|
69
|
+
uwmqm3: ["f1cnd47f", "fhxju0i"],
|
70
|
+
Bv0vk6g: "f37px4s",
|
71
|
+
fsow6f: "fgusgyc"
|
79
72
|
},
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
73
|
+
root: {
|
74
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
75
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
76
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
77
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
78
|
+
qhf8xq: "f10pi13n",
|
79
|
+
sj55zd: "fkfq4zb",
|
80
|
+
De3pzq: "fxugw4r",
|
81
|
+
z189sj: ["f81rol6", "frdkuqy"],
|
82
|
+
uwmqm3: ["frdkuqy", "f81rol6"],
|
83
|
+
Bqenvij: "f1d2rq10",
|
84
|
+
mc9l5x: "f22iagw",
|
85
|
+
Bt984gj: "f122n59",
|
86
|
+
Be2twd7: "fkhj508",
|
87
|
+
Bceei9c: "f1k6fduh",
|
88
|
+
i8kkvl: "f1q8lukm",
|
89
|
+
Belr9w4: "f1ma2n7n",
|
90
|
+
Jwef8y: "f1knas48",
|
91
|
+
Bi91k9c: "fnwyq0v",
|
92
|
+
Bk3fhr4: "ft1hn21",
|
93
|
+
Bmfj8id: "fuxngvv",
|
94
|
+
Bg7n49j: "fp258yr",
|
95
|
+
famaaq: "f1xqy1su"
|
103
96
|
},
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
97
|
+
content: {
|
98
|
+
uwmqm3: ["f161knb0", "f12huiiw"],
|
99
|
+
z189sj: ["f12huiiw", "f161knb0"],
|
100
|
+
De3pzq: "f3rmtva",
|
101
|
+
Bh6795r: "fqerorx"
|
109
102
|
},
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
103
|
+
secondaryContent: {
|
104
|
+
uwmqm3: ["f161knb0", "f12huiiw"],
|
105
|
+
z189sj: ["f12huiiw", "f161knb0"],
|
106
|
+
sj55zd: "f11d4kpn",
|
107
|
+
Bi91k9c: "f1jp5ecu",
|
108
|
+
t0hwav: "fc1cou1"
|
116
109
|
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
110
|
+
icon: {
|
111
|
+
a9b677: "f64fuq3",
|
112
|
+
Bqenvij: "fjamq6b",
|
113
|
+
Be2twd7: "fe5j1ua",
|
114
|
+
Bg96gwp: "fez10in",
|
115
|
+
Bt984gj: "f122n59",
|
116
|
+
mc9l5x: "ftuwxu6",
|
117
|
+
Brf1p80: "f4d9j23"
|
125
118
|
},
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
119
|
+
submenuIndicator: {
|
120
|
+
a9b677: "f64fuq3",
|
121
|
+
Bqenvij: "fjamq6b",
|
122
|
+
Be2twd7: "fe5j1ua",
|
123
|
+
Bg96gwp: "fez10in",
|
124
|
+
Bt984gj: "f122n59",
|
125
|
+
mc9l5x: "ftuwxu6",
|
126
|
+
Brf1p80: "f4d9j23"
|
134
127
|
},
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
128
|
+
disabled: {
|
129
|
+
sj55zd: "f1s2aq7o",
|
130
|
+
Bi91k9c: "fvgxktp",
|
131
|
+
t0hwav: "ft33916"
|
139
132
|
}
|
140
133
|
}, {
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
134
|
+
f: [".ftqa4ok:focus{outline-style:none;}", ".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}", ".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}"],
|
135
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
136
|
+
d: [".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fdiulkx[data-fui-focus-visible]::after{top:-2px;}", ".f1yalx80[data-fui-focus-visible]::after{bottom:-2px;}", ".fq22d5a[data-fui-focus-visible]::after{left:-2px;}", ".f1jw7pan[data-fui-focus-visible]::after{right:-2px;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".f1d2rq10{height:32px;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1k6fduh{cursor:pointer;}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}", ".f3rmtva{background-color:transparent;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fe5j1ua{font-size:20px;}", ".fez10in{line-height:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"],
|
137
|
+
h: [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".ft1hn21:hover .fui-Icon-filled{display:inline;}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".fp258yr:hover .fui-MenuItem__icon{color:var(--colorNeutralForeground2BrandSelected);}", ".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"]
|
145
138
|
});
|
146
139
|
/** Applies style classnames to slots */
|
147
|
-
|
148
|
-
|
149
140
|
const useMenuItemStyles_unstable = state => {
|
150
141
|
const styles = useStyles();
|
151
142
|
state.root.className = react_1.mergeClasses(exports.menuItemClassNames.root, state.isNativeButton && styles.resetButton, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);
|
152
|
-
|
153
143
|
if (state.content) {
|
154
144
|
state.content.className = react_1.mergeClasses(exports.menuItemClassNames.content, styles.content, state.content.className);
|
155
145
|
}
|
156
|
-
|
157
146
|
if (state.checkmark) {
|
158
147
|
state.checkmark.className = react_1.mergeClasses(exports.menuItemClassNames.checkmark, state.checkmark.className);
|
159
148
|
}
|
160
|
-
|
161
149
|
if (state.secondaryContent) {
|
162
150
|
state.secondaryContent.className = react_1.mergeClasses(exports.menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);
|
163
151
|
}
|
164
|
-
|
165
152
|
if (state.icon) {
|
166
153
|
state.icon.className = react_1.mergeClasses(exports.menuItemClassNames.icon, styles.icon, state.icon.className);
|
167
154
|
}
|
168
|
-
|
169
155
|
if (state.submenuIndicator) {
|
170
156
|
state.submenuIndicator.className = react_1.mergeClasses(exports.menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);
|
171
157
|
}
|
172
|
-
|
173
158
|
index_1.useCheckmarkStyles_unstable(state);
|
174
159
|
};
|
175
|
-
|
176
160
|
exports.useMenuItemStyles_unstable = useMenuItemStyles_unstable;
|
177
161
|
//# sourceMappingURL=useMenuItemStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"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","names":["exports","root","icon","checkmark","submenuIndicator","content","secondaryContent","useStyles","react_1","useMenuItemStyles_unstable","state","styles","className","isNativeButton","resetButton","focusIndicator","disabled","index_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/useMenuItemStyles.ts"],"sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport type { MenuItemCheckboxState } from '../MenuItemCheckbox/index';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuItemClassNames: SlotClassNames<MenuItemSlots> = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createFocusOutlineStyle(),\n // TODO: this should be extracted to another package\n resetButton: {\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.borderColor('transparent'),\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n },\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n position: 'relative',\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackground1,\n paddingRight: '10px',\n paddingLeft: '10px',\n height: '32px',\n display: 'flex',\n alignItems: 'center',\n fontSize: tokens.fontSizeBase300,\n cursor: 'pointer',\n ...shorthands.gap('4px'),\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n [`& .${menuItemClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n },\n\n userSelect: 'none',\n },\n content: {\n paddingLeft: '2px',\n paddingRight: '2px',\n backgroundColor: 'transparent',\n flexGrow: 1,\n },\n secondaryContent: {\n paddingLeft: '2px',\n paddingRight: '2px',\n color: tokens.colorNeutralForeground3,\n ':hover': {\n color: tokens.colorNeutralForeground3Hover,\n },\n ':focus': {\n color: tokens.colorNeutralForeground3Hover,\n },\n },\n icon: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n submenuIndicator: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n ':hover': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':focus': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/** Applies style classnames to slots */\nexport const useMenuItemStyles_unstable = (state: MenuItemState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n menuItemClassNames.root,\n state.isNativeButton && styles.resetButton,\n styles.root,\n styles.focusIndicator,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemClassNames.secondaryContent,\n !state.disabled && styles.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(\n menuItemClassNames.submenuIndicator,\n styles.submenuIndicator,\n state.submenuIndicator.className,\n );\n }\n useCheckmarkStyles_unstable(state as MenuItemCheckboxState);\n};\n"]}
|