@plexui/ui 0.30.0 → 0.32.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/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/es/components/ButtonGroup/index.js.map +1 -1
- package/dist/es/components/ContextMenu/shared.js +3 -2
- package/dist/es/components/ContextMenu/shared.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +42 -29
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/dialogSteps.js +85 -0
- package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
- package/dist/es/components/Dialog/dialogViewport.js +74 -0
- package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
- package/dist/es/components/Dialog/index.js +1 -1
- package/dist/es/components/Dialog/index.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +2 -1
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
- package/dist/es/components/IndexBar/IndexBar.js +164 -0
- package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
- package/dist/es/components/IndexBar/index.js +2 -0
- package/dist/es/components/IndexBar/index.js.map +1 -0
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js +142 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +57 -35
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/Page/Page.js +1 -1
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/PhoneLayout/PhoneLayout.js +41 -0
- package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
- package/dist/es/components/PhoneLayout/index.js +2 -0
- package/dist/es/components/PhoneLayout/index.js.map +1 -0
- package/dist/es/components/Slider/Slider.js +33 -3
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/SwipeActions/SwipeActions.js +321 -0
- package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
- package/dist/es/components/SwipeActions/index.js +2 -0
- package/dist/es/components/SwipeActions/index.js.map +1 -0
- package/dist/es/components/TabBar/TabBar.js +4 -4
- package/dist/es/components/TabBar/TabBar.js.map +1 -1
- package/dist/es/components/TabBar/index.js.map +1 -1
- package/dist/es/components/Tabs/Tabs.js +1 -1
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/TagInput/TagInput.js +5 -65
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +1 -1
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/components/Tip/Tip.js +106 -0
- package/dist/es/components/Tip/Tip.js.map +1 -0
- package/dist/es/components/Tip/index.js +2 -0
- package/dist/es/components/Tip/index.js.map +1 -0
- package/dist/es/components/Toast/ToastRenderer.js +22 -9
- package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
- package/dist/es/components/Toast/Toaster.js +17 -6
- package/dist/es/components/Toast/Toaster.js.map +1 -1
- package/dist/es/components/Toast/toastLifecycle.js +113 -1
- package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
- package/dist/es/components/Toolbar/Toolbar.js +1 -1
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/hooks/useEscCloseStack.js +10 -3
- package/dist/es/hooks/useEscCloseStack.js.map +1 -1
- package/dist/es/hooks/usePhoneSubmenu.js +6 -3
- package/dist/es/hooks/usePhoneSubmenu.js.map +1 -1
- package/dist/es/lib/floatingBoundary.js +3 -1
- package/dist/es/lib/floatingBoundary.js.map +1 -1
- package/dist/es/lib/helpers.js +21 -0
- package/dist/es/lib/helpers.js.map +1 -1
- package/dist/es/lib/menuInitialFocus.js +5 -3
- package/dist/es/lib/menuInitialFocus.js.map +1 -1
- package/dist/es/lib/menuSubmenuPlacement.js +129 -5
- package/dist/es/lib/menuSubmenuPlacement.js.map +1 -1
- package/dist/es/lib/menuTriggerCover.js +10 -4
- package/dist/es/lib/menuTriggerCover.js.map +1 -1
- package/dist/es/lib/phoneLayout.js +16 -0
- package/dist/es/lib/phoneLayout.js.map +1 -0
- package/dist/es/lib/toastRegion.js +6 -0
- package/dist/es/lib/toastRegion.js.map +1 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +8 -1
- package/dist/types/components/ButtonGroup/index.d.ts +1 -1
- package/dist/types/components/ContextMenu/shared.d.ts +3 -2
- package/dist/types/components/Dialog/Dialog.d.ts +48 -3
- package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
- package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/IndexBar/IndexBar.d.ts +35 -0
- package/dist/types/components/IndexBar/index.d.ts +1 -0
- package/dist/types/components/Menu/Menu.d.ts +6 -2
- package/dist/types/components/Page/Page.d.ts +1 -1
- package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +18 -0
- package/dist/types/components/PhoneLayout/index.d.ts +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +46 -0
- package/dist/types/components/SwipeActions/index.d.ts +1 -0
- package/dist/types/components/TabBar/TabBar.d.ts +18 -4
- package/dist/types/components/TabBar/index.d.ts +1 -1
- package/dist/types/components/Tip/Tip.d.ts +57 -0
- package/dist/types/components/Tip/index.d.ts +1 -0
- package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +5 -3
- package/dist/types/hooks/useEscCloseStack.d.ts +5 -1
- package/dist/types/hooks/usePhoneSubmenu.d.ts +2 -1
- package/dist/types/lib/helpers.d.ts +6 -0
- package/dist/types/lib/menuSubmenuPlacement.d.ts +9 -2
- package/dist/types/lib/phoneLayout.d.ts +11 -0
- package/dist/types/lib/toastRegion.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuSubmenuPlacement.js","sourceRoot":"","s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,CAAC,mBAAmB,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["/** Phone submenu geometry; desktop continues to use the primitive's cascade. */\nexport type MenuRect = { left: number; top: number; right: number; bottom: number }\nexport type MenuCollisionPadding = Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>\nexport type MenuFloatingBoundary = { collisionBoundary?: HTMLElement; collisionPadding: MenuCollisionPadding }\nexport type PhoneSubmenuPlacement = { sideOffset: number; alignOffset: number }\nexport type PhoneSubmenuState =\n | { mobile: false }\n | ({ mobile: true; ready: boolean; unavailable: boolean; label: string } & PhoneSubmenuPlacement)\n\nconst clamp = (value: number, minimum: number, maximum: number) =>\n Math.max(minimum, Math.min(maximum, value))\nconst round = (value: number) => Math.round(value * 1000) / 1000\n\nexport function solvePhoneSubmenuPlacement({\n boundary, trigger, parent, reference = trigger, width, height, paddingTop, direction,\n}: {\n boundary: MenuRect\n trigger: MenuRect\n parent: MenuRect\n /** The row's box as the primitive measures it, when the parent steps back (`readRestingMenuRects`) */\n reference?: MenuRect\n width: number\n height: number\n paddingTop: number\n direction: \"ltr\" | \"rtl\"\n}): PhoneSubmenuPlacement | null {\n if (width <= 0 || height <= 0 || boundary.right <= boundary.left || boundary.bottom <= boundary.top) return null\n // CSS caps the measured panel against this same rectangle. Do not paint an\n // oversized panel if that contract has not reached layout yet.\n if (width > boundary.right - boundary.left + 1 || height > boundary.bottom - boundary.top + 1) return null\n const left = clamp(direction === \"rtl\" ? parent.right - width : parent.left, boundary.left, Math.max(boundary.left, boundary.right - width))\n const top = clamp(trigger.top - paddingTop, boundary.top, Math.max(boundary.top, boundary.bottom - height))\n return {\n sideOffset: round(direction === \"rtl\" ? reference.left - width - left : left - reference.right),\n alignOffset: round(top - reference.top),\n }\n}\n\n/**\n * The boxes of a parent menu and of the row that opened a submenu at rest. While a phone submenu stands over it the\n * parent steps back with the CSS `scale` property (Menu.module.css, iOS-menu IMG_5677), and the submenu keeps the\n * parent's resting box, as the native one does: undo that scale around the parent's transform origin, at whatever\n * value its transition has reached.\n */\nexport function readRestingMenuRects(parent: HTMLElement, trigger: HTMLElement): { parent: MenuRect; trigger: MenuRect; reference: MenuRect } {\n const parentRect = parent.getBoundingClientRect()\n const triggerRect = trigger.getBoundingClientRect()\n const view = parent.ownerDocument.defaultView\n const style = view?.getComputedStyle(parent)\n const scale = Number.parseFloat(style?.scale ?? \"\")\n if (!style || !Number.isFinite(scale) || scale <= 0 || scale === 1) return { parent: parentRect, trigger: triggerRect, reference: triggerRect }\n const [originX = 0, originY = 0] = style.transformOrigin.split(\" \").map((value) => Number.parseFloat(value) || 0)\n const x = parentRect.left + originX * scale\n const y = parentRect.top + originY * scale\n const rest = (rect: MenuRect): MenuRect => ({\n left: x + (rect.left - x) / scale,\n top: y + (rect.top - y) / scale,\n right: x + (rect.right - x) / scale,\n bottom: y + (rect.bottom - y) / scale,\n })\n return { parent: rest(parentRect), trigger: rest(triggerRect), reference: triggerRect }\n}\n\n/** Consume boundary91's resolved footer padding; never subtract the footer again. */\nexport function readMenuBoundaryRect(document: Document, boundary: MenuFloatingBoundary): MenuRect | null {\n const view = document.defaultView\n if (!view) return null\n const viewport = view.visualViewport\n let left = viewport?.offsetLeft ?? 0\n let top = viewport?.offsetTop ?? 0\n let right = left + (viewport?.width ?? document.documentElement.clientWidth)\n let bottom = top + (viewport?.height ?? document.documentElement.clientHeight)\n const element = boundary.collisionBoundary\n if (element?.isConnected && element.ownerDocument === document) {\n const rect = element.getBoundingClientRect()\n const scaleX = element.offsetWidth > 0 ? rect.width / element.offsetWidth : 1\n const scaleY = element.offsetHeight > 0 ? rect.height / element.offsetHeight : 1\n const clientLeft = rect.left + element.clientLeft * scaleX\n const clientTop = rect.top + element.clientTop * scaleY\n left = Math.max(left, clientLeft)\n top = Math.max(top, clientTop)\n right = Math.min(right, clientLeft + element.clientWidth * scaleX)\n bottom = Math.min(bottom, clientTop + element.clientHeight * scaleY)\n }\n const padding = boundary.collisionPadding\n return {\n left: left + (padding.left ?? 0),\n top: top + (padding.top ?? 0),\n right: right - (padding.right ?? 0),\n bottom: bottom - (padding.bottom ?? 0),\n }\n}\n\nconst normalizeLabel = (value: string) => value.replace(/\\s+/g, \" \").trim()\n\nfunction visibleText(element: Element, includeHidden = false): string {\n const view = element.ownerDocument.defaultView\n if (!view) return \"\"\n // Explicit aria-labelledby targets can supply a name while visually hidden.\n if (!includeHidden && (element.hasAttribute(\"hidden\") || element.getAttribute(\"aria-hidden\") === \"true\")) return \"\"\n if ([\"SCRIPT\", \"STYLE\", \"TEMPLATE\"].includes(element.tagName)) return \"\"\n // A row's second line (Sort By over \"Manual\") is its value, not its name\n if (element.hasAttribute(\"data-menu-description\")) return \"\"\n const style = view.getComputedStyle(element)\n if (!includeHidden && (style.display === \"none\" || style.visibility === \"hidden\" || style.visibility === \"collapse\")) return \"\"\n const ownLabel = element.getAttribute(\"aria-label\")\n if (ownLabel?.trim()) return ownLabel\n if (element.tagName === \"IMG\") return element.getAttribute(\"alt\") ?? \"\"\n return Array.from(element.childNodes).map((node) => {\n if (node.nodeType === 3) return node.textContent ?? \"\"\n return node instanceof view.Element ? visibleText(node, includeHidden) : \"\"\n }).join(\"\")\n}\n\nfunction labelReferences(trigger: HTMLElement): Element[] {\n return (trigger.getAttribute(\"aria-labelledby\") ?? \"\").split(/\\s+/).filter(Boolean)\n .map((id) => trigger.ownerDocument.getElementById(id)).filter((element): element is HTMLElement => element !== null)\n}\n\n/** A text snapshot, never a clone of a consumer's rich children or their IDs. */\nexport function readMenuTriggerLabel(trigger: HTMLElement): string {\n const referenced = normalizeLabel(labelReferences(trigger).map((element) => visibleText(element, true)).join(\" \"))\n if (referenced) return referenced\n const labelled = normalizeLabel(trigger.getAttribute(\"aria-label\") ?? \"\")\n if (labelled) return labelled\n return normalizeLabel(visibleText(trigger)) || \"Collapse submenu\"\n}\n\nexport function focusPhoneSubmenuEntry(content: HTMLElement): void {\n const items = Array.from(content.querySelectorAll<HTMLElement>('[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'))\n .filter((item) => item.closest('[role=\"menu\"]') === content && !item.hasAttribute(\"data-disabled\") && item.getAttribute(\"aria-disabled\") !== \"true\")\n const target = items.find((item) => !item.hasAttribute(\"data-submenu-collapse\")) ?? items[0]\n target?.focus({ preventScroll: true })\n}\n\nexport function samePhoneSubmenuState(a: PhoneSubmenuState, b: PhoneSubmenuState): boolean {\n return a.mobile === b.mobile && (!a.mobile || !b.mobile ||\n (a.ready === b.ready && a.unavailable === b.unavailable && a.label === b.label && a.sideOffset === b.sideOffset && a.alignOffset === b.alignOffset))\n}\n\n/** Own only these Phone attributes/variables. Primitive focus and dismissal stay intact. */\nexport function observePhoneSubmenu(\n trigger: HTMLElement,\n content: HTMLElement,\n boundary: MenuFloatingBoundary,\n update: (state: PhoneSubmenuState) => void,\n): { refresh: () => void; dispose: () => void } {\n const view = content.ownerDocument.defaultView\n if (!view || trigger.ownerDocument !== content.ownerDocument) return { refresh: () => {}, dispose: () => {} }\n const parent = trigger.closest('[role=\"menu\"]')\n if (!(parent instanceof view.HTMLElement)) return { refresh: () => {}, dispose: () => {} }\n const media = typeof view.matchMedia === \"function\" ? view.matchMedia(\"(max-width: 767px)\") : null\n let disposed = false\n let frame: number | undefined\n let references: Element[] = []\n const setVariable = (name: string, value: number) => {\n const next = `${round(Math.max(0, value))}px`\n if (content.style.getPropertyValue(name) !== next) content.style.setProperty(name, next)\n }\n const clearPhone = () => {\n content.removeAttribute(\"data-submenu-phone\")\n content.removeAttribute(\"data-submenu-positioned\")\n content.removeAttribute(\"data-submenu-unavailable\")\n content.style.removeProperty(\"--menu-phone-max-width\")\n content.style.removeProperty(\"--menu-phone-max-height\")\n }\n const labelObserver = new view.MutationObserver(() => schedule())\n const updateLabelTargets = () => {\n const next = labelReferences(trigger)\n if (next.length === references.length && next.every((element, index) => element === references[index])) return\n references = next\n labelObserver.disconnect()\n for (const element of references) {\n labelObserver.observe(element, { childList: true, characterData: true, subtree: true, attributes: true })\n // A localized label can be replaced while retaining its public ID.\n if (element.parentElement) labelObserver.observe(element.parentElement, { childList: true })\n }\n }\n const refresh = () => {\n if (disposed) return\n if (!(media?.matches ?? view.innerWidth <= 767)) {\n clearPhone()\n parent.removeAttribute(\"data-submenu-over\")\n update({ mobile: false })\n return\n }\n content.setAttribute(\"data-submenu-phone\", \"\")\n updateLabelTargets()\n const label = readMenuTriggerLabel(trigger)\n const available = readMenuBoundaryRect(content.ownerDocument, boundary)\n if (!available) return\n setVariable(\"--menu-phone-max-width\", available.right - available.left)\n setVariable(\"--menu-phone-max-height\", available.bottom - available.top)\n const style = view.getComputedStyle(content)\n const width = content.offsetWidth\n const height = content.offsetHeight\n const hasHeader = !!content.querySelector(\"[data-submenu-collapse]\")\n const resting = readRestingMenuRects(parent, trigger)\n const placement = solvePhoneSubmenuPlacement({\n boundary: available,\n trigger: resting.trigger,\n parent: resting.parent,\n reference: resting.reference,\n width,\n height,\n paddingTop: Number.parseFloat(style.paddingTop) || 0,\n direction: style.direction === \"rtl\" ? \"rtl\" : \"ltr\",\n })\n // Wait for the header and real geometry, never flash the desktop cascade.\n const ready = !!placement && hasHeader\n // Header/zero-layout are still pending. After the CSS caps and header are\n // present, an empty boundary or measured overflow has no valid placement.\n const emptyBoundary = available.right <= available.left || available.bottom <= available.top\n const unavailable = hasHeader && !placement && (emptyBoundary || (width > 0 && height > 0))\n if (ready) content.setAttribute(\"data-submenu-positioned\", \"\")\n else content.removeAttribute(\"data-submenu-positioned\")\n if (unavailable) content.setAttribute(\"data-submenu-unavailable\", \"\")\n else content.removeAttribute(\"data-submenu-unavailable\")\n // The parent steps back while the submenu stands over it (Menu.module.css), not while it has nowhere to stand\n if (ready) parent.setAttribute(\"data-submenu-over\", \"\")\n else parent.removeAttribute(\"data-submenu-over\")\n update({ mobile: true, ready, unavailable, label, ...(placement ?? { sideOffset: 0, alignOffset: 0 }) })\n // A parent's enter transform moves its child trigger without resizing it.\n // Follow only that running transition, not an idle menu forever.\n if (typeof parent.getAnimations === \"function\" && parent.getAnimations().some((animation) => animation.playState === \"running\")) schedule()\n }\n const schedule = () => {\n if (!disposed && frame === undefined) frame = view.requestAnimationFrame(() => { frame = undefined; refresh() })\n }\n const resize = typeof view.ResizeObserver === \"function\" ? new view.ResizeObserver(schedule) : undefined\n for (const element of [trigger, parent, content, boundary.collisionBoundary]) if (element) resize?.observe(element)\n const mutations = new view.MutationObserver(schedule)\n mutations.observe(trigger, { attributes: true, characterData: true, childList: true, subtree: true })\n mutations.observe(parent, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n if (parent.parentElement) mutations.observe(parent.parentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-entering\", \"data-entering-active\"] })\n media?.addEventListener(\"change\", refresh)\n view.addEventListener(\"scroll\", schedule, true)\n view.addEventListener(\"resize\", schedule)\n view.visualViewport?.addEventListener(\"scroll\", schedule)\n view.visualViewport?.addEventListener(\"resize\", schedule)\n refresh()\n return {\n refresh,\n dispose: () => {\n disposed = true\n if (frame !== undefined) view.cancelAnimationFrame(frame)\n resize?.disconnect()\n mutations.disconnect()\n labelObserver.disconnect()\n media?.removeEventListener(\"change\", refresh)\n view.removeEventListener(\"scroll\", schedule, true)\n view.removeEventListener(\"resize\", schedule)\n view.visualViewport?.removeEventListener(\"scroll\", schedule)\n view.visualViewport?.removeEventListener(\"resize\", schedule)\n // Retained transition nodes keep their last geometry through exit, and a parent that leaves with its submenu\n // leaves stepped back. A choice in the submenu closes it before the whole menu starts to leave, so the parent\n // steps forward a frame later, unless by then it is leaving or another of its submenus stands over it.\n view.requestAnimationFrame(() => {\n if (parent.closest(\"[data-exiting]\") || parent.getAttribute(\"data-state\") === \"closed\") return\n if (parent.querySelector('[aria-expanded=\"true\"]')) return\n parent.removeAttribute(\"data-submenu-over\")\n })\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menuSubmenuPlacement.js","sourceRoot":"","sources":["../../../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Y,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;YAC3D,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;YAC7D,UAAU,EAAE,CAAA;YACZ,MAAM,EAAE,UAAU,EAAE,CAAA;YACpB,SAAS,CAAC,UAAU,EAAE,CAAA;YACtB,aAAa,CAAC,UAAU,EAAE,CAAA;YAC1B,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YAC7C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;YAClD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5C,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,6GAA6G;YAC7G,8GAA8G;YAC9G,uGAAuG;YACvG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE;gBAC9B,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,QAAQ;oBAAE,OAAM;gBAC9F,IAAI,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC;oBAAE,OAAM;gBAC1D,MAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { isPhoneLayout } from \"./phoneLayout\"\n\n/** Phone submenu geometry; desktop continues to use the primitive's cascade. */\nexport type MenuRect = { left: number; top: number; right: number; bottom: number }\nexport type MenuCollisionPadding = Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>\nexport type MenuFloatingBoundary = { collisionBoundary?: HTMLElement; collisionPadding: MenuCollisionPadding }\nexport type PhoneSubmenuPlacement = { sideOffset: number; alignOffset: number }\nexport type PhoneSubmenuState =\n | { mobile: false }\n | ({ mobile: true; ready: boolean; unavailable: boolean; label: string } & PhoneSubmenuPlacement)\n\nconst clamp = (value: number, minimum: number, maximum: number) =>\n Math.max(minimum, Math.min(maximum, value))\nconst round = (value: number) => Math.round(value * 1000) / 1000\n\nexport function solvePhoneSubmenuPlacement({\n boundary, trigger, parent, reference = trigger, width, height, paddingTop, direction,\n}: {\n boundary: MenuRect\n trigger: MenuRect\n parent: MenuRect\n /** The row's box as the primitive measures it, when the parent steps back (`readRestingMenuRects`) */\n reference?: MenuRect\n width: number\n height: number\n paddingTop: number\n direction: \"ltr\" | \"rtl\"\n}): PhoneSubmenuPlacement | null {\n if (width <= 0 || height <= 0 || boundary.right <= boundary.left || boundary.bottom <= boundary.top) return null\n // CSS caps the measured panel against this same rectangle. Do not paint an\n // oversized panel if that contract has not reached layout yet.\n if (width > boundary.right - boundary.left + 1 || height > boundary.bottom - boundary.top + 1) return null\n const left = clamp(direction === \"rtl\" ? parent.right - width : parent.left, boundary.left, Math.max(boundary.left, boundary.right - width))\n const top = clamp(trigger.top - paddingTop, boundary.top, Math.max(boundary.top, boundary.bottom - height))\n return {\n sideOffset: round(direction === \"rtl\" ? reference.left - width - left : left - reference.right),\n alignOffset: round(top - reference.top),\n }\n}\n\n/**\n * The boxes of a parent menu and of the row that opened a submenu at rest. While a phone submenu stands over it the\n * parent steps back with the CSS `scale` property (Menu.module.css, iOS-menu IMG_5677), and the submenu keeps the\n * parent's resting box, as the native one does: undo that scale around the parent's transform origin, at whatever\n * value its transition has reached.\n */\nexport function readRestingMenuRects(parent: HTMLElement, trigger: HTMLElement): { parent: MenuRect; trigger: MenuRect; reference: MenuRect } {\n const parentRect = parent.getBoundingClientRect()\n const triggerRect = trigger.getBoundingClientRect()\n const view = parent.ownerDocument.defaultView\n const style = view?.getComputedStyle(parent)\n const scale = Number.parseFloat(style?.scale ?? \"\")\n if (!style || !Number.isFinite(scale) || scale <= 0 || scale === 1) return { parent: parentRect, trigger: triggerRect, reference: triggerRect }\n const [originX = 0, originY = 0] = style.transformOrigin.split(\" \").map((value) => Number.parseFloat(value) || 0)\n const x = parentRect.left + originX * scale\n const y = parentRect.top + originY * scale\n const rest = (rect: MenuRect): MenuRect => ({\n left: x + (rect.left - x) / scale,\n top: y + (rect.top - y) / scale,\n right: x + (rect.right - x) / scale,\n bottom: y + (rect.bottom - y) / scale,\n })\n return { parent: rest(parentRect), trigger: rest(triggerRect), reference: triggerRect }\n}\n\n/** Consume boundary91's resolved footer padding; never subtract the footer again. */\nexport function readMenuBoundaryRect(document: Document, boundary: MenuFloatingBoundary): MenuRect | null {\n const view = document.defaultView\n if (!view) return null\n const viewport = view.visualViewport\n let left = viewport?.offsetLeft ?? 0\n let top = viewport?.offsetTop ?? 0\n let right = left + (viewport?.width ?? document.documentElement.clientWidth)\n let bottom = top + (viewport?.height ?? document.documentElement.clientHeight)\n const element = boundary.collisionBoundary\n if (element?.isConnected && element.ownerDocument === document) {\n const rect = element.getBoundingClientRect()\n const scaleX = element.offsetWidth > 0 ? rect.width / element.offsetWidth : 1\n const scaleY = element.offsetHeight > 0 ? rect.height / element.offsetHeight : 1\n const clientLeft = rect.left + element.clientLeft * scaleX\n const clientTop = rect.top + element.clientTop * scaleY\n left = Math.max(left, clientLeft)\n top = Math.max(top, clientTop)\n right = Math.min(right, clientLeft + element.clientWidth * scaleX)\n bottom = Math.min(bottom, clientTop + element.clientHeight * scaleY)\n }\n const padding = boundary.collisionPadding\n return {\n left: left + (padding.left ?? 0),\n top: top + (padding.top ?? 0),\n right: right - (padding.right ?? 0),\n bottom: bottom - (padding.bottom ?? 0),\n }\n}\n\nconst normalizeLabel = (value: string) => value.replace(/\\s+/g, \" \").trim()\n\nfunction visibleText(element: Element, includeHidden = false): string {\n const view = element.ownerDocument.defaultView\n if (!view) return \"\"\n // Explicit aria-labelledby targets can supply a name while visually hidden.\n if (!includeHidden && (element.hasAttribute(\"hidden\") || element.getAttribute(\"aria-hidden\") === \"true\")) return \"\"\n if ([\"SCRIPT\", \"STYLE\", \"TEMPLATE\"].includes(element.tagName)) return \"\"\n // A row's second line (Sort By over \"Manual\") is its value, not its name\n if (element.hasAttribute(\"data-menu-description\")) return \"\"\n const style = view.getComputedStyle(element)\n if (!includeHidden && (style.display === \"none\" || style.visibility === \"hidden\" || style.visibility === \"collapse\")) return \"\"\n const ownLabel = element.getAttribute(\"aria-label\")\n if (ownLabel?.trim()) return ownLabel\n if (element.tagName === \"IMG\") return element.getAttribute(\"alt\") ?? \"\"\n return Array.from(element.childNodes).map((node) => {\n if (node.nodeType === 3) return node.textContent ?? \"\"\n return node instanceof view.Element ? visibleText(node, includeHidden) : \"\"\n }).join(\"\")\n}\n\nfunction labelReferences(trigger: HTMLElement): Element[] {\n return (trigger.getAttribute(\"aria-labelledby\") ?? \"\").split(/\\s+/).filter(Boolean)\n .map((id) => trigger.ownerDocument.getElementById(id)).filter((element): element is HTMLElement => element !== null)\n}\n\n/** A text snapshot, never a clone of a consumer's rich children or their IDs. */\nexport function readMenuTriggerLabel(trigger: HTMLElement): string {\n const referenced = normalizeLabel(labelReferences(trigger).map((element) => visibleText(element, true)).join(\" \"))\n if (referenced) return referenced\n const labelled = normalizeLabel(trigger.getAttribute(\"aria-label\") ?? \"\")\n if (labelled) return labelled\n return normalizeLabel(visibleText(trigger)) || \"Collapse submenu\"\n}\n\nexport function focusPhoneSubmenuEntry(content: HTMLElement): void {\n const items = Array.from(content.querySelectorAll<HTMLElement>('[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'))\n .filter((item) => item.closest('[role=\"menu\"]') === content && !item.hasAttribute(\"data-disabled\") && item.getAttribute(\"aria-disabled\") !== \"true\")\n const target = items.find((item) => !item.hasAttribute(\"data-submenu-collapse\")) ?? items[0]\n target?.focus({ preventScroll: true })\n}\n\nexport function samePhoneSubmenuState(a: PhoneSubmenuState, b: PhoneSubmenuState): boolean {\n return a.mobile === b.mobile && (!a.mobile || !b.mobile ||\n (a.ready === b.ready && a.unavailable === b.unavailable && a.label === b.label && a.sideOffset === b.sideOffset && a.alignOffset === b.alignOffset))\n}\n\n/**\n * Cancels the release of a press that a phone submenu's parent took to collapse the submenu. The parent's rows take\n * presses again a frame after it collapses, and a release over one of them would choose it, as a touch dragged through\n * a menu does (Radix and Reka items click on a release that did not start on them). Only that press's release and the\n * click right after it: a press whose release never comes ends with the next press or when the window loses focus.\n */\nfunction swallowRelease(view: Window, pointerId: number): void {\n let timer: ReturnType<typeof setTimeout> | undefined\n const stop = (event: Event) => {\n event.preventDefault()\n event.stopPropagation()\n }\n const click = (event: Event) => {\n stop(event)\n done()\n }\n const end = (event: PointerEvent) => {\n if (event.pointerId !== pointerId) return\n view.removeEventListener(\"pointerup\", end, true)\n view.removeEventListener(\"pointercancel\", end, true)\n // None comes after a cancelled press\n if (event.type !== \"pointerup\") return done()\n stop(event)\n // The click of that release comes right after it\n view.addEventListener(\"click\", click, true)\n timer = setTimeout(done, 400)\n }\n const done = () => {\n if (timer !== undefined) clearTimeout(timer)\n view.removeEventListener(\"pointerup\", end, true)\n view.removeEventListener(\"pointercancel\", end, true)\n view.removeEventListener(\"click\", click, true)\n view.removeEventListener(\"pointerdown\", done, true)\n view.removeEventListener(\"blur\", done)\n }\n view.addEventListener(\"pointerup\", end, true)\n view.addEventListener(\"pointercancel\", end, true)\n // Added while that press's own pointerdown is past the window, so only a later press ends it\n view.addEventListener(\"pointerdown\", done, true)\n view.addEventListener(\"blur\", done)\n}\n\n/**\n * Own only these Phone attributes/variables. Primitive focus and dismissal stay intact.\n *\n * While a phone submenu stands over its parent the parent is behind it, as in iOS 26 (owner, plan 176): a press on it\n * collapses the submenu (`onParentPress`) and chooses none of its rows, which take no presses (Menu.module.css), and\n * it is hidden from a screen reader. Focus left in it by the press that opened the submenu moves into the submenu, as\n * VoiceOver's moves into an iOS submenu, and a focus that returns to it (the submenu collapsing) shows it again.\n */\nexport function observePhoneSubmenu(\n trigger: HTMLElement,\n content: HTMLElement,\n boundary: MenuFloatingBoundary,\n update: (state: PhoneSubmenuState) => void,\n onParentPress?: () => void,\n): { refresh: () => void; dispose: () => void } {\n const view = content.ownerDocument.defaultView\n if (!view || trigger.ownerDocument !== content.ownerDocument) return { refresh: () => {}, dispose: () => {} }\n const parent = trigger.closest('[role=\"menu\"]')\n if (!(parent instanceof view.HTMLElement)) return { refresh: () => {}, dispose: () => {} }\n const media = typeof view.matchMedia === \"function\" ? view.matchMedia(\"(max-width: 767px)\") : null\n let disposed = false\n let frame: number | undefined\n let focusFrame: number | undefined\n // Whether the submenu has found its place or found there is none, and the focus it found then\n let settled = false\n let focusAtOpen: Element | null = null\n let references: Element[] = []\n const covered = () => parent.hasAttribute(\"data-submenu-over\")\n const showParent = () => {\n if (parent.getAttribute(\"data-submenu-hidden\") === null) return\n parent.removeAttribute(\"data-submenu-hidden\")\n parent.removeAttribute(\"aria-hidden\")\n }\n // A frame after the submenu stands over the parent, once the primitive's focus scopes have taken it as a branch of a\n // modal menu: focus the press left on the row that opened it moves into the submenu, then the parent is hidden\n const hideParent = () => {\n if (focusFrame !== undefined) return\n focusFrame = view.requestAnimationFrame(() => {\n focusFrame = undefined\n if (disposed || !covered()) return\n const focused = content.ownerDocument.activeElement\n // Only the focus the submenu found as it first stood over the parent, untouched since: a keyboard entry, a\n // collapse or a later return to the parent own focus, and a submenu that first had no room does not take it\n if (focusAtOpen && focused === focusAtOpen && parent.contains(focused)) content.focus({ preventScroll: true })\n focusAtOpen = null\n // A hidden element must not hold focus; a parent focused again stays shown\n if (parent.contains(content.ownerDocument.activeElement)) return\n parent.setAttribute(\"data-submenu-hidden\", \"\")\n parent.setAttribute(\"aria-hidden\", \"true\")\n })\n }\n const pressParent = (event: PointerEvent) => {\n // A primary press, a touch or a pen: a secondary button chooses nothing behind the submenu anyway\n if (event.button !== 0 || !covered() || content.contains(event.target as Node)) return\n // It goes on to the primitives' layers, which mark a press inside a menu until it reaches the document; its rows\n // take no pointer, and the release and click that would choose one are cancelled\n event.preventDefault()\n swallowRelease(view, event.pointerId)\n onParentPress?.()\n }\n const focusParent = () => showParent()\n // Its rows take no pointer (Menu.module.css), so the pointer leaves the row that opened the submenu once the submenu\n // covers it: that leave must not move focus back to the parent, which would close the submenu\n const leaveParent = (event: PointerEvent) => {\n if (covered() && !content.contains(event.target as Node)) event.stopPropagation()\n }\n parent.addEventListener(\"pointerdown\", pressParent, true)\n parent.addEventListener(\"focusin\", focusParent, true)\n parent.addEventListener(\"pointerout\", leaveParent, true)\n parent.addEventListener(\"pointerleave\", leaveParent, true)\n const setVariable = (name: string, value: number) => {\n const next = `${round(Math.max(0, value))}px`\n if (content.style.getPropertyValue(name) !== next) content.style.setProperty(name, next)\n }\n const clearPhone = () => {\n content.removeAttribute(\"data-submenu-phone\")\n content.removeAttribute(\"data-submenu-positioned\")\n content.removeAttribute(\"data-submenu-unavailable\")\n content.style.removeProperty(\"--menu-phone-max-width\")\n content.style.removeProperty(\"--menu-phone-max-height\")\n }\n const labelObserver = new view.MutationObserver(() => schedule())\n const updateLabelTargets = () => {\n const next = labelReferences(trigger)\n if (next.length === references.length && next.every((element, index) => element === references[index])) return\n references = next\n labelObserver.disconnect()\n for (const element of references) {\n labelObserver.observe(element, { childList: true, characterData: true, subtree: true, attributes: true })\n // A localized label can be replaced while retaining its public ID.\n if (element.parentElement) labelObserver.observe(element.parentElement, { childList: true })\n }\n }\n const refresh = () => {\n if (disposed) return\n // A narrow window, or a PhoneLayout or phone Dialog at any width\n if (!isPhoneLayout(content)) {\n clearPhone()\n parent.removeAttribute(\"data-submenu-over\")\n showParent()\n update({ mobile: false })\n return\n }\n content.setAttribute(\"data-submenu-phone\", \"\")\n updateLabelTargets()\n const label = readMenuTriggerLabel(trigger)\n const available = readMenuBoundaryRect(content.ownerDocument, boundary)\n if (!available) return\n setVariable(\"--menu-phone-max-width\", available.right - available.left)\n setVariable(\"--menu-phone-max-height\", available.bottom - available.top)\n const style = view.getComputedStyle(content)\n const width = content.offsetWidth\n const height = content.offsetHeight\n const hasHeader = !!content.querySelector(\"[data-submenu-collapse]\")\n const resting = readRestingMenuRects(parent, trigger)\n const placement = solvePhoneSubmenuPlacement({\n boundary: available,\n trigger: resting.trigger,\n parent: resting.parent,\n reference: resting.reference,\n width,\n height,\n paddingTop: Number.parseFloat(style.paddingTop) || 0,\n direction: style.direction === \"rtl\" ? \"rtl\" : \"ltr\",\n })\n // Wait for the header and real geometry, never flash the desktop cascade.\n const ready = !!placement && hasHeader\n // Header/zero-layout are still pending. After the CSS caps and header are\n // present, an empty boundary or measured overflow has no valid placement.\n const emptyBoundary = available.right <= available.left || available.bottom <= available.top\n const unavailable = hasHeader && !placement && (emptyBoundary || (width > 0 && height > 0))\n if (ready) content.setAttribute(\"data-submenu-positioned\", \"\")\n else content.removeAttribute(\"data-submenu-positioned\")\n if (unavailable) content.setAttribute(\"data-submenu-unavailable\", \"\")\n else content.removeAttribute(\"data-submenu-unavailable\")\n // The parent steps back while the submenu stands over it (Menu.module.css), not while it has nowhere to stand\n if ((ready || unavailable) && !settled) {\n settled = true\n if (ready) focusAtOpen = content.ownerDocument.activeElement\n }\n if (ready) {\n parent.setAttribute(\"data-submenu-over\", \"\")\n hideParent()\n } else {\n parent.removeAttribute(\"data-submenu-over\")\n showParent()\n }\n update({ mobile: true, ready, unavailable, label, ...(placement ?? { sideOffset: 0, alignOffset: 0 }) })\n // A parent's enter transform moves its child trigger without resizing it.\n // Follow only that running transition, not an idle menu forever.\n if (typeof parent.getAnimations === \"function\" && parent.getAnimations().some((animation) => animation.playState === \"running\")) schedule()\n }\n const schedule = () => {\n if (!disposed && frame === undefined) frame = view.requestAnimationFrame(() => { frame = undefined; refresh() })\n }\n const resize = typeof view.ResizeObserver === \"function\" ? new view.ResizeObserver(schedule) : undefined\n for (const element of [trigger, parent, content, boundary.collisionBoundary]) if (element) resize?.observe(element)\n const mutations = new view.MutationObserver(schedule)\n mutations.observe(trigger, { attributes: true, characterData: true, childList: true, subtree: true })\n mutations.observe(parent, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n if (parent.parentElement) mutations.observe(parent.parentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-entering\", \"data-entering-active\"] })\n media?.addEventListener(\"change\", refresh)\n view.addEventListener(\"scroll\", schedule, true)\n view.addEventListener(\"resize\", schedule)\n view.visualViewport?.addEventListener(\"scroll\", schedule)\n view.visualViewport?.addEventListener(\"resize\", schedule)\n refresh()\n return {\n refresh,\n dispose: () => {\n disposed = true\n if (frame !== undefined) view.cancelAnimationFrame(frame)\n if (focusFrame !== undefined) view.cancelAnimationFrame(focusFrame)\n parent.removeEventListener(\"pointerdown\", pressParent, true)\n parent.removeEventListener(\"focusin\", focusParent, true)\n parent.removeEventListener(\"pointerout\", leaveParent, true)\n parent.removeEventListener(\"pointerleave\", leaveParent, true)\n showParent()\n resize?.disconnect()\n mutations.disconnect()\n labelObserver.disconnect()\n media?.removeEventListener(\"change\", refresh)\n view.removeEventListener(\"scroll\", schedule, true)\n view.removeEventListener(\"resize\", schedule)\n view.visualViewport?.removeEventListener(\"scroll\", schedule)\n view.visualViewport?.removeEventListener(\"resize\", schedule)\n // Retained transition nodes keep their last geometry through exit, and a parent that leaves with its submenu\n // leaves stepped back. A choice in the submenu closes it before the whole menu starts to leave, so the parent\n // steps forward a frame later, unless by then it is leaving or another of its submenus stands over it.\n view.requestAnimationFrame(() => {\n if (parent.closest(\"[data-exiting]\") || parent.getAttribute(\"data-state\") === \"closed\") return\n if (parent.querySelector('[aria-expanded=\"true\"]')) return\n parent.removeAttribute(\"data-submenu-over\")\n })\n },\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPhoneLayout, PHONE_LAYOUT_SCOPE } from "./phoneLayout.js";
|
|
1
2
|
/**
|
|
2
3
|
* On a phone a menu grows out of the control that opens it and covers it, as iOS 26 menus do: the panel's top is the
|
|
3
4
|
* control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu
|
|
@@ -18,11 +19,16 @@ export function observeMenuTriggerCover(trigger, onChange) {
|
|
|
18
19
|
let last;
|
|
19
20
|
const measure = () => {
|
|
20
21
|
let cover = null;
|
|
21
|
-
|
|
22
|
+
// A narrow window, or a PhoneLayout or phone Dialog at any width
|
|
23
|
+
if (isPhoneLayout(trigger)) {
|
|
22
24
|
const rect = trigger.getBoundingClientRect();
|
|
23
|
-
// The visible part of the screen: the layout viewport less a keyboard or a pinch zoom
|
|
25
|
+
// The visible part of the screen: the layout viewport less a keyboard or a pinch zoom, or the box of a
|
|
26
|
+
// PhoneLayout, which is the phone's screen (a phone Dialog's own scope has no box: the window is its screen)
|
|
24
27
|
const viewport = view.visualViewport;
|
|
25
|
-
const
|
|
28
|
+
const screen = trigger.closest(PHONE_LAYOUT_SCOPE)?.getBoundingClientRect();
|
|
29
|
+
const middle = screen && screen.height > 0
|
|
30
|
+
? Math.max(screen.top, viewport?.offsetTop ?? 0) / 2 + Math.min(screen.bottom, (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight)) / 2
|
|
31
|
+
: (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2;
|
|
26
32
|
// The layout height: a pressed control may be scaled, and the panel covers its resting box
|
|
27
33
|
cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? "top" : "bottom" };
|
|
28
34
|
}
|
|
@@ -50,7 +56,7 @@ export function observeMenuTriggerCover(trigger, onChange) {
|
|
|
50
56
|
export function ignoreReleaseOverTrigger(trigger, pointerId) {
|
|
51
57
|
const view = trigger.ownerDocument.defaultView;
|
|
52
58
|
// Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer
|
|
53
|
-
if (!view ||
|
|
59
|
+
if (!view || !isPhoneLayout(trigger))
|
|
54
60
|
return;
|
|
55
61
|
const release = (event) => {
|
|
56
62
|
if (event.pointerId !== pointerId)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuTriggerCover.js","sourceRoot":"","sources":["../../../src/lib/menuTriggerCover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menuTriggerCover.js","sourceRoot":"","sources":["../../../src/lib/menuTriggerCover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAKjE;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAoB,EAAE,QAAkD;IAC9G,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACnD,QAAQ,CAAC,IAAI,CAAC,CAAA;QACd,OAAO,GAAG,EAAE,CAAC,SAAS,CAAA;IACxB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACnD,IAAI,IAAwB,CAAA;IAC5B,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,KAAK,GAA4B,IAAI,CAAA;QACzC,iEAAiE;QACjE,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;YAC5C,uGAAuG;YACvG,6GAA6G;YAC7G,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAA;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAA;YAC3E,MAAM,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBACxC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CA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U,wBAAwB,CAAC,OAAoB,EAAE,SAAiB;IAC9E,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,+FAA+F;IAC/F,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAAE,OAAM;IAC5C,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;QACtC,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,OAAM;QACzC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QACxD,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW;YAAE,OAAM;QACtC,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;QAC5C,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC3H,KAAK,CAAC,cAAc,EAAE,CAAA;QACxB,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { isPhoneLayout, PHONE_LAYOUT_SCOPE } from \"./phoneLayout\"\n\n/** Where a phone menu stands over its trigger: the side offset that covers it, and the side it opens to. */\nexport type MenuTriggerCover = { sideOffset: number; side: \"top\" | \"bottom\" }\n\n/**\n * On a phone a menu grows out of the control that opens it and covers it, as iOS 26 menus do: the panel's top is the\n * control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu\n * IMG_5657 and IMG_5654, the More button of a top bar; IMG_5658, a button of a group; IMG_5649, the value of a form\n * row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in\n * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size\n * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts\n * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,\n * where the menu keeps its gap below the control.\n */\nexport function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void): () => void {\n const view = trigger.ownerDocument.defaultView\n if (!view || typeof view.matchMedia !== \"function\") {\n onChange(null)\n return () => undefined\n }\n const media = view.matchMedia(\"(max-width: 767px)\")\n let last: string | undefined\n const measure = () => {\n let cover: MenuTriggerCover | null = null\n // A narrow window, or a PhoneLayout or phone Dialog at any width\n if (isPhoneLayout(trigger)) {\n const rect = trigger.getBoundingClientRect()\n // The visible part of the screen: the layout viewport less a keyboard or a pinch zoom, or the box of a\n // PhoneLayout, which is the phone's screen (a phone Dialog's own scope has no box: the window is its screen)\n const viewport = view.visualViewport\n const screen = trigger.closest(PHONE_LAYOUT_SCOPE)?.getBoundingClientRect()\n const middle = screen && screen.height > 0\n ? Math.max(screen.top, viewport?.offsetTop ?? 0) / 2 + Math.min(screen.bottom, (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight)) / 2\n : (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2\n // The layout height: a pressed control may be scaled, and the panel covers its resting box\n cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? \"top\" : \"bottom\" }\n }\n const key = cover ? `${cover.sideOffset} ${cover.side}` : \"\"\n if (key === last) return\n last = key\n onChange(cover)\n }\n measure()\n const resize = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure)\n resize?.observe(trigger)\n media.addEventListener?.(\"change\", measure)\n return () => {\n resize?.disconnect()\n media.removeEventListener?.(\"change\", measure)\n }\n}\n\n/**\n * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under\n * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press\n * that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses\n * it, as a touch dragged through an iOS menu does.\n */\nexport function ignoreReleaseOverTrigger(trigger: HTMLElement, pointerId: number): void {\n const view = trigger.ownerDocument.defaultView\n // Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer\n if (!view || !isPhoneLayout(trigger)) return\n const release = (event: PointerEvent) => {\n if (event.pointerId !== pointerId) return\n view.removeEventListener(\"pointerup\", release, true)\n view.removeEventListener(\"pointercancel\", release, true)\n if (event.type !== \"pointerup\") return\n const rect = trigger.getBoundingClientRect()\n if (event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom) {\n event.preventDefault()\n }\n }\n view.addEventListener(\"pointerup\", release, true)\n view.addEventListener(\"pointercancel\", release, true)\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The phone layout outside a narrow window (plan 176). The style sheets apply their phone rules (767px and below)
|
|
3
|
+
* inside an element marked `data-plex-layout="phone"` too, at any window width: PhoneLayout marks one, and so does a
|
|
4
|
+
* Dialog with `layout="phone"`. Scripts that change what they do on a phone ask the same question here.
|
|
5
|
+
*/
|
|
6
|
+
export const PHONE_LAYOUT_SCOPE = '[data-plex-layout="phone"]';
|
|
7
|
+
export const PHONE_MEDIA = "(max-width: 767px)";
|
|
8
|
+
/** The window is 767px wide or narrower. */
|
|
9
|
+
export const isPhoneWindow = (view) => {
|
|
10
|
+
if (!view)
|
|
11
|
+
return false;
|
|
12
|
+
return typeof view.matchMedia === "function" ? view.matchMedia(PHONE_MEDIA).matches : view.innerWidth <= 767;
|
|
13
|
+
};
|
|
14
|
+
/** The element is laid out as on a phone: inside a phone layout, or in a window 767px wide or narrower. */
|
|
15
|
+
export const isPhoneLayout = (element) => element.closest(PHONE_LAYOUT_SCOPE) !== null || isPhoneWindow(element.ownerDocument.defaultView);
|
|
16
|
+
//# sourceMappingURL=phoneLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phoneLayout.js","sourceRoot":"","sources":["../../../src/lib/phoneLayout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAA;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAE/C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAA+B,EAAW,EAAE;IACxE,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IACvB,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,GAAG,CAAA;AAC9G,CAAC,CAAA;AAED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAW,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,IAAI,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA","sourcesContent":["/**\n * The phone layout outside a narrow window (plan 176). The style sheets apply their phone rules (767px and below)\n * inside an element marked `data-plex-layout=\"phone\"` too, at any window width: PhoneLayout marks one, and so does a\n * Dialog with `layout=\"phone\"`. Scripts that change what they do on a phone ask the same question here.\n */\nexport const PHONE_LAYOUT_SCOPE = '[data-plex-layout=\"phone\"]'\nexport const PHONE_MEDIA = \"(max-width: 767px)\"\n\n/** The window is 767px wide or narrower. */\nexport const isPhoneWindow = (view: Window | null | undefined): boolean => {\n if (!view) return false\n return typeof view.matchMedia === \"function\" ? view.matchMedia(PHONE_MEDIA).matches : view.innerWidth <= 767\n}\n\n/** The element is laid out as on a phone: inside a phone layout, or in a window 767px wide or narrower. */\nexport const isPhoneLayout = (element: Element): boolean =>\n element.closest(PHONE_LAYOUT_SCOPE) !== null || isPhoneWindow(element.ownerDocument.defaultView)\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toast region is a layer of its own above any overlay: a press, focus or Escape inside a toast belongs to the
|
|
3
|
+
* toast, never to a Dialog, Popover or Menu under it. Every toast list carries `data-sonner-toaster`.
|
|
4
|
+
*/
|
|
5
|
+
export const inToastRegion = (target) => typeof Element !== "undefined" && target instanceof Element && target.closest("[data-sonner-toaster]") !== null;
|
|
6
|
+
//# sourceMappingURL=toastRegion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastRegion.js","sourceRoot":"","sources":["../../../src/lib/toastRegion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAsC,EAAE,EAAE,CACtE,OAAO,OAAO,KAAK,WAAW,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAA","sourcesContent":["/**\n * The toast region is a layer of its own above any overlay: a press, focus or Escape inside a toast belongs to the\n * toast, never to a Dialog, Popover or Menu under it. Every toast list carries `data-sonner-toaster`.\n */\nexport const inToastRegion = (target: EventTarget | null | undefined) =>\n typeof Element !== \"undefined\" && target instanceof Element && target.closest(\"[data-sonner-toaster]\") !== null\n"]}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { type ComponentProps, type HTMLAttributes, type Ref } from "react";
|
|
2
2
|
import { Separator } from "../Separator/index.js";
|
|
3
3
|
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type ButtonGroupMobileMaterial = "glass" | "flat";
|
|
4
5
|
export type ButtonGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
6
|
/**
|
|
6
7
|
* Direction of the joined buttons.
|
|
7
8
|
* @default "horizontal"
|
|
8
9
|
*/
|
|
9
10
|
orientation?: ButtonGroupOrientation;
|
|
11
|
+
/**
|
|
12
|
+
* Phone surface (below 768px, with touch.css). `"glass"` makes the group one glass capsule, the Button Group
|
|
13
|
+
* of the iOS 27 kit, for controls over the content; a group in a Toolbar is one already. `"flat"` keeps the
|
|
14
|
+
* joined buttons in a Toolbar.
|
|
15
|
+
*/
|
|
16
|
+
mobileMaterial?: ButtonGroupMobileMaterial;
|
|
10
17
|
className?: string;
|
|
11
18
|
ref?: Ref<HTMLDivElement>;
|
|
12
19
|
};
|
|
13
|
-
declare const ButtonGroupRoot: ({ orientation, className, ref, ...restProps }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const ButtonGroupRoot: ({ orientation, mobileMaterial, className, ref, ...restProps }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
21
|
export type ButtonGroupSeparatorProps = Omit<ComponentProps<typeof Separator>, "orientation"> & {
|
|
15
22
|
/**
|
|
16
23
|
* When omitted, uses `"vertical"`, the axis that looks right between
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ButtonGroup, type ButtonGroupProps, type ButtonGroupOrientation, type ButtonGroupSeparatorProps, } from "./ButtonGroup.js";
|
|
1
|
+
export { ButtonGroup, type ButtonGroupProps, type ButtonGroupMobileMaterial, type ButtonGroupOrientation, type ButtonGroupSeparatorProps, } from "./ButtonGroup.js";
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
export declare const CONTEXT_MENU_LONG_PRESS = 500;
|
|
3
3
|
/** A touch that moves farther than this before then scrolls or drags instead. */
|
|
4
4
|
export declare const CONTEXT_MENU_LONG_PRESS_SLOP = 10;
|
|
5
|
-
/** The kit's gap between the preview and the menu
|
|
6
|
-
|
|
5
|
+
/** The kit's gap between the preview and the menu: iOS 27 Context Menu 125:58750, Alignment=Vertical, the menu at
|
|
6
|
+
* 176.5 under a content area that ends at 160.5 (the iOS 26 kit had 18). */
|
|
7
|
+
export declare const CONTEXT_MENU_PREVIEW_GAP = 16;
|
|
7
8
|
type Rect = {
|
|
8
9
|
x: number;
|
|
9
10
|
y: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
3
3
|
export type DialogProps = {
|
|
4
4
|
open?: boolean;
|
|
@@ -10,7 +10,7 @@ export declare const Dialog: {
|
|
|
10
10
|
Trigger: ({ children }: {
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout, ...rest }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
Header: ({ children, className, background }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
HeaderAction: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
Body: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,8 +20,19 @@ export declare const Dialog: {
|
|
|
20
20
|
Close: ({ children }: {
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
Steps: ({ step, direction, children, className }: DialogStepsProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
};
|
|
24
25
|
export type DialogPlacement = "center" | "top" | "bottom" | "start" | "end" | "fullscreen";
|
|
26
|
+
/** A press or a focus outside the dialog; `event.detail.originalEvent` is the browser's event. */
|
|
27
|
+
export type DialogInteractOutsideEvent = CustomEvent<{
|
|
28
|
+
originalEvent: PointerEvent | FocusEvent;
|
|
29
|
+
}>;
|
|
30
|
+
/** Class, style and data attributes for one of the dialog's layers. */
|
|
31
|
+
export type DialogLayerProps = {
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
35
|
+
};
|
|
25
36
|
export type DialogContentProps = {
|
|
26
37
|
children: ReactNode;
|
|
27
38
|
width?: number | string;
|
|
@@ -52,6 +63,28 @@ export type DialogContentProps = {
|
|
|
52
63
|
onOpenAutoFocus?: (event: Event) => void;
|
|
53
64
|
/** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */
|
|
54
65
|
onCloseAutoFocus?: (event: Event) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form
|
|
68
|
+
* with unsaved changes.
|
|
69
|
+
*/
|
|
70
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Called on a press or a focus outside the dialog before it closes. Call `event.preventDefault()` to keep it open,
|
|
73
|
+
* such as for a press on a developer panel over the page.
|
|
74
|
+
*/
|
|
75
|
+
onInteractOutside?: (event: DialogInteractOutsideEvent) => void;
|
|
76
|
+
/** Stack order of the overlay and the dialog. @default 50 */
|
|
77
|
+
zIndex?: number;
|
|
78
|
+
/** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */
|
|
79
|
+
rootProps?: DialogLayerProps;
|
|
80
|
+
/** Class, style and data attributes for the overlay. */
|
|
81
|
+
overlayProps?: DialogLayerProps;
|
|
82
|
+
/**
|
|
83
|
+
* `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.
|
|
84
|
+
* @default "auto"
|
|
85
|
+
*/
|
|
86
|
+
layout?: "auto" | "phone";
|
|
87
|
+
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
55
88
|
};
|
|
56
89
|
type DialogSlotProps = {
|
|
57
90
|
children: ReactNode;
|
|
@@ -60,7 +93,7 @@ type DialogSlotProps = {
|
|
|
60
93
|
/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */
|
|
61
94
|
export type DialogBarBackground = BarBackground;
|
|
62
95
|
export type DialogHeaderProps = DialogSlotProps & {
|
|
63
|
-
/** How the bar meets the content scrolled under it in a phone Sheet. @default "
|
|
96
|
+
/** How the bar meets the content scrolled under it in a phone Sheet. @default "glass" */
|
|
64
97
|
background?: DialogBarBackground;
|
|
65
98
|
};
|
|
66
99
|
export type DialogFooterProps = DialogSlotProps & {
|
|
@@ -69,4 +102,16 @@ export type DialogFooterProps = DialogSlotProps & {
|
|
|
69
102
|
/** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
|
|
70
103
|
mobileLayout?: "inline" | "stacked";
|
|
71
104
|
};
|
|
105
|
+
export type DialogStepsProps = {
|
|
106
|
+
/** The step on screen. A new value brings its content in. */
|
|
107
|
+
step: string | number;
|
|
108
|
+
/**
|
|
109
|
+
* `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to
|
|
110
|
+
* a step before it.
|
|
111
|
+
* @default "forward"
|
|
112
|
+
*/
|
|
113
|
+
direction?: "forward" | "back";
|
|
114
|
+
children: ReactNode;
|
|
115
|
+
className?: string;
|
|
116
|
+
};
|
|
72
117
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const STEP_TIMING: {
|
|
2
|
+
enterDuration: number;
|
|
3
|
+
exitDuration: number;
|
|
4
|
+
};
|
|
5
|
+
type TransitionElement = HTMLElement | SVGElement;
|
|
6
|
+
export declare const enterStep: (element: TransitionElement) => void;
|
|
7
|
+
export declare const leaveStep: (element: TransitionElement) => void;
|
|
8
|
+
export declare const settleStepHeight: (element: TransitionElement) => void;
|
|
9
|
+
export declare const releaseStepHeight: (element: TransitionElement) => void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const watchDialogViewport: (content: HTMLElement, container: HTMLElement | null) => (() => void);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dialog, type DialogBarBackground, type
|
|
1
|
+
export { Dialog, type DialogBarBackground, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogInteractOutsideEvent, type DialogLayerProps, type DialogPlacement, type DialogProps, type DialogStepsProps, } from "./Dialog.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type FocusEventHandler } from "react";
|
|
2
|
+
export type IndexBarProps = {
|
|
3
|
+
/** The `id` of the index bar. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The titles of the sections, in order: usually letters, such as `"A"` to `"Z"` and `"#"`. */
|
|
6
|
+
items: string[];
|
|
7
|
+
/** Called with the title and the index of the section to show: on a press, on each new letter while dragging, and from the keys. */
|
|
8
|
+
onSelect?: (item: string, index: number) => void;
|
|
9
|
+
/** Accessible name of the index bar. @default "Section index" */
|
|
10
|
+
"aria-label"?: string;
|
|
11
|
+
/** The `id` of the list the index scrolls. */
|
|
12
|
+
"aria-controls"?: string;
|
|
13
|
+
/** Event handler called when the index bar gains focus. */
|
|
14
|
+
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
15
|
+
/** Event handler called when the index bar loses focus. */
|
|
16
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
17
|
+
/** CSS classes applied to the index bar */
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* What the bar shows: the index of each title, or `null` for a dot. Every title shows while they fit in `capacity`
|
|
22
|
+
* lines, or while `capacity` is not known (`undefined`). Otherwise the first and the last title keep their places
|
|
23
|
+
* and titles spread evenly between them, a dot in each line between two, as UIKit's index shortens itself on a
|
|
24
|
+
* short screen; two lines hold the first and the last title, one the first, none nothing.
|
|
25
|
+
*/
|
|
26
|
+
export declare const indexBarSlots: (count: number, capacity?: number) => Array<number | null>;
|
|
27
|
+
/**
|
|
28
|
+
* The section index of a phone list, as the iOS section index: a column of letters at the trailing edge of the
|
|
29
|
+
* nearest positioned container (a Page), centred between the bars of the Page. A press shows the section of the letter under the
|
|
30
|
+
* finger, and a drag moves through the sections letter by letter. On a short screen every other letter gives
|
|
31
|
+
* way to a dot. It is one slider for assistive technology: Down and Up (or Right and Left) move one section, Home
|
|
32
|
+
* and End go to the first and the last, and Enter or Space shows the current one again. A desktop list has no
|
|
33
|
+
* index, so the bar renders under 768px only.
|
|
34
|
+
*/
|
|
35
|
+
export declare function IndexBar({ id, items, onSelect, "aria-label": ariaLabel, "aria-controls": ariaControls, onFocus, onBlur, className, }: IndexBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IndexBar, indexBarSlots, type IndexBarProps } from "./IndexBar.js";
|
|
@@ -136,8 +136,8 @@ export type MenuContentProps = {
|
|
|
136
136
|
*/
|
|
137
137
|
alignOffset?: DropdownMenu.DropdownMenuContentProps["alignOffset"];
|
|
138
138
|
/**
|
|
139
|
-
* Defines the `width` property of the content
|
|
140
|
-
*
|
|
139
|
+
* Defines the `width` property of the content. Without it the menu fits its content, or with `touch.css` on a phone
|
|
140
|
+
* is the 250px panel of an iOS menu; `"auto"` fits its content there too.
|
|
141
141
|
*/
|
|
142
142
|
width?: number | "auto";
|
|
143
143
|
/**
|
|
@@ -192,6 +192,10 @@ type SubContentProps = {
|
|
|
192
192
|
children: ReactNode;
|
|
193
193
|
sideOffset?: DropdownMenu.DropdownMenuSubContentProps["sideOffset"];
|
|
194
194
|
alignOffset?: DropdownMenu.DropdownMenuSubContentProps["alignOffset"];
|
|
195
|
+
/**
|
|
196
|
+
* The width of the submenu. Without it the submenu fits its content, or with `touch.css` on a phone is the 250px of a
|
|
197
|
+
* menu; `"auto"` fits its content there too.
|
|
198
|
+
*/
|
|
195
199
|
width?: number | "auto";
|
|
196
200
|
minWidth?: number | "auto";
|
|
197
201
|
maxHeight?: number;
|
|
@@ -30,7 +30,7 @@ export type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
32
|
divider?: boolean;
|
|
33
|
-
/** How the bar meets the content scrolled under it on a phone. @default "
|
|
33
|
+
/** How the bar meets the content scrolled under it on a phone. @default "glass" */
|
|
34
34
|
background?: PageBarBackground;
|
|
35
35
|
ref?: Ref<HTMLDivElement>;
|
|
36
36
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
export type PhoneLayoutValue = {
|
|
3
|
+
/** Where dialogs inside the layout portal to: the PhoneLayout box, or null for the document body. */
|
|
4
|
+
container: HTMLElement | null;
|
|
5
|
+
};
|
|
6
|
+
/** Non-null inside a PhoneLayout or a Dialog with `layout="phone"`. */
|
|
7
|
+
export declare const PhoneLayoutContext: import("react").Context<PhoneLayoutValue | null>;
|
|
8
|
+
export type PhoneLayoutProps = ComponentProps<"div">;
|
|
9
|
+
/**
|
|
10
|
+
* Lays out what it holds as on a phone at any window width, such as a phone frame on a desktop page: components take
|
|
11
|
+
* their phone presentation inside it, and a Dialog opened inside it covers the box instead of the window.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PhoneLayout: ({ className, children, ref, ...rest }: PhoneLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Whether components here are laid out as on a phone: inside a PhoneLayout (or a Dialog with `layout="phone"`), or
|
|
16
|
+
* in a window 767px wide or narrower. The server answers false outside a PhoneLayout.
|
|
17
|
+
*/
|
|
18
|
+
export declare const usePhoneLayout: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PhoneLayout, PhoneLayoutContext, usePhoneLayout, type PhoneLayoutProps, type PhoneLayoutValue } from "./PhoneLayout.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode, type SVGProps } from "react";
|
|
2
|
+
export type SwipeActionColor = "primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning";
|
|
3
|
+
export type SwipeAction = {
|
|
4
|
+
/** Unique ID of the action within its side */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Name of the action: shown with `labelPlacement` `"inside"` or `"below"` (and on an action without an icon), and its accessible name always */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Icon of the action */
|
|
9
|
+
Icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
10
|
+
/** Solid color of the action. @default "secondary" */
|
|
11
|
+
color?: SwipeActionColor;
|
|
12
|
+
/** Called when the action is pressed, or by a full swipe when it is the first action of its side */
|
|
13
|
+
onSelect?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export type SwipeActionsSide = "leading" | "trailing";
|
|
16
|
+
export type SwipeActionsProps = {
|
|
17
|
+
/** Actions revealed by a swipe toward the trailing edge, the first one at the leading edge */
|
|
18
|
+
leading?: SwipeAction[];
|
|
19
|
+
/** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */
|
|
20
|
+
trailing?: SwipeAction[];
|
|
21
|
+
/** Where the actions show their labels: `"hidden"` (symbols only), `"inside"` the capsule, or `"below"` it (for rows of 68px and taller). @default "hidden" */
|
|
22
|
+
labelPlacement?: "hidden" | "inside" | "below";
|
|
23
|
+
/** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */
|
|
24
|
+
fullSwipe?: boolean;
|
|
25
|
+
/** CSS classes applied to the row */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** The content of the row */
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and
|
|
32
|
+
* whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger
|
|
33
|
+
* where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and
|
|
34
|
+
* the far edge of the row the swipe is full.
|
|
35
|
+
*/
|
|
36
|
+
export declare const swipeActionsOffset: (raw: number, widths: Record<SwipeActionsSide, number>, rowWidth: number, fullSwipe: boolean) => {
|
|
37
|
+
offset: number;
|
|
38
|
+
full: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the
|
|
42
|
+
* trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of
|
|
43
|
+
* that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and
|
|
44
|
+
* the focus on one shows its side.
|
|
45
|
+
*/
|
|
46
|
+
export declare function SwipeActions({ leading, trailing, labelPlacement, fullSwipe, className, children, }: SwipeActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwipeActions, swipeActionsOffset, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide } from "./SwipeActions.js";
|