@m3ui-vue/m3ui-vue 0.9.2 → 0.9.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 (91) hide show
  1. package/README.md +2 -0
  2. package/dist/API.md +69 -8
  3. package/dist/{MIcon-CaEooCmZ.js → MIcon-DLOkQduI.js} +10 -3
  4. package/dist/MIcon-DLOkQduI.js.map +1 -0
  5. package/dist/{MTextField-Ck0oWDMk.js → MTextField-DKtgPymd.js} +416 -206
  6. package/dist/MTextField-DKtgPymd.js.map +1 -0
  7. package/dist/THIRD_PARTY_LICENSES.md +547 -0
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +2 -2
  10. package/dist/components/MButton.vue.d.ts +4 -2
  11. package/dist/components/MButtonGroup.vue.d.ts +2 -0
  12. package/dist/components/MFab.vue.d.ts +4 -2
  13. package/dist/components/MIcon.vue.d.ts +3 -0
  14. package/dist/components/MIconButton.vue.d.ts +15 -1
  15. package/dist/components/MMenuItem.vue.d.ts +17 -4
  16. package/dist/components/MSplitButton.vue.d.ts +2 -0
  17. package/dist/components/MTabs.vue.d.ts +6 -0
  18. package/dist/components/MTimePickerModal.vue.d.ts +3 -0
  19. package/dist/components/MTimeScroll.vue.d.ts +22 -0
  20. package/dist/components/MToggleButton.vue.d.ts +2 -0
  21. package/dist/components/MTree.vue.d.ts +2 -2
  22. package/dist/components/_MDrawerItemList.vue.d.ts +3 -0
  23. package/dist/composables/_useSpring.d.ts +2 -0
  24. package/dist/composables/useLocale.d.ts +6 -0
  25. package/dist/directives/vRipple.d.ts +16 -0
  26. package/dist/emoji-names-de-BphO5XpV.js.map +1 -1
  27. package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -1
  28. package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -1
  29. package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -1
  30. package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -1
  31. package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -1
  32. package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -1
  33. package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -1
  34. package/dist/index.d.ts +3 -0
  35. package/dist/locales/index.js +42 -0
  36. package/dist/locales/index.js.map +1 -1
  37. package/dist/m3ui-vue.css +1 -1
  38. package/dist/m3ui.js +5741 -5634
  39. package/dist/m3ui.js.map +1 -1
  40. package/dist/rich-text-editor.js +22 -22
  41. package/dist/styles/theme.css +13 -0
  42. package/dist/styles.css +1 -1
  43. package/dist/terminal.js +1 -1
  44. package/dist/{useLocale-CFW8cIzL.js → useLocale-Cn9MVIdw.js} +7 -1
  45. package/dist/useLocale-Cn9MVIdw.js.map +1 -0
  46. package/package.json +2 -2
  47. package/src/__tests__/MIconButton.test.ts +60 -0
  48. package/src/__tests__/MMenuItem.test.ts +84 -0
  49. package/src/__tests__/MScrollField.test.ts +28 -0
  50. package/src/__tests__/MTabs.test.ts +39 -0
  51. package/src/__tests__/MTimePickerModal.test.ts +52 -0
  52. package/src/__tests__/MTimeScroll.test.ts +44 -0
  53. package/src/__tests__/vRipple.test.ts +92 -0
  54. package/src/components/MButton.vue +4 -13
  55. package/src/components/MButtonGroup.vue +4 -11
  56. package/src/components/MFab.vue +8 -15
  57. package/src/components/MIcon.vue +4 -2
  58. package/src/components/MIconButton.vue +96 -24
  59. package/src/components/MMenuItem.vue +115 -13
  60. package/src/components/MScrollField.vue +10 -2
  61. package/src/components/MSplitButton.vue +5 -12
  62. package/src/components/MTabs.vue +16 -5
  63. package/src/components/MTimePickerModal.vue +48 -8
  64. package/src/components/MTimeScroll.vue +161 -0
  65. package/src/components/MToggleButton.vue +5 -12
  66. package/src/composables/_carouselStrategy.ts +3 -0
  67. package/src/composables/_useSpring.ts +2 -0
  68. package/src/composables/useLocale.ts +12 -0
  69. package/src/data/emoji-names/emoji-names-de.ts +1 -0
  70. package/src/data/emoji-names/emoji-names-en.ts +1 -0
  71. package/src/data/emoji-names/emoji-names-es.ts +1 -0
  72. package/src/data/emoji-names/emoji-names-fr.ts +1 -0
  73. package/src/data/emoji-names/emoji-names-ja.ts +1 -0
  74. package/src/data/emoji-names/emoji-names-ko.ts +1 -0
  75. package/src/data/emoji-names/emoji-names-pt.ts +1 -0
  76. package/src/data/emoji-names/emoji-names-zh.ts +1 -0
  77. package/src/data/emojis.ts +1 -0
  78. package/src/directives/vRipple.ts +73 -0
  79. package/src/index.ts +5 -0
  80. package/src/locales/de.ts +6 -0
  81. package/src/locales/es.ts +6 -0
  82. package/src/locales/fr.ts +6 -0
  83. package/src/locales/ja.ts +6 -0
  84. package/src/locales/ko.ts +6 -0
  85. package/src/locales/pt.ts +6 -0
  86. package/src/locales/zh.ts +6 -0
  87. package/src/plugin.ts +2 -0
  88. package/src/styles/theme.css +13 -0
  89. package/dist/MIcon-CaEooCmZ.js.map +0 -1
  90. package/dist/MTextField-Ck0oWDMk.js.map +0 -1
  91. package/dist/useLocale-CFW8cIzL.js.map +0 -1
