@m3ui-vue/m3ui-vue 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/API.md +578 -3
  2. package/dist/{MColorPickerModal-BKM1CHxr.js → MColorPickerModal-H8nuX0Wu.js} +3 -4
  3. package/dist/{MColorPickerModal-BKM1CHxr.js.map → MColorPickerModal-H8nuX0Wu.js.map} +1 -1
  4. package/dist/MDialog-B42Mhn8W.js +331 -0
  5. package/dist/MDialog-B42Mhn8W.js.map +1 -0
  6. package/dist/{MListItem-BU5KDRCB.js → MListItem-DiOAxaN7.js} +102 -102
  7. package/dist/{MListItem-BU5KDRCB.js.map → MListItem-DiOAxaN7.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-RykOo5tf.js → MLoadingIndicator-CuTZYFFj.js} +2 -2
  9. package/dist/{MLoadingIndicator-RykOo5tf.js.map → MLoadingIndicator-CuTZYFFj.js.map} +1 -1
  10. package/dist/{MSeekBar-B_Y3MpVz.js → MSeekBar-BCDQTx2t.js} +2 -2
  11. package/dist/{MSeekBar-B_Y3MpVz.js.map → MSeekBar-BCDQTx2t.js.map} +1 -1
  12. package/dist/{MSegmentedButton-CiOOY1-N.js → MSegmentedButton-BXzRsg1S.js} +2 -2
  13. package/dist/{MSegmentedButton-CiOOY1-N.js.map → MSegmentedButton-BXzRsg1S.js.map} +1 -1
  14. package/dist/MSignaturePad-BTqGaPXA.js +313 -0
  15. package/dist/MSignaturePad-BTqGaPXA.js.map +1 -0
  16. package/dist/{MSlider-BCeVIxcq.js → MSlider-D_O8J9YH.js} +3 -3
  17. package/dist/{MSlider-BCeVIxcq.js.map → MSlider-D_O8J9YH.js.map} +1 -1
  18. package/dist/{MSpinner-Cs03qoqE.js → MSpinner-UCdtSOHP.js} +2 -2
  19. package/dist/{MSpinner-Cs03qoqE.js.map → MSpinner-UCdtSOHP.js.map} +1 -1
  20. package/dist/{MTextField-NaFbMkjv.js → MTextField-CYk9yFvi.js} +3 -3
  21. package/dist/{MTextField-NaFbMkjv.js.map → MTextField-CYk9yFvi.js.map} +1 -1
  22. package/dist/{_useFieldValidation-Bz34IAQY.js → _useFieldValidation-B0B44M_t.js} +2 -2
  23. package/dist/{_useFieldValidation-Bz34IAQY.js.map → _useFieldValidation-B0B44M_t.js.map} +1 -1
  24. package/dist/api.json +1 -1
  25. package/dist/code-editor.js +2 -2
  26. package/dist/components/MFormBuilder.vue.d.ts +22 -0
  27. package/dist/components/MFormRenderer.vue.d.ts +151 -0
  28. package/dist/components/MMapRoute.vue.d.ts +13 -5
  29. package/dist/components/MPdfSigner.vue.d.ts +499 -0
  30. package/dist/components/MPdfViewer.vue.d.ts +12 -0
  31. package/dist/components/MPosKeypad.vue.d.ts +1 -1
  32. package/dist/components/MSpreadsheet.vue.d.ts +137 -0
  33. package/dist/components/MStack.vue.d.ts +1 -1
  34. package/dist/composables/pdfSign.d.ts +52 -0
  35. package/dist/composables/spreadsheetFormula.d.ts +55 -0
  36. package/dist/composables/useLocale.d.ts +154 -0
  37. package/dist/draw.js +2 -2
  38. package/dist/flow.js +1 -1
  39. package/dist/gantt.js +2 -2
  40. package/dist/index.d.ts +7 -0
  41. package/dist/locales/index.js +539 -0
  42. package/dist/locales/index.js.map +1 -1
  43. package/dist/m3ui-vue.css +1 -1
  44. package/dist/m3ui.js +16988 -15064
  45. package/dist/m3ui.js.map +1 -1
  46. package/dist/map.js +601 -585
  47. package/dist/map.js.map +1 -1
  48. package/dist/media.js +4 -4
  49. package/dist/pdf.d.ts +3 -0
  50. package/dist/pdf.js +1228 -687
  51. package/dist/pdf.js.map +1 -1
  52. package/dist/rich-text-editor.js +12 -13
  53. package/dist/rich-text-editor.js.map +1 -1
  54. package/dist/styles.css +1 -1
  55. package/dist/{useLocale-Dh1xZZ8i.js → useLocale-DL96OFgr.js} +78 -1
  56. package/dist/useLocale-DL96OFgr.js.map +1 -0
  57. package/package.json +5 -1
  58. package/src/__tests__/MFormRenderer.test.ts +157 -0
  59. package/src/__tests__/MMapRoute.test.ts +34 -0
  60. package/src/__tests__/MPdfSigner.test.ts +175 -0
  61. package/src/__tests__/MSpreadsheet.test.ts +223 -0
  62. package/src/__tests__/spreadsheetFormula.test.ts +77 -0
  63. package/src/__tests__/ssr.test.ts +3 -0
  64. package/src/components/MFormBuilder.vue +417 -0
  65. package/src/components/MFormRenderer.vue +324 -0
  66. package/src/components/MMapRoute.vue +64 -11
  67. package/src/components/MPdfSigner.vue +433 -0
  68. package/src/components/MPdfViewer.vue +12 -0
  69. package/src/components/MSpreadsheet.vue +992 -0
  70. package/src/composables/pdfSign.ts +141 -0
  71. package/src/composables/spreadsheetFormula.ts +459 -0
  72. package/src/composables/useLocale.ts +231 -0
  73. package/src/index.ts +7 -0
  74. package/src/locales/de.ts +77 -0
  75. package/src/locales/es.ts +77 -0
  76. package/src/locales/fr.ts +77 -0
  77. package/src/locales/ja.ts +77 -0
  78. package/src/locales/ko.ts +77 -0
  79. package/src/locales/pt.ts +77 -0
  80. package/src/locales/zh.ts +77 -0
  81. package/src/pdf.ts +3 -0
  82. package/dist/MButton-CN3wYwIG.js +0 -171
  83. package/dist/MButton-CN3wYwIG.js.map +0 -1
  84. package/dist/MDialog-1LAk9WAO.js +0 -167
  85. package/dist/MDialog-1LAk9WAO.js.map +0 -1
  86. package/dist/MProgressBar-BWly1UKN.js +0 -179
  87. package/dist/MProgressBar-BWly1UKN.js.map +0 -1
  88. package/dist/useLocale-Dh1xZZ8i.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MDialog-B42Mhn8W.js","names":["_withDirectives","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_normalizeStyle","_withCtx","_createElementBlock","_Fragment","MSpinner","MIcon","_renderSlot","_unref","$attrs","$slots","_openBlock","_createBlock","_Teleport","_Transition","_withCtx","_createElementBlock","_withModifiers","_createElementVNode","_mergeProps","_renderSlot","_Fragment","_createVNode","MIconButton","_unref","_normalizeClass","_createTextVNode","_toDisplayString","useLocale","vRipple","MIconButton_default","MIcon_default","MSpinner_default","_plugin_vue_export_helper_default","useEscapeStack","count","previous","lock","unlock","useScrollLock","held","set","on","active","watch","getCurrentInstance","onBeforeUnmount","base","MButton_default","defineComponent","NAMED_COLORS","props","__props","tag","computed","isCustomColor","customStyle","isError","ROLE","style","c","disabledContainerClasses","sizeMap","s","sizeClasses","iconSize","spinnerSize","px","shapeClass","variantClasses","err","withDirectives","openBlock","createBlock","resolveDynamicComponent","normalizeClass","normalizeStyle","withCtx","createElementBlock","Fragment","createCommentVNode","renderSlot","_ctx","unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","MDialog_default","__emit","locale","isCssValue","v","sizeStyle","emit","close","contentEl","ref","contentInnerEl","showDivider","resizeObserver","updateDividerVisibility","el","titleId","useId","open","nextTick","onUnmounted","Teleport","Transition","mergeProps","createElementVNode","createTextVNode","toDisplayString","withModifiers","createVNode"],"sources":["../src/composables/_useScrollLock.ts","../src/components/MButton.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 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 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,IAAIuC,IAAQ,GACRC,IAAW;AAEf,SAASC,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAASC,IAAS;CAChB,AAAIH,IAAQ,KAAK,EAAEA,MAAU,MAAG,SAAS,KAAK,MAAM,WAAWC;AACjE;AAMA,SAAgBG,EAAc,GAA+B;CAC3D,IAAIC,IAAO;CACX,SAASC,EAAI,GAAa;EACxB,AAAI,OAAO,WAAa,OAAeC,MAAOF,MAC9C,IAAOE,GACHA,IAAIL,EAAK,IACRC,EAAO;CACd;CAGA,OAFIK,KAAQC,EAAMD,IAAS,MAAOF,EAAI,CAAC,CAACC,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAC5DG,EAAmB,KAAGC,QAAsBL,EAAI,E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-DL96OFgr.js";
