@fluentui/react-menu 9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 → 9.75.2-experimental.css-modules-subpath.20261120-0eb82b7e7e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -17
- package/dist/css-modules.d.cts +2 -0
- package/dist/css-modules.d.ts +2 -0
- package/lib/components/MenuDivider/MenuDivider.module.css +6 -0
- package/lib/components/MenuDivider/useMenuDividerStyles.styles.css.js +9 -0
- package/lib/components/MenuDivider/useMenuDividerStyles.styles.css.js.map +1 -0
- package/lib/components/MenuDivider/useMenuDividerStyles.styles.raw.css.js +9 -0
- package/lib/components/MenuDivider/useMenuDividerStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.styles.css.js +8 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.styles.css.js.map +1 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.styles.raw.css.js +8 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuGroupHeader/MenuGroupHeader.module.css +10 -0
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.css.js +9 -0
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.css.js.map +1 -0
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.raw.css.js +9 -0
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItem/MenuItem.module.css +370 -0
- package/lib/components/MenuItem/useMenuItemStyles.styles.css.js +43 -0
- package/lib/components/MenuItem/useMenuItemStyles.styles.css.js.map +1 -0
- package/lib/components/MenuItem/useMenuItemStyles.styles.js +4 -4
- package/lib/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.styles.raw.css.js +43 -0
- package/lib/components/MenuItem/useMenuItemStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItem/useMenuItemStyles.styles.raw.js +4 -4
- package/lib/components/MenuItem/useMenuItemStyles.styles.raw.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.css.js +39 -0
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.css.js.map +1 -0
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.raw.css.js +39 -0
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItemLink/MenuItemLink.module.css +6 -0
- package/lib/components/MenuItemLink/useMenuItemLinkStyles.styles.css.js +35 -0
- package/lib/components/MenuItemLink/useMenuItemLinkStyles.styles.css.js.map +1 -0
- package/lib/components/MenuItemLink/useMenuItemLinkStyles.styles.raw.css.js +35 -0
- package/lib/components/MenuItemLink/useMenuItemLinkStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.css.js +38 -0
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.css.js.map +1 -0
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.raw.css.js +38 -0
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItemSwitch/MenuItemSwitch.module.css +69 -0
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.js +54 -0
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.js.map +1 -0
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +1 -1
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js.map +1 -1
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.css.js +54 -0
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.js +1 -1
- package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.js.map +1 -1
- package/lib/components/MenuList/MenuList.module.css +8 -0
- package/lib/components/MenuList/useMenuListStyles.styles.css.js +11 -0
- package/lib/components/MenuList/useMenuListStyles.styles.css.js.map +1 -0
- package/lib/components/MenuList/useMenuListStyles.styles.raw.css.js +11 -0
- package/lib/components/MenuList/useMenuListStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuPopover/MenuPopover.module.css +17 -0
- package/lib/components/MenuPopover/useMenuPopoverStyles.styles.css.js +11 -0
- package/lib/components/MenuPopover/useMenuPopoverStyles.styles.css.js.map +1 -0
- package/lib/components/MenuPopover/useMenuPopoverStyles.styles.raw.css.js +11 -0
- package/lib/components/MenuPopover/useMenuPopoverStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.module.css +22 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.js +12 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.raw.css.js +12 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuTrigger/useMenuTrigger.js +4 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/css-modules/Menu.js +1 -0
- package/lib/css-modules/Menu.js.map +1 -0
- package/lib/css-modules/MenuDivider.js +1 -0
- package/lib/css-modules/MenuDivider.js.map +1 -0
- package/lib/css-modules/MenuGroup.js +1 -0
- package/lib/css-modules/MenuGroup.js.map +1 -0
- package/lib/css-modules/MenuGroupHeader.js +1 -0
- package/lib/css-modules/MenuGroupHeader.js.map +1 -0
- package/lib/css-modules/MenuItem.js +1 -0
- package/lib/css-modules/MenuItem.js.map +1 -0
- package/lib/css-modules/MenuItemCheckbox.js +1 -0
- package/lib/css-modules/MenuItemCheckbox.js.map +1 -0
- package/lib/css-modules/MenuItemLink.js +1 -0
- package/lib/css-modules/MenuItemLink.js.map +1 -0
- package/lib/css-modules/MenuItemRadio.js +1 -0
- package/lib/css-modules/MenuItemRadio.js.map +1 -0
- package/lib/css-modules/MenuItemSwitch.js +1 -0
- package/lib/css-modules/MenuItemSwitch.js.map +1 -0
- package/lib/css-modules/MenuList.js +1 -0
- package/lib/css-modules/MenuList.js.map +1 -0
- package/lib/css-modules/MenuPopover.js +1 -0
- package/lib/css-modules/MenuPopover.js.map +1 -0
- package/lib/css-modules/MenuSplitGroup.js +1 -0
- package/lib/css-modules/MenuSplitGroup.js.map +1 -0
- package/lib/css-modules/components/Menu/Menu.js +12 -0
- package/lib/css-modules/components/Menu/Menu.js.map +1 -0
- package/lib/css-modules/components/Menu/MenuSurfaceMotion.js +40 -0
- package/lib/css-modules/components/Menu/MenuSurfaceMotion.js.map +1 -0
- package/lib/css-modules/components/Menu/index.js +4 -0
- package/lib/css-modules/components/Menu/index.js.map +1 -0
- package/lib/css-modules/components/Menu/useMenu.js +355 -0
- package/lib/css-modules/components/Menu/useMenu.js.map +1 -0
- package/lib/css-modules/components/MenuDivider/MenuDivider.js +15 -0
- package/lib/css-modules/components/MenuDivider/MenuDivider.js.map +1 -0
- package/lib/css-modules/components/MenuDivider/index.js +4 -0
- package/lib/css-modules/components/MenuDivider/index.js.map +1 -0
- package/lib/css-modules/components/MenuGroup/MenuGroup.js +17 -0
- package/lib/css-modules/components/MenuGroup/MenuGroup.js.map +1 -0
- package/lib/css-modules/components/MenuGroup/index.js +5 -0
- package/lib/css-modules/components/MenuGroup/index.js.map +1 -0
- package/lib/css-modules/components/MenuGroupHeader/MenuGroupHeader.js +15 -0
- package/lib/css-modules/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -0
- package/lib/css-modules/components/MenuGroupHeader/index.js +4 -0
- package/lib/css-modules/components/MenuGroupHeader/index.js.map +1 -0
- package/lib/css-modules/components/MenuItem/MenuItem.js +15 -0
- package/lib/css-modules/components/MenuItem/MenuItem.js.map +1 -0
- package/lib/css-modules/components/MenuItem/index.js +5 -0
- package/lib/css-modules/components/MenuItem/index.js.map +1 -0
- package/lib/css-modules/components/MenuItemCheckbox/MenuItemCheckbox.js +15 -0
- package/lib/css-modules/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -0
- package/lib/css-modules/components/MenuItemCheckbox/index.js +4 -0
- package/lib/css-modules/components/MenuItemCheckbox/index.js.map +1 -0
- package/lib/css-modules/components/MenuItemLink/MenuItemLink.js +15 -0
- package/lib/css-modules/components/MenuItemLink/MenuItemLink.js.map +1 -0
- package/lib/css-modules/components/MenuItemLink/index.js +4 -0
- package/lib/css-modules/components/MenuItemLink/index.js.map +1 -0
- package/lib/css-modules/components/MenuItemRadio/MenuItemRadio.js +15 -0
- package/lib/css-modules/components/MenuItemRadio/MenuItemRadio.js.map +1 -0
- package/lib/css-modules/components/MenuItemRadio/index.js +4 -0
- package/lib/css-modules/components/MenuItemRadio/index.js.map +1 -0
- package/lib/css-modules/components/MenuItemSwitch/MenuItemSwitch.js +13 -0
- package/lib/css-modules/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -0
- package/lib/css-modules/components/MenuItemSwitch/index.js +4 -0
- package/lib/css-modules/components/MenuItemSwitch/index.js.map +1 -0
- package/lib/css-modules/components/MenuItemSwitch/useMenuItemSwitch.js +46 -0
- package/lib/css-modules/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -0
- package/lib/css-modules/components/MenuList/MenuList.js +17 -0
- package/lib/css-modules/components/MenuList/MenuList.js.map +1 -0
- package/lib/css-modules/components/MenuList/index.js +5 -0
- package/lib/css-modules/components/MenuList/index.js.map +1 -0
- package/lib/css-modules/components/MenuPopover/MenuPopover.js +15 -0
- package/lib/css-modules/components/MenuPopover/MenuPopover.js.map +1 -0
- package/lib/css-modules/components/MenuPopover/index.js +4 -0
- package/lib/css-modules/components/MenuPopover/index.js.map +1 -0
- package/lib/css-modules/components/MenuPopover/renderMenuPopover.js +23 -0
- package/lib/css-modules/components/MenuPopover/renderMenuPopover.js.map +1 -0
- package/lib/css-modules/components/MenuSplitGroup/MenuSplitGroup.js +16 -0
- package/lib/css-modules/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib/css-modules/components/MenuSplitGroup/index.js +4 -0
- package/lib/css-modules/components/MenuSplitGroup/index.js.map +1 -0
- package/lib/css-modules/components/MenuSplitGroup/useMenuSplitGroup.js +96 -0
- package/lib/css-modules/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib/css-modules/components/index.js +2 -0
- package/lib/css-modules/components/index.js.map +1 -0
- package/lib/css-modules/index.js +19 -0
- package/lib/css-modules/index.js.map +1 -0
- package/lib/css-modules/selectable/index.js +1 -0
- package/lib/css-modules/selectable/index.js.map +1 -0
- package/lib/selectable/Checkmark.module.css +10 -0
- package/lib/selectable/useCheckmarkStyles.styles.css.js +11 -0
- package/lib/selectable/useCheckmarkStyles.styles.css.js.map +1 -0
- package/lib/selectable/useCheckmarkStyles.styles.raw.css.js +11 -0
- package/lib/selectable/useCheckmarkStyles.styles.raw.css.js.map +1 -0
- package/lib-commonjs/components/MenuDivider/MenuDivider.module.css +6 -0
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.css.cjs +26 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.raw.css.cjs +26 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.module.css +10 -0
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItem/MenuItem.module.css +370 -0
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.cjs +4 -4
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.css.cjs +62 -0
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.raw.cjs +4 -4
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.raw.css.cjs +62 -0
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.css.cjs +57 -0
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.raw.css.cjs +57 -0
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemLink/MenuItemLink.module.css +6 -0
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.css.cjs +52 -0
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.raw.css.cjs +52 -0
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.css.cjs +56 -0
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.raw.css.cjs +56 -0
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.module.css +69 -0
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.cjs +1 -1
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.cjs +74 -0
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.cjs +1 -1
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.css.cjs +74 -0
- package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuList/MenuList.module.css +8 -0
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuPopover/MenuPopover.module.css +17 -0
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.module.css +22 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.cjs +32 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.raw.css.cjs +32 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.cjs +4 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.cjs.map +1 -1
- package/lib-commonjs/css-modules/Menu.cjs +28 -0
- package/lib-commonjs/css-modules/Menu.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuDivider.cjs +28 -0
- package/lib-commonjs/css-modules/MenuDivider.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuGroup.cjs +31 -0
- package/lib-commonjs/css-modules/MenuGroup.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuGroupHeader.cjs +28 -0
- package/lib-commonjs/css-modules/MenuGroupHeader.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuItem.cjs +31 -0
- package/lib-commonjs/css-modules/MenuItem.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuItemCheckbox.cjs +31 -0
- package/lib-commonjs/css-modules/MenuItemCheckbox.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuItemLink.cjs +31 -0
- package/lib-commonjs/css-modules/MenuItemLink.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuItemRadio.cjs +31 -0
- package/lib-commonjs/css-modules/MenuItemRadio.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuItemSwitch.cjs +34 -0
- package/lib-commonjs/css-modules/MenuItemSwitch.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuList.cjs +34 -0
- package/lib-commonjs/css-modules/MenuList.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuPopover.cjs +31 -0
- package/lib-commonjs/css-modules/MenuPopover.cjs.map +1 -0
- package/lib-commonjs/css-modules/MenuSplitGroup.cjs +28 -0
- package/lib-commonjs/css-modules/MenuSplitGroup.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/Menu/Menu.cjs +20 -0
- package/lib-commonjs/css-modules/components/Menu/Menu.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/Menu/MenuSurfaceMotion.cjs +42 -0
- package/lib-commonjs/css-modules/components/Menu/MenuSurfaceMotion.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/Menu/index.cjs +31 -0
- package/lib-commonjs/css-modules/components/Menu/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/Menu/useMenu.cjs +359 -0
- package/lib-commonjs/css-modules/components/Menu/useMenu.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuDivider/MenuDivider.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuDivider/MenuDivider.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuDivider/index.cjs +31 -0
- package/lib-commonjs/css-modules/components/MenuDivider/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuGroup/MenuGroup.cjs +26 -0
- package/lib-commonjs/css-modules/components/MenuGroup/MenuGroup.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuGroup/index.cjs +35 -0
- package/lib-commonjs/css-modules/components/MenuGroup/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuGroupHeader/MenuGroupHeader.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuGroupHeader/MenuGroupHeader.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuGroupHeader/index.cjs +31 -0
- package/lib-commonjs/css-modules/components/MenuGroupHeader/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItem/MenuItem.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuItem/MenuItem.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItem/index.cjs +35 -0
- package/lib-commonjs/css-modules/components/MenuItem/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemCheckbox/MenuItemCheckbox.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuItemCheckbox/MenuItemCheckbox.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemCheckbox/index.cjs +34 -0
- package/lib-commonjs/css-modules/components/MenuItemCheckbox/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemLink/MenuItemLink.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuItemLink/MenuItemLink.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemLink/index.cjs +34 -0
- package/lib-commonjs/css-modules/components/MenuItemLink/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemRadio/MenuItemRadio.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuItemRadio/MenuItemRadio.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemRadio/index.cjs +34 -0
- package/lib-commonjs/css-modules/components/MenuItemRadio/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/MenuItemSwitch.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/MenuItemSwitch.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/index.cjs +37 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/useMenuItemSwitch.cjs +51 -0
- package/lib-commonjs/css-modules/components/MenuItemSwitch/useMenuItemSwitch.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuList/MenuList.cjs +26 -0
- package/lib-commonjs/css-modules/components/MenuList/MenuList.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuList/index.cjs +38 -0
- package/lib-commonjs/css-modules/components/MenuList/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuPopover/MenuPopover.cjs +24 -0
- package/lib-commonjs/css-modules/components/MenuPopover/MenuPopover.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuPopover/index.cjs +34 -0
- package/lib-commonjs/css-modules/components/MenuPopover/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuPopover/renderMenuPopover.cjs +31 -0
- package/lib-commonjs/css-modules/components/MenuPopover/renderMenuPopover.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/MenuSplitGroup.cjs +25 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/MenuSplitGroup.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/index.cjs +31 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/useMenuSplitGroup.cjs +98 -0
- package/lib-commonjs/css-modules/components/MenuSplitGroup/useMenuSplitGroup.cjs.map +1 -0
- package/lib-commonjs/css-modules/components/index.cjs +47 -0
- package/lib-commonjs/css-modules/components/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/index.cjs +286 -0
- package/lib-commonjs/css-modules/index.cjs.map +1 -0
- package/lib-commonjs/css-modules/selectable/index.cjs +11 -0
- package/lib-commonjs/css-modules/selectable/index.cjs.map +1 -0
- package/lib-commonjs/selectable/Checkmark.module.css +10 -0
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.css.cjs +18 -0
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.raw.css.cjs +18 -0
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.raw.css.cjs.map +1 -0
- package/package.json +28 -15
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.switchIndicator {
|
|
2
|
+
border-radius: var(--borderRadiusCircular);
|
|
3
|
+
border: var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);
|
|
4
|
+
line-height: 0;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
fill: currentColor;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
font-size: calc(var(--spacingHorizontalXL) - var(--spacingHorizontalXXS));
|
|
9
|
+
height: var(--spacingHorizontalXL);
|
|
10
|
+
transition-duration: var(--durationNormal);
|
|
11
|
+
transition-timing-function: var(--curveEasyEase);
|
|
12
|
+
transition-property: background, border, color;
|
|
13
|
+
width: calc(2 * var(--spacingHorizontalXL));
|
|
14
|
+
margin-inline-end: var(--spacingHorizontalXS);
|
|
15
|
+
color: var(--colorNeutralStrokeAccessible);
|
|
16
|
+
&:hover {
|
|
17
|
+
color: var(--colorNeutralStrokeAccessibleHover);
|
|
18
|
+
border-color: var(--colorNeutralStrokeAccessibleHover);
|
|
19
|
+
}
|
|
20
|
+
&:hover:active {
|
|
21
|
+
color: var(--colorNeutralStrokeAccessiblePressed);
|
|
22
|
+
border-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
23
|
+
}
|
|
24
|
+
& :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
|
|
25
|
+
transition-duration: var(--durationNormal);
|
|
26
|
+
transition-timing-function: var(--curveEasyEase);
|
|
27
|
+
transition-property: transform;
|
|
28
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
29
|
+
transition-duration: 0.01ms;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
33
|
+
transition-duration: 0.01ms;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
:where(.checked) > .switchIndicator {
|
|
37
|
+
& :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
|
|
38
|
+
transform: translateX(var(--spacingHorizontalXL));
|
|
39
|
+
}
|
|
40
|
+
background-color: var(--colorCompoundBrandBackground);
|
|
41
|
+
color: var(--colorNeutralForegroundInverted);
|
|
42
|
+
border-top-color: var(--colorTransparentStroke);
|
|
43
|
+
border-inline-end-color: var(--colorTransparentStroke);
|
|
44
|
+
border-bottom-color: var(--colorTransparentStroke);
|
|
45
|
+
border-inline-start-color: var(--colorTransparentStroke);
|
|
46
|
+
&:hover {
|
|
47
|
+
color: var(--colorNeutralForegroundInverted);
|
|
48
|
+
background-color: var(--colorCompoundBrandBackgroundHover);
|
|
49
|
+
border-top-color: var(--colorTransparentStrokeInteractive);
|
|
50
|
+
border-inline-end-color: var(--colorTransparentStrokeInteractive);
|
|
51
|
+
border-bottom-color: var(--colorTransparentStrokeInteractive);
|
|
52
|
+
border-inline-start-color: var(--colorTransparentStrokeInteractive);
|
|
53
|
+
}
|
|
54
|
+
&:hover:active {
|
|
55
|
+
color: var(--colorNeutralForegroundInverted);
|
|
56
|
+
background-color: var(--colorCompoundBrandBackgroundPressed);
|
|
57
|
+
border-top-color: var(--colorTransparentStrokeInteractive);
|
|
58
|
+
border-inline-end-color: var(--colorTransparentStrokeInteractive);
|
|
59
|
+
border-bottom-color: var(--colorTransparentStrokeInteractive);
|
|
60
|
+
border-inline-start-color: var(--colorTransparentStrokeInteractive);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
:where(.multiline) > .switchIndicator {
|
|
64
|
+
align-self: center;
|
|
65
|
+
}
|
|
66
|
+
/* `:dir()` follows the nearest `dir` (each FluentProvider sets one), like Griffel's direction from context. */
|
|
67
|
+
:where(.checked):dir(rtl) > .switchIndicator :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
|
|
68
|
+
transform: translateX(calc(-1 * var(--spacingHorizontalXL)));
|
|
69
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useMenuItemStyles_unstable } from "../MenuItem/useMenuItemStyles.styles.css.js";
|
|
4
|
+
import styles from "./MenuItemSwitch.module.css";
|
|
5
|
+
export const menuItemSwitchClassNames = {
|
|
6
|
+
root: 'fui-MenuItemSwitch',
|
|
7
|
+
icon: 'fui-MenuItemSwitch__icon',
|
|
8
|
+
content: 'fui-MenuItemSwitch__content',
|
|
9
|
+
secondaryContent: 'fui-MenuItemSwitch__secondaryContent',
|
|
10
|
+
switchIndicator: 'fui-MenuItemSwitch__switchIndicator',
|
|
11
|
+
subText: 'fui-MenuItemSwitch__subText'
|
|
12
|
+
};
|
|
13
|
+
export const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';
|
|
14
|
+
/**
|
|
15
|
+
* Apply styling to the MenuItemSwitch slots based on the state
|
|
16
|
+
*/ export const useMenuItemSwitchStyles_unstable = (state)=>{
|
|
17
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
18
|
+
state.root.className = clsx(menuItemSwitchClassNames.root, state.checked && styles.checked, state.subText && styles.multiline, state.root.className);
|
|
19
|
+
if (state.content) {
|
|
20
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
21
|
+
state.content.className = clsx(menuItemSwitchClassNames.content, state.content.className);
|
|
22
|
+
}
|
|
23
|
+
if (state.secondaryContent) {
|
|
24
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
25
|
+
state.secondaryContent.className = clsx(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);
|
|
26
|
+
}
|
|
27
|
+
if (state.icon) {
|
|
28
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
29
|
+
state.icon.className = clsx(menuItemSwitchClassNames.icon, state.icon.className);
|
|
30
|
+
}
|
|
31
|
+
if (state.subText) {
|
|
32
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
33
|
+
state.subText.className = clsx(menuItemSwitchClassNames.subText, state.subText.className);
|
|
34
|
+
}
|
|
35
|
+
if (state.switchIndicator) {
|
|
36
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
37
|
+
state.switchIndicator.className = clsx(menuItemSwitchClassNames.switchIndicator, styles.switchIndicator, state.switchIndicator.className);
|
|
38
|
+
}
|
|
39
|
+
useMenuItemStyles_unstable({
|
|
40
|
+
...state,
|
|
41
|
+
components: {
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
43
|
+
...state.components,
|
|
44
|
+
checkmark: 'span',
|
|
45
|
+
submenuIndicator: 'span'
|
|
46
|
+
},
|
|
47
|
+
checkmark: undefined,
|
|
48
|
+
submenuIndicator: undefined,
|
|
49
|
+
hasSubmenu: false,
|
|
50
|
+
submenuOpen: false,
|
|
51
|
+
persistOnClick: true
|
|
52
|
+
});
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { type SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles.css';\nimport styles from './MenuItemSwitch.module.css';\n\nexport const menuItemSwitchClassNames: SlotClassNames<MenuItemSwitchSlots> = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText',\n};\n\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = (state: MenuItemSwitchState): MenuItemSwitchState => {\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(\n menuItemSwitchClassNames.root,\n state.checked && styles.checked,\n state.subText && styles.multiline,\n state.root.className,\n );\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = clsx(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = clsx(\n menuItemSwitchClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = clsx(menuItemSwitchClassNames.subText, state.subText.className);\n }\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = clsx(\n menuItemSwitchClassNames.switchIndicator,\n styles.switchIndicator,\n state.switchIndicator.className,\n );\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span',\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n submenuOpen: false,\n persistOnClick: true,\n });\n return state;\n};\n"],"names":["clsx","useMenuItemStyles_unstable","styles","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","subText","circleFilledClassName","useMenuItemSwitchStyles_unstable","state","className","checked","multiline","components","checkmark","submenuIndicator","undefined","hasSubmenu","submenuOpen","persistOnClick"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAG5B,SAASC,0BAA0B,QAAQ,8CAA2C;AACtF,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;IACjBC,SAAS;AACX,EAAE;AAEF,OAAO,MAAMC,wBAAwB,oDAAoD;AAEzF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,oDAAoD;IACpDA,MAAMR,IAAI,CAACS,SAAS,GAAGb,KACrBG,yBAAyBC,IAAI,EAC7BQ,MAAME,OAAO,IAAIZ,OAAOY,OAAO,EAC/BF,MAAMH,OAAO,IAAIP,OAAOa,SAAS,EACjCH,MAAMR,IAAI,CAACS,SAAS;IAEtB,IAAID,MAAMN,OAAO,EAAE;QACjB,oDAAoD;QACpDM,MAAMN,OAAO,CAACO,SAAS,GAAGb,KAAKG,yBAAyBG,OAAO,EAAEM,MAAMN,OAAO,CAACO,SAAS;IAC1F;IACA,IAAID,MAAML,gBAAgB,EAAE;QAC1B,oDAAoD;QACpDK,MAAML,gBAAgB,CAACM,SAAS,GAAGb,KACjCG,yBAAyBI,gBAAgB,EACzCK,MAAML,gBAAgB,CAACM,SAAS;IAEpC;IACA,IAAID,MAAMP,IAAI,EAAE;QACd,oDAAoD;QACpDO,MAAMP,IAAI,CAACQ,SAAS,GAAGb,KAAKG,yBAAyBE,IAAI,EAAEO,MAAMP,IAAI,CAACQ,SAAS;IACjF;IACA,IAAID,MAAMH,OAAO,EAAE;QACjB,oDAAoD;QACpDG,MAAMH,OAAO,CAACI,SAAS,GAAGb,KAAKG,yBAAyBM,OAAO,EAAEG,MAAMH,OAAO,CAACI,SAAS;IAC1F;IACA,IAAID,MAAMJ,eAAe,EAAE;QACzB,oDAAoD;QACpDI,MAAMJ,eAAe,CAACK,SAAS,GAAGb,KAChCG,yBAAyBK,eAAe,EACxCN,OAAOM,eAAe,EACtBI,MAAMJ,eAAe,CAACK,SAAS;IAEnC;IACAZ,2BAA2B;QACzB,GAAGW,KAAK;QACRI,YAAY;YACV,4DAA4D;YAC5D,GAAGJ,MAAMI,UAAU;YACnBC,WAAW;YACXC,kBAAkB;QACpB;QACAD,WAAWE;QACXD,kBAAkBC;QAClBC,YAAY;QACZC,aAAa;QACbC,gBAAgB;IAClB;IACA,OAAOV;AACT,EAAE"}
|
|
@@ -86,7 +86,7 @@ export const useMenuItemSwitchStyles_unstable = state => {
|
|
|
86
86
|
}
|
|
87
87
|
if (state.switchIndicator) {
|
|
88
88
|
// eslint-disable-next-line react-hooks/immutability
|
|
89
|
-
state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked,
|
|
89
|
+
state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, multiline && multilineStyles.switch, state.switchIndicator.className);
|
|
90
90
|
}
|
|
91
91
|
useMenuItemStyles_unstable({
|
|
92
92
|
...state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","__resetStyles","mergeClasses","shorthands","tokens","useMenuItemStyles_unstable","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","subText","circleFilledClassName","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","r","s","useSwitchIndicatorStyles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","useMultilineStyles","qb2dma","useMenuItemSwitchStyles_unstable","state","multiline","switchIndicatorStyles","switchIndicatorBaseStyles","multilineStyles","className","switch","components","checkmark","submenuIndicator","undefined","hasSubmenu","submenuOpen","persistOnClick"],"sources":["useMenuItemSwitchStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, makeResetStyles, mergeClasses, shorthands } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { useMenuItemStyles_unstable } from \"../MenuItem/useMenuItemStyles.styles.js\";\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n },\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover\n },\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n }\n});\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`\n },\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n },\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n }\n});\nconst useMultilineStyles = makeStyles({\n switch: {\n alignSelf: 'center'\n }\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */ export const useMenuItemSwitchStyles_unstable = (state)=>{\n const { checked, subText } = state;\n const multiline = !!subText;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n const multilineStyles = useMultilineStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = mergeClasses(menuItemSwitchClassNames.subText, state.subText.className);\n }\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked,
|
|
1
|
+
{"version":3,"names":["__styles","__resetStyles","mergeClasses","shorthands","tokens","useMenuItemStyles_unstable","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","subText","circleFilledClassName","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","r","s","useSwitchIndicatorStyles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","useMultilineStyles","qb2dma","useMenuItemSwitchStyles_unstable","state","multiline","switchIndicatorStyles","switchIndicatorBaseStyles","multilineStyles","className","switch","components","checkmark","submenuIndicator","undefined","hasSubmenu","submenuOpen","persistOnClick"],"sources":["useMenuItemSwitchStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, makeResetStyles, mergeClasses, shorthands } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { useMenuItemStyles_unstable } from \"../MenuItem/useMenuItemStyles.styles.js\";\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n },\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover\n },\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n }\n});\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`\n },\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n },\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n }\n});\nconst useMultilineStyles = makeStyles({\n switch: {\n alignSelf: 'center'\n }\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */ export const useMenuItemSwitchStyles_unstable = (state)=>{\n const { checked, subText } = state;\n const multiline = !!subText;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n const multilineStyles = useMultilineStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = mergeClasses(menuItemSwitchClassNames.subText, state.subText.className);\n }\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, multiline && multilineStyles.switch, state.switchIndicator.className);\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span'\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n submenuOpen: false,\n persistOnClick: true\n });\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAAC,aAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,0BAA0B,QAAQ,yCAAyC;AACpF,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,0BAA0B;EAChCC,OAAO,EAAE,6BAA6B;EACtCC,gBAAgB,EAAE,sCAAsC;EACxDC,eAAe,EAAE,qCAAqC;EACtDC,OAAO,EAAE;AACb,CAAC;AACD,OAAO,MAAMC,qBAAqB,GAAG,mDAAmD;AACxF;AACA,MAAMC,yBAAyB,GAAG,CAAC;AACnC,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,SAAS,GAAGF,WAAW,GAAGD,yBAAyB;AACzD,MAAMI,+BAA+B,gBAAGjB,aAAA;EAAAkB,CAAA;EAAAC,CAAA;AAAA,CAkCvC,CAAC;AACF,MAAMC,wBAAwB,gBAAGrB,QAAA;EAAAsB,OAAA;IAAAC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A,IAAIL,KAAK,CAACvC,IAAI,EAAE;IACZ;IACAuC,KAAK,CAACvC,IAAI,CAAC4C,SAAS,GAAGlD,YAAY,CAACI,wBAAwB,CAACE,IAAI,EAAEuC,KAAK,CAACvC,IAAI,CAAC4C,SAAS,CAAC;EAC5F;EACA,IAAIL,KAAK,CAACnC,OAAO,EAAE;IACf;IACAmC,KAAK,CAACnC,OAAO,CAACwC,SAAS,GAAGlD,YAAY,CAACI,wBAAwB,CAACM,OAAO,EAAEmC,KAAK,CAACnC,OAAO,CAACwC,SAAS,CAAC;EACrG;EACA,IAAIL,KAAK,CAACpC,eAAe,EAAE;IACvB;IACAoC,KAAK,CAACpC,eAAe,CAACyC,SAAS,GAAGlD,YAAY,CAACI,wBAAwB,CAACK,eAAe,EAAEuC,yBAAyB,EAAE5B,OAAO,IAAI2B,qBAAqB,CAAC3B,OAAO,EAAE0B,SAAS,IAAIG,eAAe,CAACE,MAAM,EAAEN,KAAK,CAACpC,eAAe,CAACyC,SAAS,CAAC;EACvO;EACA/C,0BAA0B,CAAC;IACvB,GAAG0C,KAAK;IACRO,UAAU,EAAE;MACR;MACA,GAAGP,KAAK,CAACO,UAAU;MACnBC,SAAS,EAAE,MAAM;MACjBC,gBAAgB,EAAE;IACtB,CAAC;IACDD,SAAS,EAAEE,SAAS;IACpBD,gBAAgB,EAAEC,SAAS;IAC3BC,UAAU,EAAE,KAAK;IACjBC,WAAW,EAAE,KAAK;IAClBC,cAAc,EAAE;EACpB,CAAC,CAAC;EACF,OAAOb,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useMenuItemStyles_unstable } from "../MenuItem/useMenuItemStyles.styles.css.js";
|
|
4
|
+
import styles from "./MenuItemSwitch.module.css";
|
|
5
|
+
export const menuItemSwitchClassNames = {
|
|
6
|
+
root: 'fui-MenuItemSwitch',
|
|
7
|
+
icon: 'fui-MenuItemSwitch__icon',
|
|
8
|
+
content: 'fui-MenuItemSwitch__content',
|
|
9
|
+
secondaryContent: 'fui-MenuItemSwitch__secondaryContent',
|
|
10
|
+
switchIndicator: 'fui-MenuItemSwitch__switchIndicator',
|
|
11
|
+
subText: 'fui-MenuItemSwitch__subText'
|
|
12
|
+
};
|
|
13
|
+
export const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';
|
|
14
|
+
/**
|
|
15
|
+
* Apply styling to the MenuItemSwitch slots based on the state
|
|
16
|
+
*/ export const useMenuItemSwitchStyles_unstable = (state)=>{
|
|
17
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
18
|
+
state.root.className = clsx(menuItemSwitchClassNames.root, state.checked && styles.checked, state.subText && styles.multiline, state.root.className);
|
|
19
|
+
if (state.content) {
|
|
20
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
21
|
+
state.content.className = clsx(menuItemSwitchClassNames.content, state.content.className);
|
|
22
|
+
}
|
|
23
|
+
if (state.secondaryContent) {
|
|
24
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
25
|
+
state.secondaryContent.className = clsx(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);
|
|
26
|
+
}
|
|
27
|
+
if (state.icon) {
|
|
28
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
29
|
+
state.icon.className = clsx(menuItemSwitchClassNames.icon, state.icon.className);
|
|
30
|
+
}
|
|
31
|
+
if (state.subText) {
|
|
32
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
33
|
+
state.subText.className = clsx(menuItemSwitchClassNames.subText, state.subText.className);
|
|
34
|
+
}
|
|
35
|
+
if (state.switchIndicator) {
|
|
36
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
37
|
+
state.switchIndicator.className = clsx(menuItemSwitchClassNames.switchIndicator, styles.switchIndicator, state.switchIndicator.className);
|
|
38
|
+
}
|
|
39
|
+
useMenuItemStyles_unstable({
|
|
40
|
+
...state,
|
|
41
|
+
components: {
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
43
|
+
...state.components,
|
|
44
|
+
checkmark: 'span',
|
|
45
|
+
submenuIndicator: 'span'
|
|
46
|
+
},
|
|
47
|
+
checkmark: undefined,
|
|
48
|
+
submenuIndicator: undefined,
|
|
49
|
+
hasSubmenu: false,
|
|
50
|
+
submenuOpen: false,
|
|
51
|
+
persistOnClick: true
|
|
52
|
+
});
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { type SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles.css';\nimport styles from './MenuItemSwitch.module.css';\n\nexport const menuItemSwitchClassNames: SlotClassNames<MenuItemSwitchSlots> = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText',\n};\n\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = (state: MenuItemSwitchState): MenuItemSwitchState => {\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(\n menuItemSwitchClassNames.root,\n state.checked && styles.checked,\n state.subText && styles.multiline,\n state.root.className,\n );\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = clsx(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = clsx(\n menuItemSwitchClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = clsx(menuItemSwitchClassNames.subText, state.subText.className);\n }\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = clsx(\n menuItemSwitchClassNames.switchIndicator,\n styles.switchIndicator,\n state.switchIndicator.className,\n );\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span',\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n submenuOpen: false,\n persistOnClick: true,\n });\n return state;\n};\n"],"names":["clsx","useMenuItemStyles_unstable","styles","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","subText","circleFilledClassName","useMenuItemSwitchStyles_unstable","state","className","checked","multiline","components","checkmark","submenuIndicator","undefined","hasSubmenu","submenuOpen","persistOnClick"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAG5B,SAASC,0BAA0B,QAAQ,8CAA2C;AACtF,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;IACjBC,SAAS;AACX,EAAE;AAEF,OAAO,MAAMC,wBAAwB,oDAAoD;AAEzF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,oDAAoD;IACpDA,MAAMR,IAAI,CAACS,SAAS,GAAGb,KACrBG,yBAAyBC,IAAI,EAC7BQ,MAAME,OAAO,IAAIZ,OAAOY,OAAO,EAC/BF,MAAMH,OAAO,IAAIP,OAAOa,SAAS,EACjCH,MAAMR,IAAI,CAACS,SAAS;IAEtB,IAAID,MAAMN,OAAO,EAAE;QACjB,oDAAoD;QACpDM,MAAMN,OAAO,CAACO,SAAS,GAAGb,KAAKG,yBAAyBG,OAAO,EAAEM,MAAMN,OAAO,CAACO,SAAS;IAC1F;IACA,IAAID,MAAML,gBAAgB,EAAE;QAC1B,oDAAoD;QACpDK,MAAML,gBAAgB,CAACM,SAAS,GAAGb,KACjCG,yBAAyBI,gBAAgB,EACzCK,MAAML,gBAAgB,CAACM,SAAS;IAEpC;IACA,IAAID,MAAMP,IAAI,EAAE;QACd,oDAAoD;QACpDO,MAAMP,IAAI,CAACQ,SAAS,GAAGb,KAAKG,yBAAyBE,IAAI,EAAEO,MAAMP,IAAI,CAACQ,SAAS;IACjF;IACA,IAAID,MAAMH,OAAO,EAAE;QACjB,oDAAoD;QACpDG,MAAMH,OAAO,CAACI,SAAS,GAAGb,KAAKG,yBAAyBM,OAAO,EAAEG,MAAMH,OAAO,CAACI,SAAS;IAC1F;IACA,IAAID,MAAMJ,eAAe,EAAE;QACzB,oDAAoD;QACpDI,MAAMJ,eAAe,CAACK,SAAS,GAAGb,KAChCG,yBAAyBK,eAAe,EACxCN,OAAOM,eAAe,EACtBI,MAAMJ,eAAe,CAACK,SAAS;IAEnC;IACAZ,2BAA2B;QACzB,GAAGW,KAAK;QACRI,YAAY;YACV,4DAA4D;YAC5D,GAAGJ,MAAMI,UAAU;YACnBC,WAAW;YACXC,kBAAkB;QACpB;QACAD,WAAWE;QACXD,kBAAkBC;QAClBC,YAAY;QACZC,aAAa;QACbC,gBAAgB;IAClB;IACA,OAAOV;AACT,EAAE"}
|
|
@@ -104,7 +104,7 @@ const useMultilineStyles = makeStyles({
|
|
|
104
104
|
}
|
|
105
105
|
if (state.switchIndicator) {
|
|
106
106
|
// eslint-disable-next-line react-hooks/immutability
|
|
107
|
-
state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked,
|
|
107
|
+
state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, multiline && multilineStyles.switch, state.switchIndicator.className);
|
|
108
108
|
}
|
|
109
109
|
useMenuItemStyles_unstable({
|
|
110
110
|
...state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { type SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\n\nexport const menuItemSwitchClassNames: SlotClassNames<MenuItemSwitchSlots> = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText',\n};\n\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\n\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n },\n});\n\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`,\n },\n\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n});\n\nconst useMultilineStyles = makeStyles({\n switch: {\n alignSelf: 'center',\n },\n});\n\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = (state: MenuItemSwitchState): MenuItemSwitchState => {\n const { checked, subText } = state;\n const multiline = !!subText;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n const multilineStyles = useMultilineStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = mergeClasses(\n menuItemSwitchClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = mergeClasses(menuItemSwitchClassNames.subText, state.subText.className);\n }\n\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = mergeClasses(\n menuItemSwitchClassNames.switchIndicator,\n switchIndicatorBaseStyles,\n checked && switchIndicatorStyles.checked,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { type SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\n\nexport const menuItemSwitchClassNames: SlotClassNames<MenuItemSwitchSlots> = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator',\n subText: 'fui-MenuItemSwitch__subText',\n};\n\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\n\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n },\n});\n\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`,\n },\n\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n});\n\nconst useMultilineStyles = makeStyles({\n switch: {\n alignSelf: 'center',\n },\n});\n\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = (state: MenuItemSwitchState): MenuItemSwitchState => {\n const { checked, subText } = state;\n const multiline = !!subText;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n const multilineStyles = useMultilineStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n // eslint-disable-next-line react-hooks/immutability\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = mergeClasses(\n menuItemSwitchClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n\n if (state.subText) {\n // eslint-disable-next-line react-hooks/immutability\n state.subText.className = mergeClasses(menuItemSwitchClassNames.subText, state.subText.className);\n }\n\n if (state.switchIndicator) {\n // eslint-disable-next-line react-hooks/immutability\n state.switchIndicator.className = mergeClasses(\n menuItemSwitchClassNames.switchIndicator,\n switchIndicatorBaseStyles,\n checked && switchIndicatorStyles.checked,\n multiline && multilineStyles.switch,\n state.switchIndicator.className,\n );\n }\n\n useMenuItemStyles_unstable({\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span',\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n submenuOpen: false,\n persistOnClick: true,\n });\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","tokens","useMenuItemStyles_unstable","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","subText","circleFilledClassName","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","borderRadius","borderRadiusCircular","border","strokeWidthThin","colorNeutralStrokeAccessible","lineHeight","boxSizing","fill","flexShrink","fontSize","height","transitionDuration","durationNormal","transitionTimingFunction","curveEasyEase","transitionProperty","width","marginRight","spacingHorizontalXS","color","colorNeutralStrokeAccessibleHover","borderColor","colorNeutralStrokeAccessiblePressed","useSwitchIndicatorStyles","checked","transform","backgroundColor","colorCompoundBrandBackground","colorNeutralForegroundInverted","colorTransparentStroke","colorCompoundBrandBackgroundHover","colorTransparentStrokeInteractive","colorCompoundBrandBackgroundPressed","useMultilineStyles","switch","alignSelf","useMenuItemSwitchStyles_unstable","state","multiline","switchIndicatorStyles","switchIndicatorBaseStyles","multilineStyles","className","components","checkmark","submenuIndicator","undefined","hasSubmenu","submenuOpen","persistOnClick"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,eAAe,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACvF,SAASC,MAAM,QAAQ,wBAAwB;AAG/C,SAASC,0BAA0B,QAAQ,0CAAuC;AAElF,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;IACjBC,SAAS;AACX,EAAE;AAEF,OAAO,MAAMC,wBAAwB,oDAAoD;AAEzF,+CAA+C;AAC/C,MAAMC,4BAA4B;AAClC,MAAMC,cAAc;AACpB,MAAMC,aAAa;AACnB,MAAMC,YAAYF,cAAcD;AAEhC,MAAMI,kCAAkCjB,gBAAgB;IACtDkB,cAAcf,OAAOgB,oBAAoB;IACzCC,QAAQ,GAAGjB,OAAOkB,eAAe,CAAC,OAAO,EAAElB,OAAOmB,4BAA4B,EAAE;IAChFC,YAAY;IACZC,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU,GAAGX,UAAU,EAAE,CAAC;IAC1BY,QAAQ,GAAGd,YAAY,EAAE,CAAC;IAC1Be,oBAAoB1B,OAAO2B,cAAc;IACzC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AA4D;YAC5D,GAAGN,MAAMM,UAAU;YACnBC,WAAW;YACXC,kBAAkB;QACpB;QACAD,WAAWE;QACXD,kBAAkBC;QAClBC,YAAY;QACZC,aAAa;QACbC,gBAAgB;IAClB;IAEA,OAAOZ;AACT,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuList.module.css";
|
|
3
|
+
export const menuListClassNames = {
|
|
4
|
+
root: 'fui-MenuList'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the Menu slots based on the state
|
|
8
|
+
*/ export const useMenuListStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(menuListClassNames.root, styles.root, state.hasMenuContext && styles.hasMenuContext, state.root.className);
|
|
10
|
+
return state;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuList/useMenuListStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuListSlots, MenuListState } from './MenuList.types';\nimport styles from './MenuList.module.css';\n\nexport const menuListClassNames: SlotClassNames<MenuListSlots> = {\n root: 'fui-MenuList',\n};\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuListStyles_unstable = (state: MenuListState): MenuListState => {\n state.root.className = clsx(\n menuListClassNames.root,\n styles.root,\n state.hasMenuContext && styles.hasMenuContext,\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","menuListClassNames","root","useMenuListStyles_unstable","state","className","hasMenuContext"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,wBAAwB;AAE3C,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,mBAAmBC,IAAI,EACvBF,OAAOE,IAAI,EACXE,MAAME,cAAc,IAAIN,OAAOM,cAAc,EAC7CF,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuList.module.css";
|
|
3
|
+
export const menuListClassNames = {
|
|
4
|
+
root: 'fui-MenuList'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the Menu slots based on the state
|
|
8
|
+
*/ export const useMenuListStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(menuListClassNames.root, styles.root, state.hasMenuContext && styles.hasMenuContext, state.root.className);
|
|
10
|
+
return state;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuList/useMenuListStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuListSlots, MenuListState } from './MenuList.types';\nimport styles from './MenuList.module.css';\n\nexport const menuListClassNames: SlotClassNames<MenuListSlots> = {\n root: 'fui-MenuList',\n};\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuListStyles_unstable = (state: MenuListState): MenuListState => {\n state.root.className = clsx(\n menuListClassNames.root,\n styles.root,\n state.hasMenuContext && styles.hasMenuContext,\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","menuListClassNames","root","useMenuListStyles_unstable","state","className","hasMenuContext"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,wBAAwB;AAE3C,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,mBAAmBC,IAAI,EACvBF,OAAOE,IAAI,EACXE,MAAME,cAAc,IAAIN,OAAOM,cAAc,EAC7CF,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
border-radius: var(--borderRadiusMedium);
|
|
3
|
+
background-color: var(--colorNeutralBackground1);
|
|
4
|
+
color: var(--colorNeutralForeground1);
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
min-width: calc(4 * var(--spacingHorizontalXXXL) + var(--spacingHorizontalMNudge));
|
|
7
|
+
max-width: calc(9 * var(--spacingHorizontalXXXL) + var(--spacingHorizontalM));
|
|
8
|
+
overflow-x: hidden;
|
|
9
|
+
width: max-content;
|
|
10
|
+
box-shadow: var(--shadow16);
|
|
11
|
+
padding: var(--spacingHorizontalXS);
|
|
12
|
+
border: var(--strokeWidthThin) solid var(--colorTransparentStroke);
|
|
13
|
+
font-family: var(--fontFamilyBase);
|
|
14
|
+
font-size: var(--fontSizeBase300);
|
|
15
|
+
font-weight: var(--fontWeightRegular);
|
|
16
|
+
line-height: var(--lineHeightBase300);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuPopover.module.css";
|
|
3
|
+
export const menuPopoverClassNames = {
|
|
4
|
+
root: 'fui-MenuPopover'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the Menu slots based on the state
|
|
8
|
+
*/ export const useMenuPopoverStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(menuPopoverClassNames.root, styles.root, state.root.className);
|
|
10
|
+
return state;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './MenuPopover.module.css';\n\nexport const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots> = {\n root: 'fui-MenuPopover',\n};\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles_unstable = (state: MenuPopoverState): MenuPopoverState => {\n state.root.className = clsx(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["clsx","styles","menuPopoverClassNames","root","useMenuPopoverStyles_unstable","state","className"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,2BAA2B;AAE9C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KAAKE,sBAAsBC,IAAI,EAAEF,OAAOE,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IACzF,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuPopover.module.css";
|
|
3
|
+
export const menuPopoverClassNames = {
|
|
4
|
+
root: 'fui-MenuPopover'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the Menu slots based on the state
|
|
8
|
+
*/ export const useMenuPopoverStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(menuPopoverClassNames.root, styles.root, state.root.className);
|
|
10
|
+
return state;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuPopover/useMenuPopoverStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './MenuPopover.module.css';\n\nexport const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots> = {\n root: 'fui-MenuPopover',\n};\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles_unstable = (state: MenuPopoverState): MenuPopoverState => {\n state.root.className = clsx(menuPopoverClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["clsx","styles","menuPopoverClassNames","root","useMenuPopoverStyles_unstable","state","className"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,2BAA2B;AAE9C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KAAKE,sBAAsBC,IAAI,EAAEF,OAAOE,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IACzF,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
&[data-multiline] {
|
|
3
|
+
& > :global(.fui-MenuItem):nth-of-type(2) {
|
|
4
|
+
align-self: center;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
display: flex;
|
|
8
|
+
& > :global(.fui-MenuItem):nth-of-type(1) {
|
|
9
|
+
flex: 1;
|
|
10
|
+
}
|
|
11
|
+
& > :global(.fui-MenuItem):nth-of-type(2) {
|
|
12
|
+
border-start-start-radius: 0;
|
|
13
|
+
border-end-start-radius: 0;
|
|
14
|
+
padding-inline-start: 0;
|
|
15
|
+
&::before {
|
|
16
|
+
content: '';
|
|
17
|
+
width: var(--strokeWidthThin);
|
|
18
|
+
height: var(--spacingHorizontalXL);
|
|
19
|
+
background-color: var(--colorNeutralStroke1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuSplitGroup.module.css";
|
|
3
|
+
export const menuSplitGroupMultilineAttr = 'data-multiline';
|
|
4
|
+
export const menuSplitGroupClassNames = {
|
|
5
|
+
root: 'fui-MenuSplitGroup'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Apply styling to the MenuSplitGroup slots based on the state
|
|
9
|
+
*/ export const useMenuSplitGroupStyles_unstable = (state)=>{
|
|
10
|
+
state.root.className = clsx(menuSplitGroupClassNames.root, styles.root, state.root.className);
|
|
11
|
+
return state;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './MenuSplitGroup.module.css';\n\nexport const menuSplitGroupMultilineAttr = 'data-multiline';\n\nexport const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots> = {\n root: 'fui-MenuSplitGroup',\n};\n\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = (state: MenuSplitGroupState): MenuSplitGroupState => {\n state.root.className = clsx(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["clsx","styles","menuSplitGroupMultilineAttr","menuSplitGroupClassNames","root","useMenuSplitGroupStyles_unstable","state","className"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,8BAA8B,iBAAiB;AAE5D,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/CA,MAAMF,IAAI,CAACG,SAAS,GAAGP,KAAKG,yBAAyBC,IAAI,EAAEH,OAAOG,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAC5F,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./MenuSplitGroup.module.css";
|
|
3
|
+
export const menuSplitGroupMultilineAttr = 'data-multiline';
|
|
4
|
+
export const menuSplitGroupClassNames = {
|
|
5
|
+
root: 'fui-MenuSplitGroup'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Apply styling to the MenuSplitGroup slots based on the state
|
|
9
|
+
*/ export const useMenuSplitGroupStyles_unstable = (state)=>{
|
|
10
|
+
state.root.className = clsx(menuSplitGroupClassNames.root, styles.root, state.root.className);
|
|
11
|
+
return state;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './MenuSplitGroup.module.css';\n\nexport const menuSplitGroupMultilineAttr = 'data-multiline';\n\nexport const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots> = {\n root: 'fui-MenuSplitGroup',\n};\n\n/**\n * Apply styling to the MenuSplitGroup slots based on the state\n */\nexport const useMenuSplitGroupStyles_unstable = (state: MenuSplitGroupState): MenuSplitGroupState => {\n state.root.className = clsx(menuSplitGroupClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["clsx","styles","menuSplitGroupMultilineAttr","menuSplitGroupClassNames","root","useMenuSplitGroupStyles_unstable","state","className"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,8BAA8B,iBAAiB;AAE5D,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/CA,MAAMF,IAAI,CAACG,SAAS,GAAGP,KAAKG,yBAAyBC,IAAI,EAAEH,OAAOG,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAC5F,OAAOD;AACT,EAAE"}
|
|
@@ -117,6 +117,10 @@ function noop() {
|
|
|
117
117
|
type: 'menuTriggerKeyDown',
|
|
118
118
|
event
|
|
119
119
|
});
|
|
120
|
+
if (!isSubmenu) {
|
|
121
|
+
// The opening key must not scroll the newly focused menu item.
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
}
|
|
120
124
|
}
|
|
121
125
|
if (key === Escape && !isSubmenu) {
|
|
122
126
|
setOpen(event, {
|
|
@@ -203,7 +207,6 @@ function noop() {
|
|
|
203
207
|
...contextMenuProps,
|
|
204
208
|
// eslint-disable-next-line react-hooks/refs
|
|
205
209
|
onClick: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),
|
|
206
|
-
// eslint-disable-next-line react-hooks/refs
|
|
207
210
|
onKeyDown: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))
|
|
208
211
|
};
|
|
209
212
|
const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"sourcesContent":["'use client';\n\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n isHTMLElement,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { MenuTriggerBaseProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useIsSubmenu, useOnMenuSafeZoneTimeout } from '../../utils';\n\nfunction noop() {\n // does nothing\n}\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu.\n *\n * Composes with `useMenuTriggerBase_unstable` and supplies Tabster's `findFirstFocusable`\n * as the `focusFirst` callback so that submenu-trigger keyboard navigation honours\n * Tabster movers, focus traps, and other Tabster-managed state.\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n\n const { findFirstFocusable } = useFocusFinders();\n\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n return useMenuTriggerBase_unstable({ ...props, focusFirst });\n};\n\n/**\n * Options accepted by `useMenuTriggerBase_unstable`.\n */\n\n/**\n * Base hook for MenuTrigger component, produces state required to render the component.\n *\n * Headless: this hook does not import from `@fluentui/react-tabster` and does not\n * perform any focus discovery on its own. The submenu-already-open arrow-key path\n * delegates to the optional `options.focusFirst` callback, which lets consumers wire\n * up whichever focus-finding strategy fits their environment (Tabster, a native DOM\n * query, a virtual focus manager, etc.). When `focusFirst` is not provided that path\n * becomes a no-op.\n *\n * @public\n */\nexport const useMenuTriggerBase_unstable = (props: MenuTriggerBaseProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false, focusFirst } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n\n const isSubmenu = useIsSubmenu();\n const shouldOpenOnArrowRight = useMenuListContext_unstable(ctx => ctx.shouldOpenOnArrowRight ?? true);\n\n const openedWithKeyboardRef = React.useRef(false);\n const openedViaSafeZoneRef = React.useRef(false);\n const hasMouseMovedRef = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = getTriggerChild(children);\n\n // Heads up!\n //\n // Handles an edge case where mouse movement over the menu trigger didn't happen as safe zone blocked pointer events,\n // but the cursor is already over the menu trigger.\n const safeZoneHandlerRef = useOnMenuSafeZoneTimeout(\n useEventCallback(() => {\n if (isSubmenu) {\n openedViaSafeZoneRef.current = true;\n }\n }),\n );\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n const key = event.key;\n\n if (\n !openOnContext &&\n ((isSubmenu && shouldOpenOnArrowRight && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))\n ) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu && shouldOpenOnArrowRight) {\n focusFirst?.();\n }\n };\n\n const onMouseOver = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (openOnHover) {\n if (hasMouseMovedRef.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n } else if (openedViaSafeZoneRef.current) {\n setOpen(event, { open: true, keyboard: false, ignoreHoverDelay: true, type: 'menuTriggerMouseEnter', event });\n openedViaSafeZoneRef.current = false;\n }\n }\n };\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMovedRef.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMovedRef.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, getReactElementRef(child), safeZoneHandlerRef),\n onMouseEnter: useEventCallback(child?.props.onMouseEnter ?? noop),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n // eslint-disable-next-line react-hooks/refs\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n // eslint-disable-next-line react-hooks/refs\n onMouseOver: useEventCallback(mergeCallbacks(child?.props.onMouseOver, onMouseOver)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...contextMenuProps,\n // eslint-disable-next-line react-hooks/refs\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n // eslint-disable-next-line react-hooks/refs\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (event: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useARIAButtonProps","ArrowRight","ArrowLeft","Escape","ArrowDown","useFluent_unstable","useFluent","useFocusFinders","applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","isHTMLElement","mergeCallbacks","useEventCallback","useMergedRefs","React","useMenuContext_unstable","useMenuListContext_unstable","useIsSubmenu","useOnMenuSafeZoneTimeout","noop","useMenuTrigger_unstable","props","menuPopoverRef","context","findFirstFocusable","focusFirst","useCallback","firstFocusable","current","focus","useMenuTriggerBase_unstable","children","disableButtonEnhancement","triggerRef","setOpen","open","triggerId","openOnHover","openOnContext","isSubmenu","shouldOpenOnArrowRight","ctx","openedWithKeyboardRef","useRef","openedViaSafeZoneRef","hasMouseMovedRef","dir","OpenArrowKey","child","safeZoneHandlerRef","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","onMouseOver","ignoreHoverDelay","onMouseMove","onMouseLeave","contextMenuProps","id","ref","onMouseEnter","triggerChildProps","undefined","ariaButtonTriggerChildProps","isDisabled","el","hasAttribute","getAttribute","target","currentTarget"],"mappings":"AAAA;AAEA,SAASA,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,SAAS,QAAQ,0BAA0B;AACnF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SACEC,2BAA2B,EAC3BC,eAAe,EACfC,kBAAkB,EAClBC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,QACR,4BAA4B;AACnC,YAAYC,WAAW,QAAQ;AAG/B,SAASC,uBAAuB,QAAQ,gCAA6B;AACrE,SAASC,2BAA2B,QAAQ,oCAAiC;AAC7E,SAASC,YAAY,EAAEC,wBAAwB,QAAQ,uBAAc;AAErE,SAASC;AACP,eAAe;AACjB;AAEA;;;;;;;;;CASC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtC,MAAMC,iBAAiBP,wBAAwBQ,CAAAA,UAAWA,QAAQD,cAAc;IAEhF,MAAM,EAAEE,kBAAkB,EAAE,GAAGlB;IAE/B,MAAMmB,aAAaX,MAAMY,WAAW,CAAC;QACnC,MAAMC,iBAAiBH,mBAAmBF,eAAeM,OAAO;QAChED,2BAAAA,qCAAAA,eAAgBE,KAAK;IACvB,GAAG;QAACL;QAAoBF;KAAe;IAEvC,OAAOQ,4BAA4B;QAAE,GAAGT,KAAK;QAAEI;IAAW;AAC5D,EAAE;AAEF;;CAEC,GAED;;;;;;;;;;;CAWC,GACD,OAAO,MAAMK,8BAA8B,CAACT;;IAC1C,MAAM,EAAEU,QAAQ,EAAEC,2BAA2B,KAAK,EAAEP,UAAU,EAAE,GAAGJ;IAEnE,MAAMY,aAAalB,wBAAwBQ,CAAAA,UAAWA,QAAQU,UAAU;IACxE,MAAMC,UAAUnB,wBAAwBQ,CAAAA,UAAWA,QAAQW,OAAO;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MAAOQ,IAAI,MAAK,MAAMR,MAAMQ,IAAI,GAAG,OAC/DY;IAGF,OAAO;QACL7B;QACAR,UAAUxB,4BACRwB,UACAO,gBAAgB0B,mBAAmBhC,2BAA2BoC,oBAAoBE;IAEtF;AACF,EAAE;AAEF,MAAMlB,mBAAmB,CAACD;IACxB,MAAMoB,aAAa,CAACC,KAClBA,GAAGC,YAAY,CAAC,eAAgBD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IAC3G,IAAIhE,cAAcyC,MAAMwB,MAAM,KAAKJ,WAAWpB,MAAMwB,MAAM,GAAG;QAC3D,OAAO;IACT;IAEA,OAAOjE,cAAcyC,MAAMyB,aAAa,KAAKL,WAAWpB,MAAMyB,aAAa;AAC7E"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"sourcesContent":["'use client';\n\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n isHTMLElement,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { MenuTriggerBaseProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useIsSubmenu, useOnMenuSafeZoneTimeout } from '../../utils';\n\nfunction noop() {\n // does nothing\n}\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu.\n *\n * Composes with `useMenuTriggerBase_unstable` and supplies Tabster's `findFirstFocusable`\n * as the `focusFirst` callback so that submenu-trigger keyboard navigation honours\n * Tabster movers, focus traps, and other Tabster-managed state.\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n\n const { findFirstFocusable } = useFocusFinders();\n\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n return useMenuTriggerBase_unstable({ ...props, focusFirst });\n};\n\n/**\n * Options accepted by `useMenuTriggerBase_unstable`.\n */\n\n/**\n * Base hook for MenuTrigger component, produces state required to render the component.\n *\n * Headless: this hook does not import from `@fluentui/react-tabster` and does not\n * perform any focus discovery on its own. The submenu-already-open arrow-key path\n * delegates to the optional `options.focusFirst` callback, which lets consumers wire\n * up whichever focus-finding strategy fits their environment (Tabster, a native DOM\n * query, a virtual focus manager, etc.). When `focusFirst` is not provided that path\n * becomes a no-op.\n *\n * @public\n */\nexport const useMenuTriggerBase_unstable = (props: MenuTriggerBaseProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false, focusFirst } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n\n const isSubmenu = useIsSubmenu();\n const shouldOpenOnArrowRight = useMenuListContext_unstable(ctx => ctx.shouldOpenOnArrowRight ?? true);\n\n const openedWithKeyboardRef = React.useRef(false);\n const openedViaSafeZoneRef = React.useRef(false);\n const hasMouseMovedRef = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = getTriggerChild(children);\n\n // Heads up!\n //\n // Handles an edge case where mouse movement over the menu trigger didn't happen as safe zone blocked pointer events,\n // but the cursor is already over the menu trigger.\n const safeZoneHandlerRef = useOnMenuSafeZoneTimeout(\n useEventCallback(() => {\n if (isSubmenu) {\n openedViaSafeZoneRef.current = true;\n }\n }),\n );\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n const key = event.key;\n\n if (\n !openOnContext &&\n ((isSubmenu && shouldOpenOnArrowRight && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))\n ) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n if (!isSubmenu) {\n // The opening key must not scroll the newly focused menu item.\n event.preventDefault();\n }\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu && shouldOpenOnArrowRight) {\n focusFirst?.();\n }\n };\n\n const onMouseOver = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (openOnHover) {\n if (hasMouseMovedRef.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n } else if (openedViaSafeZoneRef.current) {\n setOpen(event, { open: true, keyboard: false, ignoreHoverDelay: true, type: 'menuTriggerMouseEnter', event });\n openedViaSafeZoneRef.current = false;\n }\n }\n };\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMovedRef.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMovedRef.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, getReactElementRef(child), safeZoneHandlerRef),\n onMouseEnter: useEventCallback(child?.props.onMouseEnter ?? noop),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n // eslint-disable-next-line react-hooks/refs\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n // eslint-disable-next-line react-hooks/refs\n onMouseOver: useEventCallback(mergeCallbacks(child?.props.onMouseOver, onMouseOver)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...contextMenuProps,\n // eslint-disable-next-line react-hooks/refs\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (event: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useARIAButtonProps","ArrowRight","ArrowLeft","Escape","ArrowDown","useFluent_unstable","useFluent","useFocusFinders","applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","isHTMLElement","mergeCallbacks","useEventCallback","useMergedRefs","React","useMenuContext_unstable","useMenuListContext_unstable","useIsSubmenu","useOnMenuSafeZoneTimeout","noop","useMenuTrigger_unstable","props","menuPopoverRef","context","findFirstFocusable","focusFirst","useCallback","firstFocusable","current","focus","useMenuTriggerBase_unstable","children","disableButtonEnhancement","triggerRef","setOpen","open","triggerId","openOnHover","openOnContext","isSubmenu","shouldOpenOnArrowRight","ctx","openedWithKeyboardRef","useRef","openedViaSafeZoneRef","hasMouseMovedRef","dir","OpenArrowKey","child","safeZoneHandlerRef","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","onMouseOver","ignoreHoverDelay","onMouseMove","onMouseLeave","contextMenuProps","id","ref","onMouseEnter","triggerChildProps","undefined","ariaButtonTriggerChildProps","isDisabled","el","hasAttribute","getAttribute","target","currentTarget"],"mappings":"AAAA;AAEA,SAASA,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,SAAS,QAAQ,0BAA0B;AACnF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SA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aAAa,CAACC,KAClBA,GAAGC,YAAY,CAAC,eAAgBD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IAC3G,IAAIhE,cAAcyC,MAAMwB,MAAM,KAAKJ,WAAWpB,MAAMwB,MAAM,GAAG;QAC3D,OAAO;IACT;IAEA,OAAOjE,cAAcyC,MAAMyB,aAAa,KAAKL,WAAWpB,MAAMyB,aAAa;AAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenuBase_unstable, useMenu_unstable } from "./components/Menu/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Menu.ts"],"sourcesContent":["export type {\n MenuBaseProps,\n MenuBaseState,\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './components/Menu/index';\nexport {\n Menu,\n renderMenu_unstable,\n useMenuContextValues_unstable,\n useMenuBase_unstable,\n useMenu_unstable,\n} from './components/Menu/index';\n"],"names":["Menu","renderMenu_unstable","useMenuContextValues_unstable","useMenuBase_unstable","useMenu_unstable"],"mappings":"AAYA,SACEA,IAAI,EACJC,mBAAmB,EACnBC,6BAA6B,EAC7BC,oBAAoB,EACpBC,gBAAgB,QACX,6BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MenuDivider, menuDividerClassNames, renderMenuDivider_unstable, useMenuDividerStyles_unstable, useMenuDivider_unstable } from "./components/MenuDivider/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/MenuDivider.ts"],"sourcesContent":["export type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './components/MenuDivider/index';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './components/MenuDivider/index';\n"],"names":["MenuDivider","menuDividerClassNames","renderMenuDivider_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable"],"mappings":"AACA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,oCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MenuGroup, menuGroupClassNames, renderMenuGroup_unstable, useMenuGroupContextValues_unstable, useMenuGroupStyles_unstable, useMenuGroup_unstable } from "./components/MenuGroup/index.js";
|