@plexui/ui 0.59.2 → 0.59.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Dialog/Dialog.js +4 -1
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +4 -1
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/lib/holdEnteringPresses.js +68 -0
- package/dist/es/lib/holdEnteringPresses.js.map +1 -0
- package/dist/types/lib/holdEnteringPresses.d.ts +11 -0
- package/package.json +1 -1
|
@@ -23,7 +23,10 @@ import { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING
|
|
|
23
23
|
import { PhoneLayoutContext, usePhoneLayout } from "../PhoneLayout/PhoneLayout.js";
|
|
24
24
|
import { usePopoverDismissableSurface } from "../Popover/deferredOutsidePress.js";
|
|
25
25
|
import s from "@plexui/styles/components/Dialog/Dialog.module.css";
|
|
26
|
+
import { HOLD_PRESSES_CLASS, holdEnteringPresses } from "../../lib/holdEnteringPresses.js";
|
|
26
27
|
import t from "@plexui/styles/components/Toolbar/Toolbar.module.css";
|
|
28
|
+
// Presses that start while a dialog or menu comes in are held, as on iOS (lib/holdEnteringPresses)
|
|
29
|
+
holdEnteringPresses();
|
|
27
30
|
const DOUBLE_CLICK = 300;
|
|
28
31
|
const DialogContext = createContext(null);
|
|
29
32
|
const useDialogContext = () => {
|
|
@@ -267,7 +270,7 @@ const Content = ({ children, width = 480, showClose = true, pill = false, classN
|
|
|
267
270
|
return () => { observer?.disconnect(); children.disconnect(); measureBars.current = () => { }; };
|
|
268
271
|
}, [panel]);
|
|
269
272
|
const layerStyle = toCssVariables({ "dialog-z-index": zIndex === undefined ? undefined : String(zIndex) });
|
|
270
|
-
return (_jsx(FloatingBoundaryProvider, { value: boundary, children: _jsx(PhoneLayoutContext, { value: phoneLayout, children: _jsx(RadixDialog.Portal, { forceMount: true, container: outerPhoneLayout?.container ?? undefined, children: _jsx(PhoneScope, { enabled: phoneLayout !== null && !outerPhoneLayout?.container, children: _jsx(TransitionGroup, { ...(crossesScreen ? overlayTimingLarge : overlayTiming), ...exitGuard.transition, className: s.Transition, overlay: true, preventInitialTransition: false, children: open && (_jsxs("div", { children: [_jsx(RadixDialog.Overlay, { ...overlayProps, ref: overlaySurfaceRef, className: clsx(s.Overlay, overlayProps?.className), style: { ...layerStyle, ...overlayProps?.style } }), _jsx(RadixDialog.Content, { ...dataAttributes(rest), ...rootProps, ref: setContent, forceMount: true, className: clsx(s.Content, rootProps?.className), "data-plex-dialog": "", style: { ...toCssVariables({ "dialog-width": width }), ...layerStyle, ...rootProps?.style }, "data-placement": placement === "center" ? undefined : placement, "data-mobile-placement": mobilePlacement, "data-mobile-variant": mobileVariant, "data-surface": surface, "data-pill": pill ? "" : undefined, onEscapeKeyDown: preventDefaultHandler, onInteractOutside: (event) => {
|
|
273
|
+
return (_jsx(FloatingBoundaryProvider, { value: boundary, children: _jsx(PhoneLayoutContext, { value: phoneLayout, children: _jsx(RadixDialog.Portal, { forceMount: true, container: outerPhoneLayout?.container ?? undefined, children: _jsx(PhoneScope, { enabled: phoneLayout !== null && !outerPhoneLayout?.container, children: _jsx(TransitionGroup, { ...(crossesScreen ? overlayTimingLarge : overlayTiming), ...exitGuard.transition, className: clsx(s.Transition, HOLD_PRESSES_CLASS), overlay: true, preventInitialTransition: false, children: open && (_jsxs("div", { children: [_jsx(RadixDialog.Overlay, { ...overlayProps, ref: overlaySurfaceRef, className: clsx(s.Overlay, overlayProps?.className), style: { ...layerStyle, ...overlayProps?.style } }), _jsx(RadixDialog.Content, { ...dataAttributes(rest), ...rootProps, ref: setContent, forceMount: true, className: clsx(s.Content, rootProps?.className), "data-plex-dialog": "", style: { ...toCssVariables({ "dialog-width": width }), ...layerStyle, ...rootProps?.style }, "data-placement": placement === "center" ? undefined : placement, "data-mobile-placement": mobilePlacement, "data-mobile-variant": mobileVariant, "data-surface": surface, "data-pill": pill ? "" : undefined, onEscapeKeyDown: preventDefaultHandler, onInteractOutside: (event) => {
|
|
271
274
|
// A press or focus in a toast is not outside: the toast region is a layer above the dialog. The
|
|
272
275
|
// Toaster stops these before Radix sees them; this holds when the Toaster mounted after the dialog.
|
|
273
276
|
if (inToastRegion(event.detail.originalEvent.target))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrI,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC5H,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,OA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K,CAAA;AACpB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Dialog as RadixDialog, Slot } from \"radix-ui\"\nimport {\n Children,\n cloneElement,\n createContext,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { inToastRegion } from \"../../lib/toastRegion\"\nimport { cancelableKeyCopy, dataAttributes, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { Button } from \"../Button\"\nimport { NavigationButton } from \"../Button/NavigationButton\"\nimport { Popover } from \"../Popover\"\nimport { followTitleRows } from \"../Page/Page\"\nimport { barBackground, Toolbar, ToolbarHostContext, type BarBackground, type BarBackgroundAlias, type ToolbarHost } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingLarge } from \"../Transition/shared\"\nimport { attachSheetDrag } from \"./sheetDrag\"\nimport { watchDialogViewport } from \"./dialogViewport\"\nimport { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING } from \"./dialogSteps\"\nimport { PhoneLayoutContext, usePhoneLayout, type PhoneLayoutValue } from \"../PhoneLayout/PhoneLayout\"\nimport { usePopoverDismissableSurface } from \"../Popover/deferredOutsidePress\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\ntype DialogContextValue = {\n open: boolean\n setOpen: (nextState: boolean) => void\n}\n\nconst DOUBLE_CLICK = 300\n\nconst DialogContext = createContext<DialogContextValue | null>(null)\n\nconst useDialogContext = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\nexport type DialogProps = {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n children: ReactNode\n}\n\nexport const Dialog = ({\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n children,\n}: DialogProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = controlledOpen ?? open\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n controlledOnOpenChange?.(nextState)\n setOpen(nextState)\n },\n [controlledOnOpenChange],\n )\n\n const store = useMemo<DialogContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <DialogContext value={store}>\n <RadixDialog.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </RadixDialog.Root>\n </DialogContext>\n )\n}\n\nconst Trigger = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Trigger asChild>{children}</RadixDialog.Trigger>\n}\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/**\n * A press or a focus outside the dialog, or a phone sheet pulled down to close; `event.detail.originalEvent` is the\n * browser's event (a TouchEvent for the sheet).\n */\nexport type DialogInteractOutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent | TouchEvent }>\n\n/**\n * What a dialog asks before it closes with unsaved changes: the question and its destructive answer. On a phone\n * Sheet it stands at the bar's Close as an iOS confirmation (a glass popover over the sheet, no dimming; a press\n * outside it keeps editing); elsewhere it is an alert with a second answer that keeps editing.\n */\nexport type DialogConfirmClose = {\n /** The question, such as \"Are you sure you want to discard this new note?\" */\n message: ReactNode\n /** A quieter line under the question, such as what a save left behind */\n detail?: ReactNode\n /** The answer that closes and loses the changes. @default \"Discard Changes\" */\n confirmLabel?: ReactNode\n /** The alert's answer that keeps the dialog open. @default \"Keep Editing\" */\n cancelLabel?: ReactNode\n}\n\n/**\n * `confirmClose` as a value, or as a function the dialog calls at each close attempt (Close, Dialog.Close, Escape, a\n * press outside, a sheet pulled down) before it decides: it returns the question, or nothing to close at once. An\n * owner that commits typed words only on blur commits them there, then compares.\n */\nexport type DialogConfirmCloseProp = DialogConfirmClose | (() => DialogConfirmClose | false | null | undefined) | false | null\n\n/** Class, style and data attributes for one of the dialog's layers. */\nexport type DialogLayerProps = {\n className?: string\n style?: CSSProperties\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nexport type DialogContentProps = {\n children: ReactNode\n width?: number | string\n showClose?: boolean\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n className?: string\n /**\n * Where the panel sits: centered, near the top (search, command lists),\n * a sheet along the bottom, a full-height panel on the start or end side,\n * or the whole screen.\n * @default center\n */\n placement?: DialogPlacement\n /**\n * Where a phone sheet stands at 767px and below: `bottom`, or `fullscreen` for the whole screen. `center` is the\n * alert's place: without `mobileVariant` it makes the dialog an alert. @default \"fullscreen\" for a fullscreen\n * dialog, else \"bottom\"\n */\n mobilePlacement?: Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">\n /**\n * The iOS presentation at 767px and below. A phone has two modal views: the sheet, which iOS gives any view it\n * presents, and the alert, a short question with its answers (UIAlertController). @default \"sheet\"\n */\n mobileVariant?: \"alert\" | \"sheet\"\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n /**\n * Called when focus moves into the dialog on open. Call\n * `event.preventDefault()` to focus something else yourself.\n */\n onOpenAutoFocus?: (event: Event) => void\n /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */\n onCloseAutoFocus?: (event: Event) => void\n /**\n * Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form\n * with unsaved changes.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /**\n * Called on a press or a focus outside the dialog, and on a phone sheet pulled down to close, before it closes. Call\n * `event.preventDefault()` to keep it open, such as for a form with unsaved changes (the sheet then returns, as an\n * iOS sheet does under `isModalInPresentation`), or for a press on a developer panel over the page.\n */\n onInteractOutside?: (event: DialogInteractOutsideEvent) => void\n /**\n * Asks before the dialog closes, as a form with unsaved changes does: Close, Escape, a press outside and a phone\n * sheet pulled down all ask first. Pass it while there are changes and leave it out (or `false`) when there are\n * none, or pass a function the dialog calls at each close attempt, returning the question or nothing to close at\n * once. Setting `open` to false yourself, such as after Save, closes at once.\n */\n confirmClose?: DialogConfirmCloseProp\n /** Stack order of the overlay and the dialog. @default 50 */\n zIndex?: number\n /** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */\n rootProps?: DialogLayerProps\n /** Class, style and data attributes for the overlay. */\n overlayProps?: DialogLayerProps\n /**\n * `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.\n * @default \"auto\"\n */\n layout?: \"auto\" | \"phone\"\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nconst Content = ({\n children,\n width = 480,\n showClose = true,\n pill = false,\n className,\n placement = \"center\",\n mobilePlacement: requestedMobilePlacement,\n mobileVariant: requestedMobileVariant,\n surface = \"plain\",\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onInteractOutside,\n confirmClose,\n zIndex,\n rootProps,\n overlayProps,\n layout = \"auto\",\n ...rest\n}: DialogContentProps) => {\n const { open, setOpen } = useDialogContext()\n const outerPhoneLayout = useContext(PhoneLayoutContext)\n // A dialog laid out as on a phone by its own prop, outside a PhoneLayout, keeps the window: what it holds and\n // the dialogs it opens are phone ones too.\n const phoneLayout = useMemo<PhoneLayoutValue | null>(\n () => outerPhoneLayout ?? (layout === \"phone\" ? { container: null } : null),\n [outerPhoneLayout, layout],\n )\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n useDialogViewport(content, outerPhoneLayout?.container ?? null)\n const overlaySurfaceRef = usePopoverDismissableSurface()\n // A phone has no other modal view than the sheet and the alert (owner 12.11: «нет такого в iOS»): a centered\n // dialog is an alert, any other a sheet, at the bottom or over the whole screen.\n const mobileVariant = requestedMobileVariant ?? (requestedMobilePlacement === \"center\" ? \"alert\" : \"sheet\")\n const mobilePlacement =\n mobileVariant === \"alert\"\n ? \"center\"\n : (requestedMobilePlacement ?? placement) === \"fullscreen\" ? \"fullscreen\" : \"bottom\"\n const [exitGuard] = useState(createExitGuard)\n const [panel, setPanel] = useState<HTMLDivElement | null>(null)\n // Dialog.Body reports where content lies under the bars: they show their lines with it.\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n // Dialog.Body tells the bars that follow the scroll, as a large title does, the body's scroll offset.\n const scrollListeners = useRef(new Set<(scrollTop: number) => void>())\n const notifyScroll = useCallback((scrollTop: number) => scrollListeners.current.forEach((listener) => listener(scrollTop)), [])\n const subscribeScroll = useCallback((listener: (scrollTop: number) => void) => {\n const listeners = scrollListeners.current\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n }, [])\n // A large Toolbar title lives at the top of Dialog.Body, where it scrolls with the body and goes under the bar, which\n // then shows it inline, as on a page; the body keeps a place for it while a title asks for one.\n const [largeTitleRequests, setLargeTitleRequests] = useState(0)\n const [largeTitleSlot, setLargeTitleSlot] = useState<HTMLDivElement | null>(null)\n const requestLargeTitleSlot = useCallback(() => {\n setLargeTitleRequests((count) => count + 1)\n return () => setLargeTitleRequests((count) => count - 1)\n }, [])\n const largeTitle = largeTitleRequests > 0\n // The title goes into the body only while there is one: without it the title stays in the bar, its rows with it.\n const [bodies, setBodies] = useState(0)\n const registerBody = useCallback(() => {\n setBodies((count) => count + 1)\n return () => setBodies((count) => count - 1)\n }, [])\n // The bar's rows under a large title stand under it in the body and pin under the bar, as on a page.\n const [largeTitleRowSlot, setLargeTitleRowSlot] = useState<HTMLDivElement | null>(null)\n const [titleRows, setTitleRowsState] = useState({ pinned: false, height: 0 })\n const setTitleRows = useCallback((pinned: boolean, height: number) => setTitleRowsState((current) => (current.pinned === pinned && current.height === height ? current : { pinned, height })), [])\n const scroll = useMemo(\n () => ({ edges, setEdges, notifyScroll, largeTitle, setLargeTitleSlot, setLargeTitleRowSlot, setTitleRows, registerBody }),\n [edges, setEdges, notifyScroll, largeTitle, setTitleRows, registerBody],\n )\n // The heights the bars report themselves: a Toolbar inside content of the app's own (a form) is not the panel's child.\n const barHeights = useRef<{ top?: number; bottom?: number }>({})\n const measureBars = useRef<() => void>(() => {})\n const setToolbarHeight = useCallback((placement: \"top\" | \"bottom\", height: number | undefined) => {\n barHeights.current[placement] = height\n measureBars.current()\n }, [])\n const toolbarHost = useMemo<ToolbarHost>(() => ({\n kind: \"dialog\",\n setHeight: setToolbarHeight,\n scrolled: edges.scrolled,\n contentBelow: edges.contentBelow,\n subscribeScroll,\n requestLargeTitleSlot,\n // Until the panel has mounted the body may not have told the dialog yet (it comes after the bar): the rows wait\n // for their place rather than mount in the bar first (Codex #69)\n holdsLargeTitle: bodies > 0 || !panel,\n largeTitleSlot: largeTitle ? largeTitleSlot : null,\n largeTitleRowSlot: largeTitle ? largeTitleRowSlot : null,\n rowsPinned: largeTitle && titleRows.pinned,\n }), [setToolbarHeight, edges, subscribeScroll, requestLargeTitleSlot, bodies, panel, largeTitle, largeTitleSlot, largeTitleRowSlot, titleRows.pinned])\n // The bar's background reaches under the pinned rows by their height, as on a page\n useLayoutEffect(() => {\n if (!panel) return\n if (titleRows.height > 0) panel.style.setProperty(\"--page-toolbar-rows-height\", `${titleRows.height}px`)\n else panel.style.removeProperty(\"--page-toolbar-rows-height\")\n }, [panel, titleRows.height])\n // Where a phone Sheet's description goes: the first text of the content, under the bar. Dialog.Body offers\n // its top; a Dialog.DescriptionSlot of the content's own, such as a scroller inside a form, comes first.\n const [bodySlot, setBodySlot] = useState<HTMLElement | null>(null)\n const [ownSlot, setOwnSlot] = useState<HTMLElement | null>(null)\n const descriptionSlot = ownSlot ?? bodySlot\n // A close asked for while there are changes waits for the answer (`confirmClose`); the ref answers at once for\n // the press that dismisses the question itself, so it does not ask again, nor does one just after it closed.\n const [confirming, setConfirmingState] = useState(false)\n const confirmingRef = useRef(false)\n const confirmClosedAt = useRef(0)\n const setConfirming = useCallback((next: boolean) => {\n if (confirmingRef.current && !next) confirmClosedAt.current = performance.now()\n confirmingRef.current = next\n setConfirmingState(next)\n }, [])\n useEffect(() => { if (!open || !confirmClose) setConfirming(false) }, [open, confirmClose, setConfirming])\n const [closeButton, setCloseButton] = useState<HTMLElement | null>(null)\n // Where focus returns when the question is dismissed: the field or button that asked to close\n const returnFocus = useRef<HTMLElement | null>(null)\n // The question a function `confirmClose` returned at the last close attempt\n const [asked, setAsked] = useState<DialogConfirmClose | null>(null)\n // Whether the dialog closed at once (no question to ask)\n const requestClose = useStableCallback((): boolean => {\n // A press on a dialog that is already leaving (closed from outside, its exit still on screen) asks nothing\n if (!open) return false\n if (!confirmClose) { setOpen(false); return true }\n // A press that dismissed the question (its pointer-down or click lands here too) keeps editing\n if (confirmingRef.current || performance.now() - confirmClosedAt.current < DOUBLE_CLICK) return false\n // A function decides at the attempt: the owner commits what is typed, then compares\n if (typeof confirmClose === \"function\") {\n const question = confirmClose()\n if (!question) { setOpen(false); return true }\n setAsked(question)\n }\n returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null\n setConfirming(true)\n return false\n })\n const question = typeof confirmClose === \"function\" ? asked : confirmClose || null\n // The answer that discards: the question leaves first, then the dialog, as iOS dismisses the confirmation before\n // the sheet. Together, the question would stand still over the sheet as it leaves: a closing dialog holds what\n // it shows, the transitions inside it too.\n const confirmTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n // A close from outside, or a new opening, ends a discard that is still waiting for the question to leave\n useEffect(() => () => clearTimeout(confirmTimer.current), [open])\n const confirmAndClose = useStableCallback(() => {\n setConfirming(false)\n clearTimeout(confirmTimer.current)\n confirmTimer.current = setTimeout(() => setOpen(false), overlayTiming.exitDuration)\n })\n const asksToClose = Boolean(confirmClose)\n const sheet = useMemo<DialogSheetValue | null>(\n () => (mobileVariant === \"sheet\"\n ? { showClose, descriptionSlot, setBodySlot, setOwnSlot, asksToClose, requestClose, setCloseButton }\n : null),\n [mobileVariant, showClose, descriptionSlot, asksToClose, requestClose],\n )\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const setPanelRef = useCallback((node: HTMLDivElement | null) => { setPanel(node); setRoot(node) }, [setRoot])\n const openedAt = useRef(0)\n // A sheet crosses the screen on a phone, and wherever its owner asked for one; a dialog left to its defaults stays\n // the centred panel on a desktop, with that panel's timing.\n const phone = usePhoneLayout() || layout === \"phone\"\n const sheetCrosses = (phone || requestedMobileVariant === \"sheet\" || requestedMobilePlacement !== undefined) &&\n (mobilePlacement === \"bottom\" || mobilePlacement === \"fullscreen\")\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || sheetCrosses\n\n // The content of a closing dialog is frozen for its exit, so this reads the owner's latest\n // handler: state that changes together with the close decides where focus returns.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n })\n\n useEscCloseStack(open, (event) => {\n if (onEscapeKeyDown) {\n const request = cancelableKeyCopy(event)\n onEscapeKeyDown(request)\n if (request.defaultPrevented) return\n }\n requestClose()\n })\n\n useEffect(() => {\n if (open) openedAt.current = performance.now()\n }, [open])\n\n // A sheet pulled down asks as a press outside does: an owner that keeps the dialog open on one, such as a form\n // with unsaved changes, keeps it on the other, and the sheet returns.\n const dismissByDrag = useStableCallback((originalEvent: TouchEvent) => {\n if (onInteractOutside) {\n const request: DialogInteractOutsideEvent = new CustomEvent(\"dialog.sheetDrag\", { cancelable: true, detail: { originalEvent } })\n onInteractOutside(request)\n if (request.defaultPrevented) return false\n }\n if (confirmClose) return requestClose()\n setOpen(false)\n return true\n })\n\n useEffect(() => {\n if (!panel || mobilePlacement !== \"bottom\") return undefined\n return attachSheetDrag(panel, dismissByDrag)\n }, [panel, mobilePlacement, dismissByDrag])\n\n useLayoutEffect(() => {\n if (!panel) return\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side: one the dialog places itself\n // before the bar its header becomes.\n const header = panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? panel.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = panel.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? panel.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n panel.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? barHeights.current.top ?? 0}px`)\n panel.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? barHeights.current.bottom ?? 0}px`)\n }\n measureBars.current = update\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n observer?.disconnect()\n panel.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => observer?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n // A form can add or remove its action bar while the dialog stays open.\n const children = new MutationObserver(observeBars)\n children.observe(panel, { childList: true })\n return () => { observer?.disconnect(); children.disconnect(); measureBars.current = () => {} }\n }, [panel])\n\n const layerStyle = toCssVariables({ \"dialog-z-index\": zIndex === undefined ? undefined : String(zIndex) })\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PhoneLayoutContext value={phoneLayout}>\n <RadixDialog.Portal forceMount container={outerPhoneLayout?.container ?? undefined}>\n {/* Portaled out of any phone layout, a phone dialog carries its own scope, above its transition: the phone\n rules of the style sheet start there. */}\n <PhoneScope enabled={phoneLayout !== null && !outerPhoneLayout?.container}>\n {/* A dialog mounted open enters too, as `open` set with the mount does */}\n <TransitionGroup\n {...(crossesScreen ? overlayTimingLarge : overlayTiming)}\n {...exitGuard.transition}\n className={s.Transition}\n overlay\n preventInitialTransition={false}\n >\n {open && (\n <div key=\"dialog\">\n <RadixDialog.Overlay\n {...overlayProps}\n ref={overlaySurfaceRef}\n className={clsx(s.Overlay, overlayProps?.className)}\n style={{ ...layerStyle, ...overlayProps?.style }}\n />\n <RadixDialog.Content\n {...dataAttributes(rest)}\n {...rootProps}\n ref={setContent}\n forceMount\n className={clsx(s.Content, rootProps?.className)}\n data-plex-dialog=\"\"\n style={{ ...toCssVariables({ \"dialog-width\": width }), ...layerStyle, ...rootProps?.style }}\n data-placement={placement === \"center\" ? undefined : placement}\n data-mobile-placement={mobilePlacement}\n data-mobile-variant={mobileVariant}\n data-surface={surface}\n data-pill={pill ? \"\" : undefined}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={(event) => {\n // A press or focus in a toast is not outside: the toast region is a layer above the dialog. The\n // Toaster stops these before Radix sees them; this holds when the Toaster mounted after the dialog.\n if (inToastRegion(event.detail.originalEvent.target)) return event.preventDefault()\n onInteractOutside?.(event)\n if (event.defaultPrevented) return\n // With changes a press outside asks first; one that dismisses the question keeps editing\n if (confirmClose) {\n event.preventDefault()\n // The second click of a double click that opened the dialog asks nothing, nor closes it (Codex #64)\n if (performance.now() - openedAt.current >= DOUBLE_CLICK) requestClose()\n return\n }\n // The second click of a double click lands on the overlay: it must not undo the first\n if (performance.now() - openedAt.current < DOUBLE_CLICK) event.preventDefault()\n else exitGuard.onInteractOutside(event)\n }}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n >\n <div ref={setPanelRef} className={clsx(s.Panel, className)}>\n {showClose && (confirmClose ? (\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" onClick={requestClose} />\n ) : (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n ))}\n <DialogRequestCloseContext.Provider value={confirmClose ? requestClose : null}>\n <DialogScrollContext.Provider value={scroll}>\n <DialogSheetContext.Provider value={sheet}>\n {/* A dialog opened from a header action is not inside that header's bar */}\n <DialogBarContext.Provider value={false}>\n <ToolbarHostContext.Provider value={toolbarHost}>{children}</ToolbarHostContext.Provider>\n </DialogBarContext.Provider>\n </DialogSheetContext.Provider>\n </DialogScrollContext.Provider>\n </DialogRequestCloseContext.Provider>\n {confirmClose && (\n <ConfirmClose\n {...(question ?? { message: null })}\n open={confirming}\n anchor={phone && mobileVariant === \"sheet\" ? closeButton : null}\n onOpenChange={setConfirming}\n returnFocus={returnFocus}\n onConfirm={confirmAndClose}\n zIndex={zIndex}\n />\n )}\n </div>\n </RadixDialog.Content>\n </div>\n )}\n </TransitionGroup>\n </PhoneScope>\n </RadixDialog.Portal>\n </PhoneLayoutContext>\n </FloatingBoundaryProvider>\n )\n}\n\ntype DialogScrollValue = {\n edges: ScrollEdges\n setEdges: (edges: ScrollEdges) => void\n notifyScroll: (scrollTop: number) => void\n /** A large Toolbar title asks for a place at the top of the body. */\n largeTitle: boolean\n setLargeTitleSlot: (slot: HTMLDivElement | null) => void\n /** The place of the bar's rows under a large title. */\n setLargeTitleRowSlot: (slot: HTMLDivElement | null) => void\n setTitleRows: (pinned: boolean, height: number) => void\n /** A body tells the dialog it is there; returns the release. */\n registerBody: () => () => void\n}\nconst DialogScrollContext = createContext<DialogScrollValue | null>(null)\n// What the header of a Sheet needs from its Content to become the Sheet's bar on a phone\ntype DialogSheetValue = {\n showClose: boolean\n descriptionSlot: HTMLElement | null\n setBodySlot: (slot: HTMLElement | null) => void\n setOwnSlot: (slot: HTMLElement | null) => void\n /** The bar's Close asks first (`confirmClose`) */\n asksToClose: boolean\n requestClose: () => boolean | void\n setCloseButton: (button: HTMLElement | null) => void\n}\nconst DialogSheetContext = createContext<DialogSheetValue | null>(null)\n// A close that asks first (`confirmClose`): Dialog.Close inside the content asks as the Close button does\nconst DialogRequestCloseContext = createContext<(() => boolean | void) | null>(null)\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DialogBarContext = createContext(false)\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\nconst useDialogViewport = (content: HTMLElement | null, container: HTMLElement | null) => {\n useLayoutEffect(() => (content ? watchDialogViewport(content, container) : undefined), [content, container])\n}\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\ntype DialogSlotProps = {\n children: ReactNode\n className?: string\n}\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground | BarBackgroundAlias\nexport type DialogHeaderProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"glass\" */\n background?: DialogBarBackground\n}\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar. A part from a\n// fragment keeps the fragment's key before its own, so two parts never share a key.\nconst headerParts = (children: ReactNode, prefix = \"\"): ReactNode[] =>\n Children.toArray(children).flatMap((part) => {\n if (!isValidElement<{ children?: ReactNode }>(part)) return [part]\n if (part.type === Fragment) return headerParts(part.props.children, `${prefix}${String(part.key)}/`)\n return [prefix ? cloneElement(part, { key: `${prefix}${String(part.key)}` }) : part]\n })\nconst isHeaderAction = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === HeaderAction\nconst isLeadingAction = (part: ReactNode): part is ReactElement<DialogHeaderActionProps> =>\n isHeaderAction(part) && (part.props as DialogHeaderActionProps).side === \"leading\"\nconst isDescription = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Description\n// A Toolbar.Row in the header is a row of the phone Sheet's bar, under its controls (console 15.11)\nconst isToolbarRow = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Toolbar.Row\n\nconst Header = ({ children, className, background = \"glass\" }: DialogHeaderProps) => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const scrolled = useContext(DialogScrollContext)?.edges.scrolled\n if (sheet && phone) {\n const parts = headerParts(children)\n const descriptions = parts.filter(isDescription)\n // The description reads as the first text of the content, at the top of Dialog.Body when there is one\n const description = descriptions.length > 0 && <div className={s.SheetDescription}>{descriptions}</div>\n // On a phone the header of a Sheet is its Toolbar (iOS 27 kit Sheets 507-24684, Toolbar - Top - iPhone\n // 1-54520): Close at the leading edge, the title alone centered on the row of controls, the header actions\n // at the trailing edge, all on one 44px row 16px under the top edge; a Toolbar.Row stands under that row.\n return (\n <>\n <Toolbar background={background} className={className} data-dialog-bar=\"\">\n <DialogBarContext.Provider value={true}>\n {/* A step's Back takes the leading place, as the back button of a screen pushed inside an iOS sheet */}\n {sheet.showClose && !parts.some(isLeadingAction) && (\n <Toolbar.Leading className={s.BarClose}>\n {sheet.asksToClose ? (\n <NavigationButton ref={sheet.setCloseButton} action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" onClick={sheet.requestClose} />\n ) : (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n )}\n </Toolbar.Leading>\n )}\n {parts.filter(isLeadingAction)}\n <div className={clsx(t.Heading, s.BarHeading)}>{parts.filter((part) => !isHeaderAction(part) && !isDescription(part) && !isToolbarRow(part))}</div>\n {parts.filter((part) => isHeaderAction(part) && !isLeadingAction(part))}\n {/* Rows stand under the controls, as in a Toolbar built by hand: the bar's glass, edge and row gap */}\n <Fragment key=\"toolbar-rows\">{parts.filter(isToolbarRow)}</Fragment>\n </DialogBarContext.Provider>\n </Toolbar>\n {description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)}\n </>\n )\n }\n return <div className={clsx(s.Header, className)} data-background={barBackground(background)} data-scrolled={scrolled ? \"\" : undefined}>{children}</div>\n}\n\nexport type DialogHeaderActionProps = DialogSlotProps & {\n /**\n * `leading` puts the action before the title, such as the Back of a step in `Dialog.Steps`: on a phone Sheet it\n * takes the place of Close, as the back button of a screen pushed inside an iOS sheet does.\n * @default \"trailing\"\n */\n side?: \"leading\" | \"trailing\"\n}\n\nconst HeaderAction = ({ children, className, side = \"trailing\" }: DialogHeaderActionProps) => {\n const bar = useContext(DialogBarContext)\n if (bar && side === \"leading\") return <Toolbar.Leading className={clsx(s.BarClose, className)}>{children}</Toolbar.Leading>\n if (bar) return <Toolbar.Trailing className={className}>{children}</Toolbar.Trailing>\n return <div className={clsx(s.HeaderAction, className)} data-side={side === \"leading\" ? \"leading\" : undefined}>{children}</div>\n}\n\n/** The scrolling part between Header and Footer: with it, only the body scrolls */\nconst Body = ({ children, className }: DialogSlotProps) => {\n const scroll = useContext(DialogScrollContext)\n const setEdges = scroll?.setEdges\n const notifyScroll = scroll?.notifyScroll\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet's description starts the body (Dialog.Header portals it here)\n const setDescriptionSlot = sheet && phone ? sheet.setBodySlot : null\n const element = useRef<HTMLDivElement | null>(null)\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !setEdges) return\n const stop = observeScrollEdges(body, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n const registerBody = scroll?.registerBody\n useLayoutEffect(() => registerBody?.(), [registerBody])\n const [rowSlot, setRowSlot] = useState<HTMLDivElement | null>(null)\n const setTitleRows = scroll?.setTitleRows\n const setLargeTitleRowSlot = scroll?.setLargeTitleRowSlot\n const setRows = useCallback((node: HTMLDivElement | null) => { setRowSlot(node); setLargeTitleRowSlot?.(node) }, [setLargeTitleRowSlot])\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !rowSlot || !setTitleRows) return\n return followTitleRows(body, rowSlot, setTitleRows)\n }, [rowSlot, setTitleRows])\n return (\n <div ref={element} className={clsx(s.Body, className)} onScroll={notifyScroll ? (event) => notifyScroll(event.currentTarget.scrollTop) : undefined}>\n {/* A large Toolbar title starts the body and scrolls with it; the description comes under it */}\n {scroll?.largeTitle && <div ref={scroll.setLargeTitleSlot} className={s.LargeTitle} />}\n {scroll?.largeTitle && <div ref={setRows} className={s.LargeTitleRows} />}\n {setDescriptionSlot && <div ref={setDescriptionSlot} className={s.SheetDescriptionSlot} />}\n {children}\n </div>\n )\n}\n\n/**\n * Where a phone Sheet's description goes in content of your own, such as a scroller inside a form so that Enter\n * submits: the description starts it, as it starts Dialog.Body, and it comes before the body's place. It renders\n * nothing outside a phone Sheet.\n */\nconst DescriptionSlot = () => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const setOwnSlot = sheet && phone ? sheet.setOwnSlot : null\n return setOwnSlot ? <div ref={setOwnSlot} className={s.SheetDescriptionSlot} /> : null\n}\n\nexport type DialogFooterProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background?: DialogBarBackground\n /** Override the mobile action layout. Two alert actions default to inline, three or more and sheets to stacked. */\n mobileLayout?: \"inline\" | \"stacked\"\n}\n\nconst Footer = ({ children, className, mobileLayout, background = \"soft\" }: DialogFooterProps) => {\n const setFooter = useFloatingBoundaryRegistration()?.setFooter\n const contentBelow = useContext(DialogScrollContext)?.edges.contentBelow\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet stacks its main action on top, as an iOS setup sheet does. A footer is written with it last,\n // where a desktop row ends, so the order is turned in the page itself: focus and a screen reader meet the\n // actions in the order they are seen.\n const parts = sheet && phone && mobileLayout !== \"inline\" ? headerParts(children).reverse() : children\n return (\n <div\n ref={setFooter}\n className={clsx(s.Footer, className)}\n data-mobile-layout={mobileLayout}\n data-background={barBackground(background)}\n data-content-below={contentBelow ? \"\" : undefined}\n >\n {parts}\n </div>\n )\n}\n\nconst Title = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n return <RadixDialog.Title className={clsx(bar ? t.Title : s.Title, className)}>{children}</RadixDialog.Title>\n}\n\nconst Description = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n const element = useRef<HTMLParagraphElement | null>(null)\n const [shown, setShown] = useState(false)\n useLayoutEffect(() => {\n // The header leaves its own descriptions out of the bar. One the bar still holds, inside a part of the\n // header's own, is the title's second line (Toolbar's subtitle) when the reader sees it; one that is only\n // read out, visually hidden, leaves the title on its one line.\n const node = element.current\n // A measurement of the laid-out description, which only an effect after layout can read\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setShown(bar && !!node && node.offsetHeight > 1 && node.offsetWidth > 1)\n }, [bar, children, className])\n return (\n <RadixDialog.Description ref={element} className={clsx(bar && shown ? t.Subtitle : s.Description, className)}>\n {children}\n </RadixDialog.Description>\n )\n}\n\nexport type DialogStepsProps = {\n /** The step on screen. A new value brings its content in. */\n step: string | number\n /**\n * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to\n * a step before it.\n * @default \"forward\"\n */\n direction?: \"forward\" | \"back\"\n children: ReactNode\n className?: string\n}\n\n/** The steps of a flow inside a dialog, such as a sign-in that asks for an email and then a code. */\nconst Steps = ({ step, direction = \"forward\", children, className }: DialogStepsProps) => (\n <div className={clsx(s.Steps, className)} data-direction={direction}>\n <TransitionGroup {...STEP_TIMING} as=\"div\" overlay className={s.Step} onEnter={enterStep} onExit={leaveStep} onExitActive={settleStepHeight} onExitComplete={releaseStepHeight}>\n <div key={step} data-dialog-step=\"\" tabIndex={-1}>{children}</div>\n </TransitionGroup>\n </div>\n)\n\ntype ConfirmCloseProps = DialogConfirmClose & {\n open: boolean\n /** The phone Sheet's Close: the question stands at it. Without one it is an alert. */\n anchor: HTMLElement | null\n onOpenChange: (open: boolean) => void\n onConfirm: () => void\n returnFocus: { current: HTMLElement | null }\n /** The owner dialog's stack order: the question stands over it */\n zIndex?: number\n}\n\n// iOS asks at the button that closes (a confirmation dialog presented from the sheet's Close on iOS 27: a glass\n// popover under it, no dimming, the question in 17 regular over a full-width destructive pill); with no such button,\n// and on a desktop, the question is an alert.\nconst ConfirmClose = ({\n message,\n detail,\n confirmLabel = \"Discard Changes\",\n cancelLabel = \"Keep Editing\",\n open,\n anchor,\n onOpenChange,\n onConfirm,\n returnFocus,\n zIndex,\n}: ConfirmCloseProps) => {\n const messageId = useId()\n if (anchor) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <Popover.Anchor element={anchor} />\n {/* Over the Close, its corner 6 before the button's, as the native confirmation grows out of it. Its height is\n read only while the question is open: a read on every render of the sheet forced a layout */}\n <Popover.Content side=\"bottom\" align=\"start\" sideOffset={open ? -anchor.offsetHeight : 0} alignOffset={-6} collisionPadding={10} width={240} minWidth={240} zIndex={zIndex} aria-labelledby={messageId} className={s.ConfirmClose} data-dialog-confirm-close=\"\">\n <p id={messageId} className={s.ConfirmCloseMessage}>{message}</p>\n {detail != null && detail !== false && <p className={s.ConfirmCloseDetail}>{detail}</p>}\n <Button block pill color=\"danger\" variant=\"soft\" className={s.ConfirmCloseAction} onClick={onConfirm}>{confirmLabel}</Button>\n </Popover.Content>\n </Popover>\n )\n }\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Content\n mobileVariant=\"alert\"\n surface=\"plain\"\n width={360}\n showClose={false}\n zIndex={zIndex}\n data-dialog-confirm-close=\"\"\n onCloseAutoFocus={(event) => {\n const target = returnFocus.current\n if (target?.isConnected) {\n event.preventDefault()\n target.focus({ preventScroll: true })\n }\n }}\n >\n {/* The question names the alert, as an alert's title does */}\n <Header>\n <Title>{message}</Title>\n {detail != null && detail !== false && <Description>{detail}</Description>}\n </Header>\n <Footer>\n <Close><Button color=\"secondary\" variant=\"soft\">{cancelLabel}</Button></Close>\n <Button color=\"danger\" onClick={onConfirm}>{confirmLabel}</Button>\n </Footer>\n </Content>\n </Dialog>\n )\n}\n\nconst Close = ({ children }: { children: ReactNode }) => {\n const requestClose = useContext(DialogRequestCloseContext)\n // A button that does not submit the form around it, and a child that prevented its click keeps the dialog, as\n // Radix's Close does\n if (requestClose) {\n return (\n <Slot.Root {...{ type: \"button\" }} onClick={(event: { defaultPrevented: boolean }) => { if (!event.defaultPrevented) requestClose() }}>\n {children}\n </Slot.Root>\n )\n }\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>\n}\n\nDialog.Trigger = Trigger\nDialog.Content = Content\nDialog.Header = Header\nDialog.HeaderAction = HeaderAction\nDialog.Body = Body\nDialog.Footer = Footer\nDialog.Title = Title\nDialog.Description = Description\nDialog.DescriptionSlot = DescriptionSlot\nDialog.Close = Close\nDialog.Steps = Steps\n"]}
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrI,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC5H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AAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;AAClC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;AAClB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;AAChC,MAAM,CAAC,eAAe,GAAG,eAAe,CAAA;AACxC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Dialog as RadixDialog, Slot } from \"radix-ui\"\nimport {\n Children,\n cloneElement,\n createContext,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { inToastRegion } from \"../../lib/toastRegion\"\nimport { cancelableKeyCopy, dataAttributes, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { Button } from \"../Button\"\nimport { NavigationButton } from \"../Button/NavigationButton\"\nimport { Popover } from \"../Popover\"\nimport { followTitleRows } from \"../Page/Page\"\nimport { barBackground, Toolbar, ToolbarHostContext, type BarBackground, type BarBackgroundAlias, type ToolbarHost } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingLarge } from \"../Transition/shared\"\nimport { attachSheetDrag } from \"./sheetDrag\"\nimport { watchDialogViewport } from \"./dialogViewport\"\nimport { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING } from \"./dialogSteps\"\nimport { PhoneLayoutContext, usePhoneLayout, type PhoneLayoutValue } from \"../PhoneLayout/PhoneLayout\"\nimport { usePopoverDismissableSurface } from \"../Popover/deferredOutsidePress\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport { HOLD_PRESSES_CLASS, holdEnteringPresses } from \"../../lib/holdEnteringPresses\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\n// Presses that start while a dialog or menu comes in are held, as on iOS (lib/holdEnteringPresses)\nholdEnteringPresses()\n\ntype DialogContextValue = {\n open: boolean\n setOpen: (nextState: boolean) => void\n}\n\nconst DOUBLE_CLICK = 300\n\nconst DialogContext = createContext<DialogContextValue | null>(null)\n\nconst useDialogContext = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\nexport type DialogProps = {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n children: ReactNode\n}\n\nexport const Dialog = ({\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n children,\n}: DialogProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = controlledOpen ?? open\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n controlledOnOpenChange?.(nextState)\n setOpen(nextState)\n },\n [controlledOnOpenChange],\n )\n\n const store = useMemo<DialogContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <DialogContext value={store}>\n <RadixDialog.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </RadixDialog.Root>\n </DialogContext>\n )\n}\n\nconst Trigger = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Trigger asChild>{children}</RadixDialog.Trigger>\n}\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/**\n * A press or a focus outside the dialog, or a phone sheet pulled down to close; `event.detail.originalEvent` is the\n * browser's event (a TouchEvent for the sheet).\n */\nexport type DialogInteractOutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent | TouchEvent }>\n\n/**\n * What a dialog asks before it closes with unsaved changes: the question and its destructive answer. On a phone\n * Sheet it stands at the bar's Close as an iOS confirmation (a glass popover over the sheet, no dimming; a press\n * outside it keeps editing); elsewhere it is an alert with a second answer that keeps editing.\n */\nexport type DialogConfirmClose = {\n /** The question, such as \"Are you sure you want to discard this new note?\" */\n message: ReactNode\n /** A quieter line under the question, such as what a save left behind */\n detail?: ReactNode\n /** The answer that closes and loses the changes. @default \"Discard Changes\" */\n confirmLabel?: ReactNode\n /** The alert's answer that keeps the dialog open. @default \"Keep Editing\" */\n cancelLabel?: ReactNode\n}\n\n/**\n * `confirmClose` as a value, or as a function the dialog calls at each close attempt (Close, Dialog.Close, Escape, a\n * press outside, a sheet pulled down) before it decides: it returns the question, or nothing to close at once. An\n * owner that commits typed words only on blur commits them there, then compares.\n */\nexport type DialogConfirmCloseProp = DialogConfirmClose | (() => DialogConfirmClose | false | null | undefined) | false | null\n\n/** Class, style and data attributes for one of the dialog's layers. */\nexport type DialogLayerProps = {\n className?: string\n style?: CSSProperties\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nexport type DialogContentProps = {\n children: ReactNode\n width?: number | string\n showClose?: boolean\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n className?: string\n /**\n * Where the panel sits: centered, near the top (search, command lists),\n * a sheet along the bottom, a full-height panel on the start or end side,\n * or the whole screen.\n * @default center\n */\n placement?: DialogPlacement\n /**\n * Where a phone sheet stands at 767px and below: `bottom`, or `fullscreen` for the whole screen. `center` is the\n * alert's place: without `mobileVariant` it makes the dialog an alert. @default \"fullscreen\" for a fullscreen\n * dialog, else \"bottom\"\n */\n mobilePlacement?: Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">\n /**\n * The iOS presentation at 767px and below. A phone has two modal views: the sheet, which iOS gives any view it\n * presents, and the alert, a short question with its answers (UIAlertController). @default \"sheet\"\n */\n mobileVariant?: \"alert\" | \"sheet\"\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n /**\n * Called when focus moves into the dialog on open. Call\n * `event.preventDefault()` to focus something else yourself.\n */\n onOpenAutoFocus?: (event: Event) => void\n /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */\n onCloseAutoFocus?: (event: Event) => void\n /**\n * Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form\n * with unsaved changes.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /**\n * Called on a press or a focus outside the dialog, and on a phone sheet pulled down to close, before it closes. Call\n * `event.preventDefault()` to keep it open, such as for a form with unsaved changes (the sheet then returns, as an\n * iOS sheet does under `isModalInPresentation`), or for a press on a developer panel over the page.\n */\n onInteractOutside?: (event: DialogInteractOutsideEvent) => void\n /**\n * Asks before the dialog closes, as a form with unsaved changes does: Close, Escape, a press outside and a phone\n * sheet pulled down all ask first. Pass it while there are changes and leave it out (or `false`) when there are\n * none, or pass a function the dialog calls at each close attempt, returning the question or nothing to close at\n * once. Setting `open` to false yourself, such as after Save, closes at once.\n */\n confirmClose?: DialogConfirmCloseProp\n /** Stack order of the overlay and the dialog. @default 50 */\n zIndex?: number\n /** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */\n rootProps?: DialogLayerProps\n /** Class, style and data attributes for the overlay. */\n overlayProps?: DialogLayerProps\n /**\n * `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.\n * @default \"auto\"\n */\n layout?: \"auto\" | \"phone\"\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nconst Content = ({\n children,\n width = 480,\n showClose = true,\n pill = false,\n className,\n placement = \"center\",\n mobilePlacement: requestedMobilePlacement,\n mobileVariant: requestedMobileVariant,\n surface = \"plain\",\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onInteractOutside,\n confirmClose,\n zIndex,\n rootProps,\n overlayProps,\n layout = \"auto\",\n ...rest\n}: DialogContentProps) => {\n const { open, setOpen } = useDialogContext()\n const outerPhoneLayout = useContext(PhoneLayoutContext)\n // A dialog laid out as on a phone by its own prop, outside a PhoneLayout, keeps the window: what it holds and\n // the dialogs it opens are phone ones too.\n const phoneLayout = useMemo<PhoneLayoutValue | null>(\n () => outerPhoneLayout ?? (layout === \"phone\" ? { container: null } : null),\n [outerPhoneLayout, layout],\n )\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n useDialogViewport(content, outerPhoneLayout?.container ?? null)\n const overlaySurfaceRef = usePopoverDismissableSurface()\n // A phone has no other modal view than the sheet and the alert (owner 12.11: «нет такого в iOS»): a centered\n // dialog is an alert, any other a sheet, at the bottom or over the whole screen.\n const mobileVariant = requestedMobileVariant ?? (requestedMobilePlacement === \"center\" ? \"alert\" : \"sheet\")\n const mobilePlacement =\n mobileVariant === \"alert\"\n ? \"center\"\n : (requestedMobilePlacement ?? placement) === \"fullscreen\" ? \"fullscreen\" : \"bottom\"\n const [exitGuard] = useState(createExitGuard)\n const [panel, setPanel] = useState<HTMLDivElement | null>(null)\n // Dialog.Body reports where content lies under the bars: they show their lines with it.\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n // Dialog.Body tells the bars that follow the scroll, as a large title does, the body's scroll offset.\n const scrollListeners = useRef(new Set<(scrollTop: number) => void>())\n const notifyScroll = useCallback((scrollTop: number) => scrollListeners.current.forEach((listener) => listener(scrollTop)), [])\n const subscribeScroll = useCallback((listener: (scrollTop: number) => void) => {\n const listeners = scrollListeners.current\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n }, [])\n // A large Toolbar title lives at the top of Dialog.Body, where it scrolls with the body and goes under the bar, which\n // then shows it inline, as on a page; the body keeps a place for it while a title asks for one.\n const [largeTitleRequests, setLargeTitleRequests] = useState(0)\n const [largeTitleSlot, setLargeTitleSlot] = useState<HTMLDivElement | null>(null)\n const requestLargeTitleSlot = useCallback(() => {\n setLargeTitleRequests((count) => count + 1)\n return () => setLargeTitleRequests((count) => count - 1)\n }, [])\n const largeTitle = largeTitleRequests > 0\n // The title goes into the body only while there is one: without it the title stays in the bar, its rows with it.\n const [bodies, setBodies] = useState(0)\n const registerBody = useCallback(() => {\n setBodies((count) => count + 1)\n return () => setBodies((count) => count - 1)\n }, [])\n // The bar's rows under a large title stand under it in the body and pin under the bar, as on a page.\n const [largeTitleRowSlot, setLargeTitleRowSlot] = useState<HTMLDivElement | null>(null)\n const [titleRows, setTitleRowsState] = useState({ pinned: false, height: 0 })\n const setTitleRows = useCallback((pinned: boolean, height: number) => setTitleRowsState((current) => (current.pinned === pinned && current.height === height ? current : { pinned, height })), [])\n const scroll = useMemo(\n () => ({ edges, setEdges, notifyScroll, largeTitle, setLargeTitleSlot, setLargeTitleRowSlot, setTitleRows, registerBody }),\n [edges, setEdges, notifyScroll, largeTitle, setTitleRows, registerBody],\n )\n // The heights the bars report themselves: a Toolbar inside content of the app's own (a form) is not the panel's child.\n const barHeights = useRef<{ top?: number; bottom?: number }>({})\n const measureBars = useRef<() => void>(() => {})\n const setToolbarHeight = useCallback((placement: \"top\" | \"bottom\", height: number | undefined) => {\n barHeights.current[placement] = height\n measureBars.current()\n }, [])\n const toolbarHost = useMemo<ToolbarHost>(() => ({\n kind: \"dialog\",\n setHeight: setToolbarHeight,\n scrolled: edges.scrolled,\n contentBelow: edges.contentBelow,\n subscribeScroll,\n requestLargeTitleSlot,\n // Until the panel has mounted the body may not have told the dialog yet (it comes after the bar): the rows wait\n // for their place rather than mount in the bar first (Codex #69)\n holdsLargeTitle: bodies > 0 || !panel,\n largeTitleSlot: largeTitle ? largeTitleSlot : null,\n largeTitleRowSlot: largeTitle ? largeTitleRowSlot : null,\n rowsPinned: largeTitle && titleRows.pinned,\n }), [setToolbarHeight, edges, subscribeScroll, requestLargeTitleSlot, bodies, panel, largeTitle, largeTitleSlot, largeTitleRowSlot, titleRows.pinned])\n // The bar's background reaches under the pinned rows by their height, as on a page\n useLayoutEffect(() => {\n if (!panel) return\n if (titleRows.height > 0) panel.style.setProperty(\"--page-toolbar-rows-height\", `${titleRows.height}px`)\n else panel.style.removeProperty(\"--page-toolbar-rows-height\")\n }, [panel, titleRows.height])\n // Where a phone Sheet's description goes: the first text of the content, under the bar. Dialog.Body offers\n // its top; a Dialog.DescriptionSlot of the content's own, such as a scroller inside a form, comes first.\n const [bodySlot, setBodySlot] = useState<HTMLElement | null>(null)\n const [ownSlot, setOwnSlot] = useState<HTMLElement | null>(null)\n const descriptionSlot = ownSlot ?? bodySlot\n // A close asked for while there are changes waits for the answer (`confirmClose`); the ref answers at once for\n // the press that dismisses the question itself, so it does not ask again, nor does one just after it closed.\n const [confirming, setConfirmingState] = useState(false)\n const confirmingRef = useRef(false)\n const confirmClosedAt = useRef(0)\n const setConfirming = useCallback((next: boolean) => {\n if (confirmingRef.current && !next) confirmClosedAt.current = performance.now()\n confirmingRef.current = next\n setConfirmingState(next)\n }, [])\n useEffect(() => { if (!open || !confirmClose) setConfirming(false) }, [open, confirmClose, setConfirming])\n const [closeButton, setCloseButton] = useState<HTMLElement | null>(null)\n // Where focus returns when the question is dismissed: the field or button that asked to close\n const returnFocus = useRef<HTMLElement | null>(null)\n // The question a function `confirmClose` returned at the last close attempt\n const [asked, setAsked] = useState<DialogConfirmClose | null>(null)\n // Whether the dialog closed at once (no question to ask)\n const requestClose = useStableCallback((): boolean => {\n // A press on a dialog that is already leaving (closed from outside, its exit still on screen) asks nothing\n if (!open) return false\n if (!confirmClose) { setOpen(false); return true }\n // A press that dismissed the question (its pointer-down or click lands here too) keeps editing\n if (confirmingRef.current || performance.now() - confirmClosedAt.current < DOUBLE_CLICK) return false\n // A function decides at the attempt: the owner commits what is typed, then compares\n if (typeof confirmClose === \"function\") {\n const question = confirmClose()\n if (!question) { setOpen(false); return true }\n setAsked(question)\n }\n returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null\n setConfirming(true)\n return false\n })\n const question = typeof confirmClose === \"function\" ? asked : confirmClose || null\n // The answer that discards: the question leaves first, then the dialog, as iOS dismisses the confirmation before\n // the sheet. Together, the question would stand still over the sheet as it leaves: a closing dialog holds what\n // it shows, the transitions inside it too.\n const confirmTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n // A close from outside, or a new opening, ends a discard that is still waiting for the question to leave\n useEffect(() => () => clearTimeout(confirmTimer.current), [open])\n const confirmAndClose = useStableCallback(() => {\n setConfirming(false)\n clearTimeout(confirmTimer.current)\n confirmTimer.current = setTimeout(() => setOpen(false), overlayTiming.exitDuration)\n })\n const asksToClose = Boolean(confirmClose)\n const sheet = useMemo<DialogSheetValue | null>(\n () => (mobileVariant === \"sheet\"\n ? { showClose, descriptionSlot, setBodySlot, setOwnSlot, asksToClose, requestClose, setCloseButton }\n : null),\n [mobileVariant, showClose, descriptionSlot, asksToClose, requestClose],\n )\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const setPanelRef = useCallback((node: HTMLDivElement | null) => { setPanel(node); setRoot(node) }, [setRoot])\n const openedAt = useRef(0)\n // A sheet crosses the screen on a phone, and wherever its owner asked for one; a dialog left to its defaults stays\n // the centred panel on a desktop, with that panel's timing.\n const phone = usePhoneLayout() || layout === \"phone\"\n const sheetCrosses = (phone || requestedMobileVariant === \"sheet\" || requestedMobilePlacement !== undefined) &&\n (mobilePlacement === \"bottom\" || mobilePlacement === \"fullscreen\")\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || sheetCrosses\n\n // The content of a closing dialog is frozen for its exit, so this reads the owner's latest\n // handler: state that changes together with the close decides where focus returns.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n })\n\n useEscCloseStack(open, (event) => {\n if (onEscapeKeyDown) {\n const request = cancelableKeyCopy(event)\n onEscapeKeyDown(request)\n if (request.defaultPrevented) return\n }\n requestClose()\n })\n\n useEffect(() => {\n if (open) openedAt.current = performance.now()\n }, [open])\n\n // A sheet pulled down asks as a press outside does: an owner that keeps the dialog open on one, such as a form\n // with unsaved changes, keeps it on the other, and the sheet returns.\n const dismissByDrag = useStableCallback((originalEvent: TouchEvent) => {\n if (onInteractOutside) {\n const request: DialogInteractOutsideEvent = new CustomEvent(\"dialog.sheetDrag\", { cancelable: true, detail: { originalEvent } })\n onInteractOutside(request)\n if (request.defaultPrevented) return false\n }\n if (confirmClose) return requestClose()\n setOpen(false)\n return true\n })\n\n useEffect(() => {\n if (!panel || mobilePlacement !== \"bottom\") return undefined\n return attachSheetDrag(panel, dismissByDrag)\n }, [panel, mobilePlacement, dismissByDrag])\n\n useLayoutEffect(() => {\n if (!panel) return\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side: one the dialog places itself\n // before the bar its header becomes.\n const header = panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? panel.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = panel.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? panel.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n panel.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? barHeights.current.top ?? 0}px`)\n panel.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? barHeights.current.bottom ?? 0}px`)\n }\n measureBars.current = update\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n observer?.disconnect()\n panel.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => observer?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n // A form can add or remove its action bar while the dialog stays open.\n const children = new MutationObserver(observeBars)\n children.observe(panel, { childList: true })\n return () => { observer?.disconnect(); children.disconnect(); measureBars.current = () => {} }\n }, [panel])\n\n const layerStyle = toCssVariables({ \"dialog-z-index\": zIndex === undefined ? undefined : String(zIndex) })\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PhoneLayoutContext value={phoneLayout}>\n <RadixDialog.Portal forceMount container={outerPhoneLayout?.container ?? undefined}>\n {/* Portaled out of any phone layout, a phone dialog carries its own scope, above its transition: the phone\n rules of the style sheet start there. */}\n <PhoneScope enabled={phoneLayout !== null && !outerPhoneLayout?.container}>\n {/* A dialog mounted open enters too, as `open` set with the mount does */}\n <TransitionGroup\n {...(crossesScreen ? overlayTimingLarge : overlayTiming)}\n {...exitGuard.transition}\n className={clsx(s.Transition, HOLD_PRESSES_CLASS)}\n overlay\n preventInitialTransition={false}\n >\n {open && (\n <div key=\"dialog\">\n <RadixDialog.Overlay\n {...overlayProps}\n ref={overlaySurfaceRef}\n className={clsx(s.Overlay, overlayProps?.className)}\n style={{ ...layerStyle, ...overlayProps?.style }}\n />\n <RadixDialog.Content\n {...dataAttributes(rest)}\n {...rootProps}\n ref={setContent}\n forceMount\n className={clsx(s.Content, rootProps?.className)}\n data-plex-dialog=\"\"\n style={{ ...toCssVariables({ \"dialog-width\": width }), ...layerStyle, ...rootProps?.style }}\n data-placement={placement === \"center\" ? undefined : placement}\n data-mobile-placement={mobilePlacement}\n data-mobile-variant={mobileVariant}\n data-surface={surface}\n data-pill={pill ? \"\" : undefined}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={(event) => {\n // A press or focus in a toast is not outside: the toast region is a layer above the dialog. The\n // Toaster stops these before Radix sees them; this holds when the Toaster mounted after the dialog.\n if (inToastRegion(event.detail.originalEvent.target)) return event.preventDefault()\n onInteractOutside?.(event)\n if (event.defaultPrevented) return\n // With changes a press outside asks first; one that dismisses the question keeps editing\n if (confirmClose) {\n event.preventDefault()\n // The second click of a double click that opened the dialog asks nothing, nor closes it (Codex #64)\n if (performance.now() - openedAt.current >= DOUBLE_CLICK) requestClose()\n return\n }\n // The second click of a double click lands on the overlay: it must not undo the first\n if (performance.now() - openedAt.current < DOUBLE_CLICK) event.preventDefault()\n else exitGuard.onInteractOutside(event)\n }}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n >\n <div ref={setPanelRef} className={clsx(s.Panel, className)}>\n {showClose && (confirmClose ? (\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" onClick={requestClose} />\n ) : (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n ))}\n <DialogRequestCloseContext.Provider value={confirmClose ? requestClose : null}>\n <DialogScrollContext.Provider value={scroll}>\n <DialogSheetContext.Provider value={sheet}>\n {/* A dialog opened from a header action is not inside that header's bar */}\n <DialogBarContext.Provider value={false}>\n <ToolbarHostContext.Provider value={toolbarHost}>{children}</ToolbarHostContext.Provider>\n </DialogBarContext.Provider>\n </DialogSheetContext.Provider>\n </DialogScrollContext.Provider>\n </DialogRequestCloseContext.Provider>\n {confirmClose && (\n <ConfirmClose\n {...(question ?? { message: null })}\n open={confirming}\n anchor={phone && mobileVariant === \"sheet\" ? closeButton : null}\n onOpenChange={setConfirming}\n returnFocus={returnFocus}\n onConfirm={confirmAndClose}\n zIndex={zIndex}\n />\n )}\n </div>\n </RadixDialog.Content>\n </div>\n )}\n </TransitionGroup>\n </PhoneScope>\n </RadixDialog.Portal>\n </PhoneLayoutContext>\n </FloatingBoundaryProvider>\n )\n}\n\ntype DialogScrollValue = {\n edges: ScrollEdges\n setEdges: (edges: ScrollEdges) => void\n notifyScroll: (scrollTop: number) => void\n /** A large Toolbar title asks for a place at the top of the body. */\n largeTitle: boolean\n setLargeTitleSlot: (slot: HTMLDivElement | null) => void\n /** The place of the bar's rows under a large title. */\n setLargeTitleRowSlot: (slot: HTMLDivElement | null) => void\n setTitleRows: (pinned: boolean, height: number) => void\n /** A body tells the dialog it is there; returns the release. */\n registerBody: () => () => void\n}\nconst DialogScrollContext = createContext<DialogScrollValue | null>(null)\n// What the header of a Sheet needs from its Content to become the Sheet's bar on a phone\ntype DialogSheetValue = {\n showClose: boolean\n descriptionSlot: HTMLElement | null\n setBodySlot: (slot: HTMLElement | null) => void\n setOwnSlot: (slot: HTMLElement | null) => void\n /** The bar's Close asks first (`confirmClose`) */\n asksToClose: boolean\n requestClose: () => boolean | void\n setCloseButton: (button: HTMLElement | null) => void\n}\nconst DialogSheetContext = createContext<DialogSheetValue | null>(null)\n// A close that asks first (`confirmClose`): Dialog.Close inside the content asks as the Close button does\nconst DialogRequestCloseContext = createContext<(() => boolean | void) | null>(null)\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DialogBarContext = createContext(false)\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\nconst useDialogViewport = (content: HTMLElement | null, container: HTMLElement | null) => {\n useLayoutEffect(() => (content ? watchDialogViewport(content, container) : undefined), [content, container])\n}\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\ntype DialogSlotProps = {\n children: ReactNode\n className?: string\n}\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground | BarBackgroundAlias\nexport type DialogHeaderProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"glass\" */\n background?: DialogBarBackground\n}\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar. A part from a\n// fragment keeps the fragment's key before its own, so two parts never share a key.\nconst headerParts = (children: ReactNode, prefix = \"\"): ReactNode[] =>\n Children.toArray(children).flatMap((part) => {\n if (!isValidElement<{ children?: ReactNode }>(part)) return [part]\n if (part.type === Fragment) return headerParts(part.props.children, `${prefix}${String(part.key)}/`)\n return [prefix ? cloneElement(part, { key: `${prefix}${String(part.key)}` }) : part]\n })\nconst isHeaderAction = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === HeaderAction\nconst isLeadingAction = (part: ReactNode): part is ReactElement<DialogHeaderActionProps> =>\n isHeaderAction(part) && (part.props as DialogHeaderActionProps).side === \"leading\"\nconst isDescription = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Description\n// A Toolbar.Row in the header is a row of the phone Sheet's bar, under its controls (console 15.11)\nconst isToolbarRow = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Toolbar.Row\n\nconst Header = ({ children, className, background = \"glass\" }: DialogHeaderProps) => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const scrolled = useContext(DialogScrollContext)?.edges.scrolled\n if (sheet && phone) {\n const parts = headerParts(children)\n const descriptions = parts.filter(isDescription)\n // The description reads as the first text of the content, at the top of Dialog.Body when there is one\n const description = descriptions.length > 0 && <div className={s.SheetDescription}>{descriptions}</div>\n // On a phone the header of a Sheet is its Toolbar (iOS 27 kit Sheets 507-24684, Toolbar - Top - iPhone\n // 1-54520): Close at the leading edge, the title alone centered on the row of controls, the header actions\n // at the trailing edge, all on one 44px row 16px under the top edge; a Toolbar.Row stands under that row.\n return (\n <>\n <Toolbar background={background} className={className} data-dialog-bar=\"\">\n <DialogBarContext.Provider value={true}>\n {/* A step's Back takes the leading place, as the back button of a screen pushed inside an iOS sheet */}\n {sheet.showClose && !parts.some(isLeadingAction) && (\n <Toolbar.Leading className={s.BarClose}>\n {sheet.asksToClose ? (\n <NavigationButton ref={sheet.setCloseButton} action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" onClick={sheet.requestClose} />\n ) : (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n )}\n </Toolbar.Leading>\n )}\n {parts.filter(isLeadingAction)}\n <div className={clsx(t.Heading, s.BarHeading)}>{parts.filter((part) => !isHeaderAction(part) && !isDescription(part) && !isToolbarRow(part))}</div>\n {parts.filter((part) => isHeaderAction(part) && !isLeadingAction(part))}\n {/* Rows stand under the controls, as in a Toolbar built by hand: the bar's glass, edge and row gap */}\n <Fragment key=\"toolbar-rows\">{parts.filter(isToolbarRow)}</Fragment>\n </DialogBarContext.Provider>\n </Toolbar>\n {description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)}\n </>\n )\n }\n return <div className={clsx(s.Header, className)} data-background={barBackground(background)} data-scrolled={scrolled ? \"\" : undefined}>{children}</div>\n}\n\nexport type DialogHeaderActionProps = DialogSlotProps & {\n /**\n * `leading` puts the action before the title, such as the Back of a step in `Dialog.Steps`: on a phone Sheet it\n * takes the place of Close, as the back button of a screen pushed inside an iOS sheet does.\n * @default \"trailing\"\n */\n side?: \"leading\" | \"trailing\"\n}\n\nconst HeaderAction = ({ children, className, side = \"trailing\" }: DialogHeaderActionProps) => {\n const bar = useContext(DialogBarContext)\n if (bar && side === \"leading\") return <Toolbar.Leading className={clsx(s.BarClose, className)}>{children}</Toolbar.Leading>\n if (bar) return <Toolbar.Trailing className={className}>{children}</Toolbar.Trailing>\n return <div className={clsx(s.HeaderAction, className)} data-side={side === \"leading\" ? \"leading\" : undefined}>{children}</div>\n}\n\n/** The scrolling part between Header and Footer: with it, only the body scrolls */\nconst Body = ({ children, className }: DialogSlotProps) => {\n const scroll = useContext(DialogScrollContext)\n const setEdges = scroll?.setEdges\n const notifyScroll = scroll?.notifyScroll\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet's description starts the body (Dialog.Header portals it here)\n const setDescriptionSlot = sheet && phone ? sheet.setBodySlot : null\n const element = useRef<HTMLDivElement | null>(null)\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !setEdges) return\n const stop = observeScrollEdges(body, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n const registerBody = scroll?.registerBody\n useLayoutEffect(() => registerBody?.(), [registerBody])\n const [rowSlot, setRowSlot] = useState<HTMLDivElement | null>(null)\n const setTitleRows = scroll?.setTitleRows\n const setLargeTitleRowSlot = scroll?.setLargeTitleRowSlot\n const setRows = useCallback((node: HTMLDivElement | null) => { setRowSlot(node); setLargeTitleRowSlot?.(node) }, [setLargeTitleRowSlot])\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !rowSlot || !setTitleRows) return\n return followTitleRows(body, rowSlot, setTitleRows)\n }, [rowSlot, setTitleRows])\n return (\n <div ref={element} className={clsx(s.Body, className)} onScroll={notifyScroll ? (event) => notifyScroll(event.currentTarget.scrollTop) : undefined}>\n {/* A large Toolbar title starts the body and scrolls with it; the description comes under it */}\n {scroll?.largeTitle && <div ref={scroll.setLargeTitleSlot} className={s.LargeTitle} />}\n {scroll?.largeTitle && <div ref={setRows} className={s.LargeTitleRows} />}\n {setDescriptionSlot && <div ref={setDescriptionSlot} className={s.SheetDescriptionSlot} />}\n {children}\n </div>\n )\n}\n\n/**\n * Where a phone Sheet's description goes in content of your own, such as a scroller inside a form so that Enter\n * submits: the description starts it, as it starts Dialog.Body, and it comes before the body's place. It renders\n * nothing outside a phone Sheet.\n */\nconst DescriptionSlot = () => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const setOwnSlot = sheet && phone ? sheet.setOwnSlot : null\n return setOwnSlot ? <div ref={setOwnSlot} className={s.SheetDescriptionSlot} /> : null\n}\n\nexport type DialogFooterProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background?: DialogBarBackground\n /** Override the mobile action layout. Two alert actions default to inline, three or more and sheets to stacked. */\n mobileLayout?: \"inline\" | \"stacked\"\n}\n\nconst Footer = ({ children, className, mobileLayout, background = \"soft\" }: DialogFooterProps) => {\n const setFooter = useFloatingBoundaryRegistration()?.setFooter\n const contentBelow = useContext(DialogScrollContext)?.edges.contentBelow\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet stacks its main action on top, as an iOS setup sheet does. A footer is written with it last,\n // where a desktop row ends, so the order is turned in the page itself: focus and a screen reader meet the\n // actions in the order they are seen.\n const parts = sheet && phone && mobileLayout !== \"inline\" ? headerParts(children).reverse() : children\n return (\n <div\n ref={setFooter}\n className={clsx(s.Footer, className)}\n data-mobile-layout={mobileLayout}\n data-background={barBackground(background)}\n data-content-below={contentBelow ? \"\" : undefined}\n >\n {parts}\n </div>\n )\n}\n\nconst Title = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n return <RadixDialog.Title className={clsx(bar ? t.Title : s.Title, className)}>{children}</RadixDialog.Title>\n}\n\nconst Description = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n const element = useRef<HTMLParagraphElement | null>(null)\n const [shown, setShown] = useState(false)\n useLayoutEffect(() => {\n // The header leaves its own descriptions out of the bar. One the bar still holds, inside a part of the\n // header's own, is the title's second line (Toolbar's subtitle) when the reader sees it; one that is only\n // read out, visually hidden, leaves the title on its one line.\n const node = element.current\n // A measurement of the laid-out description, which only an effect after layout can read\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setShown(bar && !!node && node.offsetHeight > 1 && node.offsetWidth > 1)\n }, [bar, children, className])\n return (\n <RadixDialog.Description ref={element} className={clsx(bar && shown ? t.Subtitle : s.Description, className)}>\n {children}\n </RadixDialog.Description>\n )\n}\n\nexport type DialogStepsProps = {\n /** The step on screen. A new value brings its content in. */\n step: string | number\n /**\n * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to\n * a step before it.\n * @default \"forward\"\n */\n direction?: \"forward\" | \"back\"\n children: ReactNode\n className?: string\n}\n\n/** The steps of a flow inside a dialog, such as a sign-in that asks for an email and then a code. */\nconst Steps = ({ step, direction = \"forward\", children, className }: DialogStepsProps) => (\n <div className={clsx(s.Steps, className)} data-direction={direction}>\n <TransitionGroup {...STEP_TIMING} as=\"div\" overlay className={s.Step} onEnter={enterStep} onExit={leaveStep} onExitActive={settleStepHeight} onExitComplete={releaseStepHeight}>\n <div key={step} data-dialog-step=\"\" tabIndex={-1}>{children}</div>\n </TransitionGroup>\n </div>\n)\n\ntype ConfirmCloseProps = DialogConfirmClose & {\n open: boolean\n /** The phone Sheet's Close: the question stands at it. Without one it is an alert. */\n anchor: HTMLElement | null\n onOpenChange: (open: boolean) => void\n onConfirm: () => void\n returnFocus: { current: HTMLElement | null }\n /** The owner dialog's stack order: the question stands over it */\n zIndex?: number\n}\n\n// iOS asks at the button that closes (a confirmation dialog presented from the sheet's Close on iOS 27: a glass\n// popover under it, no dimming, the question in 17 regular over a full-width destructive pill); with no such button,\n// and on a desktop, the question is an alert.\nconst ConfirmClose = ({\n message,\n detail,\n confirmLabel = \"Discard Changes\",\n cancelLabel = \"Keep Editing\",\n open,\n anchor,\n onOpenChange,\n onConfirm,\n returnFocus,\n zIndex,\n}: ConfirmCloseProps) => {\n const messageId = useId()\n if (anchor) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <Popover.Anchor element={anchor} />\n {/* Over the Close, its corner 6 before the button's, as the native confirmation grows out of it. Its height is\n read only while the question is open: a read on every render of the sheet forced a layout */}\n <Popover.Content side=\"bottom\" align=\"start\" sideOffset={open ? -anchor.offsetHeight : 0} alignOffset={-6} collisionPadding={10} width={240} minWidth={240} zIndex={zIndex} aria-labelledby={messageId} className={s.ConfirmClose} data-dialog-confirm-close=\"\">\n <p id={messageId} className={s.ConfirmCloseMessage}>{message}</p>\n {detail != null && detail !== false && <p className={s.ConfirmCloseDetail}>{detail}</p>}\n <Button block pill color=\"danger\" variant=\"soft\" className={s.ConfirmCloseAction} onClick={onConfirm}>{confirmLabel}</Button>\n </Popover.Content>\n </Popover>\n )\n }\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Content\n mobileVariant=\"alert\"\n surface=\"plain\"\n width={360}\n showClose={false}\n zIndex={zIndex}\n data-dialog-confirm-close=\"\"\n onCloseAutoFocus={(event) => {\n const target = returnFocus.current\n if (target?.isConnected) {\n event.preventDefault()\n target.focus({ preventScroll: true })\n }\n }}\n >\n {/* The question names the alert, as an alert's title does */}\n <Header>\n <Title>{message}</Title>\n {detail != null && detail !== false && <Description>{detail}</Description>}\n </Header>\n <Footer>\n <Close><Button color=\"secondary\" variant=\"soft\">{cancelLabel}</Button></Close>\n <Button color=\"danger\" onClick={onConfirm}>{confirmLabel}</Button>\n </Footer>\n </Content>\n </Dialog>\n )\n}\n\nconst Close = ({ children }: { children: ReactNode }) => {\n const requestClose = useContext(DialogRequestCloseContext)\n // A button that does not submit the form around it, and a child that prevented its click keeps the dialog, as\n // Radix's Close does\n if (requestClose) {\n return (\n <Slot.Root {...{ type: \"button\" }} onClick={(event: { defaultPrevented: boolean }) => { if (!event.defaultPrevented) requestClose() }}>\n {children}\n </Slot.Root>\n )\n }\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>\n}\n\nDialog.Trigger = Trigger\nDialog.Content = Content\nDialog.Header = Header\nDialog.HeaderAction = HeaderAction\nDialog.Body = Body\nDialog.Footer = Footer\nDialog.Title = Title\nDialog.Description = Description\nDialog.DescriptionSlot = DescriptionSlot\nDialog.Close = Close\nDialog.Steps = Steps\n"]}
|
|
@@ -20,6 +20,9 @@ import { TransitionGroup } from "../Transition/index.js";
|
|
|
20
20
|
import { createExitGuard, overlayTiming, overlayTimingQuick } from "../Transition/shared.js";
|
|
21
21
|
import { isHoverPointer } from "../../lib/inputMode.js";
|
|
22
22
|
import s from "@plexui/styles/components/Menu/Menu.module.css";
|
|
23
|
+
import { HOLD_PRESSES_CLASS, holdEnteringPresses } from "../../lib/holdEnteringPresses.js";
|
|
24
|
+
// Presses that start while a dialog or menu comes in are held, as on iOS (lib/holdEnteringPresses)
|
|
25
|
+
holdEnteringPresses();
|
|
23
26
|
// 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
|
|
24
27
|
// phone outside one it opens over the window, in a phone scope of its own (plan 176)
|
|
25
28
|
const COLLISION_PADDING = { bottom: 30, top: 30, left: 12, right: 12 };
|
|
@@ -286,7 +289,7 @@ const Content = ({ children, side, sideOffset, align, alignOffset, width, minWid
|
|
|
286
289
|
if (!modal || isRightClick)
|
|
287
290
|
interactedOutside.current = true;
|
|
288
291
|
};
|
|
289
|
-
return (_jsx(DropdownMenu.Portal, { forceMount: true, container: phoneLayout.container, children: _jsx(PhoneScope, { enabled: phoneLayout.scoped, children: _jsx(TransitionGroup, { className: s.Menu, ...overlayTiming, ...exitGuard.transition, overlay: true, children: open && (_jsx(RootMenuContent, { ref: setContent, onOpenAutoFocus: (event) => {
|
|
292
|
+
return (_jsx(DropdownMenu.Portal, { forceMount: true, container: phoneLayout.container, children: _jsx(PhoneScope, { enabled: phoneLayout.scoped, children: _jsx(TransitionGroup, { className: clsx(s.Menu, HOLD_PRESSES_CLASS), ...overlayTiming, ...exitGuard.transition, overlay: true, children: open && (_jsx(RootMenuContent, { ref: setContent, onOpenAutoFocus: (event) => {
|
|
290
293
|
onOpenAutoFocus?.(event);
|
|
291
294
|
delegateInitialPhoneSubmenuFocus(event, contentRef.current);
|
|
292
295
|
}, forceMount: true, className: s.MenuList, "data-pill": pill ? "" : undefined, side: side ?? cover?.side, sideOffset: cover ? cover.sideOffset : sideOffset ?? 5, align: align, alignOffset: alignOffset ?? (cover || align === "center" ? 0 : -5), avoidCollisions: true, ...floatingBoundary, onEscapeKeyDown: preventDefaultHandler, onInteractOutside: handleInteractOutside, onCloseAutoFocus: handleCloseAutoFocus, "data-layout": isHorizontal ? "horizontal" : undefined, "data-size": isHorizontal && size ? size : undefined, style: toCssVariables({
|
|
@@ -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,6BAA6B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAA;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,uBAAuB,EAAyB,MAAM,4BAA4B,CAAA;AAC7I,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,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A;AAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;AAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;AACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,YAAY,GAAG,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 } from \"../Transition/shared\"\nimport { isHoverPointer } from \"../../lib/inputMode\"\nimport s from \"@plexui/styles/components/Menu/Menu.module.css\"\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 className={s.Menu} {...overlayTiming} {...exitGuard.transition} overlay>\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","s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CAAA;AAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;AAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;AACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC5B,IAAI,CAAC,YAAY,GAAG,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 } 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 className={clsx(s.Menu, HOLD_PRESSES_CLASS)} {...overlayTiming} {...exitGuard.transition} overlay>\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"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sheet, dialog or menu takes no touch while it comes in, as on iOS: a second tap that starts during the enter
|
|
3
|
+
* lands on what rises under the finger, so a double tap on a row opened a sheet and a second one over it, and a
|
|
4
|
+
* double tap on a menu button chose the first item (console 16.11). A touch that starts while a marked root still
|
|
5
|
+
* carries `data-entering` is held whole: its pointerdown, its pointerup and the click that follows. A press already
|
|
6
|
+
* under way when the root mounts (the one that opened it), a mouse or a pen (a quick second click toggles a menu
|
|
7
|
+
* on a desktop) and a key's click are left alone.
|
|
8
|
+
*/
|
|
9
|
+
export const HOLD_PRESSES_CLASS = "plexui-hold-presses";
|
|
10
|
+
const ENTERING = `.${HOLD_PRESSES_CLASS}[data-entering]`;
|
|
11
|
+
// The click of a held touch may come a moment after its pointerup
|
|
12
|
+
const CLICK_WINDOW = 500;
|
|
13
|
+
const installed = new WeakMap();
|
|
14
|
+
/** Installs the hold on a window once; returns the function that removes it. */
|
|
15
|
+
export function holdEnteringPresses(view = typeof window === "undefined" ? undefined : window) {
|
|
16
|
+
if (!view)
|
|
17
|
+
return () => { };
|
|
18
|
+
const existing = installed.get(view);
|
|
19
|
+
if (existing)
|
|
20
|
+
return existing;
|
|
21
|
+
const held = new Set();
|
|
22
|
+
let eatClick = false;
|
|
23
|
+
let clickTimer;
|
|
24
|
+
const stop = (event) => {
|
|
25
|
+
event.stopImmediatePropagation();
|
|
26
|
+
if (event.cancelable)
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
};
|
|
29
|
+
const onDown = (event) => {
|
|
30
|
+
eatClick = false;
|
|
31
|
+
if (event.pointerType !== "touch" || !view.document.querySelector(ENTERING))
|
|
32
|
+
return;
|
|
33
|
+
held.add(event.pointerId);
|
|
34
|
+
stop(event);
|
|
35
|
+
};
|
|
36
|
+
const onRelease = (event) => {
|
|
37
|
+
if (!held.delete(event.pointerId))
|
|
38
|
+
return;
|
|
39
|
+
stop(event);
|
|
40
|
+
if (event.type !== "pointerup")
|
|
41
|
+
return;
|
|
42
|
+
eatClick = true;
|
|
43
|
+
clearTimeout(clickTimer);
|
|
44
|
+
clickTimer = setTimeout(() => { eatClick = false; }, CLICK_WINDOW);
|
|
45
|
+
};
|
|
46
|
+
// Only the touch's own click: a key or an assistive click (detail 0) still acts
|
|
47
|
+
const onClick = (event) => {
|
|
48
|
+
if (!eatClick || !event.detail)
|
|
49
|
+
return;
|
|
50
|
+
eatClick = false;
|
|
51
|
+
stop(event);
|
|
52
|
+
};
|
|
53
|
+
view.addEventListener("pointerdown", onDown, true);
|
|
54
|
+
view.addEventListener("pointerup", onRelease, true);
|
|
55
|
+
view.addEventListener("pointercancel", onRelease, true);
|
|
56
|
+
view.addEventListener("click", onClick, true);
|
|
57
|
+
const dispose = () => {
|
|
58
|
+
view.removeEventListener("pointerdown", onDown, true);
|
|
59
|
+
view.removeEventListener("pointerup", onRelease, true);
|
|
60
|
+
view.removeEventListener("pointercancel", onRelease, true);
|
|
61
|
+
view.removeEventListener("click", onClick, true);
|
|
62
|
+
clearTimeout(clickTimer);
|
|
63
|
+
installed.delete(view);
|
|
64
|
+
};
|
|
65
|
+
installed.set(view, dispose);
|
|
66
|
+
return dispose;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=holdEnteringPresses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holdEnteringPresses.js","sourceRoot":"","sources":["../../../src/lib/holdEnteringPresses.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAA;AAEvD,MAAM,QAAQ,GAAG,IAAI,kBAAkB,iBAAiB,CAAA;AACxD,kEAAkE;AAClE,MAAM,YAAY,GAAG,GAAG,CAAA;AAExB,MA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n * lands on what rises under the finger, so a double tap on a row opened a sheet and a second one over it, and a\n * double tap on a menu button chose the first item (console 16.11). A touch that starts while a marked root still\n * carries `data-entering` is held whole: its pointerdown, its pointerup and the click that follows. A press already\n * under way when the root mounts (the one that opened it), a mouse or a pen (a quick second click toggles a menu\n * on a desktop) and a key's click are left alone.\n */\nexport const HOLD_PRESSES_CLASS = \"plexui-hold-presses\"\n\nconst ENTERING = `.${HOLD_PRESSES_CLASS}[data-entering]`\n// The click of a held touch may come a moment after its pointerup\nconst CLICK_WINDOW = 500\n\nconst installed = new WeakMap<Window, () => void>()\n\n/** Installs the hold on a window once; returns the function that removes it. */\nexport function holdEnteringPresses(view: Window | undefined = typeof window === \"undefined\" ? undefined : window) {\n if (!view) return () => {}\n const existing = installed.get(view)\n if (existing) return existing\n const held = new Set<number>()\n let eatClick = false\n let clickTimer: ReturnType<typeof setTimeout> | undefined\n const stop = (event: Event) => {\n event.stopImmediatePropagation()\n if (event.cancelable) event.preventDefault()\n }\n const onDown = (event: PointerEvent) => {\n eatClick = false\n if (event.pointerType !== \"touch\" || !view.document.querySelector(ENTERING)) return\n held.add(event.pointerId)\n stop(event)\n }\n const onRelease = (event: PointerEvent) => {\n if (!held.delete(event.pointerId)) return\n stop(event)\n if (event.type !== \"pointerup\") return\n eatClick = true\n clearTimeout(clickTimer)\n clickTimer = setTimeout(() => { eatClick = false }, CLICK_WINDOW)\n }\n // Only the touch's own click: a key or an assistive click (detail 0) still acts\n const onClick = (event: MouseEvent) => {\n if (!eatClick || !event.detail) return\n eatClick = false\n stop(event)\n }\n view.addEventListener(\"pointerdown\", onDown, true)\n view.addEventListener(\"pointerup\", onRelease, true)\n view.addEventListener(\"pointercancel\", onRelease, true)\n view.addEventListener(\"click\", onClick, true)\n const dispose = () => {\n view.removeEventListener(\"pointerdown\", onDown, true)\n view.removeEventListener(\"pointerup\", onRelease, true)\n view.removeEventListener(\"pointercancel\", onRelease, true)\n view.removeEventListener(\"click\", onClick, true)\n clearTimeout(clickTimer)\n installed.delete(view)\n }\n installed.set(view, dispose)\n return dispose\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sheet, dialog or menu takes no touch while it comes in, as on iOS: a second tap that starts during the enter
|
|
3
|
+
* lands on what rises under the finger, so a double tap on a row opened a sheet and a second one over it, and a
|
|
4
|
+
* double tap on a menu button chose the first item (console 16.11). A touch that starts while a marked root still
|
|
5
|
+
* carries `data-entering` is held whole: its pointerdown, its pointerup and the click that follows. A press already
|
|
6
|
+
* under way when the root mounts (the one that opened it), a mouse or a pen (a quick second click toggles a menu
|
|
7
|
+
* on a desktop) and a key's click are left alone.
|
|
8
|
+
*/
|
|
9
|
+
export declare const HOLD_PRESSES_CLASS = "plexui-hold-presses";
|
|
10
|
+
/** Installs the hold on a window once; returns the function that removes it. */
|
|
11
|
+
export declare function holdEnteringPresses(view?: Window | undefined): () => void;
|