@m3ui-vue/m3ui-vue 1.4.1 → 1.4.2

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 (89) hide show
  1. package/dist/API.md +251 -9
  2. package/dist/{MButton-DQMTIlaV.js → MButton-D7M324r9.js} +2 -2
  3. package/dist/{MButton-DQMTIlaV.js.map → MButton-D7M324r9.js.map} +1 -1
  4. package/dist/{MDialog-cdgapGfZ.js → MDialog-DuOnNF9s.js} +2 -2
  5. package/dist/{MDialog-cdgapGfZ.js.map → MDialog-DuOnNF9s.js.map} +1 -1
  6. package/dist/{MListItem-ZkSGIIrb.js → MListItem-Bb84X6ex.js} +144 -120
  7. package/dist/{MListItem-ZkSGIIrb.js.map → MListItem-Bb84X6ex.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-U6_oGx8z.js → MLoadingIndicator-BUGRo2Tu.js} +2 -2
  9. package/dist/{MLoadingIndicator-U6_oGx8z.js.map → MLoadingIndicator-BUGRo2Tu.js.map} +1 -1
  10. package/dist/{MSeekBar-DTZVizZg.js → MSeekBar-BQUvUqb9.js} +2 -2
  11. package/dist/{MSeekBar-DTZVizZg.js.map → MSeekBar-BQUvUqb9.js.map} +1 -1
  12. package/dist/{MSlider-CqJkEYRZ.js → MSlider-SFdjE1Hy.js} +2 -2
  13. package/dist/{MSlider-CqJkEYRZ.js.map → MSlider-SFdjE1Hy.js.map} +1 -1
  14. package/dist/{MSpinner-Btgc-0nb.js → MSpinner-DKGNN64_.js} +2 -2
  15. package/dist/{MSpinner-Btgc-0nb.js.map → MSpinner-DKGNN64_.js.map} +1 -1
  16. package/dist/{MTextField-B6M0gJEO.js → MTextField-Utsef6Kk.js} +2 -2
  17. package/dist/{MTextField-B6M0gJEO.js.map → MTextField-Utsef6Kk.js.map} +1 -1
  18. package/dist/{MTooltip-Dspji4XG.js → MTooltip-BhTFQ9Z2.js} +4 -4
  19. package/dist/{MTooltip-Dspji4XG.js.map → MTooltip-BhTFQ9Z2.js.map} +1 -1
  20. package/dist/api.json +1 -1
  21. package/dist/code-editor.js +1 -1
  22. package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
  23. package/dist/components/MCalendarHeatmap.vue.d.ts +120 -0
  24. package/dist/components/MDatePicker.vue.d.ts +5 -0
  25. package/dist/components/MDatePickerModal.vue.d.ts +5 -0
  26. package/dist/components/MDateRangePicker.vue.d.ts +5 -0
  27. package/dist/components/MDateRangePickerModal.vue.d.ts +5 -0
  28. package/dist/components/MLightbox.vue.d.ts +1 -1
  29. package/dist/components/MListItem.vue.d.ts +10 -6
  30. package/dist/components/MMeterGroup.vue.d.ts +98 -0
  31. package/dist/components/MPhoneInput.vue.d.ts +72 -0
  32. package/dist/components/MSeekBar.vue.d.ts +1 -1
  33. package/dist/components/MTreeTable.vue.d.ts +1 -1
  34. package/dist/components/MTypewriter.vue.d.ts +57 -0
  35. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  36. package/dist/components/_MMonthYearButton.vue.d.ts +16 -0
  37. package/dist/components/_MYearGrid.vue.d.ts +19 -0
  38. package/dist/composables/_useCalendarMonth.d.ts +7 -0
  39. package/dist/composables/phoneNumber.d.ts +39 -0
  40. package/dist/composables/useLocale.d.ts +18 -0
  41. package/dist/data/phone-countries.d.ts +2 -0
  42. package/dist/draw.js +2 -2
  43. package/dist/flow.js +1 -1
  44. package/dist/gantt.js +1 -1
  45. package/dist/index.d.ts +8 -0
  46. package/dist/locales/index.js +63 -0
  47. package/dist/locales/index.js.map +1 -1
  48. package/dist/m3ui-vue.css +1 -1
  49. package/dist/m3ui.js +3615 -1999
  50. package/dist/m3ui.js.map +1 -1
  51. package/dist/map.js +5 -5
  52. package/dist/media.js +4 -4
  53. package/dist/pdf.js +4 -4
  54. package/dist/rich-text-editor.js +4 -4
  55. package/dist/styles.css +1 -1
  56. package/dist/{useLocale-DLKJIRFi.js → useLocale-B8YKWg-H.js} +10 -1
  57. package/dist/useLocale-B8YKWg-H.js.map +1 -0
  58. package/package.json +1 -1
  59. package/src/__tests__/MCalendarHeatmap.test.ts +79 -0
  60. package/src/__tests__/MListItemNestedControl.test.ts +88 -0
  61. package/src/__tests__/MMeterGroup.test.ts +43 -0
  62. package/src/__tests__/MPhoneInput.test.ts +97 -0
  63. package/src/__tests__/MTypewriter.test.ts +50 -0
  64. package/src/__tests__/calendarMonth.test.ts +104 -0
  65. package/src/__tests__/ssr.test.ts +4 -0
  66. package/src/components/MCalendarHeatmap.vue +349 -0
  67. package/src/components/MDatePicker.vue +74 -34
  68. package/src/components/MDatePickerModal.vue +79 -36
  69. package/src/components/MDateRangePicker.vue +73 -33
  70. package/src/components/MDateRangePickerModal.vue +75 -35
  71. package/src/components/MListItem.vue +54 -8
  72. package/src/components/MMeterGroup.vue +196 -0
  73. package/src/components/MPhoneInput.vue +480 -0
  74. package/src/components/MTypewriter.vue +195 -0
  75. package/src/components/_MMonthYearButton.vue +36 -0
  76. package/src/components/_MYearGrid.vue +106 -0
  77. package/src/composables/_useCalendarMonth.ts +32 -2
  78. package/src/composables/phoneNumber.ts +137 -0
  79. package/src/composables/useLocale.ts +27 -0
  80. package/src/data/phone-countries.ts +62 -0
  81. package/src/index.ts +8 -0
  82. package/src/locales/de.ts +9 -0
  83. package/src/locales/es.ts +9 -0
  84. package/src/locales/fr.ts +9 -0
  85. package/src/locales/ja.ts +9 -0
  86. package/src/locales/ko.ts +9 -0
  87. package/src/locales/pt.ts +9 -0
  88. package/src/locales/zh.ts +9 -0
  89. package/dist/useLocale-DLKJIRFi.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MDialog-cdgapGfZ.js","names":["$attrs","$slots"],"sources":["../src/composables/_useScrollLock.ts","../src/components/MDialog.vue","../src/components/MDialog.vue"],"sourcesContent":["import { getCurrentInstance, onBeforeUnmount, watch, type WatchSource } from 'vue'\n\n/*\n * Internal (not exported from index.ts): locks the page's scroll (body overflow hidden) while a modal surface is\n * open, shared by every component that does it. Counted, so overlays stacked on each other (a select's modal or a\n * date picker inside an MDialog) release it only when the last one closes: each component used to write\n * `overflow = ''` on its own, so closing the inner one let the page under the outer one scroll again. Each\n * instance also releases what it holds when it unmounts (a dialog removed while open left the page locked for good)\n * and nothing when it holds nothing (a select unmounting inside an open dialog used to unlock it).\n */\n\nlet count = 0\nlet previous = ''\n\nfunction lock() {\n if (count++ === 0) {\n previous = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n }\n}\n\nfunction unlock() {\n if (count > 0 && --count === 0) document.body.style.overflow = previous\n}\n\n/**\n * Locks the page's scroll while `active` is true (from the start too: a dialog mounted open locks it), and releases\n * it when it turns false or the component unmounts. Without `active`, drive it with the returned `set`.\n */\nexport function useScrollLock(active?: WatchSource<boolean>) {\n let held = false\n function set(on: boolean) {\n if (typeof document === 'undefined' || on === held) return\n held = on\n if (on) lock()\n else unlock()\n }\n if (active) watch(active, (on) => set(!!on), { immediate: true })\n if (getCurrentInstance()) onBeforeUnmount(() => set(false))\n return { set }\n}\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n"],"mappings":";;;;;;AAWA,IAAI,IAAQ,GACR,IAAW;AAEf,SAAS,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAAS,IAAS;CAChB,AAAI,IAAQ,KAAK,EAAE,MAAU,MAAG,SAAS,KAAK,MAAM,WAAW;AACjE;AAMA,SAAgB,EAAc,GAA+B;CAC3D,IAAI,IAAO;CACX,SAAS,EAAI,GAAa;EACpB,OAAO,WAAa,OAAe,MAAO,MAC9C,IAAO,GACH,IAAI,EAAK,IACR,EAAO;CACd;CAGA,OAFI,KAAQ,EAAM,IAAS,MAAO,EAAI,CAAC,CAAC,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAC5D,EAAmB,KAAG,QAAsB,EAAI,EAAK,CAAC,GACnD,EAAE,OAAI;AACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECrBA,IAAM,IAAQ,GAqDR,IAAS,EAAU,GAInB,KAAc,MAAc,iDAAiD,KAAK,EAAE,KAAK,CAAC,GAC1F,IAAc,QAAe,CAAC,EAAM,UAAU,EAAM,SAAS,CAAC,CAAC,QAAQ,MAAM,CAAC,EAAW,CAAC,CAAC,CAAC,GAC5F,IAAY,SAAgB;GAChC,GAAI,EAAW,EAAM,QAAQ,IAAI,EAAE,UAAU,EAAM,SAAS,IAAI,CAAC;GACjE,GAAI,EAAW,EAAM,SAAS,IAAI,EAAE,WAAW,EAAM,UAAU,IAAI,CAAC;EACtE,EAAE,GAEI,IAAO;EAEb,SAAS,IAAQ;GACX,EAAM,cACV,EAAK,qBAAqB,EAAK;EACjC;EAMA,IAAM,IAAY,EAAiB,GAC7B,IAAiB,EAAiB,GAClC,IAAc,EAAI,E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MDialog-DuOnNF9s.js","names":["$attrs","$slots"],"sources":["../src/composables/_useScrollLock.ts","../src/components/MDialog.vue","../src/components/MDialog.vue"],"sourcesContent":["import { getCurrentInstance, onBeforeUnmount, watch, type WatchSource } from 'vue'\n\n/*\n * Internal (not exported from index.ts): locks the page's scroll (body overflow hidden) while a modal surface is\n * open, shared by every component that does it. Counted, so overlays stacked on each other (a select's modal or a\n * date picker inside an MDialog) release it only when the last one closes: each component used to write\n * `overflow = ''` on its own, so closing the inner one let the page under the outer one scroll again. Each\n * instance also releases what it holds when it unmounts (a dialog removed while open left the page locked for good)\n * and nothing when it holds nothing (a select unmounting inside an open dialog used to unlock it).\n */\n\nlet count = 0\nlet previous = ''\n\nfunction lock() {\n if (count++ === 0) {\n previous = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n }\n}\n\nfunction unlock() {\n if (count > 0 && --count === 0) document.body.style.overflow = previous\n}\n\n/**\n * Locks the page's scroll while `active` is true (from the start too: a dialog mounted open locks it), and releases\n * it when it turns false or the component unmounts. Without `active`, drive it with the returned `set`.\n */\nexport function useScrollLock(active?: WatchSource<boolean>) {\n let held = false\n function set(on: boolean) {\n if (typeof document === 'undefined' || on === held) return\n held = on\n if (on) lock()\n else unlock()\n }\n if (active) watch(active, (on) => set(!!on), { immediate: true })\n if (getCurrentInstance()) onBeforeUnmount(() => set(false))\n return { set }\n}\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n"],"mappings":";;;;;;AAWA,IAAI,IAAQ,GACR,IAAW;AAEf,SAAS,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAAS,IAAS;CAChB,AAAI,IAAQ,KAAK,EAAE,MAAU,MAAG,SAAS,KAAK,MAAM,WAAW;AACjE;AAMA,SAAgB,EAAc,GAA+B;CAC3D,IAAI,IAAO;CACX,SAAS,EAAI,GAAa;EACpB,OAAO,WAAa,OAAe,MAAO,MAC9C,IAAO,GACH,IAAI,EAAK,IACR,EAAO;CACd;CAGA,OAFI,KAAQ,EAAM,IAAS,MAAO,EAAI,CAAC,CAAC,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAC5D,EAAmB,KAAG,QAAsB,EAAI,EAAK,CAAC,GACnD,EAAE,OAAI;AACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECrBA,IAAM,IAAQ,GAqDR,IAAS,EAAU,GAInB,KAAc,MAAc,iDAAiD,KAAK,EAAE,KAAK,CAAC,GAC1F,IAAc,QAAe,CAAC,EAAM,UAAU,EAAM,SAAS,CAAC,CAAC,QAAQ,MAAM,CAAC,EAAW,CAAC,CAAC,CAAC,GAC5F,IAAY,SAAgB;GAChC,GAAI,EAAW,EAAM,QAAQ,IAAI,EAAE,UAAU,EAAM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