@plexui/ui 0.61.1 → 0.62.1

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 (84) hide show
  1. package/dist/es/components/Accordion/Accordion.js +21 -2
  2. package/dist/es/components/Accordion/Accordion.js.map +1 -1
  3. package/dist/es/components/Button/NavigationButton.js +1 -1
  4. package/dist/es/components/Button/NavigationButton.js.map +1 -1
  5. package/dist/es/components/Dialog/Dialog.js +51 -3
  6. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  7. package/dist/es/components/Dialog/sheetDrag.js +45 -12
  8. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  9. package/dist/es/components/Field/Field.js +3 -1
  10. package/dist/es/components/Field/Field.js.map +1 -1
  11. package/dist/es/components/Icon/svg/Array.js +3 -3
  12. package/dist/es/components/Icon/svg/Array.js.map +1 -1
  13. package/dist/es/components/Icon/svg/Boolean.js +3 -3
  14. package/dist/es/components/Icon/svg/Boolean.js.map +1 -1
  15. package/dist/es/components/Icon/svg/Clipboard.js +3 -3
  16. package/dist/es/components/Icon/svg/Clipboard.js.map +1 -1
  17. package/dist/es/components/Icon/svg/Comment.js +3 -3
  18. package/dist/es/components/Icon/svg/Comment.js.map +1 -1
  19. package/dist/es/components/Icon/svg/Error.js +3 -3
  20. package/dist/es/components/Icon/svg/Error.js.map +1 -1
  21. package/dist/es/components/Icon/svg/Function.js +3 -3
  22. package/dist/es/components/Icon/svg/Function.js.map +1 -1
  23. package/dist/es/components/Icon/svg/Number.js +3 -3
  24. package/dist/es/components/Icon/svg/Number.js.map +1 -1
  25. package/dist/es/components/Icon/svg/Object.js +3 -3
  26. package/dist/es/components/Icon/svg/Object.js.map +1 -1
  27. package/dist/es/components/Icon/svg/Report.js +3 -3
  28. package/dist/es/components/Icon/svg/Report.js.map +1 -1
  29. package/dist/es/components/Icon/svg/Storage.js +3 -3
  30. package/dist/es/components/Icon/svg/Storage.js.map +1 -1
  31. package/dist/es/components/Icon/svg/String.js +3 -3
  32. package/dist/es/components/Icon/svg/String.js.map +1 -1
  33. package/dist/es/components/Icon/svg/Text.js +3 -3
  34. package/dist/es/components/Icon/svg/Text.js.map +1 -1
  35. package/dist/es/components/Menu/Menu.js +22 -1
  36. package/dist/es/components/Menu/Menu.js.map +1 -1
  37. package/dist/es/components/PlexUIProvider/PlexUIProvider.js +40 -6
  38. package/dist/es/components/PlexUIProvider/PlexUIProvider.js.map +1 -1
  39. package/dist/es/components/PlexUIProvider/androidRipple.js +98 -0
  40. package/dist/es/components/PlexUIProvider/androidRipple.js.map +1 -0
  41. package/dist/es/components/PlexUIProvider/index.js.map +1 -1
  42. package/dist/es/components/Select/Select.js +217 -39
  43. package/dist/es/components/Select/Select.js.map +1 -1
  44. package/dist/es/components/Sidebar/Sidebar.js +6 -3
  45. package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
  46. package/dist/es/components/Sidebar/index.js +1 -1
  47. package/dist/es/components/Sidebar/index.js.map +1 -1
  48. package/dist/es/components/Toolbar/Toolbar.js +230 -5
  49. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  50. package/dist/es/components/Toolbar/index.js.map +1 -1
  51. package/dist/es/lib/accordionMotion.js +144 -0
  52. package/dist/es/lib/accordionMotion.js.map +1 -0
  53. package/dist/es/lib/fieldRow.js +73 -1
  54. package/dist/es/lib/fieldRow.js.map +1 -1
  55. package/dist/es/lib/presentMotion.js +151 -0
  56. package/dist/es/lib/presentMotion.js.map +1 -0
  57. package/dist/es/styles/android.css +1 -0
  58. package/dist/types/components/Accordion/Accordion.d.ts +1 -1
  59. package/dist/types/components/Button/NavigationButton.d.ts +8 -1
  60. package/dist/types/components/Field/Field.d.ts +3 -0
  61. package/dist/types/components/Icon/svg/Array.d.ts +2 -2
  62. package/dist/types/components/Icon/svg/Boolean.d.ts +2 -2
  63. package/dist/types/components/Icon/svg/Clipboard.d.ts +2 -2
  64. package/dist/types/components/Icon/svg/Comment.d.ts +2 -2
  65. package/dist/types/components/Icon/svg/Error.d.ts +2 -2
  66. package/dist/types/components/Icon/svg/Function.d.ts +2 -2
  67. package/dist/types/components/Icon/svg/Number.d.ts +2 -2
  68. package/dist/types/components/Icon/svg/Object.d.ts +2 -2
  69. package/dist/types/components/Icon/svg/Report.d.ts +2 -2
  70. package/dist/types/components/Icon/svg/Storage.d.ts +2 -2
  71. package/dist/types/components/Icon/svg/String.d.ts +2 -2
  72. package/dist/types/components/Icon/svg/Text.d.ts +2 -2
  73. package/dist/types/components/PlexUIProvider/PlexUIProvider.d.ts +10 -3
  74. package/dist/types/components/PlexUIProvider/androidRipple.d.ts +9 -0
  75. package/dist/types/components/PlexUIProvider/index.d.ts +1 -1
  76. package/dist/types/components/Select/Select.d.ts +24 -0
  77. package/dist/types/components/Sidebar/Sidebar.d.ts +8 -0
  78. package/dist/types/components/Sidebar/index.d.ts +2 -2
  79. package/dist/types/components/Toolbar/Toolbar.d.ts +16 -1
  80. package/dist/types/components/Toolbar/index.d.ts +1 -1
  81. package/dist/types/lib/accordionMotion.d.ts +20 -0
  82. package/dist/types/lib/fieldRow.d.ts +14 -0
  83. package/dist/types/lib/presentMotion.d.ts +46 -0
  84. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,EAGZ,aAAa,EAGb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AAEd,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,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,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;AAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;AAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA","sourcesContent":["\"use client\"\n\nimport { DropdownMenu, Slot } from \"radix-ui\"\nimport React, {\n type ComponentProps,\n type ComponentType,\n createContext,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport clsx from \"clsx\"\nimport { useFloatingBoundary } from \"../../hooks/useFloatingBoundary\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { usePhoneSubmenu } from \"../../hooks/usePhoneSubmenu\"\nimport { focusPhoneSubmenuEntry } from \"../../lib/menuSubmenuPlacement\"\nimport { captureInitialPhoneSubmenuFocus, completeInitialPhoneSubmenuFocus, delegateInitialPhoneSubmenuFocus } from \"../../lib/menuInitialFocus\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { ignoreReleaseOverTrigger, markCoveredMenuTrigger, observeMenuTriggerCover, type MenuTriggerCover } from \"../../lib/menuTriggerCover\"\nimport { Button } from \"../Button\"\nimport { Check, ChevronDown, ChevronRight } from \"../Icon\"\nimport { PhoneLayoutContext } from \"../PhoneLayout/PhoneLayout\"\nimport { useLinkComponent } from \"../PlexUIProvider/internal\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingQuick, reducedMotionEnter } from \"../Transition/shared\"\nimport { isHoverPointer } from \"../../lib/inputMode\"\nimport s from \"@plexui/styles/components/Menu/Menu.module.css\"\nimport { HOLD_PRESSES_CLASS, holdEnteringPresses } from \"../../lib/holdEnteringPresses\"\n\n// Presses that start while a dialog or menu comes in are held, as on iOS (lib/holdEnteringPresses)\nholdEnteringPresses()\n\n// Inside a PhoneLayout a menu opens in its box, laid out as on a phone and kept within it; in a Dialog laid out as on a\n// phone outside one it opens over the window, in a phone scope of its own (plan 176)\nconst COLLISION_PADDING = { bottom: 30, top: 30, left: 12, right: 12 }\nexport const useMenuPhoneLayout = (open: boolean) => {\n const floatingBoundary = useFloatingBoundary(open, COLLISION_PADDING)\n const phoneLayout = useContext(PhoneLayoutContext)\n const container = phoneLayout?.container ?? null\n // The footer of a Page or Dialog in the box keeps the menu clear of it; one around the box does not hold it, and the\n // box clips what passes its edges\n const footerInBox = !!container && !!floatingBoundary.collisionBoundary && container.contains(floatingBoundary.collisionBoundary)\n const boundary = container && !footerInBox ? { collisionBoundary: container, collisionPadding: COLLISION_PADDING } : floatingBoundary\n return { container: container ?? undefined, scoped: phoneLayout !== null && !container, boundary }\n}\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\n// A delayed programmatic restore may inherit focus-visible from the menu.\n// Keep the focus, but suppress the Button ring only for this pointer restore.\nconst markPointerFocusRestore = (trigger: HTMLElement) => {\n const doc = trigger.ownerDocument\n let active = true\n let restoring = true\n const clear = () => {\n active = false\n trigger.removeAttribute(\"data-menu-pointer-focus\")\n trigger.removeEventListener(\"blur\", clear)\n trigger.removeEventListener(\"focus\", onFocus)\n doc.removeEventListener(\"keydown\", clear, true)\n }\n const onFocus = () => {\n if (!restoring) clear()\n }\n trigger.setAttribute(\"data-menu-pointer-focus\", \"\")\n trigger.addEventListener(\"blur\", clear)\n trigger.addEventListener(\"focus\", onFocus)\n doc.addEventListener(\"keydown\", clear, true)\n queueMicrotask(() => {\n if (!active) return\n restoring = false\n // Radix can skip its restore after an outside interaction.\n if (doc.activeElement !== trigger) clear()\n })\n return clear\n}\n\ntype MenuContextValue = {\n open: boolean\n setOpen: (next: boolean) => void\n prepareFocusRestore: (trigger: HTMLElement) => void\n isUsingKeyboard: React.RefObject<boolean>\n /** The element of `Menu.Trigger`, which a phone menu covers */\n triggerElement: HTMLElement | null\n setTriggerElement: (element: HTMLElement | null) => void\n /** Whether the menu is modal, which decides whether an outside interaction skips the focus return */\n modal: boolean\n}\n\nconst MenuContext = createContext<MenuContextValue | null>(null)\n\n/** @internal The open state of the enclosing Menu, for ContextMenu. Not exported from the package. */\nexport const useMenuContext = () => {\n const context = useContext(MenuContext)\n\n if (!context) {\n throw new Error(\"Menu components must be wrapped in <Menu />\")\n }\n\n return context\n}\n\nexport type MenuProps = {\n children: React.ReactNode\n /** Force the menu to remain open or closed */\n forceOpen?: boolean\n /** Callback triggered when the modal is opened */\n onOpen?: () => void\n /** Callback triggered when the modal is closed */\n onClose?: () => void\n /**\n * When set to `true`, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean\n}\n\nexport const Menu = ({ children, forceOpen, onOpen, onClose, modal = false }: MenuProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = forceOpen ?? open\n const isUsingKeyboard = useRef(false)\n const [triggerElement, setTriggerElement] = useState<HTMLElement | null>(null)\n const clearPointerFocus = useRef<(() => void) | undefined>(undefined)\n\n useEffect(() => {\n const onKeyDown = () => {\n isUsingKeyboard.current = true\n }\n const onPointer = () => {\n isUsingKeyboard.current = false\n }\n document.addEventListener(\"keydown\", onKeyDown, true)\n document.addEventListener(\"pointerdown\", onPointer, true)\n document.addEventListener(\"pointermove\", onPointer, true)\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown, true)\n document.removeEventListener(\"pointerdown\", onPointer, true)\n document.removeEventListener(\"pointermove\", onPointer, true)\n clearPointerFocus.current?.()\n }\n }, [])\n\n const prepareFocusRestore = useCallback((trigger: HTMLElement) => {\n clearPointerFocus.current?.()\n clearPointerFocus.current = undefined\n if (!isUsingKeyboard.current && trigger.isConnected) {\n clearPointerFocus.current = markPointerFocusRestore(trigger)\n }\n }, [])\n\n const latestOnOpen = useLatestValue(onOpen)\n const latestOnClose = useLatestValue(onClose)\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n setOpen(nextState)\n if (nextState) {\n latestOnOpen.current?.()\n } else {\n latestOnClose.current?.()\n }\n },\n [latestOnOpen, latestOnClose],\n )\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n const store = useMemo<MenuContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n prepareFocusRestore,\n isUsingKeyboard,\n triggerElement,\n setTriggerElement,\n modal,\n }),\n [isOpen, handleOpenChange, prepareFocusRestore, triggerElement, modal],\n )\n\n return (\n <MenuContext.Provider value={store}>\n <DropdownMenu.Root open={isOpen} onOpenChange={handleOpenChange} modal={modal}>\n {children}\n </DropdownMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuItemProps = {\n className?: string\n children: React.ReactNode\n /**\n * Second line under the item's label: what this action does, or which\n * value it carries. The label goes semibold on its own, the same way a\n * Select option with a description does — same pattern, same anatomy.\n */\n description?: ReactNode\n /** Callback triggered when the item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Callback triggered when the item is clicked */\n onClick?: DropdownMenu.DropdownMenuItemProps[\"onClick\"]\n /** Disables the menu item */\n disabled?: boolean\n /** Marks a destructive action (delete, remove, leave): the item is drawn in the danger color */\n danger?: boolean\n}\n\n// An icon is a component, an svg or an img; text and text elements (strong, kbd) belong to the label.\nconst isLeadingIcon = (part: ReactNode) =>\n React.isValidElement(part) && (typeof part.type !== \"string\" || part.type === \"svg\" || part.type === \"img\")\n\n/**\n * A described row: the label over its description. Icons that lead the label stay beside the two lines, centred on\n * both, as iOS draws Sort By with its order under it (Reminders); a row of icons alone stacks whole.\n */\n// A row's own children, fragments opened up as Vue's slots are, keyed again by place\nconst flattenRow = (children: ReactNode): ReactNode[] =>\n React.Children.toArray(children).flatMap((part) =>\n React.isValidElement<{ children?: ReactNode }>(part) && part.type === React.Fragment ? flattenRow(part.props.children) : [part])\n\nconst describedRow = (children: ReactNode, description: ReactNode) => {\n const parts = flattenRow(children).map((part, index) => (React.isValidElement(part) ? React.cloneElement(part, { key: index }) : part))\n const label = parts.findIndex((part) => !isLeadingIcon(part))\n const lead = label > 0 ? parts.slice(0, label) : []\n return (\n <>\n {lead}\n <div className={s.ItemLeading}>\n <div>{lead.length > 0 ? parts.slice(label) : children}</div>\n {/* Not part of the label a phone submenu heads itself with */}\n <div className={s.ItemDescription} data-menu-description=\"\">{description}</div>\n </div>\n </>\n )\n}\n\nconst Item = ({ className, children, description, disabled, danger, onSelect, onClick }: MenuItemProps) => {\n const { open } = useMenuContext()\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we're always known to be closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n // A described item stacks its two lines; without a description the item\n // keeps the plain flex row that icons and ItemActions rely on.\n const content = rendersContent(description) ? describedRow(children, description) : children\n\n // Custom click handlers: either callback makes the item interactive\n if (onSelect || onClick) {\n return (\n <DropdownMenu.Item\n className={clsx(s.MenuItem, className)}\n onSelect={onSelect}\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n data-danger={danger ? \"\" : undefined}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <div className={s.PressableInner}>{content}</div>\n </DropdownMenu.Item>\n )\n }\n\n // Read-only content - will not appear interactive.\n return <div className={clsx(s.MenuItemContent, className)}>{content}</div>\n}\n\nconst ItemActions = ({ className, children }: { className?: string; children: ReactNode }) => {\n return <div className={clsx(s.ItemActions, className)}>{children}</div>\n}\n\nconst ItemAction = ({\n children,\n onClick,\n \"aria-label\": ariaLabel,\n}: {\n children: ReactNode\n onClick: (evt: MouseEvent) => void\n /** Accessible name; the action is an icon-only button */\n \"aria-label\"?: string\n}) => {\n const { setOpen } = useMenuContext()\n\n return (\n <Button\n className=\"rounded-sm\"\n color=\"secondary\"\n size=\"xs\"\n uniform\n iconSize=\"sm\"\n variant=\"ghost\"\n aria-label={ariaLabel}\n onClick={(evt) => {\n evt.stopPropagation()\n setOpen(false)\n onClick(evt)\n }}\n >\n {children}\n </Button>\n )\n}\n\ntype MenuLinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\" | \"children\"> & {\n /** Content rendered inside the Link */\n children: React.ReactNode\n /** Disables the menu item */\n disabled?: boolean\n /** Marks a destructive destination: the item is drawn in the danger color */\n danger?: boolean\n}\n\ntype MenuLink = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends ComponentType<any> | \"a\" = PlexUI.LinkComponent,\n>(\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n MenuLinkProps & {\n /**\n * Override the default component used for the link. This is useful for\n * using a routing library, or SSR rendering.\n * purposes.\n *\n * @default 'a'\n */\n as?: T\n } & ComponentProps<T>,\n) => ReactNode\n\nconst Link = ((\n props: MenuLinkProps & { href?: string; to?: string; as?: PlexUI.LinkComponent },\n) => {\n const { className, children, href, to, disabled, danger, as: OverrideComponent, ...restProps } = props\n const { open } = useMenuContext()\n\n const propPath = href || to\n // When a path is not provided, default to an anchor\n const isExternal = propPath ? /^https?:\\/\\//.test(propPath) : true\n const DefaultComponent = useLinkComponent()\n const Component = OverrideComponent || (isExternal ? \"a\" : DefaultComponent)\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we're always known to be closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n const linkProps = isExternal\n ? { target: \"_blank\", rel: \"noopener noreferrer\", href: href ?? to }\n : { href, to }\n\n return (\n <DropdownMenu.Item\n asChild\n className={clsx(s.MenuItem, className)}\n disabled={disabled}\n data-danger={danger ? \"\" : undefined}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <Component\n {...linkProps}\n {...restProps}\n onClick={(event: React.MouseEvent<HTMLAnchorElement>) => {\n restProps.onClick?.(event)\n // Radix skips selecting a disabled item, not the link's navigation\n if (disabled) event.preventDefault()\n }}\n >\n <span className={s.PressableInner}>{children}</span>\n </Component>\n </DropdownMenu.Item>\n )\n}) as MenuLink\n\nconst Separator = ({ className }: { className?: string }) => {\n return <DropdownMenu.Separator className={clsx(s.Separator, className)} role=\"separator\" />\n}\n\n\nconst Label = ({ className, children }: { className?: string; children: ReactNode }) => {\n return (\n <DropdownMenu.Label className={clsx(s.MenuLabel, className)}>\n {children}\n </DropdownMenu.Label>\n )\n}\n\nconst Group = ({\n className,\n children,\n}: {\n className?: string\n children: ReactNode\n}) => {\n return <DropdownMenu.Group className={className}>{children}</DropdownMenu.Group>\n}\n\nexport type MenuContentProps = {\n children: React.ReactNode\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. Without it\n * a menu on a phone opens toward the larger part of the screen: upward from a trigger in the lower half.\n * @default bottom\n */\n side?: DropdownMenu.DropdownMenuContentProps[\"side\"]\n /**\n * The distance in pixels from the trigger. Without it a menu on a phone covers its trigger, as iOS menus grow out\n * of the control that opens them.\n * @default 5\n */\n sideOffset?: DropdownMenu.DropdownMenuContentProps[\"sideOffset\"]\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default center\n */\n align?: DropdownMenu.DropdownMenuContentProps[\"align\"]\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options. Without it a menu on a phone that covers its\n * trigger keeps the trigger's edge.\n * @default -5 with \"start\" or \"end\", 0 with \"center\"\n */\n alignOffset?: DropdownMenu.DropdownMenuContentProps[\"alignOffset\"]\n /**\n * Defines the `width` property of the content. Without it the menu fits its content, or with `touch.css` on a phone\n * is the 250px panel of an iOS menu; `\"auto\"` fits its content there too.\n */\n width?: number | \"auto\"\n /**\n * Defines the `min-width` property of the content, in pixels.\n * @default 300\n */\n minWidth?: number | \"auto\"\n /**\n * Defines the `max-width` property of the content, in pixels.\n */\n maxHeight?: number\n /**\n * Rounder list with fully rounded rows, for menus that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n /**\n * Layout direction of menu items.\n * Use `\"horizontal\"` for icon-based toolbars (iOS-style).\n * @default \"vertical\"\n */\n layout?: \"vertical\" | \"horizontal\"\n /**\n * Size of horizontal menu items. Controls icon size and padding.\n * Only applies when `layout=\"horizontal\"`.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\"\n /**\n * Event handler called when auto-focus tries to return to the trigger\n * after the menu closes. Call `event.preventDefault()` to prevent the\n * trigger from regaining focus (and its focus-visible ring).\n */\n onCloseAutoFocus?: DropdownMenu.DropdownMenuContentProps[\"onCloseAutoFocus\"]\n /**\n * Event handler called when focus moves into the menu as it opens. Call\n * `event.preventDefault()` to leave focus where it is, as for a menu that\n * stands open when its screen appears.\n */\n onOpenAutoFocus?: (event: Event) => void\n}\n\n/**\n * Radix forwards `onOpenAutoFocus` from DropdownMenu.Content to its internal\n * MenuContentImpl at runtime, but the public DropdownMenu types omit that\n * private prop. Phone submenu initial focus needs it to replace the\n * content-level mount focus, so the extra prop is declared here explicitly.\n */\nconst RootMenuContent = DropdownMenu.Content as React.ForwardRefExoticComponent<\n DropdownMenu.DropdownMenuContentProps & {\n onOpenAutoFocus?: (event: Event) => void\n } & React.RefAttributes<HTMLDivElement>\n>\n\nconst Content = ({\n children,\n side,\n sideOffset,\n align,\n alignOffset,\n width,\n minWidth,\n maxHeight,\n pill = false,\n layout = \"vertical\",\n size,\n onCloseAutoFocus,\n onOpenAutoFocus,\n}: MenuContentProps) => {\n const { open, prepareFocusRestore, triggerElement, modal } = useMenuContext()\n const contentRef = useRef<HTMLDivElement>(null)\n // The panel's node as state too: it mounts after the trigger's cover is known, and again when the phone layout moves\n // the portal, so the effect that hides the covered trigger reruns with the node that is on screen\n const [contentElement, setContentElement] = useState<HTMLDivElement | null>(null)\n const setContent = useCallback((node: HTMLDivElement | null) => {\n contentRef.current = node\n setContentElement(node)\n }, [])\n const interactedOutside = useRef(false)\n const phoneLayout = useMenuPhoneLayout(open)\n const floatingBoundary = phoneLayout.boundary\n // On a phone a menu without its own offset grows out of its trigger, covers it and opens toward the larger part of\n // the screen (menuTriggerCover.ts); one that opens to a side keeps its gap\n const coversTrigger = open && sideOffset === undefined && side !== \"left\" && side !== \"right\"\n const [triggerCover, setTriggerCover] = useState<MenuTriggerCover | null>(null)\n useLayoutEffect(() => {\n if (!coversTrigger || !triggerElement) return\n return observeMenuTriggerCover(triggerElement, setTriggerCover)\n }, [coversTrigger, triggerElement])\n const cover = coversTrigger ? triggerCover : null\n // A trigger the panel covers whole is hidden while it is open, as iOS turns a bar button into its menu\n useLayoutEffect(() => {\n if (!cover || !triggerElement || !contentElement) return\n return markCoveredMenuTrigger(triggerElement, contentElement)\n }, [cover, triggerElement, contentElement])\n const [exitGuard] = useState(createExitGuard)\n const isHorizontal = layout === \"horizontal\"\n // The content of a closing menu is frozen for its exit, so this reads the owner's latest handler.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n const skipFocus = interactedOutside.current\n interactedOutside.current = false\n if (event.defaultPrevented) return\n // A focus scope that unmounts while the menu stays open (React StrictMode replays the effects of a menu that mounts\n // open) is no close: focus stays, and the menu is not dismissed by focus moving out to its trigger\n if (open) {\n event.preventDefault()\n return\n }\n const content = event.target\n if (!(content instanceof HTMLElement)) return\n const trigger = content.ownerDocument.getElementById(content.getAttribute(\"aria-labelledby\") ?? \"\")\n if (!trigger) return\n prepareFocusRestore(trigger)\n // Focus returns to the trigger as Radix returns it, but without scrolling: a plain focus() scrolls every scrolling\n // ancestor to the trigger, the page around a frame that holds the menu too\n event.preventDefault()\n if (!skipFocus) trigger.focus({ preventScroll: true })\n })\n // Radix's own record of an outside interaction, which its focus return (replaced above) reads: any one when the menu\n // is not modal, a right click when it is\n const handleInteractOutside = (event: Parameters<NonNullable<DropdownMenu.DropdownMenuContentProps[\"onInteractOutside\"]>>[0]) => {\n exitGuard.onInteractOutside(event)\n // A cancelled one leaves the menu open and Radix does not record it (Vue returns early the same way)\n if (event.defaultPrevented) return\n const original = event.detail.originalEvent as PointerEvent\n const isRightClick = original.button === 2 || (original.button === 0 && original.ctrlKey === true)\n if (!modal || isRightClick) interactedOutside.current = true\n }\n\n return (\n <DropdownMenu.Portal forceMount container={phoneLayout.container}>\n <PhoneScope enabled={phoneLayout.scoped}>\n <TransitionGroup\n className={clsx(s.Menu, HOLD_PRESSES_CLASS)}\n {...overlayTiming}\n reducedMotionEnterDuration={reducedMotionEnter.menu}\n {...exitGuard.transition}\n overlay\n >\n {open && (\n <RootMenuContent\n key=\"dropdown\"\n ref={setContent}\n onOpenAutoFocus={(event) => {\n onOpenAutoFocus?.(event)\n delegateInitialPhoneSubmenuFocus(event, contentRef.current)\n }}\n forceMount\n className={s.MenuList}\n data-pill={pill ? \"\" : undefined}\n side={side ?? cover?.side}\n sideOffset={cover ? cover.sideOffset : sideOffset ?? 5}\n align={align}\n alignOffset={alignOffset ?? (cover || align === \"center\" ? 0 : -5)}\n avoidCollisions\n {...floatingBoundary}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n data-layout={isHorizontal ? \"horizontal\" : undefined}\n data-size={isHorizontal && size ? size : undefined}\n style={toCssVariables({\n \"menu-width\": width,\n \"menu-min-width\": isHorizontal ? \"auto\" : minWidth,\n \"menu-max-height\": maxHeight,\n })}\n >\n {/* The items of a vertical menu lie in the panel itself; a phone menu scrolls them and fades them at its edges */}\n {isHorizontal ? children : <div className={s.Items}>{children}</div>}\n </RootMenuContent>\n )}\n </TransitionGroup>\n </PhoneScope>\n </DropdownMenu.Portal>\n )\n}\n\ntype TriggerActivation = Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, \"onPointerDown\" | \"onPointerCancel\" | \"onClick\" | \"onKeyDown\">\n\n// Keep Radix's public trigger registration, attributes and ref while owning\n// activation. Its pointerdown-only behavior cannot commit touch/AT clicks.\nconst TriggerElement = ({ activation, ...props }: ComponentProps<typeof Slot.Root> & { activation: TriggerActivation }) => {\n delete props.onPointerDown\n delete props.onPointerCancel\n delete props.onClick\n delete props.onKeyDown\n return <Slot.Root {...props} {...activation} />\n}\n\nconst Trigger = ({\n children,\n disabled,\n onPointerDown,\n onPointerCancel,\n onClick,\n onKeyDown,\n ...restProps\n}: DropdownMenu.DropdownMenuTriggerProps & { ref?: React.Ref<HTMLButtonElement> }) => {\n const { open, setOpen, setTriggerElement } = useMenuContext()\n const handledClick = useRef(false)\n const activation: TriggerActivation = {\n onPointerDown: (event) => {\n handledClick.current = false\n onPointerDown?.(event)\n if (event.defaultPrevented) {\n handledClick.current = true\n return\n }\n if (disabled || event.button !== 0 || event.ctrlKey) return\n if (event.pointerType === \"pen\" || !isHoverPointer(event)) return\n handledClick.current = true\n setOpen(!open)\n if (open) return\n event.preventDefault()\n ignoreReleaseOverTrigger(event.currentTarget as HTMLElement, event.pointerId)\n },\n onPointerCancel: (event) => {\n handledClick.current = false\n onPointerCancel?.(event)\n },\n onClick: (event) => {\n const handled = handledClick.current\n handledClick.current = false\n onClick?.(event)\n if (event.defaultPrevented || disabled || event.button !== 0 || event.ctrlKey) return\n if (handled && event.detail !== 0) return\n setOpen(!open)\n },\n onKeyDown: (event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented || disabled || event.nativeEvent.isComposing || event.keyCode === 229) return\n if ([\"Enter\", \" \"].includes(event.key)) setOpen(!open)\n if (event.key === \"ArrowDown\") setOpen(true)\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault()\n },\n }\n return (\n <DropdownMenu.Trigger {...restProps} asChild disabled={disabled}>\n <TriggerElement ref={setTriggerElement} activation={activation}>{children}</TriggerElement>\n </DropdownMenu.Trigger>\n )\n}\n\ntype SubmenuContextValue = {\n open: boolean\n setOpen: (next: boolean) => void\n triggerRef: React.RefObject<HTMLDivElement | null>\n triggerDisabledRef: React.RefObject<boolean>\n}\n\nconst SubmenuContext = createContext<SubmenuContextValue | null>(null)\n\nconst useSubmenuContext = () => {\n const context = useContext(SubmenuContext)\n\n if (!context) {\n throw new Error(\"Submenu components must be wrapped in <Sub />\")\n }\n\n return context\n}\n\nexport type SubmenuProps = {\n children: React.ReactNode\n /** Force the menu to remain open or closed */\n forceOpen?: boolean\n /** Callback triggered when the modal is opened */\n onOpen?: () => void\n /** Callback triggered when the modal is closed */\n onClose?: () => void\n}\n\nconst Sub = ({ children, forceOpen, onOpen, onClose }: SubmenuProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const triggerRef = useRef<HTMLDivElement>(null)\n const triggerDisabledRef = useRef(false)\n const isOpen = forceOpen ?? open\n\n const latestOnOpen = useLatestValue(onOpen)\n const latestOnClose = useLatestValue(onClose)\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n if (nextState && triggerDisabledRef.current) return\n setOpen(nextState)\n if (nextState) {\n latestOnOpen.current?.()\n } else {\n latestOnClose.current?.()\n }\n },\n [latestOnOpen, latestOnClose],\n )\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n // Ensure trigger is focused\n triggerRef.current?.focus()\n })\n\n const store = useMemo<SubmenuContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n triggerRef,\n triggerDisabledRef,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <SubmenuContext.Provider value={store}>\n <DropdownMenu.Sub open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </DropdownMenu.Sub>\n </SubmenuContext.Provider>\n )\n}\n\nconst SubTrigger = ({\n className,\n children,\n description,\n disabled,\n}: {\n className?: string\n children: ReactNode\n /**\n * Second line under the label: what the submenu has chosen, as Reminders shows \"Manual\" under Sort By. It stacks\n * as an Item's description does; icons before the label stay beside both lines.\n */\n description?: ReactNode\n disabled?: boolean\n}) => {\n const { open } = useMenuContext()\n const { triggerRef, triggerDisabledRef } = useSubmenuContext()\n useLayoutEffect(() => {\n triggerDisabledRef.current = !!disabled\n return () => { triggerDisabledRef.current = false }\n }, [disabled, triggerDisabledRef])\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we know the outer menu is closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n return (\n <DropdownMenu.SubTrigger\n ref={triggerRef}\n className={clsx(s.MenuItem, s.SubMenuItem, className)}\n disabled={disabled}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <div className={s.PressableInner}>\n {rendersContent(description) ? describedRow(children, description) : children}\n <ChevronRight width=\"16\" height=\"16\" className={s.SubTriggerIcon} />\n </div>\n </DropdownMenu.SubTrigger>\n )\n}\n\ntype SubContentProps = {\n children: ReactNode\n sideOffset?: DropdownMenu.DropdownMenuSubContentProps[\"sideOffset\"]\n alignOffset?: DropdownMenu.DropdownMenuSubContentProps[\"alignOffset\"]\n /**\n * The width of the submenu. Without it the submenu fits its content, or with `touch.css` on a phone is the 250px of a\n * menu; `\"auto\"` fits its content there too.\n */\n width?: number | \"auto\"\n minWidth?: number | \"auto\"\n maxHeight?: number\n pill?: boolean\n}\n\nconst SubContent = ({\n children,\n sideOffset = 4,\n alignOffset = -6,\n width,\n minWidth,\n maxHeight,\n pill = false,\n}: SubContentProps) => {\n const { open, setOpen, triggerRef } = useSubmenuContext()\n const { isUsingKeyboard } = useMenuContext()\n const latestOpen = useLatestValue(open)\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n const stopInitialFocusCapture = useRef<(() => void) | undefined>(undefined)\n const setContentRef = useCallback((element: HTMLDivElement | null) => {\n stopInitialFocusCapture.current?.()\n stopInitialFocusCapture.current = element ? captureInitialPhoneSubmenuFocus(element, () => isUsingKeyboard.current) : undefined\n setContent(element)\n }, [isUsingKeyboard])\n const [exitGuard] = useState(createExitGuard)\n const phoneLayout = useMenuPhoneLayout(open)\n const floatingBoundary = phoneLayout.boundary\n const requestCollapse = () => {\n if (!latestOpen.current) return\n setOpen(false)\n triggerRef.current?.focus({ preventScroll: true })\n }\n // A press on the parent it stands over collapses a phone submenu\n const phone = usePhoneSubmenu(open, triggerRef, content, floatingBoundary, requestCollapse)\n // Resize recovery is not a new keyboard entry after returning to the trigger.\n const phoneWasUnavailable = useRef(false)\n useLayoutEffect(() => {\n if (!open) { phoneWasUnavailable.current = false; return }\n if (phone.mobile && phone.unavailable) phoneWasUnavailable.current = true\n if (content && triggerRef.current && completeInitialPhoneSubmenuFocus(triggerRef.current, content)) return\n if (phone.mobile && phone.ready && !phoneWasUnavailable.current && content && isUsingKeyboard.current && content.ownerDocument.activeElement === triggerRef.current) {\n focusPhoneSubmenuEntry(content)\n }\n }, [open, phone, content, isUsingKeyboard, triggerRef])\n const collapse = (event: Event) => {\n event.preventDefault()\n requestCollapse()\n }\n\n return (\n <DropdownMenu.Portal forceMount container={phoneLayout.container}>\n <PhoneScope enabled={phoneLayout.scoped}>\n <TransitionGroup className={s.Menu} {...overlayTimingQuick} {...exitGuard.transition} overlay>\n {open && (\n <DropdownMenu.SubContent\n key=\"submenu\"\n ref={setContentRef}\n className={s.MenuList}\n data-submenu=\"\"\n data-pill={pill ? \"\" : undefined}\n sideOffset={phone.mobile ? phone.sideOffset : sideOffset}\n alignOffset={phone.mobile ? phone.alignOffset : alignOffset}\n avoidCollisions={!phone.mobile}\n {...floatingBoundary}\n onEscapeKeyDown={(event) => {\n event.preventDefault()\n // The primitive identifies the topmost submenu even when a\n // controlled-open child mounts in the same commit as its root.\n if (phone.mobile && latestOpen.current) {\n event.stopPropagation()\n collapse(event)\n }\n }}\n onInteractOutside={exitGuard.onInteractOutside}\n onFocusOutside={exitGuard.onInteractOutside}\n onFocus={(event) => {\n if (phone.mobile && event.target === event.currentTarget && isUsingKeyboard.current) {\n event.preventDefault()\n focusPhoneSubmenuEntry(event.currentTarget)\n }\n }}\n style={toCssVariables({\n \"menu-width\": width,\n \"menu-min-width\": minWidth ?? \"auto\",\n \"menu-max-height\": maxHeight,\n // A submenu of \"auto\" width fits its content on a phone too; without one it takes the menu's 250px (touch.css)\n \"menu-phone-width\": phone.mobile ? (width === \"auto\" ? \"max-content\" : width) : undefined,\n \"menu-phone-min-width\": phone.mobile ? (minWidth === \"auto\" ? 0 : minWidth) : undefined,\n })}\n >\n {phone.mobile && (\n <DropdownMenu.Item className={clsx(s.MenuItem, s.SubMenuItem)} data-submenu-collapse=\"\" onSelect={collapse} onPointerMove={preventTouchHover} onPointerLeave={preventTouchHover}>\n <div className={s.PressableInner}>\n {phone.label}\n <ChevronDown width=\"16\" height=\"16\" className={s.SubTriggerIcon} />\n </div>\n </DropdownMenu.Item>\n )}\n {/* A separator under the row that heads it, as iOS 26 submenus (iOS-menu IMG_5677, IMG_5682) */}\n {phone.mobile && <DropdownMenu.Separator className={s.Separator} role=\"separator\" />}\n {/* The items, which scroll under that heading on a phone; on a desktop they lie in the panel itself */}\n <div className={s.SubmenuItems}>{children}</div>\n </DropdownMenu.SubContent>\n )}\n </TransitionGroup>\n </PhoneScope>\n </DropdownMenu.Portal>\n )\n}\n\nexport type MenuRadioGroupProps<T extends string> = {\n /** Controlled value */\n value: T\n /** Fired when selection changes */\n onChange: (value: T) => void\n children: ReactNode\n /**\n * The orientation of the indicator within the radio item.\n * @default end\n */\n indicatorPosition?: \"start\" | \"end\"\n /**\n * `horizontal` sets the options side by side, each an icon over its label and the chosen one on a fill: a mode at the\n * top of an iOS menu, above its list, as Photos orders by Added or by Captured. No radio indicator is drawn; choosing\n * one closes the menu, as any item does.\n * @default \"vertical\"\n */\n layout?: \"vertical\" | \"horizontal\"\n}\n\nconst RadioGroup = <T extends string>({\n children,\n value,\n onChange,\n indicatorPosition = \"end\",\n layout = \"vertical\",\n ...props\n}: MenuRadioGroupProps<T>) => {\n const horizontal = layout === \"horizontal\"\n return (\n <DropdownMenu.RadioGroup\n {...props}\n className={s.RadioGroup}\n value={value}\n onValueChange={(v: string) => onChange(v as T)}\n data-layout={horizontal ? \"horizontal\" : undefined}\n data-indicator-position={horizontal ? undefined : indicatorPosition}\n >\n {children}\n </DropdownMenu.RadioGroup>\n )\n}\n\nexport type MenuRadioItemProps<T extends string> = {\n value: T\n /** Class applied to the radio item */\n className?: string\n children: ReactNode\n /**\n * Second line under the label, as iOS shows the order of the chosen sort (Files: \"Newest to Oldest\" under Date). It\n * stacks as an Item's description does.\n */\n description?: ReactNode\n /** Callback triggered when the radio item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Disables the radio item */\n disabled?: boolean\n}\n\nconst preventTouchHover = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) event.preventDefault()\n}\n\nconst RadioItem = <T extends string>({ className, children, description, ...props }: MenuRadioItemProps<T>) => (\n <DropdownMenu.RadioItem\n className={clsx(s.MenuItem, s.RadioItem, className)}\n {...props}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <div className={s.PressableInner}>\n <div className={s.RadioIndicator}>\n <DropdownMenu.ItemIndicator className={s.RadioIndicatorActive}>\n <Check className={s.SelectionCheck} />\n </DropdownMenu.ItemIndicator>\n </div>\n {rendersContent(description) ? describedRow(children, description) : children}\n </div>\n </DropdownMenu.RadioItem>\n)\n\nexport type MenuCheckboxItemProps = {\n /** Controlled checked state of the checkbox item */\n checked?: DropdownMenu.DropdownMenuCheckboxItemProps[\"checked\"]\n /** Event handler called when the checked state changes */\n onCheckedChange?: DropdownMenu.DropdownMenuCheckboxItemProps[\"onCheckedChange\"]\n /** Class applied to the checkbox item */\n className?: string\n children: ReactNode\n /** Callback triggered when the checkbox item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Disables the checkbox item */\n disabled?: boolean\n /**\n * The orientation of the indicator within the checkbox item.\n * @default end\n */\n indicatorPosition?: \"start\" | \"end\"\n /**\n * Visual treatment for the checkbox indicator.\n * @default solid\n */\n indicatorVariant?: \"solid\" | \"ghost\"\n}\nconst CheckboxItem = ({\n className,\n children,\n indicatorPosition = \"end\",\n indicatorVariant = \"solid\",\n ...props\n}: MenuCheckboxItemProps) => (\n <DropdownMenu.CheckboxItem\n className={clsx(s.MenuItem, s.CheckboxItem, className)}\n {...props}\n data-indicator-position={indicatorPosition}\n data-indicator-variant={indicatorVariant}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <div className={s.PressableInner}>\n <div className={s.CheckboxIndicator}>\n <DropdownMenu.ItemIndicator>\n {indicatorVariant === \"ghost\" ? (\n <Check className={s.SelectionCheck} />\n ) : (\n <div className={s.CheckboxCircle}>\n <Check className={s.SelectionCheck} />\n </div>\n )}\n </DropdownMenu.ItemIndicator>\n </div>\n {children}\n </div>\n </DropdownMenu.CheckboxItem>\n)\n\nexport type MenuHeaderProps = {\n className?: string\n /** The title: the name of what the menu acts on, such as a file or a board */\n children: ReactNode\n /** A line under the title: what it is, such as its kind and size (\"Folder · 382 KB\") */\n description?: ReactNode\n /**\n * A picture before the title: a thumbnail image, an icon or an Avatar, in a square of 32px (40px on a phone). An\n * image or icon fills the square; an image gets small rounded corners.\n */\n media?: ReactNode\n /** A round action at the end of the header: a `Menu.HeaderAction` */\n action?: ReactNode\n}\n\n/**\n * Names what the menu acts on, above its items: the picture, name and kind of a file in the iOS Files menu, with a\n * round action at its end. Not an item itself; its action is.\n */\n// A node that renders nothing leaves no box, as an empty slot does in Vue\nconst rendersContent = (node: ReactNode) => node != null && node !== false && node !== \"\"\n\nconst Header = ({ className, children, description, media, action }: MenuHeaderProps) => (\n <div className={clsx(s.MenuHeader, className)} data-menu-header=\"\">\n {rendersContent(media) && <div className={s.MenuHeaderMedia}>{media}</div>}\n <div className={s.MenuHeaderText}>\n <div className={s.MenuHeaderTitle}>{children}</div>\n {rendersContent(description) && <div className={s.MenuHeaderDescription}>{description}</div>}\n </div>\n {action}\n </div>\n)\n\nexport type MenuHeaderActionProps = {\n /** The action's icon */\n children: ReactNode\n /** Accessible name; the action is an icon-only button */\n \"aria-label\": string\n /** Called when the action is pressed; the menu then closes. Call `event.preventDefault()` to keep it open. */\n onSelect?: (event: Event) => void\n /** Disables the action */\n disabled?: boolean\n}\n\n/** The round action at the end of a `Menu.Header`, such as Share: a menu item, reached with the arrow keys too. */\nconst HeaderAction = ({ children, \"aria-label\": ariaLabel, onSelect, disabled }: MenuHeaderActionProps) => (\n <DropdownMenu.Item\n asChild\n onSelect={onSelect}\n disabled={disabled}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <Button\n className={s.MenuHeaderAction}\n color=\"secondary\"\n variant=\"soft\"\n size=\"md\"\n uniform\n pill\n aria-label={ariaLabel}\n disabled={disabled}\n >\n {children}\n </Button>\n </DropdownMenu.Item>\n)\n\nMenu.Content = Content\nMenu.Item = Item\nMenu.ItemActions = ItemActions\nMenu.ItemAction = ItemAction\nMenu.Link = Link\nMenu.Separator = Separator\nMenu.Trigger = Trigger\nMenu.Sub = Sub\nMenu.SubTrigger = SubTrigger\nMenu.SubContent = SubContent\nMenu.CheckboxItem = CheckboxItem\nMenu.RadioGroup = RadioGroup\nMenu.RadioItem = RadioItem\nMenu.Label = Label\nMenu.Group = Group\nMenu.Header = Header\nMenu.HeaderAction = HeaderAction\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,EAGZ,aAAa,EAGb,WAAW,EACX,U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AAG,YAAY,CAAA;AAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;AAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;AAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA","sourcesContent":["\"use client\"\n\nimport { DropdownMenu, Slot } from \"radix-ui\"\nimport React, {\n type ComponentProps,\n type ComponentType,\n createContext,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport clsx from \"clsx\"\nimport { useFloatingBoundary } from \"../../hooks/useFloatingBoundary\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { usePhoneSubmenu } from \"../../hooks/usePhoneSubmenu\"\nimport { focusPhoneSubmenuEntry } from \"../../lib/menuSubmenuPlacement\"\nimport { captureInitialPhoneSubmenuFocus, completeInitialPhoneSubmenuFocus, delegateInitialPhoneSubmenuFocus } from \"../../lib/menuInitialFocus\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { ignoreReleaseOverTrigger, markCoveredMenuTrigger, observeMenuTriggerCover, type MenuTriggerCover } from \"../../lib/menuTriggerCover\"\nimport { Button } from \"../Button\"\nimport { Check, ChevronDown, ChevronRight } from \"../Icon\"\nimport { PhoneLayoutContext } from \"../PhoneLayout/PhoneLayout\"\nimport { useLinkComponent } from \"../PlexUIProvider/internal\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingQuick, reducedMotionEnter } from \"../Transition/shared\"\nimport { growsFromButton, MENU_SPRING_MS, sourceScale } from \"../../lib/presentMotion\"\nimport { isHoverPointer } from \"../../lib/inputMode\"\nimport s from \"@plexui/styles/components/Menu/Menu.module.css\"\nimport { HOLD_PRESSES_CLASS, holdEnteringPresses } from \"../../lib/holdEnteringPresses\"\n\n// Presses that start while a dialog or menu comes in are held, as on iOS (lib/holdEnteringPresses)\nholdEnteringPresses()\n\n// Inside a PhoneLayout a menu opens in its box, laid out as on a phone and kept within it; in a Dialog laid out as on a\n// phone outside one it opens over the window, in a phone scope of its own (plan 176)\nconst COLLISION_PADDING = { bottom: 30, top: 30, left: 12, right: 12 }\nexport const useMenuPhoneLayout = (open: boolean) => {\n const floatingBoundary = useFloatingBoundary(open, COLLISION_PADDING)\n const phoneLayout = useContext(PhoneLayoutContext)\n const container = phoneLayout?.container ?? null\n // The footer of a Page or Dialog in the box keeps the menu clear of it; one around the box does not hold it, and the\n // box clips what passes its edges\n const footerInBox = !!container && !!floatingBoundary.collisionBoundary && container.contains(floatingBoundary.collisionBoundary)\n const boundary = container && !footerInBox ? { collisionBoundary: container, collisionPadding: COLLISION_PADDING } : floatingBoundary\n return { container: container ?? undefined, scoped: phoneLayout !== null && !container, boundary }\n}\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\n// A delayed programmatic restore may inherit focus-visible from the menu.\n// Keep the focus, but suppress the Button ring only for this pointer restore.\nconst markPointerFocusRestore = (trigger: HTMLElement) => {\n const doc = trigger.ownerDocument\n let active = true\n let restoring = true\n const clear = () => {\n active = false\n trigger.removeAttribute(\"data-menu-pointer-focus\")\n trigger.removeEventListener(\"blur\", clear)\n trigger.removeEventListener(\"focus\", onFocus)\n doc.removeEventListener(\"keydown\", clear, true)\n }\n const onFocus = () => {\n if (!restoring) clear()\n }\n trigger.setAttribute(\"data-menu-pointer-focus\", \"\")\n trigger.addEventListener(\"blur\", clear)\n trigger.addEventListener(\"focus\", onFocus)\n doc.addEventListener(\"keydown\", clear, true)\n queueMicrotask(() => {\n if (!active) return\n restoring = false\n // Radix can skip its restore after an outside interaction.\n if (doc.activeElement !== trigger) clear()\n })\n return clear\n}\n\ntype MenuContextValue = {\n open: boolean\n setOpen: (next: boolean) => void\n prepareFocusRestore: (trigger: HTMLElement) => void\n isUsingKeyboard: React.RefObject<boolean>\n /** The element of `Menu.Trigger`, which a phone menu covers */\n triggerElement: HTMLElement | null\n setTriggerElement: (element: HTMLElement | null) => void\n /** Whether the menu is modal, which decides whether an outside interaction skips the focus return */\n modal: boolean\n}\n\nconst MenuContext = createContext<MenuContextValue | null>(null)\n\n/** @internal The open state of the enclosing Menu, for ContextMenu. Not exported from the package. */\nexport const useMenuContext = () => {\n const context = useContext(MenuContext)\n\n if (!context) {\n throw new Error(\"Menu components must be wrapped in <Menu />\")\n }\n\n return context\n}\n\nexport type MenuProps = {\n children: React.ReactNode\n /** Force the menu to remain open or closed */\n forceOpen?: boolean\n /** Callback triggered when the modal is opened */\n onOpen?: () => void\n /** Callback triggered when the modal is closed */\n onClose?: () => void\n /**\n * When set to `true`, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean\n}\n\nexport const Menu = ({ children, forceOpen, onOpen, onClose, modal = false }: MenuProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = forceOpen ?? open\n const isUsingKeyboard = useRef(false)\n const [triggerElement, setTriggerElement] = useState<HTMLElement | null>(null)\n const clearPointerFocus = useRef<(() => void) | undefined>(undefined)\n\n useEffect(() => {\n const onKeyDown = () => {\n isUsingKeyboard.current = true\n }\n const onPointer = () => {\n isUsingKeyboard.current = false\n }\n document.addEventListener(\"keydown\", onKeyDown, true)\n document.addEventListener(\"pointerdown\", onPointer, true)\n document.addEventListener(\"pointermove\", onPointer, true)\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown, true)\n document.removeEventListener(\"pointerdown\", onPointer, true)\n document.removeEventListener(\"pointermove\", onPointer, true)\n clearPointerFocus.current?.()\n }\n }, [])\n\n const prepareFocusRestore = useCallback((trigger: HTMLElement) => {\n clearPointerFocus.current?.()\n clearPointerFocus.current = undefined\n if (!isUsingKeyboard.current && trigger.isConnected) {\n clearPointerFocus.current = markPointerFocusRestore(trigger)\n }\n }, [])\n\n const latestOnOpen = useLatestValue(onOpen)\n const latestOnClose = useLatestValue(onClose)\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n setOpen(nextState)\n if (nextState) {\n latestOnOpen.current?.()\n } else {\n latestOnClose.current?.()\n }\n },\n [latestOnOpen, latestOnClose],\n )\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n const store = useMemo<MenuContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n prepareFocusRestore,\n isUsingKeyboard,\n triggerElement,\n setTriggerElement,\n modal,\n }),\n [isOpen, handleOpenChange, prepareFocusRestore, triggerElement, modal],\n )\n\n return (\n <MenuContext.Provider value={store}>\n <DropdownMenu.Root open={isOpen} onOpenChange={handleOpenChange} modal={modal}>\n {children}\n </DropdownMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuItemProps = {\n className?: string\n children: React.ReactNode\n /**\n * Second line under the item's label: what this action does, or which\n * value it carries. The label goes semibold on its own, the same way a\n * Select option with a description does — same pattern, same anatomy.\n */\n description?: ReactNode\n /** Callback triggered when the item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Callback triggered when the item is clicked */\n onClick?: DropdownMenu.DropdownMenuItemProps[\"onClick\"]\n /** Disables the menu item */\n disabled?: boolean\n /** Marks a destructive action (delete, remove, leave): the item is drawn in the danger color */\n danger?: boolean\n}\n\n// An icon is a component, an svg or an img; text and text elements (strong, kbd) belong to the label.\nconst isLeadingIcon = (part: ReactNode) =>\n React.isValidElement(part) && (typeof part.type !== \"string\" || part.type === \"svg\" || part.type === \"img\")\n\n/**\n * A described row: the label over its description. Icons that lead the label stay beside the two lines, centred on\n * both, as iOS draws Sort By with its order under it (Reminders); a row of icons alone stacks whole.\n */\n// A row's own children, fragments opened up as Vue's slots are, keyed again by place\nconst flattenRow = (children: ReactNode): ReactNode[] =>\n React.Children.toArray(children).flatMap((part) =>\n React.isValidElement<{ children?: ReactNode }>(part) && part.type === React.Fragment ? flattenRow(part.props.children) : [part])\n\nconst describedRow = (children: ReactNode, description: ReactNode) => {\n const parts = flattenRow(children).map((part, index) => (React.isValidElement(part) ? React.cloneElement(part, { key: index }) : part))\n const label = parts.findIndex((part) => !isLeadingIcon(part))\n const lead = label > 0 ? parts.slice(0, label) : []\n return (\n <>\n {lead}\n <div className={s.ItemLeading}>\n <div>{lead.length > 0 ? parts.slice(label) : children}</div>\n {/* Not part of the label a phone submenu heads itself with */}\n <div className={s.ItemDescription} data-menu-description=\"\">{description}</div>\n </div>\n </>\n )\n}\n\nconst Item = ({ className, children, description, disabled, danger, onSelect, onClick }: MenuItemProps) => {\n const { open } = useMenuContext()\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we're always known to be closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n // A described item stacks its two lines; without a description the item\n // keeps the plain flex row that icons and ItemActions rely on.\n const content = rendersContent(description) ? describedRow(children, description) : children\n\n // Custom click handlers: either callback makes the item interactive\n if (onSelect || onClick) {\n return (\n <DropdownMenu.Item\n className={clsx(s.MenuItem, className)}\n onSelect={onSelect}\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n data-danger={danger ? \"\" : undefined}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <div className={s.PressableInner}>{content}</div>\n </DropdownMenu.Item>\n )\n }\n\n // Read-only content - will not appear interactive.\n return <div className={clsx(s.MenuItemContent, className)}>{content}</div>\n}\n\nconst ItemActions = ({ className, children }: { className?: string; children: ReactNode }) => {\n return <div className={clsx(s.ItemActions, className)}>{children}</div>\n}\n\nconst ItemAction = ({\n children,\n onClick,\n \"aria-label\": ariaLabel,\n}: {\n children: ReactNode\n onClick: (evt: MouseEvent) => void\n /** Accessible name; the action is an icon-only button */\n \"aria-label\"?: string\n}) => {\n const { setOpen } = useMenuContext()\n\n return (\n <Button\n className=\"rounded-sm\"\n color=\"secondary\"\n size=\"xs\"\n uniform\n iconSize=\"sm\"\n variant=\"ghost\"\n aria-label={ariaLabel}\n onClick={(evt) => {\n evt.stopPropagation()\n setOpen(false)\n onClick(evt)\n }}\n >\n {children}\n </Button>\n )\n}\n\ntype MenuLinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\" | \"children\"> & {\n /** Content rendered inside the Link */\n children: React.ReactNode\n /** Disables the menu item */\n disabled?: boolean\n /** Marks a destructive destination: the item is drawn in the danger color */\n danger?: boolean\n}\n\ntype MenuLink = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends ComponentType<any> | \"a\" = PlexUI.LinkComponent,\n>(\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n MenuLinkProps & {\n /**\n * Override the default component used for the link. This is useful for\n * using a routing library, or SSR rendering.\n * purposes.\n *\n * @default 'a'\n */\n as?: T\n } & ComponentProps<T>,\n) => ReactNode\n\nconst Link = ((\n props: MenuLinkProps & { href?: string; to?: string; as?: PlexUI.LinkComponent },\n) => {\n const { className, children, href, to, disabled, danger, as: OverrideComponent, ...restProps } = props\n const { open } = useMenuContext()\n\n const propPath = href || to\n // When a path is not provided, default to an anchor\n const isExternal = propPath ? /^https?:\\/\\//.test(propPath) : true\n const DefaultComponent = useLinkComponent()\n const Component = OverrideComponent || (isExternal ? \"a\" : DefaultComponent)\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we're always known to be closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n const linkProps = isExternal\n ? { target: \"_blank\", rel: \"noopener noreferrer\", href: href ?? to }\n : { href, to }\n\n return (\n <DropdownMenu.Item\n asChild\n className={clsx(s.MenuItem, className)}\n disabled={disabled}\n data-danger={danger ? \"\" : undefined}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <Component\n {...linkProps}\n {...restProps}\n onClick={(event: React.MouseEvent<HTMLAnchorElement>) => {\n restProps.onClick?.(event)\n // Radix skips selecting a disabled item, not the link's navigation\n if (disabled) event.preventDefault()\n }}\n >\n <span className={s.PressableInner}>{children}</span>\n </Component>\n </DropdownMenu.Item>\n )\n}) as MenuLink\n\nconst Separator = ({ className }: { className?: string }) => {\n return <DropdownMenu.Separator className={clsx(s.Separator, className)} role=\"separator\" />\n}\n\n\nconst Label = ({ className, children }: { className?: string; children: ReactNode }) => {\n return (\n <DropdownMenu.Label className={clsx(s.MenuLabel, className)}>\n {children}\n </DropdownMenu.Label>\n )\n}\n\nconst Group = ({\n className,\n children,\n}: {\n className?: string\n children: ReactNode\n}) => {\n return <DropdownMenu.Group className={className}>{children}</DropdownMenu.Group>\n}\n\nexport type MenuContentProps = {\n children: React.ReactNode\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. Without it\n * a menu on a phone opens toward the larger part of the screen: upward from a trigger in the lower half.\n * @default bottom\n */\n side?: DropdownMenu.DropdownMenuContentProps[\"side\"]\n /**\n * The distance in pixels from the trigger. Without it a menu on a phone covers its trigger, as iOS menus grow out\n * of the control that opens them.\n * @default 5\n */\n sideOffset?: DropdownMenu.DropdownMenuContentProps[\"sideOffset\"]\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default center\n */\n align?: DropdownMenu.DropdownMenuContentProps[\"align\"]\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options. Without it a menu on a phone that covers its\n * trigger keeps the trigger's edge.\n * @default -5 with \"start\" or \"end\", 0 with \"center\"\n */\n alignOffset?: DropdownMenu.DropdownMenuContentProps[\"alignOffset\"]\n /**\n * Defines the `width` property of the content. Without it the menu fits its content, or with `touch.css` on a phone\n * is the 250px panel of an iOS menu; `\"auto\"` fits its content there too.\n */\n width?: number | \"auto\"\n /**\n * Defines the `min-width` property of the content, in pixels.\n * @default 300\n */\n minWidth?: number | \"auto\"\n /**\n * Defines the `max-width` property of the content, in pixels.\n */\n maxHeight?: number\n /**\n * Rounder list with fully rounded rows, for menus that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n /**\n * Layout direction of menu items.\n * Use `\"horizontal\"` for icon-based toolbars (iOS-style).\n * @default \"vertical\"\n */\n layout?: \"vertical\" | \"horizontal\"\n /**\n * Size of horizontal menu items. Controls icon size and padding.\n * Only applies when `layout=\"horizontal\"`.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\"\n /**\n * Event handler called when auto-focus tries to return to the trigger\n * after the menu closes. Call `event.preventDefault()` to prevent the\n * trigger from regaining focus (and its focus-visible ring).\n */\n onCloseAutoFocus?: DropdownMenu.DropdownMenuContentProps[\"onCloseAutoFocus\"]\n /**\n * Event handler called when focus moves into the menu as it opens. Call\n * `event.preventDefault()` to leave focus where it is, as for a menu that\n * stands open when its screen appears.\n */\n onOpenAutoFocus?: (event: Event) => void\n}\n\n/**\n * Radix forwards `onOpenAutoFocus` from DropdownMenu.Content to its internal\n * MenuContentImpl at runtime, but the public DropdownMenu types omit that\n * private prop. Phone submenu initial focus needs it to replace the\n * content-level mount focus, so the extra prop is declared here explicitly.\n */\nconst RootMenuContent = DropdownMenu.Content as React.ForwardRefExoticComponent<\n DropdownMenu.DropdownMenuContentProps & {\n onOpenAutoFocus?: (event: Event) => void\n } & React.RefAttributes<HTMLDivElement>\n>\n\nconst Content = ({\n children,\n side,\n sideOffset,\n align,\n alignOffset,\n width,\n minWidth,\n maxHeight,\n pill = false,\n layout = \"vertical\",\n size,\n onCloseAutoFocus,\n onOpenAutoFocus,\n}: MenuContentProps) => {\n const { open, prepareFocusRestore, triggerElement, modal } = useMenuContext()\n const contentRef = useRef<HTMLDivElement>(null)\n // The panel's node as state too: it mounts after the trigger's cover is known, and again when the phone layout moves\n // the portal, so the effect that hides the covered trigger reruns with the node that is on screen\n const [contentElement, setContentElement] = useState<HTMLDivElement | null>(null)\n const setContent = useCallback((node: HTMLDivElement | null) => {\n contentRef.current = node\n setContentElement(node)\n }, [])\n const interactedOutside = useRef(false)\n const phoneLayout = useMenuPhoneLayout(open)\n const floatingBoundary = phoneLayout.boundary\n // On a phone a menu without its own offset grows out of its trigger, covers it and opens toward the larger part of\n // the screen (menuTriggerCover.ts); one that opens to a side keeps its gap\n const coversTrigger = open && sideOffset === undefined && side !== \"left\" && side !== \"right\"\n const [triggerCover, setTriggerCover] = useState<MenuTriggerCover | null>(null)\n useLayoutEffect(() => {\n if (!coversTrigger || !triggerElement) return\n return observeMenuTriggerCover(triggerElement, setTriggerCover)\n }, [coversTrigger, triggerElement])\n const cover = coversTrigger ? triggerCover : null\n // A trigger the panel covers whole is hidden while it is open, as iOS turns a bar button into its menu\n useLayoutEffect(() => {\n if (!cover || !triggerElement || !contentElement) return\n return markCoveredMenuTrigger(triggerElement, contentElement)\n }, [cover, triggerElement, contentElement])\n // A menu that covers its button grows out of it and shrinks back into it, as an iOS 27.2 menu does, on SwiftUI's\n // spring(duration: 0.21, bounce: 0.2), --spring-menu. Its timers wait for the spring.\n // Decided while it is open: a closing menu covers nothing, yet goes back into its button\n const growsRef = useRef(false)\n if (open) growsRef.current = cover !== null && growsFromButton(triggerElement)\n const grows = growsRef.current\n useLayoutEffect(() => {\n if (!open || !contentElement) return\n const scale = grows ? sourceScale(contentElement, triggerElement) : null\n if (scale) {\n contentElement.style.setProperty(\"--menu-source-transform\", scale)\n contentElement.setAttribute(\"data-presented-from\", \"\")\n } else {\n contentElement.style.removeProperty(\"--menu-source-transform\")\n contentElement.removeAttribute(\"data-presented-from\")\n }\n }, [open, grows, contentElement, triggerElement])\n const [exitGuard] = useState(createExitGuard)\n const isHorizontal = layout === \"horizontal\"\n // The content of a closing menu is frozen for its exit, so this reads the owner's latest handler.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n const skipFocus = interactedOutside.current\n interactedOutside.current = false\n if (event.defaultPrevented) return\n // A focus scope that unmounts while the menu stays open (React StrictMode replays the effects of a menu that mounts\n // open) is no close: focus stays, and the menu is not dismissed by focus moving out to its trigger\n if (open) {\n event.preventDefault()\n return\n }\n const content = event.target\n if (!(content instanceof HTMLElement)) return\n const trigger = content.ownerDocument.getElementById(content.getAttribute(\"aria-labelledby\") ?? \"\")\n if (!trigger) return\n prepareFocusRestore(trigger)\n // Focus returns to the trigger as Radix returns it, but without scrolling: a plain focus() scrolls every scrolling\n // ancestor to the trigger, the page around a frame that holds the menu too\n event.preventDefault()\n if (!skipFocus) trigger.focus({ preventScroll: true })\n })\n // Radix's own record of an outside interaction, which its focus return (replaced above) reads: any one when the menu\n // is not modal, a right click when it is\n const handleInteractOutside = (event: Parameters<NonNullable<DropdownMenu.DropdownMenuContentProps[\"onInteractOutside\"]>>[0]) => {\n exitGuard.onInteractOutside(event)\n // A cancelled one leaves the menu open and Radix does not record it (Vue returns early the same way)\n if (event.defaultPrevented) return\n const original = event.detail.originalEvent as PointerEvent\n const isRightClick = original.button === 2 || (original.button === 0 && original.ctrlKey === true)\n if (!modal || isRightClick) interactedOutside.current = true\n }\n\n return (\n <DropdownMenu.Portal forceMount container={phoneLayout.container}>\n <PhoneScope enabled={phoneLayout.scoped}>\n <TransitionGroup\n className={clsx(s.Menu, HOLD_PRESSES_CLASS)}\n {...(grows ? { enterDuration: MENU_SPRING_MS, exitDuration: MENU_SPRING_MS } : overlayTiming)}\n reducedMotionEnterDuration={reducedMotionEnter.menu}\n {...exitGuard.transition}\n overlay\n >\n {open && (\n <RootMenuContent\n key=\"dropdown\"\n ref={setContent}\n onOpenAutoFocus={(event) => {\n onOpenAutoFocus?.(event)\n delegateInitialPhoneSubmenuFocus(event, contentRef.current)\n }}\n forceMount\n className={s.MenuList}\n data-pill={pill ? \"\" : undefined}\n side={side ?? cover?.side}\n sideOffset={cover ? cover.sideOffset : sideOffset ?? 5}\n align={align}\n alignOffset={alignOffset ?? (cover || align === \"center\" ? 0 : -5)}\n avoidCollisions\n {...floatingBoundary}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n data-layout={isHorizontal ? \"horizontal\" : undefined}\n data-size={isHorizontal && size ? size : undefined}\n style={toCssVariables({\n \"menu-width\": width,\n \"menu-min-width\": isHorizontal ? \"auto\" : minWidth,\n \"menu-max-height\": maxHeight,\n })}\n >\n {/* The items of a vertical menu lie in the panel itself; a phone menu scrolls them and fades them at its edges */}\n {isHorizontal ? children : <div className={s.Items}>{children}</div>}\n </RootMenuContent>\n )}\n </TransitionGroup>\n </PhoneScope>\n </DropdownMenu.Portal>\n )\n}\n\ntype TriggerActivation = Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, \"onPointerDown\" | \"onPointerCancel\" | \"onClick\" | \"onKeyDown\">\n\n// Keep Radix's public trigger registration, attributes and ref while owning\n// activation. Its pointerdown-only behavior cannot commit touch/AT clicks.\nconst TriggerElement = ({ activation, ...props }: ComponentProps<typeof Slot.Root> & { activation: TriggerActivation }) => {\n delete props.onPointerDown\n delete props.onPointerCancel\n delete props.onClick\n delete props.onKeyDown\n return <Slot.Root {...props} {...activation} />\n}\n\nconst Trigger = ({\n children,\n disabled,\n onPointerDown,\n onPointerCancel,\n onClick,\n onKeyDown,\n ...restProps\n}: DropdownMenu.DropdownMenuTriggerProps & { ref?: React.Ref<HTMLButtonElement> }) => {\n const { open, setOpen, setTriggerElement } = useMenuContext()\n const handledClick = useRef(false)\n const activation: TriggerActivation = {\n onPointerDown: (event) => {\n handledClick.current = false\n onPointerDown?.(event)\n if (event.defaultPrevented) {\n handledClick.current = true\n return\n }\n if (disabled || event.button !== 0 || event.ctrlKey) return\n if (event.pointerType === \"pen\" || !isHoverPointer(event)) return\n handledClick.current = true\n setOpen(!open)\n if (open) return\n event.preventDefault()\n ignoreReleaseOverTrigger(event.currentTarget as HTMLElement, event.pointerId)\n },\n onPointerCancel: (event) => {\n handledClick.current = false\n onPointerCancel?.(event)\n },\n onClick: (event) => {\n const handled = handledClick.current\n handledClick.current = false\n onClick?.(event)\n if (event.defaultPrevented || disabled || event.button !== 0 || event.ctrlKey) return\n if (handled && event.detail !== 0) return\n setOpen(!open)\n },\n onKeyDown: (event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented || disabled || event.nativeEvent.isComposing || event.keyCode === 229) return\n if ([\"Enter\", \" \"].includes(event.key)) setOpen(!open)\n if (event.key === \"ArrowDown\") setOpen(true)\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault()\n },\n }\n return (\n <DropdownMenu.Trigger {...restProps} asChild disabled={disabled}>\n <TriggerElement ref={setTriggerElement} activation={activation}>{children}</TriggerElement>\n </DropdownMenu.Trigger>\n )\n}\n\ntype SubmenuContextValue = {\n open: boolean\n setOpen: (next: boolean) => void\n triggerRef: React.RefObject<HTMLDivElement | null>\n triggerDisabledRef: React.RefObject<boolean>\n}\n\nconst SubmenuContext = createContext<SubmenuContextValue | null>(null)\n\nconst useSubmenuContext = () => {\n const context = useContext(SubmenuContext)\n\n if (!context) {\n throw new Error(\"Submenu components must be wrapped in <Sub />\")\n }\n\n return context\n}\n\nexport type SubmenuProps = {\n children: React.ReactNode\n /** Force the menu to remain open or closed */\n forceOpen?: boolean\n /** Callback triggered when the modal is opened */\n onOpen?: () => void\n /** Callback triggered when the modal is closed */\n onClose?: () => void\n}\n\nconst Sub = ({ children, forceOpen, onOpen, onClose }: SubmenuProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const triggerRef = useRef<HTMLDivElement>(null)\n const triggerDisabledRef = useRef(false)\n const isOpen = forceOpen ?? open\n\n const latestOnOpen = useLatestValue(onOpen)\n const latestOnClose = useLatestValue(onClose)\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n if (nextState && triggerDisabledRef.current) return\n setOpen(nextState)\n if (nextState) {\n latestOnOpen.current?.()\n } else {\n latestOnClose.current?.()\n }\n },\n [latestOnOpen, latestOnClose],\n )\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n // Ensure trigger is focused\n triggerRef.current?.focus()\n })\n\n const store = useMemo<SubmenuContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n triggerRef,\n triggerDisabledRef,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <SubmenuContext.Provider value={store}>\n <DropdownMenu.Sub open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </DropdownMenu.Sub>\n </SubmenuContext.Provider>\n )\n}\n\nconst SubTrigger = ({\n className,\n children,\n description,\n disabled,\n}: {\n className?: string\n children: ReactNode\n /**\n * Second line under the label: what the submenu has chosen, as Reminders shows \"Manual\" under Sort By. It stacks\n * as an Item's description does; icons before the label stay beside both lines.\n */\n description?: ReactNode\n disabled?: boolean\n}) => {\n const { open } = useMenuContext()\n const { triggerRef, triggerDisabledRef } = useSubmenuContext()\n useLayoutEffect(() => {\n triggerDisabledRef.current = !!disabled\n return () => { triggerDisabledRef.current = false }\n }, [disabled, triggerDisabledRef])\n\n // This handler patches over focus races with core Radix primitives\n // https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L712-L734\n const handlePreventAfterClose = (evt: React.PointerEvent<HTMLDivElement>) => {\n // Prevent default behavior when we know the outer menu is closing\n if (!open || !isHoverPointer(evt)) {\n evt.preventDefault()\n }\n }\n\n return (\n <DropdownMenu.SubTrigger\n ref={triggerRef}\n className={clsx(s.MenuItem, s.SubMenuItem, className)}\n disabled={disabled}\n onPointerMove={handlePreventAfterClose}\n onPointerLeave={handlePreventAfterClose}\n >\n <div className={s.PressableInner}>\n {rendersContent(description) ? describedRow(children, description) : children}\n <ChevronRight width=\"16\" height=\"16\" className={s.SubTriggerIcon} />\n </div>\n </DropdownMenu.SubTrigger>\n )\n}\n\ntype SubContentProps = {\n children: ReactNode\n sideOffset?: DropdownMenu.DropdownMenuSubContentProps[\"sideOffset\"]\n alignOffset?: DropdownMenu.DropdownMenuSubContentProps[\"alignOffset\"]\n /**\n * The width of the submenu. Without it the submenu fits its content, or with `touch.css` on a phone is the 250px of a\n * menu; `\"auto\"` fits its content there too.\n */\n width?: number | \"auto\"\n minWidth?: number | \"auto\"\n maxHeight?: number\n pill?: boolean\n}\n\nconst SubContent = ({\n children,\n sideOffset = 4,\n alignOffset = -6,\n width,\n minWidth,\n maxHeight,\n pill = false,\n}: SubContentProps) => {\n const { open, setOpen, triggerRef } = useSubmenuContext()\n const { isUsingKeyboard } = useMenuContext()\n const latestOpen = useLatestValue(open)\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n const stopInitialFocusCapture = useRef<(() => void) | undefined>(undefined)\n const setContentRef = useCallback((element: HTMLDivElement | null) => {\n stopInitialFocusCapture.current?.()\n stopInitialFocusCapture.current = element ? captureInitialPhoneSubmenuFocus(element, () => isUsingKeyboard.current) : undefined\n setContent(element)\n }, [isUsingKeyboard])\n const [exitGuard] = useState(createExitGuard)\n const phoneLayout = useMenuPhoneLayout(open)\n const floatingBoundary = phoneLayout.boundary\n const requestCollapse = () => {\n if (!latestOpen.current) return\n setOpen(false)\n triggerRef.current?.focus({ preventScroll: true })\n }\n // A press on the parent it stands over collapses a phone submenu\n const phone = usePhoneSubmenu(open, triggerRef, content, floatingBoundary, requestCollapse)\n // Resize recovery is not a new keyboard entry after returning to the trigger.\n const phoneWasUnavailable = useRef(false)\n useLayoutEffect(() => {\n if (!open) { phoneWasUnavailable.current = false; return }\n if (phone.mobile && phone.unavailable) phoneWasUnavailable.current = true\n if (content && triggerRef.current && completeInitialPhoneSubmenuFocus(triggerRef.current, content)) return\n if (phone.mobile && phone.ready && !phoneWasUnavailable.current && content && isUsingKeyboard.current && content.ownerDocument.activeElement === triggerRef.current) {\n focusPhoneSubmenuEntry(content)\n }\n }, [open, phone, content, isUsingKeyboard, triggerRef])\n const collapse = (event: Event) => {\n event.preventDefault()\n requestCollapse()\n }\n\n return (\n <DropdownMenu.Portal forceMount container={phoneLayout.container}>\n <PhoneScope enabled={phoneLayout.scoped}>\n <TransitionGroup className={s.Menu} {...overlayTimingQuick} {...exitGuard.transition} overlay>\n {open && (\n <DropdownMenu.SubContent\n key=\"submenu\"\n ref={setContentRef}\n className={s.MenuList}\n data-submenu=\"\"\n data-pill={pill ? \"\" : undefined}\n sideOffset={phone.mobile ? phone.sideOffset : sideOffset}\n alignOffset={phone.mobile ? phone.alignOffset : alignOffset}\n avoidCollisions={!phone.mobile}\n {...floatingBoundary}\n onEscapeKeyDown={(event) => {\n event.preventDefault()\n // The primitive identifies the topmost submenu even when a\n // controlled-open child mounts in the same commit as its root.\n if (phone.mobile && latestOpen.current) {\n event.stopPropagation()\n collapse(event)\n }\n }}\n onInteractOutside={exitGuard.onInteractOutside}\n onFocusOutside={exitGuard.onInteractOutside}\n onFocus={(event) => {\n if (phone.mobile && event.target === event.currentTarget && isUsingKeyboard.current) {\n event.preventDefault()\n focusPhoneSubmenuEntry(event.currentTarget)\n }\n }}\n style={toCssVariables({\n \"menu-width\": width,\n \"menu-min-width\": minWidth ?? \"auto\",\n \"menu-max-height\": maxHeight,\n // A submenu of \"auto\" width fits its content on a phone too; without one it takes the menu's 250px (touch.css)\n \"menu-phone-width\": phone.mobile ? (width === \"auto\" ? \"max-content\" : width) : undefined,\n \"menu-phone-min-width\": phone.mobile ? (minWidth === \"auto\" ? 0 : minWidth) : undefined,\n })}\n >\n {phone.mobile && (\n <DropdownMenu.Item className={clsx(s.MenuItem, s.SubMenuItem)} data-submenu-collapse=\"\" onSelect={collapse} onPointerMove={preventTouchHover} onPointerLeave={preventTouchHover}>\n <div className={s.PressableInner}>\n {phone.label}\n <ChevronDown width=\"16\" height=\"16\" className={s.SubTriggerIcon} />\n </div>\n </DropdownMenu.Item>\n )}\n {/* A separator under the row that heads it, as iOS 26 submenus (iOS-menu IMG_5677, IMG_5682) */}\n {phone.mobile && <DropdownMenu.Separator className={s.Separator} role=\"separator\" />}\n {/* The items, which scroll under that heading on a phone; on a desktop they lie in the panel itself */}\n <div className={s.SubmenuItems}>{children}</div>\n </DropdownMenu.SubContent>\n )}\n </TransitionGroup>\n </PhoneScope>\n </DropdownMenu.Portal>\n )\n}\n\nexport type MenuRadioGroupProps<T extends string> = {\n /** Controlled value */\n value: T\n /** Fired when selection changes */\n onChange: (value: T) => void\n children: ReactNode\n /**\n * The orientation of the indicator within the radio item.\n * @default end\n */\n indicatorPosition?: \"start\" | \"end\"\n /**\n * `horizontal` sets the options side by side, each an icon over its label and the chosen one on a fill: a mode at the\n * top of an iOS menu, above its list, as Photos orders by Added or by Captured. No radio indicator is drawn; choosing\n * one closes the menu, as any item does.\n * @default \"vertical\"\n */\n layout?: \"vertical\" | \"horizontal\"\n}\n\nconst RadioGroup = <T extends string>({\n children,\n value,\n onChange,\n indicatorPosition = \"end\",\n layout = \"vertical\",\n ...props\n}: MenuRadioGroupProps<T>) => {\n const horizontal = layout === \"horizontal\"\n return (\n <DropdownMenu.RadioGroup\n {...props}\n className={s.RadioGroup}\n value={value}\n onValueChange={(v: string) => onChange(v as T)}\n data-layout={horizontal ? \"horizontal\" : undefined}\n data-indicator-position={horizontal ? undefined : indicatorPosition}\n >\n {children}\n </DropdownMenu.RadioGroup>\n )\n}\n\nexport type MenuRadioItemProps<T extends string> = {\n value: T\n /** Class applied to the radio item */\n className?: string\n children: ReactNode\n /**\n * Second line under the label, as iOS shows the order of the chosen sort (Files: \"Newest to Oldest\" under Date). It\n * stacks as an Item's description does.\n */\n description?: ReactNode\n /** Callback triggered when the radio item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Disables the radio item */\n disabled?: boolean\n}\n\nconst preventTouchHover = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) event.preventDefault()\n}\n\nconst RadioItem = <T extends string>({ className, children, description, ...props }: MenuRadioItemProps<T>) => (\n <DropdownMenu.RadioItem\n className={clsx(s.MenuItem, s.RadioItem, className)}\n {...props}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <div className={s.PressableInner}>\n <div className={s.RadioIndicator}>\n <DropdownMenu.ItemIndicator className={s.RadioIndicatorActive}>\n <Check className={s.SelectionCheck} />\n </DropdownMenu.ItemIndicator>\n </div>\n {rendersContent(description) ? describedRow(children, description) : children}\n </div>\n </DropdownMenu.RadioItem>\n)\n\nexport type MenuCheckboxItemProps = {\n /** Controlled checked state of the checkbox item */\n checked?: DropdownMenu.DropdownMenuCheckboxItemProps[\"checked\"]\n /** Event handler called when the checked state changes */\n onCheckedChange?: DropdownMenu.DropdownMenuCheckboxItemProps[\"onCheckedChange\"]\n /** Class applied to the checkbox item */\n className?: string\n children: ReactNode\n /** Callback triggered when the checkbox item is pressed */\n onSelect?: DropdownMenu.DropdownMenuItemProps[\"onSelect\"]\n /** Disables the checkbox item */\n disabled?: boolean\n /**\n * The orientation of the indicator within the checkbox item.\n * @default end\n */\n indicatorPosition?: \"start\" | \"end\"\n /**\n * Visual treatment for the checkbox indicator.\n * @default solid\n */\n indicatorVariant?: \"solid\" | \"ghost\"\n}\nconst CheckboxItem = ({\n className,\n children,\n indicatorPosition = \"end\",\n indicatorVariant = \"solid\",\n ...props\n}: MenuCheckboxItemProps) => (\n <DropdownMenu.CheckboxItem\n className={clsx(s.MenuItem, s.CheckboxItem, className)}\n {...props}\n data-indicator-position={indicatorPosition}\n data-indicator-variant={indicatorVariant}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <div className={s.PressableInner}>\n <div className={s.CheckboxIndicator}>\n <DropdownMenu.ItemIndicator>\n {indicatorVariant === \"ghost\" ? (\n <Check className={s.SelectionCheck} />\n ) : (\n <div className={s.CheckboxCircle}>\n <Check className={s.SelectionCheck} />\n </div>\n )}\n </DropdownMenu.ItemIndicator>\n </div>\n {children}\n </div>\n </DropdownMenu.CheckboxItem>\n)\n\nexport type MenuHeaderProps = {\n className?: string\n /** The title: the name of what the menu acts on, such as a file or a board */\n children: ReactNode\n /** A line under the title: what it is, such as its kind and size (\"Folder · 382 KB\") */\n description?: ReactNode\n /**\n * A picture before the title: a thumbnail image, an icon or an Avatar, in a square of 32px (40px on a phone). An\n * image or icon fills the square; an image gets small rounded corners.\n */\n media?: ReactNode\n /** A round action at the end of the header: a `Menu.HeaderAction` */\n action?: ReactNode\n}\n\n/**\n * Names what the menu acts on, above its items: the picture, name and kind of a file in the iOS Files menu, with a\n * round action at its end. Not an item itself; its action is.\n */\n// A node that renders nothing leaves no box, as an empty slot does in Vue\nconst rendersContent = (node: ReactNode) => node != null && node !== false && node !== \"\"\n\nconst Header = ({ className, children, description, media, action }: MenuHeaderProps) => (\n <div className={clsx(s.MenuHeader, className)} data-menu-header=\"\">\n {rendersContent(media) && <div className={s.MenuHeaderMedia}>{media}</div>}\n <div className={s.MenuHeaderText}>\n <div className={s.MenuHeaderTitle}>{children}</div>\n {rendersContent(description) && <div className={s.MenuHeaderDescription}>{description}</div>}\n </div>\n {action}\n </div>\n)\n\nexport type MenuHeaderActionProps = {\n /** The action's icon */\n children: ReactNode\n /** Accessible name; the action is an icon-only button */\n \"aria-label\": string\n /** Called when the action is pressed; the menu then closes. Call `event.preventDefault()` to keep it open. */\n onSelect?: (event: Event) => void\n /** Disables the action */\n disabled?: boolean\n}\n\n/** The round action at the end of a `Menu.Header`, such as Share: a menu item, reached with the arrow keys too. */\nconst HeaderAction = ({ children, \"aria-label\": ariaLabel, onSelect, disabled }: MenuHeaderActionProps) => (\n <DropdownMenu.Item\n asChild\n onSelect={onSelect}\n disabled={disabled}\n onPointerMove={preventTouchHover}\n onPointerLeave={preventTouchHover}\n >\n <Button\n className={s.MenuHeaderAction}\n color=\"secondary\"\n variant=\"soft\"\n size=\"md\"\n uniform\n pill\n aria-label={ariaLabel}\n disabled={disabled}\n >\n {children}\n </Button>\n </DropdownMenu.Item>\n)\n\nMenu.Content = Content\nMenu.Item = Item\nMenu.ItemActions = ItemActions\nMenu.ItemAction = ItemAction\nMenu.Link = Link\nMenu.Separator = Separator\nMenu.Trigger = Trigger\nMenu.Sub = Sub\nMenu.SubTrigger = SubTrigger\nMenu.SubContent = SubContent\nMenu.CheckboxItem = CheckboxItem\nMenu.RadioGroup = RadioGroup\nMenu.RadioItem = RadioItem\nMenu.Label = Label\nMenu.Group = Group\nMenu.Header = Header\nMenu.HeaderAction = HeaderAction\n"]}
