@m3ui-vue/m3ui-vue 1.1.1 → 1.1.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 (90) hide show
  1. package/dist/API.md +135 -5
  2. package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
  3. package/dist/MIcon-Bxh9j135.js.map +1 -0
  4. package/dist/{MMenuItem-BOkcVtEe.js → MMenuItem-BckcR0nW.js} +6 -6
  5. package/dist/MMenuItem-BckcR0nW.js.map +1 -0
  6. package/dist/{MSlider-BXsBv0ox.js → MSlider-LyH_gy8D.js} +56 -47
  7. package/dist/MSlider-LyH_gy8D.js.map +1 -0
  8. package/dist/{MTextField-rML9jnXs.js → MTextField-FCPOTB0o.js} +65 -64
  9. package/dist/{MTextField-rML9jnXs.js.map → MTextField-FCPOTB0o.js.map} +1 -1
  10. package/dist/api.json +1 -1
  11. package/dist/code-editor.js +2 -2
  12. package/dist/components/MAnimatedNumber.vue.d.ts +27 -0
  13. package/dist/components/MIcon.vue.d.ts +2 -0
  14. package/dist/components/MListGroup.vue.d.ts +23 -0
  15. package/dist/components/MScheduler.vue.d.ts +2 -2
  16. package/dist/components/MScheme.vue.d.ts +60 -0
  17. package/dist/components/MSparkline.vue.d.ts +41 -0
  18. package/dist/components/MWindow.vue.d.ts +2 -2
  19. package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
  20. package/dist/composables/_useSegmentRuns.d.ts +8 -0
  21. package/dist/composables/dynamicColor.d.ts +11 -0
  22. package/dist/composables/useColorPalette.d.ts +3 -1
  23. package/dist/composables/useConfetti.d.ts +32 -0
  24. package/dist/composables/useLocale.d.ts +6 -0
  25. package/dist/index.d.ts +7 -1
  26. package/dist/locales/index.js +21 -0
  27. package/dist/locales/index.js.map +1 -1
  28. package/dist/m3ui-vue.css +1 -1
  29. package/dist/m3ui.js +16187 -15377
  30. package/dist/m3ui.js.map +1 -1
  31. package/dist/map.js +45 -45
  32. package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
  33. package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
  34. package/dist/rich-text-editor.js +4 -4
  35. package/dist/styles.css +1 -1
  36. package/dist/terminal.js +1 -1
  37. package/dist/{useLocale-CqQrhWFl.js → useLocale-SfQHnJfp.js} +4 -1
  38. package/dist/useLocale-SfQHnJfp.js.map +1 -0
  39. package/package.json +1 -1
  40. package/src/__tests__/MAnimatedNumber.test.ts +106 -0
  41. package/src/__tests__/MIcon.test.ts +19 -0
  42. package/src/__tests__/MListItemShape.test.ts +34 -0
  43. package/src/__tests__/MScheme.test.ts +107 -0
  44. package/src/__tests__/MSparkline.test.ts +96 -0
  45. package/src/__tests__/iconButtonNames.test.ts +124 -0
  46. package/src/__tests__/ssr.test.ts +1 -0
  47. package/src/__tests__/useConfetti.test.ts +81 -0
  48. package/src/components/MAnimatedNumber.vue +301 -0
  49. package/src/components/MAutocomplete.vue +34 -4
  50. package/src/components/MBottomSheet.vue +1 -0
  51. package/src/components/MDataTable.vue +1 -1
  52. package/src/components/MDialog.vue +2 -0
  53. package/src/components/MIcon.vue +11 -4
  54. package/src/components/MList.vue +8 -30
  55. package/src/components/MListGroup.vue +66 -0
  56. package/src/components/MMaskField.vue +3 -0
  57. package/src/components/MMultiAutocomplete.vue +5 -1
  58. package/src/components/MMultiSelect.vue +19 -9
  59. package/src/components/MScheme.vue +162 -0
  60. package/src/components/MSearchBar.vue +2 -0
  61. package/src/components/MSelect.vue +44 -10
  62. package/src/components/MSideSheet.vue +3 -0
  63. package/src/components/MSimpleCarousel.vue +6 -0
  64. package/src/components/MSparkline.vue +250 -0
  65. package/src/components/MSplitButton.vue +3 -0
  66. package/src/components/MSpotlightSearch.vue +1 -0
  67. package/src/components/MTable.vue +1 -0
  68. package/src/components/MTagInput.vue +4 -0
  69. package/src/components/MTextField.vue +3 -0
  70. package/src/components/MTour.vue +1 -0
  71. package/src/components/MTreeTable.vue +1 -0
  72. package/src/components/_MTreeNode.vue +3 -0
  73. package/src/composables/_useSegmentRuns.ts +39 -0
  74. package/src/composables/dynamicColor.ts +66 -0
  75. package/src/composables/useColorPalette.ts +2 -2
  76. package/src/composables/useConfetti.ts +204 -0
  77. package/src/composables/useLocale.ts +9 -0
  78. package/src/index.ts +7 -1
  79. package/src/locales/de.ts +3 -0
  80. package/src/locales/es.ts +3 -0
  81. package/src/locales/fr.ts +3 -0
  82. package/src/locales/ja.ts +3 -0
  83. package/src/locales/ko.ts +3 -0
  84. package/src/locales/pt.ts +3 -0
  85. package/src/locales/zh.ts +3 -0
  86. package/dist/MIcon-DLOkQduI.js.map +0 -1
  87. package/dist/MMenuItem-BOkcVtEe.js.map +0 -1
  88. package/dist/MSlider-BXsBv0ox.js.map +0 -1
  89. package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
  90. package/dist/useLocale-CqQrhWFl.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { i as e } from "./useLocale-CqQrhWFl.js";
