mood-ui 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +6 -6
  2. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  3. package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs +4 -4
  4. package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  5. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -7
  6. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  7. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +2 -2
  8. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  9. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -7
  10. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  11. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -7
  12. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  13. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +3 -3
  14. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  15. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +2 -2
  16. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  17. package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs +4 -4
  18. package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  19. package/dist/components/feedback/Drawer.cjs.map +1 -1
  20. package/dist/components/feedback/Drawer.mjs.map +1 -1
  21. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +11 -7
  22. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  23. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +17 -13
  24. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  25. package/dist/components/feedback/Modal.cjs.map +1 -1
  26. package/dist/components/feedback/Modal.mjs.map +1 -1
  27. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +10 -3
  28. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  29. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +16 -9
  30. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  31. package/dist/components/feedback/Toast.cjs +1 -1
  32. package/dist/components/feedback/Toast.cjs.map +1 -1
  33. package/dist/components/feedback/Toast.mjs +1 -1
  34. package/dist/components/feedback/Toast.mjs.map +1 -1
  35. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.cjs +4 -2
  36. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  37. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.mjs +5 -3
  38. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  39. package/dist/components/feedback/ToastContainer.cjs +1 -1
  40. package/dist/components/feedback/ToastContainer.cjs.map +1 -1
  41. package/dist/components/feedback/ToastContainer.mjs +1 -1
  42. package/dist/components/feedback/ToastContainer.mjs.map +1 -1
  43. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.cjs +4 -2
  44. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  45. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.mjs +6 -4
  46. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  47. package/dist/components/feedback/dialog/DialogTrigger.cjs.map +1 -1
  48. package/dist/components/feedback/dialog/DialogTrigger.mjs.map +1 -1
  49. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  50. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  51. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  52. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  53. package/dist/components/feedback/liquid-toast/LiquidToast.cjs.map +1 -1
  54. package/dist/components/feedback/liquid-toast/LiquidToast.mjs.map +1 -1
  55. package/dist/components/feedback/liquid-toast/LiquidToast.vue_vue_type_script_setup_true_lang.cjs +7 -6
  56. package/dist/components/feedback/liquid-toast/LiquidToast.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  57. package/dist/components/feedback/liquid-toast/LiquidToast.vue_vue_type_script_setup_true_lang.mjs +7 -6
  58. package/dist/components/feedback/liquid-toast/LiquidToast.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  59. package/dist/components/feedback/liquid-toast/LiquidToastShape.cjs.map +1 -1
  60. package/dist/components/feedback/liquid-toast/LiquidToastShape.mjs.map +1 -1
  61. package/dist/components/feedback/liquid-toast/LiquidToastShape.vue_vue_type_script_setup_true_lang.cjs +1 -0
  62. package/dist/components/feedback/liquid-toast/LiquidToastShape.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  63. package/dist/components/feedback/liquid-toast/LiquidToastShape.vue_vue_type_script_setup_true_lang.mjs +1 -0
  64. package/dist/components/feedback/liquid-toast/LiquidToastShape.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  65. package/dist/components/feedback/liquid-toast/LiquidToaster.cjs.map +1 -1
  66. package/dist/components/feedback/liquid-toast/LiquidToaster.mjs.map +1 -1
  67. package/dist/components/feedback/liquid-toast/LiquidToaster.vue_vue_type_script_setup_true_lang.cjs +2 -2
  68. package/dist/components/feedback/liquid-toast/LiquidToaster.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  69. package/dist/components/feedback/liquid-toast/LiquidToaster.vue_vue_type_script_setup_true_lang.mjs +2 -2
  70. package/dist/components/feedback/liquid-toast/LiquidToaster.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  71. package/dist/components/feedback/liquid-toast/liquidToast2.cjs +3 -3
  72. package/dist/components/feedback/liquid-toast/liquidToast2.cjs.map +1 -1
  73. package/dist/components/feedback/liquid-toast/liquidToast2.mjs +3 -3
  74. package/dist/components/feedback/liquid-toast/liquidToast2.mjs.map +1 -1
  75. package/dist/components/feedback/morph-tooltip/MorphTooltip.cjs.map +1 -1
  76. package/dist/components/feedback/morph-tooltip/MorphTooltip.mjs.map +1 -1
  77. package/dist/components/feedback/morph-tooltip/MorphTooltip.vue_vue_type_script_setup_true_lang.cjs +9 -4
  78. package/dist/components/feedback/morph-tooltip/MorphTooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  79. package/dist/components/feedback/morph-tooltip/MorphTooltip.vue_vue_type_script_setup_true_lang.mjs +9 -4
  80. package/dist/components/feedback/morph-tooltip/MorphTooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  81. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.cjs.map +1 -1
  82. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.mjs.map +1 -1
  83. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.vue_vue_type_script_setup_true_lang.cjs +8 -4
  84. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  85. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.vue_vue_type_script_setup_true_lang.mjs +8 -4
  86. package/dist/components/feedback/morph-tooltip/MorphTooltipContent.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  87. package/dist/components/feedback/sheet/SheetTrigger.cjs.map +1 -1
  88. package/dist/components/feedback/sheet/SheetTrigger.mjs.map +1 -1
  89. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  90. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  91. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  92. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  93. package/dist/components/forms/glass-switch/GlassSwitch.cjs.map +1 -1
  94. package/dist/components/forms/glass-switch/GlassSwitch.mjs.map +1 -1
  95. package/dist/components/forms/glass-switch/GlassSwitch.vue_vue_type_script_setup_true_lang.cjs +21 -25
  96. package/dist/components/forms/glass-switch/GlassSwitch.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  97. package/dist/components/forms/glass-switch/GlassSwitch.vue_vue_type_script_setup_true_lang.mjs +21 -25
  98. package/dist/components/forms/glass-switch/GlassSwitch.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  99. package/dist/components/forms/morph-select/MorphSelect.cjs.map +1 -1
  100. package/dist/components/forms/morph-select/MorphSelect.mjs.map +1 -1
  101. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.cjs +53 -6
  102. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  103. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.mjs +54 -7
  104. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  105. package/dist/components/forms/morph-select/MorphSelectContent.cjs.map +1 -1
  106. package/dist/components/forms/morph-select/MorphSelectContent.mjs.map +1 -1
  107. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs +36 -9
  108. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  109. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs +37 -10
  110. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  111. package/dist/components/forms/morph-select/MorphSelectContext.cjs.map +1 -1
  112. package/dist/components/forms/morph-select/MorphSelectContext.mjs.map +1 -1
  113. package/dist/components/forms/morph-select/MorphSelectTrigger.cjs.map +1 -1
  114. package/dist/components/forms/morph-select/MorphSelectTrigger.mjs.map +1 -1
  115. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs +39 -17
  116. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  117. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs +40 -18
  118. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  119. package/dist/components/layout/popover/PopoverTrigger.cjs.map +1 -1
  120. package/dist/components/layout/popover/PopoverTrigger.mjs.map +1 -1
  121. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  122. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  123. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  124. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  125. package/dist/components/navigation/menu/MenuTrigger.cjs.map +1 -1
  126. package/dist/components/navigation/menu/MenuTrigger.mjs.map +1 -1
  127. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs +7 -0
  128. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  129. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs +7 -0
  130. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  131. package/dist/config/ModoLocale.cjs +4 -0
  132. package/dist/config/ModoLocale.cjs.map +1 -1
  133. package/dist/config/ModoLocale.mjs +4 -0
  134. package/dist/config/ModoLocale.mjs.map +1 -1
  135. package/dist/config/locales/es.cjs +4 -0
  136. package/dist/config/locales/es.cjs.map +1 -1
  137. package/dist/config/locales/es.mjs +4 -0
  138. package/dist/config/locales/es.mjs.map +1 -1
  139. package/dist/mood-ui.css +349 -115
  140. package/dist/types/components/feedback/liquid-toast/liquidToast.d.ts +1 -1
  141. package/dist/types/components/forms/morph-select/MorphSelect.vue.d.ts +8 -7
  142. package/dist/types/components/forms/morph-select/MorphSelectContext.d.ts +6 -1
  143. package/dist/types/components/forms/morph-select/MorphSelectTrigger.vue.d.ts +6 -3
  144. package/dist/types/components/forms/morph-select/index.d.ts +24 -18
  145. package/dist/types/config/ModoLocale.d.ts +6 -0
  146. package/dist/types/interfaces/feedback/Drawer.interface.d.ts +2 -0
  147. package/dist/types/interfaces/feedback/LiquidToast.interface.d.ts +9 -9
  148. package/dist/types/interfaces/feedback/Modal.interface.d.ts +2 -0
  149. package/dist/types/interfaces/feedback/MorphTooltip.interface.d.ts +4 -4
  150. package/dist/types/interfaces/forms/GlassSwitch.interface.d.ts +1 -1
  151. package/dist/types/interfaces/forms/ModeOrb.interface.d.ts +3 -3
  152. package/dist/types/interfaces/forms/MorphSelect.interface.d.ts +13 -5
  153. package/dist/types/utils/morph/morphHelpers.d.ts +6 -0
  154. package/dist/utils/morph/morphHelpers.cjs +16 -0
  155. package/dist/utils/morph/morphHelpers.cjs.map +1 -1
  156. package/dist/utils/morph/morphHelpers.mjs +16 -1
  157. package/dist/utils/morph/morphHelpers.mjs.map +1 -1
  158. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePicker.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/data-display/date-picker/DateRangePicker.vue"],"sourcesContent":["<template> \n <div \n :class=\"['inline-flex flex-col sm:flex-row select-none bg-card w-fit max-w-full self-start', variant === 'outline' ? 'border border-border' : '', containerRadiusClass]\" \n role=\"application\" \n aria-label=\"Date range picker\" \n > \n <div \n v-if=\"showPresets\" \n class=\"flex flex-row sm:flex-col gap-2 sm:gap-1 p-3 border-b sm:border-b-0 sm:border-r border-border sm:min-w-35 overflow-x-auto sm:overflow-x-visible\" \n > \n <button \n v-for=\"preset in effectivePresets\" \n :key=\"preset.label\" \n type=\"button\" \n @click=\"applyPreset(preset)\" \n :class=\"[ \n 'text-left text-sm px-3 py-1.5 rounded-md transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 shrink-0 whitespace-nowrap', \n focusRingColorClass, \n isActivePreset(preset) \n ? activePresetClasses \n : 'text-foreground/80 hover:bg-muted', \n ]\" \n > \n {{ preset.label }} \n </button> \n </div> \n \n <div class=\"flex flex-col sm:flex-row\"> \n <div \n v-for=\"(panel, idx) in panels\" \n :key=\"idx\" \n class=\"flex flex-col\" \n :class=\"idx > 0 ? 'border-t sm:border-t-0 sm:border-l border-border' : ''\" \n > \n <div class=\"flex items-center justify-between px-2 py-3\"> \n <div class=\"flex items-center gap-0.5\"> \n <Button \n v-if=\"idx === 0\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronDoubleLeftIcon\" \n :ariaLabel=\"loc.calendar.prevYear\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('right', () => shiftYear(-1))\" \n /> \n <Button \n v-if=\"idx === 0\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronLeftIcon\" \n :ariaLabel=\"loc.calendar.prevMonth\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('right', () => shiftMonth(-1))\" \n /> \n <div v-if=\"idx !== 0\" class=\"w-15\"></div> \n </div> \n \n <span class=\"text-sm font-semibold text-foreground\"> \n {{ formatMonthYear(panel.month, panel.year) }} \n </span> \n \n <div class=\"flex items-center gap-0.5\"> \n <Button \n v-if=\"idx === panels.length - 1\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronRightIcon\" \n :ariaLabel=\"loc.calendar.nextMonth\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('left', () => shiftMonth(1))\" \n /> \n <Button \n v-if=\"idx === panels.length - 1\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronDoubleRightIcon\" \n :ariaLabel=\"loc.calendar.nextYear\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('left', () => shiftYear(1))\" \n /> \n <div v-if=\"idx !== panels.length - 1\" class=\"w-15\"></div> \n </div> \n </div> \n \n <div class=\"grid grid-cols-7 px-2\"> \n <div \n v-for=\"dayLabel in weekDayLabels\" \n :key=\"dayLabel\" \n class=\"text-center text-xs font-medium text-muted-foreground py-2\" \n > \n {{ dayLabel }} \n </div> \n </div> \n \n <div class=\"overflow-hidden px-2 pb-3\"> \n <div :ref=\"(el: unknown) => setGridRef(el as HTMLElement | null, idx)\" class=\"grid grid-cols-7\"> \n <div \n v-for=\"day in panel.days\" \n :key=\"day.date.getTime()\" \n class=\"relative flex items-center justify-center w-9 h-9\" \n > \n <span \n v-if=\"bgSide(day) === 'full'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 -inset-x-px pointer-events-none', rangeMiddleBgClass]\" \n /> \n <span \n v-else-if=\"bgSide(day) === 'left'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 -left-px right-1/2 pointer-events-none', rangeMiddleBgClass]\" \n /> \n <span \n v-else-if=\"bgSide(day) === 'right'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 left-1/2 -right-px pointer-events-none', rangeMiddleBgClass]\" \n /> \n \n <button \n type=\"button\" \n :disabled=\"day.disabled\" \n :aria-label=\"day.date.toLocaleDateString(locale === 'default' ? undefined : locale)\" \n :aria-selected=\"day.isRangeStart || day.isRangeEnd\" \n @click=\"!day.disabled && handleDayClick(day.date)\" \n @mouseenter=\"!day.disabled && (hoverDate = day.date)\" \n @mouseleave=\"hoverDate = null\" \n :class=\"[ \n 'relative z-10 w-9 h-9 text-sm flex items-center justify-center transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1', \n dayRadiusClass, \n focusRingColorClass, \n dayStateClasses(day), \n ]\" \n > \n {{ day.day }} \n </button> \n </div> \n </div> \n </div> \n </div> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, nextTick } from 'vue'; \nimport { ChevronLeftIcon, ChevronRightIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon } from '@heroicons/vue/24/outline'; \nimport Button from '../../forms/Button.vue'; \nimport gsap from 'gsap'; \nimport type { DateRangePicker, RangePreset } from '../../../interfaces/data-display/date-picker/DateRangePicker.interface'; \nimport { isSameDay, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useResolvedColor, useResolvedRadius, useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \n \nconst props = withDefaults(defineProps<DateRangePicker>(), { \n modelValue: () => [null, null] as [Date | null, Date | null], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n variant: 'outline', \n months: 2, \n showPresets: true, \n}); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [range: [Date | null, Date | null]]; \n 'rangeComplete': [range: [Date, Date]]; \n}>(); \n \nconst gridRefs = ref<(HTMLElement | null)[]>([]); \nconst setGridRef = (el: HTMLElement | null, idx: number) => { gridRefs.value[idx] = el; }; \n \nconst today = new Date(); \n \nconst baseMonth = ref(props.modelValue[0]?.getMonth() ?? today.getMonth()); \nconst baseYear = ref(props.modelValue[0]?.getFullYear() ?? today.getFullYear()); \n \nconst pendingStart = ref<Date | null>(props.modelValue[0] ?? null); \nconst pendingEnd = ref<Date | null>(props.modelValue[1] ?? null); \nconst hoverDate = ref<Date | null>(null); \nconst isAnimating = ref(false); \n \nconst defaultPresets: RangePreset[] = [ \n { label: 'Today', range: () => [new Date(), new Date()] }, \n { label: 'Yesterday', range: () => { const d = new Date(); d.setDate(d.getDate() - 1); return [d, new Date(d)]; } }, \n { label: 'Last 7 days', range: () => { const s = new Date(); s.setDate(s.getDate() - 6); return [s, new Date()]; } }, \n { label: 'Last 30 days', range: () => { const s = new Date(); s.setDate(s.getDate() - 29); return [s, new Date()]; } }, \n { label: 'This month', range: () => { const now = new Date(); return [new Date(now.getFullYear(), now.getMonth(), 1), new Date(now.getFullYear(), now.getMonth() + 1, 0)]; } }, \n { label: 'Last month', range: () => { const now = new Date(); return [new Date(now.getFullYear(), now.getMonth() - 1, 1), new Date(now.getFullYear(), now.getMonth(), 0)]; } }, \n { label: 'This year', range: () => { const now = new Date(); return [new Date(now.getFullYear(), 0, 1), new Date(now.getFullYear(), 11, 31)]; } }, \n]; \n \nconst effectivePresets = computed(() => props.presets ?? defaultPresets); \n \nconst isActivePreset = (preset: RangePreset) => { \n if (!pendingStart.value || !pendingEnd.value) return false; \n const [s, e] = preset.range(); \n return isSameDay(s, pendingStart.value) && isSameDay(e, pendingEnd.value); \n}; \n \nconst applyPreset = (preset: RangePreset) => { \n const [s, e] = preset.range(); \n pendingStart.value = s; \n pendingEnd.value = e; \n baseMonth.value = s.getMonth(); \n baseYear.value = s.getFullYear(); \n emit('update:modelValue', [s, e]); \n emit('rangeComplete', [s, e]); \n}; \n \nconst locale = computed(() => props.locale === 'default' ? undefined : props.locale); \n \nconst formatMonthYear = (month: number, year: number) => { \n return new Date(year, month, 1).toLocaleString(locale.value, { month: 'long', year: 'numeric' }); \n}; \n \nconst weekDayLabels = computed(() => { \n const labels: string[] = []; \n const base = new Date(2024, 0, 7 + props.firstDayOfWeek); \n for (let i = 0; i < 7; i++) { \n const d = new Date(base); \n d.setDate(base.getDate() + i); \n labels.push(d.toLocaleString(locale.value, { weekday: 'short' }).slice(0, 2)); \n } \n return labels; \n}); \n \ninterface Panel { \n month: number; \n year: number; \n days: CalendarDay[]; \n} \n \nconst currentRange = computed<[Date | null, Date | null]>(() => { \n if (pendingStart.value && !pendingEnd.value && hoverDate.value) { \n const s = pendingStart.value; \n const h = hoverDate.value; \n return h < s ? [h, s] : [s, h]; \n } \n return [pendingStart.value, pendingEnd.value]; \n}); \n \nconst isDateDisabled = (date: Date) => { \n if (props.minDate && date < startOfDay(props.minDate)) return true; \n if (props.maxDate && date > startOfDay(props.maxDate)) return true; \n if (props.disabledDates?.some(d => isSameDay(d, date))) return true; \n if (props.maxRange && pendingStart.value && !pendingEnd.value) { \n if (inclusiveDaysBetween(pendingStart.value, date) > props.maxRange) return true; \n } \n return false; \n}; \n \nconst buildPanel = (month: number, year: number): Panel => { \n const days: CalendarDay[] = []; \n const firstOfMonth = new Date(year, month, 1); \n const lastOfMonth = new Date(year, month + 1, 0); \n const [rangeStart, rangeEnd] = currentRange.value; \n \n let startDow = firstOfMonth.getDay() - props.firstDayOfWeek; \n if (startDow < 0) startDow += 7; \n \n const build = (date: Date, isOutside: boolean): CalendarDay => { \n const inRange = !!(rangeStart && rangeEnd && \n startOfDay(date).getTime() >= startOfDay(rangeStart).getTime() && \n startOfDay(date).getTime() <= startOfDay(rangeEnd).getTime()); \n return { \n date, \n day: date.getDate(), \n isToday: isSameDay(date, today), \n isSelected: false, \n isOutside, \n disabled: isDateDisabled(date), \n inRange, \n isRangeStart: !!rangeStart && isSameDay(date, rangeStart), \n isRangeEnd: !!rangeEnd && isSameDay(date, rangeEnd), \n }; \n }; \n \n for (let i = startDow - 1; i >= 0; i--) { \n const date = new Date(year, month, -i); \n days.push(build(date, true)); \n } \n for (let d = 1; d <= lastOfMonth.getDate(); d++) { \n days.push(build(new Date(year, month, d), false)); \n } \n const targetLength = Math.ceil(days.length / 7) * 7 < 42 ? 42 : Math.ceil(days.length / 7) * 7; \n let nextDay = 1; \n while (days.length < targetLength) { \n days.push(build(new Date(year, month + 1, nextDay++), true)); \n } \n \n return { month, year, days }; \n}; \n \nconst panels = computed<Panel[]>(() => { \n const result: Panel[] = []; \n for (let i = 0; i < props.months; i++) { \n const m = (baseMonth.value + i) % 12; \n const y = baseYear.value + Math.floor((baseMonth.value + i) / 12); \n result.push(buildPanel(m, y)); \n } \n return result; \n}); \n \nconst shiftMonth = (delta: number) => { \n let m = baseMonth.value + delta; \n let y = baseYear.value; \n while (m < 0) { m += 12; y--; } \n while (m > 11) { m -= 12; y++; } \n baseMonth.value = m; \n baseYear.value = y; \n}; \n \nconst shiftYear = (delta: number) => { \n baseYear.value += delta; \n}; \n \nconst animateShift = (direction: 'left' | 'right', action: () => void): Promise<void> => { \n return new Promise((resolve) => { \n const grids = gridRefs.value.filter((g): g is HTMLElement => !!g); \n if (grids.length === 0 || isAnimating.value) { \n action(); \n resolve(); \n return; \n } \n isAnimating.value = true; \n const from = direction === 'left' ? -20 : 20; \n const to = direction === 'left' ? 20 : -20; \n \n gsap.to(grids, { \n x: to, \n opacity: 0, \n duration: 0.15, \n ease: 'power2.in', \n onComplete: () => { \n action(); \n nextTick(() => { \n const newGrids = gridRefs.value.filter((g): g is HTMLElement => !!g); \n gsap.fromTo( \n newGrids, \n { x: from, opacity: 0 }, \n { \n x: 0, opacity: 1, duration: 0.2, ease: 'power2.out', \n onComplete: () => { isAnimating.value = false; resolve(); }, \n } \n ); \n }); \n }, \n }); \n }); \n}; \n \nconst MS_PER_DAY = 86400000; \nconst inclusiveDaysBetween = (a: Date, b: Date) => \n Math.abs(Math.round((startOfDay(b).getTime() - startOfDay(a).getTime()) / MS_PER_DAY)) + 1; \n \nconst handleDayClick = (date: Date) => { \n if (!pendingStart.value || (pendingStart.value && pendingEnd.value)) { \n pendingStart.value = date; \n pendingEnd.value = null; \n emit('update:modelValue', [date, null]); \n return; \n } \n let start = pendingStart.value; \n let end = date; \n if (end < start) [start, end] = [end, start]; \n \n if (props.minRange && inclusiveDaysBetween(start, end) < props.minRange) { \n pendingStart.value = date; \n pendingEnd.value = null; \n emit('update:modelValue', [date, null]); \n return; \n } \n \n pendingStart.value = start; \n pendingEnd.value = end; \n emit('update:modelValue', [start, end]); \n emit('rangeComplete', [start, end]); \n}; \n \nconst colorBg = computed(() => ({ \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}[resolvedColor.value] ?? 'bg-primary text-primary-foreground')); \n \nconst rangeMiddleBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n \nconst activePresetClasses = computed(() => ({ \n default: 'bg-muted text-foreground font-medium', \n primary: 'bg-primary-subtle text-primary font-medium', \n danger: 'bg-destructive-subtle text-destructive font-medium', \n success: 'bg-success-subtle text-success font-medium', \n warning: 'bg-warning-subtle text-warning font-medium', \n}[resolvedColor.value] ?? 'bg-primary-subtle text-primary font-medium')); \n \n// Unified focus ring across the system — colour-agnostic.\nconst focusRingColorClass = computed(() => 'focus-visible:ring-ring/60');\n \nconst containerRadiusClass = computed(() => ({ \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-lg', \n full: 'rounded-xl', \n}[resolvedRadius.value] ?? 'rounded-lg')); \n \nconst dayRadiusClass = computed(() => ({ \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-lg', \n full: 'rounded-full', \n}[resolvedRadius.value] ?? 'rounded-full')); \n \ntype BgSide = 'none' | 'full' | 'left' | 'right'; \nconst bgSide = (day: CalendarDay): BgSide => { \n if (day.disabled) return 'none'; \n const [rs, re] = currentRange.value; \n if (!rs || !re || isSameDay(rs, re)) return 'none'; \n if (day.isRangeStart) return 'right'; \n if (day.isRangeEnd) return 'left'; \n if (day.inRange) return 'full'; \n return 'none'; \n}; \n \nconst todayTextClass = computed(() => ({ \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}[resolvedColor.value] ?? 'text-primary')); \n \nconst dayStateClasses = (day: CalendarDay): string => { \n if (day.disabled) return 'text-muted-foreground/60 cursor-not-allowed'; \n if (day.isRangeStart || day.isRangeEnd) { \n return `${colorBg.value} hover:opacity-90`; \n } \n if (day.isToday) { \n return `font-semibold ${todayTextClass.value} hover:bg-muted`; \n } \n if (day.isOutside) return 'text-muted-foreground/40 hover:bg-muted'; \n return 'text-foreground/80 hover:bg-muted'; \n}; \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsWA,IAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EA3MnB,MAAM,MAAM,eAAe;EAE3B,MAAM,QAAQ;EAUd,MAAM,gBAAgB,uBAAuB,MAAM,MAAM;EACzD,MAAM,iBAAiB,wBAAwB,MAAM,OAAO;EAE5D,MAAM,OAAO;EAKb,MAAM,WAAW,IAA4B,EAAE,CAAC;EAChD,MAAM,cAAc,IAAwB,QAAgB;GAAE,SAAS,MAAM,OAAO;;EAEpF,MAAM,wBAAQ,IAAI,MAAM;EAExB,MAAM,YAAY,IAAI,MAAM,WAAW,IAAI,UAAU,IAAI,MAAM,UAAU,CAAC;EAC1E,MAAM,WAAW,IAAI,MAAM,WAAW,IAAI,aAAa,IAAI,MAAM,aAAa,CAAC;EAE/E,MAAM,eAAe,IAAiB,MAAM,WAAW,MAAM,KAAK;EAClE,MAAM,aAAa,IAAiB,MAAM,WAAW,MAAM,KAAK;EAChE,MAAM,YAAY,IAAiB,KAAK;EACxC,MAAM,cAAc,IAAI,MAAM;EAE9B,MAAM,iBAAgC;GAClC;IAAE,OAAO;IAAS,aAAa,i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;OAfL,MAAK;OACJ,UAAU,IAAI;OACd,cAAY,IAAI,KAAK,mBAAmB,OAAA,UAAM,YAAiB,KAAA,IAAY,OAAA,MAAM;OACjF,iBAAe,IAAI,gBAAgB,IAAI;OACvC,UAAK,WAAA,CAAG,IAAI,YAAY,eAAe,IAAI,KAAI;OAC/C,eAAU,WAAA,CAAG,IAAI,aAAa,UAAA,QAAY,IAAI;OAC9C,cAAU,OAAA,OAAA,OAAA,MAAA,WAAE,UAAA,QAAS;OACrB,OAAK,eAAA;;QAAqP,eAAA;QAAqD,oBAAA;QAA0D,gBAAgB,IAAG;;yBAO1X,IAAI,IAAG,EAAA,IAAA,YAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"DateRangePicker.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/data-display/date-picker/DateRangePicker.vue"],"sourcesContent":["<template> \n <div \n :class=\"['inline-flex flex-col sm:flex-row select-none bg-card w-fit max-w-full self-start', variant === 'outline' ? 'border border-border' : '', containerRadiusClass]\" \n role=\"application\" \n aria-label=\"Date range picker\" \n > \n <div \n v-if=\"showPresets\" \n class=\"flex flex-row sm:flex-col gap-2 sm:gap-1 p-3 border-b sm:border-b-0 sm:border-r border-border sm:min-w-35 overflow-x-auto sm:overflow-x-visible\" \n > \n <button \n v-for=\"preset in effectivePresets\" \n :key=\"preset.label\" \n type=\"button\" \n @click=\"applyPreset(preset)\" \n :class=\"[ \n 'text-left text-sm px-3 py-1.5 rounded-md transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 shrink-0 whitespace-nowrap', \n focusRingColorClass, \n isActivePreset(preset) \n ? activePresetClasses \n : 'text-foreground/80 hover:bg-muted', \n ]\" \n > \n {{ preset.label }} \n </button> \n </div> \n \n <div class=\"flex flex-col sm:flex-row\"> \n <div \n v-for=\"(panel, idx) in panels\" \n :key=\"idx\" \n class=\"flex flex-col\" \n :class=\"idx > 0 ? 'border-t sm:border-t-0 sm:border-l border-border' : ''\" \n > \n <div class=\"flex items-center justify-between px-2 py-3\"> \n <div class=\"flex items-center gap-0.5\"> \n <Button \n v-if=\"idx === 0\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronDoubleLeftIcon\" \n :ariaLabel=\"loc.calendar.prevYear\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('right', () => shiftYear(-1))\" \n /> \n <Button \n v-if=\"idx === 0\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronLeftIcon\" \n :ariaLabel=\"loc.calendar.prevMonth\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('right', () => shiftMonth(-1))\" \n /> \n <div v-if=\"idx !== 0\" class=\"w-15\"></div> \n </div> \n \n <span class=\"text-sm font-semibold text-foreground\"> \n {{ formatMonthYear(panel.month, panel.year) }} \n </span> \n \n <div class=\"flex items-center gap-0.5\"> \n <Button \n v-if=\"idx === panels.length - 1\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronRightIcon\" \n :ariaLabel=\"loc.calendar.nextMonth\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('left', () => shiftMonth(1))\" \n /> \n <Button \n v-if=\"idx === panels.length - 1\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"ChevronDoubleRightIcon\" \n :ariaLabel=\"loc.calendar.nextYear\" \n class=\"text-muted-foreground\" \n @click=\"animateShift('left', () => shiftYear(1))\" \n /> \n <div v-if=\"idx !== panels.length - 1\" class=\"w-15\"></div> \n </div> \n </div> \n \n <div class=\"grid grid-cols-7 px-2\"> \n <div \n v-for=\"dayLabel in weekDayLabels\" \n :key=\"dayLabel\" \n class=\"text-center text-xs font-medium text-muted-foreground py-2\" \n > \n {{ dayLabel }} \n </div> \n </div> \n \n <div class=\"overflow-hidden px-2 pb-3\"> \n <div :ref=\"(el: unknown) => setGridRef(el as HTMLElement | null, idx)\" class=\"grid grid-cols-7\"> \n <div \n v-for=\"day in panel.days\" \n :key=\"day.date.getTime()\" \n class=\"relative flex items-center justify-center w-9 h-9\" \n > \n <span \n v-if=\"bgSide(day) === 'full'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 -inset-x-px pointer-events-none', rangeMiddleBgClass]\" \n /> \n <span \n v-else-if=\"bgSide(day) === 'left'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 -left-px right-1/2 pointer-events-none', rangeMiddleBgClass]\" \n /> \n <span \n v-else-if=\"bgSide(day) === 'right'\" \n aria-hidden=\"true\" \n :class=\"['absolute inset-y-0 left-1/2 -right-px pointer-events-none', rangeMiddleBgClass]\" \n /> \n \n <button \n type=\"button\" \n :disabled=\"day.disabled\" \n :aria-label=\"day.date.toLocaleDateString(locale === 'default' ? undefined : locale)\" \n :aria-selected=\"day.isRangeStart || day.isRangeEnd\" \n @click=\"!day.disabled && handleDayClick(day.date)\" \n @mouseenter=\"!day.disabled && (hoverDate = day.date)\" \n @mouseleave=\"hoverDate = null\" \n :class=\"[ \n 'relative z-10 w-9 h-9 text-sm flex items-center justify-center transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1', \n dayRadiusClass, \n focusRingColorClass, \n dayStateClasses(day), \n ]\" \n > \n {{ day.day }} \n </button> \n </div> \n </div> \n </div> \n </div> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, nextTick } from 'vue'; \nimport { ChevronLeftIcon, ChevronRightIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon } from '@heroicons/vue/24/outline'; \nimport Button from '../../forms/Button.vue'; \nimport gsap from 'gsap'; \nimport type { DateRangePicker, RangePreset } from '../../../interfaces/data-display/date-picker/DateRangePicker.interface'; \nimport { isSameDay, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useResolvedColor, useResolvedRadius, useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \n \nconst props = withDefaults(defineProps<DateRangePicker>(), { \n modelValue: () => [null, null] as [Date | null, Date | null], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n variant: 'outline', \n months: 2, \n showPresets: true, \n}); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [range: [Date | null, Date | null]]; \n 'rangeComplete': [range: [Date, Date]]; \n}>(); \n \nconst gridRefs = ref<(HTMLElement | null)[]>([]); \nconst setGridRef = (el: HTMLElement | null, idx: number) => { gridRefs.value[idx] = el; }; \n \nconst today = new Date(); \n \nconst baseMonth = ref(props.modelValue[0]?.getMonth() ?? today.getMonth()); \nconst baseYear = ref(props.modelValue[0]?.getFullYear() ?? today.getFullYear()); \n \nconst pendingStart = ref<Date | null>(props.modelValue[0] ?? null); \nconst pendingEnd = ref<Date | null>(props.modelValue[1] ?? null); \nconst hoverDate = ref<Date | null>(null); \nconst isAnimating = ref(false); \n \nconst defaultPresets: RangePreset[] = [ \n { label: 'Today', range: () => [new Date(), new Date()] }, \n { label: 'Yesterday', range: () => { const d = new Date(); d.setDate(d.getDate() - 1); return [d, new Date(d)]; } }, \n { label: 'Last 7 days', range: () => { const s = new Date(); s.setDate(s.getDate() - 6); return [s, new Date()]; } }, \n { label: 'Last 30 days', range: () => { const s = new Date(); s.setDate(s.getDate() - 29); return [s, new Date()]; } }, \n { label: 'This month', range: () => { const now = new Date(); return [new Date(now.getFullYear(), now.getMonth(), 1), new Date(now.getFullYear(), now.getMonth() + 1, 0)]; } }, \n { label: 'Last month', range: () => { const now = new Date(); return [new Date(now.getFullYear(), now.getMonth() - 1, 1), new Date(now.getFullYear(), now.getMonth(), 0)]; } }, \n { label: 'This year', range: () => { const now = new Date(); return [new Date(now.getFullYear(), 0, 1), new Date(now.getFullYear(), 11, 31)]; } }, \n]; \n \nconst effectivePresets = computed(() => props.presets ?? defaultPresets); \n \nconst isActivePreset = (preset: RangePreset) => { \n if (!pendingStart.value || !pendingEnd.value) return false; \n const [s, e] = preset.range(); \n return isSameDay(s, pendingStart.value) && isSameDay(e, pendingEnd.value); \n}; \n \nconst applyPreset = (preset: RangePreset) => { \n const [s, e] = preset.range(); \n pendingStart.value = s; \n pendingEnd.value = e; \n baseMonth.value = s.getMonth(); \n baseYear.value = s.getFullYear(); \n emit('update:modelValue', [s, e]); \n emit('rangeComplete', [s, e]); \n}; \n \nconst locale = computed(() => props.locale === 'default' ? undefined : props.locale); \n \nconst formatMonthYear = (month: number, year: number) => { \n return new Date(year, month, 1).toLocaleString(locale.value, { month: 'long', year: 'numeric' }); \n}; \n \nconst weekDayLabels = computed(() => { \n const labels: string[] = []; \n const base = new Date(2024, 0, 7 + props.firstDayOfWeek); \n for (let i = 0; i < 7; i++) { \n const d = new Date(base); \n d.setDate(base.getDate() + i); \n labels.push(d.toLocaleString(locale.value, { weekday: 'short' }).slice(0, 2)); \n } \n return labels; \n}); \n \ninterface Panel { \n month: number; \n year: number; \n days: CalendarDay[]; \n} \n \nconst currentRange = computed<[Date | null, Date | null]>(() => { \n if (pendingStart.value && !pendingEnd.value && hoverDate.value) { \n const s = pendingStart.value; \n const h = hoverDate.value; \n return h < s ? [h, s] : [s, h]; \n } \n return [pendingStart.value, pendingEnd.value]; \n}); \n \nconst isDateDisabled = (date: Date) => { \n if (props.minDate && date < startOfDay(props.minDate)) return true; \n if (props.maxDate && date > startOfDay(props.maxDate)) return true; \n if (props.disabledDates?.some(d => isSameDay(d, date))) return true; \n if (props.maxRange && pendingStart.value && !pendingEnd.value) { \n if (inclusiveDaysBetween(pendingStart.value, date) > props.maxRange) return true; \n } \n return false; \n}; \n \nconst buildPanel = (month: number, year: number): Panel => { \n const days: CalendarDay[] = []; \n const firstOfMonth = new Date(year, month, 1); \n const lastOfMonth = new Date(year, month + 1, 0); \n const [rangeStart, rangeEnd] = currentRange.value; \n \n let startDow = firstOfMonth.getDay() - props.firstDayOfWeek; \n if (startDow < 0) startDow += 7; \n \n const build = (date: Date, isOutside: boolean): CalendarDay => { \n const inRange = !!(rangeStart && rangeEnd && \n startOfDay(date).getTime() >= startOfDay(rangeStart).getTime() && \n startOfDay(date).getTime() <= startOfDay(rangeEnd).getTime()); \n return { \n date, \n day: date.getDate(), \n isToday: isSameDay(date, today), \n isSelected: false, \n isOutside, \n disabled: isDateDisabled(date), \n inRange, \n isRangeStart: !!rangeStart && isSameDay(date, rangeStart), \n isRangeEnd: !!rangeEnd && isSameDay(date, rangeEnd), \n }; \n }; \n \n for (let i = startDow - 1; i >= 0; i--) { \n const date = new Date(year, month, -i); \n days.push(build(date, true)); \n } \n for (let d = 1; d <= lastOfMonth.getDate(); d++) { \n days.push(build(new Date(year, month, d), false)); \n } \n const targetLength = Math.ceil(days.length / 7) * 7 < 42 ? 42 : Math.ceil(days.length / 7) * 7; \n let nextDay = 1; \n while (days.length < targetLength) { \n days.push(build(new Date(year, month + 1, nextDay++), true)); \n } \n \n return { month, year, days }; \n}; \n \nconst panels = computed<Panel[]>(() => { \n const result: Panel[] = []; \n for (let i = 0; i < props.months; i++) { \n const m = (baseMonth.value + i) % 12; \n const y = baseYear.value + Math.floor((baseMonth.value + i) / 12); \n result.push(buildPanel(m, y)); \n } \n return result; \n}); \n \nconst shiftMonth = (delta: number) => { \n let m = baseMonth.value + delta; \n let y = baseYear.value; \n while (m < 0) { m += 12; y--; } \n while (m > 11) { m -= 12; y++; } \n baseMonth.value = m; \n baseYear.value = y; \n}; \n \nconst shiftYear = (delta: number) => { \n baseYear.value += delta; \n}; \n \nconst animateShift = (direction: 'left' | 'right', action: () => void): Promise<void> => { \n return new Promise((resolve) => { \n const grids = gridRefs.value.filter((g): g is HTMLElement => !!g); \n if (grids.length === 0 || isAnimating.value) { \n action(); \n resolve(); \n return; \n } \n isAnimating.value = true; \n const from = direction === 'left' ? -20 : 20; \n const to = direction === 'left' ? 20 : -20; \n \n gsap.to(grids, { \n x: to, \n opacity: 0, \n duration: 0.15, \n ease: 'power2.in', \n onComplete: () => { \n action(); \n nextTick(() => { \n const newGrids = gridRefs.value.filter((g): g is HTMLElement => !!g); \n gsap.fromTo( \n newGrids, \n { x: from, opacity: 0 }, \n { \n x: 0, opacity: 1, duration: 0.2, ease: 'power2.out', \n onComplete: () => { isAnimating.value = false; resolve(); }, \n } \n ); \n }); \n }, \n }); \n }); \n}; \n \nconst MS_PER_DAY = 86400000; \nconst inclusiveDaysBetween = (a: Date, b: Date) => \n Math.abs(Math.round((startOfDay(b).getTime() - startOfDay(a).getTime()) / MS_PER_DAY)) + 1; \n \nconst handleDayClick = (date: Date) => { \n if (!pendingStart.value || (pendingStart.value && pendingEnd.value)) { \n pendingStart.value = date; \n pendingEnd.value = null; \n emit('update:modelValue', [date, null]); \n return; \n } \n let start = pendingStart.value; \n let end = date; \n if (end < start) [start, end] = [end, start]; \n \n if (props.minRange && inclusiveDaysBetween(start, end) < props.minRange) { \n pendingStart.value = date; \n pendingEnd.value = null; \n emit('update:modelValue', [date, null]); \n return; \n } \n \n pendingStart.value = start; \n pendingEnd.value = end; \n emit('update:modelValue', [start, end]); \n emit('rangeComplete', [start, end]); \n}; \n \nconst colorBg = computed(() => ({ \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}[resolvedColor.value] ?? 'bg-primary text-primary-foreground')); \n \nconst rangeMiddleBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n \nconst activePresetClasses = computed(() => ({ \n default: 'bg-muted text-foreground font-medium', \n primary: 'bg-primary-subtle text-primary font-medium', \n danger: 'bg-destructive-subtle text-destructive font-medium', \n success: 'bg-success-subtle text-success font-medium', \n warning: 'bg-warning-subtle text-warning font-medium', \n}[resolvedColor.value] ?? 'bg-primary-subtle text-primary font-medium')); \n \n// Unified focus ring across the system — colour-agnostic.\nconst focusRingColorClass = computed(() => 'focus-visible:ring-ring/60');\n \nconst containerRadiusClass = computed(() => ({ \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-lg', \n full: 'rounded-xl', \n}[resolvedRadius.value] ?? 'rounded-lg')); \n \nconst dayRadiusClass = computed(() => ({ \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-lg', \n full: 'rounded-full', \n}[resolvedRadius.value] ?? 'rounded-full')); \n \ntype BgSide = 'none' | 'full' | 'left' | 'right'; \nconst bgSide = (day: CalendarDay): BgSide => { \n if (day.disabled) return 'none'; \n const [rs, re] = currentRange.value; \n if (!rs || !re || isSameDay(rs, re)) return 'none'; \n if (day.isRangeStart) return 'right'; \n if (day.isRangeEnd) return 'left'; \n if (day.inRange) return 'full'; \n return 'none'; \n}; \n \nconst todayTextClass = computed(() => ({ \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}[resolvedColor.value] ?? 'text-primary')); \n \nconst dayStateClasses = (day: CalendarDay): string => { \n if (day.disabled) return 'text-muted-foreground/60 cursor-not-allowed'; \n if (day.isRangeStart || day.isRangeEnd) { \n return `${colorBg.value} hover:opacity-90`; \n } \n if (day.isToday) { \n return `font-semibold ${todayTextClass.value} hover:bg-muted`; \n } \n if (day.isOutside) return 'text-muted-foreground/40 hover:bg-muted'; \n return 'text-foreground/80 hover:bg-muted'; \n}; \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsWA,IAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EA3MnB,MAAM,MAAM,eAAe;EAE3B,MAAM,QAAQ;EAUd,MAAM,gBAAgB,uBAAuB,MAAM,MAAM;EACzD,MAAM,iBAAiB,wBAAwB,MAAM,OAAO;EAE5D,MAAM,OAAO;EAKb,MAAM,WAAW,IAA4B,EAAE,CAAC;EAChD,MAAM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sCM,OAAA;OApCD,KAAK,IAAI,KAAK,SAAO;OACtB,OAAM;UAGI,OAAO,IAAG,KAAA,UAAA,WAAA,EADpB,mBAIE,QAAA;;OAFE,eAAY;OACX,OAAK,eAAA,CAAA,sDAAyD,mBAAA,MAAkB,CAAA;qBAGtE,OAAO,IAAG,KAAA,UAAA,WAAA,EADzB,mBAIE,QAAA;;OAFE,eAAY;OACX,OAAK,eAAA,CAAA,6DAAgE,mBAAA,MAAkB,CAAA;qBAG7E,OAAO,IAAG,KAAA,WAAA,WAAA,EADzB,mBAIE,QAAA;;OAFE,eAAY;OACX,OAAK,eAAA,CAAA,6DAAgE,mBAAA,MAAkB,CAAA;mDAG5F,mBAgBS,UAAA;OAfL,MAAK;OACJ,UAAU,IAAI;OACd,cAAY,IAAI,KAAK,mBAAmB,OAAA,UAAM,YAAiB,KAAA,IAAY,OAAA,MAAM;OACjF,iBAAe,IAAI,gBAAgB,IAAI;OACvC,UAAK,WAAA,CAAG,IAAI,YAAY,eAAe,IAAI,KAAI;OAC/C,eAAU,WAAA,CAAG,IAAI,aAAa,UAAA,QAAY,IAAI;OAC9C,cAAU,OAAA,OAAA,OAAA,MAAA,WAAE,UAAA,QAAS;OACrB,OAAK,eAAA;;QAAqP,eAAA;QAAqD,oBAAA;QAA0D,gBAAgB,IAAG;;yBAO1X,IAAI,IAAG,EAAA,IAAA,YAAA,CAAA,CAAA"}
