@m3ui-vue/m3ui-vue 1.0.2 → 1.0.3

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 (106) hide show
  1. package/dist/API.md +599 -9
  2. package/dist/MMenuItem-DFyXflk9.js +707 -0
  3. package/dist/MMenuItem-DFyXflk9.js.map +1 -0
  4. package/dist/MSlider-CdNIH7jc.js +1376 -0
  5. package/dist/MSlider-CdNIH7jc.js.map +1 -0
  6. package/dist/MTextField-B4X92vH_.js +671 -0
  7. package/dist/MTextField-B4X92vH_.js.map +1 -0
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +1 -1
  10. package/dist/components/MIconButton.vue.d.ts +1 -1
  11. package/dist/components/MMap.vue.d.ts +74 -0
  12. package/dist/components/MMapBaseLayers.vue.d.ts +15 -0
  13. package/dist/components/MMapControl.vue.d.ts +23 -0
  14. package/dist/components/MMapFeatureInfo.vue.d.ts +25 -0
  15. package/dist/components/MMapFilter.vue.d.ts +19 -0
  16. package/dist/components/MMapGeoJson.vue.d.ts +34 -0
  17. package/dist/components/MMapHover.vue.d.ts +17 -0
  18. package/dist/components/MMapIdentify.vue.d.ts +37 -0
  19. package/dist/components/MMapLayers.vue.d.ts +31 -0
  20. package/dist/components/MMapMarker.vue.d.ts +42 -0
  21. package/dist/components/MMapMeasure.vue.d.ts +43 -0
  22. package/dist/components/MMapPopup.vue.d.ts +43 -0
  23. package/dist/components/MMapSearch.vue.d.ts +28 -0
  24. package/dist/components/_MMapLayerItem.vue.d.ts +25 -0
  25. package/dist/composables/_mapGeometry.d.ts +13 -0
  26. package/dist/composables/_ssrState.d.ts +30 -0
  27. package/dist/composables/_storageKeys.d.ts +3 -0
  28. package/dist/composables/_useThemeTokens.d.ts +7 -0
  29. package/dist/composables/mapAdapters.d.ts +111 -0
  30. package/dist/composables/mapSearch.d.ts +31 -0
  31. package/dist/composables/themeInitScript.d.ts +4 -3
  32. package/dist/composables/useColorPalette.d.ts +173 -7
  33. package/dist/composables/useLocale.d.ts +30 -0
  34. package/dist/composables/useMap.d.ts +47 -0
  35. package/dist/composables/useMapFilter.d.ts +10 -0
  36. package/dist/composables/useMapLayers.d.ts +30 -0
  37. package/dist/composables/useTheme.d.ts +2 -1
  38. package/dist/index.d.ts +2 -1
  39. package/dist/locales/index.js +217 -7
  40. package/dist/locales/index.js.map +1 -1
  41. package/dist/m3ui-vue.css +1 -1
  42. package/dist/m3ui.js +6709 -7976
  43. package/dist/m3ui.js.map +1 -1
  44. package/dist/map.d.ts +24 -0
  45. package/dist/map.js +1931 -0
  46. package/dist/map.js.map +1 -0
  47. package/dist/plugin.d.ts +18 -2
  48. package/dist/rich-text-editor.js +27 -26
  49. package/dist/rich-text-editor.js.map +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/{useLocale-CuvWRZ1h.js → useLocale-b5-hzsL3.js} +32 -2
  52. package/dist/useLocale-b5-hzsL3.js.map +1 -0
  53. package/package.json +11 -2
  54. package/src/__tests__/MFab.test.ts +52 -6
  55. package/src/__tests__/MMap.test.ts +292 -0
  56. package/src/__tests__/MMapLayers.test.ts +257 -0
  57. package/src/__tests__/MMapTools.test.ts +233 -0
  58. package/src/__tests__/_fakeMaplibre.ts +158 -0
  59. package/src/__tests__/hydration.test.ts +33 -0
  60. package/src/__tests__/ssr.test.ts +63 -1
  61. package/src/__tests__/ssrState.test.ts +155 -0
  62. package/src/__tests__/themeInitScript.test.ts +18 -0
  63. package/src/components/MFab.vue +29 -7
  64. package/src/components/MIconButton.vue +1 -1
  65. package/src/components/MLightbox.vue +6 -2
  66. package/src/components/MMap.vue +522 -0
  67. package/src/components/MMapBaseLayers.vue +67 -0
  68. package/src/components/MMapControl.vue +61 -0
  69. package/src/components/MMapFeatureInfo.vue +41 -0
  70. package/src/components/MMapFilter.vue +80 -0
  71. package/src/components/MMapGeoJson.vue +136 -0
  72. package/src/components/MMapHover.vue +131 -0
  73. package/src/components/MMapIdentify.vue +103 -0
  74. package/src/components/MMapLayers.vue +111 -0
  75. package/src/components/MMapMarker.vue +102 -0
  76. package/src/components/MMapMeasure.vue +452 -0
  77. package/src/components/MMapPopup.vue +99 -0
  78. package/src/components/MMapSearch.vue +162 -0
  79. package/src/components/_MMapLayerItem.vue +77 -0
  80. package/src/composables/_mapGeometry.ts +75 -0
  81. package/src/composables/_ssrState.ts +80 -0
  82. package/src/composables/_storageKeys.ts +6 -0
  83. package/src/composables/_useThemeTokens.ts +42 -0
  84. package/src/composables/mapAdapters.ts +208 -0
  85. package/src/composables/mapSearch.ts +56 -0
  86. package/src/composables/themeInitScript.ts +6 -4
  87. package/src/composables/useColorPalette.ts +23 -9
  88. package/src/composables/useLocale.ts +62 -0
  89. package/src/composables/useMap.ts +98 -0
  90. package/src/composables/useMapFilter.ts +45 -0
  91. package/src/composables/useMapLayers.ts +124 -0
  92. package/src/composables/useTheme.ts +8 -3
  93. package/src/composables/useWindowSizeClass.ts +14 -5
  94. package/src/index.ts +2 -1
  95. package/src/locales/de.ts +31 -1
  96. package/src/locales/es.ts +31 -1
  97. package/src/locales/fr.ts +31 -1
  98. package/src/locales/ja.ts +31 -1
  99. package/src/locales/ko.ts +31 -1
  100. package/src/locales/pt.ts +31 -1
  101. package/src/locales/zh.ts +31 -1
  102. package/src/map.ts +32 -0
  103. package/src/plugin.ts +54 -3
  104. package/dist/MTextField-BPbFeI9M.js +0 -1368
  105. package/dist/MTextField-BPbFeI9M.js.map +0 -1
  106. package/dist/useLocale-CuvWRZ1h.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MTextField-B4X92vH_.js","names":["$slots"],"sources":["../src/directives/vRipple.ts","../src/components/MSpinner.vue","../src/components/MSpinner.vue","../src/composables/useFieldBg.ts","../src/composables/useDebounce.ts","../src/composables/motion.ts","../src/composables/_useSpring.ts","../src/components/MIconButton.vue","../src/components/MIconButton.vue","../src/components/MTextField.vue","../src/components/MTextField.vue"],"sourcesContent":["import type { Directive } from 'vue'\n\n/** Options for `v-ripple`. */\nexport interface RippleOptions {\n /** No ripple while true (e.g. bound to the element's disabled state). */\n disabled?: boolean\n /** Any CSS color for the ripple; defaults to the element's text color (`currentColor`). */\n color?: string\n}\n\n/** `v-ripple` value: nothing or `true` (on), `false` (off), a CSS color, or an options object. */\nexport type RippleValue = boolean | string | RippleOptions | null | undefined\n\nfunction normalize(value: RippleValue): RippleOptions {\n if (value === false) return { disabled: true }\n if (typeof value === 'string') return { color: value }\n if (value === true || value == null) return {}\n return value\n}\n\n// The ripple sits in its own clipping layer (`border-radius: inherit`), so the host only needs to be\n// positioned, not `overflow: hidden`.\nfunction spawnRipple(host: HTMLElement, event: { clientX: number; clientY: number }, color?: string) {\n const rect = host.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const layer = document.createElement('span')\n layer.className = 'm3-ripple-layer'\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n if (color) el.style.background = color\n layer.appendChild(el)\n host.appendChild(layer)\n el.addEventListener('animationend', () => layer.remove(), { once: true })\n}\n\ninterface RippleState {\n options: RippleOptions\n onPointerDown: (e: PointerEvent) => void\n}\n\nconst states = new WeakMap<HTMLElement, RippleState>()\n\n/**\n * The M3 press ripple for any element: `<div v-ripple>`, `v-ripple=\"false\"`, `v-ripple=\"'#e91e63'\"`\n * or `v-ripple=\"{ disabled, color }\"`. A statically positioned element is made `position: relative`.\n * Registered globally as `v-ripple` by `createM3UI()`; import `vRipple` to use it without the plugin.\n */\nexport const vRipple: Directive<HTMLElement, RippleValue> = {\n mounted(el, binding) {\n const state: RippleState = {\n options: normalize(binding.value),\n onPointerDown(e) {\n if (state.options.disabled || e.button !== 0) return\n // Checked on press, not on mount: the element may not be in the document yet when mounted.\n const { position } = getComputedStyle(el)\n if (!position || position === 'static') el.style.position = 'relative'\n spawnRipple(el, e, state.options.color)\n },\n }\n states.set(el, state)\n el.addEventListener('pointerdown', state.onPointerDown)\n },\n updated(el, binding) {\n const state = states.get(el)\n if (state) state.options = normalize(binding.value)\n },\n beforeUnmount(el) {\n const state = states.get(el)\n if (state) el.removeEventListener('pointerdown', state.onPointerDown)\n states.delete(el)\n },\n}\n","<script setup lang=\"ts\">\n/**\n * A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger,\n * shape-morphing loading affordance, see MLoadingIndicator.\n */\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n /** Size in px */\n size?: number;\n /**\n * M3 Expressive wavy animation style — the ring rotates while a wave travels along its stroke, instead of a\n * plain spin\n */\n wavy?: boolean;\n /** Aria label for the spinner's status role — falls back to the locale string ('Loading') when omitted */\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger,\n * shape-morphing loading affordance, see MLoadingIndicator.\n */\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n /** Size in px */\n size?: number;\n /**\n * M3 Expressive wavy animation style — the ring rotates while a wave travels along its stroke, instead of a\n * plain spin\n */\n wavy?: boolean;\n /** Aria label for the spinner's status role — falls back to the locale string ('Loading') when omitted */\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","import { ref, computed, onMounted, onBeforeUnmount, type Ref } from 'vue'\n\nconst M3_BG_CLASSES = [\n 'bg-surface-container-highest',\n 'bg-surface-container-high',\n 'bg-surface-container-low',\n 'bg-surface-container-lowest',\n 'bg-surface-container',\n 'bg-surface-variant',\n 'bg-surface-bright',\n 'bg-surface-dim',\n 'bg-surface',\n 'bg-background',\n 'bg-inverse-surface',\n 'bg-primary-container',\n 'bg-secondary-container',\n 'bg-tertiary-container',\n 'bg-error-container',\n 'bg-primary-fixed',\n 'bg-primary-fixed-dim',\n 'bg-secondary-fixed',\n 'bg-secondary-fixed-dim',\n 'bg-tertiary-fixed',\n 'bg-tertiary-fixed-dim',\n 'bg-primary',\n 'bg-secondary',\n 'bg-tertiary',\n 'bg-error',\n] as const\n\nfunction findM3BgVar(el: HTMLElement): string | null {\n for (const cls of M3_BG_CLASSES) {\n if (el.classList.contains(cls)) return `var(--color-${cls.slice(3)})`\n }\n return null\n}\n\nfunction isTransparent(color: string): boolean {\n if (!color || color === 'transparent') return true\n const m = color.match(/^rgba?\\(([^)]+)\\)$/)\n if (m) {\n const parts = m[1]!.split(',').map((s) => s.trim())\n if (parts.length === 4 && parseFloat(parts[3]!) === 0) return true\n }\n return false\n}\n\n/**\n * Auto-detects the background behind `containerEl` and exposes it as `--field-bg`.\n * Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a\n * raw computed color so the outlined label cutout transitions in sync with the rest\n * of the theme switch instead of lagging behind.\n *\n * @param containerEl The element that receives `--field-bg` as an inline style.\n * @param fieldBgProp Getter for the explicit `fieldBg` prop (overrides auto-detect).\n */\nexport function useFieldBg(\n containerEl: Ref<HTMLElement | null>,\n fieldBgProp: () => string | undefined,\n) {\n const detectedBg = ref<string>('var(--color-surface)')\n\n function applyFieldBg(value: string) {\n detectedBg.value = value\n containerEl.value?.style.setProperty('--field-bg', fieldBgProp() ?? value)\n }\n\n function resolveBg() {\n let el: HTMLElement | null = containerEl.value?.parentElement ?? null\n while (el) {\n const cssVar = findM3BgVar(el)\n if (cssVar) { applyFieldBg(cssVar); return }\n if (el === document.body) { applyFieldBg('var(--color-surface)'); return }\n const bg = getComputedStyle(el).backgroundColor\n if (!isTransparent(bg)) { applyFieldBg(bg); return }\n el = el.parentElement\n }\n applyFieldBg('var(--color-surface)')\n }\n\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n resolveBg()\n observer = new MutationObserver(() => resolveBg())\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n const resolvedFieldBg = computed(() => fieldBgProp() ?? detectedBg.value)\n\n return { resolvedFieldBg }\n}\n","import { onBeforeUnmount } from 'vue'\n\nexport function useDebounce(fn: (...args: any[]) => void, ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null\n\n function debounced(...args: any[]) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n timer = null\n fn(...args)\n }, ms)\n }\n\n function cancel() {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n }\n\n onBeforeUnmount(cancel)\n\n return { debounced, cancel }\n}\n","// Material 3's motion tokens for your own animations, from androidx's MotionTokens, StandardMotionTokens and\n// ExpressiveMotionTokens. The same easings and durations are CSS variables in theme.css (`--ease-*`, which\n// Tailwind turns into `ease-*` utilities, and `--duration-*`); the springs only make sense in JS, with\n// `useSpring` (exported next to these) or your own loop. No imports here: _useSpring builds on this file.\n\n/** A spring: dampingRatio 1 settles without overshoot, lower bounces; higher stiffness is faster */\nexport interface SpringSpec { dampingRatio: number; stiffness: number }\n\n/**\n * Spring specs of the two motion schemes. Spatial springs move things (position, size, shape); effects springs\n * change color and opacity and never overshoot. Standard is the default scheme; Expressive is bouncier, for\n * Expressive components and moments that should feel lively.\n */\nexport const motionSprings = {\n standard: {\n fastSpatial: { dampingRatio: 0.9, stiffness: 1400 },\n defaultSpatial: { dampingRatio: 0.9, stiffness: 700 },\n slowSpatial: { dampingRatio: 0.9, stiffness: 300 },\n fastEffects: { dampingRatio: 1, stiffness: 3800 },\n defaultEffects: { dampingRatio: 1, stiffness: 1600 },\n slowEffects: { dampingRatio: 1, stiffness: 800 },\n },\n expressive: {\n fastSpatial: { dampingRatio: 0.6, stiffness: 800 },\n defaultSpatial: { dampingRatio: 0.8, stiffness: 380 },\n slowSpatial: { dampingRatio: 0.8, stiffness: 200 },\n fastEffects: { dampingRatio: 1, stiffness: 3800 },\n defaultEffects: { dampingRatio: 1, stiffness: 1600 },\n slowEffects: { dampingRatio: 1, stiffness: 800 },\n },\n} as const satisfies Record<'standard' | 'expressive', Record<string, SpringSpec>>\n\n/** Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`) */\nexport const motionEasings = {\n emphasized: [0.2, 0, 0, 1],\n emphasizedDecelerate: [0.05, 0.7, 0.1, 1],\n emphasizedAccelerate: [0.3, 0, 0.8, 0.15],\n standard: [0.2, 0, 0, 1],\n standardDecelerate: [0, 0, 0, 1],\n standardAccelerate: [0.3, 0, 1, 1],\n legacy: [0.4, 0, 0.2, 1],\n legacyDecelerate: [0, 0, 0.2, 1],\n legacyAccelerate: [0.4, 0, 1, 1],\n linear: [0, 0, 1, 1],\n} as const satisfies Record<string, readonly [number, number, number, number]>\n\n/** Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`) */\nexport const motionDurations = {\n short1: 50, short2: 100, short3: 150, short4: 200,\n medium1: 250, medium2: 300, medium3: 350, medium4: 400,\n long1: 450, long2: 500, long3: 550, long4: 600,\n extraLong1: 700, extraLong2: 800, extraLong3: 900, extraLong4: 1000,\n} as const\n\n/**\n * A cubic-bezier easing as a function of progress (0–1), e.g. `cubicBezier(...motionEasings.emphasized)`, for\n * JS-driven tweens and for mapping a fraction through a curve\n */\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number {\n return (t: number) => {\n if (t <= 0) return 0\n if (t >= 1) return 1\n // Solve x(u) = t for the curve parameter u (Newton), then return y(u)\n let u = t\n for (let i = 0; i < 8; i++) {\n const x = 3 * u * (1 - u) ** 2 * x1 + 3 * u ** 2 * (1 - u) * x2 + u ** 3 - t\n const dx = 3 * (1 - u) ** 2 * x1 + 6 * u * (1 - u) * (x2 - x1) + 3 * u ** 2 * (1 - x2)\n if (Math.abs(dx) < 1e-6) break\n u -= x / dx\n }\n return 3 * u * (1 - u) ** 2 * y1 + 3 * u ** 2 * (1 - u) * y2 + u ** 3\n }\n}\n","// A set of numbers (corner radii, sizes...) that springs toward a target, written to the DOM once per\n// frame through `apply`. Same integration as the rest of the library (semi-implicit Euler), in fixed 4ms\n// substeps so a stiff spring stays stable on a dropped frame. `useSpring` is public (index.ts, with the\n// motion tokens); the constants below are the library's internal shorthands for the Standard scheme.\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport { cubicBezier, motionSprings, type SpringSpec } from './motion'\n\nexport type { SpringSpec }\n\n/** MotionSchemeKeyTokens.FastSpatial in the Standard scheme (StandardMotionTokens.SpringFastSpatial*) */\nexport const FAST_SPATIAL: SpringSpec = motionSprings.standard.fastSpatial\n/** MotionSchemeKeyTokens.FastEffects in the Standard scheme */\nexport const FAST_EFFECTS: SpringSpec = motionSprings.standard.fastEffects\n/** MotionSchemeKeyTokens.DefaultEffects in the Standard scheme */\nexport const DEFAULT_EFFECTS: SpringSpec = motionSprings.standard.defaultEffects\n/** MotionSchemeKeyTokens.DefaultSpatial in the Standard scheme */\nexport const DEFAULT_SPATIAL: SpringSpec = motionSprings.standard.defaultSpatial\n\nconst SUBSTEP = 0.004\n\nexport function useSpring(\n target: () => number[],\n apply: (values: readonly number[]) => void,\n spec: SpringSpec = FAST_SPATIAL,\n) {\n let current = [...target()]\n let velocity = current.map(() => 0)\n let raf = 0\n let last = 0\n\n function frame(now: number) {\n let dt = Math.min((now - last) / 1000, 1 / 30)\n last = now\n const t = target()\n if (t.length !== current.length) {\n current = [...t]\n velocity = t.map(() => 0)\n }\n const k = spec.stiffness\n const c = 2 * spec.dampingRatio * Math.sqrt(k)\n while (dt > 0) {\n const h = Math.min(dt, SUBSTEP)\n dt -= h\n for (let i = 0; i < t.length; i++) {\n velocity[i]! += (-k * (current[i]! - t[i]!) - c * velocity[i]!) * h\n current[i]! += velocity[i]! * h\n }\n }\n const settled = t.every((v, i) => Math.abs(v - current[i]!) < 0.05 && Math.abs(velocity[i]!) < 0.05)\n if (settled) {\n current = [...t]\n velocity = t.map(() => 0)\n }\n apply(current)\n raf = settled ? 0 : requestAnimationFrame(frame)\n }\n\n function start() {\n if (raf) return\n last = performance.now()\n raf = requestAnimationFrame(frame)\n }\n\n /** Jumps to the target without animating (e.g. when the layout context changes). */\n function snap() {\n cancelAnimationFrame(raf)\n raf = 0\n current = [...target()]\n velocity = current.map(() => 0)\n apply(current)\n }\n\n watch(() => target().join(','), start)\n onMounted(() => apply(current))\n onUnmounted(() => cancelAnimationFrame(raf))\n\n return { snap }\n}\n\n/** Compose's FastOutSlowInEasing, cubic-bezier(0.4, 0, 0.2, 1) — the easing of a default tween() */\nexport const fastOutSlowIn = cubicBezier(0.4, 0, 0.2, 1)\n","<script setup lang=\"ts\">\n/**\n * A button that shows only an icon — four visual styles, the same 5-tier expressive sizing as MButton. Give it\n * `checked` (v-model:checked) and it becomes M3's icon toggle button.\n *\n * @event update:checked Emitted on click when `checked` is set — powers v-model:checked\n */\nimport { computed, ref } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\nimport { DEFAULT_EFFECTS, useSpring } from '../composables/_useSpring'\n\nconst props = withDefaults(\n defineProps<{\n /** Material Symbol icon name */\n icon: string\n /** Accessible label (its aria-label; no visible tooltip: wrap it in MTooltip for one) */\n label?: string\n /** Visual style */\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\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 /** M3's 5-tier icon button sizing (xs:32, sm:40, md:56, lg:96, xl:136), or a custom pixel value */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n /** Disables interaction */\n disabled?: boolean\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 * Makes it a toggle button (v-model:checked): selected colors, a filled icon, and a shape that morphs when\n * pressed and when checked. Leave it unset for a plain icon button\n */\n checked?: boolean\n /** Icon shown while checked, when it differs from `icon` (e.g. 'pause' for 'play_arrow') */\n checkedIcon?: string\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n checked: undefined,\n },\n)\n\nconst emit = defineEmits<{ 'update:checked': [boolean] }>()\n\nconst isToggle = computed(() => props.checked !== undefined)\nconst tag = computed(() => props.to && !isToggle.value ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\n// Toggle radii (px) from the same token files: `square` is ContainerShapeSquare, `pressed`\n// PressedContainerShape, `checkedRound` SelectedContainerShapeRound (a round button squares off when\n// checked); SelectedContainerShapeSquare is CornerFull (a square one turns round), i.e. px / 2.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg', square: 16, pressed: 12, checkedRound: 16 },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl', square: 28, pressed: 16, checkedRound: 28 },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl', square: 28, pressed: 16, checkedRound: 28 },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') {\n return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 }\n }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n// Icon toggle shape morph (IconButton.kt's shapeByInteraction: pressed, else checked, else the resting\n// shape), on the DefaultEffects spring the source picks so it doesn't bounce. Plain icon buttons keep\n// a static shape, like Compose's non-`shapes` overloads.\nconst rootEl = ref<unknown>(null)\nconst pressed = ref(false)\n\nfunction targetRadius() {\n const r = resolved.value\n const full = r.px / 2\n if (pressed.value) return r.pressed\n if (props.checked) return props.shape === 'squared' ? full : r.checkedRound\n return props.shape === 'squared' ? r.square : full\n}\n\nuseSpring(\n () => (isToggle.value ? [targetRadius()] : []),\n (v) => {\n // A RouterLink root (plain button with `to`) is a component instance, not an element\n if (rootEl.value instanceof HTMLElement) rootEl.value.style.borderRadius = v.length ? `${v[0]}px` : ''\n },\n DEFAULT_EFFECTS,\n)\n\nfunction onPointerDown() {\n if (isToggle.value && !props.disabled) pressed.value = true\n}\nfunction onPointerUp() {\n pressed.value = false\n}\n\nfunction onClick() {\n if (isToggle.value && !props.disabled) emit('update:checked', !props.checked)\n}\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed 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 container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n if (props.variant === 'outlined' && props.checked) return 'disabled:bg-on-surface/10'\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\n\n// Toggle colors: the Selected*/Unselected* tokens of each variant's *IconButtonTokens. Unchecked\n// filled/tonal differ from the plain button's colors, so the checked state stands out.\nconst toggleClasses = computed(() => {\n const on = props.checked\n switch (props.variant) {\n case 'filled':\n return on ? 'bg-primary text-on-primary' : 'bg-surface-container text-on-surface-variant'\n case 'tonal':\n return on ? 'bg-secondary text-on-secondary' : 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // outlinedIconToggleButtonBorder: no border once checked\n return on ? 'bg-inverse-surface text-inverse-on-surface' : 'border border-current text-on-surface-variant'\n default:\n return on ? 'text-primary' : 'text-on-surface-variant'\n }\n})\n\nconst variantClasses = computed(() => {\n if (isToggle.value) return toggleClasses.value\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n ref=\"rootEl\"\n :to=\"tag === 'RouterLink' ? to : undefined\"\n :type=\"tag === 'RouterLink' ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :aria-pressed=\"isToggle ? checked : undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n v-ripple=\"{ disabled, color: rippleColor }\"\n @pointerdown=\"onPointerDown\"\n @pointerup=\"onPointerUp\"\n @pointerleave=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @click=\"onClick\"\n >\n <MIcon :name=\"checked && checkedIcon ? checkedIcon : icon\" :size=\"resolved.icon\" :filled=\"!!checked\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\n/**\n * A button that shows only an icon — four visual styles, the same 5-tier expressive sizing as MButton. Give it\n * `checked` (v-model:checked) and it becomes M3's icon toggle button.\n *\n * @event update:checked Emitted on click when `checked` is set — powers v-model:checked\n */\nimport { computed, ref } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\nimport { DEFAULT_EFFECTS, useSpring } from '../composables/_useSpring'\n\nconst props = withDefaults(\n defineProps<{\n /** Material Symbol icon name */\n icon: string\n /** Accessible label (its aria-label; no visible tooltip: wrap it in MTooltip for one) */\n label?: string\n /** Visual style */\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\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 /** M3's 5-tier icon button sizing (xs:32, sm:40, md:56, lg:96, xl:136), or a custom pixel value */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n /** Disables interaction */\n disabled?: boolean\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 * Makes it a toggle button (v-model:checked): selected colors, a filled icon, and a shape that morphs when\n * pressed and when checked. Leave it unset for a plain icon button\n */\n checked?: boolean\n /** Icon shown while checked, when it differs from `icon` (e.g. 'pause' for 'play_arrow') */\n checkedIcon?: string\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n checked: undefined,\n },\n)\n\nconst emit = defineEmits<{ 'update:checked': [boolean] }>()\n\nconst isToggle = computed(() => props.checked !== undefined)\nconst tag = computed(() => props.to && !isToggle.value ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\n// Toggle radii (px) from the same token files: `square` is ContainerShapeSquare, `pressed`\n// PressedContainerShape, `checkedRound` SelectedContainerShapeRound (a round button squares off when\n// checked); SelectedContainerShapeSquare is CornerFull (a square one turns round), i.e. px / 2.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg', square: 16, pressed: 12, checkedRound: 16 },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl', square: 28, pressed: 16, checkedRound: 28 },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl', square: 28, pressed: 16, checkedRound: 28 },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') {\n return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md', square: 12, pressed: 8, checkedRound: 12 }\n }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n// Icon toggle shape morph (IconButton.kt's shapeByInteraction: pressed, else checked, else the resting\n// shape), on the DefaultEffects spring the source picks so it doesn't bounce. Plain icon buttons keep\n// a static shape, like Compose's non-`shapes` overloads.\nconst rootEl = ref<unknown>(null)\nconst pressed = ref(false)\n\nfunction targetRadius() {\n const r = resolved.value\n const full = r.px / 2\n if (pressed.value) return r.pressed\n if (props.checked) return props.shape === 'squared' ? full : r.checkedRound\n return props.shape === 'squared' ? r.square : full\n}\n\nuseSpring(\n () => (isToggle.value ? [targetRadius()] : []),\n (v) => {\n // A RouterLink root (plain button with `to`) is a component instance, not an element\n if (rootEl.value instanceof HTMLElement) rootEl.value.style.borderRadius = v.length ? `${v[0]}px` : ''\n },\n DEFAULT_EFFECTS,\n)\n\nfunction onPointerDown() {\n if (isToggle.value && !props.disabled) pressed.value = true\n}\nfunction onPointerUp() {\n pressed.value = false\n}\n\nfunction onClick() {\n if (isToggle.value && !props.disabled) emit('update:checked', !props.checked)\n}\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed 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 container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n if (props.variant === 'outlined' && props.checked) return 'disabled:bg-on-surface/10'\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\n\n// Toggle colors: the Selected*/Unselected* tokens of each variant's *IconButtonTokens. Unchecked\n// filled/tonal differ from the plain button's colors, so the checked state stands out.\nconst toggleClasses = computed(() => {\n const on = props.checked\n switch (props.variant) {\n case 'filled':\n return on ? 'bg-primary text-on-primary' : 'bg-surface-container text-on-surface-variant'\n case 'tonal':\n return on ? 'bg-secondary text-on-secondary' : 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // outlinedIconToggleButtonBorder: no border once checked\n return on ? 'bg-inverse-surface text-inverse-on-surface' : 'border border-current text-on-surface-variant'\n default:\n return on ? 'text-primary' : 'text-on-surface-variant'\n }\n})\n\nconst variantClasses = computed(() => {\n if (isToggle.value) return toggleClasses.value\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n ref=\"rootEl\"\n :to=\"tag === 'RouterLink' ? to : undefined\"\n :type=\"tag === 'RouterLink' ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :aria-pressed=\"isToggle ? checked : undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n v-ripple=\"{ disabled, color: rippleColor }\"\n @pointerdown=\"onPointerDown\"\n @pointerup=\"onPointerUp\"\n @pointerleave=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @click=\"onClick\"\n >\n <MIcon :name=\"checked && checkedIcon ? checkedIcon : icon\" :size=\"resolved.icon\" :filled=\"!!checked\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The standard single- or multi-line text input, filled or outlined, with floating label.\n *\n * @slot trailing Custom trailing content (e.g. an icon button) — replaces the built-in clear button when\n * present\n * @event update:modelValue Emitted on every keystroke — powers v-model\n * @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)\n */\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n /** Bound value (v-model) */\n modelValue: string | number;\n /** Field label */\n label: string;\n /** HTML input type */\n type?: string;\n /** Visual style */\n variant?: \"filled\" | \"outlined\";\n /** Puts the field in error state (red border and label) */\n error?: boolean;\n /** Error message shown below the field (only visible when error is true) */\n errorLabel?: string;\n /** Hint text shown below the field */\n hint?: string;\n /** Disables the field */\n disabled?: boolean;\n /** Marks as required — adds a red asterisk after the label */\n required?: boolean;\n /** Renders a textarea instead of an input */\n multiline?: boolean;\n /** Textarea rows (when multiline) */\n rows?: number;\n /** Passed through to the native autocomplete attribute */\n autocomplete?: string;\n /** Material Symbol shown before the input */\n leadingIcon?: string;\n /** Show a clear button when the field has a value */\n clearable?: boolean;\n /**\n * Overrides the auto-detected background color used to cut the floating label out of the outlined border\n */\n fieldBg?: string;\n /** Delay (ms) before firing the @debounced event. v-model always updates immediately */\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\">&nbsp;*</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The standard single- or multi-line text input, filled or outlined, with floating label.\n *\n * @slot trailing Custom trailing content (e.g. an icon button) — replaces the built-in clear button when\n * present\n * @event update:modelValue Emitted on every keystroke — powers v-model\n * @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)\n */\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n /** Bound value (v-model) */\n modelValue: string | number;\n /** Field label */\n label: string;\n /** HTML input type */\n type?: string;\n /** Visual style */\n variant?: \"filled\" | \"outlined\";\n /** Puts the field in error state (red border and label) */\n error?: boolean;\n /** Error message shown below the field (only visible when error is true) */\n errorLabel?: string;\n /** Hint text shown below the field */\n hint?: string;\n /** Disables the field */\n disabled?: boolean;\n /** Marks as required — adds a red asterisk after the label */\n required?: boolean;\n /** Renders a textarea instead of an input */\n multiline?: boolean;\n /** Textarea rows (when multiline) */\n rows?: number;\n /** Passed through to the native autocomplete attribute */\n autocomplete?: string;\n /** Material Symbol shown before the input */\n leadingIcon?: string;\n /** Show a clear button when the field has a value */\n clearable?: boolean;\n /**\n * Overrides the auto-detected background color used to cut the floating label out of the outlined border\n */\n fieldBg?: string;\n /** Delay (ms) before firing the @debounced event. v-model always updates immediately */\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\">&nbsp;*</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n"],"mappings":";;;;AAaA,SAAS,EAAU,GAAmC;CAIpD,OAHI,MAAU,KAAc,EAAE,UAAU,GAAK,IACzC,OAAO,KAAU,WAAiB,EAAE,OAAO,EAAM,IACjD,MAAU,MAAQ,KAAS,OAAa,CAAC,IACtC;AACT;AAIA,SAAS,EAAY,GAAmB,GAA6C,GAAgB;CACnG,IAAM,IAAO,EAAK,sBAAsB,GAClC,IAAI,KAAK,IAAI,EAAK,OAAO,EAAK,MAAM,IAAI,GACxC,IAAQ,SAAS,cAAc,MAAM;CAC3C,EAAM,YAAY;CAClB,IAAM,IAAK,SAAS,cAAc,MAAM;CAMxC,AALA,EAAG,YAAY,aACf,EAAG,MAAM,UAAU,SAAS,EAAE,YAAY,EAAE,SAAS,EAAM,UAAU,EAAK,MAAM,IAAI,EAAE,UAAU,EAAM,UAAU,EAAK,OAAO,IAAI,EAAE,KAC9H,MAAO,EAAG,MAAM,aAAa,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