@wow-two-beta/ui-vue 0.0.4 → 0.0.5
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/{BackToTopButton.vue_vue_type_script_setup_true_lang-CkxLllEO.js → BackToTopButton.vue_vue_type_script_setup_true_lang-iLYlhK05.js} +11 -5
- package/dist/chunks/BackToTopButton.vue_vue_type_script_setup_true_lang-iLYlhK05.js.map +1 -0
- package/dist/chunks/{Backdrop.vue_vue_type_script_setup_true_lang-DZUhGY9p.js → Backdrop.vue_vue_type_script_setup_true_lang-CKG--_g8.js} +2 -2
- package/dist/chunks/{Backdrop.vue_vue_type_script_setup_true_lang-DZUhGY9p.js.map → Backdrop.vue_vue_type_script_setup_true_lang-CKG--_g8.js.map} +1 -1
- package/dist/chunks/{BottomSheet.vue_vue_type_script_setup_true_lang-CmNoI4BE.js → BottomSheet.vue_vue_type_script_setup_true_lang-CmNaGird.js} +8 -8
- package/dist/chunks/{BottomSheet.vue_vue_type_script_setup_true_lang-CmNoI4BE.js.map → BottomSheet.vue_vue_type_script_setup_true_lang-CmNaGird.js.map} +1 -1
- package/dist/chunks/{ChatComposer.vue_vue_type_script_setup_true_lang-lNcRhKIv.js → ChatComposer.vue_vue_type_script_setup_true_lang-DfeVsj9h.js} +1024 -579
- package/dist/chunks/ChatComposer.vue_vue_type_script_setup_true_lang-DfeVsj9h.js.map +1 -0
- package/dist/chunks/{DateExtensions-QahSUlRy.js → DateExtensions-C6a-h8ji.js} +12 -22
- package/dist/chunks/{DateExtensions-QahSUlRy.js.map → DateExtensions-C6a-h8ji.js.map} +1 -1
- package/dist/chunks/{DismissableLayer.vue_vue_type_script_setup_true_lang-6nRnzsJW.js → DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js} +3 -3
- package/dist/chunks/DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js.map +1 -0
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-DvvrJdF0.js → DrawerContent.vue_vue_type_script_setup_true_lang-4n5w3lg2.js} +5 -5
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-DvvrJdF0.js.map → DrawerContent.vue_vue_type_script_setup_true_lang-4n5w3lg2.js.map} +1 -1
- package/dist/chunks/{ModalContent.vue_vue_type_script_setup_true_lang-CLACSqKg.js → ModalContent.vue_vue_type_script_setup_true_lang-Co5jaeXk.js} +5 -5
- package/dist/chunks/{ModalContent.vue_vue_type_script_setup_true_lang-CLACSqKg.js.map → ModalContent.vue_vue_type_script_setup_true_lang-Co5jaeXk.js.map} +1 -1
- package/dist/chunks/{Navbar.vue_vue_type_script_setup_true_lang-Cl2ejukE.js → Navbar.vue_vue_type_script_setup_true_lang-Cy0zvm5d.js} +7 -7
- package/dist/chunks/Navbar.vue_vue_type_script_setup_true_lang-Cy0zvm5d.js.map +1 -0
- package/dist/chunks/{NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js → NotificationItem.vue_vue_type_script_setup_true_lang-DySfo3fD.js} +5 -5
- package/dist/chunks/{NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js.map → NotificationItem.vue_vue_type_script_setup_true_lang-DySfo3fD.js.map} +1 -1
- package/dist/chunks/{OptionTileGroup.vue_vue_type_script_setup_true_lang-BGSmXM_u.js → OptionTileGroup.vue_vue_type_script_setup_true_lang-CKSVGCby.js} +51 -30
- package/dist/chunks/OptionTileGroup.vue_vue_type_script_setup_true_lang-CKSVGCby.js.map +1 -0
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-D-OiGICS.js → PopoverContent.vue_vue_type_script_setup_true_lang-DYd617X5.js} +4 -4
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-D-OiGICS.js.map → PopoverContent.vue_vue_type_script_setup_true_lang-DYd617X5.js.map} +1 -1
- package/dist/chunks/{Presence-C7IJvh_P.js → Presence-DE4MlrJz.js} +45 -27
- package/dist/chunks/Presence-DE4MlrJz.js.map +1 -0
- package/dist/chunks/{SortableHandle.vue_vue_type_script_setup_true_lang-CWCXGjZG.js → SortableHandle.vue_vue_type_script_setup_true_lang-8WPwGZ5e.js} +141 -130
- package/dist/chunks/SortableHandle.vue_vue_type_script_setup_true_lang-8WPwGZ5e.js.map +1 -0
- package/dist/chunks/{SurfaceStyles-ChdpGRBO.js → SurfaceStyles-B6W7zdMi.js} +2 -2
- package/dist/chunks/{SurfaceStyles-ChdpGRBO.js.map → SurfaceStyles-B6W7zdMi.js.map} +1 -1
- package/dist/chunks/{TableOfContents.vue_vue_type_script_setup_true_lang-HVL4lg_f.js → TableOfContents.vue_vue_type_script_setup_true_lang-C9eM0AoG.js} +18 -20
- package/dist/chunks/TableOfContents.vue_vue_type_script_setup_true_lang-C9eM0AoG.js.map +1 -0
- package/dist/chunks/{Tones-CI65uuq9.js → Tones-WKBNZ_u2.js} +39 -17
- package/dist/chunks/Tones-WKBNZ_u2.js.map +1 -0
- package/dist/chunks/{index-BD7H9CkO.js → index-CEoYQiWL.js} +3 -3
- package/dist/chunks/{index-BD7H9CkO.js.map → index-CEoYQiWL.js.map} +1 -1
- package/dist/chunks/{index-Cbydgcdk.js → index-op-kbVUk.js} +3 -3
- package/dist/chunks/{index-Cbydgcdk.js.map → index-op-kbVUk.js.map} +1 -1
- package/dist/foundation/primitives/index.js +3 -3
- package/dist/foundation/primitives/presence/Presence.d.ts +4 -0
- package/dist/foundation/utils/index.js +3 -3
- package/dist/index.js +111 -109
- package/dist/presentation/actions/index.js +2 -2
- package/dist/presentation/actions/speedDial/SpeedDialAction.vue.d.ts +6 -5
- package/dist/presentation/actions/speedDial/index.d.ts +3 -5
- package/dist/presentation/display/audioWaveform/AudioWaveform.vue.d.ts +1 -0
- package/dist/presentation/display/diffViewer/DiffViewer.vue.d.ts +2 -0
- package/dist/presentation/display/eventCalendar/EventCalendar.vue.d.ts +1 -0
- package/dist/presentation/display/frameGlyph/FrameGlyph.vue.d.ts +2 -0
- package/dist/presentation/display/gantt/Gantt.vue.d.ts +1 -0
- package/dist/presentation/display/heatmapCalendar/HeatmapCalendar.vue.d.ts +1 -0
- package/dist/presentation/display/index.js +98 -96
- package/dist/presentation/display/list/ListContext.d.ts +16 -0
- package/dist/presentation/display/list/ListItem.vue.d.ts +7 -1
- package/dist/presentation/display/list/index.d.ts +1 -0
- package/dist/presentation/display/metricChip/MetricChip.vue.d.ts +1 -1
- package/dist/presentation/display/moduleGlyphs/CellsGlyph.vue.d.ts +1 -0
- package/dist/presentation/display/radiusGlyph/RadiusGlyph.vue.d.ts +1 -0
- package/dist/presentation/display/reactionBar/ReactionBar.vue.d.ts +1 -0
- package/dist/presentation/feedback/index.js +1 -1
- package/dist/presentation/feedback/tour/Tour.vue.d.ts +1 -0
- package/dist/presentation/forms/TimeColumns.vue.d.ts +22 -0
- package/dist/presentation/forms/dateField/DateField.vue.d.ts +12 -0
- package/dist/presentation/forms/dateTimeField/DateTimeField.vue.d.ts +17 -0
- package/dist/presentation/forms/index.js +2 -2
- package/dist/presentation/forms/multiSelect/MultiSelect.vue.d.ts +8 -0
- package/dist/presentation/forms/multiSelect/MultiSelectContext.d.ts +9 -0
- package/dist/presentation/forms/multiSelect/MultiSelectTags.vue.d.ts +10 -0
- package/dist/presentation/forms/multiSelect/MultiSelectTrigger.vue.d.ts +5 -0
- package/dist/presentation/forms/timeField/TimeField.vue.d.ts +20 -5
- package/dist/presentation/forms/timePicker/TimePicker.vue.d.ts +5 -5
- package/dist/presentation/layout/index.js +1 -1
- package/dist/presentation/nav/index.js +1 -1
- package/dist/presentation/overlays/index.js +5 -5
- package/package.json +3 -2
- package/dist/chunks/BackToTopButton.vue_vue_type_script_setup_true_lang-CkxLllEO.js.map +0 -1
- package/dist/chunks/ChatComposer.vue_vue_type_script_setup_true_lang-lNcRhKIv.js.map +0 -1
- package/dist/chunks/DismissableLayer.vue_vue_type_script_setup_true_lang-6nRnzsJW.js.map +0 -1
- package/dist/chunks/Navbar.vue_vue_type_script_setup_true_lang-Cl2ejukE.js.map +0 -1
- package/dist/chunks/OptionTileGroup.vue_vue_type_script_setup_true_lang-BGSmXM_u.js.map +0 -1
- package/dist/chunks/Presence-C7IJvh_P.js.map +0 -1
- package/dist/chunks/SortableHandle.vue_vue_type_script_setup_true_lang-CWCXGjZG.js.map +0 -1
- package/dist/chunks/TableOfContents.vue_vue_type_script_setup_true_lang-HVL4lg_f.js.map +0 -1
- package/dist/chunks/Tones-CI65uuq9.js.map +0 -1
|
@@ -176,15 +176,6 @@ function formatISOTime(t) {
|
|
|
176
176
|
if (!t) return "";
|
|
177
177
|
return t.toString({ smallestUnit: "minute" });
|
|
178
178
|
}
|
|
179
|
-
function parseISOTime(s) {
|
|
180
|
-
if (!s) return null;
|
|
181
|
-
if (!/^\d{2}:\d{2}$/.test(s)) return null;
|
|
182
|
-
try {
|
|
183
|
-
return Temporal.PlainTime.from(s, { overflow: "reject" });
|
|
184
|
-
} catch {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
179
|
function formatISODateTime(dt) {
|
|
189
180
|
if (!dt) return "";
|
|
190
181
|
return dt.toString({ smallestUnit: "minute" });
|
|
@@ -245,9 +236,8 @@ function formatZonedTime(z) {
|
|
|
245
236
|
return z.toLocaleString(void 0, { hour: "2-digit", minute: "2-digit" });
|
|
246
237
|
}
|
|
247
238
|
export {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
minZoned as C,
|
|
239
|
+
maxZoned as A,
|
|
240
|
+
minZoned as B,
|
|
251
241
|
MONTHS_LONG as M,
|
|
252
242
|
TagVariant as T,
|
|
253
243
|
WEEKDAYS_SHORT as W,
|
|
@@ -265,18 +255,18 @@ export {
|
|
|
265
255
|
formatISODateTime as k,
|
|
266
256
|
parseISODateTime as l,
|
|
267
257
|
formatISOTime as m,
|
|
268
|
-
|
|
269
|
-
|
|
258
|
+
isInRange as n,
|
|
259
|
+
daysInMonth as o,
|
|
270
260
|
parseISODate as p,
|
|
271
|
-
|
|
272
|
-
|
|
261
|
+
nowZoned as q,
|
|
262
|
+
formatZonedTime as r,
|
|
273
263
|
sundayIndex as s,
|
|
274
264
|
tagVariants as t,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
265
|
+
minutesBetween as u,
|
|
266
|
+
daysBetween as v,
|
|
267
|
+
isWeekend as w,
|
|
268
|
+
isZonedDayInRange as x,
|
|
269
|
+
isZonedOnDay as y,
|
|
280
270
|
zonedAtHour as z
|
|
281
271
|
};
|
|
282
|
-
//# sourceMappingURL=DateExtensions-
|
|
272
|
+
//# sourceMappingURL=DateExtensions-C6a-h8ji.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateExtensions-QahSUlRy.js","sources":["../../src/presentation/display/kbd/Kbd.vue","../../src/presentation/display/tag/Tag.variants.ts","../../src/presentation/display/tag/Tag.vue","../../src/presentation/forms/DateExtensions.ts"],"sourcesContent":["<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\n\nexport type KbdProps = HTMLAttributes;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn } from '../../../foundation/utils';\n\n/**\n * Keyboard key affordance — `<kbd>` styled with subtle border and inset\n * shadow. Single key per `<Kbd>`; chain via `<Kbd>⌘</Kbd> + <Kbd>K</Kbd>`.\n */\ndefineOptions({ name: 'Kbd', inheritAttrs: false });\n\n/** The key glyph — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLElement>('el');\n\nconst classes = computed(() =>\n cn(\n 'inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border',\n 'bg-muted px-1.5 font-mono text-xs text-muted-foreground shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.05)]',\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\ndefineExpose({ el });\n</script>\n\n<template>\n <kbd ref=\"el\" v-bind=\"rest\" :class=\"classes\"><slot /></kbd>\n</template>\n","import { tv, type VariantProps } from '../../../foundation/utils';\n\n/** Defines the Tag color treatment. */\nexport const TagVariant = {\n /** Refers to the neutral bordered chip. */\n Neutral: 'neutral',\n /** Refers to the primary brand tint. */\n Brand: 'brand',\n /** Refers to the positive / confirmation tint. */\n Success: 'success',\n /** Refers to the caution tint. */\n Warning: 'warning',\n /** Refers to the destructive / error tint. */\n Danger: 'danger',\n /** Refers to the informational tint. */\n Info: 'info',\n} as const;\n\nexport type TagVariant = (typeof TagVariant)[keyof typeof TagVariant];\n\nexport const tagVariants = tv({\n base: 'inline-flex items-center gap-1 rounded-md border border-border bg-card px-2 py-0.5 text-xs font-medium text-card-foreground',\n variants: {\n variant: {\n neutral: '',\n brand: 'border-transparent bg-primary-soft text-primary-soft-foreground',\n success: 'border-transparent bg-success-soft text-success-soft-foreground',\n warning: 'border-transparent bg-warning-soft text-warning-soft-foreground',\n danger: 'border-transparent bg-destructive-soft text-destructive-soft-foreground',\n info: 'border-transparent bg-info-soft text-info-soft-foreground',\n },\n },\n defaultVariants: {\n variant: 'neutral',\n },\n});\n\nexport type TagVariants = VariantProps<typeof tagVariants>;\n\n/* Compile-time lock: enum values ≡ tv variant value-set (drift = type error). */\ntype AssertExact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;\nconst _assertTagVariant: AssertExact<\n TagVariant,\n NonNullable<VariantProps<typeof tagVariants>['variant']>\n> = true;\nvoid _assertTagVariant;\n","<script lang=\"ts\">\nimport type { TagVariant } from './Tag.variants';\n\nexport interface TagProps {\n /** The color treatment. */\n variant?: TagVariant;\n\n /** The accessible label for the close button. Default `\"Remove\"`. */\n closeLabel?: string;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, useAttrs, useTemplateRef } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport { cn } from '../../../foundation/utils';\nimport { Icon } from '../../../foundation/icons';\nimport { tagVariants } from './Tag.variants';\n\nconst CloseIcon = X;\n\n/**\n * Pill with an optional close button. The close button is a raw `<button>`\n * to keep the strict atom rule (Tag is L3, so importing Button would make\n * this an atom-on-atom composition).\n */\ndefineOptions({ name: 'Tag', inheritAttrs: false });\n\n/** The tag copy — React's optional `children`. */\ndefineSlots<{ default?(): unknown }>();\n\nconst props = withDefaults(defineProps<TagProps>(), { closeLabel: 'Remove' });\n\n/** Replaces React's `onClose`; omitting `@close` omits the close button. */\nconst emit = defineEmits<{\n /** Fires when the close (×) button is clicked. */\n close: [];\n}>();\n\nconst attrs = useAttrs();\nconst instance = getCurrentInstance();\nconst el = useTemplateRef<HTMLSpanElement>('el');\n\n/**\n * Mirrors React's `onClose && <button/>` guard — the close button renders only\n * when the consumer bound `@close`. Read through a call, not a cached computed:\n * `instance.vnode` is replaced on every re-render.\n */\nconst hasClose = () => Boolean(instance?.vnode.props?.onClose);\n\nconst classes = computed(() =>\n cn(tagVariants({ variant: props.variant }), attrs.class as string | undefined),\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\ndefineExpose({ el });\n</script>\n\n<template>\n <span ref=\"el\" v-bind=\"rest\" :class=\"classes\">\n <slot />\n <button\n v-if=\"hasClose()\"\n type=\"button\"\n :aria-label=\"props.closeLabel\"\n class=\"-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('close')\"\n >\n <Icon :icon=\"CloseIcon\" :size=\"12\" />\n </button>\n </span>\n</template>\n","// Shared date helpers for Calendar / DatePicker / DateField / RangeCalendar.\n// Co-located in `forms/` so imports stay within-domain.\n//\n// Temporal-based — the ecosystem standardizes on the Temporal API (dates =\n// `Temporal.*`). `Temporal.PlainDate` carries calendar math (no timezone), so\n// these helpers are inherently local/wall-clock, which is what calendar UIs want.\n// `Temporal.PlainTime` carries hour/minute for the time components.\n\nimport { Temporal } from 'temporal-polyfill';\n\nexport const WEEKDAYS_SHORT = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];\nexport const MONTHS_LONG = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\n/** Sunday-anchored column index (0 = Sun … 6 = Sat) for a PlainDate. */\nexport function sundayIndex(d: Temporal.PlainDate): number {\n // Temporal `dayOfWeek` is 1 (Mon) … 7 (Sun); map Sunday to 0 for our Su-first grid.\n return d.dayOfWeek % 7;\n}\n\n/** Today as a PlainDate in the local time zone. */\nexport function today(): Temporal.PlainDate {\n return Temporal.Now.plainDateISO();\n}\n\nexport function isSameDay(\n a: Temporal.PlainDate | null | undefined,\n b: Temporal.PlainDate | null | undefined,\n): boolean {\n if (!a || !b) return false;\n return a.equals(b);\n}\n\nexport function isToday(d: Temporal.PlainDate): boolean {\n return d.equals(today());\n}\n\n/** Add `n` months; Temporal clamps to the target month's last day (Jan 31 +1 → Feb 28). */\nexport function addMonths(d: Temporal.PlainDate, n: number): Temporal.PlainDate {\n return d.add({ months: n });\n}\n\nexport function addDays(d: Temporal.PlainDate, n: number): Temporal.PlainDate {\n return d.add({ days: n });\n}\n\n/** First day of `d`'s month. */\nexport function startOfMonth(d: Temporal.PlainDate): Temporal.PlainDate {\n return d.with({ day: 1 });\n}\n\n/** Number of days in the given year/month (1-indexed month). */\nexport function daysInMonth(year: number, month: number): number {\n return Temporal.PlainDate.from({ year, month, day: 1 }).daysInMonth;\n}\n\n/**\n * Build the 6-week (42-cell) grid that the calendar UI renders.\n * `year`/`month` are 1-indexed (Temporal convention). Cells outside the target\n * month carry `outOfMonth: true`.\n */\nexport function buildMonthGrid(\n year: number,\n month: number,\n): { date: Temporal.PlainDate; outOfMonth: boolean }[] {\n const first = Temporal.PlainDate.from({ year, month, day: 1 });\n const start = first.subtract({ days: sundayIndex(first) });\n const cells: { date: Temporal.PlainDate; outOfMonth: boolean }[] = [];\n for (let i = 0; i < 42; i++) {\n const date = start.add({ days: i });\n cells.push({ date, outOfMonth: date.month !== month });\n }\n return cells;\n}\n\n/** Format PlainDate → \"YYYY-MM-DD\" for a native `<input type=\"date\">` value. */\nexport function formatISODate(d: Temporal.PlainDate | null | undefined): string {\n if (!d) return '';\n return d.toString();\n}\n\n/** Parse \"YYYY-MM-DD\" → PlainDate. Returns null for invalid input. */\nexport function parseISODate(s: string | null | undefined): Temporal.PlainDate | null {\n if (!s) return null;\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(s)) return null;\n try {\n return Temporal.PlainDate.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\n/** Format PlainTime → \"HH:MM\" for a native `<input type=\"time\">` value. */\nexport function formatISOTime(t: Temporal.PlainTime | null | undefined): string {\n if (!t) return '';\n return t.toString({ smallestUnit: 'minute' });\n}\n\n/** Parse \"HH:MM\" → PlainTime. Returns null for invalid input. */\nexport function parseISOTime(s: string | null | undefined): Temporal.PlainTime | null {\n if (!s) return null;\n if (!/^\\d{2}:\\d{2}$/.test(s)) return null;\n try {\n return Temporal.PlainTime.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\n/** Format PlainDateTime → \"YYYY-MM-DDTHH:MM\" for a native `<input type=\"datetime-local\">` value. */\nexport function formatISODateTime(dt: Temporal.PlainDateTime | null | undefined): string {\n if (!dt) return '';\n return dt.toString({ smallestUnit: 'minute' });\n}\n\n/** Parse \"YYYY-MM-DDTHH:MM\" (seconds optional) → PlainDateTime. Returns null for invalid input. */\nexport function parseISODateTime(s: string | null | undefined): Temporal.PlainDateTime | null {\n if (!s) return null;\n if (!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?$/.test(s)) return null;\n try {\n return Temporal.PlainDateTime.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\nexport function clampDate(\n d: Temporal.PlainDate,\n min?: Temporal.PlainDate | null,\n max?: Temporal.PlainDate | null,\n): Temporal.PlainDate {\n if (min && Temporal.PlainDate.compare(d, min) < 0) return min;\n if (max && Temporal.PlainDate.compare(d, max) > 0) return max;\n return d;\n}\n\nexport function isDateDisabled(\n d: Temporal.PlainDate,\n options: {\n min?: Temporal.PlainDate | null;\n max?: Temporal.PlainDate | null;\n isDisabled?: (d: Temporal.PlainDate) => boolean;\n },\n): boolean {\n const { min, max, isDisabled } = options;\n if (min && Temporal.PlainDate.compare(d, min) < 0) return true;\n if (max && Temporal.PlainDate.compare(d, max) > 0) return true;\n if (isDisabled?.(d)) return true;\n return false;\n}\n\nexport function isInRange(\n d: Temporal.PlainDate,\n start: Temporal.PlainDate | null | undefined,\n end: Temporal.PlainDate | null | undefined,\n): boolean {\n if (!start || !end) return false;\n const lo = Temporal.PlainDate.compare(start, end) <= 0 ? start : end;\n const hi = Temporal.PlainDate.compare(start, end) <= 0 ? end : start;\n return Temporal.PlainDate.compare(d, lo) >= 0 && Temporal.PlainDate.compare(d, hi) <= 0;\n}\n\n/** Signed whole-day count from `a` to `b` (positive when `b` is later). */\nexport function daysBetween(a: Temporal.PlainDate, b: Temporal.PlainDate): number {\n return a.until(b, { largestUnit: 'day' }).days;\n}\n\n/** True when `d` falls on a Saturday or Sunday. */\nexport function isWeekend(d: Temporal.PlainDate): boolean {\n // Temporal `dayOfWeek`: 1 (Mon) … 7 (Sun); 6 = Sat, 7 = Sun.\n return d.dayOfWeek === 6 || d.dayOfWeek === 7;\n}\n\n// ── Datetime helpers (ZonedDateTime) ──────────────────────────────────────\n// EventCalendar / ScheduleView model absolute instants (a wall-clock time in a\n// specific zone) — the `Temporal.ZonedDateTime` peer of .NET `DateTimeOffset`.\n// The grid + navigation still project down to `Temporal.PlainDate` (via the\n// helpers above); these cover the intra-day time-slot math the grid needs.\n\n/** Now as a ZonedDateTime in the local (system) time zone. */\nexport function nowZoned(): Temporal.ZonedDateTime {\n return Temporal.Now.zonedDateTimeISO();\n}\n\n/** The calendar day a ZonedDateTime falls on (its wall-clock PlainDate). */\nexport function zonedToPlainDate(z: Temporal.ZonedDateTime): Temporal.PlainDate {\n return z.toPlainDate();\n}\n\n/** True when two ZonedDateTimes land on the same wall-clock day (same zone assumed). */\nexport function isSameZonedDay(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): boolean {\n return a.toPlainDate().equals(b.toPlainDate());\n}\n\n/** True when a ZonedDateTime falls on `day` (its wall-clock date equals `day`). */\nexport function isZonedOnDay(z: Temporal.ZonedDateTime, day: Temporal.PlainDate): boolean {\n return z.toPlainDate().equals(day);\n}\n\n/** Start-of-day (00:00, zone-correct) for `day` in `z`'s time zone. */\nexport function startOfZonedDay(day: Temporal.PlainDate, timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime {\n return day.toZonedDateTime({ timeZone, plainTime: Temporal.PlainTime.from('00:00') });\n}\n\n/** `day` at hour `hour` (minutes/seconds zeroed), zone-correct, in `timeZone`. */\nexport function zonedAtHour(\n day: Temporal.PlainDate,\n hour: number,\n timeZone: Temporal.TimeZoneLike,\n): Temporal.ZonedDateTime {\n return day.toZonedDateTime({\n timeZone,\n plainTime: new Temporal.PlainTime(hour),\n });\n}\n\n/** Signed minutes from `a` to `b` (positive when `b` is later). */\nexport function minutesBetween(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): number {\n return a.until(b, { largestUnit: 'minute', smallestUnit: 'minute' }).minutes;\n}\n\n/** Later of two instants. */\nexport function maxZoned(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): Temporal.ZonedDateTime {\n return Temporal.ZonedDateTime.compare(a, b) >= 0 ? a : b;\n}\n\n/** Earlier of two instants. */\nexport function minZoned(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): Temporal.ZonedDateTime {\n return Temporal.ZonedDateTime.compare(a, b) <= 0 ? a : b;\n}\n\n/** True when `z`'s calendar day lies within [start, end] (inclusive, by day). */\nexport function isZonedDayInRange(\n z: Temporal.ZonedDateTime,\n start: Temporal.ZonedDateTime,\n end: Temporal.ZonedDateTime,\n): boolean {\n return isInRange(z.toPlainDate(), start.toPlainDate(), end.toPlainDate());\n}\n\n/** Format a ZonedDateTime's time-of-day as \"HH:MM\" (locale-aware). */\nexport function formatZonedTime(z: Temporal.ZonedDateTime): string {\n return z.toLocaleString(undefined, { hour: '2-digit', minute: '2-digit' });\n}\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot","_createVNode","_unref","Icon"],"mappings":";;;;;;;;;;AAmBA,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA4B,IAAI;AAE3C,UAAM,UAAU;AAAA,MAAS,MACvB;AAAA,QACE;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MAAA;AAAA,IACR;AAIF,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,mBAA2D,OAA3DC,WAA2D;AAAA,iBAAlD;AAAA,QAAJ,KAAI;AAAA,MAAA,GAAa,KAAA,OAAI,EAAG,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,QAAEC,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;ACrChD,MAAM,aAAa;AAAA;AAAA,EAExB,SAAS;AAAA;AAAA,EAET,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA;AAAA,EAET,SAAS;AAAA;AAAA,EAET,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAIO,MAAM,cAAc,GAAG;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EACR;AAAA,EAEF,iB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AAE,MAAM,GAAG,EAAE,aAAa,MAAA,CAAO,EAAE;AAC5C;AAGO,SAAS,UAAU,GAAgC;AAExD,SAAO,EAAE,cAAc,KAAK,EAAE,cAAc;AAC9C;AASO,SAAS,WAAmC;AACjD,SAAO,SAAS,IAAI,iBAAA;AACtB;AAaO,SAAS,aAAa,GAA2B,KAAkC;AACxF,SAAO,EAAE,cAAc,OAAO,GAAG;AACnC;AAQO,SAAS,YACd,KACA,MACA,UACwB;AACxB,SAAO,IAAI,gBAAgB;AAAA,IACzB;AAAA,IACA,WAAW,IAAI,SAAS,UAAU,IAAI;AAAA,EAAA,CACvC;AACH;AAGO,SAAS,eAAe,GAA2B,GAAmC;AAC3F,SAAO,EAAE,MAAM,GAAG,EAAE,aAAa,UAAU,cAAc,SAAA,CAAU,EAAE;AACvE;AAGO,SAAS,SAAS,GAA2B,GAAmD;AACrG,SAAO,SAAS,cAAc,QAAQ,GAAG,CAAC,KAAK,IAAI,IAAI;AACzD;AAGO,SAAS,SAAS,GAA2B,GAAmD;AACrG,SAAO,SAAS,cAAc,QAAQ,GAAG,CAAC,KAAK,IAAI,IAAI;AACzD;AAGO,SAAS,kBACd,GACA,OACA,KACS;AACT,SAAO,UAAU,EAAE,YAAA,GAAe,MAAM,YAAA,GAAe,IAAI,aAAa;AAC1E;AAGO,SAAS,gBAAgB,GAAmC;AACjE,SAAO,EAAE,eAAe,QAAW,EAAE,MAAM,WAAW,QAAQ,WAAW;AAC3E;"}
|
|
1
|
+
{"version":3,"file":"DateExtensions-C6a-h8ji.js","sources":["../../src/presentation/display/kbd/Kbd.vue","../../src/presentation/display/tag/Tag.variants.ts","../../src/presentation/display/tag/Tag.vue","../../src/presentation/forms/DateExtensions.ts"],"sourcesContent":["<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\n\nexport type KbdProps = HTMLAttributes;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn } from '../../../foundation/utils';\n\n/**\n * Keyboard key affordance — `<kbd>` styled with subtle border and inset\n * shadow. Single key per `<Kbd>`; chain via `<Kbd>⌘</Kbd> + <Kbd>K</Kbd>`.\n */\ndefineOptions({ name: 'Kbd', inheritAttrs: false });\n\n/** The key glyph — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLElement>('el');\n\nconst classes = computed(() =>\n cn(\n 'inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border',\n 'bg-muted px-1.5 font-mono text-xs text-muted-foreground shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.05)]',\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\ndefineExpose({ el });\n</script>\n\n<template>\n <kbd ref=\"el\" v-bind=\"rest\" :class=\"classes\"><slot /></kbd>\n</template>\n","import { tv, type VariantProps } from '../../../foundation/utils';\n\n/** Defines the Tag color treatment. */\nexport const TagVariant = {\n /** Refers to the neutral bordered chip. */\n Neutral: 'neutral',\n /** Refers to the primary brand tint. */\n Brand: 'brand',\n /** Refers to the positive / confirmation tint. */\n Success: 'success',\n /** Refers to the caution tint. */\n Warning: 'warning',\n /** Refers to the destructive / error tint. */\n Danger: 'danger',\n /** Refers to the informational tint. */\n Info: 'info',\n} as const;\n\nexport type TagVariant = (typeof TagVariant)[keyof typeof TagVariant];\n\nexport const tagVariants = tv({\n base: 'inline-flex items-center gap-1 rounded-md border border-border bg-card px-2 py-0.5 text-xs font-medium text-card-foreground',\n variants: {\n variant: {\n neutral: '',\n brand: 'border-transparent bg-primary-soft text-primary-soft-foreground',\n success: 'border-transparent bg-success-soft text-success-soft-foreground',\n warning: 'border-transparent bg-warning-soft text-warning-soft-foreground',\n danger: 'border-transparent bg-destructive-soft text-destructive-soft-foreground',\n info: 'border-transparent bg-info-soft text-info-soft-foreground',\n },\n },\n defaultVariants: {\n variant: 'neutral',\n },\n});\n\nexport type TagVariants = VariantProps<typeof tagVariants>;\n\n/* Compile-time lock: enum values ≡ tv variant value-set (drift = type error). */\ntype AssertExact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;\nconst _assertTagVariant: AssertExact<\n TagVariant,\n NonNullable<VariantProps<typeof tagVariants>['variant']>\n> = true;\nvoid _assertTagVariant;\n","<script lang=\"ts\">\nimport type { TagVariant } from './Tag.variants';\n\nexport interface TagProps {\n /** The color treatment. */\n variant?: TagVariant;\n\n /** The accessible label for the close button. Default `\"Remove\"`. */\n closeLabel?: string;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, useAttrs, useTemplateRef } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport { cn } from '../../../foundation/utils';\nimport { Icon } from '../../../foundation/icons';\nimport { tagVariants } from './Tag.variants';\n\nconst CloseIcon = X;\n\n/**\n * Pill with an optional close button. The close button is a raw `<button>`\n * to keep the strict atom rule (Tag is L3, so importing Button would make\n * this an atom-on-atom composition).\n */\ndefineOptions({ name: 'Tag', inheritAttrs: false });\n\n/** The tag copy — React's optional `children`. */\ndefineSlots<{ default?(): unknown }>();\n\nconst props = withDefaults(defineProps<TagProps>(), { closeLabel: 'Remove' });\n\n/** Replaces React's `onClose`; omitting `@close` omits the close button. */\nconst emit = defineEmits<{\n /** Fires when the close (×) button is clicked. */\n close: [];\n}>();\n\nconst attrs = useAttrs();\nconst instance = getCurrentInstance();\nconst el = useTemplateRef<HTMLSpanElement>('el');\n\n/**\n * Mirrors React's `onClose && <button/>` guard — the close button renders only\n * when the consumer bound `@close`. Read through a call, not a cached computed:\n * `instance.vnode` is replaced on every re-render.\n */\nconst hasClose = () => Boolean(instance?.vnode.props?.onClose);\n\nconst classes = computed(() =>\n cn(tagVariants({ variant: props.variant }), attrs.class as string | undefined),\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\ndefineExpose({ el });\n</script>\n\n<template>\n <span ref=\"el\" v-bind=\"rest\" :class=\"classes\">\n <slot />\n <button\n v-if=\"hasClose()\"\n type=\"button\"\n :aria-label=\"props.closeLabel\"\n class=\"-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('close')\"\n >\n <Icon :icon=\"CloseIcon\" :size=\"12\" />\n </button>\n </span>\n</template>\n","// Shared date helpers for Calendar / DatePicker / DateField / RangeCalendar.\n// Co-located in `forms/` so imports stay within-domain.\n//\n// Temporal-based — the ecosystem standardizes on the Temporal API (dates =\n// `Temporal.*`). `Temporal.PlainDate` carries calendar math (no timezone), so\n// these helpers are inherently local/wall-clock, which is what calendar UIs want.\n// `Temporal.PlainTime` carries hour/minute for the time components.\n\nimport { Temporal } from 'temporal-polyfill';\n\nexport const WEEKDAYS_SHORT = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];\nexport const MONTHS_LONG = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\n/** Sunday-anchored column index (0 = Sun … 6 = Sat) for a PlainDate. */\nexport function sundayIndex(d: Temporal.PlainDate): number {\n // Temporal `dayOfWeek` is 1 (Mon) … 7 (Sun); map Sunday to 0 for our Su-first grid.\n return d.dayOfWeek % 7;\n}\n\n/** Today as a PlainDate in the local time zone. */\nexport function today(): Temporal.PlainDate {\n return Temporal.Now.plainDateISO();\n}\n\nexport function isSameDay(\n a: Temporal.PlainDate | null | undefined,\n b: Temporal.PlainDate | null | undefined,\n): boolean {\n if (!a || !b) return false;\n return a.equals(b);\n}\n\nexport function isToday(d: Temporal.PlainDate): boolean {\n return d.equals(today());\n}\n\n/** Add `n` months; Temporal clamps to the target month's last day (Jan 31 +1 → Feb 28). */\nexport function addMonths(d: Temporal.PlainDate, n: number): Temporal.PlainDate {\n return d.add({ months: n });\n}\n\nexport function addDays(d: Temporal.PlainDate, n: number): Temporal.PlainDate {\n return d.add({ days: n });\n}\n\n/** First day of `d`'s month. */\nexport function startOfMonth(d: Temporal.PlainDate): Temporal.PlainDate {\n return d.with({ day: 1 });\n}\n\n/** Number of days in the given year/month (1-indexed month). */\nexport function daysInMonth(year: number, month: number): number {\n return Temporal.PlainDate.from({ year, month, day: 1 }).daysInMonth;\n}\n\n/**\n * Build the 6-week (42-cell) grid that the calendar UI renders.\n * `year`/`month` are 1-indexed (Temporal convention). Cells outside the target\n * month carry `outOfMonth: true`.\n */\nexport function buildMonthGrid(\n year: number,\n month: number,\n): { date: Temporal.PlainDate; outOfMonth: boolean }[] {\n const first = Temporal.PlainDate.from({ year, month, day: 1 });\n const start = first.subtract({ days: sundayIndex(first) });\n const cells: { date: Temporal.PlainDate; outOfMonth: boolean }[] = [];\n for (let i = 0; i < 42; i++) {\n const date = start.add({ days: i });\n cells.push({ date, outOfMonth: date.month !== month });\n }\n return cells;\n}\n\n/** Format PlainDate → \"YYYY-MM-DD\" for a native `<input type=\"date\">` value. */\nexport function formatISODate(d: Temporal.PlainDate | null | undefined): string {\n if (!d) return '';\n return d.toString();\n}\n\n/** Parse \"YYYY-MM-DD\" → PlainDate. Returns null for invalid input. */\nexport function parseISODate(s: string | null | undefined): Temporal.PlainDate | null {\n if (!s) return null;\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(s)) return null;\n try {\n return Temporal.PlainDate.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\n/** Format PlainTime → \"HH:MM\" for a native `<input type=\"time\">` value. */\nexport function formatISOTime(t: Temporal.PlainTime | null | undefined): string {\n if (!t) return '';\n return t.toString({ smallestUnit: 'minute' });\n}\n\n/** Parse \"HH:MM\" → PlainTime. Returns null for invalid input. */\nexport function parseISOTime(s: string | null | undefined): Temporal.PlainTime | null {\n if (!s) return null;\n if (!/^\\d{2}:\\d{2}$/.test(s)) return null;\n try {\n return Temporal.PlainTime.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\n/** Format PlainDateTime → \"YYYY-MM-DDTHH:MM\" for a native `<input type=\"datetime-local\">` value. */\nexport function formatISODateTime(dt: Temporal.PlainDateTime | null | undefined): string {\n if (!dt) return '';\n return dt.toString({ smallestUnit: 'minute' });\n}\n\n/** Parse \"YYYY-MM-DDTHH:MM\" (seconds optional) → PlainDateTime. Returns null for invalid input. */\nexport function parseISODateTime(s: string | null | undefined): Temporal.PlainDateTime | null {\n if (!s) return null;\n if (!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?$/.test(s)) return null;\n try {\n return Temporal.PlainDateTime.from(s, { overflow: 'reject' });\n } catch {\n return null;\n }\n}\n\nexport function clampDate(\n d: Temporal.PlainDate,\n min?: Temporal.PlainDate | null,\n max?: Temporal.PlainDate | null,\n): Temporal.PlainDate {\n if (min && Temporal.PlainDate.compare(d, min) < 0) return min;\n if (max && Temporal.PlainDate.compare(d, max) > 0) return max;\n return d;\n}\n\nexport function isDateDisabled(\n d: Temporal.PlainDate,\n options: {\n min?: Temporal.PlainDate | null;\n max?: Temporal.PlainDate | null;\n isDisabled?: (d: Temporal.PlainDate) => boolean;\n },\n): boolean {\n const { min, max, isDisabled } = options;\n if (min && Temporal.PlainDate.compare(d, min) < 0) return true;\n if (max && Temporal.PlainDate.compare(d, max) > 0) return true;\n if (isDisabled?.(d)) return true;\n return false;\n}\n\nexport function isInRange(\n d: Temporal.PlainDate,\n start: Temporal.PlainDate | null | undefined,\n end: Temporal.PlainDate | null | undefined,\n): boolean {\n if (!start || !end) return false;\n const lo = Temporal.PlainDate.compare(start, end) <= 0 ? start : end;\n const hi = Temporal.PlainDate.compare(start, end) <= 0 ? end : start;\n return Temporal.PlainDate.compare(d, lo) >= 0 && Temporal.PlainDate.compare(d, hi) <= 0;\n}\n\n/** Signed whole-day count from `a` to `b` (positive when `b` is later). */\nexport function daysBetween(a: Temporal.PlainDate, b: Temporal.PlainDate): number {\n return a.until(b, { largestUnit: 'day' }).days;\n}\n\n/** True when `d` falls on a Saturday or Sunday. */\nexport function isWeekend(d: Temporal.PlainDate): boolean {\n // Temporal `dayOfWeek`: 1 (Mon) … 7 (Sun); 6 = Sat, 7 = Sun.\n return d.dayOfWeek === 6 || d.dayOfWeek === 7;\n}\n\n// ── Datetime helpers (ZonedDateTime) ──────────────────────────────────────\n// EventCalendar / ScheduleView model absolute instants (a wall-clock time in a\n// specific zone) — the `Temporal.ZonedDateTime` peer of .NET `DateTimeOffset`.\n// The grid + navigation still project down to `Temporal.PlainDate` (via the\n// helpers above); these cover the intra-day time-slot math the grid needs.\n\n/** Now as a ZonedDateTime in the local (system) time zone. */\nexport function nowZoned(): Temporal.ZonedDateTime {\n return Temporal.Now.zonedDateTimeISO();\n}\n\n/** The calendar day a ZonedDateTime falls on (its wall-clock PlainDate). */\nexport function zonedToPlainDate(z: Temporal.ZonedDateTime): Temporal.PlainDate {\n return z.toPlainDate();\n}\n\n/** True when two ZonedDateTimes land on the same wall-clock day (same zone assumed). */\nexport function isSameZonedDay(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): boolean {\n return a.toPlainDate().equals(b.toPlainDate());\n}\n\n/** True when a ZonedDateTime falls on `day` (its wall-clock date equals `day`). */\nexport function isZonedOnDay(z: Temporal.ZonedDateTime, day: Temporal.PlainDate): boolean {\n return z.toPlainDate().equals(day);\n}\n\n/** Start-of-day (00:00, zone-correct) for `day` in `z`'s time zone. */\nexport function startOfZonedDay(day: Temporal.PlainDate, timeZone: Temporal.TimeZoneLike): Temporal.ZonedDateTime {\n return day.toZonedDateTime({ timeZone, plainTime: Temporal.PlainTime.from('00:00') });\n}\n\n/** `day` at hour `hour` (minutes/seconds zeroed), zone-correct, in `timeZone`. */\nexport function zonedAtHour(\n day: Temporal.PlainDate,\n hour: number,\n timeZone: Temporal.TimeZoneLike,\n): Temporal.ZonedDateTime {\n return day.toZonedDateTime({\n timeZone,\n plainTime: new Temporal.PlainTime(hour),\n });\n}\n\n/** Signed minutes from `a` to `b` (positive when `b` is later). */\nexport function minutesBetween(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): number {\n return a.until(b, { largestUnit: 'minute', smallestUnit: 'minute' }).minutes;\n}\n\n/** Later of two instants. */\nexport function maxZoned(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): Temporal.ZonedDateTime {\n return Temporal.ZonedDateTime.compare(a, b) >= 0 ? a : b;\n}\n\n/** Earlier of two instants. */\nexport function minZoned(a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime): Temporal.ZonedDateTime {\n return Temporal.ZonedDateTime.compare(a, b) <= 0 ? a : b;\n}\n\n/** True when `z`'s calendar day lies within [start, end] (inclusive, by day). */\nexport function isZonedDayInRange(\n z: Temporal.ZonedDateTime,\n start: Temporal.ZonedDateTime,\n end: Temporal.ZonedDateTime,\n): boolean {\n return isInRange(z.toPlainDate(), start.toPlainDate(), end.toPlainDate());\n}\n\n/** Format a ZonedDateTime's time-of-day as \"HH:MM\" (locale-aware). */\nexport function formatZonedTime(z: Temporal.ZonedDateTime): string {\n return z.toLocaleString(undefined, { hour: '2-digit', minute: '2-digit' });\n}\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot","_createVNode","_unref","Icon"],"mappings":";;;;;;;;;;AAmBA,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA4B,IAAI;AAE3C,UAAM,UAAU;AAAA,MAAS,MACvB;AAAA,QACE;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MAAA;AAAA,IACR;AAIF,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,mBAA2D,OAA3DC,WAA2D;AAAA,iBAAlD;AAAA,QAAJ,KAAI;AAAA,MAAA,GAAa,KAAA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
|
|
52
52
|
}
|
|
53
53
|
function focusFirst(container) {
|
|
54
54
|
const focusable = getFocusable(container);
|
|
55
|
-
if (focusable.length > 0) focusable[0]?.focus();
|
|
56
|
-
else container.focus();
|
|
55
|
+
if (focusable.length > 0) focusable[0]?.focus({ preventScroll: true });
|
|
56
|
+
else container.focus({ preventScroll: true });
|
|
57
57
|
}
|
|
58
58
|
let previouslyFocused = null;
|
|
59
59
|
const entry = {
|
|
@@ -211,4 +211,4 @@ export {
|
|
|
211
211
|
_sfc_main$1 as _,
|
|
212
212
|
_sfc_main as a
|
|
213
213
|
};
|
|
214
|
-
//# sourceMappingURL=DismissableLayer.vue_vue_type_script_setup_true_lang-
|
|
214
|
+
//# sourceMappingURL=DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js","sources":["../../src/foundation/primitives/focusScope/FocusScope.vue","../../src/foundation/primitives/dismissableLayer/DismissableLayer.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface FocusScopeProps {\n /** Wrap Tab / Shift+Tab at the scope's edges. Default false. */\n loop?: boolean;\n\n /** Keep focus inside the scope — focus that escapes is pulled back. Default false. */\n trapped?: boolean;\n\n /** Fires before the scope auto-focuses on mount; `preventDefault()` to keep focus where it is. */\n onMountAutoFocus?: (event: CustomEvent) => void;\n\n /** Fires before focus is restored on unmount; `preventDefault()` to keep focus where it is. */\n onUnmountAutoFocus?: (event: CustomEvent) => void;\n\n /** Merge into the single slot child instead of rendering a wrapper div. */\n asChild?: boolean;\n}\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\nfunction isVisible(el: HTMLElement): boolean {\n // checkVisibility covers display/visibility/content-visibility; the\n // getClientRects fallback (older engines) still includes position:fixed\n // elements, which `offsetParent !== null` would wrongly exclude.\n return el.checkVisibility?.() ?? el.getClientRects().length > 0;\n}\n\nfunction getFocusable(container: HTMLElement): ReadonlyArray<HTMLElement> {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => el.getAttribute('aria-hidden') !== 'true' && isVisible(el),\n );\n}\n\n/** One trapped scope's hook into the shared `focusin` listener. */\ninterface FocusScopeEntry {\n /** Pulls focus back inside when it lands outside this scope. */\n recover: (event: FocusEvent) => void;\n}\n\n/**\n * Active trapped scopes, most-recently-activated last — the same structure\n * Radix used to *pause* outer scopes, and the reason there is exactly one\n * document listener rather than one per scope.\n *\n * Nesting is what makes it necessary. A Popover inside a Modal is not DOM-nested\n * (both portal to `body`), so each scope reads focus in the other as an escape.\n * With a live listener per scope they alternate — modal pulls focus in, popover\n * pulls it back, and because `.focus()` dispatches `focusin` synchronously the\n * two recurse until the call stack blows. Topmost-only ends that: the scopes\n * below the top are paused, not unregistered, and resume the moment the one\n * above them pops.\n */\nconst scopeStack: Array<FocusScopeEntry> = [];\n\nfunction onDocumentFocusIn(event: FocusEvent): void {\n scopeStack[scopeStack.length - 1]?.recover(event);\n}\n\n/** Pushes `entry` to the top, making it the scope that owns focus. A re-activation moves it up rather than duplicating it. */\nfunction activateScope(entry: FocusScopeEntry): void {\n const index = scopeStack.indexOf(entry);\n if (index >= 0) scopeStack.splice(index, 1);\n scopeStack.push(entry);\n // One listener for the whole stack — attached with the first scope, dropped with the last.\n if (scopeStack.length === 1) document.addEventListener('focusin', onDocumentFocusIn);\n}\n\n/** Removes `entry`, restoring whichever scope sat below it as the owner. Safe to call twice. */\nfunction deactivateScope(entry: FocusScopeEntry): void {\n const index = scopeStack.indexOf(entry);\n if (index < 0) return;\n scopeStack.splice(index, 1);\n if (scopeStack.length === 0) document.removeEventListener('focusin', onDocumentFocusIn);\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { onMounted, onScopeDispose, useTemplateRef, watch, type ComponentPublicInstance } from 'vue';\nimport { Primitive } from '../slot';\n\n/**\n * Focus-management scope. On unmount, returns focus to the previously\n * focused element. Pass `loop` to wrap Tab navigation; `trapped` to trap\n * focus within children (defaults to false — focus may leave the scope\n * unless explicitly trapped).\n *\n * The React original wrapped `@radix-ui/react-focus-scope`. Radix ships no Vue\n * package, so the trap is hand-rolled here on the same technique the house\n * already uses in `hooks/useFocusTrap` — the alternative, pulling in `reka-ui`\n * for one component, would add a whole component library as a runtime\n * dependency of the foundation layer for behaviour that is ~60 lines. Radix's\n * scope *stack* is kept, though: see `scopeStack` above.\n *\n * The mount / unmount auto-focus callbacks receive a cancelable `CustomEvent`,\n * matching Radix's `onMountAutoFocus` / `onUnmountAutoFocus` contract:\n * `preventDefault()` suppresses the automatic focus move.\n */\ndefineOptions({ name: 'FocusScope' });\n\nconst props = withDefaults(defineProps<FocusScopeProps>(), {\n loop: false,\n trapped: false,\n asChild: false,\n});\n\nconst scope = useTemplateRef<ComponentPublicInstance>('scope');\n\n/** `$el` is not reactive, so the node is read on demand rather than cached in a computed. */\nfunction containerEl(): HTMLElement | null {\n const el = scope.value?.$el;\n return el instanceof HTMLElement ? el : null;\n}\n\n/*\n * `preventScroll` is load-bearing, not a nicety. An anchored scope (Popover,\n * Select, MultiSelect) mounts before Floating UI has resolved its position —\n * `useFloating` seeds `left: 0; top: 0` and applies the real transform one\n * async tick later — so at mount the panel sits at the document origin. A plain\n * `.focus()` there makes the browser scroll the page up to reveal it, and the\n * whole document jumps to the top the moment a dropdown opens. Radix's\n * FocusScope focuses the same way for the same reason.\n */\nfunction focusFirst(container: HTMLElement): void {\n const focusable = getFocusable(container);\n if (focusable.length > 0) focusable[0]?.focus({ preventScroll: true });\n // Nothing focusable inside — the container itself takes the focus, which is\n // what `tabindex=\"-1\"` on it is for.\n else container.focus({ preventScroll: true });\n}\n\nlet previouslyFocused: HTMLElement | null = null;\n\n/** Stable for this component's lifetime — it is the stack's identity for this scope. */\nconst entry: FocusScopeEntry = {\n recover: (event: FocusEvent) => {\n const container = containerEl();\n if (!container) return;\n const target = event.target as Node | null;\n if (target && container.contains(target)) return;\n focusFirst(container);\n },\n};\n\nonMounted(() => {\n const container = containerEl();\n if (!container) return;\n previouslyFocused = document.activeElement as HTMLElement | null;\n if (container.contains(previouslyFocused)) return;\n const event = new CustomEvent('focusScope.autoFocusOnMount', {\n bubbles: false,\n cancelable: true,\n });\n props.onMountAutoFocus?.(event);\n container.dispatchEvent(event);\n if (!event.defaultPrevented) focusFirst(container);\n});\n\nonScopeDispose(() => {\n // Leave the stack *before* focus moves. While this scope is still the top,\n // its own `recover` would read the restore as an escape and yank focus\n // straight back in — and the scope below it must be the one that owns the\n // restored focus, which is exactly what popping hands over.\n deactivateScope(entry);\n const event = new CustomEvent('focusScope.autoFocusOnUnmount', {\n bubbles: false,\n cancelable: true,\n });\n props.onUnmountAutoFocus?.(event);\n if (!event.defaultPrevented) previouslyFocused?.focus?.();\n previouslyFocused = null;\n});\n\n// `trapped` guards the escape route Tab cannot cover — a click, or a\n// programmatic focus, landing outside the scope. Activation is what puts this\n// scope on top of `scopeStack`; only the top reacts to `focusin`.\nwatch(\n () => props.trapped,\n (trapped, _previous, onCleanup) => {\n if (!trapped || typeof document === 'undefined') return;\n activateScope(entry);\n onCleanup(() => deactivateScope(entry));\n },\n { immediate: true },\n);\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key !== 'Tab') return;\n if (!props.loop && !props.trapped) return;\n const container = containerEl();\n if (!container) return;\n const items = getFocusable(container);\n if (items.length === 0) {\n if (props.trapped) event.preventDefault();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n if (!first || !last) return;\n const active = document.activeElement;\n const atEdge = event.shiftKey ? active === first : active === last;\n if (!atEdge) return;\n if (props.loop) {\n event.preventDefault();\n (event.shiftKey ? last : first).focus();\n } else if (props.trapped) {\n // Trapped without looping — the edge is a wall, not a wrap.\n event.preventDefault();\n }\n}\n</script>\n\n<template>\n <Primitive ref=\"scope\" :as-child=\"props.asChild\" tabindex=\"-1\" @keydown=\"onKeydown\">\n <slot />\n </Primitive>\n</template>\n","<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\n\nexport interface DismissableLayerProps extends /* @vue-ignore */ HTMLAttributes {\n /** Fires when Escape is pressed and this is the topmost layer. */\n onEscape?: (event: KeyboardEvent) => void;\n\n /** Fires when a pointerdown lands outside this layer's DOM and this is topmost. */\n onOutsidePointerDown?: (event: PointerEvent) => void;\n\n /** The Escape-listener disable flag for this layer. */\n isEscapeDisabled?: boolean;\n\n /** The outside-pointer-down-listener disable flag for this layer. */\n isOutsideClickDisabled?: boolean;\n}\n\ninterface LayerEntry {\n node: HTMLElement;\n onEscape?: (event: KeyboardEvent) => void;\n onOutsidePointerDown?: (event: PointerEvent) => void;\n}\n\nconst layerStack: Array<LayerEntry> = [];\n</script>\n\n<script setup lang=\"ts\">\nimport { onMounted, onScopeDispose, useTemplateRef, watch } from 'vue';\n\n/**\n * Stack-aware dismissal layer. Multiple layers may stack (modal > popover);\n * only the topmost reacts to Escape / outside click. Used as the base of\n * Modal, Drawer, Popover, Menu, HoverCard, ContextMenu.\n */\ndefineOptions({ name: 'DismissableLayer' });\n\nconst props = defineProps<DismissableLayerProps>();\n\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n// The stack entry reads the handlers off `props` at call time rather than\n// capturing them. React needed refs here so registration could run once —\n// re-registering on callback identity change would reorder the stack and\n// corrupt dismissal ordering. Vue props are live, so the indirection is free.\nlet entry: LayerEntry | null = null;\n\nonMounted(() => {\n const node = el.value;\n if (!node) return;\n entry = {\n node,\n onEscape: (event) => props.onEscape?.(event),\n onOutsidePointerDown: (event) => props.onOutsidePointerDown?.(event),\n };\n layerStack.push(entry);\n});\n\n// Registered at setup level — `onScopeDispose` only binds to the component's\n// effect scope while that scope is current, which it is not inside `onMounted`.\nonScopeDispose(() => {\n if (!entry) return;\n const index = layerStack.indexOf(entry);\n if (index >= 0) layerStack.splice(index, 1);\n entry = null;\n});\n\nwatch(\n () => props.isEscapeDisabled,\n (isDisabled, _previous, onCleanup) => {\n if (isDisabled || typeof document === 'undefined') return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n const top = layerStack[layerStack.length - 1];\n if (top && top.node === el.value) top.onEscape?.(event);\n };\n document.addEventListener('keydown', onKeyDown);\n onCleanup(() => document.removeEventListener('keydown', onKeyDown));\n },\n { immediate: true },\n);\n\nwatch(\n () => props.isOutsideClickDisabled,\n (isDisabled, _previous, onCleanup) => {\n if (isDisabled || typeof document === 'undefined') return;\n const onPointer = (event: PointerEvent) => {\n const top = layerStack[layerStack.length - 1];\n if (!top || top.node !== el.value) return;\n const target = event.target as Node | null;\n if (!target || el.value?.contains(target)) return;\n top.onOutsidePointerDown?.(event);\n };\n document.addEventListener('pointerdown', onPointer, true);\n onCleanup(() => document.removeEventListener('pointerdown', onPointer, true));\n },\n { immediate: true },\n);\n\ndefineExpose({ el });\n</script>\n\n<template>\n <div ref=\"el\"><slot /></div>\n</template>\n"],"names":["_createBlock","_unref","_renderSlot","_createElementBlock"],"mappings":";;AAkBA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAAS,UAAU,IAA0B;AAI3C,SAAO,GAAG,kBAAA,KAAuB,GAAG,eAAA,EAAiB,SAAS;AAChE;AAEA,SAAS,aAAa,WAAoD;AACxE,SAAO,MAAM,KAAK,UAAU,iBAA8B,kBAAkB,CAAC,EAAE;AAAA,IAC7E,CAAC,OAAO,GAAG,aAAa,aAAa,MAAM,UAAU,UAAU,EAAE;AAAA,EAAA;AAErE;AAqBA,MAAM,aAAqC,CAAA;AAE3C,SAAS,kBAAkB,OAAyB;AAClD,aAAW,WAAW,SAAS,CAAC,GAAG,QAAQ,KAAK;AAClD;AAGA,SAAS,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C,cAAI,CAAC,OAAO,IAAI,SAAS,GAAG,MAAO;AACnC,gBAAM,SAAS,MAAM;AACrB,cAAI,CAAC,UAAU,GAAG,OAAO,SAAS,MAAM,EAAG;AAC3C,cAAI,uBAAuB,KAAK;AAAA,QAClC;AACA,iBAAS,iBAAiB,eAAe,WAAW,IAAI;AACxD,kBAAU,MAAM,SAAS,oBAAoB,eAAe,WAAW,IAAI,CAAC;AAAA,MAC9E;AAAA,MACA,EAAE,WAAW,KAAA;AAAA,IAAK;AAGpB,aAAa,EAAE,IAAI;;0BAIjBC,mBAA4B,OAAA;AAAA,iBAAnB;AAAA,QAAJ,KAAI;AAAA,MAAA;QAAKD,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, provide, computed, renderSlot, inject, useAttrs, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, createCommentVNode, mergeProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$4 } from "./Backdrop.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as _sfc_main$4 } from "./Backdrop.vue_vue_type_script_setup_true_lang-CKG--_g8.js";
|
|
3
3
|
import { o as overlayChromeContextKey } from "./OverlayChrome-e4MNr8Yl.js";
|
|
4
4
|
import { u as useControlled } from "./useControlled-B6M4kTLn.js";
|
|
5
5
|
import { u as useId } from "./useId-CtgAhGrn.js";
|
|
6
6
|
import { c as cn } from "./cn-CzDCF-Ah.js";
|
|
7
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
7
|
+
import { s as surfaceVariants } from "./SurfaceStyles-B6W7zdMi.js";
|
|
8
8
|
import { _ as _sfc_main$2 } from "./Portal.vue_vue_type_script_setup_true_lang-CF3R0VCZ.js";
|
|
9
9
|
import { _ as _sfc_main$3 } from "./ScrollLockProvider.vue_vue_type_script_setup_true_lang-_ihHJ7jI.js";
|
|
10
|
-
import { P as Presence } from "./Presence-
|
|
11
|
-
import { _ as _sfc_main$5, a as _sfc_main$6 } from "./DismissableLayer.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { P as Presence } from "./Presence-DE4MlrJz.js";
|
|
11
|
+
import { _ as _sfc_main$5, a as _sfc_main$6 } from "./DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js";
|
|
12
12
|
const drawerContextKey = Symbol("wow-two.drawer");
|
|
13
13
|
function useDrawerContext() {
|
|
14
14
|
const context = inject(drawerContextKey, null);
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
_sfc_main as a,
|
|
205
205
|
useDrawerContext as u
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=DrawerContent.vue_vue_type_script_setup_true_lang-
|
|
207
|
+
//# sourceMappingURL=DrawerContent.vue_vue_type_script_setup_true_lang-4n5w3lg2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.vue_vue_type_script_setup_true_lang-DvvrJdF0.js","sources":["../../src/presentation/overlays/drawer/Drawer.vue","../../src/presentation/overlays/drawer/DrawerContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Side } from '../../../foundation/utils';\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/**\n * The prop surface of `Drawer`.\n *\n * `open` and `isOpen` are the same controlled state under two names: `open` is\n * the `v-model:open` binding target, `isOpen` the house boolean spelling that\n * mirrors the rest of the port. `open` wins when both are set. React's\n * `onOpenChange` is the `open-change` emit; `update:open` fires alongside it so\n * `v-model:open` works.\n */\nexport interface DrawerProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n open?: boolean;\n\n /** The open state, controlled — the house spelling of `open`; `open` wins when both are set. */\n isOpen?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n defaultOpen?: boolean;\n\n /** The edge the panel slides in from. Default `right`. */\n side?: Side;\n\n /** The outside-click dismissal toggle. Default `true`. */\n dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled, useId } from '../../../foundation/hooks';\n\n/**\n * State + a11y-id owner for a Drawer tree. Renders only its slot — React\n * 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` / `isOpen: 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 isOpen: undefined,\n defaultOpen: false,\n side: 'right',\n dismissOnOutsideClick: true,\n dismissOnEscape: true,\n});\n\nconst emit = defineEmits<{\n /** The `v-model:open` half. */\n 'update:open': [open: boolean];\n /** Replaces React's `onOpenChange`. */\n 'open-change': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => (props.open !== undefined ? props.open : props.isOpen),\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n emit('open-change', 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.dismissOnOutsideClick),\n dismissOnEscape: computed(() => props.dismissOnEscape),\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/utils';\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 SIDE_BASE: 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 HORIZONTAL_SIZE: 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 VERTICAL_SIZE: 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 SurfaceVariants`; 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/utils`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface DrawerContentProps {\n /** The backdrop-hide toggle — disables the default backdrop when true. */\n hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n isBlurred?: boolean;\n\n /** The per-side max-size token. Default `md`. */\n size?: DrawerSize;\n\n /** The visual recipe. Default `elevated`. */\n variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n tone?: SurfaceTone;\n\n /** The corner rounding. Default `none`. */\n radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n padding?: SurfacePadding;\n\n /** The shadow depth. Default `3`. */\n elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/utils';\nimport {\n DismissableLayer,\n FocusScope,\n Portal,\n Presence,\n ScrollLockProvider,\n} from '../../../foundation/primitives';\nimport Backdrop from '../backdrop/Backdrop.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useDrawerContext } from './Drawer.vue';\n\n/* The portalled edge panel — scrim, focus trap, scroll lock, and the sliding surface that carries the a11y contract. */\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>(), { size: 'md' });\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 requestAnimationFrame(() => context.triggerEl.value?.focus());\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(() =>\n isHorizontal.value ? HORIZONTAL_SIZE[props.size] : VERTICAL_SIZE[props.size],\n);\n\nconst classes = computed(() =>\n cn(\n 'fixed z-modal flex flex-col gap-4 outline-none',\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 SIDE_BASE[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 `Backdrop`'s own `Presence` (its `isOpen` prop); React\n mirrored the panel's `data-state` onto it by hand for the same effect. -->\n <Backdrop\n v-if=\"!props.hideBackdrop\"\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 trapped loop>\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","Backdrop","FocusScope","_mergeProps"],"mappings":";;;;;;;;;;;AAwBO,MAAM,mBAAqD,OAAO,gBAAgB;AAElF,SAAS,mBAAuC;AACrD,QAAM,UAAU,OAAO,kBAAkB,IAAI;AAC7C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,uCAAuC;AACrE,SAAO;AACT;;;;;;;;;;;;;;AAmDA,UAAM,QAAQ;AAS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A,gBACC,WAASJ,MAAA,MAAA;AAAA,gBACT,cAAY,MAAM;AAAA,gBAClB,sBAAO,eAAe;AAAA,gBACtB,SAAO;AAAA,cAAA;cAEVE,YA0BWF,MAAA,QAAA,GAAA,EA1BA,cAAYA,MAAA,MAAA,KAAM;AAAA,iCAU3B,MAea;AAAA,kBAfbE,YAeaF,MAAAK,WAAA,GAAA;AAAA,oBAfD,YAAA;AAAA,oBAAS,SAAA;AAAA,oBAAQ,MAAA;AAAA,kBAAA;qCAC3B,MAamB;AAAA,sBAbnBH,YAamBF,oBAbnBM,WAamB;AAAA,wBAZhB,uBAAqBN,MAAA,eAAA;AAAA,wBACtB,6BAAA;AAAA,wBACC,aAAW;AAAA,wBACZ,MAAK;AAAA,wBACL,cAAW;AAAA,wBACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,wBACzB,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-4n5w3lg2.js","sources":["../../src/presentation/overlays/drawer/Drawer.vue","../../src/presentation/overlays/drawer/DrawerContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Side } from '../../../foundation/utils';\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/**\n * The prop surface of `Drawer`.\n *\n * `open` and `isOpen` are the same controlled state under two names: `open` is\n * the `v-model:open` binding target, `isOpen` the house boolean spelling that\n * mirrors the rest of the port. `open` wins when both are set. React's\n * `onOpenChange` is the `open-change` emit; `update:open` fires alongside it so\n * `v-model:open` works.\n */\nexport interface DrawerProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n open?: boolean;\n\n /** The open state, controlled — the house spelling of `open`; `open` wins when both are set. */\n isOpen?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n defaultOpen?: boolean;\n\n /** The edge the panel slides in from. Default `right`. */\n side?: Side;\n\n /** The outside-click dismissal toggle. Default `true`. */\n dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled, useId } from '../../../foundation/hooks';\n\n/**\n * State + a11y-id owner for a Drawer tree. Renders only its slot — React\n * 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` / `isOpen: 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 isOpen: undefined,\n defaultOpen: false,\n side: 'right',\n dismissOnOutsideClick: true,\n dismissOnEscape: true,\n});\n\nconst emit = defineEmits<{\n /** The `v-model:open` half. */\n 'update:open': [open: boolean];\n /** Replaces React's `onOpenChange`. */\n 'open-change': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => (props.open !== undefined ? props.open : props.isOpen),\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n emit('open-change', 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.dismissOnOutsideClick),\n dismissOnEscape: computed(() => props.dismissOnEscape),\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/utils';\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 SIDE_BASE: 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 HORIZONTAL_SIZE: 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 VERTICAL_SIZE: 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 SurfaceVariants`; 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/utils`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface DrawerContentProps {\n /** The backdrop-hide toggle — disables the default backdrop when true. */\n hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n isBlurred?: boolean;\n\n /** The per-side max-size token. Default `md`. */\n size?: DrawerSize;\n\n /** The visual recipe. Default `elevated`. */\n variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n tone?: SurfaceTone;\n\n /** The corner rounding. Default `none`. */\n radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n padding?: SurfacePadding;\n\n /** The shadow depth. Default `3`. */\n elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/utils';\nimport {\n DismissableLayer,\n FocusScope,\n Portal,\n Presence,\n ScrollLockProvider,\n} from '../../../foundation/primitives';\nimport Backdrop from '../backdrop/Backdrop.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useDrawerContext } from './Drawer.vue';\n\n/* The portalled edge panel — scrim, focus trap, scroll lock, and the sliding surface that carries the a11y contract. */\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>(), { size: 'md' });\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 requestAnimationFrame(() => context.triggerEl.value?.focus());\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(() =>\n isHorizontal.value ? HORIZONTAL_SIZE[props.size] : VERTICAL_SIZE[props.size],\n);\n\nconst classes = computed(() =>\n cn(\n 'fixed z-modal flex flex-col gap-4 outline-none',\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 SIDE_BASE[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 `Backdrop`'s own `Presence` (its `isOpen` prop); React\n mirrored the panel's `data-state` onto it by hand for the same effect. -->\n <Backdrop\n v-if=\"!props.hideBackdrop\"\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 trapped loop>\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","Backdrop","FocusScope","_mergeProps"],"mappings":";;;;;;;;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C,WAAA,GAAA,MAAA;AAAA,yBAvCP,MAsCqB;AAAA,UAtCrBC,YAsCqBF,MAAAG,WAAA,GAAA,EAtCA,cAAYH,MAAA,MAAA,KAAM;AAAA,6BAGrC,MAOE;AAAA,cANO,CAAA,MAAM,6BADfD,YAOEK,aAAA;AAAA;gBALA,aAAA;AAAA,gBACC,WAASJ,MAAA,MAAA;AAAA,gBACT,cAAY,MAAM;AAAA,gBAClB,sBAAO,eAAe;AAAA,gBACtB,SAAO;AAAA,cAAA;cAEVE,YA0BWF,MAAA,QAAA,GAAA,EA1BA,cAAYA,MAAA,MAAA,KAAM;AAAA,iCAU3B,MAea;AAAA,kBAfbE,YAeaF,MAAAK,WAAA,GAAA;AAAA,oBAfD,YAAA;AAAA,oBAAS,SAAA;AAAA,oBAAQ,MAAA;AAAA,kBAAA;qCAC3B,MAamB;AAAA,sBAbnBH,YAamBF,oBAbnBM,WAamB;AAAA,wBAZhB,uBAAqBN,MAAA,eAAA;AAAA,wBACtB,6BAAA;AAAA,wBACC,aAAW;AAAA,wBACZ,MAAK;AAAA,wBACL,cAAW;AAAA,wBACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,wBACzB,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,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, provide, computed, renderSlot, inject, useAttrs, useTemplateRef, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode, createElementVNode, withModifiers, normalizeClass, mergeProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$4 } from "./Backdrop.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as _sfc_main$4 } from "./Backdrop.vue_vue_type_script_setup_true_lang-CKG--_g8.js";
|
|
3
3
|
import { o as overlayChromeContextKey } from "./OverlayChrome-e4MNr8Yl.js";
|
|
4
4
|
import { u as useControlled } from "./useControlled-B6M4kTLn.js";
|
|
5
5
|
import { u as useId } from "./useId-CtgAhGrn.js";
|
|
6
6
|
import { c as cn } from "./cn-CzDCF-Ah.js";
|
|
7
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
7
|
+
import { s as surfaceVariants } from "./SurfaceStyles-B6W7zdMi.js";
|
|
8
8
|
import { _ as _sfc_main$2 } from "./Portal.vue_vue_type_script_setup_true_lang-CF3R0VCZ.js";
|
|
9
9
|
import { _ as _sfc_main$3 } from "./ScrollLockProvider.vue_vue_type_script_setup_true_lang-_ihHJ7jI.js";
|
|
10
|
-
import { P as Presence } from "./Presence-
|
|
11
|
-
import { _ as _sfc_main$5, a as _sfc_main$6 } from "./DismissableLayer.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { P as Presence } from "./Presence-DE4MlrJz.js";
|
|
11
|
+
import { _ as _sfc_main$5, a as _sfc_main$6 } from "./DismissableLayer.vue_vue_type_script_setup_true_lang-ptH1ttBL.js";
|
|
12
12
|
const ModalRole = {
|
|
13
13
|
/** Refers to a standard dialog. */
|
|
14
14
|
Dialog: "dialog",
|
|
@@ -188,4 +188,4 @@ export {
|
|
|
188
188
|
_sfc_main as a,
|
|
189
189
|
useModalContext as u
|
|
190
190
|
};
|
|
191
|
-
//# sourceMappingURL=ModalContent.vue_vue_type_script_setup_true_lang-
|
|
191
|
+
//# sourceMappingURL=ModalContent.vue_vue_type_script_setup_true_lang-Co5jaeXk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.vue_vue_type_script_setup_true_lang-CLACSqKg.js","sources":["../../src/presentation/overlays/modal/Modal.vue","../../src/presentation/overlays/modal/ModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\n\n/** Defines the ARIA dialog role a `Modal` exposes. */\nexport const ModalRole = {\n /** Refers to a standard dialog. */\n Dialog: 'dialog',\n /** Refers to an alert dialog that interrupts to convey an urgent message. */\n AlertDialog: 'alertdialog',\n} as const;\n\nexport type ModalRole = (typeof ModalRole)[keyof typeof ModalRole];\n\n/**\n * The value shared with `ModalTrigger` / `ModalContent`.\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 ModalContextValue {\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 modal closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n role: ComputedRef<ModalRole>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const modalContextKey: InjectionKey<ModalContextValue> = Symbol('wow-two.modal');\n\nexport function useModalContext(): ModalContextValue {\n const context = inject(modalContextKey, null);\n if (!context) throw new Error('Modal.* must be used inside <Modal>');\n return context;\n}\n\n/**\n * The prop surface of `Modal`.\n *\n * `open` and `isOpen` are the same controlled state under two names: `open` is\n * the `v-model:open` binding target, `isOpen` the house boolean spelling that\n * mirrors the rest of the port. `open` wins when both are set. React's\n * `onOpenChange` is the `open-change` emit; `update:open` fires alongside it so\n * `v-model:open` works.\n */\nexport interface ModalProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n open?: boolean;\n\n /** The open state, controlled — the house spelling of `open`; `open` wins when both are set. */\n isOpen?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n defaultOpen?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n dismissOnEscape?: boolean;\n\n /** The ARIA dialog role. Internal — `AlertModal` overrides this. */\n role?: ModalRole;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled, useId } from '../../../foundation/hooks';\n\n/**\n * State + a11y-id owner for a Modal tree. Renders only its slot — React\n * returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Modal', inheritAttrs: false });\n\n/** The Modal tree — `ModalTrigger` and `ModalContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `isOpen: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would make the modal read as explicitly-closed-and-controlled and\n * strand the uncontrolled path. Declaring the default as `undefined` keeps the\n * three states React had — absent / `true` / `false`.\n */\nconst props = withDefaults(defineProps<ModalProps>(), {\n open: undefined,\n isOpen: undefined,\n defaultOpen: false,\n dismissOnOutsideClick: true,\n dismissOnEscape: true,\n role: 'dialog',\n});\n\nconst emit = defineEmits<{\n /** The `v-model:open` half. */\n 'update:open': [open: boolean];\n /** Replaces React's `onOpenChange`. */\n 'open-change': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => (props.open !== undefined ? props.open : props.isOpen),\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n emit('open-change', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('modal-title');\nconst descriptionId = useId('modal-description');\n\nprovide(modalContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n role: computed(() => props.role),\n dismissOnOutsideClick: computed(() => props.dismissOnOutsideClick),\n dismissOnEscape: computed(() => props.dismissOnEscape),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport type {\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/utils';\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceVariants`; 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/utils`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** The backdrop-hide toggle — disables the default backdrop when true. */\n hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n isBlurred?: boolean;\n\n /** The visual recipe. Default `elevated`. */\n variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n padding?: SurfacePadding;\n\n /** The shadow depth. */\n elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs, useTemplateRef } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/utils';\nimport {\n DismissableLayer,\n FocusScope,\n Portal,\n Presence,\n ScrollLockProvider,\n} from '../../../foundation/primitives';\nimport Backdrop from '../backdrop/Backdrop.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/* The portalled dialog surface — scrim, focus trap, scroll lock, and the panel that carries the a11y contract. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = defineProps<ModalContentProps>();\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n requestAnimationFrame(() => context.triggerEl.value?.focus());\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\nconst classes = computed(() =>\n cn(\n 'relative w-full max-w-lg',\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\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/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `Backdrop`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <Backdrop\n v-if=\"!props.hideBackdrop\"\n is-inline\n :is-open=\"isOpen\"\n :is-blurred=\"props.isBlurred\"\n />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div\n :class=\"\n cn(\n 'group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n )\n \"\n @click.self=\"handleOutsideClick\"\n >\n <FocusScope as-child trapped loop>\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","Backdrop","_createElementVNode","_normalizeClass","FocusScope","DismissableLayer","_mergeProps"],"mappings":";;;;;;;;;;;AAIO,MAAM,YAAY;AAAA;AAAA,EAEvB,QAAQ;AAAA;AAAA,EAER,aAAa;AACf;AAwBO,MAAM,kBAAmD,OAAO,eAAe;AAE/E,SAAS,kBAAqC;AACnD,QAAM,UAAU,OAAO,iBAAiB,IAAI;AAC5C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qCAAqC;AACnE,SAAO;AACT;;;;;;;;;;;;;;AAoDA,UAAM,QAAQ;AASd,UAAM,OAAO;AAOb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAO,MAAM,SAAS,SAAY,MAAM,OAAO,MAAM;AAAA,MACjE,SAAS,MAAM,MAAM;AAAA,MACrB,UAAU,CAAC,UAAU;AACnB,aAAK,eAAe,KAAK;AACzB,aAAK,eAAe,KAAK;AAAA,MAC3B;AAAA,IAAA,CACD;AAED,UAAM,YAAY,WAA+B,IAAI;AACrD,UAAM,UAAU,MAAM,aAAa;AACnC,UAAM,gBAAgB,MAAM,mBAAmB;AAE/C,YAAQ,iBAAiB;AAAA,MACvB,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,qBAAqB;AAAA,MACjE,iBAAiB,SAAS,MAAM,MAAM,eAAe;AAA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;gBAHA,aAAA;AAAA,gBACC,WAASJ,MAAA,MAAA;AAAA,gBACT,cAAY,MAAM;AAAA,cAAA;cASrBE,YA+BWF,MAAA,QAAA,GAAA,EA/BA,cAAYA,MAAA,MAAA,KAAM;AAAA,iCAC3B,MA6BM;AAAA,kBA7BNK,mBA6BM,OAAA;AAAA,oBA5BH,OAAKC;AAAAA,sBAAeN,MAAA,EAAA;AAAA;;;;;oBAOpB,uBAAY,oBAAkB,CAAA,MAAA,CAAA;AAAA,kBAAA;oBAE/BE,YAkBaF,MAAAO,WAAA,GAAA;AAAA,sBAlBD,YAAA;AAAA,sBAAS,SAAA;AAAA,sBAAQ,MAAA;AAAA,oBAAA;uCAC3B,MAgBmB;AAAA,wBAhBnBL,YAgBmBF,MAAAQ,WAAA,GAAA;AAAA,0BAfhB,uBAAqBR,MAAA,eAAA;AAAA,0BACtB,6BAAA;AAAA,0BACC,aAAW;AAAA,wBAAA;2CAEZ,MAUM;AAAA,4BAVNK,mBAUM,OAVNI,WAUM;AAAA,uCATA;AAAA,8BAAJ,KAAI;AAAA,8BACH,MAAMT,MAAA,IAAA;AAAA,8BACP,cAAW;AAAA,8BACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,8BACzB,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,4BAAA,GACnB,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,8BAEfF,WAAQ,KAAA,QAAA,SAAA;AAAA,4BAAA;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ModalContent.vue_vue_type_script_setup_true_lang-Co5jaeXk.js","sources":["../../src/presentation/overlays/modal/Modal.vue","../../src/presentation/overlays/modal/ModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\n\n/** Defines the ARIA dialog role a `Modal` exposes. */\nexport const ModalRole = {\n /** Refers to a standard dialog. */\n Dialog: 'dialog',\n /** Refers to an alert dialog that interrupts to convey an urgent message. */\n AlertDialog: 'alertdialog',\n} as const;\n\nexport type ModalRole = (typeof ModalRole)[keyof typeof ModalRole];\n\n/**\n * The value shared with `ModalTrigger` / `ModalContent`.\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 ModalContextValue {\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 modal closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n role: ComputedRef<ModalRole>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const modalContextKey: InjectionKey<ModalContextValue> = Symbol('wow-two.modal');\n\nexport function useModalContext(): ModalContextValue {\n const context = inject(modalContextKey, null);\n if (!context) throw new Error('Modal.* must be used inside <Modal>');\n return context;\n}\n\n/**\n * The prop surface of `Modal`.\n *\n * `open` and `isOpen` are the same controlled state under two names: `open` is\n * the `v-model:open` binding target, `isOpen` the house boolean spelling that\n * mirrors the rest of the port. `open` wins when both are set. React's\n * `onOpenChange` is the `open-change` emit; `update:open` fires alongside it so\n * `v-model:open` works.\n */\nexport interface ModalProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n open?: boolean;\n\n /** The open state, controlled — the house spelling of `open`; `open` wins when both are set. */\n isOpen?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n defaultOpen?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n dismissOnEscape?: boolean;\n\n /** The ARIA dialog role. Internal — `AlertModal` overrides this. */\n role?: ModalRole;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled, useId } from '../../../foundation/hooks';\n\n/**\n * State + a11y-id owner for a Modal tree. Renders only its slot — React\n * returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Modal', inheritAttrs: false });\n\n/** The Modal tree — `ModalTrigger` and `ModalContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `isOpen: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would make the modal read as explicitly-closed-and-controlled and\n * strand the uncontrolled path. Declaring the default as `undefined` keeps the\n * three states React had — absent / `true` / `false`.\n */\nconst props = withDefaults(defineProps<ModalProps>(), {\n open: undefined,\n isOpen: undefined,\n defaultOpen: false,\n dismissOnOutsideClick: true,\n dismissOnEscape: true,\n role: 'dialog',\n});\n\nconst emit = defineEmits<{\n /** The `v-model:open` half. */\n 'update:open': [open: boolean];\n /** Replaces React's `onOpenChange`. */\n 'open-change': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => (props.open !== undefined ? props.open : props.isOpen),\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n emit('open-change', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('modal-title');\nconst descriptionId = useId('modal-description');\n\nprovide(modalContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n role: computed(() => props.role),\n dismissOnOutsideClick: computed(() => props.dismissOnOutsideClick),\n dismissOnEscape: computed(() => props.dismissOnEscape),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport type {\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/utils';\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceVariants`; 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/utils`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** The backdrop-hide toggle — disables the default backdrop when true. */\n hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n isBlurred?: boolean;\n\n /** The visual recipe. Default `elevated`. */\n variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n padding?: SurfacePadding;\n\n /** The shadow depth. */\n elevation?: SurfaceElevation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs, useTemplateRef } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/utils';\nimport {\n DismissableLayer,\n FocusScope,\n Portal,\n Presence,\n ScrollLockProvider,\n} from '../../../foundation/primitives';\nimport Backdrop from '../backdrop/Backdrop.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/* The portalled dialog surface — scrim, focus trap, scroll lock, and the panel that carries the a11y contract. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = defineProps<ModalContentProps>();\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n requestAnimationFrame(() => context.triggerEl.value?.focus());\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\nconst classes = computed(() =>\n cn(\n 'relative w-full max-w-lg',\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\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/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `Backdrop`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <Backdrop\n v-if=\"!props.hideBackdrop\"\n is-inline\n :is-open=\"isOpen\"\n :is-blurred=\"props.isBlurred\"\n />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div\n :class=\"\n cn(\n 'group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n )\n \"\n @click.self=\"handleOutsideClick\"\n >\n <FocusScope as-child trapped loop>\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","Backdrop","_createElementVNode","_normalizeClass","FocusScope","DismissableLayer","_mergeProps"],"mappings":";;;;;;;;;;;AAIO,MAAM,YAAY;AAAA;AAAA,EAEvB,QAAQ;AAAA;AAAA,EAER,aAAa;AACf;AAwBO,MAAM,kBAAmD,OAAO,eAAe;AAE/E,SAAS,kBAAqC;AACnD,QAAM,UAAU,OAAO,iBAAiB,IAAI;AAC5C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qCAAqC;AACnE,SAAO;AACT;;;;;;;;;;;;;;AAoDA,UAAM,QAAQ;AASd,UAAM,OAAO;AAOb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAO,MAAM,SAAS,SAAY,MAAM,OAAO,MAAM;AAAA,MACjE,SAAS,MAAM,MAAM;AAAA,MACrB,UAAU,CAAC,UAAU;AACnB,aAAK,eAAe,KAAK;AACzB,aAAK,eAAe,KAAK;AAAA,MAC3B;AAAA,IAAA,CACD;AAED,UAAM,YAAY,WAA+B,IAAI;AACrD,UAAM,UAAU,MAAM,aAAa;AACnC,UAAM,gBAAgB,MAAM,mBAAmB;AAE/C,YAAQ,iBAAiB;AAAA,MACvB,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,qBAAqB;AAAA,MACjE,iBAAiB,SAAS,MAAM,MAAM,eAAe;AAAA,IAAA,CACtD;;aAICA,WAAQ,KAAA,QAAA,SAAA;AAAA;;;;;;;;;;;;;;;;;ACvEV,UAAM,QAAQ;AAEd,UAAM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QAAA,GAAA,EA/BA,cAAYA,MAAA,MAAA,KAAM;AAAA,iCAC3B,MA6BM;AAAA,kBA7BNK,mBA6BM,OAAA;AAAA,oBA5BH,OAAKC;AAAAA,sBAAeN,MAAA,EAAA;AAAA;;;;;oBAOpB,uBAAY,oBAAkB,CAAA,MAAA,CAAA;AAAA,kBAAA;oBAE/BE,YAkBaF,MAAAO,WAAA,GAAA;AAAA,sBAlBD,YAAA;AAAA,sBAAS,SAAA;AAAA,sBAAQ,MAAA;AAAA,oBAAA;uCAC3B,MAgBmB;AAAA,wBAhBnBL,YAgBmBF,MAAAQ,WAAA,GAAA;AAAA,0BAfhB,uBAAqBR,MAAA,eAAA;AAAA,0BACtB,6BAAA;AAAA,0BACC,aAAW;AAAA,wBAAA;2CAEZ,MAUM;AAAA,4BAVNK,mBAUM,OAVNI,WAUM;AAAA,uCATA;AAAA,8BAAJ,KAAI;AAAA,8BACH,MAAMT,MAAA,IAAA;AAAA,8BACP,cAAW;AAAA,8BACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,8BACzB,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,4BAAA,GACnB,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,8BAEfF,WAAQ,KAAA,QAAA,SAAA;AAAA,4BAAA;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,13 +9,13 @@ import { S as Side, c as composeEventHandlers } from "./Side-CSys3p-F.js";
|
|
|
9
9
|
import { u as useControlled } from "./useControlled-B6M4kTLn.js";
|
|
10
10
|
import { _ as _sfc_main$u } from "./Spinner.vue_vue_type_script_setup_true_lang-C4lNiUOm.js";
|
|
11
11
|
import { _ as _sfc_main$v, P as Politeness } from "./Announce.vue_vue_type_script_setup_true_lang-CDTltiIl.js";
|
|
12
|
-
import { _ as _sfc_main$w, a as _sfc_main$x } from "./DrawerContent.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { _ as _sfc_main$w, a as _sfc_main$x } from "./DrawerContent.vue_vue_type_script_setup_true_lang-4n5w3lg2.js";
|
|
13
13
|
import { u as useMediaQuery } from "./useMediaQuery-DwVcSgGk.js";
|
|
14
14
|
import { T as TransitionExtensions } from "./TransitionExtensions-hFi80JX2.js";
|
|
15
15
|
import { C as CssExtensions } from "./CssExtensions-BzLJG57F.js";
|
|
16
|
-
import { P as Presence } from "./Presence-
|
|
16
|
+
import { P as Presence } from "./Presence-DE4MlrJz.js";
|
|
17
17
|
import { P as Primitive } from "./Primitive-Cm3ECaVw.js";
|
|
18
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
18
|
+
import { s as surfaceVariants } from "./SurfaceStyles-B6W7zdMi.js";
|
|
19
19
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
20
20
|
...{ name: "Box", inheritAttrs: false },
|
|
21
21
|
__name: "Box",
|
|
@@ -937,7 +937,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
937
937
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
938
938
|
ref_key: "el",
|
|
939
939
|
ref: el,
|
|
940
|
-
"data-orientation":
|
|
940
|
+
"data-orientation": __props.orientation
|
|
941
941
|
}, rest.value, { class: classes.value }), [
|
|
942
942
|
renderSlot(_ctx.$slots, "default")
|
|
943
943
|
], 16, _hoisted_1$4);
|
|
@@ -1090,8 +1090,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1090
1090
|
"aria-valuenow": ariaValueNow.value,
|
|
1091
1091
|
"aria-valuemin": panelBefore.value?.minSize ?? 0,
|
|
1092
1092
|
"aria-valuemax": panelBefore.value?.maxSize ?? 100,
|
|
1093
|
-
"aria-disabled":
|
|
1094
|
-
tabindex:
|
|
1093
|
+
"aria-disabled": __props.isDisabled || void 0,
|
|
1094
|
+
tabindex: __props.isDisabled ? -1 : 0,
|
|
1095
1095
|
"data-dragging": dragging.value || void 0
|
|
1096
1096
|
}, rest.value, {
|
|
1097
1097
|
class: classes.value,
|
|
@@ -2070,4 +2070,4 @@ export {
|
|
|
2070
2070
|
_sfc_main$i as y,
|
|
2071
2071
|
_sfc_main$1 as z
|
|
2072
2072
|
};
|
|
2073
|
-
//# sourceMappingURL=Navbar.vue_vue_type_script_setup_true_lang-
|
|
2073
|
+
//# sourceMappingURL=Navbar.vue_vue_type_script_setup_true_lang-Cy0zvm5d.js.map
|