@plexui/ui 0.58.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Dialog/Dialog.js +1 -1
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Select/Select.js +6 -3
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +3 -3
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/lib/observeTextareaWidth.js +6 -0
- package/dist/es/lib/observeTextareaWidth.js.map +1 -1
- package/dist/types/components/Select/Select.d.ts +6 -0
- package/dist/types/lib/observeTextareaWidth.d.ts +6 -0
- package/package.json +2 -2
|
@@ -420,7 +420,7 @@ const Steps = ({ step, direction = "forward", children, className }) => (_jsx("d
|
|
|
420
420
|
const ConfirmClose = ({ message, detail, confirmLabel = "Discard Changes", cancelLabel = "Keep Editing", open, anchor, onOpenChange, onConfirm, returnFocus, zIndex, }) => {
|
|
421
421
|
const messageId = useId();
|
|
422
422
|
if (anchor) {
|
|
423
|
-
return (_jsxs(Popover, { open: open, onOpenChange: onOpenChange, children: [_jsx(Popover.Anchor, { element: anchor }), _jsxs(Popover.Content, { side: "bottom", align: "start", sideOffset: -anchor.offsetHeight, alignOffset: -6, collisionPadding: 10, width: 240, minWidth: 240, zIndex: zIndex, "aria-labelledby": messageId, className: s.ConfirmClose, "data-dialog-confirm-close": "", children: [_jsx("p", { id: messageId, className: s.ConfirmCloseMessage, children: message }), detail != null && detail !== false && _jsx("p", { className: s.ConfirmCloseDetail, children: detail }), _jsx(Button, { block: true, pill: true, color: "danger", variant: "soft", className: s.ConfirmCloseAction, onClick: onConfirm, children: confirmLabel })] })] }));
|
|
423
|
+
return (_jsxs(Popover, { open: open, onOpenChange: onOpenChange, children: [_jsx(Popover.Anchor, { element: anchor }), _jsxs(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": "", children: [_jsx("p", { id: messageId, className: s.ConfirmCloseMessage, children: message }), detail != null && detail !== false && _jsx("p", { className: s.ConfirmCloseDetail, children: detail }), _jsx(Button, { block: true, pill: true, color: "danger", variant: "soft", className: s.ConfirmCloseAction, onClick: onConfirm, children: confirmLabel })] })] }));
|
|
424
424
|
}
|
|
425
425
|
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(Content, { mobileVariant: "alert", surface: "plain", width: 360, showClose: false, zIndex: zIndex, "data-dialog-confirm-close": "", onCloseAutoFocus: (event) => {
|
|
426
426
|
const target = returnFocus.current;
|
|
@@ -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,E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I,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 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 */}\n <Popover.Content side=\"bottom\" align=\"start\" sideOffset={-anchor.offsetHeight} 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,MA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O,kBAAE,QAAQ,GAAqB,CAAA;AAClE,CAAC,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 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"]}
|
|
@@ -43,8 +43,9 @@ const DefaultMultiTriggerView = ({ values, selectedAll, }) => {
|
|
|
43
43
|
return _jsx(_Fragment, { children: displayValue });
|
|
44
44
|
};
|
|
45
45
|
export const Select = (props) => {
|
|
46
|
-
const { id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, required, value, name, multiple, variant = "outline", size = "md", dropdownIconType = "dropdown", loading = false, clearable = false, disabled = false, placeholder = "Select...", loadingPlaceholder = "Loading...", allSelectedLabel = "All selected", noneLabel = "None", pill: pillProp, listMinWidth, options, actions: propActions = [], side, avoidCollisions = true, onChange, optionClassName, OptionView = DefaultOptionView, TriggerStartIcon, triggerClassName, opticallyAlign, TriggerView: TriggerViewFromProps, searchPlaceholder = "", searchAriaLabel = "Search options", searchSize, searchPredicate = defaultSearchPredicate, searchEmptyMessage = "No results found.", trigger, checkPosition = 'start', } = props;
|
|
46
|
+
const { id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, required, value, name, multiple, variant = "outline", size = "md", dropdownIconType = "dropdown", loading = false, clearable = false, disabled = false, placeholder = "Select...", loadingPlaceholder = "Loading...", allSelectedLabel = "All selected", noneLabel = "None", pill: pillProp, listPill: listPillProp, listMinWidth, options, actions: propActions = [], side, avoidCollisions = true, onChange, optionClassName, OptionView = DefaultOptionView, TriggerStartIcon, triggerClassName, opticallyAlign, TriggerView: TriggerViewFromProps, searchPlaceholder = "", searchAriaLabel = "Search options", searchSize, searchPredicate = defaultSearchPredicate, searchEmptyMessage = "No results found.", trigger, checkPosition = 'start', } = props;
|
|
47
47
|
const pill = useFieldRowPill(pillProp);
|
|
48
|
+
const listPill = listPillProp ?? pill;
|
|
48
49
|
// At the end of a Field row the menu opens from the row's end and fits its options: on a phone
|
|
49
50
|
// the trigger there is only as wide as its value, so a menu of the trigger's width breaks every word.
|
|
50
51
|
// In a `FieldGroup columns` the value starts at the column, and so does its menu.
|
|
@@ -156,6 +157,7 @@ export const Select = (props) => {
|
|
|
156
157
|
noneLabel,
|
|
157
158
|
variant,
|
|
158
159
|
pill,
|
|
160
|
+
listPill,
|
|
159
161
|
size,
|
|
160
162
|
dropdownIconType,
|
|
161
163
|
block,
|
|
@@ -204,6 +206,7 @@ export const Select = (props) => {
|
|
|
204
206
|
noneLabel,
|
|
205
207
|
variant,
|
|
206
208
|
pill,
|
|
209
|
+
listPill,
|
|
207
210
|
size,
|
|
208
211
|
dropdownIconType,
|
|
209
212
|
block,
|
|
@@ -317,7 +320,7 @@ export const SelectTrigger = (props) => {
|
|
|
317
320
|
// Custom Select
|
|
318
321
|
// ============================================================
|
|
319
322
|
const CustomSelect = () => {
|
|
320
|
-
const { loading, disabled, side, align, alignOffset, avoidCollisions, listWidth, listMinWidth, listMaxWidth, trigger,
|
|
323
|
+
const { loading, disabled, side, align, alignOffset, avoidCollisions, listWidth, listMinWidth, listMaxWidth, trigger, listPill, } = useSelectContext();
|
|
321
324
|
const [open, setOpen] = useState(false);
|
|
322
325
|
const floatingBoundary = useFloatingBoundary(open && avoidCollisions, { bottom: 30, top: 30 });
|
|
323
326
|
const selectContentRef = useRef(null);
|
|
@@ -415,7 +418,7 @@ const CustomSelect = () => {
|
|
|
415
418
|
}
|
|
416
419
|
handleOpenChange(nextState);
|
|
417
420
|
}, modal: false, children: [_jsx(Popover.Trigger, { asChild: true, ref: setTrigger, children: trigger ? trigger({ open, onToggle: () => { if (!disabled && !loading)
|
|
418
|
-
setOpen((current) => !current); } }) : _jsx(SelectTrigger, { onOpenChange: handleOpenChange }) }), _jsx(Popover.Portal, { forceMount: true, children: _jsx(TransitionGroup, { className: s.Menu, ...overlayTiming, overlay: true, children: open && (_jsx(Popover.Content, { ref: setContent, forceMount: true, className: s.MenuList, "data-pill":
|
|
421
|
+
setOpen((current) => !current); } }) : _jsx(SelectTrigger, { onOpenChange: handleOpenChange }) }), _jsx(Popover.Portal, { forceMount: true, children: _jsx(TransitionGroup, { className: s.Menu, ...overlayTiming, overlay: true, children: open && (_jsx(Popover.Content, { ref: setContent, forceMount: true, className: s.MenuList, "data-pill": listPill ? "" : undefined, "data-list-width": listWidth === "auto" ? "auto" : undefined, "data-list-sized": typeof listWidth === "number" ? "" : undefined, side: side ?? cover?.side ?? "bottom", sideOffset: cover ? cover.sideOffset : 5, align: align, alignOffset: alignOffset, avoidCollisions: avoidCollisions, ...floatingBoundary,
|
|
419
422
|
// Prevent Radix auto focus so we can handle our own from within <CustomSelectMenu />
|
|
420
423
|
onOpenAutoFocus: preventDefaultHandler,
|
|
421
424
|
// Radix waits until the animation completes before directing focus, which is janky.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,GAAG,EACH,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAChH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAu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CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Popover } from \"radix-ui\"\nimport React, {\n createContext,\n type ReactNode,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useFloatingBoundary } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { useFieldColumns, useFieldRow, useFieldRowPill } from \"../../lib/fieldRow\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables, waitForAnimationFrame } from \"../../lib/helpers\"\nimport { Check, Info, Search } from \"../Icon\"\nimport type { ControlSize } from \"../../types\"\nimport { Input } from \"../Input\"\nimport { SelectControl, type SelectControlProps } from \"../SelectControl\"\nimport { Tooltip } from \"../Tooltip\"\nimport { TransitionGroup } from \"../Transition\"\nimport { overlayTiming } from \"../Transition/shared\"\nimport { isHoverPointer } from \"../../lib/inputMode\"\nimport { createSelectPress } from \"../../lib/selectPress\"\nimport { createFocusRestore } from \"../../lib/focusRestore\"\nimport { ignoreReleaseOverTrigger, markCoveredMenuTrigger, observeMenuTriggerCover, type MenuTriggerCover } from \"../../lib/menuTriggerCover\"\nimport { usePhoneWindow } from \"../PhoneLayout/PhoneLayout\"\nimport s from \"@plexui/styles/components/Select/Select.module.css\"\n\nexport type Option<T extends string = string> = {\n value: T\n label: string\n /** Disable the option */\n disabled?: boolean\n /** Displayed as secondary text below the option `label` */\n description?: React.ReactNode\n tooltip?: {\n content: React.ReactNode\n maxWidth?: number\n }\n}\n\nexport type OptionGroup<T extends Option> = {\n label: string\n options: T[]\n optionsLimit?: {\n label: string\n limit: number\n }\n}\n\nexport type Options<T extends Option> = T[] | OptionGroup<T>[]\n\ntype CallbackWithOption<T extends Option> = (option: T) => void\ntype CallbackWithOptions<T extends Option> = (options: T[]) => void\ntype CallbackWithActionId = (actionId: string) => void\ntype SearchPredicate<T extends Option> = (option: T, searchTerm: string) => boolean\n\ntype Action = {\n /** Unique ID to identify the action with */\n id: string\n /** Label display for the action */\n label: string\n /** Icon displayed to the left of the action */\n Icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>\n /** Custom class applied to the action container */\n className?: string\n /** Callback invoked when the action is pressed */\n onSelect: CallbackWithActionId\n}\n\ntype Actions = Action[]\n\nexport type PopoverSide = \"top\" | \"bottom\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\n\ntype SingleSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple?: false\n value: string\n onChange: CallbackWithOption<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created inline.\n */\n TriggerView?: React.FC<T>\n}\n\ntype MultiSelectTriggerViewProps<T extends Option> = {\n values: T[]\n selectedAll: boolean\n}\n\ntype MultiSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple: true\n value: string[]\n onChange: CallbackWithOptions<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created line.\n */\n TriggerView?: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\ntype SelectAccessibilityProps = Pick<SelectControlProps, \"aria-label\" | \"aria-labelledby\" | \"aria-describedby\" | \"aria-invalid\">\n\nexport type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectProps<T>) & SelectAccessibilityProps & {\n options: Options<T> // Should be passed as a stable reference\n /**\n * Disables the select visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Allows the select to be targeted with htmlFor\n */\n id?: string\n /**\n * Marks the select as a required field when using native form submission\n */\n required?: boolean\n /**\n * Creates the ability to query the value with `[name=\"${name}\"]`\n */\n name?: string\n /**\n * Placeholder text for the select\n * @default Select...\n */\n placeholder?: string\n /**\n * Placeholder text for the select while loading. Behaves exactly like `placeholder`, and `value` will be shown if provided.\n * @default Loading...\n */\n loadingPlaceholder?: string\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Style variant for the select trigger\n * @default outline\n */\n variant?: SelectControlProps[\"variant\"]\n /**\n * Determines if the select trigger should be a fully rounded pill shape\n * @default false, or true at the end of a `Field row`\n */\n pill?: boolean\n /**\n * Text of a `multiple` trigger when every option is selected\n * @default All selected\n */\n allSelectedLabel?: string\n /**\n * Controls size of the select trigger, and several other aspects of trigger styling.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n * @default md\n */\n size?: SelectControlProps[\"size\"]\n /**\n * Icon displayed in the far right of the select trigger\n * @default dropdown\n */\n dropdownIconType?: SelectControlProps[\"dropdownIconType\"]\n /**\n * Actions to display below the options list.\n */\n actions?: Actions // Memoized by length, don't assume dynamic changes are supported\n /** Custom class applied to option containers */\n optionClassName?: string\n /**\n * Customize the rendered output of individual options\n * NOTE: Must be passed as a stable reference, not created line.\n */\n OptionView?: React.FC<T>\n /** Icon displayed at the start of the select trigger */\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n /**\n * Custom class applied to the select trigger\n */\n triggerClassName?: string // If consumers need deep customization of the trigger\n /**\n * Applies a negative margin using the current gutter to optically align the trigger\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Display a clear action that allows the select to be unset. On a phone it is the first row of the list, `noneLabel`,\n * as an iOS pop-up button unsets its value with a None row instead of a clear button; a custom `trigger` keeps its\n * own clearing and gets no None row.\n * @default false\n */\n clearable?: boolean\n /**\n * Label of the row that unsets a `clearable` select on a phone\n * @default None\n */\n noneLabel?: string\n /**\n * Extends select to 100% of available width.\n * @default true\n */\n block?: boolean\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.\n * Without one the list opens below its trigger, and on a phone over it, toward the larger part of the screen.\n * @default bottom\n */\n side?: PopoverSide\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default \"end\" at the end of a `Field row` (\"start\" in a `FieldGroup columns`), \"center\" when block, otherwise \"start\"\n */\n align?: PopoverAlign\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n /**\n * Prevents collision detection in the custom menu. Use with caution.\n * @default true\n */\n avoidCollisions?: boolean\n /**\n * Set the width of the custom select menu\n * @default the width of the trigger (fits the options when not block or at the end of a `Field row`)\n */\n listWidth?: number | \"auto\"\n /**\n * Defines the `min-width` property of the custom select menu, in pixels.\n * @default the width of the trigger\n */\n listMinWidth?: number | \"auto\"\n /**\n * Defines the `max-width` property of the custom select menu, in pixels.\n * @default auto (300 when it fits the options)\n */\n listMaxWidth?: number | \"auto\"\n /** Predicate used to filter searches */\n searchPredicate?: SearchPredicate<T>\n /** Placeholder of the search input */\n searchPlaceholder?: string\n /** Accessible name of the search input, independent of the trigger label. */\n searchAriaLabel?: string\n /**\n * Size of the search input in the menu. A phone list has no search: it is\n * an iOS menu, and a long one scrolls.\n * @default md\n */\n searchSize?: ControlSize\n /**\n * Message displayed when search results are empty. Can be a simple string, or custom JSX.\n */\n searchEmptyMessage?: ReactNode\n /**\n * Render a custom trigger element instead of the default `SelectControl`.\n * Receives open state and a toggle callback. The returned element is wrapped\n * in a Radix `Popover.Trigger`.\n *\n * NOTE: Must be passed as a stable reference, not created inline.\n */\n /**\n * Position of the check indicator in the option list. `none` removes the\n * indicator column altogether — for a list that never carries a selection\n * (one-shot actions) or whose option view states the selection itself, an\n * empty 16px column is dead space in every row.\n * @default start\n */\n checkPosition?: 'start' | 'end' | 'none'\n trigger?: (props: { open: boolean; onToggle: () => void }) => ReactNode\n}\n\ntype SingleSelectContextValue<T extends Option> = {\n multiple: false\n value: string\n TriggerView: React.FC<T>\n}\n\ntype MultiSelectContextValue<T extends Option> = {\n multiple: true\n value: string[]\n TriggerView: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\ntype SelectContextValue<T extends Option> = (\n | SingleSelectContextValue<T>\n | MultiSelectContextValue<T>\n) & SelectAccessibilityProps & {\n triggerId: string\n // Props\n name?: string\n id?: string\n required?: boolean\n options: Options<T>\n disabled: boolean\n variant: SelectControlProps[\"variant\"]\n pill: boolean\n size: SelectControlProps[\"size\"]\n dropdownIconType: SelectControlProps[\"dropdownIconType\"]\n loading: boolean\n clearable: boolean\n placeholder: string\n loadingPlaceholder: string\n allSelectedLabel: string\n /** A phone's list leads with a row that unsets the value, in place of the trigger's clear button */\n noneRow: boolean\n noneLabel: string\n searchEmptyMessage: ReactNode\n searchPlaceholder: string\n searchAriaLabel: string\n searchSize?: ControlSize\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n triggerClassName?: string\n opticallyAlign?: \"start\" | \"end\"\n optionClassName?: string\n OptionView: React.FC<T>\n actions: Actions\n onActionSelect: CallbackWithActionId\n block: boolean\n /** The side asked for; without one a list opens below, or on a phone toward the larger part of the screen. */\n side: PopoverSide | undefined\n align: PopoverAlign\n alignOffset: number\n avoidCollisions: boolean\n listWidth?: number | \"auto\" // Default when not passed is to match the width of the trigger\n listMinWidth?: number | \"auto\" // Default when not passed is the width of the trigger\n listMaxWidth?: number | \"auto\"\n // References\n onSelectRef: React.MutableRefObject<(option: T, removeOption?: boolean) => void>\n searchPredicateRef: React.MutableRefObject<SearchPredicate<T>>\n // Derived\n searchable: boolean\n checkPosition: 'start' | 'end' | 'none'\n // Custom trigger\n trigger?: (props: { open: boolean; onToggle: () => void }) => ReactNode\n}\n\nconst SelectContext = createContext<SelectContextValue<Option> | null>(null)\n\nconst useSelectContext = () => {\n const context = use(SelectContext)\n\n if (!context) {\n throw new Error(\"Select components must be wrapped in <Select />\")\n }\n\n return context\n}\n\nconst DefaultOptionView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultSingleTriggerView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultMultiTriggerView = <T extends Option>({\n values,\n selectedAll,\n}: MultiSelectTriggerViewProps<T>) => {\n const { allSelectedLabel } = useSelectContext()\n const displayValue = selectedAll\n ? allSelectedLabel\n : values.length === 0\n ? // NOTE: Zero length is impossible - an empty option with `placeholder` is always returned\n \"Select...\"\n : values.length === 1\n ? values[0].label\n : `${values.length} selected`\n\n return <>{displayValue}</>\n}\n\nexport const Select = <T extends Option>(props: SelectProps<T>) => {\n const {\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n required,\n value,\n name,\n multiple,\n variant = \"outline\",\n size = \"md\",\n dropdownIconType = \"dropdown\",\n loading = false,\n clearable = false,\n disabled = false,\n placeholder = \"Select...\",\n loadingPlaceholder = \"Loading...\",\n allSelectedLabel = \"All selected\",\n noneLabel = \"None\",\n pill: pillProp,\n listMinWidth,\n options,\n actions: propActions = [],\n side,\n avoidCollisions = true,\n onChange,\n optionClassName,\n OptionView = DefaultOptionView,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n TriggerView: TriggerViewFromProps,\n searchPlaceholder = \"\",\n searchAriaLabel = \"Search options\",\n searchSize,\n searchPredicate = defaultSearchPredicate,\n searchEmptyMessage = \"No results found.\",\n trigger,\n checkPosition = 'start',\n } = props\n const pill = useFieldRowPill(pillProp)\n // At the end of a Field row the menu opens from the row's end and fits its options: on a phone\n // the trigger there is only as wide as its value, so a menu of the trigger's width breaks every word.\n // In a `FieldGroup columns` the value starts at the column, and so does its menu.\n const inRow = useFieldRow()\n const inColumns = useFieldColumns()\n // Block default is dynamic, based on `variant`\n const block = props.block ?? variant !== \"ghost\"\n // Align default is dynamic, based on the row and `block`\n const align = props.align ?? (inRow ? (inColumns ? \"start\" : \"end\") : block ? \"center\" : \"start\")\n // Flush with the trigger's edge, as the prop documents. The old -5 nudge for\n // \"start\"/\"end\" tried to line the option labels up with the trigger's text and\n // instead left the menu hanging past the field it belongs to.\n const alignOffset = props.alignOffset ?? 0\n\n // Create stable, mutable references to avoid memoization requirements from consumers\n const onSelectRef = useLatestValue((selectedOption: T, removeOption?: boolean) => {\n if (disabled || loading || getOptionByValue(options, selectedOption.value)?.disabled) return\n if (multiple) {\n // When clearing values, the value is an\n if (!selectedOption.value) {\n onChange([])\n return\n }\n\n if (removeOption) {\n const nextValues = value.filter((v) => v !== selectedOption.value)\n const currentSelectedOptions = getOptionsByValues(options, nextValues)\n onChange(currentSelectedOptions)\n } else {\n const currentSelectedOptions = getOptionsByValues(options, value)\n onChange(currentSelectedOptions.concat(selectedOption))\n }\n } else {\n onChange(selectedOption)\n }\n })\n\n const searchPredicateRef = useRef<SearchPredicate<T>>(searchPredicate)\n searchPredicateRef.current = searchPredicate\n\n // It should be exceedingly uncommon to change actions dynamically, and they are unlikely to be a stable array reference from consumers\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally limiting when this stable value changes to length of actions\n const actions = useMemo<Actions>(() => propActions, [propActions.length])\n // We need to ensure that when action callbacks are called, we have fresh function references, even if the other action details did not change.\n const propActionsRef = useRef<Actions>(propActions)\n propActionsRef.current = propActions\n const onActionSelect = useCallback<CallbackWithActionId>((actionId: string) => {\n if (disabled || loading) return\n propActionsRef.current.find((a) => a.id === actionId)?.onSelect(actionId)\n }, [disabled, loading])\n\n // Determine when custom selects should be used\n const optionsCount = useMemo(\n () =>\n isOptionGroupArray(options)\n ? options.reduce((acc: number, group) => {\n return acc + group.options.length\n }, 0)\n : options.length,\n [options],\n )\n\n // Using ID for DOM selection instead of passing around and merging a ref. Pick your poison.\n const internalTriggerId = useId()\n const triggerId = `select-trigger-${internalTriggerId}`\n\n // Locking down searchable count to a single value. Could make this customizable in the future, but would want guardrails.\n // A phone's list is an iOS menu, and a menu has no search: a long list scrolls (iOS-menu IMG_5490, Add Payment's\n // Province, 52 options; the owner 10.11 on a search row in the list), so it opens with no keyboard either. The window\n // decides, as for the list's place: the list is portaled out of any PhoneLayout.\n const phone = usePhoneWindow()\n const searchable = optionsCount > 15 && !phone\n // An iOS pop-up button has no clear button: its value is unset by a None row, first in the list and in a section of\n // its own, checked while nothing is chosen (Reminders' Early Reminder, iOS-menu IMG_5821). The window decides, as for\n // the search.\n // A custom trigger owns its clearing, so only the default one gives its clear button to the row.\n const noneRow = clearable && phone && !trigger\n\n // A block menu matches its field. An inline one, or one at the end of a Field row, fits its\n // options: no narrower than its trigger (the CSS fallback reads the trigger width), no wider than 300px.\n const fitsOptions = (!block || inRow) && props.listWidth === undefined\n const listWidth = props.listWidth ?? (fitsOptions ? \"auto\" : undefined)\n const listMaxWidth = props.listMaxWidth ?? (fitsOptions ? 300 : \"auto\")\n\n // Narrow known values for context\n const dynamicContextProps = useMemo<\n SingleSelectContextValue<T> | MultiSelectContextValue<T>\n >(() => {\n if (multiple) {\n return {\n multiple: true,\n value: value as string[],\n TriggerView: TriggerViewFromProps ?? DefaultMultiTriggerView,\n }\n }\n\n return {\n multiple: false,\n value: value as string,\n TriggerView: TriggerViewFromProps ?? DefaultSingleTriggerView,\n }\n }, [multiple, value, TriggerViewFromProps])\n\n const store = useMemo<SelectContextValue<T>>(\n () => ({\n ...dynamicContextProps,\n triggerId,\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n // Forward props\n name,\n required,\n options,\n placeholder,\n loadingPlaceholder,\n allSelectedLabel,\n loading,\n clearable,\n noneRow,\n noneLabel,\n variant,\n pill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchAriaLabel,\n searchSize,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchPredicateRef,\n // Derived state\n searchable,\n disabled,\n trigger,\n checkPosition,\n }),\n [\n dynamicContextProps,\n triggerId,\n id,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaInvalid,\n required,\n name,\n options,\n placeholder,\n loadingPlaceholder,\n allSelectedLabel,\n loading,\n clearable,\n noneRow,\n noneLabel,\n variant,\n pill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchAriaLabel,\n searchSize,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchable,\n disabled,\n trigger,\n checkPosition,\n ],\n )\n\n return (\n // NOTE: Cannot peacefully coerce SelectContextValue into a generic, so casting to any here.\n // This is safe because `store` is strongly typed above.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n <SelectContext.Provider value={store as any}>\n <CustomSelect />\n </SelectContext.Provider>\n )\n}\n\n// ============================================================\n// Trigger\n// ============================================================\ntype SelectTriggerProps = {\n onOpenChange?: (maybeNextState?: boolean) => void\n tabIndex?: number\n [\"aria-hidden\"]?: \"false\" | \"true\"\n ref?: React.Ref<HTMLButtonElement | null>\n}\n\nexport const SelectTrigger = (props: SelectTriggerProps) => {\n const {\n triggerId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n id,\n required,\n value,\n multiple,\n options,\n loading,\n disabled,\n clearable,\n noneRow,\n name,\n variant,\n pill,\n size,\n dropdownIconType,\n placeholder,\n loadingPlaceholder,\n block,\n opticallyAlign,\n triggerClassName,\n TriggerStartIcon,\n TriggerView,\n onSelectRef,\n } = useSelectContext()\n const {\n onOpenChange,\n // pass along props from Radix\n ...restProps\n } = props\n const firstValue = multiple ? value[0] : value\n const placeholderValue = loading ? loadingPlaceholder : placeholder\n\n const selectedItem = useMemo<Option>(\n () =>\n getOptionByValue(options, firstValue) || {\n value: \"\",\n label: placeholderValue,\n },\n [firstValue, options, placeholderValue],\n )\n const hasSelectedValue = multiple ? value.length > 0 : !!value\n const isPlaceholder = loading || !hasSelectedValue\n\n const typeahead = useMemo(() => createTypeahead(), [])\n\n const multipleTriggerViewProps = useMemo<MultiSelectTriggerViewProps<Option>>(() => {\n if (!multiple) {\n return { values: [], selectedAll: false }\n }\n\n const currentSelectedOptions = getOptionsByValues(options, value)\n const flatOptions = options.flatMap((o) => (\"options\" in o ? o.options : o))\n\n return {\n values: currentSelectedOptions.length\n ? currentSelectedOptions\n : [\n {\n value: \"\",\n label: placeholderValue,\n },\n ],\n selectedAll: flatOptions.length <= value.length,\n }\n }, [multiple, options, value, placeholderValue])\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLButtonElement>) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n\n // If not a command, check for typeahead\n // NOTE: Typeahead not supported in multi-select\n if (!multiple && isTypeaheadKey(evt)) {\n const currentTypeaheadValue = typeahead(key)\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value\n // NOTE: We don't look at current highlighted value as a means to start the search\n const firstMatchingOption = getTypeaheadOption(options, currentTypeaheadValue, firstValue)\n\n if (firstMatchingOption) {\n onSelectRef.current(firstMatchingOption)\n }\n }\n }\n\n const handleClearClick = () => {\n onSelectRef.current({ value: \"\", label: \"\" })\n // Ensure open state is closed\n onOpenChange?.(false)\n }\n\n return (\n <SelectControl\n id={triggerId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ? `${ariaLabelledBy} ${triggerId}-value` : undefined}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n className={triggerClassName}\n selected={!isPlaceholder}\n variant={variant}\n pill={pill}\n block={block}\n size={size}\n disabled={disabled}\n loading={loading}\n StartIcon={TriggerStartIcon}\n opticallyAlign={opticallyAlign}\n dropdownIconType={dropdownIconType}\n // On a phone the list's None row unsets the value: an iOS pop-up button has no clear button. The mark lets CSS\n // hide it from the first paint, before a server-rendered page knows the window (SelectControl.module.css)\n onClearClick={clearable && !noneRow ? handleClearClick : undefined}\n data-select-none-row={clearable ? \"\" : undefined}\n onInteract={onOpenChange}\n interactOnEnter\n onKeyDown={handleKeyDown}\n {...restProps}\n >\n {ariaLabelledBy ? (\n <span id={`${triggerId}-value`}>\n {multiple ? <TriggerView {...multipleTriggerViewProps} /> : <TriggerView {...selectedItem} />}\n </span>\n ) : multiple ? <TriggerView {...multipleTriggerViewProps} /> : <TriggerView {...selectedItem} />}\n {(name || id) &&\n // One input per selected value, so a form submits every value of a\n // multi-select; an empty one keeps `id` and `required` working\n (multiple && value.length ? value : [firstValue ?? \"\"]).map((formValue, index) => (\n <input\n key={index}\n id={index === 0 ? id : undefined}\n name={name}\n value={formValue}\n // A disabled select is neither validated nor submitted\n disabled={disabled}\n tabIndex={-1}\n onFocus={() => {\n document.getElementById(triggerId)?.focus()\n }}\n // A label's `for` lands here, and its click opens the list like a press on the trigger\n onClick={() => {\n if (!loading) {\n onOpenChange?.(true)\n }\n }}\n // keep react from complaining - don't make this readOnly because that\n // prevents the value from being required\n onChange={() => {}}\n required={required}\n className={s.FormInput}\n aria-hidden=\"true\"\n />\n ))}\n </SelectControl>\n )\n}\n\n// ============================================================\n// Custom Select\n// ============================================================\nconst CustomSelect = () => {\n const {\n loading,\n disabled,\n side,\n align,\n alignOffset,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n trigger,\n pill,\n } = useSelectContext()\n const [open, setOpen] = useState<boolean>(false)\n const floatingBoundary = useFloatingBoundary(open && avoidCollisions, { bottom: 30, top: 30 })\n const selectContentRef = useRef<HTMLDivElement>(null)\n // The trigger element, the default one or a custom `trigger` (which has no `triggerId`)\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n // Both as state too, for the effects below: the list mounts after the trigger's cover is known\n const [triggerElement, setTriggerElement] = useState<HTMLButtonElement | null>(null)\n const setTrigger = useCallback((node: HTMLButtonElement | null) => {\n popoverTriggerRef.current = node\n setTriggerElement(node)\n }, [])\n const [contentElement, setContentElement] = useState<HTMLDivElement | null>(null)\n const setContent = useCallback((node: HTMLDivElement | null) => {\n selectContentRef.current = node\n setContentElement(node)\n }, [])\n // On a phone the list opens over its trigger, as the pop-up menu of an iOS picker does (ref-app pickers, block 8:\n // the 250pt menu stands over the row's value, its end at the chevron's end, the value hidden under it), and toward\n // the larger part of the screen, as Menu does (menuTriggerCover.ts)\n // Only in a phone-wide window, where the list is laid out as on a phone (Select.module.css)\n const [cover, setCover] = useState<MenuTriggerCover | null>(null)\n useLayoutEffect(() => {\n if (!open || !triggerElement) return\n return observeMenuTriggerCover(triggerElement, setCover, { windowOnly: true })\n }, [open, triggerElement])\n // The covered trigger is hidden while the list is open, and shown again as it closes, before focus returns to it\n useLayoutEffect(() => {\n if (!open || !cover || !triggerElement || !contentElement) return\n return markCoveredMenuTrigger(triggerElement, contentElement)\n }, [open, cover, triggerElement, contentElement])\n // A mouse opens the list as its button goes down, so on a phone the list is under it when the button comes up: that\n // release chooses nothing while it is over the trigger, as in Menu\n useEffect(() => {\n if (!triggerElement) return\n const press = (event: PointerEvent) => {\n if (event.button === 0 && isHoverPointer(event)) ignoreReleaseOverTrigger(triggerElement, event.pointerId)\n }\n triggerElement.addEventListener(\"pointerdown\", press)\n return () => triggerElement.removeEventListener(\"pointerdown\", press)\n }, [triggerElement])\n const focusRestoreRef = useRef<ReturnType<typeof createFocusRestore> | null>(null)\n const focusRestoreTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n\n useEffect(() => {\n const focusRestore = createFocusRestore(popoverTriggerRef.current?.ownerDocument ?? document)\n focusRestoreRef.current = focusRestore\n return () => {\n clearTimeout(focusRestoreTimer.current)\n focusRestore.dispose()\n focusRestoreRef.current = null\n }\n }, [])\n\n const handleOpenChange = useCallback((maybeNextState?: boolean) => {\n clearTimeout(focusRestoreTimer.current)\n // Toggle the current state when called without a specific state\n const nextState = maybeNextState === undefined ? !open : maybeNextState\n if (nextState && (disabled || loading)) return\n setOpen(nextState)\n\n // When we're closing, manage focus back to trigger manually\n if (!nextState) {\n // Read this now: with animations disabled the menu unmounts before the\n // timeout below runs, so selectContentRef is already null by then\n const focusWasInMenu = !!selectContentRef.current?.contains(document.activeElement)\n\n // Wait until the next tick to determine if another element has become focused\n focusRestoreTimer.current = setTimeout(() => {\n const activeElement = document.activeElement\n const menu = selectContentRef.current\n const focusInMenu = !!menu && !!activeElement && menu.contains(activeElement)\n // Focus dropped with the closing menu lands on <body>: it was lost, not moved\n const focusLost = !activeElement || activeElement === document.body\n\n // Focus that moved to another element outside the menu stays there\n if (focusInMenu || (focusWasInMenu && focusLost)) {\n const trigger = popoverTriggerRef.current\n if (trigger) focusRestoreRef.current?.restore(trigger)\n }\n })\n }\n }, [disabled, loading, open])\n\n // Forget the open request when availability changes, so re-enabling does not\n // reopen an old menu. Radix's exit autofocus below handles this close.\n if (open && (disabled || loading)) setOpen(false)\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n return (\n <Popover.Root\n open={open}\n onOpenChange={(nextState) => {\n // Prevent opening while loading\n if (loading && nextState) {\n return\n }\n\n handleOpenChange(nextState)\n }}\n modal={false}\n >\n <Popover.Trigger asChild ref={setTrigger}>\n {trigger ? trigger({ open, onToggle: () => { if (!disabled && !loading) setOpen((current) => !current) } }) : <SelectTrigger onOpenChange={handleOpenChange} />}\n </Popover.Trigger>\n <Popover.Portal forceMount>\n <TransitionGroup className={s.Menu} {...overlayTiming} overlay>\n {open && (\n <Popover.Content\n key=\"dropdown\"\n ref={setContent}\n forceMount\n className={s.MenuList}\n data-pill={pill ? \"\" : undefined}\n // A list that fits its options is the 250pt of an iOS menu on a phone (Select.module.css)\n data-list-width={listWidth === \"auto\" ? \"auto\" : undefined}\n // A list given its own width keeps it on a phone too, below the 250pt\n data-list-sized={typeof listWidth === \"number\" ? \"\" : undefined}\n side={side ?? cover?.side ?? \"bottom\"}\n sideOffset={cover ? cover.sideOffset : 5}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n {...floatingBoundary}\n // Prevent Radix auto focus so we can handle our own from within <CustomSelectMenu />\n onOpenAutoFocus={preventDefaultHandler}\n // Radix waits until the animation completes before directing focus, which is janky.\n onCloseAutoFocus={(event) => {\n if (disabled || loading) {\n keepMovedFocus(event)\n const trigger = popoverTriggerRef.current\n if (!event.defaultPrevented && trigger) focusRestoreRef.current?.restore(trigger)\n }\n event.preventDefault()\n }}\n onEscapeKeyDown={preventDefaultHandler}\n style={toCssVariables({\n \"select-list-width\": listWidth,\n \"select-list-min-width\": listMinWidth,\n // \"auto\" is no maximum: the variable is left out, so a phone's 250pt floor can read the cap\n \"select-list-max-width\": listMaxWidth === \"auto\" ? undefined : listMaxWidth,\n })}\n >\n <CustomSelectMenu onOpenChange={handleOpenChange} />\n </Popover.Content>\n )}\n </TransitionGroup>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\ntype CustomSelectMenuContextValue = {\n openingValue: string\n listId: string\n requestCloseRef: React.RefObject<() => void | null>\n listRef: React.RefObject<HTMLDivElement | null>\n // Highlighting\n highlightedValue: string\n setHighlightedValue: React.Dispatch<React.SetStateAction<string>>\n // Search\n searchTerm: string\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>\n searchInputRef: React.RefObject<HTMLInputElement | null>\n}\n\nconst CustomSelectMenuContext = createContext<CustomSelectMenuContextValue | null>(null)\n\nconst useCustomSelectMenuContext = () => {\n const context = use(CustomSelectMenuContext)\n\n if (!context) {\n throw new Error(\"CustomSelectMenu components must be wrapped in <CustomSelectMenu />\")\n }\n\n return context\n}\n\ntype CustomSelectMenuProps = {\n onOpenChange: (maybeNextState?: boolean) => void\n}\n\nconst CustomSelectMenu = ({ onOpenChange }: CustomSelectMenuProps) => {\n const { multiple, value, options, searchable, searchPredicateRef, listWidth, noneRow } = useSelectContext()\n const requestCloseRef = useRef<() => void>(() => onOpenChange(false))\n const menuRef = useRef<HTMLDivElement>(null)\n const listRef = useRef<HTMLDivElement>(null)\n const searchInputRef = useRef<HTMLInputElement>(null)\n const [searchTerm, setSearchTerm] = useState(\"\")\n const [highlightedValue, setHighlightedValue] = useState<string>(() => {\n // With nothing chosen, the None row is the checked one\n if (noneRow && !hasChosenOption(options, value)) return NONE_OPTION_VALUE\n const selectedValue = multiple ? value[0] : value\n return (selectedValue || getFirstValidOption(options)?.value) ?? \"\"\n })\n const typeahead = useMemo(() => createTypeahead(), [])\n const internalListId = useId()\n const listId = `select-list-${internalListId}`\n\n // Lock `value` for a given open to prevent janky change during close animation\n // MultiSelect reads its live selection instead of this per-open snapshot.\n const [openingValue] = useState<string>(() => multiple ? \"\" : value)\n\n // Trim and lowercase search value\n // A term counts only while the list has its search: one typed on a desktop is dropped when the window narrows to a\n // phone, whose list has none\n const literalSearchTerm = useMemo(() => (searchable ? searchTerm.trim().toLocaleLowerCase() : \"\"), [searchable, searchTerm])\n const filteredOptions = useMemo(\n () => filterOptions(options, literalSearchTerm, searchPredicateRef.current),\n [options, literalSearchTerm, searchPredicateRef],\n )\n const firstOption = useMemo(() => getFirstValidOption(filteredOptions), [filteredOptions])\n const shownValuesRef = useRef(optionValues(filteredOptions))\n\n // Regrettable requirement for running an effect *after* mount\n const isMountStableRef = useRef<boolean>(false)\n\n const handleKeyDown = (evt: React.KeyboardEvent) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n const firstValue = multiple ? value[0] : value\n const targetValue = highlightedValue || firstOption?.value || firstValue\n const isFocusedInSearch = document.activeElement === searchInputRef.current\n\n const menuElement = menuRef.current\n\n // Should be generally impossible for menuRef.current to not exist\n // unless we've unmounted and manage to fire this handler.\n if (!menuElement) {\n return\n }\n\n const triggerHighlightedOption = () => {\n const selectedOption = findOptionByValue(highlightedValue, menuElement)\n selectedOption?.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, cancelable: true, detail: 0 }))\n }\n\n const highlightOption = (val: string, element: Element) => {\n setHighlightedValue(val)\n element.scrollIntoView({ block: \"nearest\" })\n }\n\n const highlightSelectedOrFirstOption = () => {\n // Attempt to move highlight to selected item\n const maybeFirstValue = multiple ? value[0] : value\n\n if (maybeFirstValue) {\n const selectedElement = findOptionByValue(maybeFirstValue, menuElement)\n\n if (selectedElement) {\n highlightOption(maybeFirstValue, selectedElement)\n return\n }\n }\n\n // Without a value the None row is the checked one\n const noneElement = noneRow && !hasChosenOption(options, value) ? findOptionByValue(NONE_OPTION_VALUE, menuElement) : null\n if (noneElement) {\n highlightOption(NONE_OPTION_VALUE, noneElement)\n return\n }\n\n // If value isn't set, or the selected node wasn't found in the DOM,\n // attempt to move focus to the first valid option.\n const firstValidOption = getFirstValidOption(options)\n\n if (firstValidOption) {\n const firstValidOptionElement = findOptionByValue(firstValidOption.value, menuElement)\n if (firstValidOptionElement) {\n highlightOption(firstValidOption.value, firstValidOptionElement)\n }\n }\n }\n\n // Commands\n switch (key) {\n case \"ArrowDown\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n // Otherwise, move to the next option\n const nextElement = findNextOption(highlightedValue, menuElement)\n const nextValue = nextElement?.getAttribute(\"data-option-id\")\n if (nextElement && nextValue) {\n highlightOption(nextValue, nextElement)\n }\n\n return\n }\n case \"ArrowUp\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n const previousElement = findPreviousOption(targetValue, menuElement)\n const previousValue = previousElement?.getAttribute(\"data-option-id\")\n if (previousElement && previousValue) {\n highlightOption(previousValue, previousElement)\n }\n\n return\n }\n case \"Enter\":\n // Prevent default enter behavior from the search input, if present\n evt.preventDefault()\n\n // Activate the highlighted option through its click handler\n triggerHighlightedOption()\n\n return\n case \" \":\n // Allow spaces in search, and don't treat as enter\n // if there is a valid literalSearchTerm.\n if (literalSearchTerm && isFocusedInSearch) {\n return\n }\n\n // Prevent space from entering search input\n evt.preventDefault()\n\n // Activate the highlighted option through its click handler\n triggerHighlightedOption()\n\n return\n default:\n break\n }\n\n // If not a command, check for typeahead\n if (isTypeaheadKey(evt)) {\n // Skip typeahead logic when we're focused in the search input\n if (isFocusedInSearch) {\n return\n }\n\n // Extend the current typeahead and get the latest value\n const currentTypeaheadValue = typeahead(key)\n\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value, starting at the highlighted value\n const firstMatchingOption = getTypeaheadOption(\n options,\n currentTypeaheadValue,\n highlightedValue,\n )\n\n if (firstMatchingOption) {\n const matchedNode = findOptionByValue(firstMatchingOption.value, menuElement)\n\n // Only change the highlight if we found the actual node\n if (matchedNode) {\n setHighlightedValue(firstMatchingOption.value)\n // Ensure the newly highlighted option is scrolled into view\n matchedNode.scrollIntoView({ block: \"nearest\" })\n }\n }\n }\n }\n\n const store = useMemo(\n () => ({\n openingValue,\n listId,\n highlightedValue,\n setHighlightedValue,\n requestCloseRef,\n searchTerm,\n setSearchTerm,\n searchInputRef,\n listRef,\n }),\n [openingValue, listId, highlightedValue, setHighlightedValue, searchTerm, setSearchTerm],\n )\n\n // On mount behavior\n useEffect(() => {\n // Ensure initial highlighted option is in view\n // NOTE: Allowing for a render frame ensures content is positioned correctly before scrolling it into view.\n waitForAnimationFrame(() => {\n if (!menuRef.current) {\n return\n }\n\n // Ensure the highlighted option is in view\n const currentOption = findOptionByValue(highlightedValue, menuRef.current)\n // Scroll the selected item into view, and its bottom edge.\n currentOption?.scrollIntoView({ block: \"center\" })\n })\n\n // Send initial focus to the search input, or the list without one (the\n // menu container when there are no options), to capture key events\n const autoFocusTarget = searchInputRef.current || listRef.current || menuRef.current\n autoFocusTarget?.focus({ preventScroll: true })\n\n // Required for <StrictMode>, because we need to unset this token\n // when the hooks are re-run. It's an imperative effect that we need to manage.\n return () => {\n isMountStableRef.current = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally an onMount effect\n }, [])\n\n // The window crossed the phone's width while the list was open: the search came or went (a phone's list has none),\n // so its term is cleared and focus moves to what holds the keys now, the search or the list\n const wasSearchableRef = useRef(searchable)\n useLayoutEffect(() => {\n if (wasSearchableRef.current === searchable) return\n wasSearchableRef.current = searchable\n if (!searchable) setSearchTerm(\"\")\n // The width a desktop list locked for its search would overflow a phone's 250px panel; a desktop locks it again\n if (menuRef.current) {\n menuRef.current.style.minWidth = \"\"\n if (searchable && listWidth === \"auto\") menuRef.current.style.minWidth = `${menuRef.current.offsetWidth}px`\n }\n if (menuRef.current?.contains(document.activeElement) && document.activeElement !== listRef.current) return\n ;(searchable ? searchInputRef.current : listRef.current)?.focus({ preventScroll: true })\n }, [searchable])\n\n // A long list has a search field: the menu keeps the width of all its options as the results narrow.\n useLayoutEffect(() => {\n if (searchable && listWidth === \"auto\" && menuRef.current) {\n menuRef.current.style.minWidth = `${menuRef.current.offsetWidth}px`\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally an onMount effect\n }, [])\n\n // On search behavior\n useLayoutEffect(() => {\n // This effect will run on mount, but we want to skip it.\n // The on mount effect is responsible for handling mount behavior,\n // but this effect is specifically responsible for handling search changes\n if (!isMountStableRef.current) {\n isMountStableRef.current = true\n return\n }\n\n // Impossible while mounted, list ref will exist\n if (!listRef.current) {\n return\n }\n\n // The same list again, as after a pick in a multiple list: nothing moves\n const nextValues = optionValues(filteredOptions)\n if (nextValues === shownValuesRef.current) {\n return\n }\n shownValuesRef.current = nextValues\n\n // Reset scroll position to the top\n listRef.current.scrollTop = 0\n\n // Highlight first item in the list, or the None row while nothing is chosen\n const maybeFirstOption = getFirstValidOption(filteredOptions)\n if (noneRow && !hasChosenOption(options, value)) setHighlightedValue(NONE_OPTION_VALUE)\n else if (maybeFirstOption) setHighlightedValue(maybeFirstOption.value)\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally a reaction to the shown options\n }, [filteredOptions])\n\n // The window crossed the phone's width while the list was open: the None row came or went. With nothing chosen the\n // highlight moves to it; when it goes, a highlight on it moves to the chosen option or the first one.\n const hadNoneRowRef = useRef(noneRow)\n useLayoutEffect(() => {\n if (hadNoneRowRef.current === noneRow) return\n hadNoneRowRef.current = noneRow\n if (noneRow) {\n if (!hasChosenOption(options, value)) setHighlightedValue(NONE_OPTION_VALUE)\n return\n }\n const selectedValue = multiple ? value[0] : value\n setHighlightedValue((current) =>\n current === NONE_OPTION_VALUE ? ((selectedValue || getFirstValidOption(filteredOptions)?.value) ?? \"\") : current,\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally a reaction to the row coming or going\n }, [noneRow])\n\n // The focused element (the search input, or the list without one) points\n // assistive tech at the highlighted option, when that option is rendered\n useLayoutEffect(() => {\n const target = searchInputRef.current || listRef.current\n if (!target || !menuRef.current) {\n return\n }\n\n // A list that gave the keys to a search that came with a wider window points at nothing itself\n if (target !== listRef.current) listRef.current?.removeAttribute(\"aria-activedescendant\")\n const highlightedOption = highlightedValue ? findOptionByValue(highlightedValue, menuRef.current) : null\n if (highlightedOption?.id) {\n target.setAttribute(\"aria-activedescendant\", highlightedOption.id)\n } else {\n target.removeAttribute(\"aria-activedescendant\")\n }\n // The search coming or going moves the keys, so the pointer follows them, and the None row coming or going\n }, [highlightedValue, filteredOptions, searchable, noneRow])\n\n return (\n <CustomSelectMenuContext value={store}>\n <div\n className={s.MenuInner}\n onKeyDown={handleKeyDown}\n ref={menuRef}\n // Without search, the list takes focus (and the tab stop); the container\n // stays focusable so a click on it keeps the keys here\n tabIndex={!searchable && (filteredOptions.length || noneRow) ? -1 : 0}\n >\n {searchable && (\n <CustomSelectSearch value={searchTerm} onChange={setSearchTerm} hasResults={!!filteredOptions.length} />\n )}\n <CustomSelectList filteredOptions={filteredOptions} />\n <CustomSelectActions />\n </div>\n </CustomSelectMenuContext>\n )\n}\n\ntype CustomSelectSearchProps = {\n value: string\n onChange: (nextSearchTerm: string) => void\n /** Whether the list is rendered, for `aria-controls` */\n hasResults: boolean\n}\n\nconst CustomSelectSearch = ({ value, onChange, hasResults }: CustomSelectSearchProps) => {\n const { searchPlaceholder, searchAriaLabel, searchSize } = useSelectContext()\n const { listId, searchInputRef } = useCustomSelectMenuContext()\n\n const handleChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n onChange(evt.target.value)\n }\n\n return (\n <div className={s.Search}>\n <Input\n startAdornment={\n <Search\n width={16}\n height={16}\n className=\"fill-secondary\"\n fill=\"var(--color-text-secondary)\"\n />\n }\n ref={searchInputRef}\n size={searchSize}\n variant=\"ghost\"\n pill\n value={value}\n placeholder={searchPlaceholder}\n aria-label={searchAriaLabel}\n onChange={handleChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-autocomplete=\"list\"\n role=\"combobox\"\n // The list, while there is one: with no results it is not rendered\n aria-controls={hasResults ? listId : undefined}\n aria-expanded\n />\n </div>\n )\n}\n\nconst isOptionGroup = <T extends Option>(\n mixedOption: T | OptionGroup<T>,\n): mixedOption is OptionGroup<T> => {\n return \"options\" in mixedOption\n}\n\nconst isOptionGroupArray = <T extends Option>(arr: Options<T>): arr is OptionGroup<T>[] => {\n return arr[0] && isOptionGroup(arr[0])\n}\n\nconst optionValues = <T extends Option>(options: Options<T>) =>\n (isOptionGroupArray(options) ? options.flatMap((group) => group.options) : options)\n .map((option) => option.value)\n .join(\"\\n\")\n\nconst HARD_OPTIONS_LIMIT = 300\n\nconst CustomSelectList = <T extends Option>({\n filteredOptions,\n}: {\n filteredOptions: Options<T>\n}) => {\n const {\n searchEmptyMessage,\n multiple,\n searchable,\n noneRow,\n noneLabel,\n triggerId,\n trigger,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n } = useSelectContext()\n const { listId, listRef } = useCustomSelectMenuContext()\n\n // A phone's None row still unsets a value when there are no options to show\n if (!filteredOptions.length && !noneRow) {\n return typeof searchEmptyMessage === \"string\" ? (\n <p className={s.SearchEmpty} data-text-only>\n {searchEmptyMessage}\n </p>\n ) : (\n <div className={s.SearchEmpty}>{searchEmptyMessage}</div>\n )\n }\n\n // We hard limit within groups, so at this level we will only limit flat arrays. The limit asks to search for the\n // rest, so a list with no search (a phone's) shows every option, as a long iOS menu scrolls (IMG_5490).\n const isGrouped = isOptionGroupArray(filteredOptions)\n const hardLimit = searchable ? HARD_OPTIONS_LIMIT : Infinity\n const hasHardLimit = !isGrouped && filteredOptions.length > hardLimit\n\n const options = isGrouped\n ? filteredOptions.map((group) => <CustomSelectGroup key={group.label} {...group} />)\n : filteredOptions\n .slice(0, hardLimit)\n .map((option) => <CustomSelectOption key={option.value} {...option} />)\n\n return (\n <div\n id={listId}\n className={s.OptionsList}\n ref={listRef}\n role=\"listbox\"\n // Named like the trigger: its label, or the default trigger itself\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ?? (ariaLabel || trigger ? undefined : triggerId)}\n aria-multiselectable={multiple || undefined}\n // Without search, the list is the focused element\n tabIndex={searchable ? undefined : 0}\n >\n {/* A phone's None row, in a section of its own as in Reminders (IMG_5821); the section is no group to assistive\n tech, so the row is an option of the list */}\n {noneRow && (\n <div className={s.NoneSection} role=\"none\">\n <CustomSelectOption value={NONE_OPTION_VALUE} label={noneLabel} none />\n </div>\n )}\n {options}\n {hasHardLimit && (\n <CustomSelectHardLimit numHidden={filteredOptions.length - HARD_OPTIONS_LIMIT} />\n )}\n </div>\n )\n}\n\nconst DEFAULT_OPTIONS_LIMIT = {\n limit: 100,\n label: \"Show all\",\n}\n\nconst CustomSelectGroup = <T extends Option>({\n label,\n options,\n optionsLimit = DEFAULT_OPTIONS_LIMIT,\n}: OptionGroup<T>) => {\n const groupId = useId()\n const headingId = useId()\n const { searchTerm, setHighlightedValue } = useCustomSelectMenuContext()\n const { searchable } = useSelectContext()\n const [limitExpanded, setLimitExpanded] = useState<boolean>(false)\n\n const hasExpandableLimit = optionsLimit.limit < options.length && !searchTerm && !limitExpanded\n // The hard limit asks to search for the rest: a list with no search (a phone's) shows the whole group once expanded\n const hasHardLimit = searchable && HARD_OPTIONS_LIMIT < options.length && !hasExpandableLimit\n\n let maybeLimitedOptions = options\n if (hasExpandableLimit) {\n maybeLimitedOptions = options.slice(0, optionsLimit.limit)\n } else if (hasHardLimit) {\n maybeLimitedOptions = options.slice(0, HARD_OPTIONS_LIMIT)\n }\n\n const handleLimitExpanded = () => {\n // Expand options\n setLimitExpanded(true)\n\n // Set highlight to the first option from the newly expanded list\n setHighlightedValue(options[optionsLimit.limit].value)\n }\n\n return (\n // A group named by its heading. NOTE: The arrow keys walk every option in\n // document order (findNextOption), so they cross from group to group.\n <div role=\"group\" aria-labelledby={headingId} className={s.OptionGroup}>\n {/* No indicator slot: the heading labels the whole section, so it starts\n at the row's content edge — above the check column, not indented to\n the option labels. Same alignment a grouped menu uses on GitHub. */}\n <div id={headingId} className={s.OptionGroupHeading}>{label}</div>\n {maybeLimitedOptions.map((limitedOptions) => (\n <CustomSelectOption key={limitedOptions.value} {...limitedOptions} />\n ))}\n {hasExpandableLimit && (\n <CustomSelectExpandableLimit\n value={`group-limit-${groupId}`}\n label={optionsLimit.label}\n onPointerUp={handleLimitExpanded}\n />\n )}\n {hasHardLimit && <CustomSelectHardLimit numHidden={options.length - HARD_OPTIONS_LIMIT} />}\n </div>\n )\n}\n\ntype CustomSelectHardLimitProps = {\n numHidden: number\n}\n\nconst CustomSelectHardLimit = ({ numHidden }: CustomSelectHardLimitProps) => {\n const { checkPosition } = useSelectContext()\n\n return (\n <div className={s.OptionHardLimitHeading}>\n {/* The note lines up with the option labels above it, so it borrows their\n indicator column. Without a column there is nothing to line up to. */}\n {checkPosition === 'start' && <div className={s.OptionIndicatorSlot} />}\n {`…and ${numHidden.toLocaleString()} more options. Use search to refine results further.`}\n </div>\n )\n}\n\nconst useSelectPress = (action: () => void) => {\n const press = useMemo(() => createSelectPress(), [])\n return {\n onPointerDown: press.onPointerDown,\n onPointerCancel: press.onPointerCancel,\n onPointerUp: (event: React.PointerEvent) => { if (press.onPointerUp(event)) action() },\n onClick: (event: React.MouseEvent) => { if (press.onClick(event)) action() },\n }\n}\n\ntype CustomSelectExpandableLimitProps = {\n value: string\n label: string\n onPointerUp: () => void\n}\n\nconst CustomSelectExpandableLimit = ({\n value,\n label,\n onPointerUp,\n}: CustomSelectExpandableLimitProps) => {\n const { checkPosition } = useSelectContext()\n const { highlightedValue, setHighlightedValue } = useCustomSelectMenuContext()\n const optionId = useId()\n const press = useSelectPress(onPointerUp)\n\n const isHighlighted = value === highlightedValue\n\n const handlePointerMove = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n // This component acts a LOT like an Option, but has enough bespoke behavior\n // that it cannot literally be one. We copy the important parts of Option for\n // keyboard navigation, UX, etc.\n return (\n <div\n id={optionId}\n className={clsx(s.Option, s.OptionsLimit)}\n data-option-id={value}\n data-highlight={isHighlighted ? \"\" : undefined}\n // An expandable action, never a selected value.\n role=\"option\"\n aria-selected={false}\n {...press}\n onPointerMove={handlePointerMove}\n onPointerLeave={handlePointerLeave}\n >\n <div className={clsx(s.PressableInner, s.OptionInner)}>\n {/* The row lines up with the option labels above it, so it borrows their\n indicator column. Without a column there is nothing to line up to. */}\n {checkPosition === 'start' && <div className={s.OptionIndicatorSlot} />}\n {label}\n </div>\n </div>\n )\n}\n\nconst INTERNAL_DOM_SELECTION_DATA_ATTR = \"data-option-id\"\n\n// The None row's id among the options: it never reaches `onChange`, which gets an empty value instead\nconst NONE_OPTION_VALUE = \"plexui-select-none\"\n\nconst CustomSelectOption = ({ none = false, ...option }: Option & { /** The phone's None row */ none?: boolean }) => {\n const {\n optionClassName,\n OptionView,\n value: propsValue,\n options,\n multiple,\n onSelectRef,\n checkPosition,\n } = useSelectContext()\n const { openingValue, requestCloseRef, highlightedValue, setHighlightedValue } =\n useCustomSelectMenuContext()\n const { value, disabled, tooltip } = option\n // Referenced by the list's aria-activedescendant while highlighted\n const optionId = useId()\n\n // NOTE: SingleSelect mode keeps the opening value instead of the live `propsValue`\n // to avoid selecting the item as the select closes.\n // The None row is checked while nothing is chosen: no value, or none that an option has (the trigger shows the\n // placeholder then)\n const isSelected = none\n ? !hasChosenOption(options, multiple ? propsValue : openingValue)\n : multiple ? propsValue.includes(value) : value === openingValue\n const isHighlighted = value === highlightedValue\n\n const handlePointerUp = () => {\n if (none) {\n // Unsets the value, as the clear button does, and closes the list, a multiple one too: an iOS menu closes on a\n // choice, and None leaves nothing more to choose (owner 10.11)\n onSelectRef.current({ value: \"\", label: \"\" })\n requestCloseRef.current?.()\n } else if (multiple) {\n // Trigger the change ref, optionally as a remove\n onSelectRef.current(option, isSelected)\n } else {\n // Trigger the change ref\n onSelectRef.current(option)\n // Request the dropdown to close\n requestCloseRef.current?.()\n }\n }\n\n const press = useSelectPress(handlePointerUp)\n\n const handlePointerMove = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n return (\n <div\n id={optionId}\n className={clsx(s.Option, optionClassName)}\n data-highlight={isHighlighted ? \"\" : undefined}\n role=\"option\"\n // The selection; the highlight is the list's aria-activedescendant\n aria-selected={isSelected}\n data-selected={isSelected ? \"\" : undefined}\n // Internal attribute for selecting DOM nodes\n {...{ [INTERNAL_DOM_SELECTION_DATA_ATTR]: value }}\n // Allow options to behave like a native select, when you can open and select an item in a single click\n {...(disabled ? {} : press)}\n // Pointer move allows us to prevent contention from keyboard presses and a still mouse\n // which does trigger events like onMouseEnter, creating weird battles with mouse and keyboard focus.\n onPointerMove={disabled ? undefined : handlePointerMove}\n onPointerLeave={disabled ? undefined : handlePointerLeave}\n aria-disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n >\n <div className={s.PressableInner}>\n {checkPosition === 'start' && (\n <div className={s.OptionIndicatorSlot} data-position=\"start\">\n {isSelected && <Check className={s.OptionCheck} />}\n </div>\n )}\n <div className={s.OptionLeading}>\n <div className={s.OptionInner}>\n {none ? option.label : <OptionView {...option} />}\n {tooltip && (\n <Tooltip content={tooltip.content} maxWidth={tooltip.maxWidth} side=\"right\">\n <Info className={s.OptionTooltipIcon} />\n </Tooltip>\n )}\n </div>\n {option.description && (\n <div className={clsx(s.OptionInner, s.OptionDescription)}>\n {option.description}\n </div>\n )}\n {/* An iOS menu has no tooltips: on a phone the tooltip is the row's subtitle, after the description if there\n is one (Select.module.css) */}\n {tooltip && (\n <div className={clsx(s.OptionInner, s.OptionTooltipText)}>{tooltip.content}</div>\n )}\n </div>\n {checkPosition === 'end' && (\n <div className={s.OptionIndicatorSlot} data-position=\"end\">\n {isSelected && <Check className={s.OptionCheck} />}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nconst CustomSelectActions = () => {\n const { actions } = useSelectContext()\n\n if (actions.length === 0) {\n return null\n }\n\n return (\n <div className={s.ActionsContainer}>\n {actions.map((action) => (\n <CustomSelectAction key={action.id} {...action} />\n ))}\n </div>\n )\n}\n\nconst CustomSelectAction = ({ id, label, Icon, className }: Action) => {\n const { onActionSelect } = useSelectContext()\n const { requestCloseRef } = useCustomSelectMenuContext()\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n\n switch (key) {\n case \"Tab\":\n // Allow tabbing to pass propagation as normal,\n // which bubbles up to the focus trap of Radix Popover\n break\n case \"Enter\":\n case \" \":\n evt.stopPropagation()\n evt.preventDefault()\n handlePointerUp()\n break\n default:\n evt.stopPropagation()\n }\n }\n\n const handlePointerUp = () => {\n // Trigger the action's through our context helper, not the method on this action (it may be a stale reference)\n onActionSelect(id)\n // Request to close the dropdown\n requestCloseRef.current?.()\n }\n\n const press = useSelectPress(handlePointerUp)\n\n return (\n <div\n className={s.Action}\n {...press}\n role=\"button\"\n onKeyDown={handleKeyDown}\n tabIndex={0}\n >\n <div className={clsx(s.ActionInner, className)}>\n {Icon && <Icon role=\"presentation\" />}\n {label}\n </div>\n </div>\n )\n}\n\n// ============================================================\n// Utilities\n// ============================================================\nconst defaultSearchPredicate = (option: Option, searchTerm: string) =>\n option.label.toLowerCase().includes(searchTerm)\n\nconst filterOptions = <T extends Option>(\n options: Options<T>,\n searchTerm: string,\n searchIterator: SearchPredicate<T>,\n): Options<T> => {\n const searchValue = searchTerm.trim().toLocaleLowerCase()\n\n if (!searchValue) {\n return options\n }\n\n const filterOption = (option: T): boolean => searchIterator(option, searchValue)\n\n if (isOptionGroupArray(options)) {\n return options.reduce((acc, group) => {\n const filtered = group.options.filter(filterOption)\n\n if (filtered.length) {\n acc.push({\n ...group,\n options: filtered,\n })\n }\n return acc\n }, [] as OptionGroup<T>[])\n } else {\n return options.reduce((acc, option) => {\n if (filterOption(option)) acc.push(option)\n return acc\n }, [] as T[])\n }\n}\n\nconst getFirstValidOption = <T extends Option>(options: Options<T>): T | undefined => {\n if (!options.length) {\n return undefined\n }\n\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const firstNonDisabled = opt.options.find((i) => !i.disabled)\n if (firstNonDisabled) {\n found = firstNonDisabled\n break\n }\n } else {\n if (!opt.disabled) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionByValue = <T extends Option>(options: Options<T>, value: string): T | undefined => {\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.find((i) => i.value === value)\n if (exists) {\n found = exists\n break\n }\n } else {\n if (opt.value === value) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\n// Whether a value names an option: a value no option has shows the placeholder, as no value does\nconst hasChosenOption = <T extends Option>(options: Options<T>, value: string | string[]): boolean =>\n Array.isArray(value) ? getOptionsByValues(options, value).length > 0 : !!getOptionByValue(options, value)\n\nconst getOptionsByValues = <T extends Option>(options: Options<T>, values: string[]): T[] => {\n let found: T[] = []\n const lookup = new Set(values)\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.filter((i) => lookup.has(i.value))\n found = found.concat(exists)\n } else {\n if (lookup.has(opt.value)) {\n found.push(opt)\n }\n }\n }\n\n return found\n}\n\nconst MAX_DOM_CRAWLS = 40\n\nconst findOptionByValue = (currentValue: string, container: HTMLElement) =>\n container.querySelector(`[data-option-id=\"${CSS.escape(currentValue)}\"]`)\n\nconst isValidOptionNode = (node: Element) => node.matches(\"[data-option-id]:not([data-disabled])\")\n\n// Steps from the current option to the nearest enabled one, one option row at a\n// time in document order: across groups (siblings would stop at a group's\n// edge), skipping disabled rows, at most MAX_DOM_CRAWLS rows away\nconst findAdjacentOption = (currentValue: string, container: HTMLElement, step: 1 | -1) => {\n const currentOption = findOptionByValue(currentValue, container)\n const rows = Array.from(container.querySelectorAll(\"[data-option-id]\"))\n\n let index = currentOption ? rows.indexOf(currentOption) : -1\n if (index === -1) {\n return undefined\n }\n\n for (let maxSteps = 0; maxSteps < MAX_DOM_CRAWLS; maxSteps += 1) {\n index += step\n const nextNode = rows[index]\n\n if (!nextNode) {\n return undefined\n }\n\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n }\n}\n\nconst findNextOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, 1)\n\nconst findPreviousOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, -1)\n\nconst createTypeahead = () => {\n let currentValue: string = \"\"\n let timeoutId: ReturnType<typeof setTimeout>\n\n return (char: string) => {\n // Searching is case-insensitive\n char = char.toLowerCase()\n\n // Add the new character to the current value\n currentValue += char\n\n // Clear the previous timeout if there was one\n if (timeoutId) clearTimeout(timeoutId)\n\n // Reset the value after a brief delay\n timeoutId = setTimeout(() => {\n currentValue = \"\"\n }, 500)\n\n // When a user is typing the same value, like \"llll\", assume they are cycling through items starting with \"l\"\n // We continue to build up the string in case another letter is typed, and then release the full value.\n // For example, if the user types \"ooog\", it will return \"o\", until \"g\" is typed, and then return the \"ooog\".\n const isCycling = char.repeat(currentValue.length) === currentValue\n\n // Return the typeahead value\n return isCycling ? char : currentValue\n }\n}\n\nconst isValidTypeaheadChar = (char: string): boolean => /^[a-zA-Z0-9]$/.test(char)\n\n// A shortcut (Ctrl+C, Cmd+A, Alt+letter) or a key another handler took is not typeahead\nconst isTypeaheadKey = (evt: React.KeyboardEvent): boolean =>\n isValidTypeaheadChar(evt.key) && !evt.ctrlKey && !evt.metaKey && !evt.altKey && !evt.defaultPrevented\n\nconst getTypeaheadOption = <T extends Option>(\n options: Options<T>,\n typeaheadValue: string,\n currentHighlightValue?: string,\n): T | undefined => {\n // Ensure options actually exist\n if (!options.length) {\n return undefined\n }\n\n let matchBeforeHighlight: T | undefined\n // If we' aren't provided a highlighted value, start from the top (e.g., act like it's found)\n let foundHighlightedValue: boolean = !currentHighlightValue\n\n const optionValidAndMatches = ({ disabled, label, value }: T) => {\n // Side effect of looping\n if (value === currentHighlightValue) {\n foundHighlightedValue = true\n // Don't return highlighted value\n return false\n }\n\n return !disabled && label.toLowerCase().startsWith(typeaheadValue)\n }\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n for (const option of opt.options) {\n if (optionValidAndMatches(option)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match, in any group\n return option\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || option\n }\n }\n }\n } else {\n if (optionValidAndMatches(opt)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match\n return opt\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || opt\n }\n }\n }\n }\n\n return matchBeforeHighlight\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,GAAG,EACH,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAChH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,M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H,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,IAAI,qBAAqB,EAAE,CAAC;oBAC1B,8CAA8C;oBAC9C,OAAO,GAAG,CAAA;gBACZ,CAAC;qBAAM,CAAC;oBACN,sCAAsC;oBACtC,oBAAoB,GAAG,oBAAoB,IAAI,GAAG,CAAA;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Popover } from \"radix-ui\"\nimport React, {\n createContext,\n type ReactNode,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useFloatingBoundary } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { useFieldColumns, useFieldRow, useFieldRowPill } from \"../../lib/fieldRow\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables, waitForAnimationFrame } from \"../../lib/helpers\"\nimport { Check, Info, Search } from \"../Icon\"\nimport type { ControlSize } from \"../../types\"\nimport { Input } from \"../Input\"\nimport { SelectControl, type SelectControlProps } from \"../SelectControl\"\nimport { Tooltip } from \"../Tooltip\"\nimport { TransitionGroup } from \"../Transition\"\nimport { overlayTiming } from \"../Transition/shared\"\nimport { isHoverPointer } from \"../../lib/inputMode\"\nimport { createSelectPress } from \"../../lib/selectPress\"\nimport { createFocusRestore } from \"../../lib/focusRestore\"\nimport { ignoreReleaseOverTrigger, markCoveredMenuTrigger, observeMenuTriggerCover, type MenuTriggerCover } from \"../../lib/menuTriggerCover\"\nimport { usePhoneWindow } from \"../PhoneLayout/PhoneLayout\"\nimport s from \"@plexui/styles/components/Select/Select.module.css\"\n\nexport type Option<T extends string = string> = {\n value: T\n label: string\n /** Disable the option */\n disabled?: boolean\n /** Displayed as secondary text below the option `label` */\n description?: React.ReactNode\n tooltip?: {\n content: React.ReactNode\n maxWidth?: number\n }\n}\n\nexport type OptionGroup<T extends Option> = {\n label: string\n options: T[]\n optionsLimit?: {\n label: string\n limit: number\n }\n}\n\nexport type Options<T extends Option> = T[] | OptionGroup<T>[]\n\ntype CallbackWithOption<T extends Option> = (option: T) => void\ntype CallbackWithOptions<T extends Option> = (options: T[]) => void\ntype CallbackWithActionId = (actionId: string) => void\ntype SearchPredicate<T extends Option> = (option: T, searchTerm: string) => boolean\n\ntype Action = {\n /** Unique ID to identify the action with */\n id: string\n /** Label display for the action */\n label: string\n /** Icon displayed to the left of the action */\n Icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>\n /** Custom class applied to the action container */\n className?: string\n /** Callback invoked when the action is pressed */\n onSelect: CallbackWithActionId\n}\n\ntype Actions = Action[]\n\nexport type PopoverSide = \"top\" | \"bottom\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\n\ntype SingleSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple?: false\n value: string\n onChange: CallbackWithOption<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created inline.\n */\n TriggerView?: React.FC<T>\n}\n\ntype MultiSelectTriggerViewProps<T extends Option> = {\n values: T[]\n selectedAll: boolean\n}\n\ntype MultiSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple: true\n value: string[]\n onChange: CallbackWithOptions<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created line.\n */\n TriggerView?: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\ntype SelectAccessibilityProps = Pick<SelectControlProps, \"aria-label\" | \"aria-labelledby\" | \"aria-describedby\" | \"aria-invalid\">\n\nexport type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectProps<T>) & SelectAccessibilityProps & {\n options: Options<T> // Should be passed as a stable reference\n /**\n * Disables the select visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Allows the select to be targeted with htmlFor\n */\n id?: string\n /**\n * Marks the select as a required field when using native form submission\n */\n required?: boolean\n /**\n * Creates the ability to query the value with `[name=\"${name}\"]`\n */\n name?: string\n /**\n * Placeholder text for the select\n * @default Select...\n */\n placeholder?: string\n /**\n * Placeholder text for the select while loading. Behaves exactly like `placeholder`, and `value` will be shown if provided.\n * @default Loading...\n */\n loadingPlaceholder?: string\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Style variant for the select trigger\n * @default outline\n */\n variant?: SelectControlProps[\"variant\"]\n /**\n * Determines if the select trigger should be a fully rounded pill shape\n * @default false, or true at the end of a `Field row`\n */\n pill?: boolean\n /**\n * The list in the rounder shape of a pill menu (as `Menu.Content pill`), whatever the trigger: a custom `trigger` or a\n * rounded field can open the same list as a pill one\n * @default the trigger's `pill`\n */\n listPill?: boolean\n /**\n * Text of a `multiple` trigger when every option is selected\n * @default All selected\n */\n allSelectedLabel?: string\n /**\n * Controls size of the select trigger, and several other aspects of trigger styling.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n * @default md\n */\n size?: SelectControlProps[\"size\"]\n /**\n * Icon displayed in the far right of the select trigger\n * @default dropdown\n */\n dropdownIconType?: SelectControlProps[\"dropdownIconType\"]\n /**\n * Actions to display below the options list.\n */\n actions?: Actions // Memoized by length, don't assume dynamic changes are supported\n /** Custom class applied to option containers */\n optionClassName?: string\n /**\n * Customize the rendered output of individual options\n * NOTE: Must be passed as a stable reference, not created line.\n */\n OptionView?: React.FC<T>\n /** Icon displayed at the start of the select trigger */\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n /**\n * Custom class applied to the select trigger\n */\n triggerClassName?: string // If consumers need deep customization of the trigger\n /**\n * Applies a negative margin using the current gutter to optically align the trigger\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Display a clear action that allows the select to be unset. On a phone it is the first row of the list, `noneLabel`,\n * as an iOS pop-up button unsets its value with a None row instead of a clear button; a custom `trigger` keeps its\n * own clearing and gets no None row.\n * @default false\n */\n clearable?: boolean\n /**\n * Label of the row that unsets a `clearable` select on a phone\n * @default None\n */\n noneLabel?: string\n /**\n * Extends select to 100% of available width.\n * @default true\n */\n block?: boolean\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.\n * Without one the list opens below its trigger, and on a phone over it, toward the larger part of the screen.\n * @default bottom\n */\n side?: PopoverSide\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default \"end\" at the end of a `Field row` (\"start\" in a `FieldGroup columns`), \"center\" when block, otherwise \"start\"\n */\n align?: PopoverAlign\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n /**\n * Prevents collision detection in the custom menu. Use with caution.\n * @default true\n */\n avoidCollisions?: boolean\n /**\n * Set the width of the custom select menu\n * @default the width of the trigger (fits the options when not block or at the end of a `Field row`)\n */\n listWidth?: number | \"auto\"\n /**\n * Defines the `min-width` property of the custom select menu, in pixels.\n * @default the width of the trigger\n */\n listMinWidth?: number | \"auto\"\n /**\n * Defines the `max-width` property of the custom select menu, in pixels.\n * @default auto (300 when it fits the options)\n */\n listMaxWidth?: number | \"auto\"\n /** Predicate used to filter searches */\n searchPredicate?: SearchPredicate<T>\n /** Placeholder of the search input */\n searchPlaceholder?: string\n /** Accessible name of the search input, independent of the trigger label. */\n searchAriaLabel?: string\n /**\n * Size of the search input in the menu. A phone list has no search: it is\n * an iOS menu, and a long one scrolls.\n * @default md\n */\n searchSize?: ControlSize\n /**\n * Message displayed when search results are empty. Can be a simple string, or custom JSX.\n */\n searchEmptyMessage?: ReactNode\n /**\n * Render a custom trigger element instead of the default `SelectControl`.\n * Receives open state and a toggle callback. The returned element is wrapped\n * in a Radix `Popover.Trigger`.\n *\n * NOTE: Must be passed as a stable reference, not created inline.\n */\n /**\n * Position of the check indicator in the option list. `none` removes the\n * indicator column altogether — for a list that never carries a selection\n * (one-shot actions) or whose option view states the selection itself, an\n * empty 16px column is dead space in every row.\n * @default start\n */\n checkPosition?: 'start' | 'end' | 'none'\n trigger?: (props: { open: boolean; onToggle: () => void }) => ReactNode\n}\n\ntype SingleSelectContextValue<T extends Option> = {\n multiple: false\n value: string\n TriggerView: React.FC<T>\n}\n\ntype MultiSelectContextValue<T extends Option> = {\n multiple: true\n value: string[]\n TriggerView: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\ntype SelectContextValue<T extends Option> = (\n | SingleSelectContextValue<T>\n | MultiSelectContextValue<T>\n) & SelectAccessibilityProps & {\n triggerId: string\n // Props\n name?: string\n id?: string\n required?: boolean\n options: Options<T>\n disabled: boolean\n variant: SelectControlProps[\"variant\"]\n pill: boolean\n listPill: boolean\n size: SelectControlProps[\"size\"]\n dropdownIconType: SelectControlProps[\"dropdownIconType\"]\n loading: boolean\n clearable: boolean\n placeholder: string\n loadingPlaceholder: string\n allSelectedLabel: string\n /** A phone's list leads with a row that unsets the value, in place of the trigger's clear button */\n noneRow: boolean\n noneLabel: string\n searchEmptyMessage: ReactNode\n searchPlaceholder: string\n searchAriaLabel: string\n searchSize?: ControlSize\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n triggerClassName?: string\n opticallyAlign?: \"start\" | \"end\"\n optionClassName?: string\n OptionView: React.FC<T>\n actions: Actions\n onActionSelect: CallbackWithActionId\n block: boolean\n /** The side asked for; without one a list opens below, or on a phone toward the larger part of the screen. */\n side: PopoverSide | undefined\n align: PopoverAlign\n alignOffset: number\n avoidCollisions: boolean\n listWidth?: number | \"auto\" // Default when not passed is to match the width of the trigger\n listMinWidth?: number | \"auto\" // Default when not passed is the width of the trigger\n listMaxWidth?: number | \"auto\"\n // References\n onSelectRef: React.MutableRefObject<(option: T, removeOption?: boolean) => void>\n searchPredicateRef: React.MutableRefObject<SearchPredicate<T>>\n // Derived\n searchable: boolean\n checkPosition: 'start' | 'end' | 'none'\n // Custom trigger\n trigger?: (props: { open: boolean; onToggle: () => void }) => ReactNode\n}\n\nconst SelectContext = createContext<SelectContextValue<Option> | null>(null)\n\nconst useSelectContext = () => {\n const context = use(SelectContext)\n\n if (!context) {\n throw new Error(\"Select components must be wrapped in <Select />\")\n }\n\n return context\n}\n\nconst DefaultOptionView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultSingleTriggerView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultMultiTriggerView = <T extends Option>({\n values,\n selectedAll,\n}: MultiSelectTriggerViewProps<T>) => {\n const { allSelectedLabel } = useSelectContext()\n const displayValue = selectedAll\n ? allSelectedLabel\n : values.length === 0\n ? // NOTE: Zero length is impossible - an empty option with `placeholder` is always returned\n \"Select...\"\n : values.length === 1\n ? values[0].label\n : `${values.length} selected`\n\n return <>{displayValue}</>\n}\n\nexport const Select = <T extends Option>(props: SelectProps<T>) => {\n const {\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n required,\n value,\n name,\n multiple,\n variant = \"outline\",\n size = \"md\",\n dropdownIconType = \"dropdown\",\n loading = false,\n clearable = false,\n disabled = false,\n placeholder = \"Select...\",\n loadingPlaceholder = \"Loading...\",\n allSelectedLabel = \"All selected\",\n noneLabel = \"None\",\n pill: pillProp,\n listPill: listPillProp,\n listMinWidth,\n options,\n actions: propActions = [],\n side,\n avoidCollisions = true,\n onChange,\n optionClassName,\n OptionView = DefaultOptionView,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n TriggerView: TriggerViewFromProps,\n searchPlaceholder = \"\",\n searchAriaLabel = \"Search options\",\n searchSize,\n searchPredicate = defaultSearchPredicate,\n searchEmptyMessage = \"No results found.\",\n trigger,\n checkPosition = 'start',\n } = props\n const pill = useFieldRowPill(pillProp)\n const listPill = listPillProp ?? pill\n // At the end of a Field row the menu opens from the row's end and fits its options: on a phone\n // the trigger there is only as wide as its value, so a menu of the trigger's width breaks every word.\n // In a `FieldGroup columns` the value starts at the column, and so does its menu.\n const inRow = useFieldRow()\n const inColumns = useFieldColumns()\n // Block default is dynamic, based on `variant`\n const block = props.block ?? variant !== \"ghost\"\n // Align default is dynamic, based on the row and `block`\n const align = props.align ?? (inRow ? (inColumns ? \"start\" : \"end\") : block ? \"center\" : \"start\")\n // Flush with the trigger's edge, as the prop documents. The old -5 nudge for\n // \"start\"/\"end\" tried to line the option labels up with the trigger's text and\n // instead left the menu hanging past the field it belongs to.\n const alignOffset = props.alignOffset ?? 0\n\n // Create stable, mutable references to avoid memoization requirements from consumers\n const onSelectRef = useLatestValue((selectedOption: T, removeOption?: boolean) => {\n if (disabled || loading || getOptionByValue(options, selectedOption.value)?.disabled) return\n if (multiple) {\n // When clearing values, the value is an\n if (!selectedOption.value) {\n onChange([])\n return\n }\n\n if (removeOption) {\n const nextValues = value.filter((v) => v !== selectedOption.value)\n const currentSelectedOptions = getOptionsByValues(options, nextValues)\n onChange(currentSelectedOptions)\n } else {\n const currentSelectedOptions = getOptionsByValues(options, value)\n onChange(currentSelectedOptions.concat(selectedOption))\n }\n } else {\n onChange(selectedOption)\n }\n })\n\n const searchPredicateRef = useRef<SearchPredicate<T>>(searchPredicate)\n searchPredicateRef.current = searchPredicate\n\n // It should be exceedingly uncommon to change actions dynamically, and they are unlikely to be a stable array reference from consumers\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally limiting when this stable value changes to length of actions\n const actions = useMemo<Actions>(() => propActions, [propActions.length])\n // We need to ensure that when action callbacks are called, we have fresh function references, even if the other action details did not change.\n const propActionsRef = useRef<Actions>(propActions)\n propActionsRef.current = propActions\n const onActionSelect = useCallback<CallbackWithActionId>((actionId: string) => {\n if (disabled || loading) return\n propActionsRef.current.find((a) => a.id === actionId)?.onSelect(actionId)\n }, [disabled, loading])\n\n // Determine when custom selects should be used\n const optionsCount = useMemo(\n () =>\n isOptionGroupArray(options)\n ? options.reduce((acc: number, group) => {\n return acc + group.options.length\n }, 0)\n : options.length,\n [options],\n )\n\n // Using ID for DOM selection instead of passing around and merging a ref. Pick your poison.\n const internalTriggerId = useId()\n const triggerId = `select-trigger-${internalTriggerId}`\n\n // Locking down searchable count to a single value. Could make this customizable in the future, but would want guardrails.\n // A phone's list is an iOS menu, and a menu has no search: a long list scrolls (iOS-menu IMG_5490, Add Payment's\n // Province, 52 options; the owner 10.11 on a search row in the list), so it opens with no keyboard either. The window\n // decides, as for the list's place: the list is portaled out of any PhoneLayout.\n const phone = usePhoneWindow()\n const searchable = optionsCount > 15 && !phone\n // An iOS pop-up button has no clear button: its value is unset by a None row, first in the list and in a section of\n // its own, checked while nothing is chosen (Reminders' Early Reminder, iOS-menu IMG_5821). The window decides, as for\n // the search.\n // A custom trigger owns its clearing, so only the default one gives its clear button to the row.\n const noneRow = clearable && phone && !trigger\n\n // A block menu matches its field. An inline one, or one at the end of a Field row, fits its\n // options: no narrower than its trigger (the CSS fallback reads the trigger width), no wider than 300px.\n const fitsOptions = (!block || inRow) && props.listWidth === undefined\n const listWidth = props.listWidth ?? (fitsOptions ? \"auto\" : undefined)\n const listMaxWidth = props.listMaxWidth ?? (fitsOptions ? 300 : \"auto\")\n\n // Narrow known values for context\n const dynamicContextProps = useMemo<\n SingleSelectContextValue<T> | MultiSelectContextValue<T>\n >(() => {\n if (multiple) {\n return {\n multiple: true,\n value: value as string[],\n TriggerView: TriggerViewFromProps ?? DefaultMultiTriggerView,\n }\n }\n\n return {\n multiple: false,\n value: value as string,\n TriggerView: TriggerViewFromProps ?? DefaultSingleTriggerView,\n }\n }, [multiple, value, TriggerViewFromProps])\n\n const store = useMemo<SelectContextValue<T>>(\n () => ({\n ...dynamicContextProps,\n triggerId,\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n // Forward props\n name,\n required,\n options,\n placeholder,\n loadingPlaceholder,\n allSelectedLabel,\n loading,\n clearable,\n noneRow,\n noneLabel,\n variant,\n pill,\n listPill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchAriaLabel,\n searchSize,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchPredicateRef,\n // Derived state\n searchable,\n disabled,\n trigger,\n checkPosition,\n }),\n [\n dynamicContextProps,\n triggerId,\n id,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaInvalid,\n required,\n name,\n options,\n placeholder,\n loadingPlaceholder,\n allSelectedLabel,\n loading,\n clearable,\n noneRow,\n noneLabel,\n variant,\n pill,\n listPill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchAriaLabel,\n searchSize,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchable,\n disabled,\n trigger,\n checkPosition,\n ],\n )\n\n return (\n // NOTE: Cannot peacefully coerce SelectContextValue into a generic, so casting to any here.\n // This is safe because `store` is strongly typed above.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n <SelectContext.Provider value={store as any}>\n <CustomSelect />\n </SelectContext.Provider>\n )\n}\n\n// ============================================================\n// Trigger\n// ============================================================\ntype SelectTriggerProps = {\n onOpenChange?: (maybeNextState?: boolean) => void\n tabIndex?: number\n [\"aria-hidden\"]?: \"false\" | \"true\"\n ref?: React.Ref<HTMLButtonElement | null>\n}\n\nexport const SelectTrigger = (props: SelectTriggerProps) => {\n const {\n triggerId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n id,\n required,\n value,\n multiple,\n options,\n loading,\n disabled,\n clearable,\n noneRow,\n name,\n variant,\n pill,\n size,\n dropdownIconType,\n placeholder,\n loadingPlaceholder,\n block,\n opticallyAlign,\n triggerClassName,\n TriggerStartIcon,\n TriggerView,\n onSelectRef,\n } = useSelectContext()\n const {\n onOpenChange,\n // pass along props from Radix\n ...restProps\n } = props\n const firstValue = multiple ? value[0] : value\n const placeholderValue = loading ? loadingPlaceholder : placeholder\n\n const selectedItem = useMemo<Option>(\n () =>\n getOptionByValue(options, firstValue) || {\n value: \"\",\n label: placeholderValue,\n },\n [firstValue, options, placeholderValue],\n )\n const hasSelectedValue = multiple ? value.length > 0 : !!value\n const isPlaceholder = loading || !hasSelectedValue\n\n const typeahead = useMemo(() => createTypeahead(), [])\n\n const multipleTriggerViewProps = useMemo<MultiSelectTriggerViewProps<Option>>(() => {\n if (!multiple) {\n return { values: [], selectedAll: false }\n }\n\n const currentSelectedOptions = getOptionsByValues(options, value)\n const flatOptions = options.flatMap((o) => (\"options\" in o ? o.options : o))\n\n return {\n values: currentSelectedOptions.length\n ? currentSelectedOptions\n : [\n {\n value: \"\",\n label: placeholderValue,\n },\n ],\n selectedAll: flatOptions.length <= value.length,\n }\n }, [multiple, options, value, placeholderValue])\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLButtonElement>) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n\n // If not a command, check for typeahead\n // NOTE: Typeahead not supported in multi-select\n if (!multiple && isTypeaheadKey(evt)) {\n const currentTypeaheadValue = typeahead(key)\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value\n // NOTE: We don't look at current highlighted value as a means to start the search\n const firstMatchingOption = getTypeaheadOption(options, currentTypeaheadValue, firstValue)\n\n if (firstMatchingOption) {\n onSelectRef.current(firstMatchingOption)\n }\n }\n }\n\n const handleClearClick = () => {\n onSelectRef.current({ value: \"\", label: \"\" })\n // Ensure open state is closed\n onOpenChange?.(false)\n }\n\n return (\n <SelectControl\n id={triggerId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ? `${ariaLabelledBy} ${triggerId}-value` : undefined}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n className={triggerClassName}\n selected={!isPlaceholder}\n variant={variant}\n pill={pill}\n block={block}\n size={size}\n disabled={disabled}\n loading={loading}\n StartIcon={TriggerStartIcon}\n opticallyAlign={opticallyAlign}\n dropdownIconType={dropdownIconType}\n // On a phone the list's None row unsets the value: an iOS pop-up button has no clear button. The mark lets CSS\n // hide it from the first paint, before a server-rendered page knows the window (SelectControl.module.css)\n onClearClick={clearable && !noneRow ? handleClearClick : undefined}\n data-select-none-row={clearable ? \"\" : undefined}\n onInteract={onOpenChange}\n interactOnEnter\n onKeyDown={handleKeyDown}\n {...restProps}\n >\n {ariaLabelledBy ? (\n <span id={`${triggerId}-value`}>\n {multiple ? <TriggerView {...multipleTriggerViewProps} /> : <TriggerView {...selectedItem} />}\n </span>\n ) : multiple ? <TriggerView {...multipleTriggerViewProps} /> : <TriggerView {...selectedItem} />}\n {(name || id) &&\n // One input per selected value, so a form submits every value of a\n // multi-select; an empty one keeps `id` and `required` working\n (multiple && value.length ? value : [firstValue ?? \"\"]).map((formValue, index) => (\n <input\n key={index}\n id={index === 0 ? id : undefined}\n name={name}\n value={formValue}\n // A disabled select is neither validated nor submitted\n disabled={disabled}\n tabIndex={-1}\n onFocus={() => {\n document.getElementById(triggerId)?.focus()\n }}\n // A label's `for` lands here, and its click opens the list like a press on the trigger\n onClick={() => {\n if (!loading) {\n onOpenChange?.(true)\n }\n }}\n // keep react from complaining - don't make this readOnly because that\n // prevents the value from being required\n onChange={() => {}}\n required={required}\n className={s.FormInput}\n aria-hidden=\"true\"\n />\n ))}\n </SelectControl>\n )\n}\n\n// ============================================================\n// Custom Select\n// ============================================================\nconst CustomSelect = () => {\n const {\n loading,\n disabled,\n side,\n align,\n alignOffset,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n trigger,\n listPill,\n } = useSelectContext()\n const [open, setOpen] = useState<boolean>(false)\n const floatingBoundary = useFloatingBoundary(open && avoidCollisions, { bottom: 30, top: 30 })\n const selectContentRef = useRef<HTMLDivElement>(null)\n // The trigger element, the default one or a custom `trigger` (which has no `triggerId`)\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n // Both as state too, for the effects below: the list mounts after the trigger's cover is known\n const [triggerElement, setTriggerElement] = useState<HTMLButtonElement | null>(null)\n const setTrigger = useCallback((node: HTMLButtonElement | null) => {\n popoverTriggerRef.current = node\n setTriggerElement(node)\n }, [])\n const [contentElement, setContentElement] = useState<HTMLDivElement | null>(null)\n const setContent = useCallback((node: HTMLDivElement | null) => {\n selectContentRef.current = node\n setContentElement(node)\n }, [])\n // On a phone the list opens over its trigger, as the pop-up menu of an iOS picker does (ref-app pickers, block 8:\n // the 250pt menu stands over the row's value, its end at the chevron's end, the value hidden under it), and toward\n // the larger part of the screen, as Menu does (menuTriggerCover.ts)\n // Only in a phone-wide window, where the list is laid out as on a phone (Select.module.css)\n const [cover, setCover] = useState<MenuTriggerCover | null>(null)\n useLayoutEffect(() => {\n if (!open || !triggerElement) return\n return observeMenuTriggerCover(triggerElement, setCover, { windowOnly: true })\n }, [open, triggerElement])\n // The covered trigger is hidden while the list is open, and shown again as it closes, before focus returns to it\n useLayoutEffect(() => {\n if (!open || !cover || !triggerElement || !contentElement) return\n return markCoveredMenuTrigger(triggerElement, contentElement)\n }, [open, cover, triggerElement, contentElement])\n // A mouse opens the list as its button goes down, so on a phone the list is under it when the button comes up: that\n // release chooses nothing while it is over the trigger, as in Menu\n useEffect(() => {\n if (!triggerElement) return\n const press = (event: PointerEvent) => {\n if (event.button === 0 && isHoverPointer(event)) ignoreReleaseOverTrigger(triggerElement, event.pointerId)\n }\n triggerElement.addEventListener(\"pointerdown\", press)\n return () => triggerElement.removeEventListener(\"pointerdown\", press)\n }, [triggerElement])\n const focusRestoreRef = useRef<ReturnType<typeof createFocusRestore> | null>(null)\n const focusRestoreTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n\n useEffect(() => {\n const focusRestore = createFocusRestore(popoverTriggerRef.current?.ownerDocument ?? document)\n focusRestoreRef.current = focusRestore\n return () => {\n clearTimeout(focusRestoreTimer.current)\n focusRestore.dispose()\n focusRestoreRef.current = null\n }\n }, [])\n\n const handleOpenChange = useCallback((maybeNextState?: boolean) => {\n clearTimeout(focusRestoreTimer.current)\n // Toggle the current state when called without a specific state\n const nextState = maybeNextState === undefined ? !open : maybeNextState\n if (nextState && (disabled || loading)) return\n setOpen(nextState)\n\n // When we're closing, manage focus back to trigger manually\n if (!nextState) {\n // Read this now: with animations disabled the menu unmounts before the\n // timeout below runs, so selectContentRef is already null by then\n const focusWasInMenu = !!selectContentRef.current?.contains(document.activeElement)\n\n // Wait until the next tick to determine if another element has become focused\n focusRestoreTimer.current = setTimeout(() => {\n const activeElement = document.activeElement\n const menu = selectContentRef.current\n const focusInMenu = !!menu && !!activeElement && menu.contains(activeElement)\n // Focus dropped with the closing menu lands on <body>: it was lost, not moved\n const focusLost = !activeElement || activeElement === document.body\n\n // Focus that moved to another element outside the menu stays there\n if (focusInMenu || (focusWasInMenu && focusLost)) {\n const trigger = popoverTriggerRef.current\n if (trigger) focusRestoreRef.current?.restore(trigger)\n }\n })\n }\n }, [disabled, loading, open])\n\n // Forget the open request when availability changes, so re-enabling does not\n // reopen an old menu. Radix's exit autofocus below handles this close.\n if (open && (disabled || loading)) setOpen(false)\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n return (\n <Popover.Root\n open={open}\n onOpenChange={(nextState) => {\n // Prevent opening while loading\n if (loading && nextState) {\n return\n }\n\n handleOpenChange(nextState)\n }}\n modal={false}\n >\n <Popover.Trigger asChild ref={setTrigger}>\n {trigger ? trigger({ open, onToggle: () => { if (!disabled && !loading) setOpen((current) => !current) } }) : <SelectTrigger onOpenChange={handleOpenChange} />}\n </Popover.Trigger>\n <Popover.Portal forceMount>\n <TransitionGroup className={s.Menu} {...overlayTiming} overlay>\n {open && (\n <Popover.Content\n key=\"dropdown\"\n ref={setContent}\n forceMount\n className={s.MenuList}\n data-pill={listPill ? \"\" : undefined}\n // A list that fits its options is the 250pt of an iOS menu on a phone (Select.module.css)\n data-list-width={listWidth === \"auto\" ? \"auto\" : undefined}\n // A list given its own width keeps it on a phone too, below the 250pt\n data-list-sized={typeof listWidth === \"number\" ? \"\" : undefined}\n side={side ?? cover?.side ?? \"bottom\"}\n sideOffset={cover ? cover.sideOffset : 5}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n {...floatingBoundary}\n // Prevent Radix auto focus so we can handle our own from within <CustomSelectMenu />\n onOpenAutoFocus={preventDefaultHandler}\n // Radix waits until the animation completes before directing focus, which is janky.\n onCloseAutoFocus={(event) => {\n if (disabled || loading) {\n keepMovedFocus(event)\n const trigger = popoverTriggerRef.current\n if (!event.defaultPrevented && trigger) focusRestoreRef.current?.restore(trigger)\n }\n event.preventDefault()\n }}\n onEscapeKeyDown={preventDefaultHandler}\n style={toCssVariables({\n \"select-list-width\": listWidth,\n \"select-list-min-width\": listMinWidth,\n // \"auto\" is no maximum: the variable is left out, so a phone's 250pt floor can read the cap\n \"select-list-max-width\": listMaxWidth === \"auto\" ? undefined : listMaxWidth,\n })}\n >\n <CustomSelectMenu onOpenChange={handleOpenChange} />\n </Popover.Content>\n )}\n </TransitionGroup>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\ntype CustomSelectMenuContextValue = {\n openingValue: string\n listId: string\n requestCloseRef: React.RefObject<() => void | null>\n listRef: React.RefObject<HTMLDivElement | null>\n // Highlighting\n highlightedValue: string\n setHighlightedValue: React.Dispatch<React.SetStateAction<string>>\n // Search\n searchTerm: string\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>\n searchInputRef: React.RefObject<HTMLInputElement | null>\n}\n\nconst CustomSelectMenuContext = createContext<CustomSelectMenuContextValue | null>(null)\n\nconst useCustomSelectMenuContext = () => {\n const context = use(CustomSelectMenuContext)\n\n if (!context) {\n throw new Error(\"CustomSelectMenu components must be wrapped in <CustomSelectMenu />\")\n }\n\n return context\n}\n\ntype CustomSelectMenuProps = {\n onOpenChange: (maybeNextState?: boolean) => void\n}\n\nconst CustomSelectMenu = ({ onOpenChange }: CustomSelectMenuProps) => {\n const { multiple, value, options, searchable, searchPredicateRef, listWidth, noneRow } = useSelectContext()\n const requestCloseRef = useRef<() => void>(() => onOpenChange(false))\n const menuRef = useRef<HTMLDivElement>(null)\n const listRef = useRef<HTMLDivElement>(null)\n const searchInputRef = useRef<HTMLInputElement>(null)\n const [searchTerm, setSearchTerm] = useState(\"\")\n const [highlightedValue, setHighlightedValue] = useState<string>(() => {\n // With nothing chosen, the None row is the checked one\n if (noneRow && !hasChosenOption(options, value)) return NONE_OPTION_VALUE\n const selectedValue = multiple ? value[0] : value\n return (selectedValue || getFirstValidOption(options)?.value) ?? \"\"\n })\n const typeahead = useMemo(() => createTypeahead(), [])\n const internalListId = useId()\n const listId = `select-list-${internalListId}`\n\n // Lock `value` for a given open to prevent janky change during close animation\n // MultiSelect reads its live selection instead of this per-open snapshot.\n const [openingValue] = useState<string>(() => multiple ? \"\" : value)\n\n // Trim and lowercase search value\n // A term counts only while the list has its search: one typed on a desktop is dropped when the window narrows to a\n // phone, whose list has none\n const literalSearchTerm = useMemo(() => (searchable ? searchTerm.trim().toLocaleLowerCase() : \"\"), [searchable, searchTerm])\n const filteredOptions = useMemo(\n () => filterOptions(options, literalSearchTerm, searchPredicateRef.current),\n [options, literalSearchTerm, searchPredicateRef],\n )\n const firstOption = useMemo(() => getFirstValidOption(filteredOptions), [filteredOptions])\n const shownValuesRef = useRef(optionValues(filteredOptions))\n\n // Regrettable requirement for running an effect *after* mount\n const isMountStableRef = useRef<boolean>(false)\n\n const handleKeyDown = (evt: React.KeyboardEvent) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n const firstValue = multiple ? value[0] : value\n const targetValue = highlightedValue || firstOption?.value || firstValue\n const isFocusedInSearch = document.activeElement === searchInputRef.current\n\n const menuElement = menuRef.current\n\n // Should be generally impossible for menuRef.current to not exist\n // unless we've unmounted and manage to fire this handler.\n if (!menuElement) {\n return\n }\n\n const triggerHighlightedOption = () => {\n const selectedOption = findOptionByValue(highlightedValue, menuElement)\n selectedOption?.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, cancelable: true, detail: 0 }))\n }\n\n const highlightOption = (val: string, element: Element) => {\n setHighlightedValue(val)\n element.scrollIntoView({ block: \"nearest\" })\n }\n\n const highlightSelectedOrFirstOption = () => {\n // Attempt to move highlight to selected item\n const maybeFirstValue = multiple ? value[0] : value\n\n if (maybeFirstValue) {\n const selectedElement = findOptionByValue(maybeFirstValue, menuElement)\n\n if (selectedElement) {\n highlightOption(maybeFirstValue, selectedElement)\n return\n }\n }\n\n // Without a value the None row is the checked one\n const noneElement = noneRow && !hasChosenOption(options, value) ? findOptionByValue(NONE_OPTION_VALUE, menuElement) : null\n if (noneElement) {\n highlightOption(NONE_OPTION_VALUE, noneElement)\n return\n }\n\n // If value isn't set, or the selected node wasn't found in the DOM,\n // attempt to move focus to the first valid option.\n const firstValidOption = getFirstValidOption(options)\n\n if (firstValidOption) {\n const firstValidOptionElement = findOptionByValue(firstValidOption.value, menuElement)\n if (firstValidOptionElement) {\n highlightOption(firstValidOption.value, firstValidOptionElement)\n }\n }\n }\n\n // Commands\n switch (key) {\n case \"ArrowDown\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n // Otherwise, move to the next option\n const nextElement = findNextOption(highlightedValue, menuElement)\n const nextValue = nextElement?.getAttribute(\"data-option-id\")\n if (nextElement && nextValue) {\n highlightOption(nextValue, nextElement)\n }\n\n return\n }\n case \"ArrowUp\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n const previousElement = findPreviousOption(targetValue, menuElement)\n const previousValue = previousElement?.getAttribute(\"data-option-id\")\n if (previousElement && previousValue) {\n highlightOption(previousValue, previousElement)\n }\n\n return\n }\n case \"Enter\":\n // Prevent default enter behavior from the search input, if present\n evt.preventDefault()\n\n // Activate the highlighted option through its click handler\n triggerHighlightedOption()\n\n return\n case \" \":\n // Allow spaces in search, and don't treat as enter\n // if there is a valid literalSearchTerm.\n if (literalSearchTerm && isFocusedInSearch) {\n return\n }\n\n // Prevent space from entering search input\n evt.preventDefault()\n\n // Activate the highlighted option through its click handler\n triggerHighlightedOption()\n\n return\n default:\n break\n }\n\n // If not a command, check for typeahead\n if (isTypeaheadKey(evt)) {\n // Skip typeahead logic when we're focused in the search input\n if (isFocusedInSearch) {\n return\n }\n\n // Extend the current typeahead and get the latest value\n const currentTypeaheadValue = typeahead(key)\n\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value, starting at the highlighted value\n const firstMatchingOption = getTypeaheadOption(\n options,\n currentTypeaheadValue,\n highlightedValue,\n )\n\n if (firstMatchingOption) {\n const matchedNode = findOptionByValue(firstMatchingOption.value, menuElement)\n\n // Only change the highlight if we found the actual node\n if (matchedNode) {\n setHighlightedValue(firstMatchingOption.value)\n // Ensure the newly highlighted option is scrolled into view\n matchedNode.scrollIntoView({ block: \"nearest\" })\n }\n }\n }\n }\n\n const store = useMemo(\n () => ({\n openingValue,\n listId,\n highlightedValue,\n setHighlightedValue,\n requestCloseRef,\n searchTerm,\n setSearchTerm,\n searchInputRef,\n listRef,\n }),\n [openingValue, listId, highlightedValue, setHighlightedValue, searchTerm, setSearchTerm],\n )\n\n // On mount behavior\n useEffect(() => {\n // Ensure initial highlighted option is in view\n // NOTE: Allowing for a render frame ensures content is positioned correctly before scrolling it into view.\n waitForAnimationFrame(() => {\n if (!menuRef.current) {\n return\n }\n\n // Ensure the highlighted option is in view\n const currentOption = findOptionByValue(highlightedValue, menuRef.current)\n // Scroll the selected item into view, and its bottom edge.\n currentOption?.scrollIntoView({ block: \"center\" })\n })\n\n // Send initial focus to the search input, or the list without one (the\n // menu container when there are no options), to capture key events\n const autoFocusTarget = searchInputRef.current || listRef.current || menuRef.current\n autoFocusTarget?.focus({ preventScroll: true })\n\n // Required for <StrictMode>, because we need to unset this token\n // when the hooks are re-run. It's an imperative effect that we need to manage.\n return () => {\n isMountStableRef.current = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally an onMount effect\n }, [])\n\n // The window crossed the phone's width while the list was open: the search came or went (a phone's list has none),\n // so its term is cleared and focus moves to what holds the keys now, the search or the list\n const wasSearchableRef = useRef(searchable)\n useLayoutEffect(() => {\n if (wasSearchableRef.current === searchable) return\n wasSearchableRef.current = searchable\n if (!searchable) setSearchTerm(\"\")\n // The width a desktop list locked for its search would overflow a phone's 250px panel; a desktop locks it again\n if (menuRef.current) {\n menuRef.current.style.minWidth = \"\"\n if (searchable && listWidth === \"auto\") menuRef.current.style.minWidth = `${menuRef.current.offsetWidth}px`\n }\n if (menuRef.current?.contains(document.activeElement) && document.activeElement !== listRef.current) return\n ;(searchable ? searchInputRef.current : listRef.current)?.focus({ preventScroll: true })\n }, [searchable])\n\n // A long list has a search field: the menu keeps the width of all its options as the results narrow.\n useLayoutEffect(() => {\n if (searchable && listWidth === \"auto\" && menuRef.current) {\n menuRef.current.style.minWidth = `${menuRef.current.offsetWidth}px`\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally an onMount effect\n }, [])\n\n // On search behavior\n useLayoutEffect(() => {\n // This effect will run on mount, but we want to skip it.\n // The on mount effect is responsible for handling mount behavior,\n // but this effect is specifically responsible for handling search changes\n if (!isMountStableRef.current) {\n isMountStableRef.current = true\n return\n }\n\n // Impossible while mounted, list ref will exist\n if (!listRef.current) {\n return\n }\n\n // The same list again, as after a pick in a multiple list: nothing moves\n const nextValues = optionValues(filteredOptions)\n if (nextValues === shownValuesRef.current) {\n return\n }\n shownValuesRef.current = nextValues\n\n // Reset scroll position to the top\n listRef.current.scrollTop = 0\n\n // Highlight first item in the list, or the None row while nothing is chosen\n const maybeFirstOption = getFirstValidOption(filteredOptions)\n if (noneRow && !hasChosenOption(options, value)) setHighlightedValue(NONE_OPTION_VALUE)\n else if (maybeFirstOption) setHighlightedValue(maybeFirstOption.value)\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally a reaction to the shown options\n }, [filteredOptions])\n\n // The window crossed the phone's width while the list was open: the None row came or went. With nothing chosen the\n // highlight moves to it; when it goes, a highlight on it moves to the chosen option or the first one.\n const hadNoneRowRef = useRef(noneRow)\n useLayoutEffect(() => {\n if (hadNoneRowRef.current === noneRow) return\n hadNoneRowRef.current = noneRow\n if (noneRow) {\n if (!hasChosenOption(options, value)) setHighlightedValue(NONE_OPTION_VALUE)\n return\n }\n const selectedValue = multiple ? value[0] : value\n setHighlightedValue((current) =>\n current === NONE_OPTION_VALUE ? ((selectedValue || getFirstValidOption(filteredOptions)?.value) ?? \"\") : current,\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally a reaction to the row coming or going\n }, [noneRow])\n\n // The focused element (the search input, or the list without one) points\n // assistive tech at the highlighted option, when that option is rendered\n useLayoutEffect(() => {\n const target = searchInputRef.current || listRef.current\n if (!target || !menuRef.current) {\n return\n }\n\n // A list that gave the keys to a search that came with a wider window points at nothing itself\n if (target !== listRef.current) listRef.current?.removeAttribute(\"aria-activedescendant\")\n const highlightedOption = highlightedValue ? findOptionByValue(highlightedValue, menuRef.current) : null\n if (highlightedOption?.id) {\n target.setAttribute(\"aria-activedescendant\", highlightedOption.id)\n } else {\n target.removeAttribute(\"aria-activedescendant\")\n }\n // The search coming or going moves the keys, so the pointer follows them, and the None row coming or going\n }, [highlightedValue, filteredOptions, searchable, noneRow])\n\n return (\n <CustomSelectMenuContext value={store}>\n <div\n className={s.MenuInner}\n onKeyDown={handleKeyDown}\n ref={menuRef}\n // Without search, the list takes focus (and the tab stop); the container\n // stays focusable so a click on it keeps the keys here\n tabIndex={!searchable && (filteredOptions.length || noneRow) ? -1 : 0}\n >\n {searchable && (\n <CustomSelectSearch value={searchTerm} onChange={setSearchTerm} hasResults={!!filteredOptions.length} />\n )}\n <CustomSelectList filteredOptions={filteredOptions} />\n <CustomSelectActions />\n </div>\n </CustomSelectMenuContext>\n )\n}\n\ntype CustomSelectSearchProps = {\n value: string\n onChange: (nextSearchTerm: string) => void\n /** Whether the list is rendered, for `aria-controls` */\n hasResults: boolean\n}\n\nconst CustomSelectSearch = ({ value, onChange, hasResults }: CustomSelectSearchProps) => {\n const { searchPlaceholder, searchAriaLabel, searchSize } = useSelectContext()\n const { listId, searchInputRef } = useCustomSelectMenuContext()\n\n const handleChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n onChange(evt.target.value)\n }\n\n return (\n <div className={s.Search}>\n <Input\n startAdornment={\n <Search\n width={16}\n height={16}\n className=\"fill-secondary\"\n fill=\"var(--color-text-secondary)\"\n />\n }\n ref={searchInputRef}\n size={searchSize}\n variant=\"ghost\"\n pill\n value={value}\n placeholder={searchPlaceholder}\n aria-label={searchAriaLabel}\n onChange={handleChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-autocomplete=\"list\"\n role=\"combobox\"\n // The list, while there is one: with no results it is not rendered\n aria-controls={hasResults ? listId : undefined}\n aria-expanded\n />\n </div>\n )\n}\n\nconst isOptionGroup = <T extends Option>(\n mixedOption: T | OptionGroup<T>,\n): mixedOption is OptionGroup<T> => {\n return \"options\" in mixedOption\n}\n\nconst isOptionGroupArray = <T extends Option>(arr: Options<T>): arr is OptionGroup<T>[] => {\n return arr[0] && isOptionGroup(arr[0])\n}\n\nconst optionValues = <T extends Option>(options: Options<T>) =>\n (isOptionGroupArray(options) ? options.flatMap((group) => group.options) : options)\n .map((option) => option.value)\n .join(\"\\n\")\n\nconst HARD_OPTIONS_LIMIT = 300\n\nconst CustomSelectList = <T extends Option>({\n filteredOptions,\n}: {\n filteredOptions: Options<T>\n}) => {\n const {\n searchEmptyMessage,\n multiple,\n searchable,\n noneRow,\n noneLabel,\n triggerId,\n trigger,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n } = useSelectContext()\n const { listId, listRef } = useCustomSelectMenuContext()\n\n // A phone's None row still unsets a value when there are no options to show\n if (!filteredOptions.length && !noneRow) {\n return typeof searchEmptyMessage === \"string\" ? (\n <p className={s.SearchEmpty} data-text-only>\n {searchEmptyMessage}\n </p>\n ) : (\n <div className={s.SearchEmpty}>{searchEmptyMessage}</div>\n )\n }\n\n // We hard limit within groups, so at this level we will only limit flat arrays. The limit asks to search for the\n // rest, so a list with no search (a phone's) shows every option, as a long iOS menu scrolls (IMG_5490).\n const isGrouped = isOptionGroupArray(filteredOptions)\n const hardLimit = searchable ? HARD_OPTIONS_LIMIT : Infinity\n const hasHardLimit = !isGrouped && filteredOptions.length > hardLimit\n\n const options = isGrouped\n ? filteredOptions.map((group) => <CustomSelectGroup key={group.label} {...group} />)\n : filteredOptions\n .slice(0, hardLimit)\n .map((option) => <CustomSelectOption key={option.value} {...option} />)\n\n return (\n <div\n id={listId}\n className={s.OptionsList}\n ref={listRef}\n role=\"listbox\"\n // Named like the trigger: its label, or the default trigger itself\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ?? (ariaLabel || trigger ? undefined : triggerId)}\n aria-multiselectable={multiple || undefined}\n // Without search, the list is the focused element\n tabIndex={searchable ? undefined : 0}\n >\n {/* A phone's None row, in a section of its own as in Reminders (IMG_5821); the section is no group to assistive\n tech, so the row is an option of the list */}\n {noneRow && (\n <div className={s.NoneSection} role=\"none\">\n <CustomSelectOption value={NONE_OPTION_VALUE} label={noneLabel} none />\n </div>\n )}\n {options}\n {hasHardLimit && (\n <CustomSelectHardLimit numHidden={filteredOptions.length - HARD_OPTIONS_LIMIT} />\n )}\n </div>\n )\n}\n\nconst DEFAULT_OPTIONS_LIMIT = {\n limit: 100,\n label: \"Show all\",\n}\n\nconst CustomSelectGroup = <T extends Option>({\n label,\n options,\n optionsLimit = DEFAULT_OPTIONS_LIMIT,\n}: OptionGroup<T>) => {\n const groupId = useId()\n const headingId = useId()\n const { searchTerm, setHighlightedValue } = useCustomSelectMenuContext()\n const { searchable } = useSelectContext()\n const [limitExpanded, setLimitExpanded] = useState<boolean>(false)\n\n const hasExpandableLimit = optionsLimit.limit < options.length && !searchTerm && !limitExpanded\n // The hard limit asks to search for the rest: a list with no search (a phone's) shows the whole group once expanded\n const hasHardLimit = searchable && HARD_OPTIONS_LIMIT < options.length && !hasExpandableLimit\n\n let maybeLimitedOptions = options\n if (hasExpandableLimit) {\n maybeLimitedOptions = options.slice(0, optionsLimit.limit)\n } else if (hasHardLimit) {\n maybeLimitedOptions = options.slice(0, HARD_OPTIONS_LIMIT)\n }\n\n const handleLimitExpanded = () => {\n // Expand options\n setLimitExpanded(true)\n\n // Set highlight to the first option from the newly expanded list\n setHighlightedValue(options[optionsLimit.limit].value)\n }\n\n return (\n // A group named by its heading. NOTE: The arrow keys walk every option in\n // document order (findNextOption), so they cross from group to group.\n <div role=\"group\" aria-labelledby={headingId} className={s.OptionGroup}>\n {/* No indicator slot: the heading labels the whole section, so it starts\n at the row's content edge — above the check column, not indented to\n the option labels. Same alignment a grouped menu uses on GitHub. */}\n <div id={headingId} className={s.OptionGroupHeading}>{label}</div>\n {maybeLimitedOptions.map((limitedOptions) => (\n <CustomSelectOption key={limitedOptions.value} {...limitedOptions} />\n ))}\n {hasExpandableLimit && (\n <CustomSelectExpandableLimit\n value={`group-limit-${groupId}`}\n label={optionsLimit.label}\n onPointerUp={handleLimitExpanded}\n />\n )}\n {hasHardLimit && <CustomSelectHardLimit numHidden={options.length - HARD_OPTIONS_LIMIT} />}\n </div>\n )\n}\n\ntype CustomSelectHardLimitProps = {\n numHidden: number\n}\n\nconst CustomSelectHardLimit = ({ numHidden }: CustomSelectHardLimitProps) => {\n const { checkPosition } = useSelectContext()\n\n return (\n <div className={s.OptionHardLimitHeading}>\n {/* The note lines up with the option labels above it, so it borrows their\n indicator column. Without a column there is nothing to line up to. */}\n {checkPosition === 'start' && <div className={s.OptionIndicatorSlot} />}\n {`…and ${numHidden.toLocaleString()} more options. Use search to refine results further.`}\n </div>\n )\n}\n\nconst useSelectPress = (action: () => void) => {\n const press = useMemo(() => createSelectPress(), [])\n return {\n onPointerDown: press.onPointerDown,\n onPointerCancel: press.onPointerCancel,\n onPointerUp: (event: React.PointerEvent) => { if (press.onPointerUp(event)) action() },\n onClick: (event: React.MouseEvent) => { if (press.onClick(event)) action() },\n }\n}\n\ntype CustomSelectExpandableLimitProps = {\n value: string\n label: string\n onPointerUp: () => void\n}\n\nconst CustomSelectExpandableLimit = ({\n value,\n label,\n onPointerUp,\n}: CustomSelectExpandableLimitProps) => {\n const { checkPosition } = useSelectContext()\n const { highlightedValue, setHighlightedValue } = useCustomSelectMenuContext()\n const optionId = useId()\n const press = useSelectPress(onPointerUp)\n\n const isHighlighted = value === highlightedValue\n\n const handlePointerMove = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n // This component acts a LOT like an Option, but has enough bespoke behavior\n // that it cannot literally be one. We copy the important parts of Option for\n // keyboard navigation, UX, etc.\n return (\n <div\n id={optionId}\n className={clsx(s.Option, s.OptionsLimit)}\n data-option-id={value}\n data-highlight={isHighlighted ? \"\" : undefined}\n // An expandable action, never a selected value.\n role=\"option\"\n aria-selected={false}\n {...press}\n onPointerMove={handlePointerMove}\n onPointerLeave={handlePointerLeave}\n >\n <div className={clsx(s.PressableInner, s.OptionInner)}>\n {/* The row lines up with the option labels above it, so it borrows their\n indicator column. Without a column there is nothing to line up to. */}\n {checkPosition === 'start' && <div className={s.OptionIndicatorSlot} />}\n {label}\n </div>\n </div>\n )\n}\n\nconst INTERNAL_DOM_SELECTION_DATA_ATTR = \"data-option-id\"\n\n// The None row's id among the options: it never reaches `onChange`, which gets an empty value instead\nconst NONE_OPTION_VALUE = \"plexui-select-none\"\n\nconst CustomSelectOption = ({ none = false, ...option }: Option & { /** The phone's None row */ none?: boolean }) => {\n const {\n optionClassName,\n OptionView,\n value: propsValue,\n options,\n multiple,\n onSelectRef,\n checkPosition,\n } = useSelectContext()\n const { openingValue, requestCloseRef, highlightedValue, setHighlightedValue } =\n useCustomSelectMenuContext()\n const { value, disabled, tooltip } = option\n // Referenced by the list's aria-activedescendant while highlighted\n const optionId = useId()\n\n // NOTE: SingleSelect mode keeps the opening value instead of the live `propsValue`\n // to avoid selecting the item as the select closes.\n // The None row is checked while nothing is chosen: no value, or none that an option has (the trigger shows the\n // placeholder then)\n const isSelected = none\n ? !hasChosenOption(options, multiple ? propsValue : openingValue)\n : multiple ? propsValue.includes(value) : value === openingValue\n const isHighlighted = value === highlightedValue\n\n const handlePointerUp = () => {\n if (none) {\n // Unsets the value, as the clear button does, and closes the list, a multiple one too: an iOS menu closes on a\n // choice, and None leaves nothing more to choose (owner 10.11)\n onSelectRef.current({ value: \"\", label: \"\" })\n requestCloseRef.current?.()\n } else if (multiple) {\n // Trigger the change ref, optionally as a remove\n onSelectRef.current(option, isSelected)\n } else {\n // Trigger the change ref\n onSelectRef.current(option)\n // Request the dropdown to close\n requestCloseRef.current?.()\n }\n }\n\n const press = useSelectPress(handlePointerUp)\n\n const handlePointerMove = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (!isHoverPointer(event)) return\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n return (\n <div\n id={optionId}\n className={clsx(s.Option, optionClassName)}\n data-highlight={isHighlighted ? \"\" : undefined}\n role=\"option\"\n // The selection; the highlight is the list's aria-activedescendant\n aria-selected={isSelected}\n data-selected={isSelected ? \"\" : undefined}\n // Internal attribute for selecting DOM nodes\n {...{ [INTERNAL_DOM_SELECTION_DATA_ATTR]: value }}\n // Allow options to behave like a native select, when you can open and select an item in a single click\n {...(disabled ? {} : press)}\n // Pointer move allows us to prevent contention from keyboard presses and a still mouse\n // which does trigger events like onMouseEnter, creating weird battles with mouse and keyboard focus.\n onPointerMove={disabled ? undefined : handlePointerMove}\n onPointerLeave={disabled ? undefined : handlePointerLeave}\n aria-disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n >\n <div className={s.PressableInner}>\n {checkPosition === 'start' && (\n <div className={s.OptionIndicatorSlot} data-position=\"start\">\n {isSelected && <Check className={s.OptionCheck} />}\n </div>\n )}\n <div className={s.OptionLeading}>\n <div className={s.OptionInner}>\n {none ? option.label : <OptionView {...option} />}\n {tooltip && (\n <Tooltip content={tooltip.content} maxWidth={tooltip.maxWidth} side=\"right\">\n <Info className={s.OptionTooltipIcon} />\n </Tooltip>\n )}\n </div>\n {option.description && (\n <div className={clsx(s.OptionInner, s.OptionDescription)}>\n {option.description}\n </div>\n )}\n {/* An iOS menu has no tooltips: on a phone the tooltip is the row's subtitle, after the description if there\n is one (Select.module.css) */}\n {tooltip && (\n <div className={clsx(s.OptionInner, s.OptionTooltipText)}>{tooltip.content}</div>\n )}\n </div>\n {checkPosition === 'end' && (\n <div className={s.OptionIndicatorSlot} data-position=\"end\">\n {isSelected && <Check className={s.OptionCheck} />}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nconst CustomSelectActions = () => {\n const { actions } = useSelectContext()\n\n if (actions.length === 0) {\n return null\n }\n\n return (\n <div className={s.ActionsContainer}>\n {actions.map((action) => (\n <CustomSelectAction key={action.id} {...action} />\n ))}\n </div>\n )\n}\n\nconst CustomSelectAction = ({ id, label, Icon, className }: Action) => {\n const { onActionSelect } = useSelectContext()\n const { requestCloseRef } = useCustomSelectMenuContext()\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n if (evt.defaultPrevented || evt.nativeEvent.isComposing || evt.keyCode === 229) return\n const key = evt.key\n\n switch (key) {\n case \"Tab\":\n // Allow tabbing to pass propagation as normal,\n // which bubbles up to the focus trap of Radix Popover\n break\n case \"Enter\":\n case \" \":\n evt.stopPropagation()\n evt.preventDefault()\n handlePointerUp()\n break\n default:\n evt.stopPropagation()\n }\n }\n\n const handlePointerUp = () => {\n // Trigger the action's through our context helper, not the method on this action (it may be a stale reference)\n onActionSelect(id)\n // Request to close the dropdown\n requestCloseRef.current?.()\n }\n\n const press = useSelectPress(handlePointerUp)\n\n return (\n <div\n className={s.Action}\n {...press}\n role=\"button\"\n onKeyDown={handleKeyDown}\n tabIndex={0}\n >\n <div className={clsx(s.ActionInner, className)}>\n {Icon && <Icon role=\"presentation\" />}\n {label}\n </div>\n </div>\n )\n}\n\n// ============================================================\n// Utilities\n// ============================================================\nconst defaultSearchPredicate = (option: Option, searchTerm: string) =>\n option.label.toLowerCase().includes(searchTerm)\n\nconst filterOptions = <T extends Option>(\n options: Options<T>,\n searchTerm: string,\n searchIterator: SearchPredicate<T>,\n): Options<T> => {\n const searchValue = searchTerm.trim().toLocaleLowerCase()\n\n if (!searchValue) {\n return options\n }\n\n const filterOption = (option: T): boolean => searchIterator(option, searchValue)\n\n if (isOptionGroupArray(options)) {\n return options.reduce((acc, group) => {\n const filtered = group.options.filter(filterOption)\n\n if (filtered.length) {\n acc.push({\n ...group,\n options: filtered,\n })\n }\n return acc\n }, [] as OptionGroup<T>[])\n } else {\n return options.reduce((acc, option) => {\n if (filterOption(option)) acc.push(option)\n return acc\n }, [] as T[])\n }\n}\n\nconst getFirstValidOption = <T extends Option>(options: Options<T>): T | undefined => {\n if (!options.length) {\n return undefined\n }\n\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const firstNonDisabled = opt.options.find((i) => !i.disabled)\n if (firstNonDisabled) {\n found = firstNonDisabled\n break\n }\n } else {\n if (!opt.disabled) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionByValue = <T extends Option>(options: Options<T>, value: string): T | undefined => {\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.find((i) => i.value === value)\n if (exists) {\n found = exists\n break\n }\n } else {\n if (opt.value === value) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\n// Whether a value names an option: a value no option has shows the placeholder, as no value does\nconst hasChosenOption = <T extends Option>(options: Options<T>, value: string | string[]): boolean =>\n Array.isArray(value) ? getOptionsByValues(options, value).length > 0 : !!getOptionByValue(options, value)\n\nconst getOptionsByValues = <T extends Option>(options: Options<T>, values: string[]): T[] => {\n let found: T[] = []\n const lookup = new Set(values)\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.filter((i) => lookup.has(i.value))\n found = found.concat(exists)\n } else {\n if (lookup.has(opt.value)) {\n found.push(opt)\n }\n }\n }\n\n return found\n}\n\nconst MAX_DOM_CRAWLS = 40\n\nconst findOptionByValue = (currentValue: string, container: HTMLElement) =>\n container.querySelector(`[data-option-id=\"${CSS.escape(currentValue)}\"]`)\n\nconst isValidOptionNode = (node: Element) => node.matches(\"[data-option-id]:not([data-disabled])\")\n\n// Steps from the current option to the nearest enabled one, one option row at a\n// time in document order: across groups (siblings would stop at a group's\n// edge), skipping disabled rows, at most MAX_DOM_CRAWLS rows away\nconst findAdjacentOption = (currentValue: string, container: HTMLElement, step: 1 | -1) => {\n const currentOption = findOptionByValue(currentValue, container)\n const rows = Array.from(container.querySelectorAll(\"[data-option-id]\"))\n\n let index = currentOption ? rows.indexOf(currentOption) : -1\n if (index === -1) {\n return undefined\n }\n\n for (let maxSteps = 0; maxSteps < MAX_DOM_CRAWLS; maxSteps += 1) {\n index += step\n const nextNode = rows[index]\n\n if (!nextNode) {\n return undefined\n }\n\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n }\n}\n\nconst findNextOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, 1)\n\nconst findPreviousOption = (currentValue: string, container: HTMLElement) =>\n findAdjacentOption(currentValue, container, -1)\n\nconst createTypeahead = () => {\n let currentValue: string = \"\"\n let timeoutId: ReturnType<typeof setTimeout>\n\n return (char: string) => {\n // Searching is case-insensitive\n char = char.toLowerCase()\n\n // Add the new character to the current value\n currentValue += char\n\n // Clear the previous timeout if there was one\n if (timeoutId) clearTimeout(timeoutId)\n\n // Reset the value after a brief delay\n timeoutId = setTimeout(() => {\n currentValue = \"\"\n }, 500)\n\n // When a user is typing the same value, like \"llll\", assume they are cycling through items starting with \"l\"\n // We continue to build up the string in case another letter is typed, and then release the full value.\n // For example, if the user types \"ooog\", it will return \"o\", until \"g\" is typed, and then return the \"ooog\".\n const isCycling = char.repeat(currentValue.length) === currentValue\n\n // Return the typeahead value\n return isCycling ? char : currentValue\n }\n}\n\nconst isValidTypeaheadChar = (char: string): boolean => /^[a-zA-Z0-9]$/.test(char)\n\n// A shortcut (Ctrl+C, Cmd+A, Alt+letter) or a key another handler took is not typeahead\nconst isTypeaheadKey = (evt: React.KeyboardEvent): boolean =>\n isValidTypeaheadChar(evt.key) && !evt.ctrlKey && !evt.metaKey && !evt.altKey && !evt.defaultPrevented\n\nconst getTypeaheadOption = <T extends Option>(\n options: Options<T>,\n typeaheadValue: string,\n currentHighlightValue?: string,\n): T | undefined => {\n // Ensure options actually exist\n if (!options.length) {\n return undefined\n }\n\n let matchBeforeHighlight: T | undefined\n // If we' aren't provided a highlighted value, start from the top (e.g., act like it's found)\n let foundHighlightedValue: boolean = !currentHighlightValue\n\n const optionValidAndMatches = ({ disabled, label, value }: T) => {\n // Side effect of looping\n if (value === currentHighlightValue) {\n foundHighlightedValue = true\n // Don't return highlighted value\n return false\n }\n\n return !disabled && label.toLowerCase().startsWith(typeaheadValue)\n }\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n for (const option of opt.options) {\n if (optionValidAndMatches(option)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match, in any group\n return option\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || option\n }\n }\n }\n } else {\n if (optionValidAndMatches(opt)) {\n if (foundHighlightedValue) {\n // We're done after we've found an after match\n return opt\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || opt\n }\n }\n }\n }\n\n return matchBeforeHighlight\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import clsx from "clsx";
|
|
|
4
4
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
5
5
|
import { mergeRefs } from "react-merge-refs";
|
|
6
6
|
import { toCssVariables } from "../../lib/helpers.js";
|
|
7
|
-
import { observeTextareaWidth } from "../../lib/observeTextareaWidth.js";
|
|
7
|
+
import { observeTextareaWidth, sizesByContent } from "../../lib/observeTextareaWidth.js";
|
|
8
8
|
import {} from "../../types.js";
|
|
9
9
|
import s from "@plexui/styles/components/Textarea/Textarea.module.css";
|
|
10
10
|
export const Textarea = (props) => {
|
|
@@ -30,14 +30,14 @@ export const Textarea = (props) => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
const autosizeTextarea = useCallback(() => {
|
|
33
|
-
if (!autoResize || !textAreaRef.current || computedMaxRows === undefined)
|
|
33
|
+
if (!autoResize || !textAreaRef.current || computedMaxRows === undefined || sizesByContent())
|
|
34
34
|
return;
|
|
35
35
|
textAreaRef.current.style.height = "0px";
|
|
36
36
|
const scrollHeight = textAreaRef.current.scrollHeight;
|
|
37
37
|
textAreaRef.current.style.height = scrollHeight + "px";
|
|
38
38
|
}, [autoResize, computedMaxRows]);
|
|
39
39
|
useEffect(() => {
|
|
40
|
-
if (!autoResize || !textAreaRef.current)
|
|
40
|
+
if (!autoResize || !textAreaRef.current || sizesByContent())
|
|
41
41
|
return;
|
|
42
42
|
return observeTextareaWidth(textAreaRef.current, autosizeTextarea);
|
|
43
43
|
}, [autoResize, autosizeTextarea]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MA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CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAC1D,GACE,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useCallback, useEffect, useId, useRef, useState } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { observeTextareaWidth, sizesByContent } from \"../../lib/observeTextareaWidth\"\nimport { type ControlSize, type Sizes, type Variants } from \"../../types\"\nimport s from \"@plexui/styles/components/Textarea/Textarea.module.css\"\n\nexport type TextareaProps = {\n /**\n * Visual style of the textarea\n * @default outline\n */\n variant?: Variants<\"outline\" | \"soft\" | \"ghost\">\n /**\n * Controls the size of the textarea\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n *\n * @default md\n */\n size?: ControlSize\n /**\n * Applies a negative margin using the current gutter to optically align the text with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Controls gutter on the edges of the textarea, defaults to value from `size`.\n *\n * | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /**\n * Disables the textarea visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Mark the textarea as invalid\n * @default false\n */\n invalid?: boolean\n /**\n * Allow autofill extensions to appear in the textarea\n * @default false\n */\n allowAutofillExtensions?: boolean\n /**\n * Select all contents of the textarea when mounted.\n * @default false\n */\n autoSelect?: boolean\n /** Callback invoked when the textarea is autofilled by the browser */\n onAutofill?: () => void\n /**\n * Default number of rows to display\n * @default 3\n */\n rows?: number\n /**\n * Automatically adjust the height of the textarea based on its contents.\n * @default false\n */\n autoResize?: boolean\n /**\n * Maximum number of rows that can be displayed when autoResize is enabled.\n * @default Math.max(rows, 10)\n */\n maxRows?: number\n /** Ref for the textarea */\n ref?: React.Ref<HTMLTextAreaElement | null>\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"disabled\" | \"size\">\n\nexport const Textarea = (props: TextareaProps) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null)\n const inputIdSuffix = useId()\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`\n const {\n id,\n name,\n variant = \"outline\",\n size = \"md\",\n opticallyAlign,\n gutterSize,\n className,\n autoComplete,\n disabled = false,\n readOnly = false,\n invalid = false,\n // Default to `true` when presence of `name`\n allowAutofillExtensions = !!name,\n onFocus,\n onBlur,\n onAnimationStart,\n onAutofill,\n autoSelect,\n rows = 3,\n maxRows,\n autoResize,\n ref,\n onChange,\n ...restProps\n } = props\n\n const [focused, setFocused] = useState<boolean>(false)\n const computedMaxRows = autoResize ? Math.max(maxRows ?? 10, rows) : rows\n\n useEffect(() => {\n if (autoSelect) {\n textAreaRef.current?.select()\n }\n }, [autoSelect])\n\n const handleAnimationStart = (evt: React.AnimationEvent<HTMLTextAreaElement>) => {\n onAnimationStart?.(evt)\n if (evt.animationName === \"native-autofill-in\") {\n onAutofill?.()\n }\n }\n\n const autosizeTextarea = useCallback(() => {\n if (!autoResize || !textAreaRef.current || computedMaxRows === undefined || sizesByContent()) return\n textAreaRef.current.style.height = \"0px\"\n const scrollHeight = textAreaRef.current.scrollHeight\n textAreaRef.current.style.height = scrollHeight + \"px\"\n }, [autoResize, computedMaxRows])\n\n useEffect(() => {\n if (!autoResize || !textAreaRef.current || sizesByContent()) return\n return observeTextareaWidth(textAreaRef.current, autosizeTextarea)\n }, [autoResize, autosizeTextarea])\n\n // Resize if value changes outside of user input - e.g. form reset\n useEffect(() => {\n autosizeTextarea()\n }, [props.value, rows, autosizeTextarea])\n\n return (\n <div\n className={clsx(s.Container, className)}\n data-slot=\"textarea\"\n data-variant={variant}\n data-size={size}\n data-optically-align={opticallyAlign}\n data-gutter-size={gutterSize}\n data-focused={focused}\n data-disabled={disabled ? \"\" : undefined}\n data-readonly={readOnly ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-auto-resize={autoResize ? \"\" : undefined}\n style={toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows}`,\n })}\n >\n <textarea\n {...restProps}\n onChange={(evt) => {\n onChange?.(evt)\n autosizeTextarea()\n }}\n ref={mergeRefs([textAreaRef, ref])}\n id={id || (allowAutofillExtensions ? undefined : onePasswordPreventionId)}\n className={s.Textarea}\n name={name}\n autoComplete={autoComplete}\n // Expose the visual invalid state to assistive tech; an explicit aria-invalid wins\n aria-invalid={restProps[\"aria-invalid\"] ?? (invalid || undefined)}\n readOnly={readOnly}\n disabled={disabled}\n rows={rows}\n onFocus={(evt) => {\n setFocused(true)\n onFocus?.(evt)\n }}\n onBlur={(evt) => {\n setFocused(false)\n onBlur?.(evt)\n }}\n onAnimationStart={handleAnimationStart}\n // Prevent LastPass and 1Password from appearing\n data-lpignore={allowAutofillExtensions ? undefined : true}\n data-1p-ignore={allowAutofillExtensions ? undefined : true}\n />\n </div>\n )\n}\n"]}
|
|
@@ -46,4 +46,10 @@ export const observeTextareaWidth = (element, resize) => {
|
|
|
46
46
|
view?.removeEventListener("resize", onResize);
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then
|
|
51
|
+
* the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to
|
|
52
|
+
* 0 and read scrollHeight, a forced layout on mount of every such textarea.
|
|
53
|
+
*/
|
|
54
|
+
export const sizesByContent = () => typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("field-sizing", "content");
|
|
49
55
|
//# sourceMappingURL=observeTextareaWidth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observeTextareaWidth.js","sourceRoot":"","sources":["../../../src/lib/observeTextareaWidth.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAoB,EAAE,MAAkB,EAAgB,EAAE;IAC7F,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,IAAI,MAAM,GAAG,IAAI,CAAA;IACjB,IAAI,KAAyB,CAAA;IAC7B,IAAI,aAAiC,CAAA;IAErC,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,CAAA;YAC9D,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,KAAK,aAAa;gBAAE,OAAM;YAC1E,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAA;YACvC,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAM;YAC/B,uEAAuE;YACvE,IAAI,IAAI,EAAE,CAAC;gBACT,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE;oBACtC,KAAK,GAAG,SAAS,CAAA;oBACjB,IAAI,MAAM;wBAAE,MAAM,EAAE,CAAA;gBACtB,CAAC,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,CAAA;YACV,CAAC;QACH,CAAC,CAAC,CAAA;QACF,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACzB,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,KAAK,CAAA;YACd,QAAQ,CAAC,UAAU,EAAE,CAAA;YACrB,IAAI,KAAK,KAAK,SAAS;gBAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAA;IACH,CAAC;IAED,aAAa,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;IACrD,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,MAAM,KAAK,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;QACnD,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,aAAa;YAAE,OAAM;QAC9C,aAAa,GAAG,KAAK,CAAA;QACrB,MAAM,EAAE,CAAA;IACV,CAAC,CAAA;IACD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,KAAK,CAAA;QACd,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["/** Observe width only; autosizing height must not feed back into the observer. */\nexport const observeTextareaWidth = (element: HTMLElement, resize: () => void): (() => void) => {\n const view = element.ownerDocument.defaultView\n let active = true\n let frame: number | undefined\n let previousWidth: number | undefined\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver((entries) => {\n const entry = entries.find(({ target }) => target === element)\n if (!active || !entry || entry.contentRect.width === previousWidth) return\n previousWidth = entry.contentRect.width\n if (frame !== undefined) return\n // Write height outside ResizeObserver delivery to avoid a resize loop.\n if (view) {\n frame = view.requestAnimationFrame(() => {\n frame = undefined\n if (active) resize()\n })\n } else {\n resize()\n }\n })\n observer.observe(element)\n return () => {\n active = false\n observer.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame(frame)\n }\n }\n\n previousWidth = element.getBoundingClientRect().width\n const onResize = () => {\n const width = element.getBoundingClientRect().width\n if (!active || width === previousWidth) return\n previousWidth = width\n resize()\n }\n view?.addEventListener(\"resize\", onResize)\n return () => {\n active = false\n view?.removeEventListener(\"resize\", onResize)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"observeTextareaWidth.js","sourceRoot":"","sources":["../../../src/lib/observeTextareaWidth.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAoB,EAAE,MAAkB,EAAgB,EAAE;IAC7F,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,IAAI,MAAM,GAAG,IAAI,CAAA;IACjB,IAAI,KAAyB,CAAA;IAC7B,IAAI,aAAiC,CAAA;IAErC,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,CAAA;YAC9D,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,KAAK,aAAa;gBAAE,OAAM;YAC1E,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAA;YACvC,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAM;YAC/B,uEAAuE;YACvE,IAAI,IAAI,EAAE,CAAC;gBACT,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE;oBACtC,KAAK,GAAG,SAAS,CAAA;oBACjB,IAAI,MAAM;wBAAE,MAAM,EAAE,CAAA;gBACtB,CAAC,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,CAAA;YACV,CAAC;QACH,CAAC,CAAC,CAAA;QACF,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACzB,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,KAAK,CAAA;YACd,QAAQ,CAAC,UAAU,EAAE,CAAA;YACrB,IAAI,KAAK,KAAK,SAAS;gBAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAA;IACH,CAAC;IAED,aAAa,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;IACrD,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,MAAM,KAAK,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;QACnD,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,aAAa;YAAE,OAAM;QAC9C,aAAa,GAAG,KAAK,CAAA;QACrB,MAAM,EAAE,CAAA;IACV,CAAC,CAAA;IACD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,KAAK,CAAA;QACd,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE,CAC1C,OAAO,GAAG,KAAK,WAAW,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,IAAI,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/** Observe width only; autosizing height must not feed back into the observer. */\nexport const observeTextareaWidth = (element: HTMLElement, resize: () => void): (() => void) => {\n const view = element.ownerDocument.defaultView\n let active = true\n let frame: number | undefined\n let previousWidth: number | undefined\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver((entries) => {\n const entry = entries.find(({ target }) => target === element)\n if (!active || !entry || entry.contentRect.width === previousWidth) return\n previousWidth = entry.contentRect.width\n if (frame !== undefined) return\n // Write height outside ResizeObserver delivery to avoid a resize loop.\n if (view) {\n frame = view.requestAnimationFrame(() => {\n frame = undefined\n if (active) resize()\n })\n } else {\n resize()\n }\n })\n observer.observe(element)\n return () => {\n active = false\n observer.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame(frame)\n }\n }\n\n previousWidth = element.getBoundingClientRect().width\n const onResize = () => {\n const width = element.getBoundingClientRect().width\n if (!active || width === previousWidth) return\n previousWidth = width\n resize()\n }\n view?.addEventListener(\"resize\", onResize)\n return () => {\n active = false\n view?.removeEventListener(\"resize\", onResize)\n }\n}\n\n/**\n * Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then\n * the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to\n * 0 and read scrollHeight, a forced layout on mount of every such textarea.\n */\nexport const sizesByContent = (): boolean =>\n typeof CSS !== \"undefined\" && typeof CSS.supports === \"function\" && CSS.supports(\"field-sizing\", \"content\")\n"]}
|
|
@@ -118,6 +118,12 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
118
118
|
* @default false, or true at the end of a `Field row`
|
|
119
119
|
*/
|
|
120
120
|
pill?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The list in the rounder shape of a pill menu (as `Menu.Content pill`), whatever the trigger: a custom `trigger` or a
|
|
123
|
+
* rounded field can open the same list as a pill one
|
|
124
|
+
* @default the trigger's `pill`
|
|
125
|
+
*/
|
|
126
|
+
listPill?: boolean;
|
|
121
127
|
/**
|
|
122
128
|
* Text of a `multiple` trigger when every option is selected
|
|
123
129
|
* @default All selected
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Observe width only; autosizing height must not feed back into the observer. */
|
|
2
2
|
export declare const observeTextareaWidth: (element: HTMLElement, resize: () => void) => (() => void);
|
|
3
|
+
/**
|
|
4
|
+
* Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then
|
|
5
|
+
* the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to
|
|
6
|
+
* 0 and read scrollHeight, a forced layout on mount of every such textarea.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sizesByContent: () => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Modern design system for building high-quality applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@maskito/core": "^5.2.2",
|
|
100
100
|
"@maskito/kit": "^5.2.2",
|
|
101
101
|
"@maskito/react": "^5.2.2",
|
|
102
|
-
"@plexui/styles": "^0.16.
|
|
102
|
+
"@plexui/styles": "^0.16.1",
|
|
103
103
|
"@radix-ui/react-dismissable-layer": "1.2.1",
|
|
104
104
|
"@radix-ui/react-focus-guards": "1.2.0",
|
|
105
105
|
"@radix-ui/react-focus-scope": "1.3.1",
|