@@ -1,17 +1,51 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import {} from "react";
3
+ import { useEffect, useLayoutEffect } from "react";
4
+ import { installAndroidRipple } from "./androidRipple.js";
4
5
  import { PlexUIContext } from "./PlexUIContext.js";
5
- // The link component's type comes from PlexUIConfig in global.d.ts, which is
6
- // what ButtonLink, TextLink and Menu.Link read.
6
+ const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
7
+ /** `"android"` on an Android browser, else null (the default iOS look) */
8
+ function detectPlatform() {
9
+ return typeof navigator !== "undefined" && /Android/i.test(navigator.userAgent) ? "android" : null;
10
+ }
11
+ /**
12
+ * Sets `data-platform` on the document's root, which the phone styles read. `"auto"` leaves the root alone except
13
+ * on Android, so a page (or a docs frame) that sets the attribute itself keeps it.
14
+ */
15
+ function usePlatformAttribute(platform) {
16
+ useIsomorphicLayoutEffect(() => {
17
+ const resolved = platform === "auto" ? detectPlatform() : platform;
18
+ if (!resolved)
19
+ return;
20
+ const root = document.documentElement;
21
+ const previous = root.getAttribute("data-platform");
22
+ root.setAttribute("data-platform", resolved);
23
+ return () => {
24
+ if (previous === null)
25
+ root.removeAttribute("data-platform");
26
+ else
27
+ root.setAttribute("data-platform", previous);
28
+ };
29
+ }, [platform]);
30
+ }
31
+ /** A press ripples in the Android look (androidRipple.ts); the iOS look has no listener. */
32
+ function useAndroidRipple(platform) {
33
+ useEffect(() => {
34
+ if ((platform === "auto" ? detectPlatform() : platform) !== "android")
35
+ return;
36
+ return installAndroidRipple();
37
+ }, [platform]);
38
+ }
7
39
  /**
8
40
  * Shared context for all Plex UI components - wrap your app in this
9
41
  * provider to use Plex UI components.
10
42
  *
11
- * It's pretty thin right now, we only use it to hold onto the component you
12
- * use for rendering Links, but it could be expanded in the future.
43
+ * It holds the component you use for rendering Links and picks the phone
44
+ * look (`platform`).
13
45
  */
