@muibook/components 19.3.0 → 19.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +15 -0
  2. package/dist/esm/agent/prompts/index.js +3 -3
  3. package/dist/esm/components/mui-avatar/index.js +8 -5
  4. package/dist/esm/components/mui-button/index.js +3 -3
  5. package/dist/esm/components/mui-chip/index.js +1 -1
  6. package/dist/esm/components/mui-code/index.js +1 -1
  7. package/dist/esm/components/mui-dialog/index.js +2 -1
  8. package/dist/esm/components/mui-drawer/index.js +25 -47
  9. package/dist/esm/components/mui-field/index.js +6 -4
  10. package/dist/esm/components/mui-form-group/index.js +20 -28
  11. package/dist/esm/components/mui-grid/index.js +44 -15
  12. package/dist/esm/components/mui-link/index.js +7 -7
  13. package/dist/esm/components/mui-prompt/index.js +92 -85
  14. package/dist/esm/components/mui-prompt-message/index.js +1 -1
  15. package/dist/esm/components/mui-stack/hstack/index.js +43 -14
  16. package/dist/esm/components/mui-stack/vstack/index.js +43 -14
  17. package/dist/esm/components/mui-switch/index.js +30 -30
  18. package/dist/esm/components/mui-tabs/tab-bar/index.js +1 -1
  19. package/dist/esm/components/mui-textarea/index.js +39 -29
  20. package/dist/esm/css/mui-brand.css +1 -1
  21. package/dist/esm/css/mui-tokens.css +12 -3
  22. package/dist/esm/custom-elements.json +4309 -6192
  23. package/dist/esm/dynamic-attrs.json +1 -1
  24. package/dist/types/components/mui-accordion/api.d.ts +73 -0
  25. package/dist/types/components/mui-addon/api.d.ts +28 -0
  26. package/dist/types/components/mui-alert/api.d.ts +28 -0
  27. package/dist/types/components/mui-avatar/api.d.ts +28 -0
  28. package/dist/types/components/mui-badge/api.d.ts +28 -0
  29. package/dist/types/components/mui-body/api.d.ts +21 -0
  30. package/dist/types/components/mui-button/api.d.ts +24 -0
  31. package/dist/types/components/mui-button-group/api.d.ts +17 -0
  32. package/dist/types/components/mui-card/api.d.ts +50 -0
  33. package/dist/types/components/mui-carousel/api.d.ts +35 -0
  34. package/dist/types/components/mui-checkbox/api.d.ts +36 -0
  35. package/dist/types/components/mui-chip/api.d.ts +28 -0
  36. package/dist/types/components/mui-chip-input/api.d.ts +36 -0
  37. package/dist/types/components/mui-code/api.d.ts +21 -0
  38. package/dist/types/components/mui-container/api.d.ts +17 -0
  39. package/dist/types/components/mui-dialog/api.d.ts +46 -0
  40. package/dist/types/components/mui-drawer/api.d.ts +39 -0
  41. package/dist/types/components/mui-dropdown/api.d.ts +25 -0
  42. package/dist/types/components/mui-field/api.d.ts +24 -0
  43. package/dist/types/components/mui-field/index.d.ts +1 -1
  44. package/dist/types/components/mui-file-upload/api.d.ts +16 -0
  45. package/dist/types/components/mui-form-group/api.d.ts +28 -0
  46. package/dist/types/components/mui-form-group/index.d.ts +0 -1
  47. package/dist/types/components/mui-form-message/api.d.ts +17 -0
  48. package/dist/types/components/mui-form-section/api.d.ts +24 -0
  49. package/dist/types/components/mui-form-section-footer/api.d.ts +13 -0
  50. package/dist/types/components/mui-grid/api.d.ts +28 -0
  51. package/dist/types/components/mui-heading/api.d.ts +28 -0
  52. package/dist/types/components/mui-hint/api.d.ts +21 -0
  53. package/dist/types/components/mui-icons/api.d.ts +28 -0
  54. package/dist/types/components/mui-illustrations/api.d.ts +17 -0
  55. package/dist/types/components/mui-image/api.d.ts +24 -0
  56. package/dist/types/components/mui-input/api.d.ts +32 -0
  57. package/dist/types/components/mui-link/api.d.ts +24 -0
  58. package/dist/types/components/mui-list/api.d.ts +32 -0
  59. package/dist/types/components/mui-loader/api.d.ts +17 -0
  60. package/dist/types/components/mui-media-player/api.d.ts +24 -0
  61. package/dist/types/components/mui-message/api.d.ts +28 -0
  62. package/dist/types/components/mui-progress/api.d.ts +24 -0
  63. package/dist/types/components/mui-prompt/api.d.ts +45 -0
  64. package/dist/types/components/mui-prompt-message/api.d.ts +17 -0
  65. package/dist/types/components/mui-prompt-preview/api.d.ts +36 -0
  66. package/dist/types/components/mui-prompt-toggle/api.d.ts +17 -0
  67. package/dist/types/components/mui-quote/api.d.ts +9 -0
  68. package/dist/types/components/mui-radio/api.d.ts +28 -0
  69. package/dist/types/components/mui-radio-group/api.d.ts +28 -0
  70. package/dist/types/components/mui-range-input/api.d.ts +29 -0
  71. package/dist/types/components/mui-responsive/api.d.ts +16 -0
  72. package/dist/types/components/mui-rule/api.d.ts +13 -0
  73. package/dist/types/components/mui-select/api.d.ts +24 -0
  74. package/dist/types/components/mui-skeleton/api.d.ts +28 -0
  75. package/dist/types/components/mui-slat/api.d.ts +42 -0
  76. package/dist/types/components/mui-slide-frame/api.d.ts +28 -0
  77. package/dist/types/components/mui-smart-card/api.d.ts +20 -0
  78. package/dist/types/components/mui-spinner/api.d.ts +13 -0
  79. package/dist/types/components/mui-stack/api.d.ts +54 -0
  80. package/dist/types/components/mui-stepper/api.d.ts +47 -0
  81. package/dist/types/components/mui-switch/api.d.ts +42 -0
  82. package/dist/types/components/mui-table/api.d.ts +65 -0
  83. package/dist/types/components/mui-tabs/api.d.ts +80 -0
  84. package/dist/types/components/mui-textarea/api.d.ts +24 -0
  85. package/package.json +6 -6