2
2
  import { a as t, i as n, s as r } from "./MIconButton-BBggVwBV.js";
3
3
  import { t as i } from "./MIcon-DpajuUTJ.js";
4
- import { n as a } from "./_useFieldValidation-Bz34IAQY.js";
4
+ import { n as a } from "./_useFieldValidation-B0B44M_t.js";
5
5
  import { Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, h as g, inject as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onUnmounted as w, onUpdated as T, openBlock as E, provide as D, ref as O, renderSlot as k, resolveDynamicComponent as ee, shallowRef as A, toDisplayString as j, unref as M, useId as te, useSlots as N, watch as P, withCtx as F, withModifiers as I } from "vue";
6
6
  // src/composables/_useFollowAnchor.ts
7
7
  var L = /(auto|scroll|hidden|clip)/;
@@ -447,104 +447,20 @@ var ne = /* @__PURE__ */ m({
447
447
  "style"
448
448
  ]));
449
449
  }
450
- });
451
- // src/composables/_useSegmentRuns.ts
452
- function he(e) {
453
- let t = A(/* @__PURE__ */ new Map());
454
- function n() {
455
- let n = /* @__PURE__ */ new Map(), r = [], i = () => {
456
- r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
457
- };
458
- for (let t of e.value?.children ?? []) t.getAttribute("role") === "listitem" ? r.push(t) : i();
459
- i(), t.value = n;
460
- }
461
- let r;
462
- return C(() => {
463
- n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
464
- }), w(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
465
- }
466
- // src/components/MList.vue?vue&type=script&setup=true&lang.ts
467
- var ge = ["role"], X = /* @__PURE__ */ m({
468
- __name: "MList",
469
- props: {
470
- dense: {
471
- type: Boolean,
472
- default: !1
473
- },
474
- dividers: {
475
- type: [Boolean, String],
476
- default: !1
477
- },
478
- nav: {
479
- type: Boolean,
480
- default: !1
481
- },
482
- segmented: {
483
- type: Boolean,
484
- default: !1
485
- },
486
- selectable: {
487
- type: Boolean,
488
- default: !1
489
- },
490
- selected: {},
491
- lines: {}
492
- },
493
- emits: ["update:selected"],
494
- setup(e, { emit: t }) {
495
- let n = e, r = t, i = O(), a = he(i);
496
- D("m-list", {
497
- segmentPosition: a,
498
- dense: s(() => n.dense),
499
- nav: s(() => n.nav),
500
- segmented: s(() => n.segmented),
501
- selectable: s(() => n.selectable),
502
- selected: s(() => n.selected),
503
- dividers: s(() => n.dividers),
504
- lines: s(() => n.lines),
505
- select: (e) => r("update:selected", e)
506
- });
507
- let o = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
508
- function c(e) {
509
- if (!n.selectable) return;
510
- let t = o(), r = t.indexOf(document.activeElement);
511
- if (r < 0) return;
512
- let i = e.key === "ArrowDown" ? t[r + 1] : e.key === "ArrowUp" ? t[r - 1] : e.key === "Home" ? t[0] : e.key === "End" ? t[t.length - 1] : void 0;
513
- i && (e.preventDefault(), i.focus());
514
- }
515
- function l() {
516
- if (!n.selectable) return;
517
- let e = o();
518
- e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
519
- }
520
- C(l), T(() => y(l));
521
- let d = s(() => [
522
- "flex flex-col",
523
- n.segmented ? "gap-0.5 p-2" : "py-2",
524
- n.nav && !n.segmented && "gap-0.5 px-3"
525
- ]);
526
- return (t, n) => (E(), u("ul", {
527
- ref_key: "listEl",
528
- ref: i,
529
- role: e.selectable ? "listbox" : "list",
530
- class: b(d.value),
531
- onKeydown: c
532
- }, [k(t.$slots, "default")], 42, ge));
533
- }
534
- }), Z = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, _e = [
450
+ }), he = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, ge = [
535
451
  "checked",
536
452
  "disabled",
537
453
  "name",
538
454
  "required",
539
455
  "aria-invalid",
540
456
  "aria-describedby"
541
- ], ve = {
457
+ ], X = {
542
458
  key: 0,
543
459
  class: "text-body-large text-on-surface"
544
- }, Q = {
460
+ }, Z = {
545
461
  key: 0,
546
462
  class: "text-error"
547
- }, ye = ["id"], be = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", xe = /* @__PURE__ */ m({
463
+ }, _e = ["id"], ve = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", ye = /* @__PURE__ */ m({
548
464
  __name: "MSwitch",
