@plexui/vue 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/es/components/ButtonGroup/ButtonGroup.js +7 -0
  2. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  3. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  4. package/dist/es/components/ContextMenu/shared.js +3 -2
  5. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  6. package/dist/es/components/Dialog/Dialog.js +135 -18
  7. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  8. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  9. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  10. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  11. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  12. package/dist/es/components/Dialog/index.js +1 -1
  13. package/dist/es/components/Dialog/index.js.map +1 -1
  14. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  15. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  16. package/dist/es/components/IndexBar/IndexBar.js +215 -0
  17. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  18. package/dist/es/components/IndexBar/index.js +2 -0
  19. package/dist/es/components/IndexBar/index.js.map +1 -0
  20. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +149 -1
  21. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  22. package/dist/es/components/Menu/Menu.js +10 -6
  23. package/dist/es/components/Menu/Menu.js.map +1 -1
  24. package/dist/es/components/Page/Page.js +2 -2
  25. package/dist/es/components/Page/Page.js.map +1 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js +50 -0
  27. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  28. package/dist/es/components/PhoneLayout/index.js +2 -0
  29. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  30. package/dist/es/components/Popover/Popover.js +1 -1
  31. package/dist/es/components/Popover/Popover.js.map +1 -1
  32. package/dist/es/components/Popover/deferredPointerDownOutside.js +59 -4
  33. package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
  34. package/dist/es/components/Select/Select.js +2 -2
  35. package/dist/es/components/Select/Select.js.map +1 -1
  36. package/dist/es/components/Slider/Slider.js +34 -3
  37. package/dist/es/components/Slider/Slider.js.map +1 -1
  38. package/dist/es/components/SwipeActions/SwipeActions.js +374 -0
  39. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  40. package/dist/es/components/SwipeActions/index.js +2 -0
  41. package/dist/es/components/SwipeActions/index.js.map +1 -0
  42. package/dist/es/components/Switch/Switch.js +3 -1
  43. package/dist/es/components/Switch/Switch.js.map +1 -1
  44. package/dist/es/components/TabBar/TabBar.js +23 -8
  45. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  46. package/dist/es/components/TabBar/index.js.map +1 -1
  47. package/dist/es/components/Tabs/Tabs.js +1 -0
  48. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  49. package/dist/es/components/TagInput/TagInput.js +3 -46
  50. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  51. package/dist/es/components/Textarea/Textarea.js +1 -0
  52. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  53. package/dist/es/components/Tip/Tip.js +276 -0
  54. package/dist/es/components/Tip/Tip.js.map +1 -0
  55. package/dist/es/components/Tip/index.js +2 -0
  56. package/dist/es/components/Tip/index.js.map +1 -0
  57. package/dist/es/components/Toast/ToastRenderer.js +30 -13
  58. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  59. package/dist/es/components/Toast/Toaster.js +17 -6
  60. package/dist/es/components/Toast/Toaster.js.map +1 -1
  61. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  62. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  63. package/dist/es/components/Toolbar/Toolbar.js +3 -3
  64. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  65. package/dist/es/composables/useEscCloseStack.js +8 -4
  66. package/dist/es/composables/useEscCloseStack.js.map +1 -1
  67. package/dist/es/lib/floatingBoundary.js +3 -1
  68. package/dist/es/lib/floatingBoundary.js.map +1 -1
  69. package/dist/es/lib/helpers.js +21 -0
  70. package/dist/es/lib/helpers.js.map +1 -1
  71. package/dist/es/lib/phoneLayout.js +16 -0
  72. package/dist/es/lib/phoneLayout.js.map +1 -0
  73. package/dist/es/lib/toastRegion.js +6 -0
  74. package/dist/es/lib/toastRegion.js.map +1 -0
  75. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +13 -0
  76. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  77. package/dist/types/components/ContextMenu/shared.d.ts +3 -2
  78. package/dist/types/components/Dialog/Dialog.d.ts +93 -3
  79. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  80. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  81. package/dist/types/components/Dialog/index.d.ts +1 -1
  82. package/dist/types/components/IndexBar/IndexBar.d.ts +112 -0
  83. package/dist/types/components/IndexBar/index.d.ts +1 -0
  84. package/dist/types/components/Menu/Menu.d.ts +14 -15
  85. package/dist/types/components/Page/Page.d.ts +2 -2
  86. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +21 -0
  87. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  88. package/dist/types/components/Popover/deferredPointerDownOutside.d.ts +1 -1
  89. package/dist/types/components/SwipeActions/SwipeActions.d.ts +135 -0
  90. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  91. package/dist/types/components/TabBar/TabBar.d.ts +55 -6
  92. package/dist/types/components/TabBar/index.d.ts +1 -1
  93. package/dist/types/components/Tip/Tip.d.ts +146 -0
  94. package/dist/types/components/Tip/index.d.ts +1 -0
  95. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  96. package/dist/types/components/Toolbar/Toolbar.d.ts +9 -7
  97. package/dist/types/composables/useEscCloseStack.d.ts +2 -2
  98. package/dist/types/lib/helpers.d.ts +6 -0
  99. package/dist/types/lib/phoneLayout.d.ts +11 -0
  100. package/dist/types/lib/toastRegion.d.ts +5 -0
  101. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,QAAQ,IAAI,aAAa,EACzB,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,WAAW,EACX,OAAO,EACP,GAAG,EACH,KAAK,EAQL,OAAO,GACR,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,IAAI,qBAAqB,EAC1C,aAAa,IAAI,iBAAiB,EAClC,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,eAAe,EAC9B,UAAU,IAAI,cAAc,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AAC7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,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CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IAC9J,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE;QACrB,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAA;QAC7C,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE;YAC/B,IAAI,CAAC,KAAK,CAAC,gBAAgB;gBAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC9D,CAAC,CAAA;QACD,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;IACjG,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n Fragment as FragmentVNode,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n provide,\n ref,\n watch,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n type VNodeArrayChildren,\n isVNode,\n} from \"vue\"\nimport {\n DialogContent as RekaDialogContent,\n DialogDescription as RekaDialogDescription,\n DialogOverlay as RekaDialogOverlay,\n DialogPortal as RekaDialogPortal,\n DialogRoot as RekaDialogRoot,\n DialogTitle as RekaDialogTitle,\n FocusScope as RekaFocusScope,\n injectDialogRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { dismissableSurfaces, useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { firstElementChild } from \"../Tooltip/slot.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { attachSheetDrag } from \"./sheetDrag.js\"\nimport { overlayTiming, overlayTimingLarge } from \"../Transition/shared.js\"\nimport { provideFloatingBoundaryScope, useFloatingBoundaryRegistration } from \"../../composables/useFloatingBoundary.js\"\nimport { NavigationButton } from \"../Button/NavigationButton.js\"\nimport { TOOLBAR_HOST, Toolbar, ToolbarLeading, ToolbarTrailing, type BarBackground } from \"../Toolbar/Toolbar.js\"\nimport { observeScrollEdges } from \"../../lib/scrollEdges.js\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nconst DOUBLE_CLICK = 300\n\n/** Where content lies under the bars: DialogBody reports it, the bars show their lines with it. */\ntype DialogScroll = { scrolled: Ref<boolean>; contentBelow: Ref<boolean> }\nconst DIALOG_SCROLL: InjectionKey<DialogScroll> = Symbol(\"DialogScroll\")\n// What the header of a Sheet needs from its content to become the Sheet's bar on a phone\ntype DialogSheet = { showClose: boolean }\nconst DIALOG_SHEET: InjectionKey<ComputedRef<DialogSheet | null>> = Symbol(\"DialogSheet\")\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DIALOG_BAR: InjectionKey<ComputedRef<boolean>> = Symbol(\"DialogBar\")\n\n// The phone layout of the Dialog style sheet (its rules for the Sheet's bar use the same query). A dialog's content\n// mounts on the client only (its portal waits for the document), so it reads the layout as it mounts, with nothing to\n// swap after it.\nconst PHONE_LAYOUT = \"(width <= 767px)\"\nconst phoneLayout = () => (typeof window !== \"undefined\" && typeof window.matchMedia === \"function\" ? window.matchMedia(PHONE_LAYOUT) : null)\nconst usePhoneLayout = (): Ref<boolean> => {\n const query = phoneLayout()\n const phone = ref(query?.matches ?? false)\n const update = () => { phone.value = !!query?.matches }\n if (!query) return phone\n // Safari before 14 has only the older listener methods\n if (typeof query.addEventListener !== \"function\") {\n query.addListener(update)\n onBeforeUnmount(() => query.removeListener(update))\n } else {\n query.addEventListener(\"change\", update)\n onBeforeUnmount(() => query.removeEventListener(\"change\", update))\n }\n return phone\n}\n\n// Vue port of packages/ui/src/components/Dialog/Dialog.tsx on Reka UI\n// (the Vue lineage of Radix, same anatomy). Exports are flat (`Dialog`,\n// `DialogTrigger`, ...) because runtime-compiled templates cannot resolve\n// `Dialog.Trigger` from the `components` option.\n//\n// Where Reka differs from Radix (radix-ui 1.8), the port follows Radix:\n// - The content is labelled and described only while a DialogTitle /\n// DialogDescription is mounted.\n// - A press outside (the overlay) closes it on the click that follows\n// (../Popover/deferredPointerDownOutside.ts); the overlay is a dismiss\n// surface.\n// - The portal renders once mounted, so a closed dialog server-renders\n// nothing.\n\ntype DialogContextValue = {\n open: ComputedRef<boolean>\n setOpen: (nextState: boolean) => void\n /** Mounted DialogTitle / DialogDescription parts (Radix's title and description counts) */\n titleCount: Ref<number>\n descriptionCount: Ref<number>\n /** Retain the native modal owner until its animated subtree actually unmounts. */\n mountedSurfaces: Ref<number>\n}\n\nconst DialogContextKey: InjectionKey<DialogContextValue> = Symbol(\"PlexUIDialog\")\n\nconst useDialogContext = () => {\n const context = inject(DialogContextKey, null)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\n/** Modal dialog root. Uncontrolled by default; bind `v-model:open` to control it. */\nexport const Dialog = defineComponent({\n name: \"Dialog\",\n props: {\n open: { type: Boolean, default: undefined },\n },\n emits: {\n \"update:open\": (open: boolean) => typeof open === \"boolean\",\n },\n setup(props, { slots, emit }) {\n const internalOpen = ref(false)\n const isOpen = computed(() => props.open ?? internalOpen.value)\n const mountedSurfaces = ref(0)\n const nativeOpen = computed(() => isOpen.value || mountedSurfaces.value > 0)\n\n const setOpen = (nextState: boolean) => {\n emit(\"update:open\", nextState)\n internalOpen.value = nextState\n }\n\n provide(DialogContextKey, { open: isOpen, setOpen, titleCount: ref(0), descriptionCount: ref(0), mountedSurfaces })\n\n return () =>\n h(RekaDialogRoot, { \"open\": nativeOpen.value, \"onUpdate:open\": setOpen }, { default: () => slots.default?.() })\n },\n})\n\n// Trigger and Close render their child with the dialog wiring merged in,\n// like Reka's `asChild` parts, but run the dialog action after the child's\n// own click handlers and skip it when one called preventDefault() (Radix's\n// composeEventHandlers). Reka's parts run first and cannot be cancelled.\n// Attributes the child sets itself win, as with Radix and Reka slots. The\n// child is the first element, also through a forwarded `<slot />`.\nconst withDialogProps = (\n child: VNode | undefined,\n props: Record<string, unknown>,\n onClick: (event: Event) => void,\n ref?: (el: unknown) => void,\n) => {\n if (!child) return null\n const own = child.props ?? {}\n const extra = Object.fromEntries(Object.entries(props).filter(([key]) => !(key in own)))\n return cloneVNode(child, { ...extra, onClick, ...(ref ? { ref } : {}) }, true)\n}\n\nexport const DialogTrigger = defineComponent({\n name: \"DialogTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const { open, setOpen } = useDialogContext()\n const { forwardRef, currentElement } = useForwardExpose()\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n // Focus returns here when the dialog closes\n onMounted(() => {\n rootContext.triggerElement.value = currentElement.value\n })\n\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) setOpen(!open.value)\n }\n\n return () => {\n const isOpen = open.value\n return withDialogProps(\n firstElementChild(slots.default?.()),\n {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen || false,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n },\n onClick,\n forwardRef as (el: unknown) => void,\n )\n }\n },\n})\n\n// Reka 2.11's force-mounted Dialog releases hideOthers when its `present`\n// becomes false, then calls the same non-idempotent cleanup again on unmount.\n// Keep its public Root open until this transition-owned subtree unmounts.\n// The logical open state still drives Plex triggers, events and exit rendering.\nconst DialogSurface = defineComponent({\n name: \"DialogSurface\",\n setup(_props, { slots }) {\n const { mountedSurfaces } = useDialogContext()\n onMounted(() => { mountedSurfaces.value++ })\n // Descendant Reka cleanup runs first; never send it present=false while alive.\n onUnmounted(() => { mountedSurfaces.value-- })\n return () => h(\"div\", slots.default?.())\n },\n})\n\n/** Overlay and panel. `class` lands on the panel, like `className` in React. */\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\nexport const DialogContent = defineComponent({\n name: \"DialogContent\",\n inheritAttrs: false,\n props: {\n /** Panel width; numbers are pixels. @default 480 */\n width: { type: [Number, String] as PropType<number | string>, default: 480 },\n /** Renders the close button in the top corner. @default true */\n showClose: { type: Boolean, default: true },\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill: { type: Boolean, default: false },\n /**\n * Where the panel sits: centered, near the top, a sheet along the bottom,\n * a full-height panel on the start or end side, or the whole screen.\n * @default \"center\"\n */\n placement: { type: String as PropType<DialogPlacement>, default: \"center\" },\n /** Placement at 767px and below, such as a bottom sheet on phones. @default placement */\n mobilePlacement: String as PropType<Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">>,\n /** Mobile presentation at 767px and below. Sheets default to bottom placement. */\n mobileVariant: String as PropType<\"alert\" | \"sheet\">,\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface: { type: String as PropType<\"plain\" | \"grouped\">, default: \"plain\" },\n /** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */\n onOpenAutoFocus: Function as PropType<(event: Event) => void>,\n /** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */\n onCloseAutoFocus: Function as PropType<(event: Event) => void>,\n },\n setup(props, { slots, attrs }) {\n const { open, setOpen, titleCount, descriptionCount } = useDialogContext()\n const scroll: DialogScroll = { scrolled: ref(false), contentBelow: ref(false) }\n provide(DIALOG_SCROLL, scroll)\n provide(TOOLBAR_HOST, { kind: \"dialog\", scrolled: scroll.scrolled, contentBelow: scroll.contentBelow })\n provide(DIALOG_SHEET, computed(() => (props.mobileVariant === \"sheet\" ? { showClose: props.showClose } : null)))\n // A dialog opened from a header action is not inside that header's bar\n provide(DIALOG_BAR, computed(() => false))\n const mobilePlacement = computed(() =>\n props.mobileVariant === \"alert\"\n ? \"center\"\n : props.mobilePlacement ?? (props.mobileVariant === \"sheet\" ? \"bottom\" : undefined),\n )\n const rootContext = injectDialogRootContext()\n // Radix's root makes the content id; Reka's trigger does, so a dialog\n // without one would render `id=\"\"`\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n\n const handleCloseAutoFocus = (rekaEvent: Event) => {\n // Reka announces unmount before descendant scopes release their traps.\n // Match Radix (and our Menu adapter): dispatch the cancellable callback\n // on the detached content, so custom focus restoration is not trapped.\n rekaEvent.preventDefault()\n const container = rekaEvent.target instanceof HTMLElement ? rekaEvent.target : rootContext.contentElement.value\n const trigger = rootContext.triggerElement.value\n setTimeout(() => {\n const event = new CustomEvent(rekaEvent.type, { bubbles: false, cancelable: true })\n const restoreFocus = (closeEvent: Event) => {\n props.onCloseAutoFocus?.(closeEvent)\n keepMovedFocus(closeEvent)\n if (!closeEvent.defaultPrevented) trigger?.focus()\n }\n if (!container) return restoreFocus(event)\n container.addEventListener(event.type, restoreFocus)\n container.dispatchEvent(event)\n container.removeEventListener(event.type, restoreFocus)\n }, 0)\n }\n\n // Escape goes through the shared stack, as in React, so the dialog\n // closes before overlays opened earlier (a forced-open Tooltip)\n useEscCloseStack(open, () => {\n setOpen(false)\n })\n\n // The second click of a double click lands on the overlay: it must not undo the first\n let openedAt = 0\n\n // Radix's modal content: a Ctrl+click (macOS right click) does not dismiss\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n if (!originalEvent.ctrlKey && performance.now() - openedAt >= DOUBLE_CLICK) setOpen(false)\n })\n const handlePointerDownOutside = (event: Parameters<typeof outsidePress.onPointerDownOutside>[0]) => {\n // The native modal owner outlives logical open. An exiting layer must not\n // start a deferred dismissal that closes a trigger-driven reopen.\n if (!open.value) event.preventDefault()\n else outsidePress.onPointerDownOutside(event)\n }\n const handleInteractOutside = (event: Event) => {\n if (!open.value) event.preventDefault()\n }\n watch(\n open,\n (isOpen) => {\n if (isOpen) openedAt = performance.now()\n else outsidePress.reset()\n },\n { immediate: true },\n )\n\n const boundary = provideFloatingBoundaryScope()\n let panelElement: HTMLElement | undefined\n let detachDrag: (() => void) | undefined\n let barObserver: ResizeObserver | undefined\n let barChildren: MutationObserver | undefined\n const setPanelRef = (instance: unknown) => {\n const element = instance instanceof HTMLElement ? instance : undefined\n if (element === panelElement) return\n detachDrag?.()\n barObserver?.disconnect()\n barChildren?.disconnect()\n detachDrag = undefined\n panelElement = element\n boundary.setRoot(element)\n if (element) {\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side.\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 = element.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? element.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? element.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = element.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? element.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n element.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? 0}px`)\n element.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? 0}px`)\n }\n barObserver = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n barObserver?.disconnect()\n element.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => barObserver?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n barChildren = new MutationObserver(observeBars)\n barChildren.observe(element, { childList: true })\n }\n if (element && mobilePlacement.value === \"bottom\") {\n detachDrag = attachSheetDrag(element, () => setOpen(false))\n }\n }\n\n watch(mobilePlacement, () => {\n detachDrag?.()\n detachDrag = panelElement && mobilePlacement.value === \"bottom\"\n ? attachSheetDrag(panelElement, () => setOpen(false))\n : undefined\n })\n onBeforeUnmount(() => { detachDrag?.(); barObserver?.disconnect(); barChildren?.disconnect() })\n\n let overlayElement: Element | undefined\n const setOverlayRef = (instance: unknown) => {\n const el = (instance as { $el?: unknown } | null)?.$el\n const element = el instanceof Element ? el : undefined\n if (element === overlayElement) return\n if (overlayElement) dismissableSurfaces.delete(overlayElement)\n overlayElement = element\n if (element) dismissableSurfaces.add(element)\n }\n\n const renderDialog = () =>\n h(DialogSurface, { key: \"dialog\" }, () => [\n h(RekaDialogOverlay, { class: s.Overlay, forceMount: true, ref: setOverlayRef, \"data-state\": open.value ? \"open\" : \"closed\" }),\n h(\n RekaDialogContent,\n {\n \"forceMount\": true,\n \"class\": s.Content,\n \"data-plex-dialog\": \"\",\n \"style\": toCssVariables({ \"dialog-width\": props.width }),\n \"data-placement\": props.placement === \"center\" ? undefined : props.placement,\n \"data-mobile-placement\": mobilePlacement.value,\n \"data-mobile-variant\": props.mobileVariant,\n \"data-surface\": props.surface,\n \"data-state\": open.value ? \"open\" : \"closed\",\n \"data-pill\": props.pill ? \"\" : undefined,\n \"onOpenAutoFocus\": props.onOpenAutoFocus,\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n // Radix labels and describes the content only by mounted parts\n ...(titleCount.value > 0 ? {} : { \"aria-labelledby\": undefined }),\n ...(descriptionCount.value > 0 ? {} : { \"aria-describedby\": undefined }),\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onPointerDownOutside\": handlePointerDownOutside,\n \"onFocusOutside\": outsidePress.onFocusOutside,\n \"onInteractOutside\": handleInteractOutside,\n },\n {\n default: () => [\n // The native Content is the sole focus owner while open, so it\n // keeps tracking replacement inputs. Activate this non-trapping\n // scope only during logical exit to pause the retained modal owner.\n // A second live trap would leave the paused native scope tracking\n // removed inputs; its mutation fallback could then select current text.\n h(RekaFocusScope, {\n asChild: true,\n present: !open.value,\n loop: false,\n trapped: false,\n onMountAutoFocus: preventDefaultHandler,\n onUnmountAutoFocus: preventDefaultHandler,\n }, () => h(\"div\", { class: [s.Panel, attrs.class], ref: setPanelRef }, [\n props.showClose\n ? h(DialogClose, null, {\n default: () => [\n h(NavigationButton, { \"action\": \"close\", \"variant\": \"ghost\", \"class\": s.CloseButton, \"aria-label\": \"Close dialog\" }),\n ],\n })\n : null,\n slots.default?.(),\n ])),\n ],\n },\n ),\n ])\n\n return () => {\n const { placement } = props\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || mobilePlacement.value === \"bottom\" || mobilePlacement.value === \"fullscreen\"\n return h(RekaDialogPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n // A dialog mounted open enters too, as `v-if` and `open` together do\n {\n class: s.Transition,\n ...(crossesScreen ? overlayTimingLarge : overlayTiming),\n overlay: true,\n preventInitialTransition: false,\n },\n // `open && <div>` in React: closed still renders the empty wrapper\n { default: () => [open.value ? renderDialog() : createCommentVNode()] },\n ),\n ],\n })\n }\n },\n})\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar\nconst headerParts = (children: VNodeArrayChildren | undefined): VNodeArrayChildren =>\n (children ?? []).flatMap((part) =>\n isVNode(part) && part.type === FragmentVNode ? headerParts(part.children as VNodeArrayChildren) : Array.isArray(part) ? headerParts(part) : [part])\nconst isHeaderAction = (part: unknown) => isVNode(part) && part.type === DialogHeaderAction\n\nexport const DialogHeader = defineComponent({\n name: \"DialogHeader\",\n props: {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background: { type: String as PropType<DialogBarBackground>, default: \"soft\" },\n },\n setup(props, { slots }) {\n const scroll = inject(DIALOG_SCROLL, null)\n const sheet = inject(DIALOG_SHEET, null)\n const phone = usePhoneLayout()\n const bar = computed(() => !!sheet?.value && phone.value)\n provide(DIALOG_BAR, bar)\n return () => {\n if (!bar.value) return h(\"div\", { class: s.Header, \"data-background\": props.background, \"data-scrolled\": scroll?.scrolled.value ? \"\" : undefined }, slots.default?.())\n const parts = headerParts(slots.default?.())\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 centered on the row of controls, the header actions at the\n // trailing edge, all on one 44px row under the grabber.\n return h(Toolbar, { \"background\": props.background, \"data-dialog-bar\": \"\" }, () => [\n sheet?.value?.showClose\n ? h(ToolbarLeading, { class: s.BarClose }, () => [\n h(DialogClose, null, { default: () => [h(NavigationButton, { \"action\": \"close\", \"variant\": \"ghost\", \"aria-label\": \"Close dialog\" })] }),\n ])\n : null,\n h(\"div\", { class: [t.Heading, s.BarHeading] }, parts.filter((part) => !isHeaderAction(part))),\n ...parts.filter(isHeaderAction),\n ])\n }\n },\n})\n\nexport const DialogHeaderAction = defineComponent({\n name: \"DialogHeaderAction\",\n setup(_props, { slots }) {\n const bar = inject(DIALOG_BAR, null)\n return () => (bar?.value ? h(ToolbarTrailing, null, () => slots.default?.()) : h(\"div\", { class: s.HeaderAction }, slots.default?.()))\n },\n})\n\n/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */\nexport const DialogBody = defineComponent({\n name: \"DialogBody\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const scroll = inject(DIALOG_SCROLL, null)\n const element = ref<HTMLElement | null>(null)\n let stop: (() => void) | undefined\n onMounted(() => {\n if (!element.value || !scroll) return\n stop = observeScrollEdges(element.value, (edges) => {\n scroll.scrolled.value = edges.scrolled\n scroll.contentBelow.value = edges.contentBelow\n })\n })\n onBeforeUnmount(() => {\n stop?.()\n if (scroll) { scroll.scrolled.value = false; scroll.contentBelow.value = false }\n })\n return () => h(\"div\", { ref: element, class: [s.Body, attrs.class] }, slots.default?.())\n },\n})\n\nexport const DialogFooter = defineComponent({\n name: \"DialogFooter\",\n props: {\n /** Override the mobile action layout. Alerts default to inline; sheets to stacked. */\n mobileLayout: String as PropType<\"inline\" | \"stacked\">,\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background: { type: String as PropType<DialogBarBackground>, default: \"soft\" },\n },\n setup(props, { slots }) {\n const boundary = useFloatingBoundaryRegistration()\n const scroll = inject(DIALOG_SCROLL, null)\n return () => h(\"div\", {\n \"ref\": boundary?.setFooter,\n \"class\": s.Footer,\n \"data-mobile-layout\": props.mobileLayout,\n \"data-background\": props.background,\n \"data-content-below\": scroll?.contentBelow.value ? \"\" : undefined,\n }, slots.default?.())\n },\n})\n\n/** Counts a mounted part, as Radix's title and description counts do. */\nconst useMountedCount = (count: Ref<number>) => {\n onMounted(() => {\n count.value++\n })\n onBeforeUnmount(() => {\n count.value--\n })\n}\n\nexport const DialogTitle = defineComponent({\n name: \"DialogTitle\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().titleCount)\n const bar = inject(DIALOG_BAR, null)\n return () => h(RekaDialogTitle, { class: bar?.value ? t.Title : s.Title }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogDescription = defineComponent({\n name: \"DialogDescription\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().descriptionCount)\n const bar = inject(DIALOG_BAR, null)\n const element = ref<{ $el?: Element } | Element | null>(null)\n const shown = ref(false)\n // In the bar a description the reader sees is the title's second line (Toolbar's subtitle); one that is only\n // read out, visually hidden, leaves the title on its one line.\n const measure = () => {\n const node = element.value instanceof Element ? element.value : element.value?.$el\n shown.value = !!bar?.value && node instanceof HTMLElement && node.offsetHeight > 1 && node.offsetWidth > 1\n }\n onMounted(measure)\n watch(() => bar?.value, () => queueMicrotask(measure))\n return () => h(RekaDialogDescription, { ref: element, class: bar?.value && shown.value ? t.Subtitle : s.Description }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogClose = defineComponent({\n name: \"DialogClose\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenChange(false)\n }\n return () => withDialogProps(firstElementChild(slots.default?.()), { type: \"button\" }, onClick)\n },\n})\n\nexport type DialogProps = InstanceType<typeof Dialog>[\"$props\"]\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/** DialogContent props; `class` lands on the panel, like `className` in React. */\nexport type DialogContentProps = InstanceType<typeof DialogContent>[\"$props\"] & { class?: HTMLAttributes[\"class\"] }\n\nexport type DialogHeaderProps = InstanceType<typeof DialogHeader>[\"$props\"]\nexport type DialogFooterProps = InstanceType<typeof DialogFooter>[\"$props\"]\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,QAAQ,IAAI,aAAa,EACzB,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,WAAW,EACX,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EASL,OAAO,GACR,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,IAAI,qBAAqB,EAC1C,aAAa,IAAI,iBAAiB,EAClC,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,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K,EAAE,EAAE,KAAK,EAAE;QACpB,OAAO,GAAG,EAAE;YACV,wEAAwE;YACxE,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;YACxG,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE;gBACvE,CAAC,CAAC,eAAe,EAAE;oBACjB,GAAG,WAAW;oBACd,EAAE,EAAE,KAAK;oBACT,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,CAAC,CAAC,IAAI;oBACb,OAAO,EAAE,SAAS;oBAClB,MAAM,EAAE,SAAS;oBACjB,YAAY,EAAE,gBAAgB;oBAC9B,cAAc,EAAE,iBAAiB;iBAClC,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;aAClB,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n Fragment as FragmentVNode,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n provide,\n ref,\n shallowRef,\n watch,\n type ComputedRef,\n type CSSProperties,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n type VNodeArrayChildren,\n isVNode,\n} from \"vue\"\nimport {\n DialogContent as RekaDialogContent,\n DialogDescription as RekaDialogDescription,\n DialogOverlay as RekaDialogOverlay,\n DialogPortal as RekaDialogPortal,\n DialogRoot as RekaDialogRoot,\n DialogTitle as RekaDialogTitle,\n FocusScope as RekaFocusScope,\n injectDialogRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { inToastRegion } from \"../../lib/toastRegion.js\"\nimport { cancelableKeyCopy, dataAttributes, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { dismissableSurfaces, useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { firstElementChild } from \"../Tooltip/slot.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { attachSheetDrag } from \"./sheetDrag.js\"\nimport { watchDialogViewport } from \"./dialogViewport.js\"\nimport { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING } from \"./dialogSteps.js\"\nimport { PHONE_LAYOUT as PHONE_LAYOUT_SCOPE, type PhoneLayoutValue } from \"../PhoneLayout/PhoneLayout.js\"\nimport { overlayTiming, overlayTimingLarge } from \"../Transition/shared.js\"\nimport { provideFloatingBoundaryScope, useFloatingBoundaryRegistration } from \"../../composables/useFloatingBoundary.js\"\nimport { NavigationButton } from \"../Button/NavigationButton.js\"\nimport { TOOLBAR_HOST, Toolbar, ToolbarLeading, ToolbarTrailing, type BarBackground } from \"../Toolbar/Toolbar.js\"\nimport { observeScrollEdges } from \"../../lib/scrollEdges.js\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nconst DOUBLE_CLICK = 300\n\n/** Where content lies under the bars: DialogBody reports it, the bars show their lines with it. */\ntype DialogScroll = { scrolled: Ref<boolean>; contentBelow: Ref<boolean> }\nconst DIALOG_SCROLL: InjectionKey<DialogScroll> = Symbol(\"DialogScroll\")\n// What the header of a Sheet needs from its content to become the Sheet's bar on a phone\ntype DialogSheet = { showClose: boolean }\nconst DIALOG_SHEET: InjectionKey<ComputedRef<DialogSheet | null>> = Symbol(\"DialogSheet\")\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DIALOG_BAR: InjectionKey<ComputedRef<boolean>> = Symbol(\"DialogBar\")\n\n// The phone layout of the Dialog style sheet (its rules for the Sheet's bar use the same query). A dialog's content\n// mounts on the client only (its portal waits for the document), so it reads the layout as it mounts, with nothing to\n// swap after it.\nconst PHONE_LAYOUT = \"(width <= 767px)\"\nconst phoneLayout = () => (typeof window !== \"undefined\" && typeof window.matchMedia === \"function\" ? window.matchMedia(PHONE_LAYOUT) : null)\nconst usePhoneLayout = (): Readonly<Ref<boolean>> => {\n // Inside a PhoneLayout, or a dialog with `layout=\"phone\"`, at any window width\n const scope = inject(PHONE_LAYOUT_SCOPE, null)\n const query = phoneLayout()\n const narrow = ref(query?.matches ?? false)\n const phone = computed(() => !!scope?.phone.value || narrow.value)\n const update = () => { narrow.value = !!query?.matches }\n if (!query) return phone\n // Safari before 14 has only the older listener methods\n if (typeof query.addEventListener !== \"function\") {\n query.addListener(update)\n onBeforeUnmount(() => query.removeListener(update))\n } else {\n query.addEventListener(\"change\", update)\n onBeforeUnmount(() => query.removeEventListener(\"change\", update))\n }\n return phone\n}\n\n// Vue port of packages/ui/src/components/Dialog/Dialog.tsx on Reka UI\n// (the Vue lineage of Radix, same anatomy). Exports are flat (`Dialog`,\n// `DialogTrigger`, ...) because runtime-compiled templates cannot resolve\n// `Dialog.Trigger` from the `components` option.\n//\n// Where Reka differs from Radix (radix-ui 1.8), the port follows Radix:\n// - The content is labelled and described only while a DialogTitle /\n// DialogDescription is mounted.\n// - A press outside (the overlay) closes it on the click that follows\n// (../Popover/deferredPointerDownOutside.ts); the overlay is a dismiss\n// surface.\n// - The portal renders once mounted, so a closed dialog server-renders\n// nothing.\n\ntype DialogContextValue = {\n open: ComputedRef<boolean>\n setOpen: (nextState: boolean) => void\n /** Mounted DialogTitle / DialogDescription parts (Radix's title and description counts) */\n titleCount: Ref<number>\n descriptionCount: Ref<number>\n /** Retain the native modal owner until its animated subtree actually unmounts. */\n mountedSurfaces: Ref<number>\n}\n\nconst DialogContextKey: InjectionKey<DialogContextValue> = Symbol(\"PlexUIDialog\")\n\nconst useDialogContext = () => {\n const context = inject(DialogContextKey, null)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\n/** Modal dialog root. Uncontrolled by default; bind `v-model:open` to control it. */\nexport const Dialog = defineComponent({\n name: \"Dialog\",\n props: {\n open: { type: Boolean, default: undefined },\n },\n emits: {\n \"update:open\": (open: boolean) => typeof open === \"boolean\",\n },\n setup(props, { slots, emit }) {\n const internalOpen = ref(false)\n const isOpen = computed(() => props.open ?? internalOpen.value)\n const mountedSurfaces = ref(0)\n const nativeOpen = computed(() => isOpen.value || mountedSurfaces.value > 0)\n\n const setOpen = (nextState: boolean) => {\n emit(\"update:open\", nextState)\n internalOpen.value = nextState\n }\n\n provide(DialogContextKey, { open: isOpen, setOpen, titleCount: ref(0), descriptionCount: ref(0), mountedSurfaces })\n\n return () =>\n h(RekaDialogRoot, { \"open\": nativeOpen.value, \"onUpdate:open\": setOpen }, { default: () => slots.default?.() })\n },\n})\n\n// Trigger and Close render their child with the dialog wiring merged in,\n// like Reka's `asChild` parts, but run the dialog action after the child's\n// own click handlers and skip it when one called preventDefault() (Radix's\n// composeEventHandlers). Reka's parts run first and cannot be cancelled.\n// Attributes the child sets itself win, as with Radix and Reka slots. The\n// child is the first element, also through a forwarded `<slot />`.\nconst withDialogProps = (\n child: VNode | undefined,\n props: Record<string, unknown>,\n onClick: (event: Event) => void,\n ref?: (el: unknown) => void,\n) => {\n if (!child) return null\n const own = child.props ?? {}\n const extra = Object.fromEntries(Object.entries(props).filter(([key]) => !(key in own)))\n return cloneVNode(child, { ...extra, onClick, ...(ref ? { ref } : {}) }, true)\n}\n\nexport const DialogTrigger = defineComponent({\n name: \"DialogTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const { open, setOpen } = useDialogContext()\n const { forwardRef, currentElement } = useForwardExpose()\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n // Focus returns here when the dialog closes\n onMounted(() => {\n rootContext.triggerElement.value = currentElement.value\n })\n\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) setOpen(!open.value)\n }\n\n return () => {\n const isOpen = open.value\n return withDialogProps(\n firstElementChild(slots.default?.()),\n {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen || false,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n },\n onClick,\n forwardRef as (el: unknown) => void,\n )\n }\n },\n})\n\n// Reka 2.11's force-mounted Dialog releases hideOthers when its `present`\n// becomes false, then calls the same non-idempotent cleanup again on unmount.\n// Keep its public Root open until this transition-owned subtree unmounts.\n// The logical open state still drives Plex triggers, events and exit rendering.\nconst DialogSurface = defineComponent({\n name: \"DialogSurface\",\n setup(_props, { slots }) {\n const { mountedSurfaces } = useDialogContext()\n onMounted(() => { mountedSurfaces.value++ })\n // Descendant Reka cleanup runs first; never send it present=false while alive.\n onUnmounted(() => { mountedSurfaces.value-- })\n return () => h(\"div\", slots.default?.())\n },\n})\n\n/** Overlay and panel. `class` lands on the panel, like `className` in React. */\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\nexport const DialogContent = defineComponent({\n name: \"DialogContent\",\n inheritAttrs: false,\n props: {\n /** Panel width; numbers are pixels. @default 480 */\n width: { type: [Number, String] as PropType<number | string>, default: 480 },\n /** Renders the close button in the top corner. @default true */\n showClose: { type: Boolean, default: true },\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill: { type: Boolean, default: false },\n /**\n * Where the panel sits: centered, near the top, a sheet along the bottom,\n * a full-height panel on the start or end side, or the whole screen.\n * @default \"center\"\n */\n placement: { type: String as PropType<DialogPlacement>, default: \"center\" },\n /** Placement at 767px and below, such as a bottom sheet on phones. @default placement */\n mobilePlacement: String as PropType<Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">>,\n /** Mobile presentation at 767px and below. Sheets default to bottom placement. */\n mobileVariant: String as PropType<\"alert\" | \"sheet\">,\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface: { type: String as PropType<\"plain\" | \"grouped\">, default: \"plain\" },\n /** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */\n onOpenAutoFocus: Function as PropType<(event: Event) => void>,\n /** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */\n onCloseAutoFocus: Function as PropType<(event: Event) => void>,\n /**\n * Called on Escape before the dialog closes; `event.preventDefault()` keeps it open, such as for a form with\n * unsaved changes.\n */\n onEscapeKeyDown: Function as PropType<(event: KeyboardEvent) => void>,\n /**\n * Called on a press or a focus outside the dialog before it closes; `event.preventDefault()` keeps it open, such\n * as for a press on a developer panel over the page.\n */\n onInteractOutside: Function as PropType<(event: DialogInteractOutsideEvent) => void>,\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 DialogContent land here too. */\n rootProps: Object as PropType<DialogLayerProps>,\n /** Class, style and data attributes for the overlay. */\n overlayProps: Object as PropType<DialogLayerProps>,\n /** `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is. @default \"auto\" */\n layout: { type: String as PropType<\"auto\" | \"phone\">, default: \"auto\" },\n },\n setup(props, { slots, attrs }) {\n const { open, setOpen, titleCount, descriptionCount } = useDialogContext()\n const outerPhoneLayout = inject(PHONE_LAYOUT_SCOPE, null)\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, for as long as the prop says so.\n const phoneLayout = computed(() => !!outerPhoneLayout?.phone.value || props.layout === \"phone\")\n const portalTarget = computed(() => outerPhoneLayout?.container.value ?? null)\n provide(PHONE_LAYOUT_SCOPE, { container: outerPhoneLayout?.container ?? shallowRef(null), phone: phoneLayout } satisfies PhoneLayoutValue)\n const scroll: DialogScroll = { scrolled: ref(false), contentBelow: ref(false) }\n provide(DIALOG_SCROLL, scroll)\n provide(TOOLBAR_HOST, { kind: \"dialog\", scrolled: scroll.scrolled, contentBelow: scroll.contentBelow })\n provide(DIALOG_SHEET, computed(() => (props.mobileVariant === \"sheet\" ? { showClose: props.showClose } : null)))\n // A dialog opened from a header action is not inside that header's bar\n provide(DIALOG_BAR, computed(() => false))\n const mobilePlacement = computed(() =>\n props.mobileVariant === \"alert\"\n ? \"center\"\n : props.mobilePlacement ?? (props.mobileVariant === \"sheet\" ? \"bottom\" : undefined),\n )\n const rootContext = injectDialogRootContext()\n // Radix's root makes the content id; Reka's trigger does, so a dialog\n // without one would render `id=\"\"`\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n // Reka replaces the root's content ref as it mounts, so the layer is found from the panel once it is in place\n const panelNode = shallowRef<HTMLElement | null>(null)\n let stopViewport: (() => void) | undefined\n watch(\n [panelNode, portalTarget],\n ([panel, box]) => {\n stopViewport?.()\n const content = panel?.closest<HTMLElement>(\"[data-plex-dialog]\")\n stopViewport = content ? watchDialogViewport(content, box) : undefined\n },\n { flush: \"post\", immediate: true },\n )\n onBeforeUnmount(() => stopViewport?.())\n\n const handleCloseAutoFocus = (rekaEvent: Event) => {\n // Reka announces unmount before descendant scopes release their traps.\n // Match Radix (and our Menu adapter): dispatch the cancellable callback\n // on the detached content, so custom focus restoration is not trapped.\n rekaEvent.preventDefault()\n const container = rekaEvent.target instanceof HTMLElement ? rekaEvent.target : rootContext.contentElement.value\n const trigger = rootContext.triggerElement.value\n setTimeout(() => {\n const event = new CustomEvent(rekaEvent.type, { bubbles: false, cancelable: true })\n const restoreFocus = (closeEvent: Event) => {\n props.onCloseAutoFocus?.(closeEvent)\n keepMovedFocus(closeEvent)\n if (!closeEvent.defaultPrevented) trigger?.focus()\n }\n if (!container) return restoreFocus(event)\n container.addEventListener(event.type, restoreFocus)\n container.dispatchEvent(event)\n container.removeEventListener(event.type, restoreFocus)\n }, 0)\n }\n\n // Escape goes through the shared stack, as in React, so the dialog\n // closes before overlays opened earlier (a forced-open Tooltip)\n useEscCloseStack(open, (event) => {\n if (props.onEscapeKeyDown) {\n const request = cancelableKeyCopy(event)\n props.onEscapeKeyDown(request)\n if (request.defaultPrevented) return\n }\n setOpen(false)\n })\n\n // The second click of a double click lands on the overlay: it must not undo the first\n let openedAt = 0\n\n // The owner's handler comes first; a prevented interaction keeps the dialog open\n const ownerKeepsOpen = (event: DialogInteractOutsideEvent) => {\n props.onInteractOutside?.(event)\n return event.defaultPrevented\n }\n // Radix's modal content: a Ctrl+click (macOS right click) does not dismiss. A deferred press asks the owner when\n // the click completes it, as Radix does, so a form that changed meanwhile can still forbid closing.\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n const request = new CustomEvent(\"dismissableLayer.pointerDownOutside\", { cancelable: true, detail: { originalEvent } })\n if (ownerKeepsOpen(request)) return\n if (!originalEvent.ctrlKey && performance.now() - openedAt >= DOUBLE_CLICK) setOpen(false)\n }, () => rootContext.contentElement.value)\n const handlePointerDownOutside = (event: Parameters<typeof outsidePress.onPointerDownOutside>[0]) => {\n // The native modal owner outlives logical open. An exiting layer must not\n // start a deferred dismissal that closes a trigger-driven reopen.\n if (!open.value) return event.preventDefault()\n // A press in a toast is not outside: the toast region is a layer above the dialog. The Toaster stops it\n // before Reka sees it; this holds when the Toaster mounted after the dialog.\n if (inToastRegion(event.detail.originalEvent.target)) return event.preventDefault()\n // A primary mouse or pen press waits for its click; a touch or another button dismisses now, as Reka does\n const { originalEvent } = event.detail\n if (originalEvent.button === 0 && originalEvent.pointerType !== \"touch\") return outsidePress.onPointerDownOutside(event)\n if (!ownerKeepsOpen(event as DialogInteractOutsideEvent)) outsidePress.onPointerDownOutside(event)\n }\n // Focus moving out while a press waits for its click is that press, as on Radix: the owner hears of it once\n const handleFocusOutside = (event: Parameters<typeof outsidePress.onFocusOutside>[0]) => {\n if (inToastRegion((event as DialogInteractOutsideEvent).detail?.originalEvent.target)) return event.preventDefault()\n outsidePress.onFocusOutside(event)\n if (!event.defaultPrevented) props.onInteractOutside?.(event as DialogInteractOutsideEvent)\n }\n const handleInteractOutside = (event: Event) => {\n if (!open.value) event.preventDefault()\n }\n watch(\n open,\n (isOpen) => {\n if (isOpen) openedAt = performance.now()\n else outsidePress.reset()\n },\n { immediate: true },\n )\n\n const boundary = provideFloatingBoundaryScope()\n let panelElement: HTMLElement | undefined\n let detachDrag: (() => void) | undefined\n let barObserver: ResizeObserver | undefined\n let barChildren: MutationObserver | undefined\n const setPanelRef = (instance: unknown) => {\n const element = instance instanceof HTMLElement ? instance : undefined\n if (element === panelElement) return\n detachDrag?.()\n barObserver?.disconnect()\n barChildren?.disconnect()\n detachDrag = undefined\n panelElement = element\n panelNode.value = element ?? null\n boundary.setRoot(element)\n if (element) {\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side.\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 = element.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? element.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? element.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = element.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? element.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n element.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? 0}px`)\n element.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? 0}px`)\n }\n barObserver = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n barObserver?.disconnect()\n element.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => barObserver?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n barChildren = new MutationObserver(observeBars)\n barChildren.observe(element, { childList: true })\n }\n if (element && mobilePlacement.value === \"bottom\") {\n detachDrag = attachSheetDrag(element, () => setOpen(false))\n }\n }\n\n watch(mobilePlacement, () => {\n detachDrag?.()\n detachDrag = panelElement && mobilePlacement.value === \"bottom\"\n ? attachSheetDrag(panelElement, () => setOpen(false))\n : undefined\n })\n onBeforeUnmount(() => { detachDrag?.(); barObserver?.disconnect(); barChildren?.disconnect() })\n\n let overlayElement: Element | undefined\n const setOverlayRef = (instance: unknown) => {\n const el = (instance as { $el?: unknown } | null)?.$el\n const element = el instanceof Element ? el : undefined\n if (element === overlayElement) return\n if (overlayElement) dismissableSurfaces.delete(overlayElement)\n overlayElement = element\n if (element) dismissableSurfaces.add(element)\n }\n\n const renderDialog = () =>\n h(DialogSurface, { key: \"dialog\" }, () => [\n h(RekaDialogOverlay, {\n ...props.overlayProps,\n class: [s.Overlay, props.overlayProps?.class],\n style: [layerStyle(), props.overlayProps?.style],\n forceMount: true,\n ref: setOverlayRef,\n \"data-state\": open.value ? \"open\" : \"closed\",\n }),\n h(\n RekaDialogContent,\n {\n ...dataAttributes(attrs),\n ...props.rootProps,\n \"forceMount\": true,\n \"class\": [s.Content, props.rootProps?.class],\n \"data-plex-dialog\": \"\",\n \"style\": [toCssVariables({ \"dialog-width\": props.width }), layerStyle(), props.rootProps?.style],\n \"data-placement\": props.placement === \"center\" ? undefined : props.placement,\n \"data-mobile-placement\": mobilePlacement.value,\n \"data-mobile-variant\": props.mobileVariant,\n \"data-surface\": props.surface,\n \"data-state\": open.value ? \"open\" : \"closed\",\n \"data-pill\": props.pill ? \"\" : undefined,\n \"onOpenAutoFocus\": props.onOpenAutoFocus,\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n // Radix labels and describes the content only by mounted parts\n ...(titleCount.value > 0 ? {} : { \"aria-labelledby\": undefined }),\n ...(descriptionCount.value > 0 ? {} : { \"aria-describedby\": undefined }),\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onPointerDownOutside\": handlePointerDownOutside,\n \"onFocusOutside\": handleFocusOutside,\n \"onInteractOutside\": handleInteractOutside,\n },\n {\n default: () => [\n // The native Content is the sole focus owner while open, so it\n // keeps tracking replacement inputs. Activate this non-trapping\n // scope only during logical exit to pause the retained modal owner.\n // A second live trap would leave the paused native scope tracking\n // removed inputs; its mutation fallback could then select current text.\n h(RekaFocusScope, {\n asChild: true,\n present: !open.value,\n loop: false,\n trapped: false,\n onMountAutoFocus: preventDefaultHandler,\n onUnmountAutoFocus: preventDefaultHandler,\n }, () => h(\"div\", { class: [s.Panel, attrs.class], ref: setPanelRef }, [\n props.showClose\n ? h(DialogClose, null, {\n default: () => [\n h(NavigationButton, { \"action\": \"close\", \"variant\": \"ghost\", \"class\": s.CloseButton, \"aria-label\": \"Close dialog\" }),\n ],\n })\n : null,\n slots.default?.(),\n ])),\n ],\n },\n ),\n ])\n\n const layerStyle = () => toCssVariables({ \"dialog-z-index\": props.zIndex === undefined ? undefined : String(props.zIndex) })\n\n return () => {\n const { placement } = props\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || mobilePlacement.value === \"bottom\" || mobilePlacement.value === \"fullscreen\"\n // Portaled out of any phone layout, a phone dialog carries its own scope, above its transition: the phone rules\n // of the style sheet start there.\n const scoped = (group: VNode) =>\n phoneLayout.value && !portalTarget.value ? h(\"div\", { class: s.PhoneScope, \"data-plex-layout\": \"phone\" }, [group]) : group\n return h(RekaDialogPortal, { to: portalTarget.value ?? undefined }, {\n default: () => [\n scoped(h(\n TransitionGroup,\n // A dialog mounted open enters too, as `v-if` and `open` together do\n {\n class: s.Transition,\n ...(crossesScreen ? overlayTimingLarge : overlayTiming),\n overlay: true,\n preventInitialTransition: false,\n },\n // `open && <div>` in React: closed still renders the empty wrapper\n { default: () => [open.value ? renderDialog() : createCommentVNode()] },\n )),\n ],\n })\n }\n },\n})\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar\nconst headerParts = (children: VNodeArrayChildren | undefined): VNodeArrayChildren =>\n (children ?? []).flatMap((part) =>\n isVNode(part) && part.type === FragmentVNode ? headerParts(part.children as VNodeArrayChildren) : Array.isArray(part) ? headerParts(part) : [part])\nconst isHeaderAction = (part: unknown) => isVNode(part) && part.type === DialogHeaderAction\n\nexport const DialogHeader = defineComponent({\n name: \"DialogHeader\",\n props: {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"glass\" */\n background: { type: String as PropType<DialogBarBackground>, default: \"glass\" },\n },\n setup(props, { slots }) {\n const scroll = inject(DIALOG_SCROLL, null)\n const sheet = inject(DIALOG_SHEET, null)\n const phone = usePhoneLayout()\n const bar = computed(() => !!sheet?.value && phone.value)\n provide(DIALOG_BAR, bar)\n return () => {\n if (!bar.value) return h(\"div\", { class: s.Header, \"data-background\": props.background, \"data-scrolled\": scroll?.scrolled.value ? \"\" : undefined }, slots.default?.())\n const parts = headerParts(slots.default?.())\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 centered on the row of controls, the header actions at the\n // trailing edge, all on one 44px row under the grabber.\n return h(Toolbar, { \"background\": props.background, \"data-dialog-bar\": \"\" }, () => [\n sheet?.value?.showClose\n ? h(ToolbarLeading, { class: s.BarClose }, () => [\n h(DialogClose, null, { default: () => [h(NavigationButton, { \"action\": \"close\", \"variant\": \"ghost\", \"aria-label\": \"Close dialog\" })] }),\n ])\n : null,\n h(\"div\", { class: [t.Heading, s.BarHeading] }, parts.filter((part) => !isHeaderAction(part))),\n ...parts.filter(isHeaderAction),\n ])\n }\n },\n})\n\nexport const DialogHeaderAction = defineComponent({\n name: \"DialogHeaderAction\",\n setup(_props, { slots }) {\n const bar = inject(DIALOG_BAR, null)\n return () => (bar?.value ? h(ToolbarTrailing, null, () => slots.default?.()) : h(\"div\", { class: s.HeaderAction }, slots.default?.()))\n },\n})\n\n/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */\nexport const DialogBody = defineComponent({\n name: \"DialogBody\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const scroll = inject(DIALOG_SCROLL, null)\n const element = ref<HTMLElement | null>(null)\n let stop: (() => void) | undefined\n onMounted(() => {\n if (!element.value || !scroll) return\n stop = observeScrollEdges(element.value, (edges) => {\n scroll.scrolled.value = edges.scrolled\n scroll.contentBelow.value = edges.contentBelow\n })\n })\n onBeforeUnmount(() => {\n stop?.()\n if (scroll) { scroll.scrolled.value = false; scroll.contentBelow.value = false }\n })\n return () => h(\"div\", { ref: element, class: [s.Body, attrs.class] }, slots.default?.())\n },\n})\n\nexport const DialogFooter = defineComponent({\n name: \"DialogFooter\",\n props: {\n /** Override the mobile action layout. Alerts default to inline; sheets to stacked. */\n mobileLayout: String as PropType<\"inline\" | \"stacked\">,\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background: { type: String as PropType<DialogBarBackground>, default: \"soft\" },\n },\n setup(props, { slots }) {\n const boundary = useFloatingBoundaryRegistration()\n const scroll = inject(DIALOG_SCROLL, null)\n return () => h(\"div\", {\n \"ref\": boundary?.setFooter,\n \"class\": s.Footer,\n \"data-mobile-layout\": props.mobileLayout,\n \"data-background\": props.background,\n \"data-content-below\": scroll?.contentBelow.value ? \"\" : undefined,\n }, slots.default?.())\n },\n})\n\n/** Counts a mounted part, as Radix's title and description counts do. */\nconst useMountedCount = (count: Ref<number>) => {\n onMounted(() => {\n count.value++\n })\n onBeforeUnmount(() => {\n count.value--\n })\n}\n\nexport const DialogTitle = defineComponent({\n name: \"DialogTitle\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().titleCount)\n const bar = inject(DIALOG_BAR, null)\n return () => h(RekaDialogTitle, { class: bar?.value ? t.Title : s.Title }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogDescription = defineComponent({\n name: \"DialogDescription\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().descriptionCount)\n const bar = inject(DIALOG_BAR, null)\n const element = ref<{ $el?: Element } | Element | null>(null)\n const shown = ref(false)\n // In the bar a description the reader sees is the title's second line (Toolbar's subtitle); one that is only\n // read out, visually hidden, leaves the title on its one line.\n const measure = () => {\n const node = element.value instanceof Element ? element.value : element.value?.$el\n shown.value = !!bar?.value && node instanceof HTMLElement && node.offsetHeight > 1 && node.offsetWidth > 1\n }\n onMounted(measure)\n watch(() => bar?.value, () => queueMicrotask(measure))\n return () => h(RekaDialogDescription, { ref: element, class: bar?.value && shown.value ? t.Subtitle : s.Description }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogClose = defineComponent({\n name: \"DialogClose\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenChange(false)\n }\n return () => withDialogProps(firstElementChild(slots.default?.()), { type: \"button\" }, onClick)\n },\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. */\nexport const DialogSteps = defineComponent({\n name: \"DialogSteps\",\n props: {\n /** The step on screen. A new value brings its content in. */\n step: { type: [String, Number] as PropType<string | number>, required: true },\n /**\n * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns\n * to a step before it.\n * @default \"forward\"\n */\n direction: { type: String as PropType<\"forward\" | \"back\">, default: \"forward\" },\n },\n setup(props, { slots }) {\n return () => {\n // Resolve this step now, so a step that leaves cannot read the next one\n const entry = h(\"div\", { \"key\": props.step, \"data-dialog-step\": \"\", \"tabindex\": -1 }, slots.default?.())\n return h(\"div\", { \"class\": s.Steps, \"data-direction\": props.direction }, [\n h(TransitionGroup, {\n ...STEP_TIMING,\n as: \"div\",\n overlay: true,\n class: s.Step,\n onEnter: enterStep,\n onExit: leaveStep,\n onExitActive: settleStepHeight,\n onExitComplete: releaseStepHeight,\n }, () => [entry]),\n ])\n }\n },\n})\n\nexport type DialogProps = InstanceType<typeof Dialog>[\"$props\"]\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/** A press or a focus outside the dialog; `event.detail.originalEvent` is the browser's event. */\nexport type DialogInteractOutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent }>\n\n/** Class, style and data attributes for one of the dialog's layers. */\nexport type DialogLayerProps = {\n class?: HTMLAttributes[\"class\"]\n style?: string | CSSProperties\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\n/** DialogContent props; `class` lands on the panel, like `className` in React. */\nexport type DialogContentProps = InstanceType<typeof DialogContent>[\"$props\"] & { class?: HTMLAttributes[\"class\"] }\n\nexport type DialogHeaderProps = InstanceType<typeof DialogHeader>[\"$props\"]\nexport type DialogFooterProps = InstanceType<typeof DialogFooter>[\"$props\"]\nexport type DialogStepsProps = InstanceType<typeof DialogSteps>[\"$props\"]\n"]}
