@fluentui/react-menu 9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.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.
Files changed (25) hide show
  1. package/CHANGELOG.md +26 -17
  2. package/README.md +2 -2
  3. package/lib/components/MenuDivider/MenuDivider.module.css +5 -7
  4. package/lib/components/MenuGroupHeader/MenuGroupHeader.module.css +9 -11
  5. package/lib/components/MenuItem/MenuItem.module.css +266 -254
  6. package/lib/components/MenuItemLink/MenuItemLink.module.css +5 -7
  7. package/lib/components/MenuItemSwitch/MenuItemSwitch.module.css +59 -60
  8. package/lib/components/MenuList/MenuList.module.css +7 -9
  9. package/lib/components/MenuPopover/MenuPopover.module.css +16 -18
  10. package/lib/components/MenuSplitGroup/MenuSplitGroup.module.css +18 -20
  11. package/lib/components/MenuTrigger/useMenuTrigger.js +4 -1
  12. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  13. package/lib/selectable/Checkmark.module.css +9 -11
  14. package/lib-commonjs/components/MenuDivider/MenuDivider.module.css +5 -7
  15. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.module.css +9 -11
  16. package/lib-commonjs/components/MenuItem/MenuItem.module.css +266 -254
  17. package/lib-commonjs/components/MenuItemLink/MenuItemLink.module.css +5 -7
  18. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.module.css +59 -60
  19. package/lib-commonjs/components/MenuList/MenuList.module.css +7 -9
  20. package/lib-commonjs/components/MenuPopover/MenuPopover.module.css +16 -18
  21. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.module.css +18 -20
  22. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.cjs +4 -1
  23. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.cjs.map +1 -1
  24. package/lib-commonjs/selectable/Checkmark.module.css +9 -11
  25. package/package.json +13 -13
@@ -1,70 +1,69 @@
1
- @layer fluent {
2
- .switchIndicator {
3
- border-radius: var(--borderRadiusCircular);
4
- border: var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);
5
- line-height: 0;
6
- box-sizing: border-box;
7
- fill: currentColor;
8
- flex-shrink: 0;
9
- font-size: calc(var(--spacingHorizontalXL) - var(--spacingHorizontalXXS));
10
- height: var(--spacingHorizontalXL);
1
+ /* @griffel-buckets reset: .switchIndicator */
2
+ .switchIndicator {
3
+ border-radius: var(--borderRadiusCircular);
4
+ border: var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);
5
+ line-height: 0;
6
+ box-sizing: border-box;
7
+ fill: currentColor;
8
+ flex-shrink: 0;
9
+ font-size: calc(var(--spacingHorizontalXL) - var(--spacingHorizontalXXS));
10
+ height: var(--spacingHorizontalXL);
11
+ transition-duration: var(--durationNormal);
12
+ transition-timing-function: var(--curveEasyEase);
13
+ transition-property: background, border, color;
14
+ width: calc(2 * var(--spacingHorizontalXL));
15
+ margin-inline-end: var(--spacingHorizontalXS);
16
+ color: var(--colorNeutralStrokeAccessible);
17
+ &:hover {
18
+ color: var(--colorNeutralStrokeAccessibleHover);
19
+ border-color: var(--colorNeutralStrokeAccessibleHover);
20
+ }
21
+ &:hover:active {
22
+ color: var(--colorNeutralStrokeAccessiblePressed);
23
+ border-color: var(--colorNeutralStrokeAccessiblePressed);
24
+ }
25
+ & :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
11
26
  transition-duration: var(--durationNormal);
12
27
  transition-timing-function: var(--curveEasyEase);
13
- transition-property: background, border, color;
14
- width: calc(2 * var(--spacingHorizontalXL));
15
- margin-inline-end: var(--spacingHorizontalXS);
16
- color: var(--colorNeutralStrokeAccessible);
17
- &:hover {
18
- color: var(--colorNeutralStrokeAccessibleHover);
19
- border-color: var(--colorNeutralStrokeAccessibleHover);
20
- }
21
- &:hover:active {
22
- color: var(--colorNeutralStrokeAccessiblePressed);
23
- border-color: var(--colorNeutralStrokeAccessiblePressed);
24
- }
25
- & :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
26
- transition-duration: var(--durationNormal);
27
- transition-timing-function: var(--curveEasyEase);
28
- transition-property: transform;
29
- @media screen and (prefers-reduced-motion: reduce) {
30
- transition-duration: 0.01ms;
31
- }
32
- }
28
+ transition-property: transform;
33
29
  @media screen and (prefers-reduced-motion: reduce) {
34
30
  transition-duration: 0.01ms;
35
31
  }