549
465
  props: {
550
466
  modelValue: { type: Boolean },
@@ -626,7 +542,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
626
542
  onPointerup: A,
627
543
  onPointerleave: A,
628
544
  onPointercancel: A
629
- }, [d("span", Z, [d("span", { class: b(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? C[e.color] : "border-outline bg-surface-container-highest"]) }, [
545
+ }, [d("span", he, [d("span", { class: b(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? C[e.color] : "border-outline bg-surface-container-highest"]) }, [
630
546
  d("input", {
631
547
  type: "checkbox",
632
548
  class: "peer sr-only",
@@ -643,7 +559,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
643
559
  onBlur: n[1] ||= (e) => {
644
560
  M(g).onBlur(), m("blur", e);
645
561
  }
646
- }, null, 40, _e),
562
+ }, null, 40, ge),
647
563
  M(_) ? l("", !0) : (E(), u("span", {
648
564
  key: 0,
649
565
  class: b(["pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12] peer-focus-visible:opacity-[0.08]", e.modelValue ? D[e.color] : "bg-on-surface-variant"]),
@@ -655,7 +571,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
655
571
  style: x(P.value)
656
572
  }, null, 4)),
657
573
  d("span", {
658
- class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [w[e.color], "shadow-sm"] : be]),
574
+ class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [w[e.color], "shadow-sm"] : ve]),
659
575
  style: x(N.value)
660
576
  }, [p(o, {
661
577
  "enter-active-class": "transition-opacity duration-150 delay-[120ms]",
@@ -676,12 +592,96 @@ var ge = ["role"], X = /* @__PURE__ */ m({
676
592
  ], 2)]), e.label || M(y) ? (E(), u("span", {
677
593
  key: 0,
678
594
  class: b(["flex flex-col", M(y) && "pt-1"])
679
- }, [e.label ? (E(), u("span", ve, [f(j(e.label), 1), e.required ? (E(), u("span", Q, "\xA0*")) : l("", !0)])) : l("", !0), M(y) ? (E(), u("span", {
595
+ }, [e.label ? (E(), u("span", X, [f(j(e.label), 1), e.required ? (E(), u("span", Z, "\xA0*")) : l("", !0)])) : l("", !0), M(y) ? (E(), u("span", {
680
596
  key: 1,
681
597
  id: M(S),
682
598
  role: "alert",
683
599
  class: "text-body-small text-error"
684
- }, j(M(y)), 9, ye)) : l("", !0)], 2)) : l("", !0)], 34));
600
+ }, j(M(y)), 9, _e)) : l("", !0)], 2)) : l("", !0)], 34));
601
+ }
602
+ });
603
+ // src/composables/_useSegmentRuns.ts
604
+ function Q(e) {
605
+ let t = A(/* @__PURE__ */ new Map());
606
+ function n() {
607
+ let n = /* @__PURE__ */ new Map(), r = [], i = () => {
608
+ r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
609
+ };
610
+ for (let t of e.value?.children ?? []) t.getAttribute("role") === "listitem" ? r.push(t) : i();
611
+ i(), t.value = n;
612
+ }
613
+ let r;
614
+ return C(() => {
615
+ n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
616
+ }), w(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
617
+ }
618
+ // src/components/MList.vue?vue&type=script&setup=true&lang.ts
619
+ var be = ["role"], xe = /* @__PURE__ */ m({
620
+ __name: "MList",
621
+ props: {
622
+ dense: {
623
+ type: Boolean,
624
+ default: !1
625
+ },
626
+ dividers: {
627
+ type: [Boolean, String],
628
+ default: !1
629
+ },
630
+ nav: {
631
+ type: Boolean,
632
+ default: !1
633
+ },
634
+ segmented: {
635
+ type: Boolean,
636
+ default: !1
637
+ },
638
+ selectable: {
639
+ type: Boolean,
640
+ default: !1
641
+ },
642
+ selected: {},
643
+ lines: {}
644
+ },
645
+ emits: ["update:selected"],
646
+ setup(e, { emit: t }) {
647
+ let n = e, r = t, i = O(), a = Q(i);
648
+ D("m-list", {
649
+ segmentPosition: a,
650
+ dense: s(() => n.dense),
651
+ nav: s(() => n.nav),
652
+ segmented: s(() => n.segmented),
653
+ selectable: s(() => n.selectable),
654
+ selected: s(() => n.selected),
655
+ dividers: s(() => n.dividers),
656
+ lines: s(() => n.lines),
657
+ select: (e) => r("update:selected", e)
658
+ });
659
+ let o = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
660
+ function c(e) {
661
+ if (!n.selectable) return;
662
+ let t = o(), r = t.indexOf(document.activeElement);
663
+ if (r < 0) return;
664
+ let i = e.key === "ArrowDown" ? t[r + 1] : e.key === "ArrowUp" ? t[r - 1] : e.key === "Home" ? t[0] : e.key === "End" ? t[t.length - 1] : void 0;
665
+ i && (e.preventDefault(), i.focus());
666
+ }
667
+ function l() {
668
+ if (!n.selectable) return;
669
+ let e = o();
670
+ e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
671
+ }
672
+ C(l), T(() => y(l));
673
+ let d = s(() => [
674
+ "flex flex-col",
675
+ n.segmented ? "gap-0.5 p-2" : "py-2",
676
+ n.nav && !n.segmented && "gap-0.5 px-3"
677
+ ]);
678
+ return (t, n) => (E(), u("ul", {
679
+ ref_key: "listEl",
680
+ ref: i,
681
+ role: e.selectable ? "listbox" : "list",
682
+ class: b(d.value),
683
+ onKeydown: c
684
+ }, [k(t.$slots, "default")], 42, be));
685
685
  }
686
686
  }), Se = [
687
687
  "tabindex",
@@ -798,7 +798,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
798
798
  function Q() {
799
799
  J.value = !1;
800
800
  }
801
- let ye = s(() => !T.value || n.disabled ? 0 : J.value ? .12 : q.value ? .08 : 0), be = s(() => n.indent === void 0 ? void 0 : { paddingLeft: typeof n.indent == "number" ? `${n.indent}px` : n.indent });
801
+ let be = s(() => !T.value || n.disabled ? 0 : J.value ? .12 : q.value ? .08 : 0), xe = s(() => n.indent === void 0 ? void 0 : { paddingLeft: typeof n.indent == "number" ? `${n.indent}px` : n.indent });
802
802
  function je(e) {
803
803
  Y.value = e.currentTarget.matches(":focus-visible");
804
804
  }
@@ -849,7 +849,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
849
849
  }, [
850
850
  d("span", {
851
851
  class: b(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
852
- style: x({ opacity: ye.value }),
852
+ style: x({ opacity: be.value }),
853
853
  "aria-hidden": "true"
854
854
  }, null, 6),
855
855
  k(t.$slots, "leading", {}, () => [V.value === "icon" ? (E(), c(i, {
@@ -878,7 +878,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
878
878
  class: "mli-expand-grid"
879
879
  }, [d("div", {
880
880
  class: "mli-expand-body",
881
- style: x(be.value)
881
+ style: x(xe.value)
882
882
  }, [k(t.$slots, "children")], 4)], 8, we)) : l("", !0)]),
883
883
  _: 3
884
884
  })], 16)) : (E(), c(ue, { key: 1 }, {
@@ -908,7 +908,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
908
908
  default: F(() => [
909
909
  d("span", {
910
910
  class: b(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
911
- style: x({ opacity: ye.value }),
911
+ style: x({ opacity: be.value }),
912
912
  "aria-hidden": "true"
913
913
  }, null, 6),
914
914
  ae.value ? (E(), u("div", {
@@ -964,7 +964,7 @@ var ge = ["role"], X = /* @__PURE__ */ m({
964
964
  }, null, 8, ["name", "class"])) : H.value === "text" ? (E(), u("span", {
965
965
  key: 1,
966
966
  class: b(["shrink-0 text-label-small", G.value])
967
- }, j(e.trailingText), 3)) : H.value === "switch" ? (E(), c(xe, {
967
+ }, j(e.trailingText), 3)) : H.value === "switch" ? (E(), c(ye, {
968
968
  key: 2,
969
969
  "model-value": !!e.trailingValue,
970
970
  "onUpdate:modelValue": Re
@@ -986,6 +986,6 @@ var ge = ["role"], X = /* @__PURE__ */ m({
986
986
  }));
987
987
  }
988
988
  });
989
- export { me as a, ne as c, he as i, z as l, xe as n, de as o, X as r, oe as s, je as t };
989
+ export { me as a, ne as c, ye as i, z as l, xe as n, de as o, Q as r, oe as s, je as t };
990
990
 
991
- //# sourceMappingURL=MListItem-BU5KDRCB.js.map
991
+ //# sourceMappingURL=MListItem-DiOAxaN7.js.map