@@ -0,0 +1,85 @@
1
+ // The motion of Dialog Steps (Dialog.module.css): the next step comes in over the one before, as a push on iOS.
2
+ import s from "@plexui/styles/components/Dialog/Dialog.module.css";
3
+ export const STEP_TIMING = { enterDuration: 300, exitDuration: 300 };
4
+ // Focus in the step that leaves moves to the one that comes in, so a press on Next does not drop it to the page. A
5
+ // step that comes back while it still leaves (Back right after Next) is inert for a moment and takes no focus, so
6
+ // the focus moves once it is not.
7
+ export const enterStep = (element) => {
8
+ if (!(element instanceof HTMLElement))
9
+ return;
10
+ delete element.dataset.exitDirection;
11
+ element.style.removeProperty("top");
12
+ const active = element.ownerDocument.activeElement;
13
+ const steps = element.parentElement;
14
+ if (!active || !steps?.contains(active) || element.contains(active))
15
+ return;
16
+ const view = element.ownerDocument.defaultView;
17
+ const focus = (frames) => {
18
+ if (!element.isConnected)
19
+ return;
20
+ if (element.inert && frames > 0 && view) {
21
+ view.requestAnimationFrame(() => focus(frames - 1));
22
+ return;
23
+ }
24
+ element.querySelector(":scope > [data-dialog-step]")?.focus({ preventScroll: true });
25
+ };
26
+ focus(3);
27
+ };
28
+ // The lowest edge of the steps still leaving, from the top of the steps: the step that comes in covers them to it
29
+ const exitExtent = (steps, except) => Math.max(0, ...Array.from(steps.children)
30
+ .filter((child) => child instanceof HTMLElement && child !== except && child.hasAttribute("data-exiting"))
31
+ .map((child) => (Number.parseFloat(child.style.top) || 0) + child.offsetHeight));
32
+ export const leaveStep = (element) => {
33
+ if (!(element instanceof HTMLElement))
34
+ return;
35
+ const steps = element.parentElement;
36
+ if (!steps)
37
+ return;
38
+ // A later step can change the direction while this one still leaves
39
+ element.dataset.exitDirection = steps.dataset.direction === "back" ? "back" : "forward";
40
+ // The new step starts at its top, as a pushed screen does; the one that leaves keeps its place on screen
41
+ const scroller = steps.closest(`.${s.Body}, .${s.Panel}`);
42
+ if (scroller) {
43
+ const padding = Number.parseFloat(getComputedStyle(scroller).scrollPaddingTop) || 0;
44
+ const stepsTop = steps.getBoundingClientRect().top - scroller.getBoundingClientRect().top + scroller.scrollTop;
45
+ const target = Math.max(0, Math.min(scroller.scrollTop, Math.round(stepsTop - padding)));
46
+ const offset = scroller.scrollTop - target;
47
+ if (offset > 0) {
48
+ element.style.top = `${-offset}px`;
49
+ scroller.scrollTop = target;
50
+ }
51
+ }
52
+ // The steps keep the height of the one that leaves, then take the new one's as it comes in. A step that still
53
+ // leaves from a step before stays covered too.
54
+ const height = element.offsetHeight;
55
+ const extent = Math.max(exitExtent(steps, element), (Number.parseFloat(element.style.top) || 0) + height);
56
+ steps.style.setProperty("--dialog-steps-exit-height", `${extent}px`);
57
+ steps.style.transition = "none";
58
+ steps.style.minHeight = `${height}px`;
59
+ };
60
+ export const settleStepHeight = (element) => {
61
+ if (!(element instanceof HTMLElement))
62
+ return;
63
+ const steps = element.parentElement;
64
+ const entering = steps?.querySelector(":scope > :not([data-exiting])");
65
+ if (!steps || !entering)
66
+ return;
67
+ steps.style.transition = "min-height var(--motion-enter-large) var(--cubic-enter)";
68
+ steps.style.minHeight = `${entering.offsetHeight}px`;
69
+ };
70
+ export const releaseStepHeight = (element) => {
71
+ if (!(element instanceof HTMLElement))
72
+ return;
73
+ const steps = element.parentElement;
74
+ if (!steps)
75
+ return;
76
+ // Another step still leaving keeps the height, and the cover reaches its edge
77
+ if (Array.from(steps.children).some((child) => child !== element && child.hasAttribute("data-exiting"))) {
78
+ steps.style.setProperty("--dialog-steps-exit-height", `${exitExtent(steps, element)}px`);
79
+ return;
80
+ }
81
+ steps.style.removeProperty("min-height");
82
+ steps.style.removeProperty("transition");
83
+ steps.style.removeProperty("--dialog-steps-exit-height");
84
+ };
85
+ //# sourceMappingURL=dialogSteps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogSteps.js","sourceRoot":"","sources":["../../../../src/components/Dialog/dialogSteps.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,OAAO,CAAC,MAAM,oDAAoD,CAAA;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,CAAA;AAKpE,mHAAmH;AACnH,kHAAkH;AAClH,kCAAkC;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAA0B,EAAE,EAAE;IACtD,IAAI,CAAC,CAAC,OAAO,YAAY,WAAW,CAAC;QAAE,OAAM;IAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAA;IACpC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAA;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAA;IACnC,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAM;IAC3E,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,EAAE;QAC/B,IAAI,CAAC,OAAO,CAAC,WAAW;YAAE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C,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAA;AAC1D,CAAC,CAAA","sourcesContent":["// The motion of Dialog Steps (Dialog.module.css): the next step comes in over the one before, as a push on iOS.\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\n\nexport const STEP_TIMING = { enterDuration: 300, exitDuration: 300 }\n\n// A transition can hand an SVG element; a step is always the HTML element Steps renders\ntype TransitionElement = HTMLElement | SVGElement\n\n// Focus in the step that leaves moves to the one that comes in, so a press on Next does not drop it to the page. A\n// step that comes back while it still leaves (Back right after Next) is inert for a moment and takes no focus, so\n// the focus moves once it is not.\nexport const enterStep = (element: TransitionElement) => {\n if (!(element instanceof HTMLElement)) return\n delete element.dataset.exitDirection\n element.style.removeProperty(\"top\")\n const active = element.ownerDocument.activeElement\n const steps = element.parentElement\n if (!active || !steps?.contains(active) || element.contains(active)) return\n const view = element.ownerDocument.defaultView\n const focus = (frames: number) => {\n if (!element.isConnected) return\n if (element.inert && frames > 0 && view) {\n view.requestAnimationFrame(() => focus(frames - 1))\n return\n }\n element.querySelector<HTMLElement>(\":scope > [data-dialog-step]\")?.focus({ preventScroll: true })\n }\n focus(3)\n}\n\n// The lowest edge of the steps still leaving, from the top of the steps: the step that comes in covers them to it\nconst exitExtent = (steps: HTMLElement, except?: Element) =>\n Math.max(\n 0,\n ...Array.from(steps.children)\n .filter((child): child is HTMLElement => child instanceof HTMLElement && child !== except && child.hasAttribute(\"data-exiting\"))\n .map((child) => (Number.parseFloat(child.style.top) || 0) + child.offsetHeight),\n )\n\nexport const leaveStep = (element: TransitionElement) => {\n if (!(element instanceof HTMLElement)) return\n const steps = element.parentElement\n if (!steps) return\n // A later step can change the direction while this one still leaves\n element.dataset.exitDirection = steps.dataset.direction === \"back\" ? \"back\" : \"forward\"\n // The new step starts at its top, as a pushed screen does; the one that leaves keeps its place on screen\n const scroller = steps.closest<HTMLElement>(`.${s.Body}, .${s.Panel}`)\n if (scroller) {\n const padding = Number.parseFloat(getComputedStyle(scroller).scrollPaddingTop) || 0\n const stepsTop = steps.getBoundingClientRect().top - scroller.getBoundingClientRect().top + scroller.scrollTop\n const target = Math.max(0, Math.min(scroller.scrollTop, Math.round(stepsTop - padding)))\n const offset = scroller.scrollTop - target\n if (offset > 0) {\n element.style.top = `${-offset}px`\n scroller.scrollTop = target\n }\n }\n // The steps keep the height of the one that leaves, then take the new one's as it comes in. A step that still\n // leaves from a step before stays covered too.\n const height = element.offsetHeight\n const extent = Math.max(exitExtent(steps, element), (Number.parseFloat(element.style.top) || 0) + height)\n steps.style.setProperty(\"--dialog-steps-exit-height\", `${extent}px`)\n steps.style.transition = \"none\"\n steps.style.minHeight = `${height}px`\n}\n\nexport const settleStepHeight = (element: TransitionElement) => {\n if (!(element instanceof HTMLElement)) return\n const steps = element.parentElement\n const entering = steps?.querySelector<HTMLElement>(\":scope > :not([data-exiting])\")\n if (!steps || !entering) return\n steps.style.transition = \"min-height var(--motion-enter-large) var(--cubic-enter)\"\n steps.style.minHeight = `${entering.offsetHeight}px`\n}\n\nexport const releaseStepHeight = (element: TransitionElement) => {\n if (!(element instanceof HTMLElement)) return\n const steps = element.parentElement\n if (!steps) return\n // Another step still leaving keeps the height, and the cover reaches its edge\n if (Array.from(steps.children).some((child) => child !== element && child.hasAttribute(\"data-exiting\"))) {\n steps.style.setProperty(\"--dialog-steps-exit-height\", `${exitExtent(steps, element)}px`)\n return\n }\n steps.style.removeProperty(\"min-height\")\n steps.style.removeProperty(\"transition\")\n steps.style.removeProperty(\"--dialog-steps-exit-height\")\n}\n"]}
@@ -0,0 +1,74 @@
1
+ // The height a dialog lays out in, where the window's is not it: the box of a PhoneLayout, or the part of the window
2
+ // a phone keyboard leaves visible (the visual viewport; the layout viewport keeps its height under the keyboard). The
3
+ // layer then covers that part, so a sheet sits on the keyboard and a panel stays in view. Inside a PhoneLayout the
4
+ // layer covers the part of the box the keyboard leaves visible. Returns the cleanup.
5
+ export const watchDialogViewport = (content, container) => {
6
+ const style = content.style;
7
+ const view = content.ownerDocument.defaultView;
8
+ const viewport = view?.visualViewport ?? null;
9
+ const clear = () => {
10
+ content.removeAttribute("data-visual-viewport");
11
+ style.removeProperty("--dialog-viewport-top");
12
+ style.removeProperty("--dialog-viewport-height");
13
+ };
14
+ // The part of the layout viewport a keyboard leaves visible, or null with no keyboard: a keyboard shortens the
15
+ // visual viewport at scale 1; a pinch zoom scales it instead
16
+ const visible = () => {
17
+ if (!viewport)
18
+ return null;
19
+ const layoutHeight = content.ownerDocument.documentElement.clientHeight;
20
+ if (Math.abs(viewport.scale - 1) > 0.01 || layoutHeight - viewport.height <= 1)
21
+ return null;
22
+ return { top: viewport.offsetTop, bottom: viewport.offsetTop + viewport.height };
23
+ };
24
+ const update = container
25
+ ? () => {
26
+ // A box with no height yet (not laid out) leaves the window's
27
+ const height = container.clientHeight;
28
+ if (height <= 0)
29
+ return clear();
30
+ const area = visible();
31
+ // The layer lays out in the box's padding box, in the box's own pixels: a scaled box (a phone drawn smaller)
32
+ // measures on screen at its scale
33
+ const box = container.getBoundingClientRect();
34
+ const scale = container.offsetHeight > 0 && box.height > 0 ? box.height / container.offsetHeight : 1;
35
+ const boxTop = box.top + container.clientTop * scale;
36
+ const top = area ? Math.max(0, (area.top - boxTop) / scale) : 0;
37
+ const bottom = area ? Math.min(height, (area.bottom - boxTop) / scale) : height;
38
+ if (!area || (top <= 0 && bottom >= height) || bottom <= top) {
39
+ content.removeAttribute("data-visual-viewport");
40
+ style.removeProperty("--dialog-viewport-top");
41
+ style.setProperty("--dialog-viewport-height", `${height}px`);
42
+ return;
43
+ }
44
+ content.setAttribute("data-visual-viewport", "");
45
+ style.setProperty("--dialog-viewport-top", `${top}px`);
46
+ style.setProperty("--dialog-viewport-height", `${bottom - top}px`);
47
+ }
48
+ : () => {
49
+ const area = visible();
50
+ if (!area)
51
+ return clear();
52
+ content.setAttribute("data-visual-viewport", "");
53
+ style.setProperty("--dialog-viewport-top", `${area.top}px`);
54
+ style.setProperty("--dialog-viewport-height", `${area.bottom - area.top}px`);
55
+ };
56
+ update();
57
+ viewport?.addEventListener("resize", update);
58
+ viewport?.addEventListener("scroll", update);
59
+ // The box moves with the page, and changes its own size
60
+ const observer = container && typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : undefined;
61
+ if (container) {
62
+ observer?.observe(container);
63
+ view?.addEventListener("scroll", update, { capture: true, passive: true });
64
+ }
65
+ return () => {
66
+ viewport?.removeEventListener("resize", update);
67
+ viewport?.removeEventListener("scroll", update);
68
+ observer?.disconnect();
69
+ if (container)
70
+ view?.removeEventListener("scroll", update, { capture: true });
71
+ clear();
72
+ };
73
+ };
74
+ //# sourceMappingURL=dialogViewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogViewport.js","sourceRoot":"","sources":["../../../../src/components/Dialog/dialogViewport.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,sHAAsH;AACtH,mHAAmH;AACnH,qFAAqF;AACrF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAoB,EAAE,SAA6B,EAAgB,EAAE;IACvG,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,MAAM,QAAQ,GAAG,IAAI,EAAE,cAAc,IAAI,IAAI,CAAA;IAC7C,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAA;QAC/C,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAA;QAC7C,KAAK,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAA;IAClD,CAAC,CAAA;IACD,+GAA+G;IAC/G,6DAA6D;IAC7D,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAA;QAC1B,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,YAA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AAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC5G,IAAI,SAAS,EAAE,CAAC;QACd,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC5B,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,GAAG,EAAE;QACV,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC/C,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC/C,QAAQ,EAAE,UAAU,EAAE,CAAA;QACtB,IAAI,SAAS;YAAE,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAC7E,KAAK,EAAE,CAAA;IACT,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["// The height a dialog lays out in, where the window's is not it: the box of a PhoneLayout, or the part of the window\n// a phone keyboard leaves visible (the visual viewport; the layout viewport keeps its height under the keyboard). The\n// layer then covers that part, so a sheet sits on the keyboard and a panel stays in view. Inside a PhoneLayout the\n// layer covers the part of the box the keyboard leaves visible. Returns the cleanup.\nexport const watchDialogViewport = (content: HTMLElement, container: HTMLElement | null): (() => void) => {\n const style = content.style\n const view = content.ownerDocument.defaultView\n const viewport = view?.visualViewport ?? null\n const clear = () => {\n content.removeAttribute(\"data-visual-viewport\")\n style.removeProperty(\"--dialog-viewport-top\")\n style.removeProperty(\"--dialog-viewport-height\")\n }\n // The part of the layout viewport a keyboard leaves visible, or null with no keyboard: a keyboard shortens the\n // visual viewport at scale 1; a pinch zoom scales it instead\n const visible = () => {\n if (!viewport) return null\n const layoutHeight = content.ownerDocument.documentElement.clientHeight\n if (Math.abs(viewport.scale - 1) > 0.01 || layoutHeight - viewport.height <= 1) return null\n return { top: viewport.offsetTop, bottom: viewport.offsetTop + viewport.height }\n }\n const update = container\n ? () => {\n // A box with no height yet (not laid out) leaves the window's\n const height = container.clientHeight\n if (height <= 0) return clear()\n const area = visible()\n // The layer lays out in the box's padding box, in the box's own pixels: a scaled box (a phone drawn smaller)\n // measures on screen at its scale\n const box = container.getBoundingClientRect()\n const scale = container.offsetHeight > 0 && box.height > 0 ? box.height / container.offsetHeight : 1\n const boxTop = box.top + container.clientTop * scale\n const top = area ? Math.max(0, (area.top - boxTop) / scale) : 0\n const bottom = area ? Math.min(height, (area.bottom - boxTop) / scale) : height\n if (!area || (top <= 0 && bottom >= height) || bottom <= top) {\n content.removeAttribute(\"data-visual-viewport\")\n style.removeProperty(\"--dialog-viewport-top\")\n style.setProperty(\"--dialog-viewport-height\", `${height}px`)\n return\n }\n content.setAttribute(\"data-visual-viewport\", \"\")\n style.setProperty(\"--dialog-viewport-top\", `${top}px`)\n style.setProperty(\"--dialog-viewport-height\", `${bottom - top}px`)\n }\n : () => {\n const area = visible()\n if (!area) return clear()\n content.setAttribute(\"data-visual-viewport\", \"\")\n style.setProperty(\"--dialog-viewport-top\", `${area.top}px`)\n style.setProperty(\"--dialog-viewport-height\", `${area.bottom - area.top}px`)\n }\n update()\n viewport?.addEventListener(\"resize\", update)\n viewport?.addEventListener(\"scroll\", update)\n // The box moves with the page, and changes its own size\n const observer = container && typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n if (container) {\n observer?.observe(container)\n view?.addEventListener(\"scroll\", update, { capture: true, passive: true })\n }\n return () => {\n viewport?.removeEventListener(\"resize\", update)\n viewport?.removeEventListener(\"scroll\", update)\n observer?.disconnect()\n if (container) view?.removeEventListener(\"scroll\", update, { capture: true })\n clear()\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderAction, DialogTitle, DialogTrigger, } from "./Dialog.js";
1
+ export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderAction, DialogSteps, DialogTitle, DialogTrigger, } from "./Dialog.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,GAOd,MAAM,aAAa,CAAA","sourcesContent":["export {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogHeaderAction,\n DialogTitle,\n DialogTrigger,\n type DialogBarBackground,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogContentProps,\n type DialogPlacement,\n type DialogProps,\n} from \"./Dialog.js\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,GAUd,MAAM,aAAa,CAAA","sourcesContent":["export {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogHeaderAction,\n DialogSteps,\n DialogTitle,\n DialogTrigger,\n type DialogBarBackground,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogContentProps,\n type DialogInteractOutsideEvent,\n type DialogLayerProps,\n type DialogPlacement,\n type DialogProps,\n type DialogStepsProps,\n} from \"./Dialog.js\"\n"]}
@@ -1,3 +1,4 @@
1
+ import { isPhoneLayout } from "../../lib/phoneLayout.js";
1
2
  // A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its
