@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
package/lib/index.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
export * from './MenuItem';
|
2
|
-
export * from './MenuList';
|
3
|
-
export * from './MenuItemCheckbox';
|
4
|
-
export * from './MenuItemRadio';
|
5
|
-
export * from './MenuDivider';
|
6
|
-
export * from './MenuGroupHeader';
|
7
|
-
export * from './MenuGroup';
|
8
|
-
export * from './selectable/index';
|
9
|
-
export * from './MenuTrigger';
|
10
|
-
export * from './Menu';
|
11
|
-
export * from './contexts/menuContext';
|
12
|
-
export * from './contexts/menuTriggerContext';
|
13
|
-
export * from './contexts/menuGroupContext';
|
14
|
-
export * from './contexts/menuListContext';
|
15
|
-
export * from './MenuPopover';
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export declare type SelectableHandler = (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked: boolean) => void;
|
3
|
-
/**
|
4
|
-
* Props for selecatble menu items
|
5
|
-
*/
|
6
|
-
export declare type MenuItemSelectableProps = {
|
7
|
-
/**
|
8
|
-
* Follows input convention
|
9
|
-
* https://www.w3schools.com/jsref/prop_checkbox_name.asp
|
10
|
-
*/
|
11
|
-
name: string;
|
12
|
-
/**
|
13
|
-
* Follows input convention
|
14
|
-
* https://www.w3schools.com/jsref/prop_checkbox_value.asp
|
15
|
-
*/
|
16
|
-
value: string;
|
17
|
-
};
|
18
|
-
/**
|
19
|
-
* State for selectable menu items
|
20
|
-
*/
|
21
|
-
export declare type MenuItemSelectableState = MenuItemSelectableProps & {
|
22
|
-
/**
|
23
|
-
* Checked items for a value with `name`
|
24
|
-
*/
|
25
|
-
checkedItems: string[];
|
26
|
-
/**
|
27
|
-
* Callback when checked items changes for a given value with `name`
|
28
|
-
*/
|
29
|
-
onCheckedValueChange: (e: React.MouseEvent | React.KeyboardEvent, name: string, checkedItems: string[]) => void;
|
30
|
-
/**
|
31
|
-
* Selectable is checked
|
32
|
-
*/
|
33
|
-
checked: boolean;
|
34
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { MenuItemSelectableState } from './types';
|
2
|
-
import type { MenuItemSlots } from '../components/MenuItem/MenuItem.types';
|
3
|
-
/**
|
4
|
-
* Applies styles to a checkmark slot for selectable menu items
|
5
|
-
*
|
6
|
-
* @param state - should contain a `checkmark` slot
|
7
|
-
*/
|
8
|
-
export declare const useCheckmarkStyles: (state: MenuItemSelectableState & Pick<MenuItemSlots, 'checkmark'>) => void;
|
package/lib/utils/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './useOnMenuEnter';
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A component can be a part of a submenu whether its menu context `isSubmenu` flag is true
|
3
|
-
* or whether it is a part of a `MenuList`
|
4
|
-
*
|
5
|
-
* A simple hook to check box contexts easily
|
6
|
-
*
|
7
|
-
* @returns whether the component is part of a submenu
|
8
|
-
*/
|
9
|
-
export declare function useIsSubmenu(): boolean;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import type { UseOnClickOrScrollOutsideOptions } from '@fluentui/react-utilities';
|
2
|
-
/**
|
3
|
-
* Name of the custom event
|
4
|
-
*/
|
5
|
-
export declare const MENU_ENTER_EVENT = "fuimenuenter";
|
6
|
-
/**
|
7
|
-
* This hook works similarly to @see {useOnClickOutside}
|
8
|
-
*
|
9
|
-
* Problem: Trying to behave the same as system menus:
|
10
|
-
* When the mouse leaves a stack of nested menus the stack should not dismiss.
|
11
|
-
* However if the mouse leaves a stack of menus and enters a parent menu all its children menu should dismiss.
|
12
|
-
*
|
13
|
-
* We don't use the native mouseenter event because it would trigger too many times in the document
|
14
|
-
* Instead, dispatch custom DOM event from the menu so that it can bubble
|
15
|
-
* Each nested menu can use the listener to check if the event is from a child or parent menu
|
16
|
-
*/
|
17
|
-
export declare const useOnMenuMouseEnter: (options: UseOnClickOrScrollOutsideOptions) => void;
|
18
|
-
/**
|
19
|
-
* Dispatches the custom MouseEvent enter event. Similar to calling `el.click()`
|
20
|
-
* @param el element for the event target
|
21
|
-
* @param nativeEvent the native mouse event this is mapped to
|
22
|
-
*/
|
23
|
-
export declare const dispatchMenuEnterEvent: (el: HTMLElement, nativeEvent: MouseEvent) => void;
|
package/lib-commonjs/Menu.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Menu/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuDivider/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuGroup/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuGroupHeader/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuItem/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuItemCheckbox/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuItemRadio/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuList/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuPopover/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuTrigger/index';
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.isConformant = void 0;
|
7
|
-
|
8
|
-
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
-
|
10
|
-
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
-
|
12
|
-
function isConformant(testInfo) {
|
13
|
-
var defaultOptions = {
|
14
|
-
asPropHandlesRef: true,
|
15
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
16
|
-
skipAsPropTests: true,
|
17
|
-
extraTests: react_conformance_make_styles_1.default
|
18
|
-
};
|
19
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
20
|
-
}
|
21
|
-
|
22
|
-
exports.isConformant = isConformant;
|
23
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,eAAe,EAAE,IAH0C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA;AAJ+C,GAA7D;AAOA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAXD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { MenuContextValue } from '../contexts/menuContext';
|
2
|
-
/**
|
3
|
-
* A test utility to mock the useMenuContext hook that relies on context selector
|
4
|
-
* Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
|
5
|
-
* @param options Menu context values to set for testing
|
6
|
-
*/
|
7
|
-
export declare const mockUseMenuContext: (options?: Partial<MenuContextValue>) => void;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.mockUseMenuContext = void 0;
|
7
|
-
|
8
|
-
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
-
|
10
|
-
var menuContext_1 = /*#__PURE__*/require("../contexts/menuContext");
|
11
|
-
/**
|
12
|
-
* A test utility to mock the useMenuContext hook that relies on context selector
|
13
|
-
* Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
|
14
|
-
* @param options Menu context values to set for testing
|
15
|
-
*/
|
16
|
-
|
17
|
-
|
18
|
-
var mockUseMenuContext = function (options) {
|
19
|
-
if (options === void 0) {
|
20
|
-
options = {};
|
21
|
-
}
|
22
|
-
|
23
|
-
var mockContext = tslib_1.__assign({
|
24
|
-
open: false,
|
25
|
-
setOpen: function () {
|
26
|
-
return null;
|
27
|
-
},
|
28
|
-
triggerRef: {
|
29
|
-
current: null
|
30
|
-
},
|
31
|
-
menuPopoverRef: {
|
32
|
-
current: null
|
33
|
-
},
|
34
|
-
openOnContext: false,
|
35
|
-
openOnHover: false,
|
36
|
-
isSubmenu: false,
|
37
|
-
triggerId: 'id'
|
38
|
-
}, options); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
39
|
-
|
40
|
-
|
41
|
-
menuContext_1.useMenuContext.mockImplementation(function (selector) {
|
42
|
-
return selector(mockContext);
|
43
|
-
});
|
44
|
-
};
|
45
|
-
|
46
|
-
exports.mockUseMenuContext = mockUseMenuContext;
|
47
|
-
//# sourceMappingURL=mockUseMenuContext.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/mockUseMenuContext.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;AAIG;;;AACI,IAAM,kBAAkB,GAAG,UAAC,OAAD,EAAwC;AAAvC,MAAA,OAAA,KAAA,KAAA,CAAA,EAAA;AAAA,IAAA,OAAA,GAAA,EAAA;AAAuC;;AACxE,MAAM,WAAW,GAAA,OAAA,CAAA,QAAA,CAAA;AACf,IAAA,IAAI,EAAE,KADS;AAEf,IAAA,OAAO,EAAE,YAAA;AAAM,aAAA,IAAA;AAAI,KAFJ;AAGf,IAAA,UAAU,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAHE;AAIf,IAAA,cAAc,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAJF;AAKf,IAAA,aAAa,EAAE,KALA;AAMf,IAAA,WAAW,EAAE,KANE;AAOf,IAAA,SAAS,EAAE,KAPI;AAQf,IAAA,SAAS,EAAE;AARI,GAAA,EASZ,OATY,CAAjB,CADwE,CAYxE;;;AACC,EAAA,aAAA,CAAA,cAAA,CAA6B,kBAA7B,CAAgD,UAAC,QAAD,EAA6C;AAC5F,WAAO,QAAQ,CAAC,WAAD,CAAf;AACD,GAFA;AAGF,CAhBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourceRoot":""}
|
@@ -1,112 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
|
3
|
-
import { usePopperMouseTarget, PositioningShorthand } from '@fluentui/react-positioning';
|
4
|
-
import { MenuListCommons } from '../MenuList/index';
|
5
|
-
import { MenuContextValue } from '../../contexts/menuContext';
|
6
|
-
declare type MenuCommons = MenuListCommons & {
|
7
|
-
/**
|
8
|
-
* Whether the popup is open
|
9
|
-
*/
|
10
|
-
open: boolean;
|
11
|
-
/**
|
12
|
-
* Call back when the component requests to change value
|
13
|
-
* The `open` value is used as a hint when directly controlling the component
|
14
|
-
*/
|
15
|
-
onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
|
16
|
-
/**
|
17
|
-
* Whether the popup is open by default
|
18
|
-
*/
|
19
|
-
defaultOpen?: boolean;
|
20
|
-
openOnHover: boolean;
|
21
|
-
/**
|
22
|
-
* Opens the menu on right click (context menu), removes all other menu open interactions
|
23
|
-
*/
|
24
|
-
openOnContext?: boolean;
|
25
|
-
/**
|
26
|
-
* Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
|
27
|
-
* This option is disregarded for submenus
|
28
|
-
*/
|
29
|
-
inline?: boolean;
|
30
|
-
/**
|
31
|
-
* Do not dismiss the menu when a menu item is clicked
|
32
|
-
*/
|
33
|
-
persistOnItemClick?: boolean;
|
34
|
-
/**
|
35
|
-
* Sets the delay for mouse open/close for the popover one mouse enter/leave
|
36
|
-
*/
|
37
|
-
hoverDelay?: number;
|
38
|
-
};
|
39
|
-
export declare type MenuSlots = {};
|
40
|
-
/**
|
41
|
-
* Extends and drills down Menulist props to simplify API
|
42
|
-
*/
|
43
|
-
export declare type MenuProps = Partial<MenuCommons> & ComponentProps<MenuSlots> & {
|
44
|
-
/**
|
45
|
-
* Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.
|
46
|
-
* Alternatively can only contain {@link MenuPopover} if using a custom `target`.
|
47
|
-
*/
|
48
|
-
children: [JSX.Element, JSX.Element] | JSX.Element;
|
49
|
-
/**
|
50
|
-
* Configures the positioned menu
|
51
|
-
*/
|
52
|
-
positioning?: PositioningShorthand;
|
53
|
-
};
|
54
|
-
export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
55
|
-
/**
|
56
|
-
* Callback to open/close the popup
|
57
|
-
*/
|
58
|
-
setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
|
59
|
-
/**
|
60
|
-
* Internal react node that just simplifies handling children
|
61
|
-
*/
|
62
|
-
menuPopover: React.ReactNode;
|
63
|
-
/**
|
64
|
-
* Internal react node that just simplifies handling children
|
65
|
-
*/
|
66
|
-
menuTrigger: React.ReactNode;
|
67
|
-
/**
|
68
|
-
* The ref for the popup
|
69
|
-
*/
|
70
|
-
menuPopoverRef: React.MutableRefObject<HTMLElement>;
|
71
|
-
/**
|
72
|
-
* The ref for the MenuTrigger, used for popup positioning
|
73
|
-
*/
|
74
|
-
triggerRef: React.MutableRefObject<HTMLElement>;
|
75
|
-
/**
|
76
|
-
* Id for the MenuTrigger element for aria relationship
|
77
|
-
*/
|
78
|
-
triggerId: string;
|
79
|
-
/**
|
80
|
-
* Whether this menu is a submenu
|
81
|
-
*/
|
82
|
-
isSubmenu: boolean;
|
83
|
-
/**
|
84
|
-
* Anchors the popper to the mouse click for context events
|
85
|
-
*/
|
86
|
-
contextTarget: ReturnType<typeof usePopperMouseTarget>[0];
|
87
|
-
/**
|
88
|
-
* A callback to set the target of the popper to the mouse click for context events
|
89
|
-
*/
|
90
|
-
setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];
|
91
|
-
};
|
92
|
-
/**
|
93
|
-
* Data attached to open/close events
|
94
|
-
*/
|
95
|
-
export declare type MenuOpenChangeData = Pick<MenuState, 'open'> & {
|
96
|
-
/**
|
97
|
-
* Indicates whether the change of state was a keyboard interaction
|
98
|
-
*/
|
99
|
-
keyboard?: boolean;
|
100
|
-
/**
|
101
|
-
* indicates whether the request for the open state was bubbled from a nested menu
|
102
|
-
*/
|
103
|
-
bubble?: boolean;
|
104
|
-
};
|
105
|
-
export declare type MenuContextValues = {
|
106
|
-
menu: MenuContextValue;
|
107
|
-
};
|
108
|
-
/**
|
109
|
-
* The supported events that will trigger open/close of the menu
|
110
|
-
*/
|
111
|
-
export declare type MenuOpenEvents = MouseEvent | TouchEvent | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.FocusEvent<HTMLElement>;
|
112
|
-
export {};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { MenuProps, MenuState } from './Menu.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Menu.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as useMenuStyles,
|
6
|
-
* before being passed to renderMenu.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of Menu
|
9
|
-
*/
|
10
|
-
export declare const useMenu: (props: MenuProps) => MenuState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuDividerProps } from './MenuDivider.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuDivider, using the `useMenuDivider` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuDivider: ForwardRefComponent<MenuDividerProps>;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
export declare type MenuDividerSlots = {
|
3
|
-
root: IntrinsicShorthandProps<'div'>;
|
4
|
-
};
|
5
|
-
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
6
|
-
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { MenuDividerProps, MenuDividerState } from './MenuDivider.types';
|
3
|
-
/**
|
4
|
-
* Given user props, returns state and render function for a MenuDivider.
|
5
|
-
*/
|
6
|
-
export declare const useMenuDivider: (props: MenuDividerProps, ref: React.Ref<HTMLElement>) => MenuDividerState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuGroupProps } from './MenuGroup.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuGroup, using the `useMenuGroup` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuGroup: ForwardRefComponent<MenuGroupProps>;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
import { MenuGroupContextValue } from '../../contexts/menuGroupContext';
|
3
|
-
export declare type MenuGroupSlots = {
|
4
|
-
root: IntrinsicShorthandProps<'div'>;
|
5
|
-
};
|
6
|
-
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
7
|
-
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
8
|
-
/**
|
9
|
-
* id applied to the DOM element of `MenuGroupHeader`
|
10
|
-
*/
|
11
|
-
headerId: string;
|
12
|
-
};
|
13
|
-
export declare type MenuGroupContextValues = {
|
14
|
-
menuGroup: MenuGroupContextValue;
|
15
|
-
};
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { MenuGroupContextValues, MenuGroupState } from './MenuGroup.types';
|
2
|
-
/**
|
3
|
-
* Redefine the render function to add slots. Reuse the menugroup structure but add
|
4
|
-
* slots to children.
|
5
|
-
*/
|
6
|
-
export declare const renderMenuGroup: (state: MenuGroupState, contextValues: MenuGroupContextValues) => JSX.Element;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { MenuGroupProps, MenuGroupState } from './MenuGroup.types';
|
3
|
-
/**
|
4
|
-
* Given user props, returns state and render function for a MenuGroup.
|
5
|
-
*/
|
6
|
-
export declare function useMenuGroup(props: MenuGroupProps, ref: React.Ref<HTMLElement>): MenuGroupState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuGroupHeaderProps } from './MenuGroupHeader.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuGroupHeader, using the `useMenuGroupHeader` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
export declare type MenuGroupHeaderSlots = {
|
3
|
-
root: IntrinsicShorthandProps<'div'>;
|
4
|
-
};
|
5
|
-
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
6
|
-
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { MenuGroupHeaderState } from './MenuGroupHeader.types';
|
2
|
-
/**
|
3
|
-
* Redefine the render function to add slots. Reuse the menugroupheader structure but add
|
4
|
-
* slots to children.
|
5
|
-
*/
|
6
|
-
export declare const renderMenuGroupHeader: (state: MenuGroupHeaderState) => JSX.Element;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { MenuGroupHeaderProps, MenuGroupHeaderState } from './MenuGroupHeader.types';
|
3
|
-
/**
|
4
|
-
* Given user props, returns state and render function for a MenuGroupHeader.
|
5
|
-
*/
|
6
|
-
export declare function useMenuGroupHeader(props: MenuGroupHeaderProps, ref: React.Ref<HTMLElement>): MenuGroupHeaderState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuItemProps } from './MenuItem.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Define a styled MenuItem, using the `useMenuItem` and `useMenuItemStyles` hook.
|
5
|
-
*/
|
6
|
-
export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
|
@@ -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;
|