mood-ui 0.14.0 → 0.14.1
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/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +6 -6
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -7
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -7
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -7
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +5 -5
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +5 -5
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/morph-select/MorphSelectTrigger.cjs.map +1 -1
- package/dist/components/forms/morph-select/MorphSelectTrigger.mjs.map +1 -1
- package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/mood-ui.css +4 -14
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import Typography_default from "../data-display/Typography.mjs";
|
|
|
8
8
|
import { lockBodyScroll, unlockBodyScroll } from "../../composables/useBodyScrollLock.mjs";
|
|
9
9
|
import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx, withModifiers } from "vue";
|
|
10
10
|
import { XMarkIcon } from "@heroicons/vue/24/outline";
|
|
11
|
-
import { gsap } from "gsap";
|
|
11
|
+
import { gsap as gsap$1 } from "gsap";
|
|
12
12
|
//#region src/components/feedback/Modal.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var _hoisted_1 = ["data-modo-theme"];
|
|
14
14
|
var _hoisted_2 = ["data-modo-scrim"];
|
|
@@ -182,7 +182,7 @@ var Modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
182
182
|
}
|
|
183
183
|
activeTimeline?.kill();
|
|
184
184
|
if (prefersReducedMotion()) {
|
|
185
|
-
gsap.set([overlay, panel], {
|
|
185
|
+
gsap$1.set([overlay, panel], {
|
|
186
186
|
opacity: 1,
|
|
187
187
|
clearProps: "transform"
|
|
188
188
|
});
|
|
@@ -191,7 +191,7 @@ var Modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
191
191
|
}
|
|
192
192
|
const origin = !props.disableOriginAnimation ? getOriginEl() : null;
|
|
193
193
|
const pRect = panel.getBoundingClientRect();
|
|
194
|
-
const tl = gsap.timeline({ onComplete: () => {
|
|
194
|
+
const tl = gsap$1.timeline({ onComplete: () => {
|
|
195
195
|
activeTimeline = null;
|
|
196
196
|
done();
|
|
197
197
|
} });
|
|
@@ -245,7 +245,7 @@ var Modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
245
245
|
}
|
|
246
246
|
activeTimeline?.kill();
|
|
247
247
|
if (prefersReducedMotion()) {
|
|
248
|
-
gsap.to(overlay, {
|
|
248
|
+
gsap$1.to(overlay, {
|
|
249
249
|
opacity: 0,
|
|
250
250
|
duration: .12,
|
|
251
251
|
onComplete: () => {
|
|
@@ -257,7 +257,7 @@ var Modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
257
257
|
}
|
|
258
258
|
const origin = !props.disableOriginAnimation ? getOriginEl() : null;
|
|
259
259
|
const pRect = panel.getBoundingClientRect();
|
|
260
|
-
const tl = gsap.timeline({ onComplete: () => {
|
|
260
|
+
const tl = gsap$1.timeline({ onComplete: () => {
|
|
261
261
|
activeTimeline = null;
|
|
262
262
|
releaseScrollLock();
|
|
263
263
|
done();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../src/components/feedback/Modal.vue"],"sourcesContent":["<template> \n <Teleport to=\"body\"> \n <Transition :css=\"false\" @enter=\"onOverlayEnter\" @leave=\"onOverlayLeave\" appear> \n <div \n v-if=\"modelValue\" \n ref=\"overlayRef\" \n :class=\"[ \n 'modo-modal-overlay fixed inset-0 z-1200 flex opacity-0', \n positionClasses, \n ]\" \n :style=\"overlayStyle\" \n :data-modo-theme=\"scopedTheme || undefined\" \n @mousedown=\"onOverlayMouseDown\" \n @click=\"onOverlayClick\" \n > \n <!-- Scrim (shared Valux material, dark veil in both modes) -->\n <div\n aria-hidden=\"true\"\n class=\"modo-scrim pointer-events-none absolute inset-0\"\n :data-modo-scrim=\"scrimVariant\"\n />\n <div \n ref=\"panelRef\" \n data-modo-modal-panel \n role=\"dialog\" \n aria-modal=\"true\" \n :aria-labelledby=\"title ? titleId : undefined\" \n :aria-describedby=\"description ? descriptionId : undefined\" \n :aria-label=\"!title ? ariaLabel : undefined\" \n :class=\"[ \n 'modo-modal relative flex flex-col w-full bg-card text-foreground overflow-hidden', \n 'dark:bg-card/85 dark:backdrop-blur-xl', \n 'border border-border shadow-xl outline-none focus:outline-none focus-visible:outline-none', \n sizeClasses, \n radiusClasses, \n ]\" \n tabindex=\"-1\" \n @click.stop \n @keydown=\"onPanelKeydown\" \n > \n <!-- Inner border layer --> \n <span \n v-if=\"innerBorder\" \n aria-hidden=\"true\" \n :class=\"[ \n 'pointer-events-none absolute inset-1 border border-border/40', \n innerBorderRadiusClass, \n ]\" \n /> \n \n <!-- Close button (usa nuestro Button en modo icono) --> \n <div v-if=\"showClose\" class=\"absolute top-3 right-3 z-10\"> \n <Button \n variant=\"text\" \n size=\"small\" \n :color=\"resolvedColor\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"closeLabelText\" \n @click=\"close\" \n /> \n </div> \n \n <!-- Content wrapper --> \n <div ref=\"contentRef\" data-modo-modal-content class=\"flex flex-col min-h-0 flex-1\"> \n <!-- Header --> \n <header \n v-if=\"$slots.header || title || description\" \n :class=\"[ \n 'relative flex flex-col gap-1 px-6 pt-6', \n showClose ? 'pr-12' : '', \n $slots.default || $slots.body || $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"header\"> \n <Typography \n v-if=\"title\" \n :id=\"titleId\" \n variant=\"title\" \n size=\"medium\" \n as=\"h2\" \n weight=\"semibold\" \n > \n {{ title }} \n </Typography> \n <Typography \n v-if=\"description\" \n :id=\"descriptionId\" \n variant=\"body\" \n size=\"small\" \n color=\"muted\" \n > \n {{ description }} \n </Typography> \n </slot> \n </header> \n \n <!-- Body --> \n <div \n v-if=\"$slots.default || $slots.body\" \n :class=\"[ \n 'relative flex-1 overflow-auto px-6', \n ($slots.header || title || description) ? '' : 'pt-6', \n $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"body\"> \n <slot /> \n </slot> \n </div> \n \n <!-- Footer (divider respeta inner border con inset) --> \n <footer \n v-if=\"$slots.footer\" \n class=\"relative flex items-center justify-end gap-2 px-6 py-4\" \n > \n <span \n v-if=\"innerBorder\" \n aria-hidden=\"true\" \n class=\"pointer-events-none absolute top-0 left-1 right-1 h-px bg-border/40\" \n /> \n <span \n v-else \n aria-hidden=\"true\" \n class=\"pointer-events-none absolute top-0 left-0 right-0 h-px bg-border\" \n /> \n <slot name=\"footer\" :close=\"close\" /> \n </footer> \n </div> \n </div> \n </div> \n </Transition> \n </Teleport> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch } from 'vue'; \nimport { gsap } from 'gsap'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Button from '../forms/Button.vue'; \nimport Typography from '../data-display/Typography.vue'; \nimport type { Modal } from '../../interfaces/feedback/Modal.interface'; \nimport { \n useResolvedColor, \n useResolvedRadius, \n useResolvedTheme, \n useModoConfig, \n useModoLocale,\n} from '../../composables/useModoConfig'; \nimport { resolveColorMode } from '../../composables/useColorMode';\nimport { lockBodyScroll, unlockBodyScroll } from '../../composables/useBodyScrollLock';\nimport { palettesToCssVars, semanticTokensFromPalettes } from '../../config/palettes';\nimport { hexToOklchString, pickForegroundOklch } from '../../config/colorPrimitives';\nimport { surfacesToCssVars } from '../../config/surfaces'; \nimport type { ModoColor, ModoRadius } from '../../config/ModoConfig'; \n \nconst props = withDefaults(defineProps<Modal>(), { \n modelValue: false, \n size: 'medium', \n position: 'center', \n closeOnOverlay: true, \n closeOnEscape: true, \n showClose: true, \n lockScroll: true, \n color: 'default', \n overlay: 'blur', \n innerBorder: true, \n disableOriginAnimation: false, \n});\n// Close button label: prop wins, then the provider locale (`common.close`).\nconst loc = useModoLocale();\nconst closeLabelText = computed(() => props.closeLabel ?? loc.value.common.close);\n \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: boolean]; \n open: []; \n close: []; \n afterLeave: []; \n}>(); \n \nconst autoId = useId(); \nconst titleId = computed(() => `modo-modal-${autoId}-title`); \nconst descriptionId = computed(() => `modo-modal-${autoId}-desc`); \n \nconst overlayRef = ref<HTMLElement | null>(null); \nconst panelRef = ref<HTMLElement | null>(null); \nconst contentRef = ref<HTMLElement | null>(null); \n \nconst resolvedColor = useResolvedColor(() => props.color as ModoColor | undefined); \nconst resolvedRadius = useResolvedRadius(() => props.radius as ModoRadius | undefined); \n \nconst cfg = useModoConfig(); \nconst theme = useResolvedTheme(); \nconst scopedTheme = computed(() => resolveColorMode(theme.value)); \n \nconst overlayStyle = computed(() => { \n const providerVars = cfg?.value.palettes \n ? { \n ...palettesToCssVars(cfg.value.palettes), \n ...semanticTokensFromPalettes(cfg.value.palettes, hexToOklchString, pickForegroundOklch), \n } \n : {};\n const surfaceVars = cfg?.value.surfaces\n ? surfacesToCssVars(cfg.value.surfaces)\n : {};\n const darkSurfaceVars = (scopedTheme.value === 'dark' && cfg?.value.darkSurfaces)\n ? surfacesToCssVars(cfg.value.darkSurfaces)\n : {};\n return { ...providerVars, ...surfaceVars, ...darkSurfaceVars };\n}); \n \nfunction close() { \n if (!props.modelValue) return; \n emit('update:modelValue', false); \n emit('close'); \n} \n \n/* ---------- Click outside ---------- */ \nlet mouseDownOnOverlay = false; \nfunction onOverlayMouseDown(e: MouseEvent) { \n mouseDownOnOverlay = e.target === overlayRef.value; \n} \nfunction onOverlayClick(e: MouseEvent) { \n if (!props.closeOnOverlay) return; \n if (e.target !== overlayRef.value) return; \n if (!mouseDownOnOverlay) return; \n close(); \n} \n \n/* ---------- Keydown (Escape + focus trap) ---------- */ \nfunction onPanelKeydown(e: KeyboardEvent) { \n if (props.closeOnEscape && e.key === 'Escape') { \n e.preventDefault(); \n close(); \n return; \n } \n if (e.key === 'Tab' && panelRef.value) { \n const focusables = getFocusable(panelRef.value); \n if (focusables.length === 0) { \n e.preventDefault(); \n return; \n } \n const first = focusables[0]; \n const last = focusables[focusables.length - 1]; \n const active = document.activeElement as HTMLElement | null; \n if (e.shiftKey && active === first) { \n e.preventDefault(); \n last.focus(); \n } else if (!e.shiftKey && active === last) { \n e.preventDefault(); \n first.focus(); \n } \n } \n} \n \nconst FOCUSABLE_SELECTOR = \n 'a[href], area[href], input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]'; \n \nfunction getFocusable(container: HTMLElement): HTMLElement[] { \n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) \n .filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null); \n} \n \n/* ---------- Animations (staged open/close) ---------- */ \n \nfunction prefersReducedMotion() { \n return typeof window !== 'undefined' \n && window.matchMedia('(prefers-reduced-motion: reduce)').matches; \n} \n \nlet capturedOrigin: HTMLElement | null = null; \nlet lastPointerTrigger: { el: HTMLElement; time: number } | null = null;\n\nfunction onWindowPointerDown(e: PointerEvent) {\n const target = e.target as Element | null;\n const trigger = target?.closest?.('button, a, [role=\"button\"], [tabindex]') as HTMLElement | null;\n if (trigger) {\n lastPointerTrigger = { el: trigger, time: Date.now() };\n }\n}\n\nfunction getOriginEl(): HTMLElement | null { \n if (props.origin) return props.origin; \n return capturedOrigin; \n} \n \nlet activeTimeline: gsap.core.Timeline | null = null; \n \nfunction onOverlayEnter(el: Element, done: () => void) { \n const overlay = (el as HTMLElement) ?? overlayRef.value; \n const panel = \n overlay?.querySelector<HTMLElement>('[data-modo-modal-panel]') \n ?? panelRef.value; \n if (!overlay || !panel) { done(); return; } \n \n activeTimeline?.kill(); \n \n if (prefersReducedMotion()) { \n gsap.set([overlay, panel], { opacity: 1, clearProps: 'transform' }); \n done(); \n return; \n } \n \n const origin = !props.disableOriginAnimation ? getOriginEl() : null; \n const pRect = panel.getBoundingClientRect(); \n \n const tl = gsap.timeline({ onComplete: () => { activeTimeline = null; done(); } }); \n activeTimeline = tl; \n \n // 1. Overlay fade in \n tl.fromTo(overlay, { opacity: 0 }, { opacity: 1, duration: 0.25, ease: 'power2.out' }, 0); \n \n // 2. Panel + contenido emergen juntos desde el trigger hasta su tamaño real\n if (origin && document.body.contains(origin)) { \n const oRect = origin.getBoundingClientRect(); \n const dx = oRect.left + oRect.width / 2 - (pRect.left + pRect.width / 2); \n const dy = oRect.top + oRect.height / 2 - (pRect.top + pRect.height / 2); \n const scaleX = Math.max(oRect.width / pRect.width, 0.05); \n const scaleY = Math.max(oRect.height / pRect.height, 0.05); \n tl.fromTo( \n panel, \n { x: dx, y: dy, scaleX, scaleY, opacity: 0.85, transformOrigin: 'center center' }, \n { x: 0, y: 0, scaleX: 1, scaleY: 1, opacity: 1, duration: 0.5, ease: 'power3.out' }, \n 0.05, \n ); \n } else { \n tl.fromTo( \n panel, \n { y: 16, scale: 0.95, opacity: 0 }, \n { y: 0, scale: 1, opacity: 1, duration: 0.35, ease: 'power2.out' }, \n 0, \n ); \n } \n} \n \nfunction onOverlayLeave(el: Element, done: () => void) { \n // Durante el leave, los template refs de Vue ya fueron desvinculados, \n // así que resolvemos los nodos desde el elemento que Transition nos entrega. \n const overlay = el as HTMLElement; \n const panel = \n overlay.querySelector<HTMLElement>('[data-modo-modal-panel]') \n ?? panelRef.value; \n // Bail out without animating, but never without releasing the lock — this\n // path is the one that used to strand `overflow: hidden` on <body>.\n if (!overlay || !panel) { releaseScrollLock(); done(); return; }\n\n activeTimeline?.kill();\n\n if (prefersReducedMotion()) {\n gsap.to(overlay, {\n opacity: 0,\n duration: 0.12,\n onComplete: () => { releaseScrollLock(); done(); },\n });\n return;\n }\n\n const origin = !props.disableOriginAnimation ? getOriginEl() : null; \n const pRect = panel.getBoundingClientRect(); \n \n const tl = gsap.timeline({ \n onComplete: () => { \n activeTimeline = null; \n releaseScrollLock(); \n done(); \n }, \n }); \n activeTimeline = tl; \n \n // El panel regresa con todo su contenido visible hacia su lugar de origen;\n // el overlay (padre del panel) solo cae en opacidad al final del recorrido\n // para no ocultar el vuelo de regreso antes de llegar al trigger.\n if (origin && document.body.contains(origin)) { \n const oRect = origin.getBoundingClientRect(); \n const dx = oRect.left + oRect.width / 2 - (pRect.left + pRect.width / 2); \n const dy = oRect.top + oRect.height / 2 - (pRect.top + pRect.height / 2); \n const scaleX = Math.max(oRect.width / pRect.width, 0.05); \n const scaleY = Math.max(oRect.height / pRect.height, 0.05); \n tl.to( \n panel, \n { x: dx, y: dy, scaleX, scaleY, transformOrigin: 'center center', duration: 0.38, ease: 'power3.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.28, ease: 'power3.in' }, 0.1); \n } else { \n tl.to( \n panel, \n { y: 10, scale: 0.95, opacity: 0, duration: 0.24, ease: 'power2.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.24, ease: 'power2.in' }, 0.04); \n } \n} \n \n/* ---------- Scroll lock + focus management ---------- */\nlet previouslyFocused: HTMLElement | null = null;\nlet scrollLocked = false;\n\nfunction releaseScrollLock() {\n if (!scrollLocked) return;\n scrollLocked = false;\n unlockBodyScroll();\n}\n\nonMounted(() => {\n if (typeof window !== 'undefined') {\n window.addEventListener('pointerdown', onWindowPointerDown, { capture: true, passive: true });\n }\n});\n\nwatch( \n () => props.modelValue, \n (open) => { \n if (open) { \n const active = document.activeElement as HTMLElement | null; \n const recentPointer =\n lastPointerTrigger\n && Date.now() - lastPointerTrigger.time < 600\n && document.body.contains(lastPointerTrigger.el)\n ? lastPointerTrigger.el\n : null;\n const triggerEl =\n active && active !== document.body && active !== document.documentElement\n ? active\n : recentPointer;\n previouslyFocused = triggerEl; \n capturedOrigin = triggerEl; \n \n if (props.lockScroll && !scrollLocked) {\n scrollLocked = true;\n lockBodyScroll();\n }\n emit('open'); \n nextTick(() => { \n if (!panelRef.value) return; \n const focusables = getFocusable(panelRef.value); \n (focusables[0] ?? panelRef.value).focus(); \n }); \n } else { \n // El scroll lock se libera en onOverlayLeave cuando termina la \n // animación, para evitar que aparezca el scrollbar y empuje el \n // modal antes de que desaparezca. \n if (previouslyFocused && typeof previouslyFocused.focus === 'function') { \n previouslyFocused.focus(); \n } \n previouslyFocused = null; \n emit('afterLeave'); \n } \n }, \n); \n \nonBeforeUnmount(() => { \n if (typeof window !== 'undefined') {\n window.removeEventListener('pointerdown', onWindowPointerDown, { capture: true });\n }\n activeTimeline?.kill(); \n releaseScrollLock(); \n}); \n \n/* ---------- Style maps ---------- */ \nconst sizeClasses = computed(() => { \n switch (props.size) { \n case 'xsmall': return 'max-w-xs';\n case 'small': return 'max-w-sm'; \n case 'large': return 'max-w-2xl'; \n case 'xlarge': return 'max-w-4xl'; \n case 'full': return 'max-w-none w-[calc(100vw-2rem)] h-[calc(100vh-2rem)]'; \n default: return 'max-w-md'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n if (props.size === 'full') return 'rounded-xl'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-md'; \n case 'large': return 'rounded-2xl'; \n case 'full': return 'rounded-3xl'; \n default: return 'rounded-xl'; \n } \n}); \n \nconst innerBorderRadiusClass = computed(() => { \n if (props.size === 'full') return 'rounded-lg'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-[calc(1.5rem-4px)]'; \n default: return 'rounded-lg'; \n } \n}); \n \nconst positionClasses = computed(() => { \n if (props.position === 'top') return 'items-start justify-center p-4 sm:p-6 pt-[10vh]'; \n return 'items-center justify-center p-4 sm:p-6'; \n}); \n \nconst scrimVariant = computed(() => props.overlay ?? 'blur'); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+PA,IAAM,qBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EArGJ,MAAM,QAAQ;EAcd,MAAM,MAAM,eAAe;EAC3B,MAAM,iBAAiB,eAAe,MAAM,cAAc,IAAI,MAAM,OAAO,MAAM;EAGjF,MAAM,OAAO;EAOb,MAAM,SAAS,OAAO;EACtB,MAAM,UAAU,eAAe,cAAc,OAAO,QAAQ;EAC5D,MAAM,gBAAgB,eAAe,cAAc,OAAO,OAAO;EAEjE,MAAM,aAAa,IAAwB,KAAK;EAChD,MAAM,WAAW,IAAwB,KAAK;EAC9C,MAAM,aAAa,IAAwB,KAAK;EAEhD,MAAM,gBAAgB,uBAAuB,MAAM,MAA+B;EAClF,MAAM,iBAAiB,wBAAwB,MAAM,OAAiC;EAEtF,MAAM,MAAM,eAAe;EAC3B,MAAM,QAAQ,kBAAkB;EAChC,MAAM,cAAc,eAAe,iBAAiB,MAAM,MAAM,CAAC;EAEjE,MAAM,eAAe,eAAe;GAChC,MAAM,eAAe,KAAK,MAAM,WAC1B;IACE,GAAG,kBAAkB,IAAI,MAAM,SAAS;IACxC,GAAG,2BAA2B,IAAI,MAAM,UAAU,kBAAkB,oBAAoB;IAC3F,GACC,EAAE;GACR,MAAM,cAAc,KAAK,MAAM,WACzB,kBAAkB,IAAI,MAAM,SAAQ,GACpC,EAAE;GACR,MAAM,kBAAmB,YAAY,UAAU,UAAU,KAAK,MAAM,eAC9D,kBAAkB,IAAI,MAAM,aAAY,GACxC,EAAE;GACR,OAAO;IAAE,GAAG;IAAc,GAAG;I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O,UAAU,QAAA,SAAS,QAAA,cAAW,KAAA;QAAkDA,KAAAA,OAAO,SAAM,SAAA;;UAMvN,WAEO,KAAA,QAAA,QAAA,EAAA,QAAA,CADH,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;MAMNA,KAAAA,OAAO,UAAA,WAAA,EADjB,mBAeS,UAfT,YAeS,CAVK,QAAA,eAAA,WAAA,EADV,mBAIE,QAJF,WAIE,KAAA,WAAA,EACF,mBAIE,QAJF,WAIE,GACF,WAAqC,KAAA,QAAA,UAAA,EAAT,OAAK,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"Modal.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../src/components/feedback/Modal.vue"],"sourcesContent":["<template> \n <Teleport to=\"body\"> \n <Transition :css=\"false\" @enter=\"onOverlayEnter\" @leave=\"onOverlayLeave\" appear> \n <div \n v-if=\"modelValue\" \n ref=\"overlayRef\" \n :class=\"[ \n 'modo-modal-overlay fixed inset-0 z-1200 flex opacity-0', \n positionClasses, \n ]\" \n :style=\"overlayStyle\" \n :data-modo-theme=\"scopedTheme || undefined\" \n @mousedown=\"onOverlayMouseDown\" \n @click=\"onOverlayClick\" \n > \n <!-- Scrim (shared Valux material, dark veil in both modes) -->\n <div\n aria-hidden=\"true\"\n class=\"modo-scrim pointer-events-none absolute inset-0\"\n :data-modo-scrim=\"scrimVariant\"\n />\n <div \n ref=\"panelRef\" \n data-modo-modal-panel \n role=\"dialog\" \n aria-modal=\"true\" \n :aria-labelledby=\"title ? titleId : undefined\" \n :aria-describedby=\"description ? descriptionId : undefined\" \n :aria-label=\"!title ? ariaLabel : undefined\" \n :class=\"[ \n 'modo-modal relative flex flex-col w-full bg-card text-foreground overflow-hidden', \n 'dark:bg-card/85 dark:backdrop-blur-xl', \n 'border border-border shadow-xl outline-none focus:outline-none focus-visible:outline-none', \n sizeClasses, \n radiusClasses, \n ]\" \n tabindex=\"-1\" \n @click.stop \n @keydown=\"onPanelKeydown\" \n > \n <!-- Inner border layer --> \n <span \n v-if=\"innerBorder\" \n aria-hidden=\"true\" \n :class=\"[ \n 'pointer-events-none absolute inset-1 border border-border/40', \n innerBorderRadiusClass, \n ]\" \n /> \n \n <!-- Close button (usa nuestro Button en modo icono) --> \n <div v-if=\"showClose\" class=\"absolute top-3 right-3 z-10\"> \n <Button \n variant=\"text\" \n size=\"small\" \n :color=\"resolvedColor\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"closeLabelText\" \n @click=\"close\" \n /> \n </div> \n \n <!-- Content wrapper --> \n <div ref=\"contentRef\" data-modo-modal-content class=\"flex flex-col min-h-0 flex-1\"> \n <!-- Header --> \n <header \n v-if=\"$slots.header || title || description\" \n :class=\"[ \n 'relative flex flex-col gap-1 px-6 pt-6', \n showClose ? 'pr-12' : '', \n $slots.default || $slots.body || $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"header\"> \n <Typography \n v-if=\"title\" \n :id=\"titleId\" \n variant=\"title\" \n size=\"medium\" \n as=\"h2\" \n weight=\"semibold\" \n > \n {{ title }} \n </Typography> \n <Typography \n v-if=\"description\" \n :id=\"descriptionId\" \n variant=\"body\" \n size=\"small\" \n color=\"muted\" \n > \n {{ description }} \n </Typography> \n </slot> \n </header> \n \n <!-- Body --> \n <div \n v-if=\"$slots.default || $slots.body\" \n :class=\"[ \n 'relative flex-1 overflow-auto px-6', \n ($slots.header || title || description) ? '' : 'pt-6', \n $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"body\"> \n <slot /> \n </slot> \n </div> \n \n <!-- Footer (divider respeta inner border con inset) --> \n <footer \n v-if=\"$slots.footer\" \n class=\"relative flex items-center justify-end gap-2 px-6 py-4\" \n > \n <span \n v-if=\"innerBorder\" \n aria-hidden=\"true\" \n class=\"pointer-events-none absolute top-0 left-1 right-1 h-px bg-border/40\" \n /> \n <span \n v-else \n aria-hidden=\"true\" \n class=\"pointer-events-none absolute top-0 left-0 right-0 h-px bg-border\" \n /> \n <slot name=\"footer\" :close=\"close\" /> \n </footer> \n </div> \n </div> \n </div> \n </Transition> \n </Teleport> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch } from 'vue'; \nimport { gsap } from 'gsap'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Button from '../forms/Button.vue'; \nimport Typography from '../data-display/Typography.vue'; \nimport type { Modal } from '../../interfaces/feedback/Modal.interface'; \nimport { \n useResolvedColor, \n useResolvedRadius, \n useResolvedTheme, \n useModoConfig, \n useModoLocale,\n} from '../../composables/useModoConfig'; \nimport { resolveColorMode } from '../../composables/useColorMode';\nimport { lockBodyScroll, unlockBodyScroll } from '../../composables/useBodyScrollLock';\nimport { palettesToCssVars, semanticTokensFromPalettes } from '../../config/palettes';\nimport { hexToOklchString, pickForegroundOklch } from '../../config/colorPrimitives';\nimport { surfacesToCssVars } from '../../config/surfaces'; \nimport type { ModoColor, ModoRadius } from '../../config/ModoConfig'; \n \nconst props = withDefaults(defineProps<Modal>(), { \n modelValue: false, \n size: 'medium', \n position: 'center', \n closeOnOverlay: true, \n closeOnEscape: true, \n showClose: true, \n lockScroll: true, \n color: 'default', \n overlay: 'blur', \n innerBorder: true, \n disableOriginAnimation: false, \n});\n// Close button label: prop wins, then the provider locale (`common.close`).\nconst loc = useModoLocale();\nconst closeLabelText = computed(() => props.closeLabel ?? loc.value.common.close);\n \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: boolean]; \n open: []; \n close: []; \n afterLeave: []; \n}>(); \n \nconst autoId = useId(); \nconst titleId = computed(() => `modo-modal-${autoId}-title`); \nconst descriptionId = computed(() => `modo-modal-${autoId}-desc`); \n \nconst overlayRef = ref<HTMLElement | null>(null); \nconst panelRef = ref<HTMLElement | null>(null); \nconst contentRef = ref<HTMLElement | null>(null); \n \nconst resolvedColor = useResolvedColor(() => props.color as ModoColor | undefined); \nconst resolvedRadius = useResolvedRadius(() => props.radius as ModoRadius | undefined); \n \nconst cfg = useModoConfig(); \nconst theme = useResolvedTheme(); \nconst scopedTheme = computed(() => resolveColorMode(theme.value)); \n \nconst overlayStyle = computed(() => { \n const providerVars = cfg?.value.palettes \n ? { \n ...palettesToCssVars(cfg.value.palettes), \n ...semanticTokensFromPalettes(cfg.value.palettes, hexToOklchString, pickForegroundOklch), \n } \n : {};\n const surfaceVars = cfg?.value.surfaces\n ? surfacesToCssVars(cfg.value.surfaces)\n : {};\n const darkSurfaceVars = (scopedTheme.value === 'dark' && cfg?.value.darkSurfaces)\n ? surfacesToCssVars(cfg.value.darkSurfaces)\n : {};\n return { ...providerVars, ...surfaceVars, ...darkSurfaceVars };\n}); \n \nfunction close() { \n if (!props.modelValue) return; \n emit('update:modelValue', false); \n emit('close'); \n} \n \n/* ---------- Click outside ---------- */ \nlet mouseDownOnOverlay = false; \nfunction onOverlayMouseDown(e: MouseEvent) { \n mouseDownOnOverlay = e.target === overlayRef.value; \n} \nfunction onOverlayClick(e: MouseEvent) { \n if (!props.closeOnOverlay) return; \n if (e.target !== overlayRef.value) return; \n if (!mouseDownOnOverlay) return; \n close(); \n} \n \n/* ---------- Keydown (Escape + focus trap) ---------- */ \nfunction onPanelKeydown(e: KeyboardEvent) { \n if (props.closeOnEscape && e.key === 'Escape') { \n e.preventDefault(); \n close(); \n return; \n } \n if (e.key === 'Tab' && panelRef.value) { \n const focusables = getFocusable(panelRef.value); \n if (focusables.length === 0) { \n e.preventDefault(); \n return; \n } \n const first = focusables[0]; \n const last = focusables[focusables.length - 1]; \n const active = document.activeElement as HTMLElement | null; \n if (e.shiftKey && active === first) { \n e.preventDefault(); \n last.focus(); \n } else if (!e.shiftKey && active === last) { \n e.preventDefault(); \n first.focus(); \n } \n } \n} \n \nconst FOCUSABLE_SELECTOR = \n 'a[href], area[href], input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]'; \n \nfunction getFocusable(container: HTMLElement): HTMLElement[] { \n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) \n .filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null); \n} \n \n/* ---------- Animations (staged open/close) ---------- */ \n \nfunction prefersReducedMotion() { \n return typeof window !== 'undefined' \n && window.matchMedia('(prefers-reduced-motion: reduce)').matches; \n} \n \nlet capturedOrigin: HTMLElement | null = null; \nlet lastPointerTrigger: { el: HTMLElement; time: number } | null = null;\n\nfunction onWindowPointerDown(e: PointerEvent) {\n const target = e.target as Element | null;\n const trigger = target?.closest?.('button, a, [role=\"button\"], [tabindex]') as HTMLElement | null;\n if (trigger) {\n lastPointerTrigger = { el: trigger, time: Date.now() };\n }\n}\n\nfunction getOriginEl(): HTMLElement | null { \n if (props.origin) return props.origin; \n return capturedOrigin; \n} \n \nlet activeTimeline: gsap.core.Timeline | null = null; \n \nfunction onOverlayEnter(el: Element, done: () => void) { \n const overlay = (el as HTMLElement) ?? overlayRef.value; \n const panel = \n overlay?.querySelector<HTMLElement>('[data-modo-modal-panel]') \n ?? panelRef.value; \n if (!overlay || !panel) { done(); return; } \n \n activeTimeline?.kill(); \n \n if (prefersReducedMotion()) { \n gsap.set([overlay, panel], { opacity: 1, clearProps: 'transform' }); \n done(); \n return; \n } \n \n const origin = !props.disableOriginAnimation ? getOriginEl() : null; \n const pRect = panel.getBoundingClientRect(); \n \n const tl = gsap.timeline({ onComplete: () => { activeTimeline = null; done(); } }); \n activeTimeline = tl; \n \n // 1. Overlay fade in \n tl.fromTo(overlay, { opacity: 0 }, { opacity: 1, duration: 0.25, ease: 'power2.out' }, 0); \n \n // 2. Panel + contenido emergen juntos desde el trigger hasta su tamaño real\n if (origin && document.body.contains(origin)) { \n const oRect = origin.getBoundingClientRect(); \n const dx = oRect.left + oRect.width / 2 - (pRect.left + pRect.width / 2); \n const dy = oRect.top + oRect.height / 2 - (pRect.top + pRect.height / 2); \n const scaleX = Math.max(oRect.width / pRect.width, 0.05); \n const scaleY = Math.max(oRect.height / pRect.height, 0.05); \n tl.fromTo( \n panel, \n { x: dx, y: dy, scaleX, scaleY, opacity: 0.85, transformOrigin: 'center center' }, \n { x: 0, y: 0, scaleX: 1, scaleY: 1, opacity: 1, duration: 0.5, ease: 'power3.out' }, \n 0.05, \n ); \n } else { \n tl.fromTo( \n panel, \n { y: 16, scale: 0.95, opacity: 0 }, \n { y: 0, scale: 1, opacity: 1, duration: 0.35, ease: 'power2.out' }, \n 0, \n ); \n } \n} \n \nfunction onOverlayLeave(el: Element, done: () => void) { \n // Durante el leave, los template refs de Vue ya fueron desvinculados, \n // así que resolvemos los nodos desde el elemento que Transition nos entrega. \n const overlay = el as HTMLElement; \n const panel = \n overlay.querySelector<HTMLElement>('[data-modo-modal-panel]') \n ?? panelRef.value; \n // Bail out without animating, but never without releasing the lock — this\n // path is the one that used to strand `overflow: hidden` on <body>.\n if (!overlay || !panel) { releaseScrollLock(); done(); return; }\n\n activeTimeline?.kill();\n\n if (prefersReducedMotion()) {\n gsap.to(overlay, {\n opacity: 0,\n duration: 0.12,\n onComplete: () => { releaseScrollLock(); done(); },\n });\n return;\n }\n\n const origin = !props.disableOriginAnimation ? getOriginEl() : null; \n const pRect = panel.getBoundingClientRect(); \n \n const tl = gsap.timeline({ \n onComplete: () => { \n activeTimeline = null; \n releaseScrollLock(); \n done(); \n }, \n }); \n activeTimeline = tl; \n \n // El panel regresa con todo su contenido visible hacia su lugar de origen;\n // el overlay (padre del panel) solo cae en opacidad al final del recorrido\n // para no ocultar el vuelo de regreso antes de llegar al trigger.\n if (origin && document.body.contains(origin)) { \n const oRect = origin.getBoundingClientRect(); \n const dx = oRect.left + oRect.width / 2 - (pRect.left + pRect.width / 2); \n const dy = oRect.top + oRect.height / 2 - (pRect.top + pRect.height / 2); \n const scaleX = Math.max(oRect.width / pRect.width, 0.05); \n const scaleY = Math.max(oRect.height / pRect.height, 0.05); \n tl.to( \n panel, \n { x: dx, y: dy, scaleX, scaleY, transformOrigin: 'center center', duration: 0.38, ease: 'power3.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.28, ease: 'power3.in' }, 0.1); \n } else { \n tl.to( \n panel, \n { y: 10, scale: 0.95, opacity: 0, duration: 0.24, ease: 'power2.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.24, ease: 'power2.in' }, 0.04); \n } \n} \n \n/* ---------- Scroll lock + focus management ---------- */\nlet previouslyFocused: HTMLElement | null = null;\nlet scrollLocked = false;\n\nfunction releaseScrollLock() {\n if (!scrollLocked) return;\n scrollLocked = false;\n unlockBodyScroll();\n}\n\nonMounted(() => {\n if (typeof window !== 'undefined') {\n window.addEventListener('pointerdown', onWindowPointerDown, { capture: true, passive: true });\n }\n});\n\nwatch( \n () => props.modelValue, \n (open) => { \n if (open) { \n const active = document.activeElement as HTMLElement | null; \n const recentPointer =\n lastPointerTrigger\n && Date.now() - lastPointerTrigger.time < 600\n && document.body.contains(lastPointerTrigger.el)\n ? lastPointerTrigger.el\n : null;\n const triggerEl =\n active && active !== document.body && active !== document.documentElement\n ? active\n : recentPointer;\n previouslyFocused = triggerEl; \n capturedOrigin = triggerEl; \n \n if (props.lockScroll && !scrollLocked) {\n scrollLocked = true;\n lockBodyScroll();\n }\n emit('open'); \n nextTick(() => { \n if (!panelRef.value) return; \n const focusables = getFocusable(panelRef.value); \n (focusables[0] ?? panelRef.value).focus(); \n }); \n } else { \n // El scroll lock se libera en onOverlayLeave cuando termina la \n // animación, para evitar que aparezca el scrollbar y empuje el \n // modal antes de que desaparezca. \n if (previouslyFocused && typeof previouslyFocused.focus === 'function') { \n previouslyFocused.focus(); \n } \n previouslyFocused = null; \n emit('afterLeave'); \n } \n }, \n); \n \nonBeforeUnmount(() => { \n if (typeof window !== 'undefined') {\n window.removeEventListener('pointerdown', onWindowPointerDown, { capture: true });\n }\n activeTimeline?.kill(); \n releaseScrollLock(); \n}); \n \n/* ---------- Style maps ---------- */ \nconst sizeClasses = computed(() => { \n switch (props.size) { \n case 'xsmall': return 'max-w-xs';\n case 'small': return 'max-w-sm'; \n case 'large': return 'max-w-2xl'; \n case 'xlarge': return 'max-w-4xl'; \n case 'full': return 'max-w-none w-[calc(100vw-2rem)] h-[calc(100vh-2rem)]'; \n default: return 'max-w-md'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n if (props.size === 'full') return 'rounded-xl'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-md'; \n case 'large': return 'rounded-2xl'; \n case 'full': return 'rounded-3xl'; \n default: return 'rounded-xl'; \n } \n}); \n \nconst innerBorderRadiusClass = computed(() => { \n if (props.size === 'full') return 'rounded-lg'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-[calc(1.5rem-4px)]'; \n default: return 'rounded-lg'; \n } \n}); \n \nconst positionClasses = computed(() => { \n if (props.position === 'top') return 'items-start justify-center p-4 sm:p-6 pt-[10vh]'; \n return 'items-center justify-center p-4 sm:p-6'; \n}); \n \nconst scrimVariant = computed(() => props.overlay ?? 'blur'); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+PA,IAAM,qBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EArGJ,MAAM,QAAQ;EAcd,MAAM,MAAM,eAAe;EAC3B,MAAM,iBAAiB,eAAe,MAAM,cAAc,IAAI,MAAM,OAAO,MAAM;EAGjF,MAAM,OAAO;EAOb,MAAM,SAAS,OAAO;EACtB,MAAM,UAAU,eAAe,cAAc,OAAO,QAAQ;EAC5D,MAAM,gBAAgB,eAAe,cAAc,OAAO,OAAO;EAEjE,MAAM,aAAa,IAAwB,KAAK;EAChD,MA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BS,UAAA;;OA3BJ,OAAK,eAAA;;QAAgH,QAAA,YAAS,UAAA;QAAkDA,KAAAA,OAAO,WAAWA,KAAAA,OAAO,QAAQA,KAAAA,OAAO,SAAM,SAAA;;UAM/N,WAoBO,KAAA,QAAA,UAAA,EAAA,QAAA,CAlBO,QAAA,SAAA,WAAA,EADV,YASa,oBAAA;;OAPR,IAAI,QAAA;OACL,SAAQ;OACR,MAAK;OACL,IAAG;OACH,QAAO;;8BAEI,CAAA,gBAAA,gBAAR,QAAA,MAAK,EAAA,EAAA,CAAA,CAAA;;qDAGF,QAAA,eAAA,WAAA,EADV,YAQa,oBAAA;;OANR,IAAI,cAAA;OACL,SAAQ;OACR,MAAK;OACL,OAAM;;8BAEW,CAAA,gBAAA,gBAAd,QAAA,YAAW,EAAA,EAAA,CAAA,CAAA;;;MAOhBA,KAAAA,OAAO,WAAWA,KAAAA,OAAO,QAAA,WAAA,EADnC,mBAWM,OAAA;;OATD,OAAK,eAAA;;QAA6GA,KAAAA,OAAO,UAAU,QAAA,SAAS,QAAA,cAAW,KAAA;QAAkDA,KAAAA,OAAO,SAAM,SAAA;;UAMvN,WAEO,KAAA,QAAA,QAAA,EAAA,QAAA,CADH,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;MAMNA,KAAAA,OAAO,UAAA,WAAA,EADjB,mBAeS,UAfT,YAeS,CAVK,QAAA,eAAA,WAAA,EADV,mBAIE,QAJF,WAIE,KAAA,WAAA,EACF,mBAIE,QAJF,WAIE,GACF,WAAqC,KAAA,QAAA,UAAA,EAAT,OAAK,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MorphSelectTrigger.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MorphSelectTrigger.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MorphSelectTrigger.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MorphSelectTrigger.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -75,7 +75,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
75
75
|
}
|
|
76
76
|
return (_ctx, _cache) => {
|
|
77
77
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
78
|
-
class: (0, vue.normalizeClass)(["modo-morph-select flex flex-col", (0, vue.unref)(fullWidth) ? "w-full" : "inline-flex"]),
|
|
78
|
+
class: (0, vue.normalizeClass)(["modo-morph-select flex flex-col gap-1.5", (0, vue.unref)(fullWidth) ? "w-full" : "inline-flex"]),
|
|
79
79
|
"data-modo-morph-select": "",
|
|
80
80
|
"data-modo-size": (0, vue.unref)(size),
|
|
81
81
|
"data-modo-radius": (0, vue.unref)(radius),
|
|
@@ -84,7 +84,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
84
84
|
(0, vue.unref)(label) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", {
|
|
85
85
|
key: 0,
|
|
86
86
|
for: (0, vue.unref)(fieldId),
|
|
87
|
-
class: "modo-morph-select__label"
|
|
87
|
+
class: "modo-morph-select__label text-caption font-medium text-foreground"
|
|
88
88
|
}, [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(label)) + " ", 1), (0, vue.unref)(required) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3, "*")) : (0, vue.createCommentVNode)("", true)], 8, _hoisted_2)) : (0, vue.createCommentVNode)("", true),
|
|
89
89
|
(0, vue.createElementVNode)("div", {
|
|
90
90
|
ref_key: "trigger",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs","$slots"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,UAAU,iBAAiB,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,YACrH,QAAQ,MAAM,MAAM,WAAW,SAAS,UAAU,aAAa,OAAO,MAAM,SAAS,QAAQ,YAC3F,2BAAA,gBAAe;EACnB,MAAM,MAAM,sBAAA,eAAc;EAC1B,MAAM,KAAK,sBAAA,oBAAoB,KAAK,MAAK;EACzC,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAAE,eAAe,MAAM;GAAS;GAAY;GAAU;GAAQ;GAAM,CAAA;EACrI,MAAM,uBAAA,GAAA,IAAA,gBAAqC,iBAAA,+BAA+B,WAAW,UAAU,wBAAuB;EAEtH,MAAM,UAAA,GAAA,IAAA,KAAa,MAAK;EACxB,IAAI;EACJ,CAAA,GAAA,IAAA,OAAM,QAAQ,MAAM,aAAa;GAC/B,IAAI,aAAa,aAAa,SAAS,UAAU;IAC/C,OAAO,QAAQ;IAAM,aAAa,YAAW;IAC7C,cAAc,iBAAiB;KAAE,OAAO,QAAQ;OAAS,IAAG;;IAE/D;EACD,CAAA,GAAA,IAAA,uBAAsB,aAAa,YAAY,CAAA;EAC/C,MAAM,YAAA,GAAA,IAAA,gBAA0B,gBAAgB,MAAM,GAAE;EAExD,MAAM,WAAA,GAAA,IAAA,gBAAyB,gBAAgB,MAAM,KAAI,WAAU,OAAO,aAAa,OAAO,OAAO,MAAM,CAAC,CAAC,KAAK,KAAK,CAAA;EACvH,MAAM,YAAA,GAAA,IAAA,gBAA0B,gBAAgB,MAAM,SAAS,EAAC;EAChE,SAAS,IAAI,OAAsB;GAAE,IAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,WAAW;IAAE,MAAM,gBAAgB;IAAE,QAAQ,KAAK;;;;4DA8B9H,OAAA;IA3BA,QAAA,GAAA,IAAA,gBAAK,CAAA,
|
|
1
|
+
{"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs","$slots"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,UAAU,iBAAiB,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,YACrH,QAAQ,MAAM,MAAM,WAAW,SAAS,UAAU,aAAa,OAAO,MAAM,SAAS,QAAQ,YAC3F,2BAAA,gBAAe;EACnB,MAAM,MAAM,sBAAA,eAAc;EAC1B,MAAM,KAAK,sBAAA,oBAAoB,KAAK,MAAK;EACzC,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAAE,eAAe,MAAM;GAAS;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AA,eAAA;OAAA,CAAA,CAAA;MAA3H,eAAY;;;mBAGlD,SAAQ,KAAA,GAAA,IAAA,OAAI,UAAS,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAAkG,mBAAA,SAAA;;KAA/F,KAAA,GAAA,IAAA,OAAI,QAAO;KAAE,SAAQ;KAAU,MAAK;KAAS,OAAM;KAAS,IAAG;;qCAAmB,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAZ,UAAS,CAAA,EAAA,EAAA,CAAA,CAAA;;oCAClG,WAAU,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAAmG,mBAAA,SAAA;;KAAhG,KAAA,GAAA,IAAA,OAAI,SAAQ;KAAE,SAAQ;KAAU,MAAK;KAAS,OAAM;KAAQ,IAAG;;qCAAoB,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAb,WAAU,CAAA,EAAA,EAAA,CAAA,CAAA"}
|
|
@@ -74,7 +74,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
74
74
|
}
|
|
75
75
|
return (_ctx, _cache) => {
|
|
76
76
|
return openBlock(), createElementBlock("div", {
|
|
77
|
-
class: normalizeClass(["modo-morph-select flex flex-col", unref(fullWidth) ? "w-full" : "inline-flex"]),
|
|
77
|
+
class: normalizeClass(["modo-morph-select flex flex-col gap-1.5", unref(fullWidth) ? "w-full" : "inline-flex"]),
|
|
78
78
|
"data-modo-morph-select": "",
|
|
79
79
|
"data-modo-size": unref(size),
|
|
80
80
|
"data-modo-radius": unref(radius),
|
|
@@ -83,7 +83,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
83
83
|
unref(label) ? (openBlock(), createElementBlock("label", {
|
|
84
84
|
key: 0,
|
|
85
85
|
for: unref(fieldId),
|
|
86
|
-
class: "modo-morph-select__label"
|
|
86
|
+
class: "modo-morph-select__label text-caption font-medium text-foreground"
|
|
87
87
|
}, [createTextVNode(toDisplayString(unref(label)) + " ", 1), unref(required) ? (openBlock(), createElementBlock("span", _hoisted_3, "*")) : createCommentVNode("", true)], 8, _hoisted_2)) : createCommentVNode("", true),
|
|
88
88
|
createElementVNode("div", {
|
|
89
89
|
ref_key: "trigger",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs","$slots"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,UAAU,iBAAiB,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,YACrH,QAAQ,MAAM,MAAM,WAAW,SAAS,UAAU,aAAa,OAAO,MAAM,SAAS,QAAQ,YAC3F,gBAAe;EACnB,MAAM,MAAM,eAAc;EAC1B,MAAM,KAAK,oBAAoB,KAAK,MAAK;EACzC,MAAM,EAAE,uBAAuB,kBAAkB,gBAAgB;GAAE,eAAe,MAAM;GAAS;GAAY;GAAU;GAAQ;GAAM,CAAA;EACrI,MAAM,sBAAsB,eAAe,+BAA+B,WAAW,UAAU,wBAAuB;EAEtH,MAAM,SAAS,IAAI,MAAK;EACxB,IAAI;EACJ,MAAM,QAAQ,MAAM,aAAa;GAC/B,IAAI,aAAa,aAAa,SAAS,UAAU;IAC/C,OAAO,QAAQ;IAAM,aAAa,YAAW;IAC7C,cAAc,iBAAiB;KAAE,OAAO,QAAQ;OAAS,IAAG;;IAE/D;EACD,sBAAsB,aAAa,YAAY,CAAA;EAC/C,MAAM,WAAW,eAAe,gBAAgB,MAAM,GAAE;EAExD,MAAM,UAAU,eAAe,gBAAgB,MAAM,KAAI,WAAU,OAAO,aAAa,OAAO,OAAO,MAAM,CAAC,CAAC,KAAK,KAAK,CAAA;EACvH,MAAM,WAAW,eAAe,gBAAgB,MAAM,SAAS,EAAC;EAChE,SAAS,IAAI,OAAsB;GAAE,IAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,WAAW;IAAE,MAAM,gBAAgB;IAAE,QAAQ,KAAK;;;;uBAGpI,mBA2BM,OAAA;IA3BA,OAAK,eAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs","$slots"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography>\n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,UAAU,iBAAiB,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,YACrH,QAAQ,MAAM,MAAM,WAAW,SAAS,UAAU,aAAa,OAAO,MAAM,SAAS,QAAQ,YAC3F,gBAAe;EACnB,MAAM,MAAM,eAAc;EAC1B,MAAM,KAAK,oBAAoB,KAAK,MAAK;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var(--success); }
|
|
2973
2973
|
.modo-morph-select[data-modo-tone="warning"] { --modo-morph-select-tone: var(--warning); }
|
|
2974
2974
|
|
|
2975
|
-
.modo-morph-select__label {
|
|
2976
|
-
display: block;
|
|
2977
|
-
margin: 0 0 0.375rem 0.25rem;
|
|
2978
|
-
font-size: 0.8125rem;
|
|
2979
|
-
font-weight: 600;
|
|
2980
|
-
color: color-mix(in srgb, var(--foreground), transparent 22%);
|
|
2981
|
-
}
|
|
2982
|
-
|
|
2983
2975
|
/* The FIELD is the morph origin — hiding it whole makes the panel grow
|
|
2984
2976
|
out of the bordered box, border included. */
|
|
2985
2977
|
.modo-morph-select[data-modo-variant="outline"] .modo-morph-select__field {
|
|
@@ -3105,7 +3097,7 @@ to {
|
|
|
3105
3097
|
height: 2rem;
|
|
3106
3098
|
padding: 0 0.75rem;
|
|
3107
3099
|
border: 1px solid color-mix(in srgb, var(--foreground), transparent 82%);
|
|
3108
|
-
border-radius:
|
|
3100
|
+
border-radius: var(--modo-menu-item-radius);
|
|
3109
3101
|
background: transparent;
|
|
3110
3102
|
color: var(--foreground);
|
|
3111
3103
|
font: inherit;
|
|
@@ -3123,8 +3115,8 @@ to {
|
|
|
3123
3115
|
gap: 1px;
|
|
3124
3116
|
}
|
|
3125
3117
|
|
|
3126
|
-
/* Options
|
|
3127
|
-
|
|
3118
|
+
/* Options share the Menu row: same hover token and the same provider-driven
|
|
3119
|
+
item radius (concentric with the panel; pills only at radius="full"). */
|
|
3128
3120
|
.modo-morph-select__option {
|
|
3129
3121
|
display: flex;
|
|
3130
3122
|
align-items: center;
|
|
@@ -3132,7 +3124,7 @@ to {
|
|
|
3132
3124
|
gap: 0.75rem;
|
|
3133
3125
|
padding: 0.5rem 0.875rem;
|
|
3134
3126
|
border: none;
|
|
3135
|
-
border-radius:
|
|
3127
|
+
border-radius: var(--modo-menu-item-radius);
|
|
3136
3128
|
background: transparent;
|
|
3137
3129
|
color: inherit;
|
|
3138
3130
|
font: inherit;
|
|
@@ -3216,8 +3208,6 @@ to {
|
|
|
3216
3208
|
.modo-morph-select__field:has([aria-invalid="true"]) { border-color: var(--destructive); }
|
|
3217
3209
|
.modo-morph-select__button { justify-content: space-between; }
|
|
3218
3210
|
|
|
3219
|
-
.modo-morph-select[data-modo-radius="medium"] .modo-morph-select__field { border-radius: 1rem; }
|
|
3220
|
-
[data-modo-morph-select-panel][data-modo-radius="medium"] { border-radius: 1.5rem; }
|
|
3221
3211
|
|
|
3222
3212
|
.modo-canvas[data-v-7ff0ca23] {
|
|
3223
3213
|
/* Foreground stroke uses the border token, alpha modulated by intensity.
|