@@ -31,13 +31,13 @@ class S extends HTMLElement {
31
31
  e.forEach((r) => {
32
32
  const n = r.name === "actions";
33
33
  r.assignedElements({ flatten: !0 }).forEach((a) => {
34
- [a, ...Array.from(a.querySelectorAll("*"))].forEach((h) => {
35
- const p = h.tagName.toLowerCase();
34
+ [a, ...Array.from(a.querySelectorAll("*"))].forEach((m) => {
35
+ const p = m.tagName.toLowerCase();
36
36
  if (p === "mui-button") {
37
- h.setAttribute("variant", "tertiary"), o(h, n);
37
+ m.setAttribute("variant", "tertiary"), o(m, n);
38
38
  return;
39
39
  }
40
- p === "mui-dropdown" && h.querySelectorAll('[slot="action"]').forEach((d) => {
40
+ p === "mui-dropdown" && m.querySelectorAll('[slot="action"]').forEach((d) => {
41
41
  d instanceof HTMLElement && d.tagName.toLowerCase() === "mui-button" && (d.setAttribute("variant", "tertiary"), o(d, n));
42
42
  });
43
43
  });
@@ -48,9 +48,9 @@ class S extends HTMLElement {
48
48
  }, this.onPaste = (t) => {
49
49
  const e = t, o = e.clipboardData;
50
50
  if (!o) return;
51
- const r = Array.from(o.files || []), n = o.getData("text/plain") || "", i = n.trim(), a = i.length > 0, l = a ? this.detectMediaUrl(i) : null, h = this.getAttribute("preview-overflow-to-preview") !== "false", p = this.getAttribute("preview-threshold-chars"), c = Number.isFinite(Number.parseInt(p || "", 10)) ? Math.max(1, Number.parseInt(p || "", 10)) : 220, d = a ? this.detectBadge(i) : "", u = d !== "" && d !== "Insightful", b = h && a && (!!(l != null && l.url) || i.length >= c || u), m = r.length > 0;
52
- if (!m && !a) return;
53
- (m || b) && e.preventDefault();
51
+ const r = Array.from(o.files || []), n = o.getData("text/plain") || "", i = n.trim(), a = i.length > 0, l = a ? this.detectMediaUrl(i) : null, m = this.getAttribute("preview-overflow-to-preview") !== "false", p = this.getAttribute("preview-threshold-chars"), c = Number.isFinite(Number.parseInt(p || "", 10)) ? Math.max(1, Number.parseInt(p || "", 10)) : 220, d = a ? this.detectBadge(i) : "", u = d !== "" && d !== "Insightful", b = m && a && (!!(l != null && l.url) || i.length >= c || u), h = r.length > 0;
52
+ if (!h && !a) return;
53
+ (h || b) && e.preventDefault();
54
54
  const v = r.map((s) => ({
55
55
  kind: s.type.startsWith("image/") ? "image" : s.type.startsWith("video/") ? "video" : s.type.startsWith("audio/") ? "audio" : "file",
56
56
  mimeType: s.type || "",
@@ -240,14 +240,14 @@ class S extends HTMLElement {
240
240
  )
241
241
  ).flatMap((r) => r.assignedElements({ flatten: !0 })).forEach((r) => {
242
242
  [r, ...Array.from(r.querySelectorAll("*"))].forEach((i) => {
243
- const l = i.tagName.toLowerCase() === "mui-prompt-toggle", h = i.hasAttribute("context-toggle"), p = i.hasAttribute("context-active") || i.hasAttribute("context-close") || i.hasAttribute("context-chip") || i.hasAttribute("context-spinner");
243
+ const l = i.tagName.toLowerCase() === "mui-prompt-toggle", m = i.hasAttribute("context-toggle"), p = i.hasAttribute("context-active") || i.hasAttribute("context-close") || i.hasAttribute("context-chip") || i.hasAttribute("context-spinner");
244
244
  if (l) {
245
245
  i.setAttribute("mode", t);
246
246
  return;
247
247
  }
248
- if (h || p) {
248
+ if (m || p) {
249
249
  i.hasAttribute("context-chip") && i.tagName.toLowerCase() === "mui-chip" && !i.hasAttribute("variant") && i.setAttribute("variant", "ghost");
250
- const c = h ? t === "icon" : t === "chip";
250
+ const c = m ? t === "icon" : t === "chip";
251
251
  i.toggleAttribute("hidden", !c), i.style.display = c ? "inline-flex" : "none";
252
252
  }
253
253
  });
@@ -434,10 +434,10 @@ class S extends HTMLElement {
434
434
  t == null || t.focus();
435
435
  }
436
436
  syncTextareaHeight(t) {
437
- const o = Number.parseInt(this.getAttribute("rows") || String(3), 10) || 3, r = Math.max(o + 6, 10), n = getComputedStyle(t), a = (Number.parseFloat(n.fontSize) || 16) * 1.55, l = Number.parseFloat(n.paddingTop) || 0, h = Number.parseFloat(n.paddingBottom) || 0, p = Number.parseFloat(n.borderTopWidth) || 0, c = Number.parseFloat(n.borderBottomWidth) || 0, d = l + h + p + c, u = 3 * a + d, b = r * a + d;
437
+ const o = Number.parseInt(this.getAttribute("rows") || String(3), 10) || 3, r = Math.max(o + 6, 10), n = getComputedStyle(t), a = (Number.parseFloat(n.fontSize) || 16) * 1.55, l = Number.parseFloat(n.paddingTop) || 0, m = Number.parseFloat(n.paddingBottom) || 0, p = Number.parseFloat(n.borderTopWidth) || 0, c = Number.parseFloat(n.borderBottomWidth) || 0, d = l + m + p + c, u = 3 * a + d, b = r * a + d;
438
438
  t.style.height = "auto";
439
- const m = t.scrollHeight, v = Math.max(u, Math.min(m, b));
440
- t.style.height = `${Math.ceil(v)}px`, t.style.overflowY = m > b ? "auto" : "hidden";
439
+ const h = t.scrollHeight, v = Math.max(u, Math.min(h, b));
440
+ t.style.height = `${Math.ceil(v)}px`, t.style.overflowY = h > b ? "auto" : "hidden";
441
441
  }
442
442
  detectBadge(t) {
443
443
  const e = t.trim();
@@ -559,7 +559,7 @@ class S extends HTMLElement {
559
559
  openInternalPreviewDialog(t) {
560
560
  var f;
561
561
  if (!this.shadowRoot) return;
562
- const e = this.shadowRoot.querySelector("#promptAutoPreviewDialog"), o = this.shadowRoot.querySelector("#promptAutoPreviewTitle"), r = this.shadowRoot.querySelector("#promptAutoPreviewCode"), n = this.shadowRoot.querySelector("#promptAutoPreviewImage"), i = this.shadowRoot.querySelector("#promptAutoPreviewMedia"), a = this.shadowRoot.querySelector("#promptAutoPreviewMediaUrl"), l = this.normalizePreviewDetail(t), h = this.getAttribute("preview-dialog-title") || l.label, p = l.value, c = l.bgImage, d = l.badge, u = p ? this.detectMediaUrl(p) : null, b = !c && p.length > 0 && (d === "VIDEO" || d === "MUSIC"), m = !c && (!!(u && (u.kind === "video" || u.kind === "audio")) || b), v = c.length > 0, s = p.length > 0, y = (() => {
562
+ const e = this.shadowRoot.querySelector("#promptAutoPreviewDialog"), o = this.shadowRoot.querySelector("#promptAutoPreviewTitle"), r = this.shadowRoot.querySelector("#promptAutoPreviewCode"), n = this.shadowRoot.querySelector("#promptAutoPreviewImage"), i = this.shadowRoot.querySelector("#promptAutoPreviewMedia"), a = this.shadowRoot.querySelector("#promptAutoPreviewMediaUrl"), l = this.normalizePreviewDetail(t), m = this.getAttribute("preview-dialog-title") || l.label, p = l.value, c = l.bgImage, d = l.badge, u = p ? this.detectMediaUrl(p) : null, b = !c && p.length > 0 && (d === "VIDEO" || d === "MUSIC"), h = !c && (!!(u && (u.kind === "video" || u.kind === "audio")) || b), v = c.length > 0, s = p.length > 0, y = (() => {
563
563
  if (!u || u.kind !== "audio") return !1;
564
564
  try {
565
565
  const g = new URL(u.url);
@@ -576,10 +576,10 @@ class S extends HTMLElement {
576
576
  return "Audio";
577
577
  }
578
578
  })();
579
- if (!(!v && !s && !m)) {
580
- if (this.setAttribute("preview-dialog-value", p), this.setAttribute("preview-dialog-image", c), this.setAttribute("preview-dialog-type", d || (v ? "IMG" : "CODE")), o && (o.textContent = h), m ? e == null || e.setAttribute("content-max-height", "none") : e == null || e.removeAttribute("content-max-height"), v)
579
+ if (!(!v && !s && !h)) {
580
+ if (this.setAttribute("preview-dialog-value", p), this.setAttribute("preview-dialog-image", c), this.setAttribute("preview-dialog-type", d || (v ? "IMG" : "CODE")), o && (o.textContent = m), h ? e == null || e.setAttribute("content-max-height", "none") : e == null || e.removeAttribute("content-max-height"), v)
581
581
  a && a.setAttribute("hidden", ""), n && (n.setAttribute("src", c), n.removeAttribute("hidden")), i && i.setAttribute("hidden", ""), r && r.setAttribute("hidden", "");
582
- else if (m && u) {
582
+ else if (h && u) {
583
583
  if (a) {
584
584
  const g = y;
585
585
  a.textContent = g ? w : u.url, g ? (a.setAttribute("href", u.url), a.setAttribute("target", "_blank"), a.setAttribute("rel", "noopener noreferrer")) : (a.removeAttribute("href"), a.removeAttribute("target"), a.removeAttribute("rel")), a.toggleAttribute("hidden", !g);
@@ -644,11 +644,11 @@ class S extends HTMLElement {
644
644
  const s = !r || i;
645
645
  e.toggleAttribute("hidden", s), e.style.display = s ? "none" : "inline-flex";
646
646
  }
647
- const a = i || !r ? null : e, l = o.filter((s) => s !== a), h = a ? [a, ...l] : o, p = this.shadowRoot.querySelector('slot[name="actions-right"]'), c = (p == null ? void 0 : p.assignedElements({ flatten: !0 })) || [], d = l.length > 0;
647
+ const a = i || !r ? null : e, l = o.filter((s) => s !== a), m = a ? [a, ...l] : o, p = this.shadowRoot.querySelector('slot[name="actions-right"]'), c = (p == null ? void 0 : p.assignedElements({ flatten: !0 })) || [], d = l.length > 0;
648
648
  this.toggleAttribute("has-actions", r), this.toggleAttribute("has-extra-actions", d);
649
- const u = r || this.hasTruthyFlagAttribute("actions-fan"), b = this.hasAttribute("fan-open"), m = 100, v = "calc(var(--action-icon-only-size-medium) + var(--space-100))";
650
- this.enforceActionVariants(), h.forEach((s, y) => {
651
- s.style.transition = `transform ${m}ms ease, opacity ${m}ms ease`, s.style.zIndex = "";
649
+ const u = r || this.hasTruthyFlagAttribute("actions-fan"), b = this.hasAttribute("fan-open"), h = 100, v = "calc(var(--action-icon-only-size-medium) + var(--space-100))";
650
+ this.enforceActionVariants(), m.forEach((s, y) => {
651
+ s.style.transition = `transform ${h}ms ease, opacity ${h}ms ease`, s.style.zIndex = "";
652
652
  const w = this.fanAnimations.get(s);
653
653
  if (w && (w.cancel(), this.fanAnimations.delete(s)), !u) {
654
654
  this.setFanItemInert(s, !1), s.style.transitionDelay = "", s.style.transform = "", s.style.opacity = "", s.style.pointerEvents = "", s.style.filter = "";
@@ -663,7 +663,7 @@ class S extends HTMLElement {
663
663
  return;
664
664
  }
665
665
  const f = `calc(${v} * -${y})`, g = y * 50;
666
- s.style.transition = `opacity ${Math.max(120, m - 40)}ms ease, transform ${m}ms cubic-bezier(0.22, 1, 0.36, 1)`, s.style.transitionDelay = `${g}ms`, s.style.transform = "translateX(0) scale(0.92)", s.style.opacity = "0", s.style.pointerEvents = "none", s.style.filter = "", this.setFanItemInert(s, !0), requestAnimationFrame(() => {
666
+ s.style.transition = `opacity ${Math.max(120, h - 40)}ms ease, transform ${h}ms cubic-bezier(0.22, 1, 0.36, 1)`, s.style.transitionDelay = `${g}ms`, s.style.transform = "translateX(0) scale(0.92)", s.style.opacity = "0", s.style.pointerEvents = "none", s.style.filter = "", this.setFanItemInert(s, !0), requestAnimationFrame(() => {
667
667
  if (s.style.transform = `translateX(${f})`, s.style.opacity = "1", window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
668
668
  s.style.pointerEvents = "", this.setFanItemInert(s, !1);
669
669
  return;
@@ -676,7 +676,7 @@ class S extends HTMLElement {
676
676
  { transform: `translateX(${f}) scale(1)` }
677
677
  ],
678
678
  {
679
- duration: m + 180,
679
+ duration: h + 180,
680
680
  delay: g,
681
681
  easing: "cubic-bezier(0.22, 1, 0.36, 1)",
682
682
  fill: "forwards"
@@ -693,34 +693,38 @@ class S extends HTMLElement {
693
693
  }
694
694
  render() {
695
695
  if (!this.shadowRoot) return;
696
- const t = this.getAttribute("placeholder") || "Reply to Mui...", e = this.getAttribute("value") || "", o = this.getAttribute("rows") || "3", r = this.hasAttribute("disabled"), n = this.getAttribute("preview-dialog-width") || "560px", i = this.getAttribute("color-top-start") || "", a = this.getAttribute("color-top-mid") || "", l = this.getAttribute("color-top-end") || "", h = this.getAttribute("color-top-accent") || "", c = (this.getAttribute("color-layout") || "default").toLowerCase() === "swap", d = c ? l || "var(--prompt-color-top-end, var(--green-500))" : i || "var(--prompt-color-top-start, var(--blue-500))", u = c ? h || "var(--prompt-color-top-accent, var(--orange-500))" : a || "var(--prompt-color-top-mid, var(--blue-500))", b = c ? i || "var(--prompt-color-top-start, var(--blue-500))" : l || "var(--prompt-color-top-end, var(--green-500))", m = c ? a || "var(--prompt-color-top-mid, var(--blue-500))" : h || "var(--prompt-color-top-accent, var(--orange-500))", v = this.getAttribute("aria-label"), s = this.getAttribute("aria-labelledby"), y = this.getAttribute("aria-describedby"), w = !v && !s ? "Prompt input" : "", f = (this.getAttribute("error-message") || "").trim(), g = f;
696
+ const t = this.getAttribute("placeholder") || "Reply to Mui...", e = this.getAttribute("value") || "", o = this.getAttribute("rows") || "3", r = this.hasAttribute("disabled"), n = this.getAttribute("preview-dialog-width") || "560px", i = this.getAttribute("color-top-start") || "", a = this.getAttribute("color-top-mid") || "", l = this.getAttribute("color-top-end") || "", m = this.getAttribute("color-top-accent") || "", c = (this.getAttribute("color-layout") || "default").toLowerCase() === "swap", d = c ? l || "var(--prompt-color-top-end, var(--green-500))" : i || "var(--prompt-color-top-start, var(--blue-500))", u = c ? m || "var(--prompt-color-top-accent, var(--orange-500))" : a || "var(--prompt-color-top-mid, var(--blue-500))", b = c ? i || "var(--prompt-color-top-start, var(--blue-500))" : l || "var(--prompt-color-top-end, var(--green-500))", h = c ? a || "var(--prompt-color-top-mid, var(--blue-500))" : m || "var(--prompt-color-top-accent, var(--orange-500))", v = this.getAttribute("aria-label"), s = this.getAttribute("aria-labelledby"), y = this.getAttribute("aria-describedby"), w = !v && !s ? "Prompt input" : "", f = (this.getAttribute("error-message") || "").trim(), g = f;
697
697
  this.shadowRoot.innerHTML = /*html*/
698
698
  `
699
699
  <style>
700
700
  :host {
701
701
  display: block;
702
702
  --prompt-action-radius: var(--chip-radius-small, var(--radius-400));
703
- --_prompt-color-top-start-source: ${d};
704
- --_prompt-color-top-mid-source: ${u};
705
- --_prompt-color-top-end-source: ${b};
706
- --_prompt-color-top-accent-source: ${m};
707
- --_prompt-accent-primary: var(--prompt-accent-primary, var(--prompt-spectrum-start, var(--blue-500)));
708
- --_prompt-accent-secondary: var(--prompt-accent-secondary, var(--blue-500));
709
- --_prompt-accent-mid: color-mix(in srgb, var(--_prompt-accent-primary) 52%, var(--_prompt-accent-secondary) 48%);
710
- --_prompt-start-tint: color-mix(in srgb, var(--_prompt-color-top-start-source) 24%, transparent 76%);
711
- --_prompt-mid-tint: color-mix(in srgb, var(--_prompt-color-top-mid-source) 18%, transparent 82%);
712
- --_prompt-end-tint: color-mix(in srgb, var(--_prompt-color-top-end-source) 20%, transparent 80%);
713
- --_prompt-accent-tint: color-mix(
703
+ --prompt-color-top-start-source: ${d};
704
+ --prompt-color-top-mid-source: ${u};
705
+ --prompt-color-top-end-source: ${b};
706
+ --prompt-color-top-accent-source: ${h};
707
+ --prompt-accent-primary-derived: var(--prompt-accent-primary, var(--prompt-spectrum-start, var(--blue-500)));
708
+ --prompt-accent-secondary-derived: var(--prompt-accent-secondary, var(--blue-500));
709
+ --prompt-accent-mid: color-mix(
714
710
  in srgb,
715
- var(--_prompt-color-top-accent-source) 16%,
711
+ var(--prompt-accent-primary-derived) 52%,
712
+ var(--prompt-accent-secondary-derived) 48%
713
+ );
714
+ --prompt-start-tint: color-mix(in srgb, var(--prompt-color-top-start-source) 24%, transparent 76%);
715
+ --prompt-mid-tint: color-mix(in srgb, var(--prompt-color-top-mid-source) 18%, transparent 82%);
716
+ --prompt-end-tint: color-mix(in srgb, var(--prompt-color-top-end-source) 20%, transparent 80%);
717
+ --prompt-accent-tint: color-mix(
718
+ in srgb,
719
+ var(--prompt-color-top-accent-source) 16%,
716
720
  transparent 84%
717
721
  );
718
- --_prompt-layer-start-tint: ${c ? "var(--_prompt-end-tint)" : "var(--_prompt-start-tint)"};
719
- --_prompt-layer-mid-tint: ${c ? "var(--_prompt-accent-tint)" : "var(--_prompt-mid-tint)"};
720
- --_prompt-layer-end-tint: ${c ? "var(--_prompt-start-tint)" : "var(--_prompt-end-tint)"};
721
- --_prompt-layer-accent-tint: ${c ? "var(--_prompt-mid-tint)" : "var(--_prompt-accent-tint)"};
722
- --_prompt-spectrum-blend-mode-hover: normal;
723
- --_prompt-spectrum-blend-mode-focus: normal;
722
+ --prompt-layer-start-tint: ${c ? "var(--prompt-end-tint)" : "var(--prompt-start-tint)"};
723
+ --prompt-layer-mid-tint: ${c ? "var(--prompt-accent-tint)" : "var(--prompt-mid-tint)"};
724
+ --prompt-layer-end-tint: ${c ? "var(--prompt-start-tint)" : "var(--prompt-end-tint)"};
725
+ --prompt-layer-accent-tint: ${c ? "var(--prompt-mid-tint)" : "var(--prompt-accent-tint)"};
726
+ --prompt-spectrum-blend-mode-hover: normal;
727
+ --prompt-spectrum-blend-mode-focus: normal;
724
728
  --prompt-placeholder-color-hover-light: var(--grey-1200);
725
729
  --prompt-placeholder-color-hover-dark: var(--white);
726
730
  --prompt-placeholder-color-focus-light: var(--grey-1200);
@@ -753,24 +757,24 @@ class S extends HTMLElement {
753
757
  var(--prompt-focus-border-color) 25%,
754
758
  transparent 75%
755
759
  );
756
- --_prompt-border-hover-primary-soft: color-mix(
760
+ --prompt-border-hover-primary-soft: color-mix(
757
761
  in srgb,
758
- var(--prompt-border-color-hover-primary, var(--_prompt-accent-primary)) 46%,
762
+ var(--prompt-border-color-hover-primary, var(--prompt-accent-primary-derived)) 46%,
759
763
  var(--form-default-border-color-hover) 54%
760
764
  );
761
- --_prompt-border-hover-primary-strong: color-mix(
765
+ --prompt-border-hover-primary-strong: color-mix(
762
766
  in srgb,
763
- var(--prompt-border-color-hover-primary, var(--_prompt-accent-primary)) 70%,
767
+ var(--prompt-border-color-hover-primary, var(--prompt-accent-primary-derived)) 70%,
764
768
  var(--form-default-border-color-hover) 30%
765
769
  );
766
- --_prompt-border-hover-secondary-soft: color-mix(
770
+ --prompt-border-hover-secondary-soft: color-mix(
767
771
  in srgb,
768
- var(--prompt-border-color-hover-secondary, var(--_prompt-accent-secondary)) 46%,
772
+ var(--prompt-border-color-hover-secondary, var(--prompt-accent-secondary-derived)) 46%,
769
773
  var(--form-default-border-color-hover) 54%
770
774
  );
771
- --_prompt-border-hover-secondary-strong: color-mix(
775
+ --prompt-border-hover-secondary-strong: color-mix(
772
776
  in srgb,
773
- var(--prompt-border-color-hover-secondary, var(--_prompt-accent-secondary)) 70%,
777
+ var(--prompt-border-color-hover-secondary, var(--prompt-accent-secondary-derived)) 70%,
774
778
  var(--form-default-border-color-hover) 30%
775
779
  );
776
780
  overflow: visible;
@@ -813,25 +817,25 @@ class S extends HTMLElement {
813
817
  background:
814
818
  radial-gradient(
815
819
  90% 120% at 12% 16%,
816
- var(--_prompt-layer-start-tint) 0%,
820
+ var(--prompt-layer-start-tint) 0%,
817
821
  transparent 62%
818
822
  ),
819
823
  radial-gradient(
820
824
  90% 120% at 72% 8%,
821
- var(--_prompt-layer-mid-tint) 0%,
825
+ var(--prompt-layer-mid-tint) 0%,
822
826
  transparent 60%
823
827
  ),
824
828
  radial-gradient(
825
829
  80% 120% at 86% 72%,
826
- var(--_prompt-layer-end-tint) 0%,
830
+ var(--prompt-layer-end-tint) 0%,
827
831
  transparent 58%
828
832
  ),
829
833
  radial-gradient(
830
834
  110% 120% at 34% 88%,
831
- var(--_prompt-layer-accent-tint) 0%,
835
+ var(--prompt-layer-accent-tint) 0%,
832
836
  transparent 64%
833
837
  );
834
- mix-blend-mode: var(--_prompt-spectrum-blend-mode-hover);
838
+ mix-blend-mode: var(--prompt-spectrum-blend-mode-hover);
835
839
  filter: blur(var(--space-050));
836
840
  transform: translate3d(0, 0, 0) scaleX(0.94) scaleY(1.01);
837
841
  transform-origin: center;
@@ -852,26 +856,26 @@ class S extends HTMLElement {
852
856
  background:
853
857
  radial-gradient(
854
858
  90% 120% at 12% 16%,
855
- var(--_prompt-layer-start-tint) 0%,
859
+ var(--prompt-layer-start-tint) 0%,
856
860
  transparent 62%
857
861
  ),
858
862
  radial-gradient(
859
863
  90% 120% at 72% 8%,
860
- var(--_prompt-layer-mid-tint) 0%,
864
+ var(--prompt-layer-mid-tint) 0%,
861
865
  transparent 60%
862
866
  ),
863
867
  radial-gradient(
864
868
  80% 120% at 86% 72%,
865
- var(--_prompt-layer-end-tint) 0%,
869
+ var(--prompt-layer-end-tint) 0%,
866
870
  transparent 58%
867
871
  ),
868
872
  radial-gradient(
869
873
  110% 120% at 34% 88%,
870
- var(--_prompt-layer-accent-tint) 0%,
874
+ var(--prompt-layer-accent-tint) 0%,
871
875
  transparent 64%
872
876
  ),
873
877
  var(--surface-elevated-100);
874
- mix-blend-mode: var(--_prompt-spectrum-blend-mode-hover);
878
+ mix-blend-mode: var(--prompt-spectrum-blend-mode-hover);
875
879
  filter: none;
876
880
  animation: promptMeshPulse calc(var(--prompt-hover-sweep-speed, var(--speed-500)) * 1.15) ease-in-out infinite;
877
881
  }
@@ -900,26 +904,26 @@ class S extends HTMLElement {
900
904
  background:
901
905
  radial-gradient(
902
906
  90% 120% at 12% 16%,
903
- var(--_prompt-layer-start-tint) 0%,
907
+ var(--prompt-layer-start-tint) 0%,
904
908
  transparent 62%
905
909
  ),
906
910
  radial-gradient(
907
911
  90% 120% at 72% 8%,
908
- var(--_prompt-layer-mid-tint) 0%,
912
+ var(--prompt-layer-mid-tint) 0%,
909
913
  transparent 60%
910
914
  ),
911
915
  radial-gradient(
912
916
  80% 120% at 86% 72%,
913
- var(--_prompt-layer-end-tint) 0%,
917
+ var(--prompt-layer-end-tint) 0%,
914
918
  transparent 58%
915
919
  ),
916
920
  radial-gradient(
917
921
  110% 120% at 34% 88%,
918
- var(--_prompt-layer-accent-tint) 0%,
922
+ var(--prompt-layer-accent-tint) 0%,
919
923
  transparent 64%
920
924
  ),
921
925
  var(--prompt-focus-surface-background, var(--surface-elevated-100));
922
- mix-blend-mode: var(--_prompt-spectrum-blend-mode-hover);
926
+ mix-blend-mode: var(--prompt-spectrum-blend-mode-hover);
923
927
  animation: none;
924
928
  }
925
929
  :host([effects-off]) .surface::before {
@@ -1158,41 +1162,41 @@ class S extends HTMLElement {
1158
1162
  :host-context([theme="dark"]),
1159
1163
  :host-context(.theme-dark) {
1160
1164
  --prompt-focus-surface-opacity: 0.35;
1161
- --_prompt-accent-secondary: var(
1165
+ --prompt-accent-secondary-derived: var(
1162
1166
  --prompt-accent-secondary,
1163
- color-mix(in srgb, var(--_prompt-accent-primary) 64%, var(--grey-1200) 36%)
1167
+ color-mix(in srgb, var(--prompt-accent-primary-derived) 64%, var(--grey-1200) 36%)
1164
1168
  );
1165
- --_prompt-accent-mid: color-mix(
1169
+ --prompt-accent-mid: color-mix(
1166
1170
  in srgb,
1167
- var(--_prompt-accent-primary) 56%,
1168
- var(--_prompt-accent-secondary) 44%
1171
+ var(--prompt-accent-primary-derived) 56%,
1172
+ var(--prompt-accent-secondary-derived) 44%
1169
1173
  );
1170
- --_prompt-start-tint: color-mix(in srgb, var(--_prompt-color-top-start-source) 22%, transparent 78%);
1171
- --_prompt-mid-tint: color-mix(in srgb, var(--_prompt-color-top-mid-source) 18%, transparent 82%);
1172
- --_prompt-end-tint: color-mix(in srgb, var(--_prompt-color-top-end-source) 20%, transparent 80%);
1173
- --_prompt-accent-tint: color-mix(
1174
+ --prompt-start-tint: color-mix(in srgb, var(--prompt-color-top-start-source) 22%, transparent 78%);
1175
+ --prompt-mid-tint: color-mix(in srgb, var(--prompt-color-top-mid-source) 18%, transparent 82%);
1176
+ --prompt-end-tint: color-mix(in srgb, var(--prompt-color-top-end-source) 20%, transparent 80%);
1177
+ --prompt-accent-tint: color-mix(
1174
1178
  in srgb,
1175
- var(--_prompt-color-top-accent-source) 16%,
1179
+ var(--prompt-color-top-accent-source) 16%,
1176
1180
  transparent 84%
1177
1181
  );
1178
- --_prompt-border-hover-primary-soft: color-mix(
1182
+ --prompt-border-hover-primary-soft: color-mix(
1179
1183
  in srgb,
1180
- var(--prompt-border-color-hover-primary, var(--_prompt-accent-primary)) 56%,
1184
+ var(--prompt-border-color-hover-primary, var(--prompt-accent-primary-derived)) 56%,
1181
1185
  var(--form-default-border-color-hover) 44%
1182
1186
  );
1183
- --_prompt-border-hover-primary-strong: color-mix(
1187
+ --prompt-border-hover-primary-strong: color-mix(
1184
1188
  in srgb,
1185
- var(--prompt-border-color-hover-primary, var(--_prompt-accent-primary)) 78%,
1189
+ var(--prompt-border-color-hover-primary, var(--prompt-accent-primary-derived)) 78%,
1186
1190
  var(--form-default-border-color-hover) 22%
1187
1191
  );
1188
- --_prompt-border-hover-secondary-soft: color-mix(
1192
+ --prompt-border-hover-secondary-soft: color-mix(
1189
1193
  in srgb,
1190
- var(--prompt-border-color-hover-secondary, var(--_prompt-accent-secondary)) 56%,
1194
+ var(--prompt-border-color-hover-secondary, var(--prompt-accent-secondary-derived)) 56%,
1191
1195
  var(--form-default-border-color-hover) 44%
1192
1196
  );
1193
- --_prompt-border-hover-secondary-strong: color-mix(
1197
+ --prompt-border-hover-secondary-strong: color-mix(
1194
1198
  in srgb,
1195
- var(--prompt-border-color-hover-secondary, var(--_prompt-accent-secondary)) 78%,
1199
+ var(--prompt-border-color-hover-secondary, var(--prompt-accent-secondary-derived)) 78%,
1196
1200
  var(--form-default-border-color-hover) 22%
1197
1201
  );
1198
1202
  --prompt-hover-border-pulse-start: color-mix(
@@ -1212,8 +1216,8 @@ class S extends HTMLElement {
1212
1216
  --prompt-focus-after-opacity: 0.3;
1213
1217
  --prompt-focus-after-opacity-min: 0;
1214
1218
  --prompt-focus-after-opacity-max: 0.3;
1215
- --_prompt-spectrum-blend-mode-hover: soft-light;
1216
- --_prompt-spectrum-blend-mode-focus: normal;
1219
+ --prompt-spectrum-blend-mode-hover: soft-light;
1220
+ --prompt-spectrum-blend-mode-focus: normal;
1217
1221
  }
1218
1222
  :host-context([data-theme="light"]),
1219
1223
  :host-context([theme="light"]),
@@ -1349,6 +1353,9 @@ class S extends HTMLElement {
1349
1353
  .auto-preview-media-url::part(text-overflow) {
1350
1354
  text-overflow: ellipsis;
1351
1355
  }
1356
+ #promptAutoPreviewCode {
1357
+ --code-background: var(--prompt-preview-code-background);
1358
+ }
1352
1359
  #promptAutoPreviewCode[hidden],
1353
1360
  #promptAutoPreviewImage[hidden],
1354
1361
  #promptAutoPreviewMediaUrl[hidden],
@@ -75,7 +75,7 @@ class d extends HTMLElement {
75
75
  const a = () => {
76
76
  var i, o;
77
77
  const t = this.getAttribute("size") || "medium", e = {
78
- "x-small": "x-small",
78
+ "x-small": "xx-small",
79
79
  small: "small",
80
80
  medium: "small",
81
81
  large: "medium"
@@ -1,26 +1,50 @@
1
- import { getPartMap as e } from "../../../utils/part-map/index.js";
2
- class r extends HTMLElement {
1
+ import { getPartMap as a } from "../../../utils/part-map/index.js";
2
+ class h extends HTMLElement {
3
3
  static get observedAttributes() {
4
- return ["space", "aligny", "alignx"];
4
+ return ["space", "aligny", "alignx", "padding", "height", "width", "viewport", "fill"];
5
5
  }
6
6
  constructor() {
7
7
  super(), this.attachShadow({ mode: "open" }), this.space = "var(--space-500)", this.alignY = "flex-start", this.alignX = "flex-start", this.styles = /*css*/
8
8
  `
9
9
  :host {
10
10
  display: block;
11
+ --stack-height: auto;
12
+ --stack-width: auto;
13
+ height: var(--stack-height);
14
+ width: var(--stack-width);
15
+ }
16
+ :host([fill]) {
17
+ --stack-height: 100%;
18
+ --stack-width: 100%;
19
+ }
20
+ :host([viewport]) {
21
+ --stack-height: 100dvh;
11
22
  }
12
23
  slot {
13
24
  display: flex;
25
+ box-sizing: border-box;
26
+ height: auto;
27
+ width: auto;
14
28
  gap: var(--space);
29
+ padding: var(--padding);
15
30
  align-items: var(--alignY);
16
31
  justify-content: var(--alignX);
17
32
  }
33
+ :host([height]) slot,
34
+ :host([viewport]) slot,
35
+ :host([fill]) slot {
36
+ height: 100%;
37
+ }
38
+ :host([width]) slot,
39
+ :host([fill]) slot {
40
+ width: 100%;
41
+ }
18
42
  `;
19
43
  }
20
44
  async connectedCallback() {
21
45
  if (!this.shadowRoot) return;
22
- await this.waitForPartMap();
23
- const t = e("spacing", "layout", "visual");
46
+ await this.waitForPartMap(), this.syncDimensions();
47
+ const t = a("spacing", "layout", "visual");
24
48
  this.shadowRoot.innerHTML = /*html*/
25
49
  `
26
50
  <style>${this.styles}</style>
@@ -28,25 +52,30 @@ class r extends HTMLElement {
28
52
  part="${t}"
29
53
  style="
30
54
  --space: ${this.getAttribute("space") || this.space};
55
+ --padding: ${this.getAttribute("padding") || "var(--space-000)"};
31
56
  --alignY: ${this.getAttribute("aligny") || this.alignY};
32
57
  --alignX: ${this.getAttribute("alignx") || this.alignX};
33
58
  ">
34
59
  </slot>
35
60
  `;
36
61
  }
37
- attributeChangedCallback(t, s, i) {
38
- if (s === i || !this.shadowRoot) return;
39
- const a = this.shadowRoot.querySelector("slot");
40
- a && (t === "space" && a.style.setProperty("--space", i || this.space), t === "aligny" && a.style.setProperty("--alignY", i || this.alignY), t === "alignx" && a.style.setProperty("--alignX", i || this.alignX));
62
+ attributeChangedCallback(t, i, s) {
63
+ if (i === s || ((t === "height" || t === "width") && this.syncDimensions(), !this.shadowRoot)) return;
64
+ const e = this.shadowRoot.querySelector("slot");
65
+ e && (t === "space" && e.style.setProperty("--space", s || this.space), t === "padding" && e.style.setProperty("--padding", s || "var(--space-000)"), t === "aligny" && e.style.setProperty("--alignY", s || this.alignY), t === "alignx" && e.style.setProperty("--alignX", s || this.alignX));
66
+ }
67
+ syncDimensions() {
68
+ const t = this.getAttribute("height"), i = this.getAttribute("width");
69
+ t ? this.style.setProperty("--stack-height", t) : this.style.removeProperty("--stack-height"), i ? this.style.setProperty("--stack-width", i) : this.style.removeProperty("--stack-width");
41
70
  }
42
71
  waitForPartMap() {
43
72
  return new Promise((t) => {
44
- if (typeof e == "function") return t();
45
- const s = () => {
46
- typeof e == "function" ? t() : requestAnimationFrame(s);
73
+ if (typeof a == "function") return t();
74
+ const i = () => {
75
+ typeof a == "function" ? t() : requestAnimationFrame(i);
47
76
  };
48
- s();
77
+ i();
49
78
  });
50
79
  }
51
80
  }
52
- customElements.get("mui-h-stack") || customElements.define("mui-h-stack", r);
81
+ customElements.get("mui-h-stack") || customElements.define("mui-h-stack", h);
@@ -1,26 +1,50 @@
1
- import { getPartMap as e } from "../../../utils/part-map/index.js";
2
- class r extends HTMLElement {
1
+ import { getPartMap as a } from "../../../utils/part-map/index.js";
2
+ class h extends HTMLElement {
3
3
  static get observedAttributes() {
4
- return ["space", "alignx", "aligny"];
4
+ return ["space", "alignx", "aligny", "padding", "height", "width", "viewport", "fill"];
5
5
  }
6
6
  constructor() {
7
7
  super(), this.attachShadow({ mode: "open" }), this.space = "var(--space-500)", this.alignX = "normal", this.alignY = "normal", this.styles = /*css*/
8
8
  `
9
9
  :host {
10
10
  display: block;
11
+ --stack-height: auto;
12
+ --stack-width: auto;
13
+ height: var(--stack-height);
14
+ width: var(--stack-width);
15
+ }
16
+ :host([fill]) {
17
+ --stack-height: 100%;
18
+ --stack-width: 100%;
19
+ }
20
+ :host([viewport]) {
21
+ --stack-height: 100dvh;
11
22
  }
12
23
  slot {
13
24
  display: grid;
25
+ box-sizing: border-box;
26
+ height: auto;
27
+ width: auto;
14
28
  gap: var(--space);
29
+ padding: var(--padding);
15
30
  justify-items: var(--alignX);
16
31
  align-items: var(--alignY);
17
32
  }
33
+ :host([height]) slot,
34
+ :host([viewport]) slot,
35
+ :host([fill]) slot {
36
+ height: 100%;
37
+ }
38
+ :host([width]) slot,
39
+ :host([fill]) slot {
40
+ width: 100%;
41
+ }
18
42
  `;
19
43
  }
20
44
  async connectedCallback() {
21
45
  if (!this.shadowRoot) return;
22
- await this.waitForPartMap();
23
- const t = e("spacing", "layout", "visual");
46
+ await this.waitForPartMap(), this.syncDimensions();
47
+ const t = a("spacing", "layout", "visual");
24
48
  this.shadowRoot.innerHTML = /*html*/
25
49
  `
26
50
  <style>${this.styles}</style>
@@ -28,25 +52,30 @@ class r extends HTMLElement {
28
52
  part="${t}"
29
53
  style="
30
54
  --space: ${this.getAttribute("space") || this.space};
55
+ --padding: ${this.getAttribute("padding") || "var(--space-000)"};
31
56
  --alignX: ${this.getAttribute("alignx") || this.alignX};
32
57
  --alignY: ${this.getAttribute("aligny") || this.alignY};
33
58
  ">
34
59
  </slot>
35
60
  `;
36
61
  }
37
- attributeChangedCallback(t, s, i) {
38
- if (s === i || !this.shadowRoot) return;
39
- const a = this.shadowRoot.querySelector("slot");
40
- a && (t === "space" && a.style.setProperty("--space", i || this.space), t === "alignx" && a.style.setProperty("--alignX", i || this.alignX), t === "aligny" && a.style.setProperty("--alignY", i || this.alignY));
62
+ attributeChangedCallback(t, i, s) {
63
+ if (i === s || ((t === "height" || t === "width") && this.syncDimensions(), !this.shadowRoot)) return;
64
+ const e = this.shadowRoot.querySelector("slot");
65
+ e && (t === "space" && e.style.setProperty("--space", s || this.space), t === "padding" && e.style.setProperty("--padding", s || "var(--space-000)"), t === "alignx" && e.style.setProperty("--alignX", s || this.alignX), t === "aligny" && e.style.setProperty("--alignY", s || this.alignY));
66
+ }
67
+ syncDimensions() {
68
+ const t = this.getAttribute("height"), i = this.getAttribute("width");
69
+ t ? this.style.setProperty("--stack-height", t) : this.style.removeProperty("--stack-height"), i ? this.style.setProperty("--stack-width", i) : this.style.removeProperty("--stack-width");
41
70
  }
42
71
  waitForPartMap() {
43
72
  return new Promise((t) => {
44
- if (typeof e == "function") return t();
45
- const s = () => {
46
- typeof e == "function" ? t() : requestAnimationFrame(s);
73
+ if (typeof a == "function") return t();
74
+ const i = () => {
75
+ typeof a == "function" ? t() : requestAnimationFrame(i);
47
76
  };
48
- s();
77
+ i();
49
78
  });
50
79
  }
51
80
  }
52
- customElements.get("mui-v-stack") || customElements.define("mui-v-stack", r);
81
+ customElements.get("mui-v-stack") || customElements.define("mui-v-stack", h);