@@ -2,7 +2,7 @@ import { useResolvedColor, useResolvedRadius } from "../../../composables/useMod
2
2
  import Button_default from "../../forms/Button.mjs";
3
3
  import Calendar_default from "../calendar/Calendar.mjs";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, onMounted, openBlock, ref, renderList, toDisplayString, watch } from "vue";
5
- import gsap from "gsap";
5
+ import gsap$1 from "gsap";
6
6
  //#region src/components/data-display/date-picker/DateTimePicker.vue?vue&type=script&setup=true&lang.ts
7
7
  var _hoisted_1 = { class: "px-3 py-3 border-b border-border text-center shrink-0" };
8
8
  var _hoisted_2 = { class: "text-sm font-semibold text-foreground" };
@@ -184,7 +184,7 @@ var DateTimePicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
184
184
  if (!targetBtn) return;
185
185
  const apply = () => {
186
186
  const targetTop = targetBtn.getBoundingClientRect().top - container.getBoundingClientRect().top + container.scrollTop - container.clientHeight / 2 + targetBtn.clientHeight / 2;
187
- if (animate) gsap.to(container, {
187
+ if (animate) gsap$1.to(container, {
188
188
  scrollTop: targetTop,
189
189
  duration: .3,
190
190
  ease: "power2.out"
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePicker.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/data-display/date-picker/DateTimePicker.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'relative inline-flex flex-col items-stretch bg-card w-fit self-start',\n !timeOnly ? 'sm:flex-row max-w-65 sm:max-w-none' : '',\n variant === 'outline' ? 'border border-border' : '',\n containerRadiusClass,\n ]\"\n >\n <Calendar\n v-if=\"!timeOnly\"\n v-model=\"dateOnly\"\n :locale=\"locale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :disabled-dates=\"disabledDates\"\n :color=\"color\"\n variant=\"filled\"\n :radius=\"radius\"\n />\n\n <div :class=\"['relative shrink-0', timePanelWidthClass]\">\n <div\n :class=\"[\n 'flex flex-col h-52',\n !timeOnly ? 'border-t border-border sm:border-t-0 sm:border-l sm:absolute sm:inset-0 sm:h-auto' : '',\n ]\"\n >\n <div class=\"px-3 py-3 border-b border-border text-center shrink-0\">\n <span class=\"text-sm font-semibold text-foreground\">{{\n timeLabel\n }}</span>\n </div>\n\n <div class=\"flex flex-1 min-h-0 overflow-hidden\">\n <div\n v-for=\"col in columns\"\n :key=\"col.key\"\n class=\"flex flex-col flex-1 border-r last:border-r-0 border-border\"\n >\n <div\n class=\"px-2 py-1.5 text-center text-xs font-medium text-muted-foreground border-b border-border\"\n >\n {{ col.label }}\n </div>\n <div\n :ref=\"\n (el: unknown) => setScrollRef(col.key, el as HTMLElement | null)\n \"\n class=\"flex-1 overflow-y-auto scroll-smooth\"\n style=\"scrollbar-width: thin\"\n >\n <div class=\"py-14\">\n <button\n v-for=\"item in col.items\"\n :key=\"item.value\"\n type=\"button\"\n :disabled=\"item.disabled\"\n :data-col=\"col.key\"\n :data-value=\"item.value\"\n @click=\"selectTimeItem(col.key, item.value)\"\n :class=\"[\n 'w-full px-2 py-1.5 text-sm text-center transition-colors cursor-pointer focus:outline-none',\n item.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : item.value === col.selected\n ? selectedItemClasses\n : 'text-foreground/80 hover:bg-muted',\n ]\"\n >\n {{ item.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"px-3 py-2 border-t border-border flex justify-end gap-2 shrink-0\"\n >\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"medium\"\n label=\"Now\"\n :class=\"todayTextClass\"\n @click=\"handleNow\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, nextTick, onMounted } from \"vue\";\nimport gsap from \"gsap\";\nimport Calendar from \"../calendar/Calendar.vue\";\nimport Button from \"../../forms/Button.vue\";\nimport {\n useResolvedColor,\n useResolvedRadius,\n} from \"../../../composables/useModoConfig\";\nimport type { DateTimePicker } from \"../../../interfaces/data-display/date-picker/DateTimePicker.interface\";\n\nconst props = withDefaults(defineProps<DateTimePicker>(), {\n modelValue: null,\n locale: \"default\",\n firstDayOfWeek: 0,\n color: \"default\",\n variant: \"outline\",\n format: \"24h\",\n step: 5,\n showSeconds: false,\n timeOnly: false,\n});\n\nconst resolvedColor = useResolvedColor(() => props.color);\nconst resolvedRadius = useResolvedRadius(() => props.radius);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [date: Date];\n}>();\n\ntype ColKey = \"hour\" | \"minute\" | \"second\" | \"period\";\n\nconst scrollRefs = ref<Record<ColKey, HTMLElement | null>>({\n hour: null,\n minute: null,\n second: null,\n period: null,\n});\nconst setScrollRef = (key: ColKey, el: HTMLElement | null) => {\n scrollRefs.value[key] = el;\n};\n\nconst initialDate = props.modelValue ?? new Date();\n\nconst dateOnly = ref<Date>(new Date(initialDate));\nconst hour = ref(initialDate.getHours());\nconst minute = ref(\n Math.round(initialDate.getMinutes() / props.step) * props.step,\n);\nconst second = ref(initialDate.getSeconds());\n\nconst parseTimeStr = (t?: string): number | null => {\n if (!t) return null;\n const [h, m, s] = t.split(\":\").map(Number);\n return h * 3600 + (m || 0) * 60 + (s || 0);\n};\nconst minTimeSec = computed(() => parseTimeStr(props.minTime));\nconst maxTimeSec = computed(() => parseTimeStr(props.maxTime));\n\nconst pad2 = (n: number) => n.toString().padStart(2, \"0\");\n\nconst is12h = computed(() => props.format === \"12h\");\n\nconst hourValues = computed(() => {\n if (is12h.value) {\n return Array.from({ length: 12 }, (_, i) => (i === 0 ? 12 : i));\n }\n return Array.from({ length: 24 }, (_, i) => i);\n});\n\nconst minuteValues = computed(() => {\n const values: number[] = [];\n for (let i = 0; i < 60; i += props.step) values.push(i);\n return values;\n});\n\nconst secondValues = computed(() => {\n const values: number[] = [];\n for (let i = 0; i < 60; i += props.step) values.push(i);\n return values;\n});\n\nconst currentPeriod = computed<\"AM\" | \"PM\">(() =>\n hour.value < 12 ? \"AM\" : \"PM\",\n);\n\nconst hourDisplay = computed(() => {\n if (!is12h.value) return hour.value;\n const h = hour.value % 12;\n return h === 0 ? 12 : h;\n});\n\nconst isTimeDisabled = (h: number, m: number, s: number): boolean => {\n const total = h * 3600 + m * 60 + s;\n if (minTimeSec.value !== null && total < minTimeSec.value) return true;\n if (maxTimeSec.value !== null && total > maxTimeSec.value) return true;\n return false;\n};\n\ninterface TimeItem {\n value: number;\n label: string;\n disabled: boolean;\n}\n\ninterface TimeColumn {\n key: ColKey;\n label: string;\n items: TimeItem[];\n selected: number;\n}\n\nconst columns = computed<TimeColumn[]>(() => {\n const cols: TimeColumn[] = [];\n\n cols.push({\n key: \"hour\",\n label: \"Hour\",\n selected: hourDisplay.value,\n items: hourValues.value.map((v) => {\n const h24 = is12h.value\n ? currentPeriod.value === \"AM\"\n ? v === 12\n ? 0\n : v\n : v === 12\n ? 12\n : v + 12\n : v;\n return {\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(h24, minute.value, second.value),\n };\n }),\n });\n\n cols.push({\n key: \"minute\",\n label: \"Min\",\n selected: minute.value,\n items: minuteValues.value.map((v) => ({\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(hour.value, v, second.value),\n })),\n });\n\n if (props.showSeconds) {\n cols.push({\n key: \"second\",\n label: \"Sec\",\n selected: second.value,\n items: secondValues.value.map((v) => ({\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(hour.value, minute.value, v),\n })),\n });\n }\n\n if (is12h.value) {\n cols.push({\n key: \"period\",\n label: \"AM/PM\",\n selected: currentPeriod.value === \"AM\" ? 0 : 1,\n items: [\n { value: 0, label: \"AM\", disabled: false },\n { value: 1, label: \"PM\", disabled: false },\n ],\n });\n }\n\n return cols;\n});\n\nconst timeLabel = computed(() => {\n const h = is12h.value ? hourDisplay.value : hour.value;\n let s = `${pad2(h)}:${pad2(minute.value)}`;\n if (props.showSeconds) s += `:${pad2(second.value)}`;\n if (is12h.value) s += ` ${currentPeriod.value}`;\n return s;\n});\n\nconst commitDate = () => {\n const d = new Date(dateOnly.value);\n d.setHours(hour.value, minute.value, props.showSeconds ? second.value : 0, 0);\n if (props.modelValue && d.getTime() === props.modelValue.getTime()) return;\n emit(\"update:modelValue\", d);\n};\n\nconst selectTimeItem = (col: ColKey, value: number) => {\n if (col === \"hour\") {\n if (is12h.value) {\n const base = value === 12 ? 0 : value;\n hour.value = currentPeriod.value === \"AM\" ? base : base + 12;\n } else {\n hour.value = value;\n }\n } else if (col === \"minute\") {\n minute.value = value;\n } else if (col === \"second\") {\n second.value = value;\n } else if (col === \"period\") {\n const targetAM = value === 0;\n if (targetAM && hour.value >= 12) hour.value -= 12;\n else if (!targetAM && hour.value < 12) hour.value += 12;\n }\n commitDate();\n scrollColumnToSelected(col);\n};\n\nconst scrollColumnToSelected = (col: ColKey, animate = true) => {\n nextTick(() => {\n const container = scrollRefs.value[col];\n if (!container) return;\n const colInfo = columns.value.find((c) => c.key === col);\n if (!colInfo) return;\n const targetBtn = container.querySelector<HTMLElement>(\n `button[data-col=\"${col}\"][data-value=\"${colInfo.selected}\"]`,\n );\n if (!targetBtn) return;\n const apply = () => {\n // Measured against the scroll container itself rather than\n // `targetBtn.offsetTop`: the nearest positioned ancestor is the time\n // panel wrapper, not this container, so offsetTop also carries the\n // \"Time\" header and the column label. That constant error is what\n // pushed the selected option up behind the hour/min label — most\n // visible in `timeOnly`, where the column is only h-52 tall.\n const offsetWithinScroller =\n targetBtn.getBoundingClientRect().top\n - container.getBoundingClientRect().top\n + container.scrollTop;\n const targetTop =\n offsetWithinScroller -\n container.clientHeight / 2 +\n targetBtn.clientHeight / 2;\n if (animate) {\n gsap.to(container, {\n scrollTop: targetTop,\n duration: 0.3,\n ease: \"power2.out\",\n });\n } else {\n container.scrollTop = targetTop;\n }\n };\n // Defer hasta un segundo frame para que el layout esté asentado\n // (especialmente en mount, cuando el Calendar todavía no determinó altura final).\n requestAnimationFrame(() => requestAnimationFrame(apply));\n });\n};\n\nwatch(dateOnly, () => commitDate());\n\nwatch(\n () => props.modelValue,\n (v) => {\n if (!v) return;\n dateOnly.value = new Date(v);\n hour.value = v.getHours();\n minute.value = v.getMinutes();\n second.value = v.getSeconds();\n columns.value.forEach((c) => scrollColumnToSelected(c.key));\n },\n);\n\nonMounted(() => {\n if (!props.modelValue) commitDate();\n nextTick(() => {\n columns.value.forEach((c) => scrollColumnToSelected(c.key, false));\n });\n});\n\nconst handleNow = () => {\n const now = new Date();\n dateOnly.value = new Date(now);\n hour.value = now.getHours();\n minute.value = Math.round(now.getMinutes() / props.step) * props.step;\n second.value = now.getSeconds();\n commitDate();\n columns.value.forEach((c) => scrollColumnToSelected(c.key));\n};\n\nconst timePanelWidthClass = computed(() => {\n const n = columns.value.length;\n // Mobile: stretches to full calendar width. sm+: fixed width per column count.\n if (n <= 2) return \"sm:w-32\"; // 128px\n if (n === 3) return \"sm:w-48\"; // 192px sm+\n return \"sm:w-64\"; // 256px sm+\n});\n\nconst selectedItemClasses = computed(\n () =>\n ({\n default: \"bg-foreground text-background font-semibold\",\n primary: \"bg-primary text-primary-foreground font-semibold\",\n danger: \"bg-destructive text-destructive-foreground font-semibold\",\n success: \"bg-success text-success-foreground font-semibold\",\n warning: \"bg-warning text-warning-foreground font-semibold\",\n })[resolvedColor.value] ??\n \"bg-primary text-primary-foreground font-semibold\",\n);\n\nconst todayTextClass = computed(\n () =>\n ({\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n })[resolvedColor.value] ?? \"text-primary\",\n);\n\nconst containerRadiusClass = computed(\n () =>\n ({\n none: \"rounded-none\",\n small: \"rounded-sm\",\n medium: \"rounded-md\",\n large: \"rounded-lg\",\n full: \"rounded-xl\",\n })[resolvedRadius.value] ?? \"rounded-lg\",\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GA,MAAM,QAAQ;EAYd,MAAM,gBAAgB,uBAAuB,MAAM,MAAM;EACzD,MAAM,iBAAiB,wBAAwB,MAAM,OAAO;EAE5D,MAAM,OAAO;EAMb,MAAM,aAAa,IAAwC;GACzD,MAAM;GACN,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT,CAAC;EACF,MAAM,gBAAgB,KAAa,OAA2B;GAC5D,WAAW,MAAM,OAAO;;EAG1B,MAAM,cAAc,MAAM,8BAAc,IAAI,MAAM;EAElD,MAAM,WAAW,IAAU,IAAI,KAAK,YAAY,CAAC;EACjD,MAAM,OAAO,IAAI,YAAY,UAAU,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ADb,mBAkBS,UAAA;OAhBN,KAAK,KAAK;OACX,MAAK;OACJ,UAAU,KAAK;OACf,YAAU,IAAI;OACd,cAAY,KAAK;OACjB,UAAK,WAAE,eAAe,IAAI,KAAK,KAAK,MAAK;OACzC,OAAK,eAAA,CAAA,8FAA0I,KAAK,WAAA,gDAAuG,KAAK,UAAU,IAAI,WAAmC,oBAAA,QAAA,oCAAA,CAAA;yBAS/S,KAAK,MAAK,EAAA,IAAA,WAAA;;;IAOvB,mBAWM,OAXN,YAWM,CARJ,YAOE,gBAAA;KANA,SAAQ;KACR,MAAK;KACL,QAAO;KACP,OAAM;KACL,OAAK,eAAE,eAAA,MAAc;KACrB,SAAO"}
1
+ {"version":3,"file":"DateTimePicker.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/data-display/date-picker/DateTimePicker.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'relative inline-flex flex-col items-stretch bg-card w-fit self-start',\n !timeOnly ? 'sm:flex-row max-w-65 sm:max-w-none' : '',\n variant === 'outline' ? 'border border-border' : '',\n containerRadiusClass,\n ]\"\n >\n <Calendar\n v-if=\"!timeOnly\"\n v-model=\"dateOnly\"\n :locale=\"locale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :disabled-dates=\"disabledDates\"\n :color=\"color\"\n variant=\"filled\"\n :radius=\"radius\"\n />\n\n <div :class=\"['relative shrink-0', timePanelWidthClass]\">\n <div\n :class=\"[\n 'flex flex-col h-52',\n !timeOnly ? 'border-t border-border sm:border-t-0 sm:border-l sm:absolute sm:inset-0 sm:h-auto' : '',\n ]\"\n >\n <div class=\"px-3 py-3 border-b border-border text-center shrink-0\">\n <span class=\"text-sm font-semibold text-foreground\">{{\n timeLabel\n }}</span>\n </div>\n\n <div class=\"flex flex-1 min-h-0 overflow-hidden\">\n <div\n v-for=\"col in columns\"\n :key=\"col.key\"\n class=\"flex flex-col flex-1 border-r last:border-r-0 border-border\"\n >\n <div\n class=\"px-2 py-1.5 text-center text-xs font-medium text-muted-foreground border-b border-border\"\n >\n {{ col.label }}\n </div>\n <div\n :ref=\"\n (el: unknown) => setScrollRef(col.key, el as HTMLElement | null)\n \"\n class=\"flex-1 overflow-y-auto scroll-smooth\"\n style=\"scrollbar-width: thin\"\n >\n <div class=\"py-14\">\n <button\n v-for=\"item in col.items\"\n :key=\"item.value\"\n type=\"button\"\n :disabled=\"item.disabled\"\n :data-col=\"col.key\"\n :data-value=\"item.value\"\n @click=\"selectTimeItem(col.key, item.value)\"\n :class=\"[\n 'w-full px-2 py-1.5 text-sm text-center transition-colors cursor-pointer focus:outline-none',\n item.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : item.value === col.selected\n ? selectedItemClasses\n : 'text-foreground/80 hover:bg-muted',\n ]\"\n >\n {{ item.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"px-3 py-2 border-t border-border flex justify-end gap-2 shrink-0\"\n >\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"medium\"\n label=\"Now\"\n :class=\"todayTextClass\"\n @click=\"handleNow\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, nextTick, onMounted } from \"vue\";\nimport gsap from \"gsap\";\nimport Calendar from \"../calendar/Calendar.vue\";\nimport Button from \"../../forms/Button.vue\";\nimport {\n useResolvedColor,\n useResolvedRadius,\n} from \"../../../composables/useModoConfig\";\nimport type { DateTimePicker } from \"../../../interfaces/data-display/date-picker/DateTimePicker.interface\";\n\nconst props = withDefaults(defineProps<DateTimePicker>(), {\n modelValue: null,\n locale: \"default\",\n firstDayOfWeek: 0,\n color: \"default\",\n variant: \"outline\",\n format: \"24h\",\n step: 5,\n showSeconds: false,\n timeOnly: false,\n});\n\nconst resolvedColor = useResolvedColor(() => props.color);\nconst resolvedRadius = useResolvedRadius(() => props.radius);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [date: Date];\n}>();\n\ntype ColKey = \"hour\" | \"minute\" | \"second\" | \"period\";\n\nconst scrollRefs = ref<Record<ColKey, HTMLElement | null>>({\n hour: null,\n minute: null,\n second: null,\n period: null,\n});\nconst setScrollRef = (key: ColKey, el: HTMLElement | null) => {\n scrollRefs.value[key] = el;\n};\n\nconst initialDate = props.modelValue ?? new Date();\n\nconst dateOnly = ref<Date>(new Date(initialDate));\nconst hour = ref(initialDate.getHours());\nconst minute = ref(\n Math.round(initialDate.getMinutes() / props.step) * props.step,\n);\nconst second = ref(initialDate.getSeconds());\n\nconst parseTimeStr = (t?: string): number | null => {\n if (!t) return null;\n const [h, m, s] = t.split(\":\").map(Number);\n return h * 3600 + (m || 0) * 60 + (s || 0);\n};\nconst minTimeSec = computed(() => parseTimeStr(props.minTime));\nconst maxTimeSec = computed(() => parseTimeStr(props.maxTime));\n\nconst pad2 = (n: number) => n.toString().padStart(2, \"0\");\n\nconst is12h = computed(() => props.format === \"12h\");\n\nconst hourValues = computed(() => {\n if (is12h.value) {\n return Array.from({ length: 12 }, (_, i) => (i === 0 ? 12 : i));\n }\n return Array.from({ length: 24 }, (_, i) => i);\n});\n\nconst minuteValues = computed(() => {\n const values: number[] = [];\n for (let i = 0; i < 60; i += props.step) values.push(i);\n return values;\n});\n\nconst secondValues = computed(() => {\n const values: number[] = [];\n for (let i = 0; i < 60; i += props.step) values.push(i);\n return values;\n});\n\nconst currentPeriod = computed<\"AM\" | \"PM\">(() =>\n hour.value < 12 ? \"AM\" : \"PM\",\n);\n\nconst hourDisplay = computed(() => {\n if (!is12h.value) return hour.value;\n const h = hour.value % 12;\n return h === 0 ? 12 : h;\n});\n\nconst isTimeDisabled = (h: number, m: number, s: number): boolean => {\n const total = h * 3600 + m * 60 + s;\n if (minTimeSec.value !== null && total < minTimeSec.value) return true;\n if (maxTimeSec.value !== null && total > maxTimeSec.value) return true;\n return false;\n};\n\ninterface TimeItem {\n value: number;\n label: string;\n disabled: boolean;\n}\n\ninterface TimeColumn {\n key: ColKey;\n label: string;\n items: TimeItem[];\n selected: number;\n}\n\nconst columns = computed<TimeColumn[]>(() => {\n const cols: TimeColumn[] = [];\n\n cols.push({\n key: \"hour\",\n label: \"Hour\",\n selected: hourDisplay.value,\n items: hourValues.value.map((v) => {\n const h24 = is12h.value\n ? currentPeriod.value === \"AM\"\n ? v === 12\n ? 0\n : v\n : v === 12\n ? 12\n : v + 12\n : v;\n return {\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(h24, minute.value, second.value),\n };\n }),\n });\n\n cols.push({\n key: \"minute\",\n label: \"Min\",\n selected: minute.value,\n items: minuteValues.value.map((v) => ({\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(hour.value, v, second.value),\n })),\n });\n\n if (props.showSeconds) {\n cols.push({\n key: \"second\",\n label: \"Sec\",\n selected: second.value,\n items: secondValues.value.map((v) => ({\n value: v,\n label: pad2(v),\n disabled: isTimeDisabled(hour.value, minute.value, v),\n })),\n });\n }\n\n if (is12h.value) {\n cols.push({\n key: \"period\",\n label: \"AM/PM\",\n selected: currentPeriod.value === \"AM\" ? 0 : 1,\n items: [\n { value: 0, label: \"AM\", disabled: false },\n { value: 1, label: \"PM\", disabled: false },\n ],\n });\n }\n\n return cols;\n});\n\nconst timeLabel = computed(() => {\n const h = is12h.value ? hourDisplay.value : hour.value;\n let s = `${pad2(h)}:${pad2(minute.value)}`;\n if (props.showSeconds) s += `:${pad2(second.value)}`;\n if (is12h.value) s += ` ${currentPeriod.value}`;\n return s;\n});\n\nconst commitDate = () => {\n const d = new Date(dateOnly.value);\n d.setHours(hour.value, minute.value, props.showSeconds ? second.value : 0, 0);\n if (props.modelValue && d.getTime() === props.modelValue.getTime()) return;\n emit(\"update:modelValue\", d);\n};\n\nconst selectTimeItem = (col: ColKey, value: number) => {\n if (col === \"hour\") {\n if (is12h.value) {\n const base = value === 12 ? 0 : value;\n hour.value = currentPeriod.value === \"AM\" ? base : base + 12;\n } else {\n hour.value = value;\n }\n } else if (col === \"minute\") {\n minute.value = value;\n } else if (col === \"second\") {\n second.value = value;\n } else if (col === \"period\") {\n const targetAM = value === 0;\n if (targetAM && hour.value >= 12) hour.value -= 12;\n else if (!targetAM && hour.value < 12) hour.value += 12;\n }\n commitDate();\n scrollColumnToSelected(col);\n};\n\nconst scrollColumnToSelected = (col: ColKey, animate = true) => {\n nextTick(() => {\n const container = scrollRefs.value[col];\n if (!container) return;\n const colInfo = columns.value.find((c) => c.key === col);\n if (!colInfo) return;\n const targetBtn = container.querySelector<HTMLElement>(\n `button[data-col=\"${col}\"][data-value=\"${colInfo.selected}\"]`,\n );\n if (!targetBtn) return;\n const apply = () => {\n // Measured against the scroll container itself rather than\n // `targetBtn.offsetTop`: the nearest positioned ancestor is the time\n // panel wrapper, not this container, so offsetTop also carries the\n // \"Time\" header and the column label. That constant error is what\n // pushed the selected option up behind the hour/min label — most\n // visible in `timeOnly`, where the column is only h-52 tall.\n const offsetWithinScroller =\n targetBtn.getBoundingClientRect().top\n - container.getBoundingClientRect().top\n + container.scrollTop;\n const targetTop =\n offsetWithinScroller -\n container.clientHeight / 2 +\n targetBtn.clientHeight / 2;\n if (animate) {\n gsap.to(container, {\n scrollTop: targetTop,\n duration: 0.3,\n ease: \"power2.out\",\n });\n } else {\n container.scrollTop = targetTop;\n }\n };\n // Defer hasta un segundo frame para que el layout esté asentado\n // (especialmente en mount, cuando el Calendar todavía no determinó altura final).\n requestAnimationFrame(() => requestAnimationFrame(apply));\n });\n};\n\nwatch(dateOnly, () => commitDate());\n\nwatch(\n () => props.modelValue,\n (v) => {\n if (!v) return;\n dateOnly.value = new Date(v);\n hour.value = v.getHours();\n minute.value = v.getMinutes();\n second.value = v.getSeconds();\n columns.value.forEach((c) => scrollColumnToSelected(c.key));\n },\n);\n\nonMounted(() => {\n if (!props.modelValue) commitDate();\n nextTick(() => {\n columns.value.forEach((c) => scrollColumnToSelected(c.key, false));\n });\n});\n\nconst handleNow = () => {\n const now = new Date();\n dateOnly.value = new Date(now);\n hour.value = now.getHours();\n minute.value = Math.round(now.getMinutes() / props.step) * props.step;\n second.value = now.getSeconds();\n commitDate();\n columns.value.forEach((c) => scrollColumnToSelected(c.key));\n};\n\nconst timePanelWidthClass = computed(() => {\n const n = columns.value.length;\n // Mobile: stretches to full calendar width. sm+: fixed width per column count.\n if (n <= 2) return \"sm:w-32\"; // 128px\n if (n === 3) return \"sm:w-48\"; // 192px sm+\n return \"sm:w-64\"; // 256px sm+\n});\n\nconst selectedItemClasses = computed(\n () =>\n ({\n default: \"bg-foreground text-background font-semibold\",\n primary: \"bg-primary text-primary-foreground font-semibold\",\n danger: \"bg-destructive text-destructive-foreground font-semibold\",\n success: \"bg-success text-success-foreground font-semibold\",\n warning: \"bg-warning text-warning-foreground font-semibold\",\n })[resolvedColor.value] ??\n \"bg-primary text-primary-foreground font-semibold\",\n);\n\nconst todayTextClass = computed(\n () =>\n ({\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n })[resolvedColor.value] ?? \"text-primary\",\n);\n\nconst containerRadiusClass = computed(\n () =>\n ({\n none: \"rounded-none\",\n small: \"rounded-sm\",\n medium: \"rounded-md\",\n large: \"rounded-lg\",\n full: \"rounded-xl\",\n })[resolvedRadius.value] ?? \"rounded-lg\",\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GA,MAAM,QAAQ;EAYd,MAAM,gBAAgB,uBAAuB,MAAM,MAAM;EACzD,MAAM,iBAAiB,wBAAwB,MAAM,OAAO;EAE5D,MAAM,OAAO;EAMb,MAAM,aAAa,IAAwC;GACzD,MAAM;GACN,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT,CAAC;EACF,MAAM,gBAAgB,KAAa,OAA2B;GAC5D,WAAW,MAAM,OAAO;;EAG1B,MAAM,cAAc,MAAM,8BAAc,IAAI,MAAM;EAElD,MAAM,WAAW,IAAU,IAAI,KAAK,YA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BS,UAAA,MAAA,WAjBQ,IAAI,QAAZ,SAAI;0BADb,mBAkBS,UAAA;OAhBN,KAAK,KAAK;OACX,MAAK;OACJ,UAAU,KAAK;OACf,YAAU,IAAI;OACd,cAAY,KAAK;OACjB,UAAK,WAAE,eAAe,IAAI,KAAK,KAAK,MAAK;OACzC,OAAK,eAAA,CAAA,8FAA0I,KAAK,WAAA,gDAAuG,KAAK,UAAU,IAAI,WAAmC,oBAAA,QAAA,oCAAA,CAAA;yBAS/S,KAAK,MAAK,EAAA,IAAA,WAAA;;;IAOvB,mBAWM,OAXN,YAWM,CARJ,YAOE,gBAAA;KANA,SAAQ;KACR,MAAK;KACL,QAAO;KACP,OAAM;KACL,OAAK,eAAE,eAAA,MAAc;KACrB,SAAO"}
@@ -2,7 +2,7 @@ import { useModoLocale, useResolvedRadius } from "../../composables/useModoConfi
2
2
  import Button_default from "../forms/Button.mjs";
3
3
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, nextTick, normalizeClass, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref } from "vue";
4
4
  import { XMarkIcon } from "@heroicons/vue/24/outline";
5
- import gsap from "gsap";
5
+ import gsap$1 from "gsap";
6
6
  //#region src/components/feedback/Banner.vue?vue&type=script&setup=true&lang.ts
7
7
  var _hoisted_1 = ["role", "aria-live"];
8
8
  var _hoisted_2 = {
@@ -95,7 +95,7 @@ var Banner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
95
95
  if (!bannerRef.value) return;
96
96
  if ((typeof window !== "undefined" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)") : null)?.matches) return;
97
97
  const el = bannerRef.value;
98
- gsap.fromTo(el, {
98
+ gsap$1.fromTo(el, {
99
99
  opacity: 0,
100
100
  height: 0,
101
101
  paddingTop: 0,
@@ -131,7 +131,7 @@ var Banner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
131
131
  const originX = btnRect.left + btnRect.width / 2 - bannerRect.left;
132
132
  const originY = btnRect.top + btnRect.height / 2 - bannerRect.top;
133
133
  bannerRef.value.style.transformOrigin = `${originX}px ${originY}px`;
134
- gsap.timeline({ onComplete: () => {
134
+ gsap$1.timeline({ onComplete: () => {
135
135
  visible.value = false;
136
136
  emit("dismiss");
137
137
  } }).to(bannerRef.value, {
@@ -140,7 +140,7 @@ var Banner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
140
140
  duration: .6,
141
141
  ease: "power1.in"
142
142
  });
143
- } else gsap.to(bannerRef.value, {
143
+ } else gsap$1.to(bannerRef.value, {
144
144
  opacity: 0,
145
145
  height: 0,
146
146
  paddingTop: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../src/components/feedback/Banner.vue"],"sourcesContent":["<template> \n <div \n v-if=\"visible\" \n ref=\"bannerRef\" \n :role=\"liveRole\" \n :aria-live=\"liveness\" \n :class=\"['overflow-hidden', baseClasses, colorClasses, positionClasses, fullWidth ? 'rounded-none' : radiusClasses]\" \n > \n <div v-if=\"showIcon\" :class=\"['shrink-0', iconColorClasses]\"> \n <component :is=\"icon\" v-if=\"icon\" class=\"w-5 h-5\" /> \n <svg v-else-if=\"color === 'info'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" /> \n </svg> \n <svg v-else-if=\"color === 'warning'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\" /> \n </svg> \n <svg v-else-if=\"color === 'danger'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z\" /> \n </svg> \n <svg v-else class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" /> \n </svg> \n </div> \n \n <div class=\"flex-1 min-w-0\"> \n <p v-if=\"title\" :class=\"['font-semibold', titleColorClasses]\">{{ title }}</p> \n <div v-if=\"description || $slots.default\" :class=\"[title ? 'mt-1' : '', bodyColorClasses]\"> \n <slot>{{ description }}</slot> \n </div> \n </div> \n \n <div v-if=\"$slots.actions\" class=\"shrink-0 ml-4\"> \n <slot name=\"actions\" /> \n </div> \n \n <Button \n v-if=\"dismissable\" \n ref=\"dismissBtnRef\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.banner.dismiss\" \n :class=\"['shrink-0 ml-2', dismissClasses]\" \n @click=\"dismiss\" \n /> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, onMounted, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport type { Banner } from '../../interfaces/feedback/Banner.interface'; \nimport { useResolvedRadius, useModoLocale } from '../../composables/useModoConfig'; \nimport Button from '../forms/Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ dismiss: [] }>(); \n \nconst props = withDefaults(defineProps<Banner>(), { \n color: 'info', \n variant: 'subtle', \n dismissable: false, \n dismissAnimation: 'collapse', \n showIcon: true, \n position: 'inline', \n fullWidth: false, \n}); \n \nconst radius = useResolvedRadius(() => props.radius); \nconst radiusClasses = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-3xl'; \n default: return 'rounded-lg'; \n } \n}); \n \nconst visible = ref(true); \nconst bannerRef = ref<HTMLElement | null>(null); \nconst dismissBtnRef = ref<{ $el: HTMLElement } | null>(null); \n \n/** \n * Intro animation: collapsed height + fade-in + small translate-y. \n * Mirrors the reverse of the default `collapse` dismiss so entry and exit \n * feel symmetrical. Skipped under `prefers-reduced-motion`. \n */ \nonMounted(async () => { \n await nextTick(); \n if (!bannerRef.value) return; \n const mql = typeof window !== 'undefined' && window.matchMedia \n ? window.matchMedia('(prefers-reduced-motion: reduce)') \n : null; \n if (mql?.matches) return; \n \n const el = bannerRef.value; \n gsap.fromTo( \n el, \n { opacity: 0, height: 0, paddingTop: 0, paddingBottom: 0, marginBottom: 0, y: -4 }, \n { \n opacity: 1, \n height: 'auto', \n paddingTop: '', \n paddingBottom: '', \n marginBottom: '', \n y: 0, \n duration: 0.32, \n ease: 'power2.out', \n clearProps: 'height,paddingTop,paddingBottom,marginBottom,transform', \n }, \n ); \n}); \n \n/** \n * Accessibility: \n * - `danger`/`warning` → `role=\"alert\"` + `aria-live=\"assertive\"` (interrupts). \n * - `info`/`success` → `role=\"status\"` + `aria-live=\"polite\"` (queued). \n * This matches WAI-ARIA guidance: assertive only for time-critical or error \n * messages; polite for informative updates. \n */ \nconst liveRole = computed(() => (props.color === 'danger' || props.color === 'warning' ? 'alert' : 'status')); \nconst liveness = computed<'assertive' | 'polite'>(() => (props.color === 'danger' || props.color === 'warning' ? 'assertive' : 'polite')); \n \nconst dismiss = () => { \n if (!bannerRef.value) return; \n \n if (props.dismissAnimation === 'shrink' && dismissBtnRef.value?.$el) { \n const bannerRect = bannerRef.value.getBoundingClientRect(); \n const btnRect = dismissBtnRef.value.$el.getBoundingClientRect(); \n \n const originX = btnRect.left + btnRect.width / 2 - bannerRect.left; \n const originY = btnRect.top + btnRect.height / 2 - bannerRect.top; \n bannerRef.value.style.transformOrigin = `${originX}px ${originY}px`; \n \n const tl = gsap.timeline({ \n onComplete: () => { \n visible.value = false; \n emit('dismiss'); \n }, \n }); \n \n tl.to(bannerRef.value, { \n scale: 0, \n opacity: 0, \n duration: 0.6, \n ease: 'power1.in', \n }); \n } else { \n gsap.to(bannerRef.value, { \n opacity: 0, \n height: 0, \n paddingTop: 0, \n paddingBottom: 0, \n marginBottom: 0, \n duration: 0.3, \n ease: 'power2.inOut', \n onComplete: () => { \n visible.value = false; \n emit('dismiss'); \n }, \n }); \n } \n}; \n \nconst baseClasses = 'flex items-start gap-3 px-4 py-3 text-sm'; \n \nconst positionClasses = computed(() => { \n switch (props.position) { \n case 'sticky-top': return 'sticky top-0 z-50'; \n case 'sticky-bottom': return 'sticky bottom-0 z-50'; \n default: return ''; \n } \n}); \n \nconst colorClasses = computed(() => { \n const map: Record<string, Record<string, string>> = { \n info: { \n filled: 'bg-info text-info-foreground', \n subtle: 'bg-info-subtle', \n outline: 'border border-info/30 bg-card', \n }, \n warning: { \n filled: 'bg-warning text-warning-foreground', \n subtle: 'bg-warning-subtle', \n outline: 'border border-warning/30 bg-card', \n }, \n danger: { \n filled: 'bg-destructive text-destructive-foreground', \n subtle: 'bg-destructive-subtle', \n outline: 'border border-destructive/30 bg-card', \n }, \n success: { \n filled: 'bg-success text-success-foreground', \n subtle: 'bg-success-subtle', \n outline: 'border border-success/30 bg-card', \n }, \n }; \n return map[props.color]?.[props.variant] ?? map.info.subtle; \n}); \n \nconst iconColorClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/80'; \n const map: Record<string, string> = { \n info: 'text-info', \n warning: 'text-warning', \n danger: 'text-destructive', \n success: 'text-success', \n }; \n return map[props.color] ?? 'text-info'; \n}); \n \nconst titleColorClasses = computed(() => { \n if (props.variant === 'filled') return ''; \n const map: Record<string, string> = { \n info: 'text-info', \n warning: 'text-warning', \n danger: 'text-destructive', \n success: 'text-success', \n }; \n return map[props.color] ?? 'text-info'; \n}); \n \nconst bodyColorClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/90'; \n const map: Record<string, string> = { \n info: 'text-info/90', \n warning: 'text-warning/90', \n danger: 'text-destructive/90', \n success: 'text-success/90', \n }; \n return map[props.color] ?? 'text-info/90'; \n}); \n \nconst dismissClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/70 hover:text-current hover:bg-current/10'; \n const map: Record<string, string> = { \n info: 'text-info/60 hover:text-info hover:bg-info/10', \n warning: 'text-warning/60 hover:text-warning hover:bg-warning/10', \n danger: 'text-destructive/60 hover:text-destructive hover:bg-destructive/10', \n success: 'text-success/60 hover:text-success hover:bg-success/10', \n }; \n return map[props.color] ?? 'text-info/60 hover:text-info hover:bg-info/10'; \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwKA,IAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;EA/GpB,MAAM,MAAM,eAAe;EAE3B,MAAM,OAAO;EAEb,MAAM,QAAQ;EAUd,MAAM,SAAS,wBAAwB,MAAM,OAAO;EACpD,MAAM,gBAAgB,eAAe;GACjC,QAAQ,OAAO,OAAf;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IACrB,KAAK,QAAQ,OAAO;IACpB,SAAS,OAAO;;IAEtB;EAEF,MAAM,UAAU,IAAI,KAAK;EACzB,MAAM,YAAY,IAAwB,KAAK;EAC/C,MAAM,gBAAgB,IAAiC,KAAK;;;;;;EAO5D,UAAU,YAAY;GAClB,MAAM,UAAU;GAChB,IAAI,CAAC,UAAU,OAAO;GAItB,KAHY,OAAO,WAAW,eAAe,OAAO,aAC9C,OAAO,WAAW,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,WAAuB,KAAA,QAAA,UAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;IAIjB,QAAA,eAAA,WAAA,EADV,YAUE,gBAAA;;cARM;KAAJ,KAAI;KACJ,SAAQ;KACR,MAAK;KACL,QAAO;KACN,MAAM,MAAA,UAAS;KACf,WAAW,MAAA,IAAG,CAAC,OAAO;KACtB,OAAK,eAAA,CAAA,iBAAoB,eAAA,MAAc,CAAA;KACvC,SAAO"}
1
+ {"version":3,"file":"Banner.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../src/components/feedback/Banner.vue"],"sourcesContent":["<template> \n <div \n v-if=\"visible\" \n ref=\"bannerRef\" \n :role=\"liveRole\" \n :aria-live=\"liveness\" \n :class=\"['overflow-hidden', baseClasses, colorClasses, positionClasses, fullWidth ? 'rounded-none' : radiusClasses]\" \n > \n <div v-if=\"showIcon\" :class=\"['shrink-0', iconColorClasses]\"> \n <component :is=\"icon\" v-if=\"icon\" class=\"w-5 h-5\" /> \n <svg v-else-if=\"color === 'info'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" /> \n </svg> \n <svg v-else-if=\"color === 'warning'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\" /> \n </svg> \n <svg v-else-if=\"color === 'danger'\" class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z\" /> \n </svg> \n <svg v-else class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"> \n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" /> \n </svg> \n </div> \n \n <div class=\"flex-1 min-w-0\"> \n <p v-if=\"title\" :class=\"['font-semibold', titleColorClasses]\">{{ title }}</p> \n <div v-if=\"description || $slots.default\" :class=\"[title ? 'mt-1' : '', bodyColorClasses]\"> \n <slot>{{ description }}</slot> \n </div> \n </div> \n \n <div v-if=\"$slots.actions\" class=\"shrink-0 ml-4\"> \n <slot name=\"actions\" /> \n </div> \n \n <Button \n v-if=\"dismissable\" \n ref=\"dismissBtnRef\" \n variant=\"text\" \n size=\"small\" \n radius=\"medium\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.banner.dismiss\" \n :class=\"['shrink-0 ml-2', dismissClasses]\" \n @click=\"dismiss\" \n /> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, onMounted, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport type { Banner } from '../../interfaces/feedback/Banner.interface'; \nimport { useResolvedRadius, useModoLocale } from '../../composables/useModoConfig'; \nimport Button from '../forms/Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ dismiss: [] }>(); \n \nconst props = withDefaults(defineProps<Banner>(), { \n color: 'info', \n variant: 'subtle', \n dismissable: false, \n dismissAnimation: 'collapse', \n showIcon: true, \n position: 'inline', \n fullWidth: false, \n}); \n \nconst radius = useResolvedRadius(() => props.radius); \nconst radiusClasses = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-3xl'; \n default: return 'rounded-lg'; \n } \n}); \n \nconst visible = ref(true); \nconst bannerRef = ref<HTMLElement | null>(null); \nconst dismissBtnRef = ref<{ $el: HTMLElement } | null>(null); \n \n/** \n * Intro animation: collapsed height + fade-in + small translate-y. \n * Mirrors the reverse of the default `collapse` dismiss so entry and exit \n * feel symmetrical. Skipped under `prefers-reduced-motion`. \n */ \nonMounted(async () => { \n await nextTick(); \n if (!bannerRef.value) return; \n const mql = typeof window !== 'undefined' && window.matchMedia \n ? window.matchMedia('(prefers-reduced-motion: reduce)') \n : null; \n if (mql?.matches) return; \n \n const el = bannerRef.value; \n gsap.fromTo( \n el, \n { opacity: 0, height: 0, paddingTop: 0, paddingBottom: 0, marginBottom: 0, y: -4 }, \n { \n opacity: 1, \n height: 'auto', \n paddingTop: '', \n paddingBottom: '', \n marginBottom: '', \n y: 0, \n duration: 0.32, \n ease: 'power2.out', \n clearProps: 'height,paddingTop,paddingBottom,marginBottom,transform', \n }, \n ); \n}); \n \n/** \n * Accessibility: \n * - `danger`/`warning` → `role=\"alert\"` + `aria-live=\"assertive\"` (interrupts). \n * - `info`/`success` → `role=\"status\"` + `aria-live=\"polite\"` (queued). \n * This matches WAI-ARIA guidance: assertive only for time-critical or error \n * messages; polite for informative updates. \n */ \nconst liveRole = computed(() => (props.color === 'danger' || props.color === 'warning' ? 'alert' : 'status')); \nconst liveness = computed<'assertive' | 'polite'>(() => (props.color === 'danger' || props.color === 'warning' ? 'assertive' : 'polite')); \n \nconst dismiss = () => { \n if (!bannerRef.value) return; \n \n if (props.dismissAnimation === 'shrink' && dismissBtnRef.value?.$el) { \n const bannerRect = bannerRef.value.getBoundingClientRect(); \n const btnRect = dismissBtnRef.value.$el.getBoundingClientRect(); \n \n const originX = btnRect.left + btnRect.width / 2 - bannerRect.left; \n const originY = btnRect.top + btnRect.height / 2 - bannerRect.top; \n bannerRef.value.style.transformOrigin = `${originX}px ${originY}px`; \n \n const tl = gsap.timeline({ \n onComplete: () => { \n visible.value = false; \n emit('dismiss'); \n }, \n }); \n \n tl.to(bannerRef.value, { \n scale: 0, \n opacity: 0, \n duration: 0.6, \n ease: 'power1.in', \n }); \n } else { \n gsap.to(bannerRef.value, { \n opacity: 0, \n height: 0, \n paddingTop: 0, \n paddingBottom: 0, \n marginBottom: 0, \n duration: 0.3, \n ease: 'power2.inOut', \n onComplete: () => { \n visible.value = false; \n emit('dismiss'); \n }, \n }); \n } \n}; \n \nconst baseClasses = 'flex items-start gap-3 px-4 py-3 text-sm'; \n \nconst positionClasses = computed(() => { \n switch (props.position) { \n case 'sticky-top': return 'sticky top-0 z-50'; \n case 'sticky-bottom': return 'sticky bottom-0 z-50'; \n default: return ''; \n } \n}); \n \nconst colorClasses = computed(() => { \n const map: Record<string, Record<string, string>> = { \n info: { \n filled: 'bg-info text-info-foreground', \n subtle: 'bg-info-subtle', \n outline: 'border border-info/30 bg-card', \n }, \n warning: { \n filled: 'bg-warning text-warning-foreground', \n subtle: 'bg-warning-subtle', \n outline: 'border border-warning/30 bg-card', \n }, \n danger: { \n filled: 'bg-destructive text-destructive-foreground', \n subtle: 'bg-destructive-subtle', \n outline: 'border border-destructive/30 bg-card', \n }, \n success: { \n filled: 'bg-success text-success-foreground', \n subtle: 'bg-success-subtle', \n outline: 'border border-success/30 bg-card', \n }, \n }; \n return map[props.color]?.[props.variant] ?? map.info.subtle; \n}); \n \nconst iconColorClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/80'; \n const map: Record<string, string> = { \n info: 'text-info', \n warning: 'text-warning', \n danger: 'text-destructive', \n success: 'text-success', \n }; \n return map[props.color] ?? 'text-info'; \n}); \n \nconst titleColorClasses = computed(() => { \n if (props.variant === 'filled') return ''; \n const map: Record<string, string> = { \n info: 'text-info', \n warning: 'text-warning', \n danger: 'text-destructive', \n success: 'text-success', \n }; \n return map[props.color] ?? 'text-info'; \n}); \n \nconst bodyColorClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/90'; \n const map: Record<string, string> = { \n info: 'text-info/90', \n warning: 'text-warning/90', \n danger: 'text-destructive/90', \n success: 'text-success/90', \n }; \n return map[props.color] ?? 'text-info/90'; \n}); \n \nconst dismissClasses = computed(() => { \n if (props.variant === 'filled') return 'text-current/70 hover:text-current hover:bg-current/10'; \n const map: Record<string, string> = { \n info: 'text-info/60 hover:text-info hover:bg-info/10', \n warning: 'text-warning/60 hover:text-warning hover:bg-warning/10', \n danger: 'text-destructive/60 hover:text-destructive hover:bg-destructive/10', \n success: 'text-success/60 hover:text-success hover:bg-success/10', \n }; \n return map[props.color] ?? 'text-info/60 hover:text-info hover:bg-info/10'; \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwKA,IAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;EA/GpB,MAAM,MAAM,eAAe;EAE3B,MAAM,OAAO;EAEb,MAAM,QAAQ;EAUd,MAAM,SAAS,wBAAwB,MAAM,OAAO;EACpD,MAAM,gBAAgB,eAAe;GACjC,QAAQ,OAAO,OAAf;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IACrB,KAAK,QAAQ,OAAO;IACpB,SAAS,OAAO;;IAEtB;EAEF,MAAM,UAAU,IAAI,KAAK;EACzB,MAAM,YAAY,IAAwB,KAAK;EAC/C,MAAM,gBAAgB,IAAiC,KAAK;;;;;;EAO5D,UAAU,YAAY;GAClB,MAAM,UAAU;GAChB,IAAI,CAAC,UAAU,OAAO;GAItB,KAHY,OAAO,WAAW,eAAe,OAAO,aAC9C,OAAO,WAAW,mCAAmC,GACrD,OACG,SAAS;GAElB,MAAM,KAAK,UAAU;GACrB,OAAK,OACD,IACA;IAAE,SAAS;IAAG,QAAQ;IAAG,YAAY;IAAG,eAAe;IAAG,cAAc;IAAG,GAAG;IAAI,EAClF;IACI,S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ACN,MAAM,MAAA,UAAS;KACf,WAAW,MAAA,IAAG,CAAC,OAAO;KACtB,OAAK,eAAA,CAAA,iBAAoB,eAAA,MAAc,CAAA;KACvC,SAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.cjs","names":[],"sources":["../../../src/components/feedback/Drawer.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-drawer-overlay fixed inset-0 z-1200 flex opacity-0', \n inset ? 'p-2.5' : '', \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-drawer-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-drawer modo-drawer-glass relative flex flex-col text-foreground overflow-hidden', \n 'outline-none focus:outline-none focus-visible:outline-none', \n sideBorderClass, \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 --> \n <div v-if=\"showClose\" class=\"absolute top-3 right-3.5 z-10\"> \n <button\n type=\"button\"\n class=\"modo-drawer__x\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n </button>\n </div> \n \n <!-- Content wrapper --> \n <div ref=\"contentRef\" data-modo-drawer-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-5 pt-5', \n showClose ? 'pr-14' : '', \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-5', \n ($slots.header || title || description) ? '' : 'pt-5', \n $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"body\"> \n <slot /> \n </slot> \n </div> \n \n <!-- Footer --> \n <footer \n v-if=\"$slots.footer\" \n class=\"relative flex items-center justify-end gap-2 px-5 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, ref, useId, watch } from 'vue'; \nimport { gsap } from 'gsap'; \nimport Typography from '../data-display/Typography.vue'; \nimport type { Drawer } from '../../interfaces/feedback/Drawer.interface'; \nimport { \n useResolvedRadius, \n useResolvedTheme, \n useModoConfig, \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 { ModoRadius } from '../../config/ModoConfig'; \n \nconst props = withDefaults(defineProps<Drawer>(), { \n modelValue: false, \n side: 'right', \n size: 'medium', \n inset: true,\n closeOnOverlay: true, \n closeOnEscape: true, \n showClose: true, \n lockScroll: true, \n color: 'default', \n overlay: 'blur', \n innerBorder: false, \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-drawer-${autoId}-title`); \nconst descriptionId = computed(() => `modo-drawer-${autoId}-desc`); \n \nconst overlayRef = ref<HTMLElement | null>(null); \nconst panelRef = ref<HTMLElement | null>(null); \nconst contentRef = ref<HTMLElement | null>(null); \n \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 (slide from edge) ---------- */ \n \nfunction prefersReducedMotion() { \n return typeof window !== 'undefined' \n && window.matchMedia('(prefers-reduced-motion: reduce)').matches; \n} \n \nlet activeTimeline: gsap.core.Timeline | null = null; \n \nfunction getEnterTransform() { \n const marginOffset = props.inset ? 28 : 0;\n switch (props.side) { \n case 'left': return { xPercent: -100, x: -marginOffset, yPercent: 0, y: 0 }; \n case 'right': return { xPercent: 100, x: marginOffset, yPercent: 0, y: 0 }; \n case 'top': return { xPercent: 0, x: 0, yPercent: -100, y: -marginOffset }; \n case 'bottom': return { xPercent: 0, x: 0, yPercent: 100, y: marginOffset }; \n default: return { xPercent: 100, x: marginOffset, yPercent: 0, y: 0 }; \n } \n} \n \nfunction onOverlayEnter(el: Element, done: () => void) { \n const overlay = (el as HTMLElement) ?? overlayRef.value; \n const panel = \n overlay?.querySelector<HTMLElement>('[data-modo-drawer-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 enter = getEnterTransform(); \n const tl = gsap.timeline({ onComplete: () => { activeTimeline = null; done(); } }); \n activeTimeline = tl; \n \n tl.fromTo(overlay, { opacity: 0 }, { opacity: 1, duration: 0.24, ease: 'power2.out' }, 0); \n \n tl.fromTo( \n panel, \n { xPercent: enter.xPercent, x: enter.x, yPercent: enter.yPercent, y: enter.y, opacity: 1 }, \n { xPercent: 0, x: 0, yPercent: 0, y: 0, opacity: 1, duration: 0.38, ease: 'power4.out' }, \n 0, \n ); \n} \n \nfunction onOverlayLeave(el: Element, done: () => void) { \n const overlay = el as HTMLElement; \n const panel = \n overlay.querySelector<HTMLElement>('[data-modo-drawer-panel]') \n ?? panelRef.value; \n // Bail out without animating, but never without releasing the lock.\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 enter = getEnterTransform(); \n const tl = gsap.timeline({ \n onComplete: () => { \n activeTimeline = null; \n releaseScrollLock(); \n done(); \n }, \n }); \n activeTimeline = tl; \n \n tl.to( \n panel, \n { xPercent: enter.xPercent, x: enter.x, yPercent: enter.yPercent, y: enter.y, duration: 0.28, ease: 'power3.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.24, ease: 'power2.in' }, 0.04); \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\nwatch( \n () => props.modelValue, \n (open) => { \n if (open) { \n const active = document.activeElement as HTMLElement | null; \n previouslyFocused = active; \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 if (previouslyFocused && typeof previouslyFocused.focus === 'function') { \n previouslyFocused.focus(); \n } \n previouslyFocused = null; \n emit('afterLeave'); \n } \n }, \n); \n \nonBeforeUnmount(() => { \n activeTimeline?.kill(); \n releaseScrollLock(); \n}); \n \n/* ---------- Style maps ---------- */ \n \nconst isHorizontal = computed(() => props.side === 'left' || props.side === 'right'); \n \nconst positionClasses = computed(() => { \n switch (props.side) { \n case 'left': return 'flex-row items-stretch justify-start'; \n case 'right': return 'flex-row items-stretch justify-end'; \n case 'top': return 'flex-col items-stretch justify-start'; \n case 'bottom': return 'flex-col items-stretch justify-end'; \n default: return 'flex-row items-stretch justify-end'; \n } \n}); \n \nconst sizeClasses = computed(() => { \n if (isHorizontal.value) { \n if (props.inset) {\n const baseCls = 'h-full max-h-full max-w-full';\n switch (props.size) { \n case 'xsmall': return `${baseCls} w-[16rem]`; \n case 'small': return `${baseCls} w-[18rem]`; \n case 'large': return `${baseCls} w-[28rem]`; \n case 'full': return `${baseCls} w-full`; \n default: return `${baseCls} w-[22rem]`; \n }\n }\n const heightCls = 'h-full'; \n switch (props.size) { \n case 'xsmall': return `${heightCls} w-[17rem] max-w-[88vw]`; \n case 'small': return `${heightCls} w-[20rem] max-w-[90vw]`; \n case 'large': return `${heightCls} w-[36rem] max-w-[95vw]`; \n case 'full': return `${heightCls} w-screen`; \n default: return `${heightCls} w-[28rem] max-w-[92vw]`; \n } \n } else { \n if (props.inset) {\n const baseCls = 'w-full max-w-full max-h-full';\n switch (props.size) { \n case 'xsmall': return `${baseCls} h-[14rem]`; \n case 'small': return `${baseCls} h-[18rem]`; \n case 'large': return `${baseCls} h-[32rem] sm:max-h-[88dvh]`; \n case 'full': return `${baseCls} h-full`; \n default: return `${baseCls} h-[24rem] sm:max-h-[85dvh]`; \n }\n }\n const widthCls = 'w-full'; \n switch (props.size) { \n case 'xsmall': return `${widthCls} h-[14rem] max-h-[75vh]`; \n case 'small': return `${widthCls} h-[18rem] max-h-[80vh]`; \n case 'large': return `${widthCls} h-[32rem] max-h-[90vh]`; \n case 'full': return `${widthCls} h-screen`; \n default: return `${widthCls} h-[24rem] max-h-[85vh]`; \n } \n } \n}); \n \nconst sideBorderClass = computed(() => { \n if (props.inset) return 'border';\n switch (props.side) { \n case 'left': return 'border-r'; \n case 'right': return 'border-l'; \n case 'top': return 'border-b'; \n case 'bottom': return 'border-t'; \n default: return 'border-l'; \n } \n}); \n \n/** \n * Cuando `inset` está activo (default), el panel flota despegado en sus 4 lados\n * y redondea las 4 esquinas respetando `radius`. Si `inset=false`, solo redondea\n * las dos esquinas internas al viewport.\n */ \nconst radiusClasses = computed(() => { \n if (props.inset) {\n // Same radius scale as Sheet / Dialog (--modo-dialog-radius).\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded-[0.5rem]';\n case 'large': return 'rounded-[1.25rem]';\n case 'full': return 'rounded-[1.75rem]';\n default: return 'rounded-[0.875rem]';\n }\n }\n if (props.size === 'full') return 'rounded-none'; \n const map = { \n none: { \n left: 'rounded-none', right: 'rounded-none', \n top: 'rounded-none', bottom: 'rounded-none', \n }, \n small: { \n left: 'rounded-r-md', right: 'rounded-l-md', \n top: 'rounded-b-md', bottom: 'rounded-t-md', \n }, \n medium: { \n left: 'rounded-r-xl', right: 'rounded-l-xl', \n top: 'rounded-b-xl', bottom: 'rounded-t-xl', \n }, \n large: { \n left: 'rounded-r-2xl', right: 'rounded-l-2xl', \n top: 'rounded-b-2xl', bottom: 'rounded-t-2xl', \n }, \n full: { \n left: 'rounded-r-3xl', right: 'rounded-l-3xl', \n top: 'rounded-b-3xl', bottom: 'rounded-t-3xl', \n }, \n } as const; \n const r = (resolvedRadius.value ?? 'medium') as keyof typeof map; \n const safeR = map[r] ? r : 'medium'; \n return map[safeR][props.side]; \n}); \n \nconst innerBorderRadiusClass = computed(() => { \n if (!props.inset && props.size === 'full') return 'rounded-none'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-[calc(0.5rem-4px)]';\n case 'large': return 'rounded-[calc(1.25rem-4px)]';\n case 'full': return 'rounded-[calc(1.75rem-4px)]';\n default: return 'rounded-[calc(0.875rem-4px)]'; \n } \n}); \n \nconst scrimVariant = computed(() => props.overlay ?? 'blur'); \n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"Drawer.cjs","names":[],"sources":["../../../src/components/feedback/Drawer.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-drawer-overlay fixed inset-0 z-1200 flex opacity-0', \n inset ? 'p-2.5' : '', \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-drawer-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-drawer modo-drawer-glass relative flex flex-col text-foreground overflow-hidden', \n 'outline-none focus:outline-none focus-visible:outline-none', \n sideBorderClass, \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 --> \n <div v-if=\"showClose\" class=\"absolute top-3 right-3.5 z-10\"> \n <button\n type=\"button\"\n class=\"modo-drawer__x\"\n :aria-label=\"closeLabelText\"\n @click=\"close\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n </button>\n </div> \n \n <!-- Content wrapper --> \n <div ref=\"contentRef\" data-modo-drawer-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-5 pt-5', \n showClose ? 'pr-14' : '', \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-5', \n ($slots.header || title || description) ? '' : 'pt-5', \n $slots.footer ? 'pb-4' : 'pb-6', \n ]\" \n > \n <slot name=\"body\"> \n <slot /> \n </slot> \n </div> \n \n <!-- Footer --> \n <footer \n v-if=\"$slots.footer\" \n class=\"relative flex items-center justify-end gap-2 px-5 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, ref, useId, watch } from 'vue'; \nimport { gsap } from 'gsap'; \nimport Typography from '../data-display/Typography.vue'; \nimport type { Drawer } from '../../interfaces/feedback/Drawer.interface'; \nimport { \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 { ModoRadius } from '../../config/ModoConfig'; \n \nconst props = withDefaults(defineProps<Drawer>(), { \n modelValue: false, \n side: 'right', \n size: 'medium', \n inset: true,\n closeOnOverlay: true, \n closeOnEscape: true, \n showClose: true, \n lockScroll: true, \n color: 'default', \n overlay: 'blur', \n innerBorder: 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-drawer-${autoId}-title`); \nconst descriptionId = computed(() => `modo-drawer-${autoId}-desc`); \n \nconst overlayRef = ref<HTMLElement | null>(null); \nconst panelRef = ref<HTMLElement | null>(null); \nconst contentRef = ref<HTMLElement | null>(null); \n \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 (slide from edge) ---------- */ \n \nfunction prefersReducedMotion() { \n return typeof window !== 'undefined' \n && window.matchMedia('(prefers-reduced-motion: reduce)').matches; \n} \n \nlet activeTimeline: gsap.core.Timeline | null = null; \n \nfunction getEnterTransform() { \n const marginOffset = props.inset ? 28 : 0;\n switch (props.side) { \n case 'left': return { xPercent: -100, x: -marginOffset, yPercent: 0, y: 0 }; \n case 'right': return { xPercent: 100, x: marginOffset, yPercent: 0, y: 0 }; \n case 'top': return { xPercent: 0, x: 0, yPercent: -100, y: -marginOffset }; \n case 'bottom': return { xPercent: 0, x: 0, yPercent: 100, y: marginOffset }; \n default: return { xPercent: 100, x: marginOffset, yPercent: 0, y: 0 }; \n } \n} \n \nfunction onOverlayEnter(el: Element, done: () => void) { \n const overlay = (el as HTMLElement) ?? overlayRef.value; \n const panel = \n overlay?.querySelector<HTMLElement>('[data-modo-drawer-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 enter = getEnterTransform(); \n const tl = gsap.timeline({ onComplete: () => { activeTimeline = null; done(); } }); \n activeTimeline = tl; \n \n tl.fromTo(overlay, { opacity: 0 }, { opacity: 1, duration: 0.24, ease: 'power2.out' }, 0); \n \n tl.fromTo( \n panel, \n { xPercent: enter.xPercent, x: enter.x, yPercent: enter.yPercent, y: enter.y, opacity: 1 }, \n { xPercent: 0, x: 0, yPercent: 0, y: 0, opacity: 1, duration: 0.38, ease: 'power4.out' }, \n 0, \n ); \n} \n \nfunction onOverlayLeave(el: Element, done: () => void) { \n const overlay = el as HTMLElement; \n const panel = \n overlay.querySelector<HTMLElement>('[data-modo-drawer-panel]') \n ?? panelRef.value; \n // Bail out without animating, but never without releasing the lock.\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 enter = getEnterTransform(); \n const tl = gsap.timeline({ \n onComplete: () => { \n activeTimeline = null; \n releaseScrollLock(); \n done(); \n }, \n }); \n activeTimeline = tl; \n \n tl.to( \n panel, \n { xPercent: enter.xPercent, x: enter.x, yPercent: enter.yPercent, y: enter.y, duration: 0.28, ease: 'power3.in' }, \n 0, \n ); \n tl.to(overlay, { opacity: 0, duration: 0.24, ease: 'power2.in' }, 0.04); \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\nwatch( \n () => props.modelValue, \n (open) => { \n if (open) { \n const active = document.activeElement as HTMLElement | null; \n previouslyFocused = active; \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 if (previouslyFocused && typeof previouslyFocused.focus === 'function') { \n previouslyFocused.focus(); \n } \n previouslyFocused = null; \n emit('afterLeave'); \n } \n }, \n); \n \nonBeforeUnmount(() => { \n activeTimeline?.kill(); \n releaseScrollLock(); \n}); \n \n/* ---------- Style maps ---------- */ \n \nconst isHorizontal = computed(() => props.side === 'left' || props.side === 'right'); \n \nconst positionClasses = computed(() => { \n switch (props.side) { \n case 'left': return 'flex-row items-stretch justify-start'; \n case 'right': return 'flex-row items-stretch justify-end'; \n case 'top': return 'flex-col items-stretch justify-start'; \n case 'bottom': return 'flex-col items-stretch justify-end'; \n default: return 'flex-row items-stretch justify-end'; \n } \n}); \n \nconst sizeClasses = computed(() => { \n if (isHorizontal.value) { \n if (props.inset) {\n const baseCls = 'h-full max-h-full max-w-full';\n switch (props.size) { \n case 'xsmall': return `${baseCls} w-[16rem]`; \n case 'small': return `${baseCls} w-[18rem]`; \n case 'large': return `${baseCls} w-[28rem]`; \n case 'full': return `${baseCls} w-full`; \n default: return `${baseCls} w-[22rem]`; \n }\n }\n const heightCls = 'h-full'; \n switch (props.size) { \n case 'xsmall': return `${heightCls} w-[17rem] max-w-[88vw]`; \n case 'small': return `${heightCls} w-[20rem] max-w-[90vw]`; \n case 'large': return `${heightCls} w-[36rem] max-w-[95vw]`; \n case 'full': return `${heightCls} w-screen`; \n default: return `${heightCls} w-[28rem] max-w-[92vw]`; \n } \n } else { \n if (props.inset) {\n const baseCls = 'w-full max-w-full max-h-full';\n switch (props.size) { \n case 'xsmall': return `${baseCls} h-[14rem]`; \n case 'small': return `${baseCls} h-[18rem]`; \n case 'large': return `${baseCls} h-[32rem] sm:max-h-[88dvh]`; \n case 'full': return `${baseCls} h-full`; \n default: return `${baseCls} h-[24rem] sm:max-h-[85dvh]`; \n }\n }\n const widthCls = 'w-full'; \n switch (props.size) { \n case 'xsmall': return `${widthCls} h-[14rem] max-h-[75vh]`; \n case 'small': return `${widthCls} h-[18rem] max-h-[80vh]`; \n case 'large': return `${widthCls} h-[32rem] max-h-[90vh]`; \n case 'full': return `${widthCls} h-screen`; \n default: return `${widthCls} h-[24rem] max-h-[85vh]`; \n } \n } \n}); \n \nconst sideBorderClass = computed(() => { \n if (props.inset) return 'border';\n switch (props.side) { \n case 'left': return 'border-r'; \n case 'right': return 'border-l'; \n case 'top': return 'border-b'; \n case 'bottom': return 'border-t'; \n default: return 'border-l'; \n } \n}); \n \n/** \n * Cuando `inset` está activo (default), el panel flota despegado en sus 4 lados\n * y redondea las 4 esquinas respetando `radius`. Si `inset=false`, solo redondea\n * las dos esquinas internas al viewport.\n */ \nconst radiusClasses = computed(() => { \n if (props.inset) {\n // Same radius scale as Sheet / Dialog (--modo-dialog-radius).\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded-[0.5rem]';\n case 'large': return 'rounded-[1.25rem]';\n case 'full': return 'rounded-[1.75rem]';\n default: return 'rounded-[0.875rem]';\n }\n }\n if (props.size === 'full') return 'rounded-none'; \n const map = { \n none: { \n left: 'rounded-none', right: 'rounded-none', \n top: 'rounded-none', bottom: 'rounded-none', \n }, \n small: { \n left: 'rounded-r-md', right: 'rounded-l-md', \n top: 'rounded-b-md', bottom: 'rounded-t-md', \n }, \n medium: { \n left: 'rounded-r-xl', right: 'rounded-l-xl', \n top: 'rounded-b-xl', bottom: 'rounded-t-xl', \n }, \n large: { \n left: 'rounded-r-2xl', right: 'rounded-l-2xl', \n top: 'rounded-b-2xl', bottom: 'rounded-t-2xl', \n }, \n full: { \n left: 'rounded-r-3xl', right: 'rounded-l-3xl', \n top: 'rounded-b-3xl', bottom: 'rounded-t-3xl', \n }, \n } as const; \n const r = (resolvedRadius.value ?? 'medium') as keyof typeof map; \n const safeR = map[r] ? r : 'medium'; \n return map[safeR][props.side]; \n}); \n \nconst innerBorderRadiusClass = computed(() => { \n if (!props.inset && props.size === 'full') return 'rounded-none'; \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-[calc(0.5rem-4px)]';\n case 'large': return 'rounded-[calc(1.25rem-4px)]';\n case 'full': return 'rounded-[calc(1.75rem-4px)]';\n default: return 'rounded-[calc(0.875rem-4px)]'; \n } \n}); \n \nconst scrimVariant = computed(() => props.overlay ?? 'blur'); \n</script>\n"],"mappings":""}