@fluentui/react-menu 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +981 -32
- package/CHANGELOG.md +354 -138
- package/Spec.md +21 -16
- package/dist/{react-menu.d.ts → index.d.ts} +295 -166
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- 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.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.js.map +1 -1
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/Menu/renderMenu.js +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +120 -129
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +35 -33
- package/lib/components/Menu/useMenuContextValues.js.map +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.js.map +1 -1
- package/lib/components/MenuDivider/index.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +9 -7
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +14 -5
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +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.js.map +1 -1
- package/lib/components/MenuGroup/index.js +1 -0
- package/lib/components/MenuGroup/index.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +10 -7
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js +14 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
- package/lib/components/MenuGroupHeader/index.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +14 -5
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +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.js.map +1 -1
- package/lib/components/MenuItem/index.js.map +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.js +37 -44
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +61 -17
- package/lib/components/MenuItem/useMenuItemStyles.js.map +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.js +1 -0
- package/lib/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +36 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +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.js +1 -0
- package/lib/components/MenuItemRadio/index.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +36 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +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.js.map +1 -1
- package/lib/components/MenuList/index.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js +7 -7
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +71 -88
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +19 -17
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +16 -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.js.map +1 -1
- package/lib/components/MenuPopover/index.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +35 -41
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +20 -8
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -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.js +6 -0
- package/lib/components/MenuSplitGroup/index.js.map +1 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +42 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib/components/MenuTrigger/index.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +2 -2
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- 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.js +5 -11
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js +3 -5
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js +7 -17
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js +4 -6
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.js +25 -15
- 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.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.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.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.js +5 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +131 -142
- package/lib-commonjs/components/Menu/useMenu.js.map +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.js +9 -9
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +1 -1
- package/lib-commonjs/components/MenuDivider/index.js.map +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.js +12 -11
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +18 -7
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +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.js.map +1 -1
- 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.js +12 -13
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +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.js +11 -11
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +25 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- 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.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.js +11 -12
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +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.js +18 -7
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +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.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.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.js +45 -53
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +68 -20
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +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.js +3 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +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.js +19 -21
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +40 -7
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +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.js +3 -1
- package/lib-commonjs/components/MenuItemRadio/index.js.map +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.js +19 -20
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +40 -7
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +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.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +1 -1
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +78 -96
- package/lib-commonjs/components/MenuList/useMenuList.js.map +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.js +19 -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.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.js +14 -13
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- 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.js +24 -10
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- 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.js +6 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -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.js +26 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -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.js +54 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- 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.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.js +6 -6
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- 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.js +6 -12
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +5 -7
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +8 -18
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +6 -8
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +487 -16
- 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.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 +25 -29
- package/lib/Menu.d.ts +0 -1
- package/lib/MenuDivider.d.ts +0 -1
- package/lib/MenuGroup.d.ts +0 -1
- package/lib/MenuGroupHeader.d.ts +0 -1
- package/lib/MenuItem.d.ts +0 -1
- package/lib/MenuItemCheckbox.d.ts +0 -1
- package/lib/MenuItemRadio.d.ts +0 -1
- package/lib/MenuList.d.ts +0 -1
- package/lib/MenuPopover.d.ts +0 -1
- package/lib/MenuTrigger.d.ts +0 -1
- 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/Menu/Menu.d.ts +0 -6
- package/lib/components/Menu/Menu.types.d.ts +0 -112
- package/lib/components/Menu/index.d.ts +0 -5
- package/lib/components/Menu/renderMenu.d.ts +0 -5
- package/lib/components/Menu/useMenu.d.ts +0 -10
- package/lib/components/Menu/useMenuContextValues.d.ts +0 -2
- package/lib/components/MenuDivider/MenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +0 -6
- package/lib/components/MenuDivider/index.d.ts +0 -5
- package/lib/components/MenuDivider/renderMenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/useMenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
- package/lib/components/MenuGroup/MenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +0 -15
- package/lib/components/MenuGroup/index.d.ts +0 -5
- package/lib/components/MenuGroup/renderMenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/useMenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
- package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
- package/lib/components/MenuGroupHeader/index.d.ts +0 -5
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
- package/lib/components/MenuItem/MenuItem.d.ts +0 -6
- package/lib/components/MenuItem/MenuItem.types.d.ts +0 -43
- package/lib/components/MenuItem/index.d.ts +0 -5
- package/lib/components/MenuItem/renderMenuItem.d.ts +0 -5
- package/lib/components/MenuItem/useCharacterSearch.d.ts +0 -3
- package/lib/components/MenuItem/useMenuItem.d.ts +0 -10
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +0 -3
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
- package/lib/components/MenuItemCheckbox/index.d.ts +0 -4
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
- package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
- package/lib/components/MenuItemRadio/index.d.ts +0 -4
- package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
- package/lib/components/MenuList/MenuList.d.ts +0 -6
- package/lib/components/MenuList/MenuList.types.d.ts +0 -53
- package/lib/components/MenuList/index.d.ts +0 -6
- package/lib/components/MenuList/renderMenuList.d.ts +0 -5
- package/lib/components/MenuList/useMenuList.d.ts +0 -6
- package/lib/components/MenuList/useMenuListContextValues.d.ts +0 -2
- package/lib/components/MenuList/useMenuListStyles.d.ts +0 -5
- package/lib/components/MenuPopover/MenuPopover.d.ts +0 -6
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +0 -18
- package/lib/components/MenuPopover/index.d.ts +0 -5
- package/lib/components/MenuPopover/renderMenuPopover.d.ts +0 -5
- package/lib/components/MenuPopover/useMenuPopover.d.ts +0 -12
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
- package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -7
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
- package/lib/components/MenuTrigger/index.d.ts +0 -4
- package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
- package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
- 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/components/index.d.ts +0 -2
- package/lib/contexts/menuContext.d.ts +0 -16
- package/lib/contexts/menuGroupContext.d.ts +0 -13
- package/lib/contexts/menuListContext.d.ts +0 -15
- package/lib/contexts/menuTriggerContext.d.ts +0 -3
- package/lib/index.d.ts +0 -15
- package/lib/selectable/index.d.ts +0 -2
- package/lib/selectable/types.d.ts +0 -34
- package/lib/selectable/useCheckmarkStyles.d.ts +0 -8
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/useIsSubmenu.d.ts +0 -9
- package/lib/utils/useOnMenuEnter.d.ts +0 -23
- package/lib-commonjs/Menu.d.ts +0 -1
- package/lib-commonjs/MenuDivider.d.ts +0 -1
- package/lib-commonjs/MenuGroup.d.ts +0 -1
- package/lib-commonjs/MenuGroupHeader.d.ts +0 -1
- package/lib-commonjs/MenuItem.d.ts +0 -1
- package/lib-commonjs/MenuItemCheckbox.d.ts +0 -1
- package/lib-commonjs/MenuItemRadio.d.ts +0 -1
- package/lib-commonjs/MenuList.d.ts +0 -1
- package/lib-commonjs/MenuPopover.d.ts +0 -1
- package/lib-commonjs/MenuTrigger.d.ts +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/Menu/Menu.d.ts +0 -6
- package/lib-commonjs/components/Menu/Menu.types.d.ts +0 -112
- package/lib-commonjs/components/Menu/index.d.ts +0 -5
- package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -5
- package/lib-commonjs/components/Menu/useMenu.d.ts +0 -10
- package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/index.d.ts +0 -5
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +0 -2
- package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +0 -15
- package/lib-commonjs/components/MenuGroup/index.d.ts +0 -5
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/index.d.ts +0 -5
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -2
- package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -6
- package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +0 -43
- package/lib-commonjs/components/MenuItem/index.d.ts +0 -5
- package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +0 -5
- package/lib-commonjs/components/MenuItem/useCharacterSearch.d.ts +0 -3
- package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +0 -10
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +0 -3
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
- package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +0 -4
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -2
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
- package/lib-commonjs/components/MenuItemRadio/index.d.ts +0 -4
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -2
- package/lib-commonjs/components/MenuList/MenuList.d.ts +0 -6
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +0 -53
- package/lib-commonjs/components/MenuList/index.d.ts +0 -6
- package/lib-commonjs/components/MenuList/renderMenuList.d.ts +0 -5
- package/lib-commonjs/components/MenuList/useMenuList.d.ts +0 -6
- package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +0 -5
- package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +0 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +0 -18
- package/lib-commonjs/components/MenuPopover/index.d.ts +0 -5
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +0 -5
- package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +0 -12
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -5
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -7
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +0 -16
- package/lib-commonjs/components/MenuTrigger/index.d.ts +0 -4
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
- 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/components/index.d.ts +0 -2
- package/lib-commonjs/contexts/menuContext.d.ts +0 -16
- package/lib-commonjs/contexts/menuGroupContext.d.ts +0 -13
- package/lib-commonjs/contexts/menuListContext.d.ts +0 -15
- package/lib-commonjs/contexts/menuTriggerContext.d.ts +0 -3
- package/lib-commonjs/index.d.ts +0 -15
- package/lib-commonjs/selectable/index.d.ts +0 -2
- package/lib-commonjs/selectable/types.d.ts +0 -34
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +0 -8
- package/lib-commonjs/utils/index.d.ts +0 -1
- package/lib-commonjs/utils/useIsSubmenu.d.ts +0 -9
- package/lib-commonjs/utils/useOnMenuEnter.d.ts +0 -23
@@ -1,43 +0,0 @@
|
|
1
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
export declare type MenuItemSlots = {
|
3
|
-
root: IntrinsicShorthandProps<'div'>;
|
4
|
-
/**
|
5
|
-
* Icon slot rendered before children content
|
6
|
-
*/
|
7
|
-
icon?: IntrinsicShorthandProps<'span'>;
|
8
|
-
/**
|
9
|
-
* A helper slot for alignment when a menu item is used with selectable menuitems
|
10
|
-
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
11
|
-
*/
|
12
|
-
checkmark?: IntrinsicShorthandProps<'span'>;
|
13
|
-
/**
|
14
|
-
* Icon slot that shows the indicator for a submenu
|
15
|
-
*/
|
16
|
-
submenuIndicator?: IntrinsicShorthandProps<'span'>;
|
17
|
-
/**
|
18
|
-
* Component children are placed in this slot
|
19
|
-
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
20
|
-
*/
|
21
|
-
content: IntrinsicShorthandProps<'span'>;
|
22
|
-
/**
|
23
|
-
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
24
|
-
*/
|
25
|
-
secondaryContent?: IntrinsicShorthandProps<'span'>;
|
26
|
-
};
|
27
|
-
declare type MenuItemCommons = {
|
28
|
-
/**
|
29
|
-
* If the menu item is a trigger for a submenu
|
30
|
-
*/
|
31
|
-
hasSubmenu?: boolean;
|
32
|
-
/**
|
33
|
-
* Applies disabled styles to menu item but remains focusable
|
34
|
-
*/
|
35
|
-
disabled?: boolean;
|
36
|
-
/**
|
37
|
-
* Clicking on the menu item will not dismiss an open menu
|
38
|
-
*/
|
39
|
-
persistOnClick?: boolean;
|
40
|
-
};
|
41
|
-
export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & MenuItemCommons;
|
42
|
-
export declare type MenuItemState = ComponentState<MenuItemSlots> & MenuItemCommons;
|
43
|
-
export {};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem.types';
|
3
|
-
/**
|
4
|
-
* Consts listing which props are shorthand props.
|
5
|
-
*/
|
6
|
-
export declare const menuItemSlots: Array<keyof MenuItemSlots>;
|
7
|
-
/**
|
8
|
-
* Returns the props and state required to render the component
|
9
|
-
*/
|
10
|
-
export declare const useMenuItem: (props: MenuItemProps, ref: React.Ref<HTMLElement>) => MenuItemState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuItemCheckboxProps } from './MenuItemCheckbox.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>;
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import type { MenuItemSelectableProps, MenuItemSelectableState } from '../../selectable/index';
|
2
|
-
import type { MenuItemProps, MenuItemState } from '../MenuItem/MenuItem.types';
|
3
|
-
export declare type MenuItemCheckboxProps = MenuItemProps & MenuItemSelectableProps;
|
4
|
-
export declare type MenuItemCheckboxState = MenuItemState & MenuItemSelectableState;
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox.types';
|
3
|
-
/** Returns the props and state required to render the component */
|
4
|
-
export declare const useMenuItemCheckbox: (props: MenuItemCheckboxProps, ref: React.Ref<HTMLElement>) => MenuItemCheckboxState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuItemRadioProps } from './MenuItemRadio.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuItemRadio, using the `useMenuItemRadio` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>;
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import type { MenuItemSelectableProps, MenuItemSelectableState } from '../../selectable/index';
|
2
|
-
import type { MenuItemProps, MenuItemState } from '../MenuItem/MenuItem.types';
|
3
|
-
export declare type MenuItemRadioProps = MenuItemProps & MenuItemSelectableProps;
|
4
|
-
export declare type MenuItemRadioState = MenuItemState & MenuItemSelectableState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuItemRadioState } from './MenuItemRadio.types';
|
2
|
-
/**
|
3
|
-
* Redefine the render function to add slots. Reuse the menuitemradio structure but add
|
4
|
-
* slots to children.
|
5
|
-
*/
|
6
|
-
export declare const renderMenuItemRadio: (state: MenuItemRadioState) => JSX.Element;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio.types';
|
3
|
-
/**
|
4
|
-
* Given user props, returns state and render function for a MenuItemRadio.
|
5
|
-
*/
|
6
|
-
export declare const useMenuItemRadio: (props: MenuItemRadioProps, ref: React.Ref<HTMLElement>) => MenuItemRadioState;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
3
|
-
import { MenuListContextValue } from '../../contexts/menuListContext';
|
4
|
-
import { SelectableHandler } from '../../selectable/index';
|
5
|
-
export declare type MenuListCommons = {
|
6
|
-
/**
|
7
|
-
* Callback when checked items change for value with a name
|
8
|
-
*
|
9
|
-
* @param event - React's original SyntheticEvent
|
10
|
-
* @param data - A data object with relevant information
|
11
|
-
*/
|
12
|
-
onCheckedValueChange?: (e: React.MouseEvent | React.KeyboardEvent, data: {
|
13
|
-
/** The name of the value */
|
14
|
-
name: string;
|
15
|
-
/** The items for this value that are checked */
|
16
|
-
checkedItems: string[];
|
17
|
-
}) => void;
|
18
|
-
/**
|
19
|
-
* Map of all checked values
|
20
|
-
*/
|
21
|
-
checkedValues: Record<string, string[]>;
|
22
|
-
/**
|
23
|
-
* Default values to be checked on mount
|
24
|
-
*/
|
25
|
-
defaultCheckedValues?: Record<string, string[]>;
|
26
|
-
/**
|
27
|
-
* States that menu items can contain icons and reserve slots for item alignment
|
28
|
-
*/
|
29
|
-
hasIcons?: boolean;
|
30
|
-
/**
|
31
|
-
* States that menu items can contain selectable items and reserve slots for item alignment
|
32
|
-
*/
|
33
|
-
hasCheckmarks?: boolean;
|
34
|
-
};
|
35
|
-
export declare type MenuListSlots = {
|
36
|
-
root: IntrinsicShorthandProps<'div'>;
|
37
|
-
};
|
38
|
-
export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
|
39
|
-
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
40
|
-
/**
|
41
|
-
* Callback to set focus on the next menu item by first character
|
42
|
-
*/
|
43
|
-
setFocusByFirstCharacter: NonNullable<MenuListContextValue['setFocusByFirstCharacter']>;
|
44
|
-
toggleCheckbox: SelectableHandler;
|
45
|
-
/**
|
46
|
-
* Selects a radio item, will de-select the currently selected ratio item
|
47
|
-
*/
|
48
|
-
selectRadio: SelectableHandler;
|
49
|
-
};
|
50
|
-
export declare type MenuListContextValues = {
|
51
|
-
menuList: MenuListContextValue;
|
52
|
-
};
|
53
|
-
export declare type UninitializedMenuListState = Omit<MenuListState, 'setFocusByFirstCharacter' | 'toggleCheckbox' | 'selectRadio' | 'checkedValues'> & Partial<Pick<MenuListState, 'checkedValues'>>;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuListProps, MenuListState } from './MenuList.types';
|
3
|
-
/**
|
4
|
-
* Returns the props and state required to render the component
|
5
|
-
*/
|
6
|
-
export declare const useMenuList: (props: MenuListProps, ref: React.Ref<HTMLElement>) => MenuListState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuPopoverProps } from './MenuPopover.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
|
5
|
-
*/
|
6
|
-
export declare const MenuPopover: ForwardRefComponent<MenuPopoverProps>;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
export declare type MenuPopoverSlots = {
|
3
|
-
root: IntrinsicShorthandProps<'div'>;
|
4
|
-
};
|
5
|
-
/**
|
6
|
-
* MenuPopover Props
|
7
|
-
*/
|
8
|
-
export declare type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;
|
9
|
-
/**
|
10
|
-
* State used in rendering MenuPopover
|
11
|
-
*/
|
12
|
-
export declare type MenuPopoverState = ComponentState<MenuPopoverSlots> & {
|
13
|
-
/**
|
14
|
-
* Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
|
15
|
-
* This option is disregarded for submenus
|
16
|
-
*/
|
17
|
-
inline: boolean;
|
18
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { MenuPopoverProps, MenuPopoverState } from './MenuPopover.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render MenuPopover.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as useMenuPopoverStyles,
|
7
|
-
* before being passed to renderMenuPopover.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of MenuPopover
|
10
|
-
* @param ref - reference to root HTMLElement of MenuPopover
|
11
|
-
*/
|
12
|
-
export declare const useMenuPopover: (props: MenuPopoverProps, ref: React.Ref<HTMLElement>) => MenuPopoverState;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuTriggerProps } from './MenuTrigger.types';
|
3
|
-
/**
|
4
|
-
* Wraps a trigger element as an only child
|
5
|
-
* and adds the necessary event handling to open a popup menu
|
6
|
-
*/
|
7
|
-
export declare const MenuTrigger: React.FC<MenuTriggerProps>;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export declare type MenuTriggerProps = {
|
3
|
-
/**
|
4
|
-
* Explicitly require single child or render function
|
5
|
-
*/
|
6
|
-
children: (React.ReactElement & {
|
7
|
-
ref?: React.Ref<unknown>;
|
8
|
-
}) | ((props: MenuTriggerChildProps) => React.ReactNode);
|
9
|
-
};
|
10
|
-
/**
|
11
|
-
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
12
|
-
*/
|
13
|
-
export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'>> & {
|
14
|
-
ref?: React.Ref<never>;
|
15
|
-
};
|
16
|
-
export declare type MenuTriggerState = MenuTriggerProps;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render MenuTrigger.
|
4
|
-
* Clones the only child component and adds necessary event handling behaviours to open a popup menu
|
5
|
-
*
|
6
|
-
* @param props - props from this instance of MenuTrigger
|
7
|
-
*/
|
8
|
-
export declare const useMenuTrigger: (props: MenuTriggerProps) => MenuTriggerState;
|
@@ -1,179 +0,0 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
|
-
import * as React from 'react';
|
3
|
-
import { ArrowRight, ArrowDown, ArrowLeft, Escape } from '@fluentui/keyboard-keys';
|
4
|
-
import { applyTriggerPropsToChildren, onlyChild, shouldPreventDefaultOnKeyDown, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
|
5
|
-
import { useFocusFinders } from '@fluentui/react-tabster';
|
6
|
-
import { useMenuContext } from '../../contexts/menuContext';
|
7
|
-
import { useFluent } from '@fluentui/react-shared-contexts';
|
8
|
-
import { useIsSubmenu } from '../../utils/useIsSubmenu';
|
9
|
-
|
10
|
-
var noop = function () {
|
11
|
-
return null;
|
12
|
-
};
|
13
|
-
/**
|
14
|
-
* Adds the necessary props to the trigger element
|
15
|
-
*/
|
16
|
-
|
17
|
-
|
18
|
-
export var useTriggerElement = function (state) {
|
19
|
-
var _a, _b;
|
20
|
-
|
21
|
-
var triggerRef = useMenuContext(function (context) {
|
22
|
-
return context.triggerRef;
|
23
|
-
});
|
24
|
-
var menuPopoverRef = useMenuContext(function (context) {
|
25
|
-
return context.menuPopoverRef;
|
26
|
-
});
|
27
|
-
var setOpen = useMenuContext(function (context) {
|
28
|
-
return context.setOpen;
|
29
|
-
});
|
30
|
-
var open = useMenuContext(function (context) {
|
31
|
-
return context.open;
|
32
|
-
});
|
33
|
-
var triggerId = useMenuContext(function (context) {
|
34
|
-
return context.triggerId;
|
35
|
-
});
|
36
|
-
var openOnHover = useMenuContext(function (context) {
|
37
|
-
return context.openOnHover;
|
38
|
-
});
|
39
|
-
var openOnContext = useMenuContext(function (context) {
|
40
|
-
return context.openOnContext;
|
41
|
-
});
|
42
|
-
var isSubmenu = useIsSubmenu();
|
43
|
-
var findFirstFocusable = useFocusFinders().findFirstFocusable;
|
44
|
-
var focusFirst = React.useCallback(function () {
|
45
|
-
var firstFocusable = findFirstFocusable(menuPopoverRef.current);
|
46
|
-
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
47
|
-
}, [findFirstFocusable, menuPopoverRef]);
|
48
|
-
var openedWithKeyboardRef = React.useRef(false);
|
49
|
-
var hasMouseMoved = React.useRef(false);
|
50
|
-
var dir = useFluent().dir;
|
51
|
-
var OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
|
52
|
-
var child = /*#__PURE__*/React.isValidElement(state.children) ? onlyChild(state.children) : undefined;
|
53
|
-
var onContextMenu = useEventCallback(function (e) {
|
54
|
-
var _a, _b;
|
55
|
-
|
56
|
-
if (openOnContext) {
|
57
|
-
e.preventDefault();
|
58
|
-
setOpen(e, {
|
59
|
-
open: true,
|
60
|
-
keyboard: false
|
61
|
-
});
|
62
|
-
}
|
63
|
-
|
64
|
-
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
65
|
-
});
|
66
|
-
var onClick = useEventCallback(function (e) {
|
67
|
-
var _a, _b;
|
68
|
-
|
69
|
-
if (!openOnContext) {
|
70
|
-
setOpen(e, {
|
71
|
-
open: !open,
|
72
|
-
keyboard: openedWithKeyboardRef.current
|
73
|
-
});
|
74
|
-
openedWithKeyboardRef.current = false;
|
75
|
-
}
|
76
|
-
|
77
|
-
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
78
|
-
});
|
79
|
-
var onKeyDown = useEventCallback(function (e) {
|
80
|
-
var _a, _b, _c;
|
81
|
-
|
82
|
-
if (shouldPreventDefaultOnKeyDown(e)) {
|
83
|
-
e.preventDefault();
|
84
|
-
openedWithKeyboardRef.current = true;
|
85
|
-
(_a = e.target) === null || _a === void 0 ? void 0 : _a.click();
|
86
|
-
}
|
87
|
-
|
88
|
-
var key = e.key;
|
89
|
-
|
90
|
-
if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {
|
91
|
-
setOpen(e, {
|
92
|
-
open: true,
|
93
|
-
keyboard: true
|
94
|
-
});
|
95
|
-
}
|
96
|
-
|
97
|
-
if (key === Escape && !isSubmenu) {
|
98
|
-
setOpen(e, {
|
99
|
-
open: false,
|
100
|
-
keyboard: true
|
101
|
-
});
|
102
|
-
} // if menu is already open, can't rely on effects to focus
|
103
|
-
|
104
|
-
|
105
|
-
if (open && key === OpenArrowKey && isSubmenu) {
|
106
|
-
focusFirst();
|
107
|
-
}
|
108
|
-
|
109
|
-
if (open && key === ArrowDown && !isSubmenu) {
|
110
|
-
focusFirst();
|
111
|
-
}
|
112
|
-
|
113
|
-
(_c = (_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
|
114
|
-
});
|
115
|
-
var onMouseEnter = useEventCallback(function (e) {
|
116
|
-
var _a, _b;
|
117
|
-
|
118
|
-
if (openOnHover && hasMouseMoved.current) {
|
119
|
-
setOpen(e, {
|
120
|
-
open: true,
|
121
|
-
keyboard: false
|
122
|
-
});
|
123
|
-
}
|
124
|
-
|
125
|
-
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
126
|
-
}); // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
|
127
|
-
// First time open the mouse using mousemove and then continue with mouseenter
|
128
|
-
// Only use once to determine that the user is using the mouse since it is an expensive event to handle
|
129
|
-
|
130
|
-
var onMouseMove = useEventCallback(function (e) {
|
131
|
-
if (openOnHover && !hasMouseMoved.current) {
|
132
|
-
setOpen(e, {
|
133
|
-
open: true,
|
134
|
-
keyboard: false
|
135
|
-
});
|
136
|
-
hasMouseMoved.current = true;
|
137
|
-
}
|
138
|
-
});
|
139
|
-
var onMouseLeave = useEventCallback(function (e) {
|
140
|
-
var _a, _b;
|
141
|
-
|
142
|
-
if (openOnHover) {
|
143
|
-
setOpen(e, {
|
144
|
-
open: false,
|
145
|
-
keyboard: false
|
146
|
-
});
|
147
|
-
}
|
148
|
-
|
149
|
-
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
150
|
-
});
|
151
|
-
var disabled = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.disabled;
|
152
|
-
|
153
|
-
var triggerProps = __assign({
|
154
|
-
'aria-haspopup': true,
|
155
|
-
'aria-expanded': open,
|
156
|
-
id: ((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id) || triggerId
|
157
|
-
}, !disabled ? {
|
158
|
-
onClick: onClick,
|
159
|
-
onMouseEnter: onMouseEnter,
|
160
|
-
onMouseLeave: onMouseLeave,
|
161
|
-
onContextMenu: onContextMenu,
|
162
|
-
onKeyDown: onKeyDown,
|
163
|
-
onMouseMove: onMouseMove
|
164
|
-
} : // Spread disabled event handlers to implement contract and avoid specific disabled logic in handlers
|
165
|
-
{
|
166
|
-
onClick: noop,
|
167
|
-
onMouseEnter: noop,
|
168
|
-
onMouseLeave: noop,
|
169
|
-
onContextMenu: noop,
|
170
|
-
onKeyDown: noop,
|
171
|
-
onMouseMove: noop
|
172
|
-
});
|
173
|
-
|
174
|
-
state.children = applyTriggerPropsToChildren(state.children, __assign(__assign({}, triggerProps), {
|
175
|
-
ref: useMergedRefs(typeof state.children !== 'function' && state.children.ref || null, triggerRef)
|
176
|
-
}));
|
177
|
-
return state;
|
178
|
-
};
|
179
|
-
//# sourceMappingURL=useTriggerElement.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,SAA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IADD;AAEhB,qBAAiB,IAFD;AAGhB,IAAA,EAAE,EAAE,CAAA,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,EAAd,KAAoB;AAHR,GAAA,EAKZ,CAAC,QAAD,GACA;AACE,IAAA,OAAO,EAAA,OADT;AAEE,IAAA,YAAY,EAAA,YAFd;AAGE,IAAA,YAAY,EAAA,YAHd;AAIE,IAAA,aAAa,EAAA,aAJf;AAKE,IAAA,SAAS,EAAA,SALX;AAME,IAAA,WAAW,EAAA;AANb,GADA,GASA;AACA;AACE,IAAA,OAAO,EAAE,IADX;AAEE,IAAA,YAAY,EAAE,IAFhB;AAGE,IAAA,YAAY,EAAE,IAHhB;AAIE,IAAA,aAAa,EAAE,IAJjB;AAKE,IAAA,SAAS,EAAE,IALb;AAME,IAAA,WAAW,EAAE;AANf,GAfY,CAAlB;;AAyBA,EAAA,KAAK,CAAC,QAAN,GAAiB,2BAA2B,CAAC,KAAK,CAAC,QAAP,EAAe,QAAA,CAAA,QAAA,CAAA,EAAA,EACtD,YADsD,CAAA,EAC1C;AACf,IAAA,GAAG,EAAE,aAAa,CAAE,OAAO,KAAK,CAAC,QAAb,KAA0B,UAA1B,IAAwC,KAAK,CAAC,QAAN,CAAe,GAAxD,IAAgE,IAAjE,EAAuE,UAAvE;AADH,GAD0C,CAAf,CAA5C;AAKA,SAAO,KAAP;AACD,CAhIM","sourceRoot":""}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ContextSelector, Context } from '@fluentui/react-context-selector';
|
3
|
-
import type { MenuListProps } from '../components/index';
|
4
|
-
import type { MenuState } from '../components/Menu/index';
|
5
|
-
export declare const MenuContext: Context<MenuContextValue>;
|
6
|
-
/**
|
7
|
-
* Context shared between Menu and its children components
|
8
|
-
*
|
9
|
-
* Extends and drills down MenuList props to simplify API
|
10
|
-
*/
|
11
|
-
export declare type MenuContextValue = MenuListProps & Pick<MenuState, 'openOnHover' | 'openOnContext' | 'triggerRef' | 'menuPopoverRef' | 'setOpen' | 'isSubmenu' | 'triggerId' | 'hasIcons' | 'hasCheckmarks' | 'persistOnItemClick' | 'inline'> & {
|
12
|
-
open: boolean;
|
13
|
-
triggerId: string;
|
14
|
-
};
|
15
|
-
export declare const MenuProvider: React.Provider<MenuContextValue> & React.FC<React.ProviderProps<MenuContextValue>>;
|
16
|
-
export declare const useMenuContext: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
/**
|
3
|
-
* Context used to guarantee correct aria-relationship between header
|
4
|
-
* and group information
|
5
|
-
*/
|
6
|
-
export declare type MenuGroupContextValue = {
|
7
|
-
/**
|
8
|
-
* Element id applied to the `MenuGroupHeader` component
|
9
|
-
*/
|
10
|
-
headerId: string;
|
11
|
-
};
|
12
|
-
export declare const MenuGroupContextProvider: React.Provider<MenuGroupContextValue>;
|
13
|
-
export declare const useMenuGroupContext: () => MenuGroupContextValue;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ContextSelector, Context } from '@fluentui/react-context-selector';
|
3
|
-
import type { SelectableHandler } from '../selectable/index';
|
4
|
-
import type { MenuListProps } from '../components/index';
|
5
|
-
export declare const MenuListContext: Context<MenuListContextValue>;
|
6
|
-
/**
|
7
|
-
* Context shared between MenuList and its children components
|
8
|
-
*/
|
9
|
-
export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
|
10
|
-
setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
|
11
|
-
toggleCheckbox?: SelectableHandler;
|
12
|
-
selectRadio?: SelectableHandler;
|
13
|
-
};
|
14
|
-
export declare const MenuListProvider: React.Provider<MenuListContextValue> & React.FC<React.ProviderProps<MenuListContextValue>>;
|
15
|
-
export declare const useMenuListContext: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
|