@m3ui-vue/m3ui-vue 1.3.8 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/API.md +1102 -20
  2. package/dist/{MButton-D5eJiDza.js → MButton-DQMTIlaV.js} +2 -2
  3. package/dist/{MButton-D5eJiDza.js.map → MButton-DQMTIlaV.js.map} +1 -1
  4. package/dist/{MDialog-WqB0jewp.js → MDialog-cdgapGfZ.js} +2 -2
  5. package/dist/{MDialog-WqB0jewp.js.map → MDialog-cdgapGfZ.js.map} +1 -1
  6. package/dist/{MListItem-Cf-C2Ru-.js → MListItem-ZkSGIIrb.js} +2 -2
  7. package/dist/{MListItem-Cf-C2Ru-.js.map → MListItem-ZkSGIIrb.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-D4GzEZoH.js → MLoadingIndicator-U6_oGx8z.js} +2 -2
  9. package/dist/{MLoadingIndicator-D4GzEZoH.js.map → MLoadingIndicator-U6_oGx8z.js.map} +1 -1
  10. package/dist/{MSeekBar-B19xoWE3.js → MSeekBar-DTZVizZg.js} +2 -2
  11. package/dist/{MSeekBar-B19xoWE3.js.map → MSeekBar-DTZVizZg.js.map} +1 -1
  12. package/dist/{MSlider-9RoiuebS.js → MSlider-CqJkEYRZ.js} +2 -2
  13. package/dist/{MSlider-9RoiuebS.js.map → MSlider-CqJkEYRZ.js.map} +1 -1
  14. package/dist/{MSpinner-BNF8MN-L.js → MSpinner-Btgc-0nb.js} +2 -2
  15. package/dist/{MSpinner-BNF8MN-L.js.map → MSpinner-Btgc-0nb.js.map} +1 -1
  16. package/dist/{MTextField-CuG0T3qh.js → MTextField-B6M0gJEO.js} +2 -2
  17. package/dist/{MTextField-CuG0T3qh.js.map → MTextField-B6M0gJEO.js.map} +1 -1
  18. package/dist/{MTooltip-Bv7yxngk.js → MTooltip-Dspji4XG.js} +4 -4
  19. package/dist/{MTooltip-Bv7yxngk.js.map → MTooltip-Dspji4XG.js.map} +1 -1
  20. package/dist/api.json +1 -1
  21. package/dist/code-editor.js +1 -1
  22. package/dist/components/MAudioPlayer.vue.d.ts +2 -2
  23. package/dist/components/MAvailabilityCalendar.vue.d.ts +83 -0
  24. package/dist/components/MBeforeAfter.vue.d.ts +61 -0
  25. package/dist/components/MBodyMap.vue.d.ts +70 -0
  26. package/dist/components/MCandlestickChart.vue.d.ts +82 -0
  27. package/dist/components/MCertificate.vue.d.ts +76 -0
  28. package/dist/components/MCountdown.vue.d.ts +80 -0
  29. package/dist/components/MCreditCardInput.vue.d.ts +75 -0
  30. package/dist/components/MMortgageCalculator.vue.d.ts +83 -0
  31. package/dist/components/MOdontogram.vue.d.ts +86 -0
  32. package/dist/components/MOrderBook.vue.d.ts +89 -0
  33. package/dist/components/MOrderTicket.vue.d.ts +91 -0
  34. package/dist/components/MPosKeypad.vue.d.ts +84 -0
  35. package/dist/components/MProductConfigurator.vue.d.ts +136 -0
  36. package/dist/components/MQuiz.vue.d.ts +102 -0
  37. package/dist/components/MReceipt.vue.d.ts +93 -0
  38. package/dist/components/MSeatMap.vue.d.ts +131 -0
  39. package/dist/components/MSeekBar.vue.d.ts +1 -1
  40. package/dist/components/MTicket.vue.d.ts +83 -0
  41. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  42. package/dist/components/MVitalsChart.vue.d.ts +73 -0
  43. package/dist/composables/_printElement.d.ts +9 -0
  44. package/dist/composables/cardBrand.d.ts +25 -0
  45. package/dist/composables/mortgage.d.ts +37 -0
  46. package/dist/composables/useLocale.d.ts +131 -0
  47. package/dist/draw.js +2 -2
  48. package/dist/flow.js +1 -1
  49. package/dist/gantt.js +1 -1
  50. package/dist/index.d.ts +37 -0
  51. package/dist/locales/index.js +924 -7
  52. package/dist/locales/index.js.map +1 -1
  53. package/dist/m3ui-vue.css +1 -1
  54. package/dist/m3ui.js +10125 -5263
  55. package/dist/m3ui.js.map +1 -1
  56. package/dist/map.js +5 -5
  57. package/dist/media.js +4 -4
  58. package/dist/pdf.js +4 -4
  59. package/dist/rich-text-editor.js +4 -4
  60. package/dist/styles.css +1 -1
  61. package/dist/{useLocale-D2ucaY-l.js → useLocale-DLKJIRFi.js} +133 -2
  62. package/dist/useLocale-DLKJIRFi.js.map +1 -0
  63. package/package.json +1 -1
  64. package/src/__tests__/MAvailabilityCalendar.test.ts +85 -0
  65. package/src/__tests__/MBeforeAfter.test.ts +79 -0
  66. package/src/__tests__/MBodyMap.test.ts +60 -0
  67. package/src/__tests__/MCandlestickChart.test.ts +66 -0
  68. package/src/__tests__/MCertificate.test.ts +32 -0
  69. package/src/__tests__/MCountdown.test.ts +75 -0
  70. package/src/__tests__/MCreditCardInput.test.ts +122 -0
  71. package/src/__tests__/MMortgageCalculator.test.ts +49 -0
  72. package/src/__tests__/MOdontogram.test.ts +93 -0
  73. package/src/__tests__/MOrderBook.test.ts +66 -0
  74. package/src/__tests__/MOrderTicket.test.ts +68 -0
  75. package/src/__tests__/MPosKeypad.test.ts +116 -0
  76. package/src/__tests__/MProductConfigurator.test.ts +73 -0
  77. package/src/__tests__/MQuiz.test.ts +104 -0
  78. package/src/__tests__/MReceipt.test.ts +52 -0
  79. package/src/__tests__/MSeatMap.test.ts +76 -0
  80. package/src/__tests__/MTicket.test.ts +38 -0
  81. package/src/__tests__/MVitalsChart.test.ts +49 -0
  82. package/src/__tests__/clearToNull.test.ts +30 -0
  83. package/src/__tests__/mortgage.test.ts +25 -0
  84. package/src/__tests__/ssr.test.ts +11 -0
  85. package/src/components/MAutocomplete.vue +2 -2
  86. package/src/components/MAvailabilityCalendar.vue +460 -0
  87. package/src/components/MBeforeAfter.vue +248 -0
  88. package/src/components/MBodyMap.vue +266 -0
  89. package/src/components/MCandlestickChart.vue +479 -0
  90. package/src/components/MCertificate.vue +351 -0
  91. package/src/components/MCountdown.vue +200 -0
  92. package/src/components/MCreditCardInput.vue +351 -0
  93. package/src/components/MMortgageCalculator.vue +258 -0
  94. package/src/components/MOdontogram.vue +462 -0
  95. package/src/components/MOrderBook.vue +287 -0
  96. package/src/components/MOrderTicket.vue +217 -0
  97. package/src/components/MPosKeypad.vue +406 -0
  98. package/src/components/MProductConfigurator.vue +412 -0
  99. package/src/components/MQuiz.vue +531 -0
  100. package/src/components/MReceipt.vue +249 -0
  101. package/src/components/MSeatMap.vue +431 -0
  102. package/src/components/MSelect.vue +2 -2
  103. package/src/components/MTicket.vue +209 -0
  104. package/src/components/MVitalsChart.vue +303 -0
  105. package/src/composables/_printElement.ts +36 -0
  106. package/src/composables/cardBrand.ts +104 -0
  107. package/src/composables/mortgage.ts +70 -0
  108. package/src/composables/useLocale.ts +277 -0
  109. package/src/index.ts +37 -0
  110. package/src/locales/de.ts +131 -0
  111. package/src/locales/es.ts +131 -0
  112. package/src/locales/fr.ts +131 -0
  113. package/src/locales/ja.ts +131 -0
  114. package/src/locales/ko.ts +131 -0
  115. package/src/locales/pt.ts +131 -0
  116. package/src/locales/zh.ts +131 -0
  117. package/dist/useLocale-D2ucaY-l.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { p as e } from "./MIconButton-DoNotQ9v.js";
