@wow-two-beta/fe 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-Dl8CP4-K.js → DrawerContent.vue_vue_type_script_setup_true_lang-C17R6SMV.js} +41 -35
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-Dl8CP4-K.js.map → DrawerContent.vue_vue_type_script_setup_true_lang-C17R6SMV.js.map} +1 -1
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Bc3nV-BB.js → LightboxModal.vue_vue_type_script_setup_true_lang-HSUZqn0g.js} +80 -65
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Bc3nV-BB.js.map → LightboxModal.vue_vue_type_script_setup_true_lang-HSUZqn0g.js.map} +1 -1
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-DYy0asRz.js → MasonryLayout.vue_vue_type_script_setup_true_lang-CKhBN2SC.js} +2 -2
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-DYy0asRz.js.map → MasonryLayout.vue_vue_type_script_setup_true_lang-CKhBN2SC.js.map} +1 -1
- package/dist/chunks/{index-CvEjoKow.js → index-DA17sNzP.js} +99 -83
- package/dist/chunks/index-DA17sNzP.js.map +1 -0
- package/dist/foundation/themes/index.js +1 -1
- package/dist/index.js +4 -4
- package/dist/presentation/layout/index.js +1 -1
- package/dist/presentation/overlays/index.js +2 -2
- package/dist/themes.css +82 -80
- package/dist/themes.json +8 -5
- package/package.json +1 -1
- package/dist/chunks/index-CvEjoKow.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, defineComponent, shallowRef, provide, computed, renderSlot, useAttrs, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, createCommentVNode, mergeProps } from "vue";
|
|
1
|
+
import { inject, defineComponent, shallowRef, provide, computed, renderSlot, useAttrs, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, createCommentVNode, createElementVNode, withModifiers, mergeProps } from "vue";
|
|
2
2
|
import { c as cn } from "./Cn-C7De6POU.js";
|
|
3
3
|
import { s as surfaceVariants } from "./SurfaceStyles-B8KNkFsm.js";
|
|
4
4
|
import { _ as _sfc_main$4 } from "./BackdropOverlay.vue_vue_type_script_setup_true_lang-BsjQoWDM.js";
|
|
@@ -147,7 +147,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
147
147
|
return others;
|
|
148
148
|
});
|
|
149
149
|
const backdropClasses = "motion-safe:transition-opacity motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) data-[state=closed]:opacity-0";
|
|
150
|
-
|
|
150
|
+
const outsideClasses = computed(() => cn("fixed inset-0 z-modal", !isOpen.value && "pointer-events-none"));
|
|
151
|
+
function handleOutsideClick() {
|
|
151
152
|
if (context.dismissOnOutsideClick.value) context.setOpen(false);
|
|
152
153
|
}
|
|
153
154
|
function handleEscape() {
|
|
@@ -163,39 +164,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
163
164
|
"is-inline": "",
|
|
164
165
|
"is-open": unref(isOpen),
|
|
165
166
|
"is-blurred": props.isBlurred,
|
|
166
|
-
class: normalizeClass(backdropClasses)
|
|
167
|
-
onClick: handleBackdropClick
|
|
167
|
+
class: normalizeClass(backdropClasses)
|
|
168
168
|
}, null, 8, ["is-open", "is-blurred"])) : createCommentVNode("", true),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
169
|
+
createElementVNode("div", {
|
|
170
|
+
class: normalizeClass(outsideClasses.value),
|
|
171
|
+
"data-drawer-outside": "",
|
|
172
|
+
onClick: withModifiers(handleOutsideClick, ["self"])
|
|
173
|
+
}, [
|
|
174
|
+
createVNode(unref(Presence), { "is-present": unref(isOpen) }, {
|
|
175
|
+
default: withCtx(() => [
|
|
176
|
+
createVNode(unref(_sfc_main$5), {
|
|
177
|
+
"as-child": "",
|
|
178
|
+
"is-trapped": "",
|
|
179
|
+
"can-loop": "",
|
|
180
|
+
"is-modal": ""
|
|
181
|
+
}, {
|
|
182
|
+
default: withCtx(() => [
|
|
183
|
+
createVNode(unref(_sfc_main$6), mergeProps({
|
|
184
|
+
"is-escape-disabled": !unref(dismissOnEscape),
|
|
185
|
+
"is-outside-click-disabled": "",
|
|
186
|
+
"on-escape": handleEscape,
|
|
187
|
+
role: "dialog",
|
|
188
|
+
"aria-modal": "true",
|
|
189
|
+
"aria-labelledby": unref(context).titleId,
|
|
190
|
+
"aria-describedby": unref(context).descriptionId,
|
|
191
|
+
"data-side": unref(side)
|
|
192
|
+
}, rest.value, { class: classes.value }), {
|
|
193
|
+
default: withCtx(() => [
|
|
194
|
+
renderSlot(_ctx.$slots, "default")
|
|
195
|
+
]),
|
|
196
|
+
_: 3
|
|
197
|
+
}, 16, ["is-escape-disabled", "aria-labelledby", "aria-describedby", "data-side", "class"])
|
|
198
|
+
]),
|
|
199
|
+
_: 3
|
|
200
|
+
})
|
|
201
|
+
]),
|
|
202
|
+
_: 3
|
|
203
|
+
}, 8, ["is-present"])
|
|
204
|
+
], 2)
|
|
199
205
|
]),
|
|
200
206
|
_: 3
|
|
201
207
|
}, 8, ["is-enabled"])
|
|
@@ -213,4 +219,4 @@ export {
|
|
|
213
219
|
overlayChromeContextKey as o,
|
|
214
220
|
useOverlayChromeContext as u
|
|
215
221
|
};
|
|
216
|
-
//# sourceMappingURL=DrawerContent.vue_vue_type_script_setup_true_lang-
|
|
222
|
+
//# sourceMappingURL=DrawerContent.vue_vue_type_script_setup_true_lang-C17R6SMV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.vue_vue_type_script_setup_true_lang-Dl8CP4-K.js","sources":["../../src/presentation/overlays/OverlayChrome.ts","../../src/presentation/overlays/drawer/Drawer.vue","../../src/presentation/overlays/drawer/DrawerContent.vue"],"sourcesContent":["// Shared header / title / description / body / footer / close subcomponents\n// for Modal and Drawer. Co-located in `overlays/` as a domain-internal helper.\n//\n// Each consuming overlay (Modal, Drawer, BottomSheet) `provide()`s the\n// `titleId`, `descriptionId`, and a `close()` action on the key below. The\n// shared subcomponents inject it.\n//\n// Naming convention: `AnchorLayout*` for shared chrome pieces; consumers re-export\n// them under their own name (e.g. `ModalHeader = OverlayHeader`).\n//\n// React's `OverlayChromeProvider` — the context Provider rendered as an element\n// around `children` — has no counterpart here: `provide()` in the consuming\n// overlay's `setup()` covers it, because slot content is instantiated as a\n// child of the component that renders the slot, so injection resolves.\n//\n// This module is the context half of React's `OverlayChrome.tsx`; the component\n// half is one SFC per piece alongside it (Vue allows a single component per file).\n\nimport { inject, type InjectionKey } from 'vue';\n\nexport interface OverlayChromeContextValue {\n titleId: string;\n descriptionId: string;\n /** Closes the overlay and returns focus to the trigger. */\n close: () => void;\n}\n\nexport const overlayChromeContextKey: InjectionKey<OverlayChromeContextValue> = Symbol('wow-two.overlayChrome');\n\nexport function useOverlayChromeContext(): OverlayChromeContextValue {\n const context = inject(overlayChromeContextKey, null);\n if (!context)\n throw new Error('AnchorLayout chrome subcomponents must be used inside an OverlayChromeProvider (Modal / Drawer)');\n return context;\n}\n","<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Side } from '../../../foundation/styles';\n\n/**\n * The value shared with `DrawerTrigger` / `DrawerContent`.\n *\n * React's context held plain values re-created on every render; here the\n * reactive fields stay refs so a child reads the live value without the root\n * re-rendering it.\n */\nexport interface DrawerContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the focus-return target when the drawer closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n side: ComputedRef<Side>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const drawerContextKey: InjectionKey<DrawerContextValue> = Symbol('wow-two.drawer');\n\nexport function useDrawerContext(): DrawerContextValue {\n const context = inject(drawerContextKey, null);\n if (!context) throw new Error('Drawer.* must be used inside <Drawer>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface DrawerProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The edge the panel slides in from. Default `right`. */\n readonly side?: Side;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\nimport { useId } from '../../../foundation/identifiers';\n\n/**\n * Renders only its slot, owning the open state and a11y ids of the Drawer tree below it.\n * React returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Drawer', inheritAttrs: false });\n\n/** The Drawer tree — `DrawerTrigger` and `DrawerContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `open: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would strand the uncontrolled path behind a permanently-closed\n * controlled one.\n */\nconst props = withDefaults(defineProps<DrawerProps>(), {\n open: undefined,\n defaultOpen: false,\n side: 'right',\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the drawer opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('drawer-title');\nconst descriptionId = useId('drawer-description');\n\nprovide(drawerContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n side: computed(() => props.side),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport type {\n Side,\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-size token for a `DrawerContent` panel. */\nexport const DrawerSize = {\n /** Refers to the small panel size. */\n Sm: 'sm',\n /** Refers to the medium panel size. */\n Md: 'md',\n /** Refers to the large panel size. */\n Lg: 'lg',\n /** Refers to the extra-large panel size. */\n Xl: 'xl',\n /** Refers to a panel that fills its cross-axis. */\n Full: 'full',\n} as const;\n\nexport type DrawerSize = (typeof DrawerSize)[keyof typeof DrawerSize];\n\n// Full-edge slide: the panel rests at translate-0 when open and is pushed\n// fully off its own edge when closed. `transition-transform` (gated on\n// `motion-safe:`) animates both enter and exit via Presence's data-state flip.\nconst SideBase: Record<Side, string> = {\n right:\n 'inset-y-0 right-0 h-full w-full border-l ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:translate-x-full',\n left:\n 'inset-y-0 left-0 h-full w-full border-r ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:-translate-x-full',\n top:\n 'inset-x-0 top-0 w-full border-b ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:-translate-y-full',\n bottom:\n 'inset-x-0 bottom-0 w-full border-t ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:translate-y-full',\n};\n\nconst HorizontalSize: Record<DrawerSize, string> = {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-2xl',\n full: '',\n};\n\nconst VerticalSize: Record<DrawerSize, string> = {\n sm: 'max-h-[40vh]',\n md: 'max-h-[60vh]',\n lg: 'max-h-[75vh]',\n xl: 'max-h-[85vh]',\n full: 'max-h-screen',\n};\n\n/**\n * Represents the prop surface of `DrawerContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface DrawerContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The per-side max-size token. Default `md`. */\n readonly size?: DrawerSize;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `none`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. Default `3`. */\n readonly elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useDrawerContext } from './Drawer.vue';\n\n/** Renders the portalled edge panel — scrim, focus trap, scroll lock, and the sliding a11y surface. */\ndefineOptions({ name: 'DrawerContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the drawer body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<DrawerContentProps>(), {\n size: 'md',\n showBackdrop: undefined,\n hideBackdrop: undefined,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useDrawerContext();\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst side = context.side;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\nconst isHorizontal = computed(() => side.value === 'right' || side.value === 'left');\nconst sizeClass = computed(() => (isHorizontal.value ? HorizontalSize[props.size] : VerticalSize[props.size]));\n\nconst classes = computed(() =>\n cn(\n 'fixed z-modal flex flex-col gap-4 outline-hidden',\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'none',\n padding: props.padding ?? 'xl',\n elevation: props.elevation ?? 3,\n }),\n SideBase[side.value],\n sizeClass.value,\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** The scrim's fade runs in lock-step with the slide — same token duration on both. */\nconst backdropClasses =\n 'motion-safe:transition-opacity motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) data-[state=closed]:opacity-0';\n\nfunction handleBackdropClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n</script>\n\n<template>\n <!--\n React nested `Portal` + `ScrollLockProvider` *inside* the Presence-cloned\n surface and forwarded the injected `ref` past them onto the panel with\n `forwardRef`. Vue resolves a cloned `ref` through `$el`, and a Teleport /\n renderless root has no element, so the portal and the lock are hoisted above\n `Presence` and the lock now follows open state rather than mount — the shape\n React's own `ModalContent` already used. Presence's cloned child is the panel\n itself, which is what has to carry `data-state` and the slide it times against.\n -->\n <Portal>\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop); React\n mirrored the panel's `data-state` onto it by hand for the same effect. -->\n <BackdropOverlay\n v-if=\"hasBackdrop\"\n is-inline\n :is-open=\"isOpen\"\n :is-blurred=\"props.isBlurred\"\n :class=\"backdropClasses\"\n @click=\"handleBackdropClick\"\n />\n <Presence :is-present=\"isOpen\">\n <!--\n `FocusScope as-child` merges into `DismissableLayer`, whose own root div\n *is* the dialog panel — React kept the layer div and the panel div\n separate and forwarded `data-state` down to the inner one. Collapsing\n them keeps every attribute of React's panel (`role`, `aria-modal`,\n `aria-labelledby`, `aria-describedby`, `data-state`, `data-side`, the\n surface classes) on one node, which is also the node `Presence` clones\n and whose `transition-transform` end defers the unmount.\n -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-side=\"side\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","FocusScope","_mergeProps"],"mappings":";;;;;;;;;;;AA2BO,MAAM,0BAAmE,OAAO,uBAAuB;AAEvG,SAAS,0BAAqD;AACnE,QAAM,UAAU,OAAO,yBAAyB,IAAI;AACpD,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,iGAAiG;AACnH,SAAO;AACT;ACVO,MAAM,mBAAqD,OAAO,gBAAgB;AAElF,SAAS,mBAAuC;AACrD,QAAM,UAAU,OAAO,kBAAkB,IAAI;AAC7C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,uCAAuC;AACrE,SAAO;AACT;;;;;;;;;;;;;;;AA6CA,UAAM,QAAQ;AAUd,UAAM,OAAO;AAKb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAM,MAAM;AAAA,MACxB,SAAS,MAAM,MAAM;AAAA,MACrB,UAAU,CAAC,UAAU;AACnB,aAAK,eAAe,KAAK;AAAA,MAC3B;AAAA,IAAA,CACD;AAED,UAAM,YAAY,WAA+B,IAAI;AACrD,UAAM,UAAU,MAAM,cAAc;AACpC,UAAM,gBAAgB,MAAM,oBAAoB;AAEhD,YAAQ,kBAAkB;AAAA,MACxB,MAAM,WAAW;AAAA,MACjB,SAAS,WAAW;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,SAAS,MAAM,MAAM,IAAI;AAAA,MAC/B,uBAAuB,SAAS,MAAM,MAAM,4BAA4B,MAAM,yBAAyB,IAAI;AAAA,MAC3G,iBAAiB,SAAS,MAAM,MAAM,sBAAsB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B,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,wBAC1B,aAAWA,MAAA,IAAA;AAAA,sBAAA,GACJ,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,yCAEf,MAAQ;AAAA,0BAARF,WAAQ,KAAA,QAAA,SAAA;AAAA,wBAAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"DrawerContent.vue_vue_type_script_setup_true_lang-C17R6SMV.js","sources":["../../src/presentation/overlays/OverlayChrome.ts","../../src/presentation/overlays/drawer/Drawer.vue","../../src/presentation/overlays/drawer/DrawerContent.vue"],"sourcesContent":["// Shared header / title / description / body / footer / close subcomponents\n// for Modal and Drawer. Co-located in `overlays/` as a domain-internal helper.\n//\n// Each consuming overlay (Modal, Drawer, BottomSheet) `provide()`s the\n// `titleId`, `descriptionId`, and a `close()` action on the key below. The\n// shared subcomponents inject it.\n//\n// Naming convention: `AnchorLayout*` for shared chrome pieces; consumers re-export\n// them under their own name (e.g. `ModalHeader = OverlayHeader`).\n//\n// React's `OverlayChromeProvider` — the context Provider rendered as an element\n// around `children` — has no counterpart here: `provide()` in the consuming\n// overlay's `setup()` covers it, because slot content is instantiated as a\n// child of the component that renders the slot, so injection resolves.\n//\n// This module is the context half of React's `OverlayChrome.tsx`; the component\n// half is one SFC per piece alongside it (Vue allows a single component per file).\n\nimport { inject, type InjectionKey } from 'vue';\n\nexport interface OverlayChromeContextValue {\n titleId: string;\n descriptionId: string;\n /** Closes the overlay and returns focus to the trigger. */\n close: () => void;\n}\n\nexport const overlayChromeContextKey: InjectionKey<OverlayChromeContextValue> = Symbol('wow-two.overlayChrome');\n\nexport function useOverlayChromeContext(): OverlayChromeContextValue {\n const context = inject(overlayChromeContextKey, null);\n if (!context)\n throw new Error('AnchorLayout chrome subcomponents must be used inside an OverlayChromeProvider (Modal / Drawer)');\n return context;\n}\n","<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Side } from '../../../foundation/styles';\n\n/**\n * The value shared with `DrawerTrigger` / `DrawerContent`.\n *\n * React's context held plain values re-created on every render; here the\n * reactive fields stay refs so a child reads the live value without the root\n * re-rendering it.\n */\nexport interface DrawerContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the focus-return target when the drawer closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n side: ComputedRef<Side>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const drawerContextKey: InjectionKey<DrawerContextValue> = Symbol('wow-two.drawer');\n\nexport function useDrawerContext(): DrawerContextValue {\n const context = inject(drawerContextKey, null);\n if (!context) throw new Error('Drawer.* must be used inside <Drawer>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface DrawerProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The edge the panel slides in from. Default `right`. */\n readonly side?: Side;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\nimport { useId } from '../../../foundation/identifiers';\n\n/**\n * Renders only its slot, owning the open state and a11y ids of the Drawer tree below it.\n * React returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Drawer', inheritAttrs: false });\n\n/** The Drawer tree — `DrawerTrigger` and `DrawerContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `open: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would strand the uncontrolled path behind a permanently-closed\n * controlled one.\n */\nconst props = withDefaults(defineProps<DrawerProps>(), {\n open: undefined,\n defaultOpen: false,\n side: 'right',\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the drawer opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('drawer-title');\nconst descriptionId = useId('drawer-description');\n\nprovide(drawerContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n side: computed(() => props.side),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport type {\n Side,\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-size token for a `DrawerContent` panel. */\nexport const DrawerSize = {\n /** Refers to the small panel size. */\n Sm: 'sm',\n /** Refers to the medium panel size. */\n Md: 'md',\n /** Refers to the large panel size. */\n Lg: 'lg',\n /** Refers to the extra-large panel size. */\n Xl: 'xl',\n /** Refers to a panel that fills its cross-axis. */\n Full: 'full',\n} as const;\n\nexport type DrawerSize = (typeof DrawerSize)[keyof typeof DrawerSize];\n\n// Full-edge slide: the panel rests at translate-0 when open and is pushed\n// fully off its own edge when closed. `transition-transform` (gated on\n// `motion-safe:`) animates both enter and exit via Presence's data-state flip.\nconst SideBase: Record<Side, string> = {\n right:\n 'inset-y-0 right-0 h-full w-full border-l ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:translate-x-full',\n left:\n 'inset-y-0 left-0 h-full w-full border-r ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:-translate-x-full',\n top:\n 'inset-x-0 top-0 w-full border-b ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:-translate-y-full',\n bottom:\n 'inset-x-0 bottom-0 w-full border-t ' +\n 'motion-safe:transition-transform motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) ' +\n 'data-[state=closed]:translate-y-full',\n};\n\nconst HorizontalSize: Record<DrawerSize, string> = {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-2xl',\n full: '',\n};\n\nconst VerticalSize: Record<DrawerSize, string> = {\n sm: 'max-h-[40vh]',\n md: 'max-h-[60vh]',\n lg: 'max-h-[75vh]',\n xl: 'max-h-[85vh]',\n full: 'max-h-screen',\n};\n\n/**\n * Represents the prop surface of `DrawerContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface DrawerContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The per-side max-size token. Default `md`. */\n readonly size?: DrawerSize;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `none`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. Default `3`. */\n readonly elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useDrawerContext } from './Drawer.vue';\n\n/** Renders the portalled edge panel — scrim, focus trap, scroll lock, and the sliding a11y surface. */\ndefineOptions({ name: 'DrawerContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the drawer body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<DrawerContentProps>(), {\n size: 'md',\n showBackdrop: undefined,\n hideBackdrop: undefined,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useDrawerContext();\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst side = context.side;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\nconst isHorizontal = computed(() => side.value === 'right' || side.value === 'left');\nconst sizeClass = computed(() => (isHorizontal.value ? HorizontalSize[props.size] : VerticalSize[props.size]));\n\nconst classes = computed(() =>\n cn(\n 'fixed z-modal flex flex-col gap-4 outline-hidden',\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'none',\n padding: props.padding ?? 'xl',\n elevation: props.elevation ?? 3,\n }),\n SideBase[side.value],\n sizeClass.value,\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** The scrim's fade runs in lock-step with the slide — same token duration on both. */\nconst backdropClasses =\n 'motion-safe:transition-opacity motion-safe:duration-(--duration-base) motion-safe:ease-(--ease-out) data-[state=closed]:opacity-0';\n\n/**\n * The outside layer spans the window above the scrim and holds the panel. The panel's modal FocusScope marks every\n * body branch outside it inert, the scrim beside it included, so a click on the scrim reached nothing; an ancestor of\n * the panel stays live, so clicks outside the panel land on this layer. Closed, it lets every pointer through.\n */\nconst outsideClasses = computed(() => cn('fixed inset-0 z-modal', !isOpen.value && 'pointer-events-none'));\n\n/** A click on the outside layer itself (`.self`), not on the panel inside it. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n</script>\n\n<template>\n <!--\n React nested `Portal` + `ScrollLockProvider` *inside* the Presence-cloned\n surface and forwarded the injected `ref` past them onto the panel with\n `forwardRef`. Vue resolves a cloned `ref` through `$el`, and a Teleport /\n renderless root has no element, so the portal and the lock are hoisted above\n `Presence` and the lock now follows open state rather than mount — the shape\n React's own `ModalContent` already used. Presence's cloned child is the panel\n itself, which is what has to carry `data-state` and the slide it times against.\n -->\n <Portal>\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop); React\n mirrored the panel's `data-state` onto it by hand for the same effect. It is inert while the panel is up;\n the outside layer takes the clicks. -->\n <BackdropOverlay\n v-if=\"hasBackdrop\"\n is-inline\n :is-open=\"isOpen\"\n :is-blurred=\"props.isBlurred\"\n :class=\"backdropClasses\"\n />\n <div :class=\"outsideClasses\" data-drawer-outside @click.self=\"handleOutsideClick\">\n <Presence :is-present=\"isOpen\">\n <!--\n `FocusScope as-child` merges into `DismissableLayer`, whose own root div\n *is* the dialog panel — React kept the layer div and the panel div\n separate and forwarded `data-state` down to the inner one. Collapsing\n them keeps every attribute of React's panel (`role`, `aria-modal`,\n `aria-labelledby`, `aria-describedby`, `data-state`, `data-side`, the\n surface classes) on one node, which is also the node `Presence` clones\n and whose `transition-transform` end defers the unmount.\n -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-side=\"side\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </DismissableLayer>\n </FocusScope>\n </Presence>\n </div>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","_createElementVNode","FocusScope","_mergeProps"],"mappings":";;;;;;;;;;;AA2BO,MAAM,0BAAmE,OAAO,uBAAuB;AAEvG,SAAS,0BAAqD;AACnE,QAAM,UAAU,OAAO,yBAAyB,IAAI;AACpD,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,iGAAiG;AACnH,SAAO;AACT;ACVO,MAAM,mBAAqD,OAAO,gBAAgB;AAElF,SAAS,mBAAuC;AACrD,QAAM,UAAU,OAAO,kBAAkB,IAAI;AAC7C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,uCAAuC;AACrE,SAAO;AACT;;;;;;;;;;;;;;;AA6CA,UAAM,QAAQ;AAUd,UAAM,OAAO;AAKb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAM,MAAM;AAAA,MACxB,SAAS,MAAM,MAAM;AAAA,MACrB,U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gBACT,cAAY,MAAM;AAAA,gBAClB,sBAAO,eAAe;AAAA,cAAA;cAEzBK,mBA4BM,OAAA;AAAA,gBA5BA,sBAAO,eAAA,KAAc;AAAA,gBAAE,uBAAA;AAAA,gBAAqB,uBAAY,oBAAkB,CAAA,MAAA,CAAA;AAAA,cAAA;gBAC9EH,YA0BWF,MAAA,QAAA,GAAA,EA1BA,cAAYA,MAAA,MAAA,KAAM;AAAA,mCAU3B,MAea;AAAA,oBAfbE,YAeaF,MAAAM,WAAA,GAAA;AAAA,sBAfD,YAAA;AAAA,sBAAS,cAAA;AAAA,sBAAW,YAAA;AAAA,sBAAS,YAAA;AAAA,oBAAA;uCACvC,MAamB;AAAA,wBAbnBJ,YAamBF,oBAbnBO,WAamB;AAAA,0BAZhB,uBAAqBP,MAAA,eAAA;AAAA,0BACtB,6BAAA;AAAA,0BACC,aAAW;AAAA,0BACZ,MAAK;AAAA,0BACL,cAAW;AAAA,0BACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,0BACzB,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,0BAC1B,aAAWA,MAAA,IAAA;AAAA,wBAAA,GACJ,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,2CAEf,MAAQ;AAAA,4BAARF,WAAQ,KAAA,QAAA,SAAA;AAAA,0BAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { r as resolveElement } from "./ResolveElement-CyRfM82x.js";
|
|
|
3
3
|
import { O as OverlayExtensions, _ as _sfc_main$D, b as _sfc_main$E, a as _sfc_main$F, l as listboxGroupLabelVariants, c as listboxItemVariants, d as listboxEmptyVariants, e as listboxSeparatorVariants } from "./PopoverContent.vue_vue_type_script_setup_true_lang-hfb8AAVv.js";
|
|
4
4
|
import { P as Primitive } from "./Primitive-D-9ShOm7.js";
|
|
5
5
|
import { c as cn } from "./Cn-C7De6POU.js";
|
|
6
|
-
import { o as overlayChromeContextKey, u as useOverlayChromeContext, b as useDrawerContext, _ as _sfc_main$I, a as _sfc_main$J } from "./DrawerContent.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { o as overlayChromeContextKey, u as useOverlayChromeContext, b as useDrawerContext, _ as _sfc_main$I, a as _sfc_main$J } from "./DrawerContent.vue_vue_type_script_setup_true_lang-C17R6SMV.js";
|
|
7
7
|
import { _ as _sfc_main$C } from "./OverlayArrow.vue_vue_type_script_setup_true_lang-CLYhnI8i.js";
|
|
8
8
|
import { u as useLocaleDefaults } from "./UseLocaleDefaults-DnL2Ctbe.js";
|
|
9
9
|
import { u as useId } from "./UseId-CtgAhGrn.js";
|
|
@@ -1395,20 +1395,29 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1395
1395
|
return OverlayExtensions.toHtmlElement(panel.value?.$el);
|
|
1396
1396
|
}
|
|
1397
1397
|
function handlePointerDown(event) {
|
|
1398
|
+
if (event.button !== 0) return;
|
|
1398
1399
|
startY = event.clientY;
|
|
1399
1400
|
const rect = panelEl()?.getBoundingClientRect();
|
|
1400
1401
|
startHeight = rect ? rect.height : 0;
|
|
1401
|
-
|
|
1402
|
+
try {
|
|
1403
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
1404
|
+
} catch {
|
|
1405
|
+
}
|
|
1402
1406
|
}
|
|
1403
1407
|
function handlePointerMove(event) {
|
|
1404
1408
|
if (startY === null) return;
|
|
1405
1409
|
const dy = event.clientY - startY;
|
|
1406
1410
|
dragHeight.value = Math.max(0, startHeight - dy);
|
|
1407
1411
|
}
|
|
1412
|
+
function handlePointerCancel() {
|
|
1413
|
+
startY = null;
|
|
1414
|
+
dragHeight.value = null;
|
|
1415
|
+
}
|
|
1408
1416
|
function handlePointerUp(event) {
|
|
1409
1417
|
if (startY === null) return;
|
|
1410
1418
|
startY = null;
|
|
1411
|
-
event.currentTarget
|
|
1419
|
+
const handleElement = event.currentTarget;
|
|
1420
|
+
if (handleElement.hasPointerCapture?.(event.pointerId)) handleElement.releasePointerCapture(event.pointerId);
|
|
1412
1421
|
const viewport = typeof window !== "undefined" ? window.innerHeight : 800;
|
|
1413
1422
|
const heights = props.snapPoints.map((point) => resolveSnapPx(point, viewport));
|
|
1414
1423
|
const liveHeight = dragHeight.value ?? heights[currentSnap.value] ?? 0;
|
|
@@ -1449,7 +1458,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1449
1458
|
"Height {index} of {count}"
|
|
1450
1459
|
)
|
|
1451
1460
|
);
|
|
1452
|
-
function
|
|
1461
|
+
function handleOutsideClick() {
|
|
1453
1462
|
if (dismissesOnOutsideClick.value) controlled.setValue(false);
|
|
1454
1463
|
}
|
|
1455
1464
|
function handleEscape() {
|
|
@@ -1470,6 +1479,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1470
1479
|
attrs.style
|
|
1471
1480
|
])
|
|
1472
1481
|
);
|
|
1482
|
+
const outsideClasses = computed(() => cn("fixed inset-0 z-modal", !resolvedOpen.value && "pointer-events-none"));
|
|
1473
1483
|
const classes = computed(
|
|
1474
1484
|
() => cn(
|
|
1475
1485
|
"fixed inset-x-0 bottom-0 z-modal flex flex-col rounded-t-xl border-t outline-hidden",
|
|
@@ -1499,67 +1509,72 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1499
1509
|
default: withCtx(() => [
|
|
1500
1510
|
createVNode(_sfc_main$z, {
|
|
1501
1511
|
"is-inline": "",
|
|
1502
|
-
"is-open": unref(resolvedOpen)
|
|
1503
|
-
onClick: handleBackdropClick
|
|
1512
|
+
"is-open": unref(resolvedOpen)
|
|
1504
1513
|
}, null, 8, ["is-open"]),
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
"
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1514
|
+
createElementVNode("div", {
|
|
1515
|
+
class: normalizeClass(outsideClasses.value),
|
|
1516
|
+
"data-bottom-sheet-outside": "",
|
|
1517
|
+
onClick: withModifiers(handleOutsideClick, ["self"])
|
|
1518
|
+
}, [
|
|
1519
|
+
createVNode(unref(Presence), { "is-present": unref(resolvedOpen) }, {
|
|
1520
|
+
default: withCtx(() => [
|
|
1521
|
+
createVNode(unref(_sfc_main$A), {
|
|
1522
|
+
"as-child": "",
|
|
1523
|
+
"is-trapped": "",
|
|
1524
|
+
"can-loop": "",
|
|
1525
|
+
"is-modal": "",
|
|
1526
|
+
"on-mount-auto-focus": handleMountAutoFocus
|
|
1527
|
+
}, {
|
|
1528
|
+
default: withCtx(() => [
|
|
1529
|
+
createVNode(unref(_sfc_main$B), mergeProps({
|
|
1530
|
+
ref_key: "panel",
|
|
1531
|
+
ref: panel,
|
|
1532
|
+
"is-escape-disabled": !dismissesOnEscape.value,
|
|
1533
|
+
"is-outside-click-disabled": "",
|
|
1534
|
+
"on-escape": handleEscape,
|
|
1535
|
+
role: "dialog",
|
|
1536
|
+
"aria-modal": "true",
|
|
1537
|
+
"aria-labelledby": unref(titleId),
|
|
1538
|
+
"aria-describedby": unref(descriptionId),
|
|
1539
|
+
style: panelStyle.value
|
|
1540
|
+
}, rest.value, { class: classes.value }), {
|
|
1541
|
+
default: withCtx(() => [
|
|
1542
|
+
createElementVNode("div", {
|
|
1543
|
+
ref_key: "handle",
|
|
1544
|
+
ref: handle,
|
|
1545
|
+
role: "separator",
|
|
1546
|
+
"aria-orientation": "horizontal",
|
|
1547
|
+
"aria-valuenow": currentSnap.value,
|
|
1548
|
+
"aria-valuemin": 0,
|
|
1549
|
+
"aria-valuemax": props.snapPoints.length - 1,
|
|
1550
|
+
"aria-valuetext": handleValueText.value,
|
|
1551
|
+
"aria-label": unref(locale).t("BottomSheet.resize", void 0, "Resize sheet"),
|
|
1552
|
+
tabindex: "0",
|
|
1553
|
+
class: "flex h-7 cursor-ns-resize touch-none items-center justify-center focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
1554
|
+
onPointerdown: handlePointerDown,
|
|
1555
|
+
onPointermove: handlePointerMove,
|
|
1556
|
+
onPointerup: handlePointerUp,
|
|
1557
|
+
onPointercancel: handlePointerCancel,
|
|
1558
|
+
onKeydown: handleKeyDown
|
|
1559
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
1560
|
+
createElementVNode("span", {
|
|
1561
|
+
class: "h-1 w-10 rounded-full bg-border-strong",
|
|
1562
|
+
"aria-hidden": "true"
|
|
1563
|
+
}, null, -1)
|
|
1564
|
+
])], 40, _hoisted_1$5),
|
|
1565
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
1566
|
+
renderSlot(_ctx.$slots, "default")
|
|
1567
|
+
])
|
|
1568
|
+
]),
|
|
1569
|
+
_: 3
|
|
1570
|
+
}, 16, ["is-escape-disabled", "aria-labelledby", "aria-describedby", "style", "class"])
|
|
1571
|
+
]),
|
|
1572
|
+
_: 3
|
|
1573
|
+
})
|
|
1574
|
+
]),
|
|
1575
|
+
_: 3
|
|
1576
|
+
}, 8, ["is-present"])
|
|
1577
|
+
], 2)
|
|
1563
1578
|
]),
|
|
1564
1579
|
_: 3
|
|
1565
1580
|
}, 8, ["is-enabled"])
|
|
@@ -2253,4 +2268,4 @@ export {
|
|
|
2253
2268
|
_sfc_main$v as y,
|
|
2254
2269
|
_sfc_main$j as z
|
|
2255
2270
|
};
|
|
2256
|
-
//# sourceMappingURL=LightboxModal.vue_vue_type_script_setup_true_lang-
|
|
2271
|
+
//# sourceMappingURL=LightboxModal.vue_vue_type_script_setup_true_lang-HSUZqn0g.js.map
|