36
32
  }
37
- :where(.checked) > .switchIndicator {
38
- & :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
39
- transform: translateX(var(--spacingHorizontalXL));
40
- }
41
- background-color: var(--colorCompoundBrandBackground);
42
- color: var(--colorNeutralForegroundInverted);
43
- border-top-color: var(--colorTransparentStroke);
44
- border-right-color: var(--colorTransparentStroke);
45
- border-bottom-color: var(--colorTransparentStroke);
46
- border-left-color: var(--colorTransparentStroke);
47
- &:hover {
48
- color: var(--colorNeutralForegroundInverted);
49
- background-color: var(--colorCompoundBrandBackgroundHover);
50
- border-top-color: var(--colorTransparentStrokeInteractive);
51
- border-right-color: var(--colorTransparentStrokeInteractive);
52
- border-bottom-color: var(--colorTransparentStrokeInteractive);
53
- border-left-color: var(--colorTransparentStrokeInteractive);
54
- }
55
- &:hover:active {
56
- color: var(--colorNeutralForegroundInverted);
57
- background-color: var(--colorCompoundBrandBackgroundPressed);
58
- border-top-color: var(--colorTransparentStrokeInteractive);
59
- border-right-color: var(--colorTransparentStrokeInteractive);
60
- border-bottom-color: var(--colorTransparentStrokeInteractive);
61
- border-left-color: var(--colorTransparentStrokeInteractive);
62
- }
33
+ @media screen and (prefers-reduced-motion: reduce) {
34
+ transition-duration: 0.01ms;
63
35
  }
64
- :where(.multiline) > .switchIndicator {
65
- align-self: center;
36
+ }
37
+ :where(.checked) > .switchIndicator {
38
+ & :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
39
+ transform: translateX(var(--spacingHorizontalXL));
66
40
  }
67
- :global([dir='rtl']) :where(.checked) > .switchIndicator :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
68
- transform: translateX(calc(-1 * var(--spacingHorizontalXL)));
41
+ background-color: var(--colorCompoundBrandBackground);
42
+ color: var(--colorNeutralForegroundInverted);
43
+ border-top-color: var(--colorTransparentStroke);
44
+ border-inline-end-color: var(--colorTransparentStroke);
45
+ border-bottom-color: var(--colorTransparentStroke);
46
+ border-inline-start-color: var(--colorTransparentStroke);
47
+ &:hover {
48
+ color: var(--colorNeutralForegroundInverted);
49
+ background-color: var(--colorCompoundBrandBackgroundHover);
50
+ border-top-color: var(--colorTransparentStrokeInteractive);
51
+ border-inline-end-color: var(--colorTransparentStrokeInteractive);
52
+ border-bottom-color: var(--colorTransparentStrokeInteractive);
53
+ border-inline-start-color: var(--colorTransparentStrokeInteractive);
69
54
  }
55
+ &:hover:active {
56
+ color: var(--colorNeutralForegroundInverted);
57
+ background-color: var(--colorCompoundBrandBackgroundPressed);
58
+ border-top-color: var(--colorTransparentStrokeInteractive);
59
+ border-inline-end-color: var(--colorTransparentStrokeInteractive);
60
+ border-bottom-color: var(--colorTransparentStrokeInteractive);
61
+ border-inline-start-color: var(--colorTransparentStrokeInteractive);
62
+ }
63
+ }
64
+ :where(.multiline) > .switchIndicator {
65
+ align-self: center;
66
+ }
67
+ :global([dir='rtl']) :where(.checked) > .switchIndicator :global(.fui-MenuItemSwitch__switchIndicator__circleFilled) {
68
+ transform: translateX(calc(-1 * var(--spacingHorizontalXL)));
70
69
  }
@@ -1,10 +1,8 @@
1
- @layer fluent {
2
- .root {
3
- display: flex;
4
- flex-direction: column;
5
- gap: var(--spacingHorizontalXXS);
6
- }
7
- .hasMenuContext {
8
- height: 100%;
9
- }
1
+ .root {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--spacingHorizontalXXS);
5
+ }
6
+ .hasMenuContext {
7
+ height: 100%;
10
8
  }