2
3
  // height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.
3
4
  const GRIP = 44;
@@ -57,7 +58,7 @@ export const attachSheetDrag = (panel, close) => {
57
58
  settleTimer = view.setTimeout(clear, Math.max(SETTLE, Number.isFinite(duration) ? duration : 0));
58
59
  };
59
60
  const onStart = (event) => {
60
- const phone = view.matchMedia?.("(max-width: 767px)").matches ?? view.innerWidth <= 767;
61
+ const phone = isPhoneLayout(panel);
61
62
  if (event.touches.length !== 1 || !phone || panel.closest(EXITING))
62
63
  return;
63
64
  const { clientY } = event.touches[0];
@@ -1 +1 @@
1
- {"version":3,"file":"sheetDrag.js","sourceRoot":"","sources":["../../../../src/components/Dialog/sheetDrag.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,mGAAmG;AACnG,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,IAAI,GAAG,GAAG,CAAA;AAChB,MAAM,MAAM,GAAG,GAAG,CAAA;AAClB,MAAM,WAAW,GAAG,qDAAqD,CAAA;AACzE,MAAM,cAAc,GAAG,+BAA+B,CAAA;AACtD,MAAM,OAAO,GAAG,uCAAuC,CAAA;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,KAAiB,EAAE,EAAE;IACvE,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAA;IAC5C,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAA;IAC1B,IAAI,MAAM,GAAkB,IAAI,CAAA;IAChC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,WAA+B,CAAA;IAEnC,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,WAAW,KAAK,SAAS;Y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AAO,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/D,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IACzC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAE/C,OAAO,GAAG,EAAE;QACV,aAAa,EAAE,UAAU,EAAE,CAAA;QAC3B,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;QAChD,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAC9C,KAAK,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAClD,MAAM,GAAG,IAAI,CAAA;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its\n// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.\nconst GRIP = 44\nconst CLOSE_SHARE = 0.3\nconst CLOSE_SPEED = 0.5\nconst REST = 100\nconst SETTLE = 400\nconst INTERACTIVE = \"a, button, input, select, textarea, [role='button']\"\nconst DRAG_TRANSFORM = \"--dialog-panel-drag-transform\"\nconst EXITING = \"[data-exiting], [data-exiting-active]\"\n\nexport const attachSheetDrag = (panel: HTMLElement, close: () => void) => {\n const view = panel.ownerDocument.defaultView\n if (!view) return () => {}\n let startY: number | null = null\n let lastY = 0\n let lastTime = 0\n let speed = 0\n let settleTimer: number | undefined\n\n const stopSettling = () => {\n if (settleTimer !== undefined) view.clearTimeout(settleTimer)\n settleTimer = undefined\n panel.removeEventListener(\"transitionend\", onSettled)\n }\n const clearInline = () => {\n panel.style.transition = \"\"\n panel.style.transform = \"\"\n }\n const clear = () => {\n stopSettling()\n clearInline()\n panel.style.removeProperty(DRAG_TRANSFORM)\n }\n const onSettled = (event: TransitionEvent) => {\n if (event.target === panel && event.propertyName === \"transform\") clear()\n }\n const returnToRest = () => {\n stopSettling()\n if (view.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) {\n clear()\n return\n }\n panel.style.transition = \"transform var(--motion-enter) var(--cubic-enter)\"\n panel.style.transform = \"\"\n panel.style.removeProperty(DRAG_TRANSFORM)\n const durationText = view.getComputedStyle(panel).transitionDuration\n const duration = Number.parseFloat(durationText) * (durationText.endsWith(\"ms\") ? 1 : 1000)\n if (duration === 0) {\n clear()\n return\n }\n panel.addEventListener(\"transitionend\", onSettled)\n // A theme can lengthen the token or remove the transition altogether.\n // This cleanup must not cut a valid longer transition at the veto timeout.\n settleTimer = view.setTimeout(clear, Math.max(SETTLE, Number.isFinite(duration) ? duration : 0))\n }\n\n const onStart = (event: TouchEvent) => {\n const phone = view.matchMedia?.(\"(max-width: 767px)\").matches ?? view.innerWidth <= 767\n if (event.touches.length !== 1 || !phone || panel.closest(EXITING)) return\n const { clientY } = event.touches[0]\n if (clientY - panel.getBoundingClientRect().top > GRIP) return\n if (event.target instanceof view.Element && event.target.closest(INTERACTIVE)) return\n stopSettling()\n startY = clientY\n lastY = clientY\n lastTime = event.timeStamp\n speed = 0\n }\n\n const onMove = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (startY === null || !touch) return\n event.preventDefault()\n const { clientY } = touch\n speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime)\n lastY = clientY\n lastTime = event.timeStamp\n panel.style.transition = \"none\"\n panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`\n }\n\n const onEnd = (event: TouchEvent) => {\n if (startY === null) return\n const travelled = lastY - startY\n // A finger that rested before lifting is no flick.\n const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST\n startY = null\n if (travelled <= 0) {\n clear()\n return\n }\n if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {\n // The normal/exit-start CSS states retain this exact release position.\n // No inline transform or transition may mask the active CSS exit.\n panel.style.setProperty(DRAG_TRANSFORM, `translateY(${travelled}px)`)\n clearInline()\n // An owner can veto close. Register before close, which can detach us.\n settleTimer = view.setTimeout(() => {\n settleTimer = undefined\n if (panel.isConnected && !panel.closest(EXITING)) returnToRest()\n }, SETTLE)\n close()\n return\n }\n returnToRest()\n }\n\n const onCancel = () => {\n startY = null\n clear()\n }\n\n // A retained panel can reopen before its exit completes. Its new entrance\n // must return to rest, not finish at the old gesture's release offset.\n const dialog = panel.closest(\"[data-plex-dialog]\")\n const stateObserver = dialog ? new view.MutationObserver((records) => {\n if (panel.style.getPropertyValue(DRAG_TRANSFORM) &&\n dialog.getAttribute(\"data-state\") === \"open\" &&\n records.some((record) => record.oldValue === \"closed\")) clear()\n }) : undefined\n stateObserver?.observe(dialog ?? panel, {\n attributes: true, attributeFilter: [\"data-state\"], attributeOldValue: true,\n })\n\n panel.addEventListener(\"touchstart\", onStart, { passive: true })\n panel.addEventListener(\"touchmove\", onMove, { passive: false })\n panel.addEventListener(\"touchend\", onEnd)\n panel.addEventListener(\"touchcancel\", onCancel)\n\n return () => {\n stateObserver?.disconnect()\n panel.removeEventListener(\"touchstart\", onStart)\n panel.removeEventListener(\"touchmove\", onMove)\n panel.removeEventListener(\"touchend\", onEnd)\n panel.removeEventListener(\"touchcancel\", onCancel)\n startY = null\n clear()\n }\n}\n"]}
1
+ {"version":3,"file":"sheetDrag.js","sourceRoot":"","sources":["../../../../src/components/Dialog/sheetDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,sGAAsG;AACtG,mGAAmG;AACnG,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,IAAI,GAAG,GAAG,CAAA;AAChB,MAAM,MAAM,GAAG,GAAG,CAAA;AAClB,MAAM,WAAW,GAAG,qDAAqD,CAAA;AACzE,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,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;YAAE,KAAK,EAAE,CAAA;IACrE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACd,aAAa,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE;QACtC,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,YAAY,CAAC,EAAE,iBAAiB,EAAE,IAAI;KAC3E,CAAC,CAAA;IAEF,KAAK,CAAC,gBAAgB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,KAAK,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/D,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IACzC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAE/C,OAAO,GAAG,EAAE;QACV,aAAa,EAAE,UAAU,EAAE,CAAA;QAC3B,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;QAChD,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAC9C,KAAK,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAClD,MAAM,GAAG,IAAI,CAAA;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { isPhoneLayout } from \"../../lib/phoneLayout.js\"\n\n// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its\n// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.\nconst GRIP = 44\nconst CLOSE_SHARE = 0.3\nconst CLOSE_SPEED = 0.5\nconst REST = 100\nconst SETTLE = 400\nconst INTERACTIVE = \"a, button, input, select, textarea, [role='button']\"\nconst DRAG_TRANSFORM = \"--dialog-panel-drag-transform\"\nconst EXITING = \"[data-exiting], [data-exiting-active]\"\n\nexport const attachSheetDrag = (panel: HTMLElement, close: () => void) => {\n const view = panel.ownerDocument.defaultView\n if (!view) return () => {}\n let startY: number | null = null\n let lastY = 0\n let lastTime = 0\n let speed = 0\n let settleTimer: number | undefined\n\n const stopSettling = () => {\n if (settleTimer !== undefined) view.clearTimeout(settleTimer)\n settleTimer = undefined\n panel.removeEventListener(\"transitionend\", onSettled)\n }\n const clearInline = () => {\n panel.style.transition = \"\"\n panel.style.transform = \"\"\n }\n const clear = () => {\n stopSettling()\n clearInline()\n panel.style.removeProperty(DRAG_TRANSFORM)\n }\n const onSettled = (event: TransitionEvent) => {\n if (event.target === panel && event.propertyName === \"transform\") clear()\n }\n const returnToRest = () => {\n stopSettling()\n if (view.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) {\n clear()\n return\n }\n panel.style.transition = \"transform var(--motion-enter) var(--cubic-enter)\"\n panel.style.transform = \"\"\n panel.style.removeProperty(DRAG_TRANSFORM)\n const durationText = view.getComputedStyle(panel).transitionDuration\n const duration = Number.parseFloat(durationText) * (durationText.endsWith(\"ms\") ? 1 : 1000)\n if (duration === 0) {\n clear()\n return\n }\n panel.addEventListener(\"transitionend\", onSettled)\n // A theme can lengthen the token or remove the transition altogether.\n // This cleanup must not cut a valid longer transition at the veto timeout.\n settleTimer = view.setTimeout(clear, Math.max(SETTLE, Number.isFinite(duration) ? duration : 0))\n }\n\n const onStart = (event: TouchEvent) => {\n const phone = isPhoneLayout(panel)\n if (event.touches.length !== 1 || !phone || panel.closest(EXITING)) return\n const { clientY } = event.touches[0]\n if (clientY - panel.getBoundingClientRect().top > GRIP) return\n if (event.target instanceof view.Element && event.target.closest(INTERACTIVE)) return\n stopSettling()\n startY = clientY\n lastY = clientY\n lastTime = event.timeStamp\n speed = 0\n }\n\n const onMove = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (startY === null || !touch) return\n event.preventDefault()\n const { clientY } = touch\n speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime)\n lastY = clientY\n lastTime = event.timeStamp\n panel.style.transition = \"none\"\n panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`\n }\n\n const onEnd = (event: TouchEvent) => {\n if (startY === null) return\n const travelled = lastY - startY\n // A finger that rested before lifting is no flick.\n const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST\n startY = null\n if (travelled <= 0) {\n clear()\n return\n }\n if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {\n // The normal/exit-start CSS states retain this exact release position.\n // No inline transform or transition may mask the active CSS exit.\n panel.style.setProperty(DRAG_TRANSFORM, `translateY(${travelled}px)`)\n clearInline()\n // An owner can veto close. Register before close, which can detach us.\n settleTimer = view.setTimeout(() => {\n settleTimer = undefined\n if (panel.isConnected && !panel.closest(EXITING)) returnToRest()\n }, SETTLE)\n close()\n return\n }\n returnToRest()\n }\n\n const onCancel = () => {\n startY = null\n clear()\n }\n\n // A retained panel can reopen before its exit completes. Its new entrance\n // must return to rest, not finish at the old gesture's release offset.\n const dialog = panel.closest(\"[data-plex-dialog]\")\n const stateObserver = dialog ? new view.MutationObserver((records) => {\n if (panel.style.getPropertyValue(DRAG_TRANSFORM) &&\n dialog.getAttribute(\"data-state\") === \"open\" &&\n records.some((record) => record.oldValue === \"closed\")) clear()\n }) : undefined\n stateObserver?.observe(dialog ?? panel, {\n attributes: true, attributeFilter: [\"data-state\"], attributeOldValue: true,\n })\n\n panel.addEventListener(\"touchstart\", onStart, { passive: true })\n panel.addEventListener(\"touchmove\", onMove, { passive: false })\n panel.addEventListener(\"touchend\", onEnd)\n panel.addEventListener(\"touchcancel\", onCancel)\n\n return () => {\n stateObserver?.disconnect()\n panel.removeEventListener(\"touchstart\", onStart)\n panel.removeEventListener(\"touchmove\", onMove)\n panel.removeEventListener(\"touchend\", onEnd)\n panel.removeEventListener(\"touchcancel\", onCancel)\n startY = null\n clear()\n }\n}\n"]}