@fluentui/react-menu 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +578 -27
- package/CHANGELOG.md +132 -18
- package/Spec.md +21 -16
- package/dist/react-menu.d.ts +143 -72
- package/lib/Menu.js.map +1 -1
- package/lib/MenuDivider.js.map +1 -1
- package/lib/MenuGroup.js.map +1 -1
- package/lib/MenuGroupHeader.js.map +1 -1
- package/lib/MenuItem.js.map +1 -1
- package/lib/MenuItemCheckbox.js.map +1 -1
- package/lib/MenuItemRadio.js.map +1 -1
- package/lib/MenuList.js.map +1 -1
- package/lib/MenuPopover.js.map +1 -1
- package/lib/MenuSplitGroup.d.ts +1 -0
- package/lib/MenuSplitGroup.js +2 -0
- package/lib/MenuSplitGroup.js.map +1 -0
- package/lib/MenuTrigger.js.map +1 -1
- package/lib/components/Menu/Menu.js +7 -7
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +3 -2
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/Menu/renderMenu.d.ts +1 -1
- package/lib/components/Menu/renderMenu.js +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.d.ts +2 -2
- package/lib/components/Menu/useMenu.js +119 -128
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
- package/lib/components/Menu/useMenuContextValues.js +35 -33
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +8 -8
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
- package/lib/components/MenuDivider/index.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +9 -7
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +7 -5
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +10 -8
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
- package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
- package/lib/components/MenuGroup/index.d.ts +1 -0
- package/lib/components/MenuGroup/index.js +1 -0
- package/lib/components/MenuGroup/index.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +10 -7
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
- package/lib/components/MenuGroupHeader/index.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +7 -5
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.d.ts +1 -1
- package/lib/components/MenuItem/MenuItem.js +8 -10
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib/components/MenuItem/index.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +12 -8
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +7 -7
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
- package/lib/components/MenuItem/useMenuItem.js +37 -44
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +2 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +31 -27
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
- package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
- package/lib/components/MenuItemCheckbox/index.js +1 -0
- package/lib/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +8 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
- package/lib/components/MenuItemRadio/index.d.ts +1 -0
- package/lib/components/MenuItemRadio/index.js +1 -0
- package/lib/components/MenuItemRadio/index.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +8 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.d.ts +1 -1
- package/lib/components/MenuList/MenuList.js +10 -10
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.d.ts +12 -10
- package/lib/components/MenuList/MenuList.types.js.map +1 -1
- package/lib/components/MenuList/index.d.ts +1 -1
- package/lib/components/MenuList/index.js +0 -1
- package/lib/components/MenuList/index.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.d.ts +1 -1
- package/lib/components/MenuList/renderMenuList.js +7 -7
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.d.ts +1 -1
- package/lib/components/MenuList/useMenuList.js +70 -87
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +19 -17
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.d.ts +2 -1
- package/lib/components/MenuList/useMenuListStyles.js +9 -7
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +7 -7
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
- package/lib/components/MenuPopover/index.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
- package/lib/components/MenuPopover/useMenuPopover.js +35 -41
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +13 -8
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
- package/lib/components/MenuSplitGroup/index.d.ts +5 -0
- package/lib/components/MenuSplitGroup/index.js +6 -0
- package/lib/components/MenuSplitGroup/index.js.map +1 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
- package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib/components/MenuTrigger/index.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
- package/lib/components/MenuTrigger/useMenuTrigger.js +167 -5
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/contexts/menuContext.d.ts +1 -1
- package/lib/contexts/menuContext.js +5 -11
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.d.ts +1 -1
- package/lib/contexts/menuGroupContext.js +3 -5
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.d.ts +1 -1
- package/lib/contexts/menuListContext.js +7 -17
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.d.ts +1 -1
- package/lib/contexts/menuTriggerContext.js +4 -6
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.d.ts +11 -10
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/lib/selectable/index.js.map +1 -1
- package/lib/selectable/types.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib/selectable/useCheckmarkStyles.js +4 -4
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +3 -5
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +16 -14
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/Menu.js +1 -1
- package/lib-commonjs/Menu.js.map +1 -1
- package/lib-commonjs/MenuDivider.js +1 -1
- package/lib-commonjs/MenuDivider.js.map +1 -1
- package/lib-commonjs/MenuGroup.js +1 -1
- package/lib-commonjs/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroupHeader.js +1 -1
- package/lib-commonjs/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/MenuItem.js +1 -1
- package/lib-commonjs/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +1 -1
- package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/MenuItemRadio.js +1 -1
- package/lib-commonjs/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/MenuList.js +1 -1
- package/lib-commonjs/MenuList.js.map +1 -1
- package/lib-commonjs/MenuPopover.js +1 -1
- package/lib-commonjs/MenuPopover.js.map +1 -1
- package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
- package/lib-commonjs/MenuSplitGroup.js +10 -0
- package/lib-commonjs/MenuSplitGroup.js.map +1 -0
- package/lib-commonjs/MenuTrigger.js +1 -1
- package/lib-commonjs/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js +7 -7
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.d.ts +3 -2
- package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +1 -1
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +5 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
- package/lib-commonjs/components/Menu/useMenu.js +130 -141
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.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/renderMenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +11 -7
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
- package/lib-commonjs/components/MenuGroup/index.js +3 -1
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.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/renderMenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +11 -7
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib-commonjs/components/MenuItem/MenuItem.types.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/renderMenuItem.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +2 -6
- package/lib-commonjs/components/MenuItem/useMenuItem.js +45 -53
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +40 -33
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
- 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.d.ts +1 -0
- package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +12 -7
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
- 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.d.ts +1 -0
- package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +12 -7
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +11 -11
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +12 -10
- package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.d.ts +1 -1
- package/lib-commonjs/components/MenuList/index.js +1 -3
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +77 -95
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +12 -9
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.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/renderMenuPopover.d.ts +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +17 -10
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
- package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +7 -3
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.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/renderMenuTrigger.d.ts +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +6 -6
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +175 -7
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -1
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuContext.js +6 -12
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +5 -7
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuListContext.js +8 -18
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +6 -8
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.d.ts +11 -10
- package/lib-commonjs/index.js +17 -15
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +1 -1
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/types.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/index.js +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +5 -7
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +16 -17
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib/common/mockUseMenuContext.d.ts +0 -7
- package/lib/common/mockUseMenuContext.js +0 -36
- package/lib/common/mockUseMenuContext.js.map +0 -1
- package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
- package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
- package/lib/utils/DefaultIcons.d.ts +0 -7
- package/lib/utils/DefaultIcons.js +0 -88
- package/lib/utils/DefaultIcons.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -23
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
- package/lib-commonjs/common/mockUseMenuContext.js +0 -47
- package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
- package/lib-commonjs/utils/DefaultIcons.d.ts +0 -7
- package/lib-commonjs/utils/DefaultIcons.js +0 -100
- package/lib-commonjs/utils/DefaultIcons.js.map +0 -1
package/dist/react-menu.d.ts
CHANGED
@@ -2,10 +2,11 @@ import { ComponentProps } from '@fluentui/react-utilities';
|
|
2
2
|
import { ComponentState } from '@fluentui/react-utilities';
|
3
3
|
import type { Context } from '@fluentui/react-context-selector';
|
4
4
|
import type { ContextSelector } from '@fluentui/react-context-selector';
|
5
|
+
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
5
6
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
6
|
-
import { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
7
7
|
import { PositioningShorthand } from '@fluentui/react-positioning';
|
8
8
|
import * as React_2 from 'react';
|
9
|
+
import type { Slot } from '@fluentui/react-utilities';
|
9
10
|
import { usePopperMouseTarget } from '@fluentui/react-positioning';
|
10
11
|
|
11
12
|
/**
|
@@ -13,6 +14,15 @@ import { usePopperMouseTarget } from '@fluentui/react-positioning';
|
|
13
14
|
*/
|
14
15
|
export declare const Menu: React_2.FC<MenuProps>;
|
15
16
|
|
17
|
+
export declare type MenuCheckedValueChangeData = {
|
18
|
+
/** The name of the value */
|
19
|
+
name: string;
|
20
|
+
/** The items for this value that are checked */
|
21
|
+
checkedItems: string[];
|
22
|
+
};
|
23
|
+
|
24
|
+
export declare type MenuCheckedValueChangeEvent = React_2.MouseEvent | React_2.KeyboardEvent;
|
25
|
+
|
16
26
|
declare type MenuCommons = MenuListCommons & {
|
17
27
|
/**
|
18
28
|
* Whether the popup is open
|
@@ -64,23 +74,27 @@ export declare type MenuContextValues = {
|
|
64
74
|
};
|
65
75
|
|
66
76
|
/**
|
67
|
-
* Define a styled MenuDivider, using the `
|
77
|
+
* Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.
|
68
78
|
*/
|
69
79
|
export declare const MenuDivider: ForwardRefComponent<MenuDividerProps>;
|
70
80
|
|
81
|
+
export declare const menuDividerClassName = "fui-MenuDivider";
|
82
|
+
|
71
83
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
72
84
|
|
73
85
|
export declare type MenuDividerSlots = {
|
74
|
-
root:
|
86
|
+
root: Slot<'div'>;
|
75
87
|
};
|
76
88
|
|
77
89
|
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
78
90
|
|
79
91
|
/**
|
80
|
-
* Define a styled MenuGroup, using the `
|
92
|
+
* Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.
|
81
93
|
*/
|
82
94
|
export declare const MenuGroup: ForwardRefComponent<MenuGroupProps>;
|
83
95
|
|
96
|
+
export declare const menuGroupClassName = "fui-MenuGroup";
|
97
|
+
|
84
98
|
export declare const MenuGroupContextProvider: React_2.Provider<MenuGroupContextValue>;
|
85
99
|
|
86
100
|
/**
|
@@ -99,14 +113,16 @@ export declare type MenuGroupContextValues = {
|
|
99
113
|
};
|
100
114
|
|
101
115
|
/**
|
102
|
-
* Define a styled MenuGroupHeader, using the `
|
116
|
+
* Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.
|
103
117
|
*/
|
104
118
|
export declare const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>;
|
105
119
|
|
120
|
+
export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
|
121
|
+
|
106
122
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
107
123
|
|
108
124
|
export declare type MenuGroupHeaderSlots = {
|
109
|
-
root:
|
125
|
+
root: Slot<'div'>;
|
110
126
|
};
|
111
127
|
|
112
128
|
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
@@ -114,7 +130,7 @@ export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
114
130
|
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
115
131
|
|
116
132
|
export declare type MenuGroupSlots = {
|
117
|
-
root:
|
133
|
+
root: Slot<'div'>;
|
118
134
|
};
|
119
135
|
|
120
136
|
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
@@ -125,19 +141,23 @@ export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
|
125
141
|
};
|
126
142
|
|
127
143
|
/**
|
128
|
-
* Define a styled MenuItem, using the `
|
144
|
+
* Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
|
129
145
|
*/
|
130
146
|
export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
|
131
147
|
|
132
148
|
/**
|
133
|
-
* Define a styled MenuItemCheckbox, using the `
|
149
|
+
* Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.
|
134
150
|
*/
|
135
151
|
export declare const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>;
|
136
152
|
|
153
|
+
export declare const menuItemCheckboxClassName = "fui-MenuItemCheckbox";
|
154
|
+
|
137
155
|
export declare type MenuItemCheckboxProps = MenuItemProps & MenuItemSelectableProps;
|
138
156
|
|
139
157
|
export declare type MenuItemCheckboxState = MenuItemState & MenuItemSelectableState;
|
140
158
|
|
159
|
+
export declare const menuItemClassName = "fui-MenuItem";
|
160
|
+
|
141
161
|
declare type MenuItemCommons = {
|
142
162
|
/**
|
143
163
|
* If the menu item is a trigger for a submenu
|
@@ -156,10 +176,12 @@ declare type MenuItemCommons = {
|
|
156
176
|
export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & MenuItemCommons;
|
157
177
|
|
158
178
|
/**
|
159
|
-
* Define a styled MenuItemRadio, using the `
|
179
|
+
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
160
180
|
*/
|
161
181
|
export declare const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>;
|
162
182
|
|
183
|
+
export declare const menuItemRadioClassName = "fui-MenuItemRadio";
|
184
|
+
|
163
185
|
export declare type MenuItemRadioProps = MenuItemProps & MenuItemSelectableProps;
|
164
186
|
|
165
187
|
export declare type MenuItemRadioState = MenuItemState & MenuItemSelectableState;
|
@@ -199,56 +221,48 @@ export declare type MenuItemSelectableState = MenuItemSelectableProps & {
|
|
199
221
|
};
|
200
222
|
|
201
223
|
export declare type MenuItemSlots = {
|
202
|
-
root:
|
224
|
+
root: Slot<'div'>;
|
203
225
|
/**
|
204
226
|
* Icon slot rendered before children content
|
205
227
|
*/
|
206
|
-
icon?:
|
228
|
+
icon?: Slot<'span'>;
|
207
229
|
/**
|
208
230
|
* A helper slot for alignment when a menu item is used with selectable menuitems
|
209
231
|
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
210
232
|
*/
|
211
|
-
checkmark?:
|
233
|
+
checkmark?: Slot<'span'>;
|
212
234
|
/**
|
213
235
|
* Icon slot that shows the indicator for a submenu
|
214
236
|
*/
|
215
|
-
submenuIndicator?:
|
237
|
+
submenuIndicator?: Slot<'span'>;
|
216
238
|
/**
|
217
239
|
* Component children are placed in this slot
|
218
240
|
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
219
241
|
*/
|
220
|
-
content
|
242
|
+
content?: Slot<'span'>;
|
221
243
|
/**
|
222
244
|
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
223
245
|
*/
|
224
|
-
secondaryContent?:
|
246
|
+
secondaryContent?: Slot<'span'>;
|
225
247
|
};
|
226
248
|
|
227
|
-
/**
|
228
|
-
* Consts listing which props are shorthand props.
|
229
|
-
*/
|
230
|
-
export declare const menuItemSlots: Array<keyof MenuItemSlots>;
|
231
|
-
|
232
249
|
export declare type MenuItemState = ComponentState<MenuItemSlots> & MenuItemCommons;
|
233
250
|
|
234
251
|
/**
|
235
|
-
* Define a styled MenuList, using the `
|
252
|
+
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
236
253
|
*/
|
237
254
|
export declare const MenuList: ForwardRefComponent<MenuListProps>;
|
238
255
|
|
239
|
-
export declare
|
256
|
+
export declare const menuListClassName = "fui-MenuList";
|
257
|
+
|
258
|
+
declare type MenuListCommons = {
|
240
259
|
/**
|
241
260
|
* Callback when checked items change for value with a name
|
242
261
|
*
|
243
262
|
* @param event - React's original SyntheticEvent
|
244
263
|
* @param data - A data object with relevant information
|
245
264
|
*/
|
246
|
-
onCheckedValueChange?: (e:
|
247
|
-
/** The name of the value */
|
248
|
-
name: string;
|
249
|
-
/** The items for this value that are checked */
|
250
|
-
checkedItems: string[];
|
251
|
-
}) => void;
|
265
|
+
onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
|
252
266
|
/**
|
253
267
|
* Map of all checked values
|
254
268
|
*/
|
@@ -287,7 +301,7 @@ export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<Menu
|
|
287
301
|
export declare const MenuListProvider: React_2.Provider<MenuListContextValue> & React_2.FC<React_2.ProviderProps<MenuListContextValue>>;
|
288
302
|
|
289
303
|
export declare type MenuListSlots = {
|
290
|
-
root:
|
304
|
+
root: Slot<'div'>;
|
291
305
|
};
|
292
306
|
|
293
307
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
@@ -305,7 +319,8 @@ export declare type MenuListState = ComponentState<MenuListSlots> & MenuListComm
|
|
305
319
|
/**
|
306
320
|
* Data attached to open/close events
|
307
321
|
*/
|
308
|
-
export declare type MenuOpenChangeData =
|
322
|
+
export declare type MenuOpenChangeData = {
|
323
|
+
open: boolean;
|
309
324
|
/**
|
310
325
|
* Indicates whether the change of state was a keyboard interaction
|
311
326
|
*/
|
@@ -326,13 +341,15 @@ export declare type MenuOpenEvents = MouseEvent | TouchEvent | React_2.MouseEven
|
|
326
341
|
*/
|
327
342
|
export declare const MenuPopover: ForwardRefComponent<MenuPopoverProps>;
|
328
343
|
|
344
|
+
export declare const menuPopoverClassName = "fui-MenuPopover";
|
345
|
+
|
329
346
|
/**
|
330
347
|
* MenuPopover Props
|
331
348
|
*/
|
332
349
|
export declare type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;
|
333
350
|
|
334
351
|
export declare type MenuPopoverSlots = {
|
335
|
-
root:
|
352
|
+
root: Slot<'div'>;
|
336
353
|
};
|
337
354
|
|
338
355
|
/**
|
@@ -365,6 +382,29 @@ export declare const MenuProvider: React_2.Provider<MenuContextValue> & React_2.
|
|
365
382
|
|
366
383
|
export declare type MenuSlots = {};
|
367
384
|
|
385
|
+
/**
|
386
|
+
* Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
|
387
|
+
*/
|
388
|
+
export declare const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>;
|
389
|
+
|
390
|
+
export declare const menuSplitGroupClassName = "fui-MenuSplitGroup";
|
391
|
+
|
392
|
+
declare type MenuSplitGroupCommons = {};
|
393
|
+
|
394
|
+
/**
|
395
|
+
* MenuSplitGroup Props
|
396
|
+
*/
|
397
|
+
export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;
|
398
|
+
|
399
|
+
export declare type MenuSplitGroupSlots = {
|
400
|
+
root: Slot<'div'>;
|
401
|
+
};
|
402
|
+
|
403
|
+
/**
|
404
|
+
* State used in rendering MenuSplitGroup
|
405
|
+
*/
|
406
|
+
export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots> & MenuSplitGroupCommons;
|
407
|
+
|
368
408
|
export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
369
409
|
/**
|
370
410
|
* Callback to open/close the popup
|
@@ -408,13 +448,14 @@ export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
|
408
448
|
* Wraps a trigger element as an only child
|
409
449
|
* and adds the necessary event handling to open a popup menu
|
410
450
|
*/
|
411
|
-
export declare const MenuTrigger: React_2.FC<MenuTriggerProps
|
451
|
+
export declare const MenuTrigger: React_2.FC<MenuTriggerProps> & FluentTriggerComponent;
|
412
452
|
|
413
453
|
/**
|
414
454
|
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
415
455
|
*/
|
416
|
-
export declare type MenuTriggerChildProps = Required<Pick<React_2.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | '
|
456
|
+
export declare type MenuTriggerChildProps = Required<Pick<React_2.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseMove' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'id'>> & {
|
417
457
|
ref?: React_2.Ref<never>;
|
458
|
+
'aria-expanded': boolean | undefined;
|
418
459
|
};
|
419
460
|
|
420
461
|
export declare const MenuTriggerContextProvider: React_2.Provider<boolean>;
|
@@ -425,64 +466,72 @@ export declare type MenuTriggerProps = {
|
|
425
466
|
*/
|
426
467
|
children: (React_2.ReactElement & {
|
427
468
|
ref?: React_2.Ref<unknown>;
|
428
|
-
}) | ((props: MenuTriggerChildProps) => React_2.
|
469
|
+
}) | ((props: MenuTriggerChildProps) => React_2.ReactElement | null);
|
429
470
|
};
|
430
471
|
|
431
|
-
export declare type MenuTriggerState =
|
472
|
+
export declare type MenuTriggerState = {
|
473
|
+
children: React_2.ReactElement | null;
|
474
|
+
isSubmenu: boolean;
|
475
|
+
};
|
432
476
|
|
433
477
|
/**
|
434
478
|
* Render the final JSX of Menu
|
435
479
|
*/
|
436
|
-
export declare const
|
480
|
+
export declare const renderMenu_unstable: (state: MenuState, contextValues: MenuContextValues) => JSX.Element;
|
437
481
|
|
438
482
|
/**
|
439
483
|
* Redefine the render function to add slots. Reuse the menudivider structure but add
|
440
484
|
* slots to children.
|
441
485
|
*/
|
442
|
-
export declare const
|
486
|
+
export declare const renderMenuDivider_unstable: (state: MenuDividerState) => JSX.Element;
|
443
487
|
|
444
488
|
/**
|
445
489
|
* Redefine the render function to add slots. Reuse the menugroup structure but add
|
446
490
|
* slots to children.
|
447
491
|
*/
|
448
|
-
export declare const
|
492
|
+
export declare const renderMenuGroup_unstable: (state: MenuGroupState, contextValues: MenuGroupContextValues) => JSX.Element;
|
449
493
|
|
450
494
|
/**
|
451
495
|
* Redefine the render function to add slots. Reuse the menugroupheader structure but add
|
452
496
|
* slots to children.
|
453
497
|
*/
|
454
|
-
export declare const
|
498
|
+
export declare const renderMenuGroupHeader_unstable: (state: MenuGroupHeaderState) => JSX.Element;
|
455
499
|
|
456
500
|
/**
|
457
501
|
* Function that renders the final JSX of the component
|
458
502
|
*/
|
459
|
-
export declare const
|
503
|
+
export declare const renderMenuItem_unstable: (state: MenuItemState) => JSX.Element;
|
460
504
|
|
461
505
|
/** Function that renders the final JSX of the component */
|
462
|
-
export declare const
|
506
|
+
export declare const renderMenuItemCheckbox_unstable: (state: MenuItemCheckboxState) => JSX.Element;
|
463
507
|
|
464
508
|
/**
|
465
509
|
* Redefine the render function to add slots. Reuse the menuitemradio structure but add
|
466
510
|
* slots to children.
|
467
511
|
*/
|
468
|
-
export declare const
|
512
|
+
export declare const renderMenuItemRadio_unstable: (state: MenuItemRadioState) => JSX.Element;
|
469
513
|
|
470
514
|
/**
|
471
515
|
* Function that renders the final JSX of the component
|
472
516
|
*/
|
473
|
-
export declare const
|
517
|
+
export declare const renderMenuList_unstable: (state: MenuListState, contextValues: MenuListContextValues) => JSX.Element;
|
474
518
|
|
475
519
|
/**
|
476
520
|
* Render the final JSX of MenuPopover
|
477
521
|
*/
|
478
|
-
export declare const
|
522
|
+
export declare const renderMenuPopover_unstable: (state: MenuPopoverState) => JSX.Element;
|
523
|
+
|
524
|
+
/**
|
525
|
+
* Render the final JSX of MenuSplitGroup
|
526
|
+
*/
|
527
|
+
export declare const renderMenuSplitGroup_unstable: (state: MenuSplitGroupState) => JSX.Element;
|
479
528
|
|
480
529
|
/**
|
481
530
|
* Render the final JSX of MenuTrigger
|
482
531
|
*
|
483
532
|
* Only renders children
|
484
533
|
*/
|
485
|
-
export declare const
|
534
|
+
export declare const renderMenuTrigger_unstable: (state: MenuTriggerState) => JSX.Element;
|
486
535
|
|
487
536
|
export declare type SelectableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked: boolean) => void;
|
488
537
|
|
@@ -493,90 +542,112 @@ export declare type UninitializedMenuListState = Omit<MenuListState, 'setFocusBy
|
|
493
542
|
*
|
494
543
|
* @param state - should contain a `checkmark` slot
|
495
544
|
*/
|
496
|
-
export declare const
|
545
|
+
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
|
497
546
|
|
498
547
|
/**
|
499
548
|
* Create the state required to render Menu.
|
500
549
|
*
|
501
550
|
* The returned state can be modified with hooks such as useMenuStyles,
|
502
|
-
* before being passed to
|
551
|
+
* before being passed to renderMenu_unstable.
|
503
552
|
*
|
504
553
|
* @param props - props from this instance of Menu
|
505
554
|
*/
|
506
|
-
export declare const
|
555
|
+
export declare const useMenu_unstable: (props: MenuProps) => MenuState;
|
507
556
|
|
508
|
-
export declare const
|
557
|
+
export declare const useMenuContext_unstable: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
|
509
558
|
|
510
|
-
export declare function
|
559
|
+
export declare function useMenuContextValues_unstable(state: MenuState): MenuContextValues;
|
511
560
|
|
512
561
|
/**
|
513
562
|
* Given user props, returns state and render function for a MenuDivider.
|
514
563
|
*/
|
515
|
-
export declare const
|
564
|
+
export declare const useMenuDivider_unstable: (props: MenuDividerProps, ref: React_2.Ref<HTMLElement>) => MenuDividerState;
|
516
565
|
|
517
|
-
export declare const
|
566
|
+
export declare const useMenuDividerStyles_unstable: (state: MenuDividerState) => MenuDividerState;
|
518
567
|
|
519
568
|
/**
|
520
569
|
* Given user props, returns state and render function for a MenuGroup.
|
521
570
|
*/
|
522
|
-
export declare function
|
571
|
+
export declare function useMenuGroup_unstable(props: MenuGroupProps, ref: React_2.Ref<HTMLElement>): MenuGroupState;
|
523
572
|
|
524
|
-
export declare const
|
573
|
+
export declare const useMenuGroupContext_unstable: () => MenuGroupContextValue;
|
525
574
|
|
526
|
-
export declare function
|
575
|
+
export declare function useMenuGroupContextValues_unstable(state: MenuGroupState): MenuGroupContextValues;
|
527
576
|
|
528
577
|
/**
|
529
578
|
* Given user props, returns state and render function for a MenuGroupHeader.
|
530
579
|
*/
|
531
|
-
export declare function
|
580
|
+
export declare function useMenuGroupHeader_unstable(props: MenuGroupHeaderProps, ref: React_2.Ref<HTMLElement>): MenuGroupHeaderState;
|
532
581
|
|
533
|
-
export declare const
|
582
|
+
export declare const useMenuGroupHeaderStyles_unstable: (state: MenuGroupHeaderState) => MenuGroupHeaderState;
|
583
|
+
|
584
|
+
export declare const useMenuGroupStyles_unstable: (state: MenuGroupState) => MenuGroupState;
|
534
585
|
|
535
586
|
/**
|
536
587
|
* Returns the props and state required to render the component
|
537
588
|
*/
|
538
|
-
export declare const
|
589
|
+
export declare const useMenuItem_unstable: (props: MenuItemProps, ref: React_2.Ref<HTMLElement>) => MenuItemState;
|
539
590
|
|
540
591
|
/** Returns the props and state required to render the component */
|
541
|
-
export declare const
|
592
|
+
export declare const useMenuItemCheckbox_unstable: (props: MenuItemCheckboxProps, ref: React_2.Ref<HTMLElement>) => MenuItemCheckboxState;
|
593
|
+
|
594
|
+
export declare const useMenuItemCheckboxStyles_unstable: (state: MenuItemCheckboxState) => void;
|
542
595
|
|
543
596
|
/**
|
544
597
|
* Given user props, returns state and render function for a MenuItemRadio.
|
545
598
|
*/
|
546
|
-
export declare const
|
599
|
+
export declare const useMenuItemRadio_unstable: (props: MenuItemRadioProps, ref: React_2.Ref<HTMLElement>) => MenuItemRadioState;
|
600
|
+
|
601
|
+
export declare const useMenuItemRadioStyles_unstable: (state: MenuItemRadioState) => void;
|
547
602
|
|
548
603
|
/** Applies style classnames to slots */
|
549
|
-
export declare const
|
604
|
+
export declare const useMenuItemStyles_unstable: (state: MenuItemState) => void;
|
550
605
|
|
551
606
|
/**
|
552
607
|
* Returns the props and state required to render the component
|
553
608
|
*/
|
554
|
-
export declare const
|
609
|
+
export declare const useMenuList_unstable: (props: MenuListProps, ref: React_2.Ref<HTMLElement>) => MenuListState;
|
555
610
|
|
556
|
-
export declare const
|
611
|
+
export declare const useMenuListContext_unstable: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
|
557
612
|
|
558
|
-
export declare function
|
613
|
+
export declare function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues;
|
559
614
|
|
560
615
|
/**
|
561
616
|
* Apply styling to the Menu slots based on the state
|
562
617
|
*/
|
563
|
-
export declare const
|
618
|
+
export declare const useMenuListStyles_unstable: (state: MenuListState) => MenuListState;
|
564
619
|
|
565
620
|
/**
|
566
621
|
* Create the state required to render MenuPopover.
|
567
622
|
*
|
568
|
-
* The returned state can be modified with hooks such as
|
569
|
-
* before being passed to
|
623
|
+
* The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
|
624
|
+
* before being passed to renderMenuPopover_unstable.
|
570
625
|
*
|
571
626
|
* @param props - props from this instance of MenuPopover
|
572
627
|
* @param ref - reference to root HTMLElement of MenuPopover
|
573
628
|
*/
|
574
|
-
export declare const
|
629
|
+
export declare const useMenuPopover_unstable: (props: MenuPopoverProps, ref: React_2.Ref<HTMLElement>) => MenuPopoverState;
|
575
630
|
|
576
631
|
/**
|
577
632
|
* Apply styling to the Menu slots based on the state
|
578
633
|
*/
|
579
|
-
export declare const
|
634
|
+
export declare const useMenuPopoverStyles_unstable: (state: MenuPopoverState) => MenuPopoverState;
|
635
|
+
|
636
|
+
/**
|
637
|
+
* Create the state required to render MenuSplitGroup.
|
638
|
+
*
|
639
|
+
* The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
|
640
|
+
* before being passed to renderMenuSplitGroup_unstable.
|
641
|
+
*
|
642
|
+
* @param props - props from this instance of MenuSplitGroup
|
643
|
+
* @param ref - reference to root HTMLElement of MenuSplitGroup
|
644
|
+
*/
|
645
|
+
export declare const useMenuSplitGroup_unstable: (props: MenuSplitGroupProps, ref: React_2.Ref<HTMLElement>) => MenuSplitGroupState;
|
646
|
+
|
647
|
+
/**
|
648
|
+
* Apply styling to the MenuSplitGroup slots based on the state
|
649
|
+
*/
|
650
|
+
export declare const useMenuSplitGroupStyles_unstable: (state: MenuSplitGroupState) => MenuSplitGroupState;
|
580
651
|
|
581
652
|
/**
|
582
653
|
* Create the state required to render MenuTrigger.
|
@@ -584,8 +655,8 @@ export declare const useMenuPopoverStyles: (state: MenuPopoverState) => MenuPopo
|
|
584
655
|
*
|
585
656
|
* @param props - props from this instance of MenuTrigger
|
586
657
|
*/
|
587
|
-
export declare const
|
658
|
+
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;
|
588
659
|
|
589
|
-
export declare const
|
660
|
+
export declare const useMenuTriggerContext_unstable: () => boolean;
|
590
661
|
|
591
662
|
export { }
|
package/lib/Menu.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"../src/","sources":["Menu.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Menu/index';\n"]}
|
package/lib/MenuDivider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuDivider.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuDivider.js","sourceRoot":"../src/","sources":["MenuDivider.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuDivider/index';\n"]}
|
package/lib/MenuGroup.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuGroup.js","sourceRoot":"../src/","sources":["MenuGroup.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './components/MenuGroup/index';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuGroupHeader.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuGroupHeader.js","sourceRoot":"../src/","sources":["MenuGroupHeader.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/MenuGroupHeader/index';\n"]}
|
package/lib/MenuItem.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"../src/","sources":["MenuItem.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/MenuItem/index';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItemCheckbox.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuItemCheckbox.js","sourceRoot":"../src/","sources":["MenuItemCheckbox.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC","sourcesContent":["export * from './components/MenuItemCheckbox/index';\n"]}
|
package/lib/MenuItemRadio.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItemRadio.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuItemRadio.js","sourceRoot":"../src/","sources":["MenuItemRadio.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/MenuItemRadio/index';\n"]}
|
package/lib/MenuList.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuList.js","sourceRoot":"../src/","sources":["MenuList.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/MenuList/index';\n"]}
|
package/lib/MenuPopover.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuPopover.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuPopover.js","sourceRoot":"../src/","sources":["MenuPopover.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuPopover/index';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/MenuSplitGroup/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuSplitGroup.js","sourceRoot":"../src/","sources":["MenuSplitGroup.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/MenuSplitGroup/index';\n"]}
|
package/lib/MenuTrigger.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuTrigger.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"MenuTrigger.js","sourceRoot":"../src/","sources":["MenuTrigger.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/MenuTrigger/index';\n"]}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { useMenu_unstable } from './useMenu';
|
2
|
+
import { useMenuContextValues_unstable } from './useMenuContextValues';
|
3
|
+
import { renderMenu_unstable } from './renderMenu';
|
4
4
|
/**
|
5
5
|
* Wrapper component that manages state for a popup MenuList and a MenuTrigger
|
6
6
|
*/
|
7
7
|
|
8
|
-
export
|
9
|
-
|
10
|
-
|
11
|
-
return
|
8
|
+
export const Menu = props => {
|
9
|
+
const state = useMenu_unstable(props);
|
10
|
+
const contextValues = useMenuContextValues_unstable(state);
|
11
|
+
return renderMenu_unstable(state, contextValues);
|
12
12
|
};
|
13
13
|
Menu.displayName = 'Menu';
|
14
14
|
//# sourceMappingURL=Menu.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,mBAAT,QAAoC,cAApC;AAGA;;AAEG;;AACH,OAAO,MAAM,IAAI,GAAwB,KAAK,IAAG;AAC/C,QAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,CAA9B;AACA,QAAM,aAAa,GAAG,6BAA6B,CAAC,KAAD,CAAnD;AAEA,SAAO,mBAAmB,CAAC,KAAD,EAAQ,aAAR,CAA1B;AACD,CALM;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","sourcesContent":["import * as React from 'react';\nimport { useMenu_unstable } from './useMenu';\nimport { useMenuContextValues_unstable } from './useMenuContextValues';\nimport { renderMenu_unstable } from './renderMenu';\nimport type { MenuProps } from './Menu.types';\n\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */\nexport const Menu: React.FC<MenuProps> = props => {\n const state = useMenu_unstable(props);\n const contextValues = useMenuContextValues_unstable(state);\n\n return renderMenu_unstable(state, contextValues);\n};\n\nMenu.displayName = 'Menu';\n"],"sourceRoot":"../src/"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
|
3
3
|
import { usePopperMouseTarget, PositioningShorthand } from '@fluentui/react-positioning';
|
4
|
-
import { MenuListCommons } from '../MenuList/
|
4
|
+
import { MenuListCommons } from '../MenuList/MenuList.types';
|
5
5
|
import { MenuContextValue } from '../../contexts/menuContext';
|
6
6
|
declare type MenuCommons = MenuListCommons & {
|
7
7
|
/**
|
@@ -92,7 +92,8 @@ export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
|
92
92
|
/**
|
93
93
|
* Data attached to open/close events
|
94
94
|
*/
|
95
|
-
export declare type MenuOpenChangeData =
|
95
|
+
export declare type MenuOpenChangeData = {
|
96
|
+
open: boolean;
|
96
97
|
/**
|
97
98
|
* Indicates whether the change of state was a keyboard interaction
|
98
99
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.types.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"Menu.types.js","sourceRoot":"../src/","sources":["components/Menu/Menu.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport { usePopperMouseTarget, PositioningShorthand } from '@fluentui/react-positioning';\nimport { MenuListCommons } from '../MenuList/MenuList.types';\nimport { MenuContextValue } from '../../contexts/menuContext';\n\ntype MenuCommons = MenuListCommons & {\n /**\n * Whether the popup is open\n */\n open: boolean;\n\n /**\n * Call back when the component requests to change value\n * The `open` value is used as a hint when directly controlling the component\n */\n onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Whether the popup is open by default\n */\n defaultOpen?: boolean;\n\n /*\n * Opens the menu on hover\n */\n openOnHover: boolean;\n\n /**\n * Opens the menu on right click (context menu), removes all other menu open interactions\n */\n openOnContext?: boolean;\n\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n */\n inline?: boolean;\n\n /**\n * Do not dismiss the menu when a menu item is clicked\n */\n persistOnItemClick?: boolean;\n\n /**\n * Sets the delay for mouse open/close for the popover one mouse enter/leave\n */\n hoverDelay?: number;\n};\n\nexport type MenuSlots = {};\n\n/**\n * Extends and drills down Menulist props to simplify API\n */\nexport type MenuProps = Partial<MenuCommons> &\n ComponentProps<MenuSlots> & {\n /**\n * Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.\n * Alternatively can only contain {@link MenuPopover} if using a custom `target`.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n\n /**\n * Configures the positioned menu\n */\n positioning?: PositioningShorthand;\n };\n\nexport type MenuState = MenuCommons &\n ComponentState<MenuSlots> & {\n /**\n * Callback to open/close the popup\n */\n setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuPopover: React.ReactNode;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuTrigger: React.ReactNode;\n\n /**\n * The ref for the popup\n */\n menuPopoverRef: React.MutableRefObject<HTMLElement>;\n\n /**\n * The ref for the MenuTrigger, used for popup positioning\n */\n triggerRef: React.MutableRefObject<HTMLElement>;\n\n /**\n * Id for the MenuTrigger element for aria relationship\n */\n triggerId: string;\n\n /**\n * Whether this menu is a submenu\n */\n isSubmenu: boolean;\n\n /**\n * Anchors the popper to the mouse click for context events\n */\n contextTarget: ReturnType<typeof usePopperMouseTarget>[0];\n\n /**\n * A callback to set the target of the popper to the mouse click for context events\n */\n setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];\n };\n\n/**\n * Data attached to open/close events\n */\nexport type MenuOpenChangeData = {\n open: boolean;\n /**\n * Indicates whether the change of state was a keyboard interaction\n */\n keyboard?: boolean;\n /**\n * indicates whether the request for the open state was bubbled from a nested menu\n */\n bubble?: boolean;\n};\n\nexport type MenuContextValues = {\n menu: MenuContextValue;\n};\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type MenuOpenEvents =\n | MouseEvent\n | TouchEvent\n | React.MouseEvent<HTMLElement>\n | React.KeyboardEvent<HTMLElement>\n | React.FocusEvent<HTMLElement>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './Menu';\nexport * from './Menu.types';\nexport * from './renderMenu';\nexport * from './useMenu';\nexport * from './useMenuContextValues';\n"]}
|
@@ -2,4 +2,4 @@ import type { MenuContextValues, MenuState } from './Menu.types';
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of Menu
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderMenu_unstable: (state: MenuState, contextValues: MenuContextValues) => JSX.Element;
|