2
- import { t } from "./MIcon-DLOkQduI.js";
1
+ import { i as e } from "./useLocale-SfQHnJfp.js";
2
+ import { t } from "./MIcon-Bxh9j135.js";
3
3
  import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, useSlots as S, watch as C, withCtx as w, withDirectives as T } from "vue";
4
4
  //#region src/directives/vRipple.ts
5
5
  function E(e) {
@@ -38,7 +38,7 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
38
38
  "width",
39
39
  "height",
40
40
  "viewBox"
41
- ], N = ["d", "stroke-dasharray"], P = 3, F = 9, I = /* @__PURE__ */ l({
41
+ ], ee = ["d", "stroke-dasharray"], N = 3, P = 9, F = /* @__PURE__ */ l({
42
42
  __name: "MSpinner",
43
43
  props: {
44
44
  size: { default: 20 },
@@ -49,10 +49,10 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
49
49
  label: {}
50
50
  },
51
51
  setup(t) {
52
- let r = t, i = e(), s = n(() => (r.size / 2 - 1 - P / 2) / 1.25), c = n(() => r.size / 2), l = n(() => {
52
+ let r = t, i = e(), s = n(() => (r.size / 2 - 1 - N / 2) / 1.25), c = n(() => r.size / 2), l = n(() => {
53
53
  let e = c.value, t = s.value, n = t * .08, r = [], i = 0, a = 0, o = 0;
54
54
  for (let s = 0; s <= 216; s++) {
55
- let c = 2 * Math.PI * s / 216 - Math.PI / 2, l = t + n * Math.sin(F * c), u = e + l * Math.cos(c), d = e + l * Math.sin(c);
55
+ let c = 2 * Math.PI * s / 216 - Math.PI / 2, l = t + n * Math.sin(P * c), u = e + l * Math.cos(c), d = e + l * Math.sin(c);
56
56
  s > 0 && (i += Math.sqrt((u - a) ** 2 + (d - o) ** 2)), r.push(`${s === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), a = u, o = d;
57
57
  }
58
58
  let l = i * .58, u = i - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
@@ -81,14 +81,14 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
81
81
  }, [o("path", {
82
82
  d: l.value.path,
83
83
  stroke: "currentColor",
84
- "stroke-width": P,
84
+ "stroke-width": N,
85
85
  "stroke-linecap": "round",
86
86
  "stroke-dasharray": l.value.dash,
87
87
  class: "animate-[m3-wavy-travel_2s_linear_infinite]",
88
88
  style: d({ "--m3-wave-len": l.value.len })
89
- }, null, 12, N)], 12, M)) : (h(), a("span", j))], 12, A));
89
+ }, null, 12, ee)], 12, M)) : (h(), a("span", j))], 12, A));
90
90
  }
91
- }), L = [
91
+ }), I = [
92
92
  "bg-surface-container-highest",
93
93
  "bg-surface-container-high",
94
94
  "bg-surface-container-low",
@@ -115,11 +115,11 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
115
115
  "bg-tertiary",
116
116
  "bg-error"
117
117
  ];
118
- function R(e) {
119
- for (let t of L) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
118
+ function L(e) {
119
+ for (let t of I) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
120
120
  return null;
121
121
  }
122
- function ee(e) {
122
+ function R(e) {
123
123
  if (!e || e === "transparent") return !0;
124
124
  let t = e.match(/^rgba?\(([^)]+)\)$/);
125
125
  if (t) {
@@ -136,7 +136,7 @@ function z(e, t) {
136
136
  function a() {
137
137
  let t = e.value?.parentElement ?? null;
138
138
  for (; t;) {
139
- let e = R(t);
139
+ let e = L(t);
140
140
  if (e) {
141
141
  i(e);
142
142
  return;
@@ -146,7 +146,7 @@ function z(e, t) {
146
146
  return;
147
147
  }
148
148
  let n = getComputedStyle(t).backgroundColor;
149
- if (!ee(n)) {
149
+ if (!R(n)) {
150
150
  i(n);
151
151
  return;
152
152
  }
@@ -534,13 +534,13 @@ var Z = W(.4, 0, .2, 1), Q = "relative inline-flex shrink-0 items-center justify
534
534
  }, $ = {
535
535
  key: 3,
536
536
  class: "absolute right-2 top-1/2 -translate-y-1/2"
537
- }, se = {
537
+ }, se = ["aria-label"], ce = {
538
538
  key: 0,
539
539
  class: "px-4 text-body-small text-error"
540
- }, ce = {
540
+ }, le = {
541
541
  key: 1,
542
542
  class: "px-4 text-body-small text-on-surface-variant"
543
- }, le = /* @__PURE__ */ l({
543
+ }, ue = /* @__PURE__ */ l({
544
544
  __name: "MTextField",
545
545
  props: {
546
546
  modelValue: {},
@@ -564,108 +564,109 @@ var Z = W(.4, 0, .2, 1), Q = "relative inline-flex shrink-0 items-center justify
564
564
  debounce: { default: 0 }
565
565
  },
566
566
  emits: ["update:modelValue", "debounced"],
567
- setup(e, { emit: r }) {
568
- let l = e, f = r, p = x(), m = S(), v = g(null), { resolvedFieldBg: C } = z(v, () => l.fieldBg), { debounced: w, cancel: T } = B((e) => f("debounced", e), l.debounce), E = n(() => l.clearable && String(l.modelValue).length > 0 && !l.disabled), D = n(() => {
569
- let e = !!m.trailing || l.clearable, t = l.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", r = l.multiline ? "resize-y min-h-[56px]" : "h-14", i = [
567
+ setup(r, { emit: l }) {
568
+ let f = e(), p = r, m = l, v = x(), C = S(), w = g(null), { resolvedFieldBg: T } = z(w, () => p.fieldBg), { debounced: E, cancel: D } = B((e) => m("debounced", e), p.debounce), O = n(() => p.clearable && String(p.modelValue).length > 0 && !p.disabled), k = n(() => {
569
+ let e = !!C.trailing || p.clearable, t = p.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", r = p.multiline ? "resize-y min-h-[56px]" : "h-14", i = [
570
570
  "peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
571
571
  "transition-[border-color,border-width] duration-150",
572
572
  "disabled:cursor-not-allowed disabled:text-on-surface/38",
573
- l.error ? "caret-error" : "caret-primary",
573
+ p.error ? "caret-error" : "caret-primary",
574
574
  r,
575
575
  t,
576
576
  n
577
577
  ];
578
- return l.variant === "outlined" ? [
578
+ return p.variant === "outlined" ? [
579
579
  ...i,
580
580
  "rounded-xs border bg-transparent py-4",
581
- l.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
581
+ p.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
582
582
  "disabled:border-on-surface/12"
583
583
  ].join(" ") : [
584
584
  ...i,
585
585
  "rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
586
- l.error ? "border-error focus:border-b-2 focus:border-error" : "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
586
+ p.error ? "border-error focus:border-b-2 focus:border-error" : "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
587
587
  "disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
588
588
  ].join(" ");
589
- }), O = n(() => {
589
+ }), A = n(() => {
590
590
  let e = [
591
591
  "pointer-events-none absolute truncate transition-all duration-200",
592
- l.leadingIcon ? l.variant === "outlined" ? "left-11" : "left-12" : l.variant === "outlined" ? "left-3" : "left-4",
592
+ p.leadingIcon ? p.variant === "outlined" ? "left-11" : "left-12" : p.variant === "outlined" ? "left-3" : "left-4",
593
593
  "right-4",
594
- `${l.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
594
+ `${p.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
595
595
  ];
596
- return l.variant === "outlined" ? [
596
+ return p.variant === "outlined" ? [
597
597
  ...e,
598
598
  "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",
599
599
  "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)]",
600
600
  "peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
601
- l.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
601
+ p.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
602
602
  "peer-disabled:text-on-surface/38"
603
603
  ].join(" ") : [
604
604
  ...e,
605
605
  "peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
606
606
  "peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
607
- l.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
607
+ p.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
608
608
  "peer-disabled:text-on-surface/38"
609
609
  ].join(" ");
610
610
  });
611
- function k(e) {
611
+ function j(e) {
612
612
  let t = e.target;
613
- f("update:modelValue", t.value), l.debounce > 0 && w(t.value);
613
+ m("update:modelValue", t.value), p.debounce > 0 && E(t.value);
614
614
  }
615
- return (n, r) => (h(), a("div", ne, [o("div", {
615
+ return (e, n) => (h(), a("div", ne, [o("div", {
616
616
  ref_key: "fieldBgEl",
617
- ref: v,
618
- class: u(["relative", e.variant === "outlined" ? "mt-2" : ""]),
619
- style: d(e.variant === "outlined" ? { "--field-bg": b(C) } : void 0)
617
+ ref: w,
618
+ class: u(["relative", r.variant === "outlined" ? "mt-2" : ""]),
619
+ style: d(r.variant === "outlined" ? { "--field-bg": b(T) } : void 0)
620
620
  }, [
621
- e.leadingIcon ? (h(), a("div", {
621
+ r.leadingIcon ? (h(), a("div", {
622
622
  key: 0,
623
- class: u(["pointer-events-none absolute left-3.5", [e.multiline ? "top-[55%] -translate-y-1/2" : e.variant === "filled" ? "top-4.5" : "top-4", e.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
623
+ class: u(["pointer-events-none absolute left-3.5", [r.multiline ? "top-[55%] -translate-y-1/2" : r.variant === "filled" ? "top-4.5" : "top-4", r.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
624
624
  }, [c(t, {
625
- name: e.leadingIcon,
625
+ name: r.leadingIcon,
626
626
  size: 24
627
627
  }, null, 8, ["name"])], 2)) : i("", !0),
628
- e.multiline ? (h(), a("textarea", {
628
+ r.multiline ? (h(), a("textarea", {
629
629
  key: 1,
630
- id: b(p),
631
- value: String(e.modelValue),
632
- rows: e.rows,
633
- disabled: e.disabled,
634
- required: e.required,
630
+ id: b(v),
631
+ value: String(r.modelValue),
632
+ rows: r.rows,
633
+ disabled: r.disabled,
634
+ required: r.required,
635
635
  placeholder: " ",
636
- class: u(D.value),
637
- onInput: k
636
+ class: u(k.value),
637
+ onInput: j
638
638
  }, null, 42, re)) : (h(), a("input", {
639
639
  key: 2,
640
- id: b(p),
641
- type: e.type,
642
- value: e.modelValue,
643
- disabled: e.disabled,
644
- required: e.required,
645
- autocomplete: e.autocomplete,
640
+ id: b(v),
641
+ type: r.type,
642
+ value: r.modelValue,
643
+ disabled: r.disabled,
644
+ required: r.required,
645
+ autocomplete: r.autocomplete,
646
646
  placeholder: " ",
647
- class: u(D.value),
648
- onInput: k
647
+ class: u(k.value),
648
+ onInput: j
649
649
  }, null, 42, ie)),
650
650
  o("label", {
651
- for: b(p),
652
- class: u(O.value)
653
- }, [s(y(e.label), 1), e.required ? (h(), a("span", oe, "\xA0*")) : i("", !0)], 10, ae),
654
- n.$slots.trailing ? (h(), a("div", $, [_(n.$slots, "trailing")])) : E.value ? (h(), a("button", {
651
+ for: b(v),
652
+ class: u(A.value)
653
+ }, [s(y(r.label), 1), r.required ? (h(), a("span", oe, "\xA0*")) : i("", !0)], 10, ae),
654
+ e.$slots.trailing ? (h(), a("div", $, [_(e.$slots, "trailing")])) : O.value ? (h(), a("button", {
655
655
  key: 4,
656
+ "aria-label": b(f).clear,
656
657
  type: "button",
657
658
  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",
658
- onClick: r[0] ||= (e) => {
659
- b(T)(), f("update:modelValue", "");
659
+ onClick: n[0] ||= (e) => {
660
+ b(D)(), m("update:modelValue", "");
660
661
  }
661
662
  }, [c(t, {
662
663
  name: "close",
663
664
  size: 18
664
- })])) : i("", !0)
665
- ], 6), e.error && e.errorLabel ? (h(), a("p", se, y(e.errorLabel), 1)) : e.hint ? (h(), a("p", ce, y(e.hint), 1)) : i("", !0)]));
665
+ })], 8, se)) : i("", !0)
666
+ ], 6), r.error && r.errorLabel ? (h(), a("p", ce, y(r.errorLabel), 1)) : r.hint ? (h(), a("p", le, y(r.hint), 1)) : i("", !0)]));
666
667
  }
667
668
  });
668
669
  //#endregion
669
- export { K as a, X as c, H as d, V as f, k as g, I as h, J as i, W as l, z as m, te as n, G as o, B as p, q as r, Z as s, le as t, U as u };
670
+ export { K as a, X as c, H as d, V as f, k as g, F as h, J as i, W as l, z as m, te as n, G as o, B as p, q as r, Z as s, ue as t, U as u };
670
671
 
671
- //# sourceMappingURL=MTextField-rML9jnXs.js.map
672
+ //# sourceMappingURL=MTextField-FCPOTB0o.js.map