@@ -1,16 +1,45 @@
1
- import { i as e } from "./useLocale-CFW8cIzL.js";
2
- import { t } from "./MIcon-CaEooCmZ.js";
1
+ import { i as e } from "./useLocale-Cn9MVIdw.js";
2
+ import { t } from "./MIcon-DLOkQduI.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
- import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useId as A, useSlots as j, watch as ee, withCtx as M, withModifiers as N } from "vue";
5
- //#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
6
- var P = ["aria-label"], F = {
4
+ import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useId as A, useSlots as j, watch as ee, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
5
+ //#region src/directives/vRipple.ts
6
+ function F(e) {
7
+ return e === !1 ? { disabled: !0 } : typeof e == "string" ? { color: e } : e === !0 || e == null ? {} : e;
8
+ }
9
+ function te(e, t, n) {
10
+ let r = e.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = document.createElement("span");
11
+ a.className = "m3-ripple-layer";
12
+ let o = document.createElement("span");
13
+ o.className = "m3-ripple", o.style.cssText = `width:${i}px;height:${i}px;top:${t.clientY - r.top - i / 2}px;left:${t.clientX - r.left - i / 2}px`, n && (o.style.background = n), a.appendChild(o), e.appendChild(a), o.addEventListener("animationend", () => a.remove(), { once: !0 });
14
+ }
15
+ var I = /* @__PURE__ */ new WeakMap(), L = {
16
+ mounted(e, t) {
17
+ let n = {
18
+ options: F(t.value),
19
+ onPointerDown(t) {
20
+ if (n.options.disabled || t.button !== 0) return;
21
+ let { position: r } = getComputedStyle(e);
22
+ (!r || r === "static") && (e.style.position = "relative"), te(e, t, n.options.color);
23
+ }
24
+ };
25
+ I.set(e, n), e.addEventListener("pointerdown", n.onPointerDown);
26
+ },
27
+ updated(e, t) {
28
+ let n = I.get(e);
29
+ n && (n.options = F(t.value));
30
+ },
31
+ beforeUnmount(e) {
32
+ let t = I.get(e);
33
+ t && e.removeEventListener("pointerdown", t.onPointerDown), I.delete(e);
34
+ }
35
+ }, R = ["aria-label"], z = {
7
36
  key: 0,
8
37
  class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
9
- }, I = [
38
+ }, B = [
10
39
  "width",
11
40
  "height",
12
41
  "viewBox"
13
- ], te = ["d", "stroke-dasharray"], L = 3, ne = 9, R = /* @__PURE__ */ p({
42
+ ], V = ["d", "stroke-dasharray"], H = 3, U = 9, W = /* @__PURE__ */ p({
14
43
  __name: "MSpinner",
15
44
  props: {
16
45
  size: { default: 20 },
@@ -21,10 +50,10 @@ var P = ["aria-label"], F = {
21
50
  label: {}
22
51
  },
23
52
  setup(t) {
24
- let n = t, r = e(), i = o(() => (n.size / 2 - 1 - L / 2) / 1.25), a = o(() => n.size / 2), s = o(() => {
53
+ let n = t, r = e(), i = o(() => (n.size / 2 - 1 - H / 2) / 1.25), a = o(() => n.size / 2), s = o(() => {
25
54
  let e = a.value, t = i.value, n = t * .08, r = [], o = 0, s = 0, c = 0;
26
55
  for (let i = 0; i <= 216; i++) {
27
- let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(ne * a), u = e + l * Math.cos(a), d = e + l * Math.sin(a);
56
+ let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(U * a), u = e + l * Math.cos(a), d = e + l * Math.sin(a);
28
57
  i > 0 && (o += Math.sqrt((u - s) ** 2 + (d - c) ** 2)), r.push(`${i === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), s = u, c = d;
29
58
  }
30
59
  let l = o * .58, u = o - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
@@ -53,14 +82,14 @@ var P = ["aria-label"], F = {
53
82
  }, [u("path", {
54
83
  d: s.value.path,
55
84
  stroke: "currentColor",
56
- "stroke-width": L,
85
+ "stroke-width": H,
57
86
  "stroke-linecap": "round",
58
87
  "stroke-dasharray": s.value.dash,
59
88
  class: "animate-[m3-wavy-travel_2s_linear_infinite]",
60
89
  style: v({ "--m3-wave-len": s.value.len })
61
- }, null, 12, te)], 12, I)) : (S(), l("span", F))], 12, P));
90
+ }, null, 12, V)], 12, B)) : (S(), l("span", z))], 12, R));
62
91
  }
63
- }), z = [
92
+ }), ne = [
64
93
  "bg-surface-container-highest",
65
94
  "bg-surface-container-high",
66
95
  "bg-surface-container-low",
@@ -87,11 +116,11 @@ var P = ["aria-label"], F = {
87
116
  "bg-tertiary",
88
117
  "bg-error"
89
118
  ];
90
- function B(e) {
91
- for (let t of z) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
119
+ function re(e) {
120
+ for (let t of ne) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
92
121
  return null;
93
122
  }
94
- function V(e) {
123
+ function G(e) {
95
124
  if (!e || e === "transparent") return !0;
96
125
  let t = e.match(/^rgba?\(([^)]+)\)$/);
97
126
  if (t) {
@@ -100,7 +129,7 @@ function V(e) {
100
129
  }
101
130
  return !1;
102
131
  }
103
- function H(e, t) {
132
+ function K(e, t) {
104
133
  let n = w("var(--color-surface)");
105
134
  function r(r) {
106
135
  n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
@@ -108,7 +137,7 @@ function H(e, t) {
108
137
  function i() {
109
138
  let t = e.value?.parentElement ?? null;
110
139
  for (; t;) {
111
- let e = B(t);
140
+ let e = re(t);
112
141
  if (e) {
113
142
  r(e);
114
143
  return;
@@ -118,7 +147,7 @@ function H(e, t) {
118
147
  return;
119
148
  }
120
149
  let n = getComputedStyle(t).backgroundColor;
121
- if (!V(n)) {
150
+ if (!G(n)) {
122
151
  r(n);
123
152
  return;
124
153
  }
@@ -140,7 +169,7 @@ function H(e, t) {
140
169
  }
141
170
  //#endregion
142
171
  //#region src/composables/useDebounce.ts
143
- function U(e, t) {
172
+ function q(e, t) {
144
173
  let n = null;
145
174
  function r(...r) {
146
175
  n && clearTimeout(n), n = setTimeout(() => {
@@ -156,8 +185,55 @@ function U(e, t) {
156
185
  };
157
186
  }
158
187
  //#endregion
188
+ //#region src/composables/_useSpring.ts
189
+ var J = {
190
+ dampingRatio: .9,
191
+ stiffness: 1400
192
+ }, Y = {
193
+ dampingRatio: 1,
194
+ stiffness: 3800
195
+ }, X = {
196
+ dampingRatio: 1,
197
+ stiffness: 1600
198
+ }, ie = .004;
199
+ function Z(e, t, n = J) {
200
+ let r = [...e()], i = r.map(() => 0), a = 0, o = 0;
201
+ function s(c) {
202
+ let l = Math.min((c - o) / 1e3, 1 / 30);
203
+ o = c;
204
+ let u = e();
205
+ u.length !== r.length && (r = [...u], i = u.map(() => 0));
206
+ let d = n.stiffness, f = 2 * n.dampingRatio * Math.sqrt(d);
207
+ for (; l > 0;) {
208
+ let e = Math.min(l, ie);
209
+ l -= e;
210
+ for (let t = 0; t < u.length; t++) i[t] += (-d * (r[t] - u[t]) - f * i[t]) * e, r[t] += i[t] * e;
211
+ }
212
+ let p = u.every((e, t) => Math.abs(e - r[t]) < .05 && Math.abs(i[t]) < .05);
213
+ p && (r = [...u], i = u.map(() => 0)), t(r), a = p ? 0 : requestAnimationFrame(s);
214
+ }
215
+ function c() {
216
+ a ||= (o = performance.now(), requestAnimationFrame(s));
217
+ }
218
+ function l() {
219
+ cancelAnimationFrame(a), a = 0, r = [...e()], i = r.map(() => 0), t(r);
220
+ }
221
+ return ee(() => e().join(","), c), b(() => t(r)), x(() => cancelAnimationFrame(a)), { snap: l };
222
+ }
223
+ function ae(e) {
224
+ if (e <= 0) return 0;
225
+ if (e >= 1) return 1;
226
+ let t = e;
227
+ for (let n = 0; n < 8; n++) {
228
+ let n = 3 * t * (1 - t) ** 2 * .4 + 3 * t ** 2 * (1 - t) * .2 + t ** 3 - e, r = 3 * (1 - t) ** 2 * .4 + 6 * t * (1 - t) * -.2 + 3 * t ** 2 * .8;
229
+ if (Math.abs(r) < 1e-6) break;
230
+ t -= n / r;
231
+ }
232
+ return 3 * t ** 2 * (1 - t) + t ** 3;
233
+ }
234
+ //#endregion
159
235
  //#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
160
- var re = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", W = /* @__PURE__ */ p({
236
+ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", se = /* @__PURE__ */ p({
161
237
  __name: "MIconButton",
162
238
  props: {
163
239
  icon: {},
@@ -169,91 +245,153 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
169
245
  type: Boolean,
170
246
  default: !1
171
247
  },
172
- to: {}
248
+ to: {},
249
+ rippleColor: {},
250
+ checked: {
251
+ type: Boolean,
252
+ default: void 0
253
+ },
254
+ checkedIcon: {}
173
255
  },
174
- setup(e) {
175
- let n = e, r = o(() => n.to ? "RouterLink" : "button"), i = {
256
+ emits: ["update:checked"],
257
+ setup(e, { emit: n }) {
258
+ let r = e, i = n, a = o(() => r.checked !== void 0), c = o(() => r.to && !a.value ? "RouterLink" : "button"), l = {
176
259
  xs: {
177
260
  px: 32,
178
261
  icon: 20,
179
- squareRadius: "rounded-md"
262
+ squareRadius: "rounded-md",
263
+ square: 12,
264
+ pressed: 8,
265
+ checkedRound: 12
180
266
  },
181
267
  sm: {
182
268
  px: 40,
183
269
  icon: 24,
184
- squareRadius: "rounded-md"
270
+ squareRadius: "rounded-md",
271
+ square: 12,
272
+ pressed: 8,
273
+ checkedRound: 12
185
274
  },
186
275
  md: {
187
276
  px: 56,
188
277
  icon: 24,
189
- squareRadius: "rounded-lg"
278
+ squareRadius: "rounded-lg",
279
+ square: 16,
280
+ pressed: 12,
281
+ checkedRound: 16
190
282
  },
191
283
  lg: {
192
284
  px: 96,
193
285
  icon: 32,
194
- squareRadius: "rounded-xl"
286
+ squareRadius: "rounded-xl",
287
+ square: 28,
288
+ pressed: 16,
289
+ checkedRound: 28
195
290
  },
196
291
  xl: {
197
292
  px: 136,
198
293
  icon: 40,
199
- squareRadius: "rounded-xl"
294
+ squareRadius: "rounded-xl",
295
+ square: 28,
296
+ pressed: 16,
297
+ checkedRound: 28
200
298
  }
201
- }, a = o(() => typeof n.size == "number" ? {
202
- px: n.size,
203
- icon: Math.round(n.size * .55),
204
- squareRadius: "rounded-md"
205
- } : i[n.size] ?? i.sm), c = o(() => {
206
- switch (n.variant) {
299
+ }, u = o(() => typeof r.size == "number" ? {
300
+ px: r.size,
301
+ icon: Math.round(r.size * .55),
302
+ squareRadius: "rounded-md",
303
+ square: 12,
304
+ pressed: 8,
305
+ checkedRound: 12
306
+ } : l[r.size] ?? l.sm), d = w(null), p = w(!1);
307
+ function m() {
308
+ let e = u.value, t = e.px / 2;
309
+ return p.value ? e.pressed : r.checked ? r.shape === "squared" ? t : e.checkedRound : r.shape === "squared" ? e.square : t;
310
+ }
311
+ Z(() => a.value ? [m()] : [], (e) => {
312
+ d.value instanceof HTMLElement && (d.value.style.borderRadius = e.length ? `${e[0]}px` : "");
313
+ }, X);
314
+ function h() {
315
+ a.value && !r.disabled && (p.value = !0);
316
+ }
317
+ function g() {
318
+ p.value = !1;
319
+ }
320
+ function y() {
321
+ a.value && !r.disabled && i("update:checked", !r.checked);
322
+ }
323
+ let b = o(() => {
324
+ if (r.variant === "outlined" && r.checked) return "disabled:bg-on-surface/10";
325
+ switch (r.variant) {
207
326
  case "filled":
208
327
  case "tonal": return "disabled:bg-on-surface/10";
209
328
  default: return "";
210
329
  }
211
- }), l = o(() => n.shape === "squared" ? a.value.squareRadius : "rounded-full");
212
- function u(e) {
213
- if (n.disabled) return;
214
- let t = e.currentTarget, r = t.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = document.createElement("span");
215
- a.className = "m3-ripple", a.style.cssText = `width:${i}px;height:${i}px;top:${e.clientY - r.top - i / 2}px;left:${e.clientX - r.left - i / 2}px`, t.appendChild(a), a.addEventListener("animationend", () => a.remove(), { once: !0 });
216
- }
217
- let d = o(() => {
218
- switch (n.variant) {
330
+ }), x = o(() => r.shape === "squared" ? u.value.squareRadius : "rounded-full"), C = o(() => {
331
+ let e = r.checked;
332
+ switch (r.variant) {
333
+ case "filled": return e ? "bg-primary text-on-primary" : "bg-surface-container text-on-surface-variant";
334
+ case "tonal": return e ? "bg-secondary text-on-secondary" : "bg-secondary-container text-on-secondary-container";
335
+ case "outlined": return e ? "bg-inverse-surface text-inverse-on-surface" : "border border-current text-on-surface-variant";
336
+ default: return e ? "text-primary" : "text-on-surface-variant";
337
+ }
338
+ }), T = o(() => {
339
+ if (a.value) return C.value;
340
+ switch (r.variant) {
219
341
  case "filled": return "bg-primary text-on-primary";
220
342
  case "tonal": return "bg-secondary-container text-on-secondary-container";
221
343
  case "outlined": return "border border-current text-on-surface-variant";
222
344
  default: return "text-on-surface-variant";
223
345
  }
224
346
  });
225
- return (n, i) => (S(), s(D(r.value), {
226
- to: e.to || void 0,
227
- type: e.to ? void 0 : "button",
347
+ return (n, r) => N((S(), s(D(c.value), {
348
+ ref_key: "rootEl",
349
+ ref: d,
350
+ to: c.value === "RouterLink" ? e.to : void 0,
351
+ type: c.value === "RouterLink" ? void 0 : "button",
228
352
  "aria-label": e.label || void 0,
353
+ "aria-pressed": a.value ? e.checked : void 0,
229
354
  disabled: e.disabled,
230
355
  class: _([
231
- re,
232
- l.value,
233
- d.value,
234
- c.value
356
+ oe,
357
+ x.value,
358
+ T.value,
359
+ b.value
235
360
  ]),
236
361
  style: v({
237
- width: `${a.value.px}px`,
238
- height: `${a.value.px}px`
362
+ width: `${u.value.px}px`,
363
+ height: `${u.value.px}px`
239
364
  }),
240
- onPointerdown: u
365
+ onPointerdown: h,
366
+ onPointerup: g,
367
+ onPointerleave: g,
368
+ onPointercancel: g,
369
+ onClick: y
241
370
  }, {
242
371
  default: M(() => [f(t, {
243
- name: e.icon,
244
- size: a.value.icon
245
- }, null, 8, ["name", "size"])]),
372
+ name: e.checked && e.checkedIcon ? e.checkedIcon : e.icon,
373
+ size: u.value.icon,
374
+ filled: !!e.checked
375
+ }, null, 8, [
376
+ "name",
377
+ "size",
378
+ "filled"
379
+ ])]),
246
380
  _: 1
247
381
  }, 40, [
248
382
  "to",
249
383
  "type",
250
384
  "aria-label",
385
+ "aria-pressed",
251
386
  "disabled",
252
387
  "class",
253
388
  "style"
254
- ]));
389
+ ])), [[k(L), {
390
+ disabled: e.disabled,
391
+ color: e.rippleColor
392
+ }]]);
255
393
  }
256
- }), G = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", K = /* @__PURE__ */ p({
394
+ }), Q = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", ce = /* @__PURE__ */ p({
257
395
  __name: "MButton",
258
396
  props: {
259
397
  variant: { default: "filled" },
@@ -271,7 +409,8 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
271
409
  iconPos: { default: "leading" },
272
410
  size: { default: "sm" },
273
411
  shape: { default: "rounded" },
274
- to: {}
412
+ to: {},
413
+ rippleColor: {}
275
414
  },
276
415
  setup(e) {
277
416
  let n = ["primary", "error"], i = e, a = o(() => i.to ? "RouterLink" : "button"), u = o(() => !!i.color && !n.includes(i.color)), d = o(() => {
@@ -351,28 +490,22 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
351
490
  default: return "";
352
491
  }
353
492
  });
354
- function T(e) {
355
- if (i.disabled || i.loading) return;
356
- let t = e.currentTarget, n = t.getBoundingClientRect(), r = Math.max(n.width, n.height) * 2, a = document.createElement("span");
357
- a.className = "m3-ripple", a.style.cssText = `width:${r}px;height:${r}px;top:${e.clientY - n.top - r / 2}px;left:${e.clientX - n.left - r / 2}px`, t.appendChild(a), a.addEventListener("animationend", () => a.remove(), { once: !0 });
358
- }
359
- return (n, i) => (S(), s(D(a.value), {
493
+ return (n, i) => N((S(), s(D(a.value), {
360
494
  to: e.to || void 0,
361
495
  type: e.to ? void 0 : e.type,
362
496
  disabled: e.disabled || e.loading,
363
497
  class: _([
364
- G,
498
+ Q,
365
499
  C.value,
366
500
  g.value,
367
501
  x.value,
368
502
  w.value,
369
503
  p.value
370
504
  ]),
371
- style: v(d.value),
372
- onPointerdown: T
505
+ style: v(d.value)
373
506
  }, {
374
507
  default: M(() => [
375
- e.iconPos === "leading" ? (S(), l(r, { key: 0 }, [e.loading ? (S(), s(R, {
508
+ e.iconPos === "leading" ? (S(), l(r, { key: 0 }, [e.loading ? (S(), s(W, {
376
509
  key: 0,
377
510
  size: b.value
378
511
  }, null, 8, ["size"])) : e.icon ? (S(), s(t, {
@@ -381,7 +514,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
381
514
  size: y.value
382
515
  }, null, 8, ["name", "size"])) : c("", !0)], 64)) : c("", !0),
383
516
  E(n.$slots, "default"),
384
- e.iconPos === "trailing" ? (S(), l(r, { key: 1 }, [e.loading ? (S(), s(R, {
517
+ e.iconPos === "trailing" ? (S(), l(r, { key: 1 }, [e.loading ? (S(), s(W, {
385
518
  key: 0,
386
519
  size: b.value
387
520
  }, null, 8, ["size"])) : e.icon ? (S(), s(t, {
@@ -391,33 +524,36 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
391
524
  }, null, 8, ["name", "size"])) : c("", !0)], 64)) : c("", !0)
392
525
  ]),
393
526
  _: 3
394
- }, 40, [
527
+ }, 8, [
395
528
  "to",
396
529
  "type",
397
530
  "disabled",
398
531
  "class",
399
532
  "style"
400
- ]));
533
+ ])), [[k(L), {
534
+ disabled: e.disabled || e.loading,
535
+ color: e.rippleColor
536
+ }]]);
401
537
  }
402
- }), q = { class: "relative px-6 pt-6 pb-2" }, J = {
538
+ }), le = { class: "relative px-6 pt-6 pb-2" }, ue = {
403
539
  key: 0,
404
540
  class: "absolute right-4 top-4"
405
- }, Y = {
541
+ }, de = {
406
542
  key: 1,
407
543
  class: "mb-4 flex justify-center text-secondary"
408
- }, X = {
544
+ }, fe = {
409
545
  key: 0,
410
546
  class: "shrink-0 border-t border-outline-variant"
411
- }, ie = {
547
+ }, pe = {
412
548
  key: 1,
413
549
  class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
414
- }, ae = {
550
+ }, me = {
415
551
  key: 0,
416
552
  class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
417
- }, Z = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, oe = { class: "flex-1 text-title-large font-medium text-on-surface" }, se = {
553
+ }, he = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, ge = { class: "flex-1 text-title-large font-medium text-on-surface" }, _e = {
418
554
  key: 1,
419
555
  class: "flex items-center gap-2"
420
- }, Q = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ce = /*#__PURE__*/ n(/* @__PURE__ */ p({
556
+ }, ve = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ye = /*#__PURE__*/ n(/* @__PURE__ */ p({
421
557
  __name: "MDialog",
422
558
  props: {
423
559
  modelValue: { type: Boolean },
@@ -450,7 +586,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
450
586
  function T(e) {
451
587
  e.key === "Escape" && C();
452
588
  }
453
- let D = w(), A = w(), j = w(!1), P;
589
+ let D = w(), A = w(), j = w(!1), N;
454
590
  function F() {
455
591
  let e = D.value;
456
592
  if (!e) {
@@ -460,24 +596,24 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
460
596
  j.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1;
461
597
  }
462
598
  return ee(() => r.modelValue, async (e) => {
463
- e ? (document.addEventListener("keydown", T), document.body.style.overflow = "hidden", await g(), F(), P = new ResizeObserver(F), D.value && P.observe(D.value), A.value && P.observe(A.value)) : (document.removeEventListener("keydown", T), document.body.style.overflow = "", P?.disconnect(), P = void 0);
599
+ e ? (document.addEventListener("keydown", T), document.body.style.overflow = "hidden", await g(), F(), N = new ResizeObserver(F), D.value && N.observe(D.value), A.value && N.observe(A.value)) : (document.removeEventListener("keydown", T), document.body.style.overflow = "", N?.disconnect(), N = void 0);
464
600
  }), x(() => {
465
- document.removeEventListener("keydown", T), P?.disconnect();
601
+ document.removeEventListener("keydown", T), N?.disconnect();
466
602
  }), (e, n) => (S(), s(i, { to: "body" }, [t.fullscreen ? (S(), s(a, {
467
603
  key: 1,
468
604
  name: "m3-dialog-fs",
469
605
  appear: ""
470
606
  }, {
471
- default: M(() => [t.modelValue ? (S(), l("div", ae, [u("div", Z, [
472
- t.persistent ? c("", !0) : (S(), s(W, {
607
+ default: M(() => [t.modelValue ? (S(), l("div", me, [u("div", he, [
608
+ t.persistent ? c("", !0) : (S(), s(se, {
473
609
  key: 0,
474
610
  icon: "close",
475
611
  label: t.closeLabel ?? k(p).close,
476
612
  onClick: C
477
613
  }, null, 8, ["label"])),
478
- u("h2", oe, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)]),
479
- e.$slots.actions ? (S(), l("div", se, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
480
- ]), u("div", Q, [E(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
614
+ u("h2", ge, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)]),
615
+ e.$slots.actions ? (S(), l("div", _e, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
616
+ ]), u("div", ve, [E(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
481
617
  _: 3
482
618
  })) : (S(), s(a, {
483
619
  key: 0,
@@ -487,18 +623,18 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
487
623
  default: M(() => [t.modelValue ? (S(), l("div", {
488
624
  key: 0,
489
625
  class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
490
- onClick: N(C, ["self"])
626
+ onClick: P(C, ["self"])
491
627
  }, [u("div", {
492
628
  class: _(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", h.value]),
493
629
  style: v(y.value)
494
630
  }, [
495
- u("div", q, [
496
- t.closable && !t.persistent ? (S(), l("div", J, [f(W, {
631
+ u("div", le, [
632
+ t.closable && !t.persistent ? (S(), l("div", ue, [f(se, {
497
633
  icon: "close",
498
634
  label: t.closeLabel ?? k(p).close,
499
635
  onClick: C
500
636
  }, null, 8, ["label"])])) : c("", !0),
501
- e.$slots.icon ? (S(), l("div", Y, [E(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
637
+ e.$slots.icon ? (S(), l("div", de, [E(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
502
638
  u("h2", { class: _(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]]) }, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)], 2)
503
639
  ]),
504
640
  u("div", {
@@ -510,25 +646,25 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
510
646
  ref_key: "contentInnerEl",
511
647
  ref: A
512
648
  }, [E(e.$slots, "default", {}, void 0, !0)], 512)], 34),
513
- j.value && e.$slots.actions ? (S(), l("div", X)) : c("", !0),
514
- e.$slots.actions ? (S(), l("div", ie, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
649
+ j.value && e.$slots.actions ? (S(), l("div", fe)) : c("", !0),
650
+ e.$slots.actions ? (S(), l("div", pe, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
515
651
  ], 6)])) : c("", !0)]),
516
652
  _: 3
517
653
  }))]));
518
654
  }
519
- }), [["__scopeId", "data-v-0aac9ebd"]]), le = { class: "my-1 border-outline-variant" }, ue = /* @__PURE__ */ p({
655
+ }), [["__scopeId", "data-v-0aac9ebd"]]), be = { class: "my-1 border-outline-variant" }, xe = /* @__PURE__ */ p({
520
656
  __name: "MMenuDivider",
521
657
  props: { gap: {
522
658
  type: Boolean,
523
659
  default: !1
524
660
  } },
525
661
  setup(e) {
526
- return (e, t) => (S(), l("hr", le));
662
+ return (e, t) => (S(), l("hr", be));
527
663
  }
528
- }), de = { class: "flex-1 truncate" }, fe = { key: "root" }, pe = {
664
+ }), Se = { class: "flex-1 truncate" }, Ce = { key: "root" }, we = {
529
665
  key: 0,
530
666
  class: "flex flex-col gap-1 px-1.5"
531
- }, me = { class: "overflow-hidden rounded-lg bg-surface-container" }, he = 220, $ = 1 / 240, ge = /* @__PURE__ */ p({
667
+ }, Te = { class: "overflow-hidden rounded-lg bg-surface-container" }, Ee = 220, $ = 1 / 240, De = /* @__PURE__ */ p({
532
668
  inheritAttrs: !1,
533
669
  __name: "MMenu",
534
670
  props: {
@@ -544,7 +680,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
544
680
  return t;
545
681
  }
546
682
  function O(e) {
547
- if (e.type !== ue) return !1;
683
+ if (e.type !== xe) return !1;
548
684
  let t = e.props?.gap;
549
685
  return t === "" || t === !0 || t === "true";
550
686
  }
@@ -554,7 +690,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
554
690
  for (let n of e) O(n) ? t.push([]) : t[t.length - 1].push(n);
555
691
  return t.filter((e) => e.length > 0);
556
692
  }), A = o(() => !!k.value && k.value.length > 1), N = w([]), P = o(() => N.value[N.value.length - 1]), F = w("forward");
557
- function I(e, t) {
693
+ function te(e, t) {
558
694
  let n = F.value === "forward" ? 1 : -1, r = e.animate([{
559
695
  transform: `translateX(${n * 100}%)`,
560
696
  opacity: .4
@@ -562,12 +698,12 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
562
698
  transform: "translateX(0%)",
563
699
  opacity: 1
564
700
  }], {
565
- duration: he,
701
+ duration: Ee,
566
702
  easing: "cubic-bezier(0.05,0.7,0.1,1)"
567
703
  });
568
704
  r.onfinish = t;
569
705
  }
570
- function te(e, t) {
706
+ function I(e, t) {
571
707
  let n = F.value === "forward" ? -1 : 1, r = e;
572
708
  r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
573
709
  let i = r.animate([{
@@ -577,13 +713,13 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
577
713
  transform: `translateX(${n * 100}%)`,
578
714
  opacity: .4
579
715
  }], {
580
- duration: he,
716
+ duration: Ee,
581
717
  easing: "cubic-bezier(0.3,0,0.8,0.15)"
582
718
  });
583
719
  i.onfinish = t;
584
720
  }
585
721
  let L = null;
586
- function ne() {
722
+ function R() {
587
723
  if (L) return L;
588
724
  let e = [], t = .8, n = 0, r = 0, i = 0;
589
725
  for (let a = 0; a < 1 && (e.push({
@@ -595,10 +731,10 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
595
731
  alpha: 1
596
732
  }), L = e, e;
597
733
  }
598
- let R = 0, z = null, B = null;
599
- function V(e, t, n) {
600
- z?.();
601
- let r = e, i = ne(), a = i.length - 1, o = n ? 1 : -1, s = n ? a : 0, c = 0, l = 0, u = !1;
734
+ let z = 0, B = null, V = null;
735
+ function H(e, t, n) {
736
+ B?.();
737
+ let r = e, i = R(), a = i.length - 1, o = n ? 1 : -1, s = n ? a : 0, c = 0, l = 0, u = !1;
602
738
  function d(e) {
603
739
  let t = i[Math.round(Math.max(0, Math.min(a, e)))];
604
740
  r.style.transform = `scale(${t.scale})`, r.style.opacity = String(Math.min(1, Math.max(0, t.alpha)));
@@ -606,29 +742,29 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
606
742
  function f(e) {
607
743
  if (u) return;
608
744
  let r = c ? (e - c) / 1e3 / $ : 1;
609
- if (c = e, R = Math.max(0, Math.min(a, R + o * r)), d(R), n && R >= s || !n && R <= s) {
610
- z = null, B = null, t();
745
+ if (c = e, z = Math.max(0, Math.min(a, z + o * r)), d(z), n && z >= s || !n && z <= s) {
746
+ B = null, V = null, t();
611
747
  return;
612
748
  }
613
749
  l = requestAnimationFrame(f);
614
750
  }
615
- z = () => {
751
+ B = () => {
616
752
  u = !0, cancelAnimationFrame(l);
617
- }, B = n ? null : () => {
618
- z?.(), z = null, B = null, t();
619
- }, d(R), l = requestAnimationFrame(f);
620
- }
621
- function H(e, t) {
622
- V(e, t, !0);
753
+ }, V = n ? null : () => {
754
+ B?.(), B = null, V = null, t();
755
+ }, d(z), l = requestAnimationFrame(f);
623
756
  }
624
757
  function U(e, t) {
625
- V(e, t, !1);
758
+ H(e, t, !0);
626
759
  }
627
- function re(e) {
628
- F.value = "forward", N.value.push(e), g(() => Z());
760
+ function W(e, t) {
761
+ H(e, t, !1);
629
762
  }
630
- function W() {
631
- F.value = "backward", N.value.pop(), g(() => Z());
763
+ function ne(e) {
764
+ F.value = "forward", N.value.push(e), g(() => ae());
765
+ }
766
+ function re() {
767
+ F.value = "backward", N.value.pop(), g(() => ae());
632
768
  }
633
769
  let G = w(!1), K = w(null), q = w(null), J = w({}), Y = m("m-menu-panel-registry", /* @__PURE__ */ new Set());
634
770
  C("m-menu-panel-registry", Y), ee(q, (e, t) => {
@@ -643,27 +779,27 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
643
779
  let e = K.value.getBoundingClientRect(), t = window.innerHeight - e.bottom - 8, n = t < 200 && e.top > t, r = { maxHeight: `${Math.min(n ? e.top - 12 : t, 400)}px` };
644
780
  n ? r.bottom = `${window.innerHeight - e.top + 4}px` : r.top = `${e.bottom + 4}px`, d.align === "right" ? r.right = `${window.innerWidth - e.right}px` : r.left = `${e.left}px`, J.value = r;
645
781
  }
646
- function ae() {
782
+ function Z() {
647
783
  return q.value ? Array.from(q.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
648
784
  }
649
- function Z() {
650
- g(() => ae()[0]?.focus());
785
+ function ae() {
786
+ g(() => Z()[0]?.focus());
651
787
  }
652
788
  function oe(e) {
653
- let t = ae();
789
+ let t = Z();
654
790
  if (!t.length) return;
655
791
  let n = t.indexOf(document.activeElement);
656
792
  (n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
657
793
  }
658
794
  function se() {
659
- G.value ? X?.current === Q && (X.current = null) : (X && X.current && X.current !== Q && X.current(), X && (X.current = Q), ie(), N.value = []), G.value = !G.value, G.value && Z();
795
+ G.value ? X?.current === Q && (X.current = null) : (X && X.current && X.current !== Q && X.current(), X && (X.current = Q), ie(), N.value = []), G.value = !G.value, G.value && ae();
660
796
  }
661
797
  function Q() {
662
798
  X?.current === Q && (X.current = null), G.value = !1;
663
799
  }
664
800
  C("m-menu-close", Q), C("m-menu-nav", {
665
801
  mode: d.submenuMode,
666
- push: re
802
+ push: ne
667
803
  }), n({
668
804
  close: Q,
669
805
  open: G
@@ -681,19 +817,19 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
681
817
  for (let e of Y) if (e.contains(t)) return;
682
818
  t.closest?.(".m3-submenu") || Q();
683
819
  }
684
- function ge(e) {
820
+ function ue(e) {
685
821
  if (e.key === "Escape") {
686
- N.value.length ? W() : Q();
822
+ N.value.length ? re() : Q();
687
823
  return;
688
824
  }
689
825
  G.value && (e.key === "ArrowDown" ? (e.preventDefault(), oe(1)) : e.key === "ArrowUp" && (e.preventDefault(), oe(-1)));
690
826
  }
691
827
  b(() => {
692
- document.addEventListener("mousedown", ce), document.addEventListener("keydown", ge), window.addEventListener("scroll", le, !0);
828
+ document.addEventListener("mousedown", ce), document.addEventListener("keydown", ue), window.addEventListener("scroll", le, !0);
693
829
  }), x(() => {
694
- document.removeEventListener("mousedown", ce), document.removeEventListener("keydown", ge), window.removeEventListener("scroll", le, !0), B ? B() : z?.();
830
+ document.removeEventListener("mousedown", ce), document.removeEventListener("keydown", ue), window.removeEventListener("scroll", le, !0), V ? V() : B?.();
695
831
  });
696
- let _e = o(() => d.align === "right" ? "top right" : "top left");
832
+ let de = o(() => d.align === "right" ? "top right" : "top left");
697
833
  return (n, o) => (S(), l(r, null, [u("div", h({
698
834
  ref_key: "triggerEl",
699
835
  ref: K
@@ -702,8 +838,8 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
702
838
  onClick: se
703
839
  }), [E(n.$slots, "trigger", { open: G.value })], 16), (S(), s(i, { to: "body" }, [f(a, {
704
840
  css: !1,
705
- onEnter: H,
706
- onLeave: U
841
+ onEnter: U,
842
+ onLeave: W
707
843
  }, {
708
844
  default: M(() => [G.value ? (S(), l("div", {
709
845
  key: 0,
@@ -712,20 +848,20 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
712
848
  class: _(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "shadow-elevation-2"]]),
713
849
  style: v({
714
850
  ...J.value,
715
- transformOrigin: _e.value
851
+ transformOrigin: de.value
716
852
  })
717
853
  }, [u("div", { class: _(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "bg-surface-container"]]) }, [u("div", {
718
854
  class: "relative overflow-y-auto overscroll-contain py-1",
719
855
  style: v({ maxHeight: J.value.maxHeight })
720
856
  }, [f(a, {
721
857
  css: !1,
722
- onEnter: I,
723
- onLeave: te
858
+ onEnter: te,
859
+ onLeave: I
724
860
  }, {
725
861
  default: M(() => [P.value ? (S(), l("div", { key: N.value.length }, [u("button", {
726
862
  type: "button",
727
863
  class: "flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
728
- onClick: W
864
+ onClick: re
729
865
  }, [
730
866
  f(t, {
731
867
  name: "chevron_left",
@@ -738,20 +874,20 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
738
874
  size: 20,
739
875
  class: "shrink-0 text-on-surface-variant"
740
876
  }, null, 8, ["name"])) : c("", !0),
741
- u("span", de, [(S(), s(D(() => P.value?.header?.())))])
742
- ]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div", fe, [A.value ? (S(), l("div", pe, [(S(!0), l(r, null, T(k.value, (e, t) => (S(), l("div", {
877
+ u("span", Se, [(S(), s(D(() => P.value?.header?.())))])
878
+ ]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div", Ce, [A.value ? (S(), l("div", we, [(S(!0), l(r, null, T(k.value, (e, t) => (S(), l("div", {
743
879
  key: t,
744
880
  class: "rounded-lg shadow-elevation-2"
745
- }, [u("div", me, [(S(), s(D(() => e)))])]))), 128))])) : E(n.$slots, "default", { close: Q }, void 0, void 0, 1)]))]),
881
+ }, [u("div", Te, [(S(), s(D(() => e)))])]))), 128))])) : E(n.$slots, "default", { close: Q }, void 0, void 0, 1)]))]),
746
882
  _: 3
747
883
  })], 4)], 2)], 6)) : c("", !0)]),
748
884
  _: 3
749
885
  })]))], 64));
750
886
  }
751
- }), _e = { class: "flex-1" }, ve = {
752
- key: 1,
887
+ }), Oe = ["data-m3-menu-choice"], ke = { class: "flex-1" }, Ae = {
888
+ key: 2,
753
889
  class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
754
- }, ye = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, be = /* @__PURE__ */ p({
890
+ }, je = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Me = 32, Ne = /* @__PURE__ */ p({
755
891
  __name: "MMenuItem",
756
892
  props: {
757
893
  icon: {},
@@ -767,82 +903,154 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
767
903
  },
768
904
  keepOpen: {
769
905
  type: Boolean,
770
- default: !1
771
- }
906
+ default: void 0
907
+ },
908
+ selected: {
909
+ type: Boolean,
910
+ default: void 0
911
+ },
912
+ checked: {
913
+ type: Boolean,
914
+ default: void 0
915
+ },
916
+ selectedIcon: {}
772
917
  },
773
- emits: ["click"],
918
+ emits: ["click", "update:checked"],
774
919
  setup(e, { emit: n }) {
775
- let r = e, d = n, p = j(), h = o(() => r.to ? "RouterLink" : "button"), g = o(() => !!p.children), y = m("m-menu-close", null), b = m("m-menu-nav", null), x = w(), C = w(!1), T = w({});
776
- function A() {
777
- if (!x.value) return;
778
- let e = x.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
779
- T.value = {
920
+ let r = e, d = n, p = o(() => r.checked !== void 0), h = o(() => p.value || r.selected !== void 0), y = o(() => !!(r.checked ?? r.selected)), C = o(() => h.value && !r.icon), T = o(() => r.selectedIcon ?? (r.icon ? void 0 : "check")), A = w("single");
921
+ function N() {
922
+ let e = V.value;
923
+ if (!e || !h.value) return;
924
+ let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
925
+ A.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
926
+ }
927
+ function P() {
928
+ if (y.value) return [
929
+ 12,
930
+ 12,
931
+ 12,
932
+ 12
933
+ ];
934
+ let e = A.value === "first" ? 12 : 4, t = A.value === "last" ? 12 : 4;
935
+ return [
936
+ e,
937
+ e,
938
+ t,
939
+ t
940
+ ];
941
+ }
942
+ let { snap: F } = Z(() => h.value ? [...P(), C.value && y.value ? Me : 0] : [], ([e, t, n, r, i]) => {
943
+ let a = H.value instanceof HTMLElement ? H.value : H.value?.$el;
944
+ a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), U.value && i !== void 0 && (U.value.style.width = `${i}px`);
945
+ }, J);
946
+ ee(A, () => F());
947
+ let te = null;
948
+ b(() => {
949
+ N();
950
+ let e = V.value?.parentElement;
951
+ e && (te = new MutationObserver(N), te.observe(e, { childList: !0 }));
952
+ }), x(() => te?.disconnect()), ee(h, () => g(N)), Z(() => C.value ? [+!!y.value] : [], ([e]) => {
953
+ U.value && e !== void 0 && (U.value.style.opacity = String(e));
954
+ }, Y);
955
+ let I = j(), L = o(() => r.to ? "RouterLink" : "button"), R = o(() => !!I.children), z = m("m-menu-close", null), B = m("m-menu-nav", null), V = w(), H = w(), U = w(), W = w(!1), ne = w({});
956
+ function re() {
957
+ if (!V.value) return;
958
+ let e = V.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
959
+ ne.value = {
780
960
  position: "fixed",
781
961
  top: `${e.top}px`,
782
962
  ...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
783
963
  zIndex: "501"
784
964
  };
785
965
  }
786
- function ee() {
787
- if (C.value) {
788
- C.value = !1;
966
+ function G() {
967
+ if (W.value) {
968
+ W.value = !1;
789
969
  return;
790
970
  }
791
- A(), C.value = !0;
971
+ re(), W.value = !0;
792
972
  }
793
- function N() {
973
+ function K() {
794
974
  if (!r.disabled) {
795
- if (g.value) {
796
- b?.mode === "push" ? b.push({
975
+ if (R.value) {
976
+ B?.mode === "push" ? B.push({
797
977
  icon: r.icon,
798
- header: p.default,
799
- content: p.children
800
- }) : ee();
978
+ header: I.default,
979
+ content: I.children
980
+ }) : G();
801
981
  return;
802
982
  }
803
- d("click"), r.keepOpen || y?.();
983
+ p.value && d("update:checked", !r.checked), d("click"), (r.keepOpen ?? p.value) || z?.();
804
984
  }
805
985
  }
806
- function P(e) {
807
- e.pointerType === "mouse" && g.value && !r.disabled && (A(), C.value = !0);
986
+ function q(e) {
987
+ e.pointerType === "mouse" && R.value && !r.disabled && (re(), W.value = !0);
808
988
  }
809
- function F(e) {
810
- e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (C.value = !1));
989
+ function X(e) {
990
+ e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (W.value = !1));
811
991
  }
812
- function I(e) {
992
+ function ie(e) {
813
993
  if (e.pointerType !== "mouse") return;
814
994
  let t = e.relatedTarget;
815
- t?.closest(".m3-submenu") || x.value?.contains(t) || (C.value = !1);
995
+ t?.closest(".m3-submenu") || V.value?.contains(t) || (W.value = !1);
816
996
  }
817
997
  return (n, r) => (S(), l("div", {
818
998
  ref_key: "itemEl",
819
- ref: x,
820
- onPointerenter: P,
821
- onPointerleave: F
822
- }, [(S(), s(D(h.value), {
999
+ ref: V,
1000
+ "data-m3-menu-choice": h.value || void 0,
1001
+ onPointerenter: q,
1002
+ onPointerleave: X
1003
+ }, [(S(), s(D(L.value), {
1004
+ ref_key: "controlEl",
1005
+ ref: H,
823
1006
  to: e.to || void 0,
824
1007
  type: e.to ? void 0 : "button",
825
- class: _(["flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", [
1008
+ role: h.value ? p.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
1009
+ "aria-checked": h.value ? y.value : void 0,
1010
+ class: _(["flex items-center gap-3 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", h.value ? [
1011
+ "relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity",
1012
+ y.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
1013
+ e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
1014
+ ] : [
1015
+ "w-full px-4",
826
1016
  e.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
827
1017
  !e.disabled && e.danger ? "text-error hover:bg-error/8" : "",
828
1018
  !e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
829
1019
  ]]),
830
1020
  disabled: e.disabled || void 0,
831
- "aria-haspopup": g.value ? "menu" : void 0,
832
- "aria-expanded": g.value ? C.value : void 0,
833
- onClick: N
1021
+ "aria-haspopup": R.value ? "menu" : void 0,
1022
+ "aria-expanded": R.value ? W.value : void 0,
1023
+ onClick: K
834
1024
  }, {
835
1025
  default: M(() => [
836
- e.icon ? (S(), s(t, {
1026
+ C.value ? (S(), l("span", {
837
1027
  key: 0,
838
- name: e.icon,
1028
+ ref_key: "iconSlotEl",
1029
+ ref: U,
1030
+ class: "-mr-3 flex shrink-0 overflow-hidden",
1031
+ style: {
1032
+ width: "0",
1033
+ opacity: "0"
1034
+ }
1035
+ }, [f(t, {
1036
+ name: T.value,
1037
+ size: 20,
1038
+ class: "shrink-0"
1039
+ }, null, 8, ["name"])], 512)) : e.icon ? (S(), s(t, {
1040
+ key: 1,
1041
+ name: y.value && T.value ? T.value : e.icon,
1042
+ filled: y.value && !T.value,
839
1043
  size: 20,
840
- class: _(["shrink-0", e.danger ? "text-error" : "text-on-surface-variant"])
841
- }, null, 8, ["name", "class"])) : c("", !0),
842
- u("span", _e, [E(n.$slots, "default")]),
843
- e.shortcut && !g.value ? (S(), l("span", ve, O(e.shortcut), 1)) : c("", !0),
844
- g.value ? (S(), s(t, {
845
- key: 2,
1044
+ class: _(["shrink-0", h.value ? y.value ? "" : "text-on-surface-variant" : e.danger ? "text-error" : "text-on-surface-variant"])
1045
+ }, null, 8, [
1046
+ "name",
1047
+ "filled",
1048
+ "class"
1049
+ ])) : c("", !0),
1050
+ u("span", ke, [E(n.$slots, "default")]),
1051
+ e.shortcut && !R.value ? (S(), l("span", Ae, O(e.shortcut), 1)) : c("", !0),
1052
+ R.value ? (S(), s(t, {
1053
+ key: 3,
846
1054
  name: "chevron_right",
847
1055
  size: 18,
848
1056
  class: "shrink-0 text-on-surface-variant"
@@ -852,11 +1060,13 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
852
1060
  }, 8, [
853
1061
  "to",
854
1062
  "type",
1063
+ "role",
1064
+ "aria-checked",
855
1065
  "class",
856
1066
  "disabled",
857
1067
  "aria-haspopup",
858
1068
  "aria-expanded"
859
- ])), g.value && k(b)?.mode !== "push" ? (S(), s(i, {
1069
+ ])), R.value && k(B)?.mode !== "push" ? (S(), s(i, {
860
1070
  key: 0,
861
1071
  to: "body"
862
1072
  }, [f(a, {
@@ -865,41 +1075,41 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
865
1075
  "leave-active-class": "transition-opacity duration-75",
866
1076
  "leave-to-class": "opacity-0"
867
1077
  }, {
868
- default: M(() => [C.value ? (S(), l("div", {
1078
+ default: M(() => [W.value ? (S(), l("div", {
869
1079
  key: 0,
870
1080
  class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
871
- style: v(T.value),
872
- onPointerleave: I
873
- }, [u("div", ye, [E(n.$slots, "children")])], 36)) : c("", !0)]),
1081
+ style: v(ne.value),
1082
+ onPointerleave: ie
1083
+ }, [u("div", je, [E(n.$slots, "children")])], 36)) : c("", !0)]),
874
1084
  _: 3
875
- })])) : c("", !0)], 544));
1085
+ })])) : c("", !0)], 40, Oe));
876
1086
  }
877
- }), xe = { class: "flex flex-col gap-1" }, Se = [
1087
+ }), Pe = { class: "flex flex-col gap-1" }, Fe = [
878
1088
  "id",
879
1089
  "value",
880
1090
  "rows",
881
1091
  "disabled",
882
1092
  "required"
883
- ], Ce = [
1093
+ ], Ie = [
884
1094
  "id",
885
1095
  "type",
886
1096
  "value",
887
1097
  "disabled",
888
1098
  "required",
889
1099
  "autocomplete"
890
- ], we = ["for"], Te = {
1100
+ ], Le = ["for"], Re = {
891
1101
  key: 0,
892
1102
  class: "text-error"
893
- }, Ee = {
1103
+ }, ze = {
894
1104
  key: 3,
895
1105
  class: "absolute right-2 top-1/2 -translate-y-1/2"
896
- }, De = {
1106
+ }, Be = {
897
1107
  key: 0,
898
1108
  class: "px-4 text-body-small text-error"
899
- }, Oe = {
1109
+ }, Ve = {
900
1110
  key: 1,
901
1111
  class: "px-4 text-body-small text-on-surface-variant"
902
- }, ke = /* @__PURE__ */ p({
1112
+ }, He = /* @__PURE__ */ p({
903
1113
  __name: "MTextField",
904
1114
  props: {
905
1115
  modelValue: {},
@@ -924,7 +1134,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
924
1134
  },
925
1135
  emits: ["update:modelValue", "debounced"],
926
1136
  setup(e, { emit: n }) {
927
- let r = e, i = n, a = A(), s = j(), p = w(null), { resolvedFieldBg: m } = H(p, () => r.fieldBg), { debounced: h, cancel: g } = U((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
1137
+ let r = e, i = n, a = A(), s = j(), p = w(null), { resolvedFieldBg: m } = K(p, () => r.fieldBg), { debounced: h, cancel: g } = q((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
928
1138
  let e = !!s.trailing || r.clearable, t = r.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", i = r.multiline ? "resize-y min-h-[56px]" : "h-14", a = [
929
1139
  "peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
930
1140
  "transition-[border-color,border-width] duration-150",
@@ -971,7 +1181,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
971
1181
  let t = e.target;
972
1182
  i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
973
1183
  }
974
- return (n, r) => (S(), l("div", xe, [u("div", {
1184
+ return (n, r) => (S(), l("div", Pe, [u("div", {
975
1185
  ref_key: "fieldBgEl",
976
1186
  ref: p,
977
1187
  class: _(["relative", e.variant === "outlined" ? "mt-2" : ""]),
@@ -994,7 +1204,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
994
1204
  placeholder: " ",
995
1205
  class: _(b.value),
996
1206
  onInput: C
997
- }, null, 42, Se)) : (S(), l("input", {
1207
+ }, null, 42, Fe)) : (S(), l("input", {
998
1208
  key: 2,
999
1209
  id: k(a),
1000
1210
  type: e.type,
@@ -1005,12 +1215,12 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
1005
1215
  placeholder: " ",
1006
1216
  class: _(b.value),
1007
1217
  onInput: C
1008
- }, null, 42, Ce)),
1218
+ }, null, 42, Ie)),
1009
1219
  u("label", {
1010
1220
  for: k(a),
1011
1221
  class: _(x.value)
1012
- }, [d(O(e.label), 1), e.required ? (S(), l("span", Te, "\xA0*")) : c("", !0)], 10, we),
1013
- n.$slots.trailing ? (S(), l("div", Ee, [E(n.$slots, "trailing")])) : y.value ? (S(), l("button", {
1222
+ }, [d(O(e.label), 1), e.required ? (S(), l("span", Re, "\xA0*")) : c("", !0)], 10, Le),
1223
+ n.$slots.trailing ? (S(), l("div", ze, [E(n.$slots, "trailing")])) : y.value ? (S(), l("button", {
1014
1224
  key: 4,
1015
1225
  type: "button",
1016
1226
  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",
@@ -1021,10 +1231,10 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
1021
1231
  name: "close",
1022
1232
  size: 18
1023
1233
  })])) : c("", !0)
1024
- ], 6), e.error && e.errorLabel ? (S(), l("p", De, O(e.errorLabel), 1)) : e.hint ? (S(), l("p", Oe, O(e.hint), 1)) : c("", !0)]));
1234
+ ], 6), e.error && e.errorLabel ? (S(), l("p", Be, O(e.errorLabel), 1)) : e.hint ? (S(), l("p", Ve, O(e.hint), 1)) : c("", !0)]));
1025
1235
  }
1026
1236
  });
1027
1237
  //#endregion
1028
- export { ce as a, U as c, ue as i, H as l, be as n, K as o, ge as r, W as s, ke as t, R as u };
1238
+ export { ye as a, J as c, q as d, K as f, xe as i, ae as l, L as m, Ne as n, ce as o, W as p, De as r, se as s, He as t, Z as u };
1029
1239
 
1030
- //# sourceMappingURL=MTextField-Ck0oWDMk.js.map
1240
+ //# sourceMappingURL=MTextField-DKtgPymd.js.map