2
2
  import { t } from "./MIcon-Bxh9j135.js";
3
- import { t as n } from "./MSpinner-BNF8MN-L.js";
3
+ import { t as n } from "./MSpinner-Btgc-0nb.js";
4
4
  import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, unref as m, withCtx as h, withDirectives as g } from "vue";
5
5
  //#region src/components/MButton.vue?vue&type=script&setup=true&lang.ts
6
6
  var _ = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", v = /* @__PURE__ */ c({
@@ -169,4 +169,4 @@ var _ = "relative inline-flex items-center justify-center font-medium whitespace
169
169
  //#endregion
170
170
  export { v as t };
171
171
 
172
- //# sourceMappingURL=MButton-D5eJiDza.js.map
172
+ //# sourceMappingURL=MButton-DQMTIlaV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MButton-D5eJiDza.js","names":[],"sources":["../src/components/MButton.vue","../src/components/MButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template>\n"],"mappings":";;;;;AAkGA,IAAM,IACJ;;;;;;;;;;;;;;;;;;;;;;;;EAxFF,IAAM,IAAe,CAAC,WAAW,OAAO,GAGlC,IAAQ,GA0DR,IAAM,QAAe,EAAM,KAAK,eAAe,QAAQ,GAEvD,IAAgB,QACd,CAAC,CAAC,EAAM,SAAS,CAAE,EAAmC,SAAS,EAAM,KAAK,CAClF,GAEM,IAAc,QAAe;GAC5B,MAAc,OACnB,OAAO;IACL,mBAAmB,EAAM;IACzB,sBAAsB;IACtB,6BAA6B,EAAM,QAAQ;IAC3C,gCAAgC,EAAM;GACxC;EACF,CAAC,GAEK,IAAU,QAAe,EAAM,UAAU,OAAO,GAGhD,IAAO,4HACP,IAAQ,QAAe;GAC3B,IAAM,IAAI,EAAM;GAEhB,OADI,CAAC,KAAK,EAAM,YAAY,EAAM,UAAgB,EAAY,QACvD;IAAE,GAAG,EAAY;IAAO,OAAO,EAAK,KAAK,CAAC,IAAI,eAAe,EAAE,KAAK;GAAE;EAC/E,CAAC,GAgBK,IAA2B,QAAe;GAC9C,QAAQ,EAAM,SAAd;IACE,KAAK;IACL,KAAK;IACL,KAAK,YACH,OAAO;IACT,KAAK,YACH,OAAO,EAAQ,QAAQ,6BAA6B;IACtD,SACE,OAAO;GACX;EACF,CAAC,GAcK,IAAU;GACd,IAAI;I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AkBY,EAjBL,EAAA,KAAG,GAAA;GACP,IAAI,EAAA,MAAM,KAAA;GACV,MAAM,EAAA,KAAK,KAAA,IAAY,EAAA;GACvB,UAAU,EAAA,YAAY,EAAA;GACtB,OAAK,EAAA;IAAG;IAAM,EAAA;IAAY,EAAA;IAAa,EAAA;IAAI,EAAA;IAAgB,EAAA;GAAwB,CAAA;GACnF,OAAK,EAAE,EAAA,KAAK;;GAGb,SAAA,QAGW;IAHK,EAAA,YAAO,aAAvB,EAAA,GAAA,EAGW,GAAA,EAAA,KAAA,EAAA,GAAA,CAFO,EAAA,WAAhB,EAAA,GAAA,EAA+C,GAAA;;KAArB,MAAM,EAAA;IACd,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAA,EAAA,QAAlB,EAAA,GAAA,EAA6E,GAAA;;KAApD,MAAM,EAAA;KAAO,MAAM,EAAA;KAAW,QAAQ,EAAA;;;;;;IAEjE,EAAQ,EAAA,QAAA,SAAA;IACQ,EAAA,YAAO,cAAvB,EAAA,GAAA,EAGW,GAAA,EAAA,KAAA,EAAA,GAAA,CAFO,EAAA,WAAhB,EAAA,GAAA,EAA+C,GAAA;;KAArB,MAAM,EAAA;IACd,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAA,EAAA,QAAlB,EAAA,GAAA,EAA6E,GAAA;;KAApD,MAAM,EAAA;KAAO,MAAM,EAAA;KAAW,QAAQ,EAAA;;;;;;;;;;;;;;EAT3C,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,GAAA;GAAA,UAAA,EAAA,YAAY,EAAA;GAAO,OAAS,EAAA;EAAW,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"MButton-DQMTIlaV.js","names":[],"sources":["../src/components/MButton.vue","../src/components/MButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template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,EAAA;IACd,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAA,EAAA,QAAlB,EAAA,GAAA,EAA6E,GAAA;;KAApD,MAAM,EAAA;KAAO,MAAM,EAAA;KAAW,QAAQ,EAAA;;;;;;IAEjE,EAAQ,EAAA,QAAA,SAAA;IACQ,EAAA,YAAO,cAAvB,EAAA,GAAA,EAGW,GAAA,EAAA,KAAA,EAAA,GAAA,CAFO,EAAA,WAAhB,EAAA,GAAA,EAA+C,GAAA;;KAArB,MAAM,EAAA;IACd,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAA,EAAA,QAAlB,EAAA,GAAA,EAA6E,GAAA;;KAApD,MAAM,EAAA;KAAO,MAAM,EAAA;KAAW,QAAQ,EAAA;;;;;;;;;;;;;;EAT3C,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,GAAA;GAAA,UAAA,EAAA,YAAY,EAAA;GAAO,OAAS,EAAA;EAAW,CAAA,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-D2ucaY-l.js";
1
+ import { i as e } from "./useLocale-DLKJIRFi.js";
2
2
  import { t } from "./MIconButton-DoNotQ9v.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { t as r } from "./_useEscapeStack-CjndQhqg.js";