@@ -1,19 +1,17 @@
1
- @layer fluent {
2
- .root {
3
- border-radius: var(--borderRadiusMedium);
4
- background-color: var(--colorNeutralBackground1);
5
- color: var(--colorNeutralForeground1);
6
- box-sizing: border-box;
7
- min-width: calc(4 * var(--spacingHorizontalXXXL) + var(--spacingHorizontalMNudge));
8
- max-width: calc(9 * var(--spacingHorizontalXXXL) + var(--spacingHorizontalM));
9
- overflow-x: hidden;
10
- width: max-content;
11
- box-shadow: var(--shadow16);
12
- padding: var(--spacingHorizontalXS);
13
- border: var(--strokeWidthThin) solid var(--colorTransparentStroke);
14
- font-family: var(--fontFamilyBase);
15
- font-size: var(--fontSizeBase300);
16
- font-weight: var(--fontWeightRegular);
17
- line-height: var(--lineHeightBase300);
18
- }
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);
19
17
  }
@@ -1,24 +1,22 @@
1
- @layer fluent {
2
- .root {
3
- &[data-multiline] {
4
- & > :global(.fui-MenuItem):nth-of-type(2) {
5
- align-self: center;
6
- }
7
- }
8
- display: flex;
9
- & > :global(.fui-MenuItem):nth-of-type(1) {
10
- flex: 1;
11
- }
1
+ .root {
2
+ &[data-multiline] {
12
3
  & > :global(.fui-MenuItem):nth-of-type(2) {
13
- border-start-start-radius: 0;
14
- border-end-start-radius: 0;
15
- padding-inline-start: 0;
16
- &::before {
17
- content: '';
18
- width: var(--strokeWidthThin);
19
- height: var(--spacingHorizontalXL);
20
- background-color: var(--colorNeutralStroke1);
21
- }
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);
22
20
  }
23
21
  }
24
22
  }
@@ -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,M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E;IAEA,MAAMY,8BAA8BvE,mBAClCiD,CAAAA,kBAAAA,4BAAAA,MAAOQ,IAAI,MAAK,YAAYR,CAAAA,kBAAAA,4BAAAA,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,EA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,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,12 +1,10 @@
1
- @layer fluent {
2
- .checkmark {
3
- width: var(--spacingHorizontalL);
4
- height: var(--spacingHorizontalL);
5
- visibility: hidden;
6
- flex-shrink: 0;
7
- }
8
- .checkmark:where(.checked) {
9
- visibility: visible;
10
- flex-shrink: 0;
11
- }
1
+ .checkmark {
2
+ width: var(--spacingHorizontalL);
3
+ height: var(--spacingHorizontalL);
4
+ visibility: hidden;
5
+ flex-shrink: 0;
6
+ }
7
+ .checkmark:where(.checked) {
8
+ visibility: visible;
9
+ flex-shrink: 0;
12
10
  }
@@ -1,8 +1,6 @@
1
- @layer fluent {
2
- .root {
3
- margin-block: var(--spacingVerticalXS);
4
- margin-inline: calc(0px - var(--spacingHorizontalXS) - var(--strokeWidthThin));
5
- width: auto;
6
- border-bottom: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
7
- }
1
+ .root {
2
+ margin-block: var(--spacingVerticalXS);
3
+ margin-inline: calc(0px - var(--spacingHorizontalXS) - var(--strokeWidthThin));
4
+ width: auto;
5
+ border-bottom: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
8
6
  }
@@ -1,12 +1,10 @@
1
- @layer fluent {
2
- .root {
3
- font-size: var(--fontSizeBase200);
4
- color: var(--colorNeutralForeground3);
5
- padding-inline-start: var(--spacingHorizontalS);
6
- padding-inline-end: var(--spacingHorizontalS);
7
- font-weight: var(--fontWeightSemibold);
8
- height: var(--spacingHorizontalXXXL);
9
- display: flex;
10
- align-items: center;
11
- }
1
+ .root {
2
+ font-size: var(--fontSizeBase200);
3
+ color: var(--colorNeutralForeground3);
4
+ padding-inline-start: var(--spacingHorizontalS);
5
+ padding-inline-end: var(--spacingHorizontalS);
6
+ font-weight: var(--fontWeightSemibold);
7
+ height: var(--spacingHorizontalXXXL);
8
+ display: flex;
9
+ align-items: center;
12
10
  }