@muibook/components 19.3.0 → 19.4.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.
@@ -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,16 +1,28 @@
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", "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
+ height: var(--stack-height, auto);
12
+ width: var(--stack-width, auto);
13
+ }
14
+ :host([fill]) {
15
+ --stack-height: 100%;
16
+ --stack-width: 100%;
17
+ }
18
+ :host([viewport]) {
19
+ --stack-height: 100dvh;
11
20
  }
12
21
  slot {
13
22
  display: flex;
23
+ box-sizing: border-box;
24
+ height: 100%;
25
+ width: 100%;
14
26
  gap: var(--space);
15
27
  align-items: var(--alignY);
16
28
  justify-content: var(--alignX);
@@ -19,8 +31,8 @@ class r extends HTMLElement {
19
31
  }
20
32
  async connectedCallback() {
21
33
  if (!this.shadowRoot) return;
22
- await this.waitForPartMap();
23
- const t = e("spacing", "layout", "visual");
34
+ await this.waitForPartMap(), this.syncDimensions();
35
+ const t = a("spacing", "layout", "visual");
24
36
  this.shadowRoot.innerHTML = /*html*/
25
37
  `
26
38
  <style>${this.styles}</style>
@@ -34,19 +46,23 @@ class r extends HTMLElement {
34
46
  </slot>
35
47
  `;
36
48
  }
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));
49
+ attributeChangedCallback(t, i, s) {
50
+ if (i === s || ((t === "height" || t === "width") && this.syncDimensions(), !this.shadowRoot)) return;
51
+ const e = this.shadowRoot.querySelector("slot");
52
+ e && (t === "space" && e.style.setProperty("--space", s || this.space), t === "aligny" && e.style.setProperty("--alignY", s || this.alignY), t === "alignx" && e.style.setProperty("--alignX", s || this.alignX));
53
+ }
54
+ syncDimensions() {
55
+ const t = this.getAttribute("height"), i = this.getAttribute("width");
56
+ 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
57
  }
42
58
  waitForPartMap() {
43
59
  return new Promise((t) => {
44
- if (typeof e == "function") return t();
45
- const s = () => {
46
- typeof e == "function" ? t() : requestAnimationFrame(s);
60
+ if (typeof a == "function") return t();
61
+ const i = () => {
62
+ typeof a == "function" ? t() : requestAnimationFrame(i);
47
63
  };
48
- s();
64
+ i();
49
65
  });
50
66
  }
51
67
  }
52
- customElements.get("mui-h-stack") || customElements.define("mui-h-stack", r);
68
+ customElements.get("mui-h-stack") || customElements.define("mui-h-stack", h);
@@ -1,16 +1,28 @@
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", "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
+ height: var(--stack-height, auto);
12
+ width: var(--stack-width, auto);
13
+ }
14
+ :host([fill]) {
15
+ --stack-height: 100%;
16
+ --stack-width: 100%;
17
+ }
18
+ :host([viewport]) {
19
+ --stack-height: 100dvh;
11
20
  }
12
21
  slot {
13
22
  display: grid;
23
+ box-sizing: border-box;
24
+ height: 100%;
25
+ width: 100%;
14
26
  gap: var(--space);
15
27
  justify-items: var(--alignX);
16
28
  align-items: var(--alignY);
@@ -19,8 +31,8 @@ class r extends HTMLElement {
19
31
  }
20
32
  async connectedCallback() {
21
33
  if (!this.shadowRoot) return;
22
- await this.waitForPartMap();
23
- const t = e("spacing", "layout", "visual");
34
+ await this.waitForPartMap(), this.syncDimensions();
35
+ const t = a("spacing", "layout", "visual");
24
36
  this.shadowRoot.innerHTML = /*html*/
25
37
  `
26
38
  <style>${this.styles}</style>
@@ -34,19 +46,23 @@ class r extends HTMLElement {
34
46
  </slot>
35
47
  `;
36
48
  }
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));
49
+ attributeChangedCallback(t, i, s) {
50
+ if (i === s || ((t === "height" || t === "width") && this.syncDimensions(), !this.shadowRoot)) return;
51
+ const e = this.shadowRoot.querySelector("slot");
52
+ e && (t === "space" && e.style.setProperty("--space", s || this.space), t === "alignx" && e.style.setProperty("--alignX", s || this.alignX), t === "aligny" && e.style.setProperty("--alignY", s || this.alignY));
53
+ }
54
+ syncDimensions() {
55
+ const t = this.getAttribute("height"), i = this.getAttribute("width");
56
+ 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
57
  }
42
58
  waitForPartMap() {
43
59
  return new Promise((t) => {
44
- if (typeof e == "function") return t();
45
- const s = () => {
46
- typeof e == "function" ? t() : requestAnimationFrame(s);
60
+ if (typeof a == "function") return t();
61
+ const i = () => {
62
+ typeof a == "function" ? t() : requestAnimationFrame(i);
47
63
  };
48
- s();
64
+ i();
49
65
  });
50
66
  }
51
67
  }
52
- customElements.get("mui-v-stack") || customElements.define("mui-v-stack", r);
68
+ customElements.get("mui-v-stack") || customElements.define("mui-v-stack", h);