@@ -170,4 +170,4 @@ var F = ["aria-labelledby", "aria-label"], I = {
170
170
  //#endregion
171
171
  export { P as n, q as t };
172
172
 
173
- //# sourceMappingURL=MDialog-WqB0jewp.js.map
173
+ //# sourceMappingURL=MDialog-cdgapGfZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MDialog-WqB0jewp.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,E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CAAA"}
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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EAAAA,OAAO,WAAjC,EAAA,GAAA,EAA6F,OAA7F,CAA6F,KAAA,EAAA,IAAA,EAAA;IAElFA,EAAAA,OAAO,WAAlB,EAAA,GAAA,EAEM,OAFN,GAEM,CADJ,EAAuB,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;;;EAQjC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-D2ucaY-l.js";
1
+ import { i as e } from "./useLocale-DLKJIRFi.js";
2
2
  import { a as t, i as n, s as r } from "./MIconButton-DoNotQ9v.js";
3
3
  import { t as i } from "./MIcon-Bxh9j135.js";
4
4
  import { Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, h, inject as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onMounted as x, onUnmounted as S, onUpdated as C, openBlock as w, provide as T, ref as E, renderSlot as D, resolveDynamicComponent as ee, shallowRef as O, toDisplayString as k, unref as A, useId as te, useSlots as j, watch as M, withCtx as N, withModifiers as P } from "vue";
@@ -821,4 +821,4 @@ var le = ["role"], ue = /* @__PURE__ */ p({
821
821
  //#endregion
822
822
  export { J as a, ne as c, ce as i, fe as n, U as o, ue as r, ie as s, Se as t };
823
823
 
824
- //# sourceMappingURL=MListItem-Cf-C2Ru-.js.map
824
+ //# sourceMappingURL=MListItem-ZkSGIIrb.js.map