@fluentui/react-menu 0.0.0-nightlyd3bf09bf8120211201.1 → 0.0.0-nightlyd45ba4664620220211.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +244 -29
- package/CHANGELOG.md +53 -16
- package/Spec.md +21 -16
- package/dist/react-menu.d.ts +111 -68
- package/lib/MenuSplitGroup.d.ts +1 -0
- package/lib/MenuSplitGroup.js +2 -0
- package/lib/MenuSplitGroup.js.map +1 -0
- package/lib/components/Menu/Menu.js +6 -6
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +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 +33 -25
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
- package/lib/components/Menu/useMenuContextValues.js +1 -1
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +7 -7
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +3 -2
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +4 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +3 -2
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +9 -9
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
- package/lib/components/MenuGroup/renderMenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +3 -2
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +4 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js +2 -2
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +7 -7
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +3 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +6 -3
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +3 -2
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.d.ts +1 -1
- package/lib/components/MenuItem/MenuItem.js +7 -9
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +9 -4
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +2 -2
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
- package/lib/components/MenuItem/useMenuItem.js +11 -16
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +21 -22
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +8 -4
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +6 -6
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +6 -6
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +7 -7
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +8 -4
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +6 -6
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +6 -6
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.d.ts +1 -1
- package/lib/components/MenuList/MenuList.js +9 -9
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.d.ts +4 -4
- 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 +3 -2
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.d.ts +1 -1
- package/lib/components/MenuList/useMenuList.js +11 -8
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.d.ts +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +2 -2
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +6 -6
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +5 -3
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
- package/lib/components/MenuPopover/useMenuPopover.js +11 -8
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +3 -2
- 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 +5 -4
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
- package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
- 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/contexts/menuContext.d.ts +1 -1
- package/lib/contexts/menuContext.js +1 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.d.ts +1 -1
- package/lib/contexts/menuGroupContext.js +1 -1
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.d.ts +1 -1
- package/lib/contexts/menuListContext.js +1 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.d.ts +1 -1
- package/lib/contexts/menuTriggerContext.js +1 -1
- 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/useCheckmarkStyles.d.ts +2 -2
- package/lib/selectable/useCheckmarkStyles.js +2 -2
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +2 -2
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.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/components/Menu/Menu.js +3 -3
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.d.ts +1 -1
- package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +3 -3
- 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 +38 -31
- 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 +3 -3
- 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 +4 -4
- 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/renderMenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +5 -4
- 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 +6 -3
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
- 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 +5 -5
- 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/renderMenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +5 -4
- 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 +6 -3
- 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 +3 -3
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +5 -5
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +4 -4
- 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/renderMenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +5 -4
- 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 +7 -4
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
- 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 +4 -7
- 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/renderMenuItem.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +11 -7
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +1 -1
- 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 +11 -16
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +30 -29
- 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 +4 -4
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -7
- 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 +6 -6
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +7 -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 +4 -4
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -7
- 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 +6 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +7 -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 +5 -5
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +4 -4
- package/lib-commonjs/components/MenuList/index.d.ts +1 -1
- package/lib-commonjs/components/MenuList/index.js +0 -2
- 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 +5 -4
- 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 +12 -9
- 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 +3 -3
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -6
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +3 -3
- 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/renderMenuPopover.d.ts +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +7 -5
- 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 +12 -9
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +8 -6
- 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 +3 -2
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +3 -3
- 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 +176 -7
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuContext.js +3 -3
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +3 -3
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuListContext.js +3 -3
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +3 -3
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.d.ts +11 -10
- package/lib-commonjs/index.js +16 -14
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib-commonjs/selectable/useCheckmarkStyles.js +6 -6
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +13 -15
- package/lib/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib/components/MenuTrigger/useTriggerElement.js +0 -165
- package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -180
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.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
|
/**
|
@@ -73,7 +74,7 @@ export declare type MenuContextValues = {
|
|
73
74
|
};
|
74
75
|
|
75
76
|
/**
|
76
|
-
* Define a styled MenuDivider, using the `
|
77
|
+
* Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.
|
77
78
|
*/
|
78
79
|
export declare const MenuDivider: ForwardRefComponent<MenuDividerProps>;
|
79
80
|
|
@@ -82,13 +83,13 @@ export declare const menuDividerClassName = "fui-MenuDivider";
|
|
82
83
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
83
84
|
|
84
85
|
export declare type MenuDividerSlots = {
|
85
|
-
root:
|
86
|
+
root: Slot<'div'>;
|
86
87
|
};
|
87
88
|
|
88
89
|
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
89
90
|
|
90
91
|
/**
|
91
|
-
* Define a styled MenuGroup, using the `
|
92
|
+
* Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.
|
92
93
|
*/
|
93
94
|
export declare const MenuGroup: ForwardRefComponent<MenuGroupProps>;
|
94
95
|
|
@@ -112,7 +113,7 @@ export declare type MenuGroupContextValues = {
|
|
112
113
|
};
|
113
114
|
|
114
115
|
/**
|
115
|
-
* Define a styled MenuGroupHeader, using the `
|
116
|
+
* Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.
|
116
117
|
*/
|
117
118
|
export declare const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>;
|
118
119
|
|
@@ -121,7 +122,7 @@ export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
|
|
121
122
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
122
123
|
|
123
124
|
export declare type MenuGroupHeaderSlots = {
|
124
|
-
root:
|
125
|
+
root: Slot<'div'>;
|
125
126
|
};
|
126
127
|
|
127
128
|
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
@@ -129,7 +130,7 @@ export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
129
130
|
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
130
131
|
|
131
132
|
export declare type MenuGroupSlots = {
|
132
|
-
root:
|
133
|
+
root: Slot<'div'>;
|
133
134
|
};
|
134
135
|
|
135
136
|
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
@@ -140,12 +141,12 @@ export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
|
140
141
|
};
|
141
142
|
|
142
143
|
/**
|
143
|
-
* Define a styled MenuItem, using the `
|
144
|
+
* Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
|
144
145
|
*/
|
145
146
|
export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
|
146
147
|
|
147
148
|
/**
|
148
|
-
* Define a styled MenuItemCheckbox, using the `
|
149
|
+
* Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.
|
149
150
|
*/
|
150
151
|
export declare const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>;
|
151
152
|
|
@@ -175,7 +176,7 @@ declare type MenuItemCommons = {
|
|
175
176
|
export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & MenuItemCommons;
|
176
177
|
|
177
178
|
/**
|
178
|
-
* Define a styled MenuItemRadio, using the `
|
179
|
+
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
179
180
|
*/
|
180
181
|
export declare const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>;
|
181
182
|
|
@@ -220,46 +221,41 @@ export declare type MenuItemSelectableState = MenuItemSelectableProps & {
|
|
220
221
|
};
|
221
222
|
|
222
223
|
export declare type MenuItemSlots = {
|
223
|
-
root:
|
224
|
+
root: Slot<'div'>;
|
224
225
|
/**
|
225
226
|
* Icon slot rendered before children content
|
226
227
|
*/
|
227
|
-
icon?:
|
228
|
+
icon?: Slot<'span'>;
|
228
229
|
/**
|
229
230
|
* A helper slot for alignment when a menu item is used with selectable menuitems
|
230
231
|
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
231
232
|
*/
|
232
|
-
checkmark?:
|
233
|
+
checkmark?: Slot<'span'>;
|
233
234
|
/**
|
234
235
|
* Icon slot that shows the indicator for a submenu
|
235
236
|
*/
|
236
|
-
submenuIndicator?:
|
237
|
+
submenuIndicator?: Slot<'span'>;
|
237
238
|
/**
|
238
239
|
* Component children are placed in this slot
|
239
240
|
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
240
241
|
*/
|
241
|
-
content
|
242
|
+
content?: Slot<'span'>;
|
242
243
|
/**
|
243
244
|
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
244
245
|
*/
|
245
|
-
secondaryContent?:
|
246
|
+
secondaryContent?: Slot<'span'>;
|
246
247
|
};
|
247
248
|
|
248
|
-
/**
|
249
|
-
* Consts listing which props are shorthand props.
|
250
|
-
*/
|
251
|
-
export declare const menuItemSlots: Array<keyof MenuItemSlots>;
|
252
|
-
|
253
249
|
export declare type MenuItemState = ComponentState<MenuItemSlots> & MenuItemCommons;
|
254
250
|
|
255
251
|
/**
|
256
|
-
* Define a styled MenuList, using the `
|
252
|
+
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
257
253
|
*/
|
258
254
|
export declare const MenuList: ForwardRefComponent<MenuListProps>;
|
259
255
|
|
260
256
|
export declare const menuListClassName = "fui-MenuList";
|
261
257
|
|
262
|
-
|
258
|
+
declare type MenuListCommons = {
|
263
259
|
/**
|
264
260
|
* Callback when checked items change for value with a name
|
265
261
|
*
|
@@ -305,7 +301,7 @@ export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<Menu
|
|
305
301
|
export declare const MenuListProvider: React_2.Provider<MenuListContextValue> & React_2.FC<React_2.ProviderProps<MenuListContextValue>>;
|
306
302
|
|
307
303
|
export declare type MenuListSlots = {
|
308
|
-
root:
|
304
|
+
root: Slot<'div'>;
|
309
305
|
};
|
310
306
|
|
311
307
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
@@ -353,7 +349,7 @@ export declare const menuPopoverClassName = "fui-MenuPopover";
|
|
353
349
|
export declare type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;
|
354
350
|
|
355
351
|
export declare type MenuPopoverSlots = {
|
356
|
-
root:
|
352
|
+
root: Slot<'div'>;
|
357
353
|
};
|
358
354
|
|
359
355
|
/**
|
@@ -386,6 +382,29 @@ export declare const MenuProvider: React_2.Provider<MenuContextValue> & React_2.
|
|
386
382
|
|
387
383
|
export declare type MenuSlots = {};
|
388
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
|
+
|
389
408
|
export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
390
409
|
/**
|
391
410
|
* Callback to open/close the popup
|
@@ -429,13 +448,14 @@ export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
|
429
448
|
* Wraps a trigger element as an only child
|
430
449
|
* and adds the necessary event handling to open a popup menu
|
431
450
|
*/
|
432
|
-
export declare const MenuTrigger: React_2.FC<MenuTriggerProps
|
451
|
+
export declare const MenuTrigger: React_2.FC<MenuTriggerProps> & FluentTriggerComponent;
|
433
452
|
|
434
453
|
/**
|
435
454
|
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
436
455
|
*/
|
437
|
-
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'>> & {
|
438
457
|
ref?: React_2.Ref<never>;
|
458
|
+
'aria-expanded': boolean | undefined;
|
439
459
|
};
|
440
460
|
|
441
461
|
export declare const MenuTriggerContextProvider: React_2.Provider<boolean>;
|
@@ -446,64 +466,71 @@ export declare type MenuTriggerProps = {
|
|
446
466
|
*/
|
447
467
|
children: (React_2.ReactElement & {
|
448
468
|
ref?: React_2.Ref<unknown>;
|
449
|
-
}) | ((props: MenuTriggerChildProps) => React_2.
|
469
|
+
}) | ((props: MenuTriggerChildProps) => React_2.ReactElement | null);
|
450
470
|
};
|
451
471
|
|
452
|
-
export declare type MenuTriggerState =
|
472
|
+
export declare type MenuTriggerState = {
|
473
|
+
children: React_2.ReactElement | null;
|
474
|
+
};
|
453
475
|
|
454
476
|
/**
|
455
477
|
* Render the final JSX of Menu
|
456
478
|
*/
|
457
|
-
export declare const
|
479
|
+
export declare const renderMenu_unstable: (state: MenuState, contextValues: MenuContextValues) => JSX.Element;
|
458
480
|
|
459
481
|
/**
|
460
482
|
* Redefine the render function to add slots. Reuse the menudivider structure but add
|
461
483
|
* slots to children.
|
462
484
|
*/
|
463
|
-
export declare const
|
485
|
+
export declare const renderMenuDivider_unstable: (state: MenuDividerState) => JSX.Element;
|
464
486
|
|
465
487
|
/**
|
466
488
|
* Redefine the render function to add slots. Reuse the menugroup structure but add
|
467
489
|
* slots to children.
|
468
490
|
*/
|
469
|
-
export declare const
|
491
|
+
export declare const renderMenuGroup_unstable: (state: MenuGroupState, contextValues: MenuGroupContextValues) => JSX.Element;
|
470
492
|
|
471
493
|
/**
|
472
494
|
* Redefine the render function to add slots. Reuse the menugroupheader structure but add
|
473
495
|
* slots to children.
|
474
496
|
*/
|
475
|
-
export declare const
|
497
|
+
export declare const renderMenuGroupHeader_unstable: (state: MenuGroupHeaderState) => JSX.Element;
|
476
498
|
|
477
499
|
/**
|
478
500
|
* Function that renders the final JSX of the component
|
479
501
|
*/
|
480
|
-
export declare const
|
502
|
+
export declare const renderMenuItem_unstable: (state: MenuItemState) => JSX.Element;
|
481
503
|
|
482
504
|
/** Function that renders the final JSX of the component */
|
483
|
-
export declare const
|
505
|
+
export declare const renderMenuItemCheckbox_unstable: (state: MenuItemCheckboxState) => JSX.Element;
|
484
506
|
|
485
507
|
/**
|
486
508
|
* Redefine the render function to add slots. Reuse the menuitemradio structure but add
|
487
509
|
* slots to children.
|
488
510
|
*/
|
489
|
-
export declare const
|
511
|
+
export declare const renderMenuItemRadio_unstable: (state: MenuItemRadioState) => JSX.Element;
|
490
512
|
|
491
513
|
/**
|
492
514
|
* Function that renders the final JSX of the component
|
493
515
|
*/
|
494
|
-
export declare const
|
516
|
+
export declare const renderMenuList_unstable: (state: MenuListState, contextValues: MenuListContextValues) => JSX.Element;
|
495
517
|
|
496
518
|
/**
|
497
519
|
* Render the final JSX of MenuPopover
|
498
520
|
*/
|
499
|
-
export declare const
|
521
|
+
export declare const renderMenuPopover_unstable: (state: MenuPopoverState) => JSX.Element;
|
522
|
+
|
523
|
+
/**
|
524
|
+
* Render the final JSX of MenuSplitGroup
|
525
|
+
*/
|
526
|
+
export declare const renderMenuSplitGroup_unstable: (state: MenuSplitGroupState) => JSX.Element;
|
500
527
|
|
501
528
|
/**
|
502
529
|
* Render the final JSX of MenuTrigger
|
503
530
|
*
|
504
531
|
* Only renders children
|
505
532
|
*/
|
506
|
-
export declare const
|
533
|
+
export declare const renderMenuTrigger_unstable: (state: MenuTriggerState) => JSX.Element;
|
507
534
|
|
508
535
|
export declare type SelectableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked: boolean) => void;
|
509
536
|
|
@@ -514,96 +541,112 @@ export declare type UninitializedMenuListState = Omit<MenuListState, 'setFocusBy
|
|
514
541
|
*
|
515
542
|
* @param state - should contain a `checkmark` slot
|
516
543
|
*/
|
517
|
-
export declare const
|
544
|
+
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
|
518
545
|
|
519
546
|
/**
|
520
547
|
* Create the state required to render Menu.
|
521
548
|
*
|
522
549
|
* The returned state can be modified with hooks such as useMenuStyles,
|
523
|
-
* before being passed to
|
550
|
+
* before being passed to renderMenu_unstable.
|
524
551
|
*
|
525
552
|
* @param props - props from this instance of Menu
|
526
553
|
*/
|
527
|
-
export declare const
|
554
|
+
export declare const useMenu_unstable: (props: MenuProps) => MenuState;
|
528
555
|
|
529
|
-
export declare const
|
556
|
+
export declare const useMenuContext_unstable: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
|
530
557
|
|
531
|
-
export declare function
|
558
|
+
export declare function useMenuContextValues_unstable(state: MenuState): MenuContextValues;
|
532
559
|
|
533
560
|
/**
|
534
561
|
* Given user props, returns state and render function for a MenuDivider.
|
535
562
|
*/
|
536
|
-
export declare const
|
563
|
+
export declare const useMenuDivider_unstable: (props: MenuDividerProps, ref: React_2.Ref<HTMLElement>) => MenuDividerState;
|
537
564
|
|
538
|
-
export declare const
|
565
|
+
export declare const useMenuDividerStyles_unstable: (state: MenuDividerState) => MenuDividerState;
|
539
566
|
|
540
567
|
/**
|
541
568
|
* Given user props, returns state and render function for a MenuGroup.
|
542
569
|
*/
|
543
|
-
export declare function
|
570
|
+
export declare function useMenuGroup_unstable(props: MenuGroupProps, ref: React_2.Ref<HTMLElement>): MenuGroupState;
|
544
571
|
|
545
|
-
export declare const
|
572
|
+
export declare const useMenuGroupContext_unstable: () => MenuGroupContextValue;
|
546
573
|
|
547
|
-
export declare function
|
574
|
+
export declare function useMenuGroupContextValues_unstable(state: MenuGroupState): MenuGroupContextValues;
|
548
575
|
|
549
576
|
/**
|
550
577
|
* Given user props, returns state and render function for a MenuGroupHeader.
|
551
578
|
*/
|
552
|
-
export declare function
|
579
|
+
export declare function useMenuGroupHeader_unstable(props: MenuGroupHeaderProps, ref: React_2.Ref<HTMLElement>): MenuGroupHeaderState;
|
553
580
|
|
554
|
-
export declare const
|
581
|
+
export declare const useMenuGroupHeaderStyles_unstable: (state: MenuGroupHeaderState) => MenuGroupHeaderState;
|
555
582
|
|
556
|
-
export declare const
|
583
|
+
export declare const useMenuGroupStyles_unstable: (state: MenuGroupState) => MenuGroupState;
|
557
584
|
|
558
585
|
/**
|
559
586
|
* Returns the props and state required to render the component
|
560
587
|
*/
|
561
|
-
export declare const
|
588
|
+
export declare const useMenuItem_unstable: (props: MenuItemProps, ref: React_2.Ref<HTMLElement>) => MenuItemState;
|
562
589
|
|
563
590
|
/** Returns the props and state required to render the component */
|
564
|
-
export declare const
|
591
|
+
export declare const useMenuItemCheckbox_unstable: (props: MenuItemCheckboxProps, ref: React_2.Ref<HTMLElement>) => MenuItemCheckboxState;
|
565
592
|
|
566
|
-
export declare const
|
593
|
+
export declare const useMenuItemCheckboxStyles_unstable: (state: MenuItemCheckboxState) => void;
|
567
594
|
|
568
595
|
/**
|
569
596
|
* Given user props, returns state and render function for a MenuItemRadio.
|
570
597
|
*/
|
571
|
-
export declare const
|
598
|
+
export declare const useMenuItemRadio_unstable: (props: MenuItemRadioProps, ref: React_2.Ref<HTMLElement>) => MenuItemRadioState;
|
572
599
|
|
573
|
-
export declare const
|
600
|
+
export declare const useMenuItemRadioStyles_unstable: (state: MenuItemRadioState) => void;
|
574
601
|
|
575
602
|
/** Applies style classnames to slots */
|
576
|
-
export declare const
|
603
|
+
export declare const useMenuItemStyles_unstable: (state: MenuItemState) => void;
|
577
604
|
|
578
605
|
/**
|
579
606
|
* Returns the props and state required to render the component
|
580
607
|
*/
|
581
|
-
export declare const
|
608
|
+
export declare const useMenuList_unstable: (props: MenuListProps, ref: React_2.Ref<HTMLElement>) => MenuListState;
|
582
609
|
|
583
|
-
export declare const
|
610
|
+
export declare const useMenuListContext_unstable: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
|
584
611
|
|
585
|
-
export declare function
|
612
|
+
export declare function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues;
|
586
613
|
|
587
614
|
/**
|
588
615
|
* Apply styling to the Menu slots based on the state
|
589
616
|
*/
|
590
|
-
export declare const
|
617
|
+
export declare const useMenuListStyles_unstable: (state: MenuListState) => MenuListState;
|
591
618
|
|
592
619
|
/**
|
593
620
|
* Create the state required to render MenuPopover.
|
594
621
|
*
|
595
|
-
* The returned state can be modified with hooks such as
|
596
|
-
* before being passed to
|
622
|
+
* The returned state can be modified with hooks such as useMenuPopoverStyles_unstable,
|
623
|
+
* before being passed to renderMenuPopover_unstable.
|
597
624
|
*
|
598
625
|
* @param props - props from this instance of MenuPopover
|
599
626
|
* @param ref - reference to root HTMLElement of MenuPopover
|
600
627
|
*/
|
601
|
-
export declare const
|
628
|
+
export declare const useMenuPopover_unstable: (props: MenuPopoverProps, ref: React_2.Ref<HTMLElement>) => MenuPopoverState;
|
602
629
|
|
603
630
|
/**
|
604
631
|
* Apply styling to the Menu slots based on the state
|
605
632
|
*/
|
606
|
-
export declare const
|
633
|
+
export declare const useMenuPopoverStyles_unstable: (state: MenuPopoverState) => MenuPopoverState;
|
634
|
+
|
635
|
+
/**
|
636
|
+
* Create the state required to render MenuSplitGroup.
|
637
|
+
*
|
638
|
+
* The returned state can be modified with hooks such as useMenuSplitGroupStyles_unstable,
|
639
|
+
* before being passed to renderMenuSplitGroup_unstable.
|
640
|
+
*
|
641
|
+
* @param props - props from this instance of MenuSplitGroup
|
642
|
+
* @param ref - reference to root HTMLElement of MenuSplitGroup
|
643
|
+
*/
|
644
|
+
export declare const useMenuSplitGroup_unstable: (props: MenuSplitGroupProps, ref: React_2.Ref<HTMLElement>) => MenuSplitGroupState;
|
645
|
+
|
646
|
+
/**
|
647
|
+
* Apply styling to the MenuSplitGroup slots based on the state
|
648
|
+
*/
|
649
|
+
export declare const useMenuSplitGroupStyles_unstable: (state: MenuSplitGroupState) => MenuSplitGroupState;
|
607
650
|
|
608
651
|
/**
|
609
652
|
* Create the state required to render MenuTrigger.
|
@@ -611,8 +654,8 @@ export declare const useMenuPopoverStyles: (state: MenuPopoverState) => MenuPopo
|
|
611
654
|
*
|
612
655
|
* @param props - props from this instance of MenuTrigger
|
613
656
|
*/
|
614
|
-
export declare const
|
657
|
+
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;
|
615
658
|
|
616
|
-
export declare const
|
659
|
+
export declare const useMenuTriggerContext_unstable: () => boolean;
|
617
660
|
|
618
661
|
export { }
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/MenuSplitGroup/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuSplitGroup.js","sourceRoot":"","sources":["../src/MenuSplitGroup.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
@@ -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
8
|
export const Menu = props => {
|
9
|
-
const state =
|
10
|
-
const contextValues =
|
11
|
-
return
|
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":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/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","sourceRoot":""}
|
@@ -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
|
/**
|
@@ -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;
|
@@ -4,7 +4,7 @@ import { MenuProvider } from '../../contexts/menuContext';
|
|
4
4
|
* Render the final JSX of Menu
|
5
5
|
*/
|
6
6
|
|
7
|
-
export const
|
7
|
+
export const renderMenu_unstable = (state, contextValues) => {
|
8
8
|
return /*#__PURE__*/React.createElement(MenuProvider, {
|
9
9
|
value: contextValues.menu
|
10
10
|
}, state.menuTrigger, state.open && state.menuPopover);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAmB,aAAnB,KAAuD;AACxF,sBACE,KAAA,CAAA,aAAA,CAAC,YAAD,EAAa;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAb,EACG,KAAK,CAAC,WADT,EAEG,KAAK,CAAC,IAAN,IAAc,KAAK,CAAC,WAFvB,CADF;AAMD,CAPM","sourceRoot":""}
|
@@ -3,8 +3,8 @@ import type { MenuProps, MenuState } from './Menu.types';
|
|
3
3
|
* Create the state required to render Menu.
|
4
4
|
*
|
5
5
|
* The returned state can be modified with hooks such as useMenuStyles,
|
6
|
-
* before being passed to
|
6
|
+
* before being passed to renderMenu_unstable.
|
7
7
|
*
|
8
8
|
* @param props - props from this instance of Menu
|
9
9
|
*/
|
10
|
-
export declare const
|
10
|
+
export declare const useMenu_unstable: (props: MenuProps) => MenuState;
|
@@ -4,20 +4,19 @@ import { useControllableState, useId, useOnClickOutside, useEventCallback } from
|
|
4
4
|
import { useFluent } from '@fluentui/react-shared-contexts';
|
5
5
|
import { elementContains } from '@fluentui/react-portal';
|
6
6
|
import { useFocusFinders } from '@fluentui/react-tabster';
|
7
|
-
import {
|
8
|
-
import { useMenuContext } from '../../contexts/menuContext';
|
7
|
+
import { useMenuContext_unstable } from '../../contexts/menuContext';
|
9
8
|
import { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';
|
10
9
|
import { useIsSubmenu } from '../../utils/useIsSubmenu';
|
11
10
|
/**
|
12
11
|
* Create the state required to render Menu.
|
13
12
|
*
|
14
13
|
* The returned state can be modified with hooks such as useMenuStyles,
|
15
|
-
* before being passed to
|
14
|
+
* before being passed to renderMenu_unstable.
|
16
15
|
*
|
17
16
|
* @param props - props from this instance of Menu
|
18
17
|
*/
|
19
18
|
|
20
|
-
export const
|
19
|
+
export const useMenu_unstable = props => {
|
21
20
|
const triggerId = useId('menu');
|
22
21
|
const isSubmenu = useIsSubmenu();
|
23
22
|
const [contextTarget, setContextTarget] = usePopperMouseTarget();
|
@@ -29,23 +28,28 @@ export const useMenu = props => {
|
|
29
28
|
};
|
30
29
|
const children = React.Children.toArray(props.children);
|
31
30
|
|
32
|
-
if (
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
if (process.env.NODE_ENV !== 'production') {
|
32
|
+
if (children.length === 0) {
|
33
|
+
// eslint-disable-next-line no-console
|
34
|
+
console.warn('Menu must contain at least one child');
|
35
|
+
}
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
} = children.reduce((acc, child) => {
|
41
|
-
if (child.type === MenuTrigger) {
|
42
|
-
acc.menuTrigger = child;
|
43
|
-
} else {
|
44
|
-
acc.menuPopover = child;
|
37
|
+
if (children.length > 2) {
|
38
|
+
// eslint-disable-next-line no-console
|
39
|
+
console.warn('Menu must contain at most two children');
|
45
40
|
}
|
41
|
+
}
|
42
|
+
|
43
|
+
let menuTrigger = undefined;
|
44
|
+
let menuPopover = undefined;
|
45
|
+
|
46
|
+
if (children.length === 2) {
|
47
|
+
menuTrigger = children[0];
|
48
|
+
menuPopover = children[1];
|
49
|
+
} else if (children.length === 1) {
|
50
|
+
menuPopover = children[0];
|
51
|
+
}
|
46
52
|
|
47
|
-
return acc;
|
48
|
-
}, {});
|
49
53
|
const {
|
50
54
|
targetRef: triggerRef,
|
51
55
|
containerRef: menuPopoverRef
|
@@ -61,7 +65,8 @@ export const useMenu = props => {
|
|
61
65
|
menuTrigger,
|
62
66
|
menuPopover,
|
63
67
|
triggerRef,
|
64
|
-
menuPopoverRef
|
68
|
+
menuPopoverRef,
|
69
|
+
components: {}
|
65
70
|
}; // TODO Better way to narrow types ?
|
66
71
|
|
67
72
|
const [open, setOpen] = useMenuOpenState(initialState);
|
@@ -113,7 +118,7 @@ const useMenuOpenState = state => {
|
|
113
118
|
const {
|
114
119
|
targetDocument
|
115
120
|
} = useFluent();
|
116
|
-
const parentSetOpen =
|
121
|
+
const parentSetOpen = useMenuContext_unstable(context => context.setOpen);
|
117
122
|
const onOpenChange = useEventCallback((e, data) => {
|
118
123
|
var _a;
|
119
124
|
|
@@ -227,15 +232,18 @@ const useMenuOpenState = state => {
|
|
227
232
|
prevFocusable === null || prevFocusable === void 0 ? void 0 : prevFocusable.focus();
|
228
233
|
}, [findPrevFocusable, state.triggerRef]);
|
229
234
|
React.useEffect(() => {
|
230
|
-
|
231
|
-
|
232
|
-
if (!shouldHandleKeyboardRef.current) {
|
233
|
-
return;
|
235
|
+
if (open) {
|
236
|
+
focusFirst();
|
234
237
|
}
|
238
|
+
}, [open, focusFirst]);
|
239
|
+
React.useEffect(() => {
|
240
|
+
var _a;
|
235
241
|
|
236
242
|
if (open) {
|
237
243
|
focusFirst();
|
238
|
-
}
|
244
|
+
}
|
245
|
+
|
246
|
+
if (shouldHandleKeyboardRef.current && !open) {
|
239
247
|
if (shouldHandleTabRef.current && !state.isSubmenu) {
|
240
248
|
pressedShiftRef.current ? focusBeforeMenuTrigger() : focusAfterMenuTrigger();
|
241
249
|
} else {
|