14
- export function PlexUIProvider({ children, linkComponent, }) {
46
+ export function PlexUIProvider({ children, linkComponent, platform = "auto", }) {
47
+ usePlatformAttribute(platform);
48
+ useAndroidRipple(platform);
15
49
  return _jsx(PlexUIContext.Provider, { value: { linkComponent }, children: children });
16
50
  }
17
51
  //# sourceMappingURL=PlexUIProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlexUIProvider.js","sourceRoot":"","sources":["../../../../src/components/PlexUIProvider/PlexUIProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,6EAA6E;AAC7E,gDAAgD;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,aAAa,GAKd;IACC,OAAO,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,YAAG,QAAQ,GAA0B,CAAA;AAC9F,CAAC","sourcesContent":["\"use client\"\n\nimport { type ComponentType, type ForwardRefExoticComponent, type ReactNode } from \"react\"\nimport { PlexUIContext } from \"./PlexUIContext\"\n\n// The link component's type comes from PlexUIConfig in global.d.ts, which is\n// what ButtonLink, TextLink and Menu.Link read.\n\n/**\n * Shared context for all Plex UI components - wrap your app in this\n * provider to use Plex UI components.\n *\n * It's pretty thin right now, we only use it to hold onto the component you\n * use for rendering Links, but it could be expanded in the future.\n */\nexport function PlexUIProvider({\n children,\n linkComponent,\n}: {\n children: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n linkComponent: ComponentType<any> | ForwardRefExoticComponent<any> | \"a\"\n}) {\n return <PlexUIContext.Provider value={{ linkComponent }}>{children}</PlexUIContext.Provider>\n}\n"]}
1
+ {"version":3,"file":"PlexUIProvider.js","sourceRoot":"","sources":["../../../../src/components/PlexUIProvider/PlexUIProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAsE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AACtH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAW/C,MAAM,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAA;AAE7F,0EAA0E;AAC1E,SAAS,cAAc;IACrB,OAAO,OAAO,SAAS,KAAK,WAAW,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;AACpG,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,QAAwB;IACpD,yBAAyB,CAAC,GAAG,EAAE;QAC7B,MAAM,QAAQ,GAAG,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAA;QAClE,IAAI,CAAC,QAAQ;YAAE,OAAM;QACrB,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAA;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QACnD,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;QAC5C,OAAO,GAAG,EAAE;YACV,IAAI,QAAQ,KAAK,IAAI;gBAAE,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;;gBACvD,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;QACnD,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;AAChB,CAAC;AAED,4FAA4F;AAC5F,SAAS,gBAAgB,CAAC,QAAwB;IAChD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS;YAAE,OAAM;QAC7E,OAAO,oBAAoB,EAAE,CAAA;IAC/B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,aAAa,EACb,QAAQ,GAAG,MAAM,GAOlB;IACC,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IAC9B,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAC1B,OAAO,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,YAAG,QAAQ,GAA0B,CAAA;AAC9F,CAAC","sourcesContent":["\"use client\"\n\nimport { type ComponentType, type ForwardRefExoticComponent, type ReactNode, useEffect, useLayoutEffect } from \"react\"\nimport { installAndroidRipple } from \"./androidRipple\"\nimport { PlexUIContext } from \"./PlexUIContext\"\n\n// The link component's type comes from PlexUIConfig in global.d.ts, which is\n// what ButtonLink, TextLink and Menu.Link read.\n\n/**\n * The phone look of the components (with `@plexui/styles/styles/touch.css`): `\"ios\"` draws iOS 26, `\"android\"` the\n * Plex Android look, `\"auto\"` the Android look on an Android browser and iOS elsewhere.\n */\nexport type PlexUIPlatform = \"auto\" | \"ios\" | \"android\"\n\nconst useIsomorphicLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect\n\n/** `\"android\"` on an Android browser, else null (the default iOS look) */\nfunction detectPlatform(): \"android\" | null {\n return typeof navigator !== \"undefined\" && /Android/i.test(navigator.userAgent) ? \"android\" : null\n}\n\n/**\n * Sets `data-platform` on the document's root, which the phone styles read. `\"auto\"` leaves the root alone except\n * on Android, so a page (or a docs frame) that sets the attribute itself keeps it.\n */\nfunction usePlatformAttribute(platform: PlexUIPlatform) {\n useIsomorphicLayoutEffect(() => {\n const resolved = platform === \"auto\" ? detectPlatform() : platform\n if (!resolved) return\n const root = document.documentElement\n const previous = root.getAttribute(\"data-platform\")\n root.setAttribute(\"data-platform\", resolved)\n return () => {\n if (previous === null) root.removeAttribute(\"data-platform\")\n else root.setAttribute(\"data-platform\", previous)\n }\n }, [platform])\n}\n\n/** A press ripples in the Android look (androidRipple.ts); the iOS look has no listener. */\nfunction useAndroidRipple(platform: PlexUIPlatform) {\n useEffect(() => {\n if ((platform === \"auto\" ? detectPlatform() : platform) !== \"android\") return\n return installAndroidRipple()\n }, [platform])\n}\n\n/**\n * Shared context for all Plex UI components - wrap your app in this\n * provider to use Plex UI components.\n *\n * It holds the component you use for rendering Links and picks the phone\n * look (`platform`).\n */\nexport function PlexUIProvider({\n children,\n linkComponent,\n platform = \"auto\",\n}: {\n children: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n linkComponent: ComponentType<any> | ForwardRefExoticComponent<any> | \"a\"\n /** The phone look: iOS 26, the Plex Android look, or `\"auto\"` (Android on an Android browser) */\n platform?: PlexUIPlatform\n}) {\n usePlatformAttribute(platform)\n useAndroidRipple(platform)\n return <PlexUIContext.Provider value={{ linkComponent }}>{children}</PlexUIContext.Provider>\n}\n"]}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * The press of the Plex Android look: a ripple, as Android's RippleDrawable draws one (its timing and colors are in
3
+ * `@plexui/styles/styles/android.css`). PlexUIProvider listens for presses while the platform is Android; a press
4
+ * gives the control under the finger where its circle starts and how far it grows, as custom properties, and
5
+ * restarts its animation (`data-ripple`). The styles decide which controls draw it, in what shape and color. The same
6
+ * file is in @plexui/vue.
7
+ */
8
+ /**
9
+ * A control that can be pressed. A switch, a check, a radio or a value (a Select's or a date's) in a row is not one:
10
+ * the row takes the press. A segment of a segmented control is a radio; a row of a choice list is a radio or a check.
11
+ */
12
+ const HOSTS = 'button:not(:is([role="switch"], [role="checkbox"], [role="radio"], [data-slot="select-control"]):where([data-row] *)), a[href], summary, [role="button"]:not([data-slot="select-control"]:where([data-row] *)), [role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"], [role="option"], [role="tab"], :is([role="radio"], [role="checkbox"]):not(button, input), [data-row]';
13
+ let installs = 0;
14
+ let contents;
15
+ /**
16
+ * Android's start: a circle of 30% of the control's longer side round the touch, moved in so it stays inside the
17
+ * end circle: the one round the control's center that reaches its corners, or a fixed one (`--android-ripple-radius`,
18
+ * a borderless ripple of 20px) round the center of what the control shows, its symbol or label, which a row's 44px
19
+ * target may hold at its end. A key starts it at the center. The points are offsets from that center, so a layer of
20
+ * another size round it (a borderless circle, moved by --android-ripple-ox and -oy) draws them as well.
21
+ */
22
+ function press(host, clientX, clientY, centered) {
23
+ // A press inside a control that drew one before ends that one, which :active would keep lit
24
+ for (let held = host.parentElement?.closest("[data-ripple]"); held; held = held.parentElement?.closest("[data-ripple]")) {
25
+ held.removeAttribute("data-ripple");
26
+ }
27
+ host.removeAttribute("data-ripple");
28
+ // Reading the box applies the removal, so the attribute set below starts the animation again
29
+ const box = host.getBoundingClientRect();
30
+ const halfWidth = box.width / 2;
31
+ const halfHeight = box.height / 2;
32
+ let centerX = box.left + halfWidth;
33
+ let centerY = box.top + halfHeight;
34
+ const radius = parseFloat(getComputedStyle(host).getPropertyValue("--android-ripple-radius"));
35
+ if (radius > 0) {
36
+ // What it shows: the contents of the wrapper it may hold alone (a Button's inner box), not that wrapper's box
37
+ let shown = host;
38
+ while (shown.childNodes.length === 1 && shown.firstChild instanceof Element && !(shown.firstChild instanceof SVGElement)) {
39
+ shown = shown.firstChild;
40
+ }
41
+ contents ??= document.createRange();
42
+ contents.selectNodeContents(shown);
43
+ const content = contents.getBoundingClientRect();
44
+ if (content.width > 0 && content.height > 0) {
45
+ centerX = content.left + content.width / 2;
46
+ centerY = content.top + content.height / 2;
47
+ }
48
+ }
49
+ const end = radius > 0 ? radius : Math.sqrt(halfWidth * halfWidth + halfHeight * halfHeight);
50
+ const start = Math.min(Math.max(box.width, box.height) * 0.3, end);
51
+ let dx = centered ? 0 : clientX - centerX;
52
+ let dy = centered ? 0 : clientY - centerY;
53
+ const distance = Math.sqrt(dx * dx + dy * dy);
54
+ const limit = Math.max(end - start, 0);
55
+ if (distance > limit) {
56
+ dx *= limit / distance;
57
+ dy *= limit / distance;
58
+ }
59
+ const style = host.style;
60
+ style.setProperty("--android-ripple-ox", `${centerX - box.left - halfWidth}px`);
61
+ style.setProperty("--android-ripple-oy", `${centerY - box.top - halfHeight}px`);
62
+ style.setProperty("--android-ripple-x", `calc(50% + ${dx}px)`);
63
+ style.setProperty("--android-ripple-y", `calc(50% + ${dy}px)`);
64
+ style.setProperty("--android-ripple-r0", `${start}px`);
65
+ style.setProperty("--android-ripple-r1", `${end}px`);
66
+ host.setAttribute("data-ripple", "");
67
+ }
68
+ function onPointerDown(event) {
69
+ if (event.button !== 0 || !event.isPrimary || !(event.target instanceof Element))
70
+ return;
71
+ const host = event.target.closest(HOSTS);
72
+ if (host)
73
+ press(host, event.clientX, event.clientY, false);
74
+ }
75
+ function onKeyDown(event) {
76
+ if (event.repeat || (event.key !== "Enter" && event.key !== " "))
77
+ return;
78
+ if (event.target instanceof Element && event.target.matches(HOSTS))
79
+ press(event.target, 0, 0, true);
80
+ }
81
+ /** Starts the ripple on the document; the returned function stops it once every caller has. */
82
+ export function installAndroidRipple() {
83
+ if (installs++ === 0) {
84
+ document.addEventListener("pointerdown", onPointerDown, { capture: true, passive: true });
85
+ document.addEventListener("keydown", onKeyDown, { capture: true, passive: true });
86
+ }
87
+ let installed = true;
88
+ return () => {
89
+ if (!installed)
90
+ return;
91
+ installed = false;
92
+ if (--installs === 0) {
93
+ document.removeEventListener("pointerdown", onPointerDown, { capture: true });
94
+ document.removeEventListener("keydown", onKeyDown, { capture: true });
95
+ }
96
+ };
97
+ }
98
+ //# sourceMappingURL=androidRipple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"androidRipple.js","sourceRoot":"","sources":["../../../../src/components/PlexUIProvider/androidRipple.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,KAAK,GACT,4XAA4X,CAAA;AAI9X,IAAI,QAAQ,GAAG,CAAC,CAAA;AAChB,IAAI,QAA2B,CAAA;AAE/B;;;;;;GAMG;AACH,SAAS,KAAK,CAAC,IAAgB,EAAE,OAAe,EAAE,OAAe,EAAE,QAAiB;IAClF,4FAA4F;IAC5F,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACxH,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;IACrC,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;IACnC,6FAA6F;IAC7F,MAAM,GAAG,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;IACxC,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,CAAA;IAC/B,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAA;IACjC,IAAI,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAA;IAClC,IAAI,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,UAAU,CAAA;IAClC,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,gBAAgB,C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EAAE,CAAC,CAAA;QACvE,CAAC;IACH,CAAC,CAAA;AACH,CAAC","sourcesContent":["/**\n * The press of the Plex Android look: a ripple, as Android's RippleDrawable draws one (its timing and colors are in\n * `@plexui/styles/styles/android.css`). PlexUIProvider listens for presses while the platform is Android; a press\n * gives the control under the finger where its circle starts and how far it grows, as custom properties, and\n * restarts its animation (`data-ripple`). The styles decide which controls draw it, in what shape and color. The same\n * file is in @plexui/vue.\n */\n\n/**\n * A control that can be pressed. A switch, a check, a radio or a value (a Select's or a date's) in a row is not one:\n * the row takes the press. A segment of a segmented control is a radio; a row of a choice list is a radio or a check.\n */\nconst HOSTS =\n 'button:not(:is([role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [data-slot=\"select-control\"]):where([data-row] *)), a[href], summary, [role=\"button\"]:not([data-slot=\"select-control\"]:where([data-row] *)), [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"], [role=\"option\"], [role=\"tab\"], :is([role=\"radio\"], [role=\"checkbox\"]):not(button, input), [data-row]'\n\ntype RippleHost = Element & ElementCSSInlineStyle\n\nlet installs = 0\nlet contents: Range | undefined\n\n/**\n * Android's start: a circle of 30% of the control's longer side round the touch, moved in so it stays inside the\n * end circle: the one round the control's center that reaches its corners, or a fixed one (`--android-ripple-radius`,\n * a borderless ripple of 20px) round the center of what the control shows, its symbol or label, which a row's 44px\n * target may hold at its end. A key starts it at the center. The points are offsets from that center, so a layer of\n * another size round it (a borderless circle, moved by --android-ripple-ox and -oy) draws them as well.\n */\nfunction press(host: RippleHost, clientX: number, clientY: number, centered: boolean) {\n // A press inside a control that drew one before ends that one, which :active would keep lit\n for (let held = host.parentElement?.closest(\"[data-ripple]\"); held; held = held.parentElement?.closest(\"[data-ripple]\")) {\n held.removeAttribute(\"data-ripple\")\n }\n host.removeAttribute(\"data-ripple\")\n // Reading the box applies the removal, so the attribute set below starts the animation again\n const box = host.getBoundingClientRect()\n const halfWidth = box.width / 2\n const halfHeight = box.height / 2\n let centerX = box.left + halfWidth\n let centerY = box.top + halfHeight\n const radius = parseFloat(getComputedStyle(host).getPropertyValue(\"--android-ripple-radius\"))\n if (radius > 0) {\n // What it shows: the contents of the wrapper it may hold alone (a Button's inner box), not that wrapper's box\n let shown: Element = host\n while (shown.childNodes.length === 1 && shown.firstChild instanceof Element && !(shown.firstChild instanceof SVGElement)) {\n shown = shown.firstChild\n }\n contents ??= document.createRange()\n contents.selectNodeContents(shown)\n const content = contents.getBoundingClientRect()\n if (content.width > 0 && content.height > 0) {\n centerX = content.left + content.width / 2\n centerY = content.top + content.height / 2\n }\n }\n const end = radius > 0 ? radius : Math.sqrt(halfWidth * halfWidth + halfHeight * halfHeight)\n const start = Math.min(Math.max(box.width, box.height) * 0.3, end)\n let dx = centered ? 0 : clientX - centerX\n let dy = centered ? 0 : clientY - centerY\n const distance = Math.sqrt(dx * dx + dy * dy)\n const limit = Math.max(end - start, 0)\n if (distance > limit) {\n dx *= limit / distance\n dy *= limit / distance\n }\n const style = host.style\n style.setProperty(\"--android-ripple-ox\", `${centerX - box.left - halfWidth}px`)\n style.setProperty(\"--android-ripple-oy\", `${centerY - box.top - halfHeight}px`)\n style.setProperty(\"--android-ripple-x\", `calc(50% + ${dx}px)`)\n style.setProperty(\"--android-ripple-y\", `calc(50% + ${dy}px)`)\n style.setProperty(\"--android-ripple-r0\", `${start}px`)\n style.setProperty(\"--android-ripple-r1\", `${end}px`)\n host.setAttribute(\"data-ripple\", \"\")\n}\n\nfunction onPointerDown(event: PointerEvent) {\n if (event.button !== 0 || !event.isPrimary || !(event.target instanceof Element)) return\n const host = event.target.closest(HOSTS) as RippleHost | null\n if (host) press(host, event.clientX, event.clientY, false)\n}\n\nfunction onKeyDown(event: KeyboardEvent) {\n if (event.repeat || (event.key !== \"Enter\" && event.key !== \" \")) return\n if (event.target instanceof Element && event.target.matches(HOSTS)) press(event.target as RippleHost, 0, 0, true)\n}\n\n/** Starts the ripple on the document; the returned function stops it once every caller has. */\nexport function installAndroidRipple(): () => void {\n if (installs++ === 0) {\n document.addEventListener(\"pointerdown\", onPointerDown, { capture: true, passive: true })\n document.addEventListener(\"keydown\", onKeyDown, { capture: true, passive: true })\n }\n let installed = true\n return () => {\n if (!installed) return\n installed = false\n if (--installs === 0) {\n document.removeEventListener(\"pointerdown\", onPointerDown, { capture: true })\n document.removeEventListener(\"keydown\", onKeyDown, { capture: true })\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/PlexUIProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA","sourcesContent":["export { PlexUIProvider } from \"./PlexUIProvider\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/PlexUIProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA","sourcesContent":["export { PlexUIProvider, type PlexUIPlatform } from \"./PlexUIProvider\"\n"]}