@muibook/components 18.1.0 → 18.2.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.
@@ -47,7 +47,7 @@ class l extends HTMLElement {
47
47
  ::slotted([slot="before"]),
48
48
  ::slotted([slot="after"]) {
49
49
  flex-shrink: 0;
50
- margin-top: var(--body-inline-icon-offset-medium, var(--body-inline-icon-offset, var(--stroke-size-100)));
50
+ margin-top: var(--body-inline-icon-offset-medium, var(--body-inline-icon-offset, var(--stroke-size-200)));
51
51
  }
52
52
 
53
53
  :host([size="x-small"]) ::slotted([slot="before"]),
@@ -57,12 +57,14 @@ class l extends HTMLElement {
57
57
 
58
58
  :host([size="small"]) ::slotted([slot="before"]),
59
59
  :host([size="small"]) ::slotted([slot="after"]) {
60
- margin-top: var(--body-inline-icon-offset-small, var(--body-inline-icon-offset, var(--stroke-size-100)));
60
+ margin-top: var(
61
+ --body-inline-icon-offset-small, var(--body-inline-icon-offset)
62
+ );
61
63
  }
62
64
 
63
65
  :host([size="large"]) ::slotted([slot="before"]),
64
66
  :host([size="large"]) ::slotted([slot="after"]) {
65
- margin-top: var(--body-inline-icon-offset-large, var(--body-inline-icon-offset, var(--stroke-size-100)));
67
+ margin-top: var(--body-inline-icon-offset-large, var(--body-inline-icon-offset, var(--stroke-size-050)));
66
68
  }
67
69
 
68
70
  :host([size="x-small"]) p {
@@ -379,6 +379,7 @@ class h extends HTMLElement {
379
379
  /* Dropdown Slot */
380
380
  :host([size][dropdown-slot]) button {
381
381
  border-radius: var(--radius-000);
382
+ white-space: nowrap;
382
383
  }
383
384
 
384
385
  :host([size][dropdown-slot-first]) button {
@@ -514,6 +515,31 @@ class h extends HTMLElement {
514
515
  border-radius: var(--action-radius-large);
515
516
  }
516
517
 
518
+ /* Dropdown slot corner radius must win over size radius rules */
519
+ :host([size][dropdown-slot]) button,
520
+ :host([size][dropdown-slot]) button:hover,
521
+ :host([size][dropdown-slot]) button:focus,
522
+ :host([size][dropdown-slot]) button:disabled {
523
+ border-radius: var(--radius-000);
524
+ white-space: nowrap;
525
+ }
526
+
527
+ :host([size][dropdown-slot-first]) button,
528
+ :host([size][dropdown-slot-first]) button:hover,
529
+ :host([size][dropdown-slot-first]) button:focus,
530
+ :host([size][dropdown-slot-first]) button:disabled {
531
+ border-top-left-radius: calc(var(--radius-100) / 2);
532
+ border-top-right-radius: calc(var(--radius-100) / 2);
533
+ }
534
+
535
+ :host([size][dropdown-slot-last]) button,
536
+ :host([size][dropdown-slot-last]) button:hover,
537
+ :host([size][dropdown-slot-last]) button:focus,
538
+ :host([size][dropdown-slot-last]) button:disabled {
539
+ border-bottom-left-radius: calc(var(--radius-100) / 2);
540
+ border-bottom-right-radius: calc(var(--radius-100) / 2);
541
+ }
542
+
517
543
  :host([size="xx-small"][icon-only]) button {
518
544
  height: calc(var(--action-icon-only-size-x-small) - var(--space-100));
519
545
  width: calc(var(--action-icon-only-size-x-small) - var(--space-100));
@@ -637,19 +663,19 @@ class h extends HTMLElement {
637
663
  this.shadowRoot.innerHTML = o, await customElements.whenDefined("mui-button"), requestAnimationFrame(() => {
638
664
  const s = this.shadowRoot;
639
665
  if (!s) return;
640
- const e = s.querySelector("slot:not([name])"), t = s.querySelector('slot[name="before"]'), a = s.querySelector('slot[name="after"]'), i = (c) => c ? c.assignedNodes({ flatten: !0 }).some((n) => {
666
+ const e = s.querySelector("slot:not([name])"), t = s.querySelector('slot[name="before"]'), a = s.querySelector('slot[name="after"]'), i = (d) => d ? d.assignedNodes({ flatten: !0 }).some((n) => {
641
667
  var l;
642
668
  return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!((l = n.textContent) != null && l.trim());
643
- }) : !1, d = i(t), u = i(a);
644
- this.toggleAttribute("has-before", d), this.toggleAttribute("has-after", u);
669
+ }) : !1, c = i(t), u = i(a);
670
+ this.toggleAttribute("has-before", c), this.toggleAttribute("has-after", u);
645
671
  const v = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) ?? [];
646
- v.every((c) => {
672
+ v.every((d) => {
647
673
  var n;
648
- if (c.nodeType === Node.ELEMENT_NODE) {
649
- const l = c;
674
+ if (d.nodeType === Node.ELEMENT_NODE) {
675
+ const l = d;
650
676
  return l.tagName.toLowerCase() === "svg" || l.classList.contains("mui-icon");
651
677
  }
652
- return c.nodeType === Node.TEXT_NODE && !((n = c.textContent) != null && n.trim());
678
+ return d.nodeType === Node.TEXT_NODE && !((n = d.textContent) != null && n.trim());
653
679
  }) ? (this.setAttribute("icon-only", ""), this.updateIconSizes(v, !0)) : (this.removeAttribute("icon-only"), [t, e, a].forEach((n) => {
654
680
  if (n) {
655
681
  const l = n.assignedNodes({ flatten: !0 });
@@ -672,9 +698,9 @@ class h extends HTMLElement {
672
698
  t.querySelector('slot[name="before"]'),
673
699
  t.querySelector('slot[name="after"]')
674
700
  ], i = this.hasAttribute("icon-only");
675
- a.forEach((d) => {
676
- if (d) {
677
- const u = d.assignedNodes({ flatten: !0 });
701
+ a.forEach((c) => {
702
+ if (c) {
703
+ const u = c.assignedNodes({ flatten: !0 });
678
704
  this.updateIconSizes(u, i), this.updateAvatarSizes(u), this.updateBadgeSizes(u);
679
705
  }
680
706
  });
@@ -1,4 +1,4 @@
1
- class a extends HTMLElement {
1
+ class n extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this.currentIndex = 0, this.boundMouseEnter = () => this.pauseAutoRotate(), this.boundMouseLeave = () => this.resumeAutoRotate(), this.boundFocusIn = () => this.pauseAutoRotate(), this.boundFocusOut = () => this.resumeAutoRotate(), this.shadow = this.attachShadow({ mode: "open" }), this.handleTabChange = this.handleTabChange.bind(this);
4
4
  }
@@ -7,13 +7,13 @@ class a extends HTMLElement {
7
7
  }
8
8
  connectedCallback() {
9
9
  this.hasAttribute("direction") || this.setAttribute("direction", "horizontal"), this.render(), this.addEventListener("tab-change", this.handleTabChange);
10
- const t = this.querySelector("tab-bar");
10
+ const t = this.querySelector("mui-tab-bar");
11
11
  if (t) {
12
- const e = t.querySelector("tab-item[active]");
12
+ const e = t.querySelector("mui-tab-item[active]");
13
13
  if (e)
14
14
  this.updatePanels(e.id);
15
15
  else {
16
- const o = t.querySelector("tab-item");
16
+ const o = t.querySelector("mui-tab-item");
17
17
  o && (o.setAttribute("active", ""), this.updatePanels(o.id));
18
18
  }
19
19
  }
@@ -56,11 +56,11 @@ class a extends HTMLElement {
56
56
  const o = t[this.currentIndex].getAttribute("item");
57
57
  if (console.log("➡️ Rotating to index:", this.currentIndex, "itemId:", o), o) {
58
58
  this.updatePanels(o);
59
- const s = this.querySelector("tab-bar");
59
+ const s = this.querySelector("mui-tab-bar");
60
60
  if (s) {
61
- const r = s.querySelector(`tab-item#${o}`);
62
- r && (s.querySelectorAll("tab-item").forEach((n) => {
63
- n.removeAttribute("active");
61
+ const r = s.querySelector(`mui-tab-item#${o}`);
62
+ r && (s.querySelectorAll("mui-tab-item").forEach((i) => {
63
+ i.removeAttribute("active");
64
64
  }), r.setAttribute("active", ""));
65
65
  }
66
66
  }
@@ -173,7 +173,7 @@ class a extends HTMLElement {
173
173
  console.error("❌ Track element not found!");
174
174
  return;
175
175
  }
176
- const s = Array.from(e).findIndex((n) => n.getAttribute("item") === t);
176
+ const s = Array.from(e).findIndex((i) => i.getAttribute("item") === t);
177
177
  if (s === -1) {
178
178
  console.warn("⚠️ Panel not found for:", t);
179
179
  return;
@@ -183,4 +183,4 @@ class a extends HTMLElement {
183
183
  console.log("🎬 Setting transform to:", r), console.log("📏 Current transform:", o.style.transform), console.log("🎨 Current transition:", window.getComputedStyle(o).transition), o.style.transform = r, o.offsetHeight, console.log("✅ After setting transform:", o.style.transform);
184
184
  }
185
185
  }
186
- customElements.get("mui-carousel-controller") || customElements.define("mui-carousel-controller", a);
186
+ customElements.get("mui-carousel-controller") || customElements.define("mui-carousel-controller", n);
@@ -1,4 +1,4 @@
1
- const o = class o extends HTMLElement {
1
+ const s = class s extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this.button = null, this.menu = null, this.handleResize = () => {
4
4
  var t;
@@ -8,13 +8,13 @@ const o = class o extends HTMLElement {
8
8
  (t = this.menu) != null && t.classList.contains("show") && this.adjustPosition();
9
9
  }, this.handleFocusOut = (t) => {
10
10
  var e;
11
- this.persistent || this.contains(t.relatedTarget) || (this.closeWithAnimation(), (e = this.menu) == null || e.setAttribute("inert", "true"), o.openDropdown === this && (o.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
11
+ this.persistent || this.contains(t.relatedTarget) || (this.closeWithAnimation(), (e = this.menu) == null || e.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
12
12
  }, this.attachShadow({ mode: "open" });
13
13
  }
14
14
  handleKeyDown(t) {
15
15
  if (t.key === "Escape") {
16
16
  if (!this.menu) return;
17
- this.menu.classList.remove("show"), this.menu.setAttribute("inert", "true"), o.openDropdown === this && (o.openDropdown = null), this.dispatchEvent(
17
+ this.menu.classList.remove("show"), this.menu.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(
18
18
  new CustomEvent("dropdown-toggle", {
19
19
  detail: { open: !1 },
20
20
  bubbles: !0
@@ -43,14 +43,14 @@ const o = class o extends HTMLElement {
43
43
  const d = (a = this.shadowRoot) == null ? void 0 : a.querySelector("slot:not([name])");
44
44
  if (d) {
45
45
  const u = () => {
46
- const c = d.assignedElements({ flatten: !0 }).filter((s) => s.tagName.toLowerCase() === "mui-button");
47
- c.forEach((s) => {
48
- s.removeAttribute("dropdown-slot"), s.removeAttribute("dropdown-slot-first"), s.removeAttribute("dropdown-slot-last");
49
- }), c.forEach((s, w) => {
50
- s.setAttribute("dropdown-slot", ""), w === 0 && s.setAttribute("dropdown-slot-first", ""), w === c.length - 1 && s.setAttribute("dropdown-slot-last", ""), s._dropdownListenerAdded || (s.addEventListener("click", () => {
46
+ const c = d.assignedElements({ flatten: !0 }).filter((o) => o.tagName.toLowerCase() === "mui-button");
47
+ c.forEach((o) => {
48
+ o.removeAttribute("dropdown-slot"), o.removeAttribute("dropdown-slot-first"), o.removeAttribute("dropdown-slot-last");
49
+ }), c.forEach((o, w) => {
50
+ o.hasAttribute("variant") || o.setAttribute("variant", "tertiary"), o.setAttribute("dropdown-slot", ""), w === 0 && o.setAttribute("dropdown-slot-first", ""), w === c.length - 1 && o.setAttribute("dropdown-slot-last", ""), o._dropdownListenerAdded || (o.addEventListener("click", () => {
51
51
  var p, f;
52
- this.persistent || ((p = this.menu) == null || p.classList.remove("show"), (f = this.menu) == null || f.setAttribute("inert", "true"), o.openDropdown === this && (o.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
53
- }), s._dropdownListenerAdded = !0);
52
+ this.persistent || ((p = this.menu) == null || p.classList.remove("show"), (f = this.menu) == null || f.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
53
+ }), o._dropdownListenerAdded = !0);
54
54
  });
55
55
  };
56
56
  d.addEventListener("slotchange", u), u();
@@ -71,23 +71,23 @@ const o = class o extends HTMLElement {
71
71
  var n;
72
72
  if (t.stopPropagation(), !this.menu) return;
73
73
  const e = this.menu.classList.contains("show");
74
- !e && o.openDropdown && o.openDropdown !== this && o.openDropdown.closeWithAnimation(), e ? (this.closeWithAnimation(), (n = this.menu) == null || n.setAttribute("inert", "true"), o.openDropdown === this && (o.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 }))) : (this.menu.style.display = "block", requestAnimationFrame(() => {
74
+ !e && s.openDropdown && s.openDropdown !== this && s.openDropdown.closeWithAnimation(), e ? (this.closeWithAnimation(), (n = this.menu) == null || n.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 }))) : (this.menu.style.display = "block", requestAnimationFrame(() => {
75
75
  var d, i;
76
76
  (d = this.menu) == null || d.classList.add("show"), (i = this.menu) == null || i.removeAttribute("inert"), this.adjustPosition();
77
- }), o.openDropdown = this, this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !0 }, bubbles: !0 })));
77
+ }), s.openDropdown = this, this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !0 }, bubbles: !0 })));
78
78
  }
79
79
  closeMenu(t) {
80
80
  var n;
81
81
  const e = t.composedPath();
82
- this.menu && e.includes(this.menu) || this.button && e.includes(this.button) || (this.closeWithAnimation(), (n = this.menu) == null || n.setAttribute("inert", "true"), o.openDropdown === this && (o.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
82
+ this.menu && e.includes(this.menu) || this.button && e.includes(this.button) || (this.closeWithAnimation(), (n = this.menu) == null || n.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
83
83
  }
84
84
  adjustPosition() {
85
85
  if (!this.menu) return;
86
86
  const t = this.menu, e = 8, n = getComputedStyle(this).getPropertyValue("--dropdown-offset").trim() || "0.8rem", d = parseFloat(getComputedStyle(document.documentElement).fontSize) || 10, i = n.endsWith("rem") ? parseFloat(n) * d : parseFloat(n) || 8;
87
87
  t.style.top = "", t.style.bottom = "", t.style.left = "", t.style.right = "", t.style.maxWidth = "";
88
- const r = this.getBoundingClientRect(), l = t.offsetWidth, a = t.offsetHeight, h = window.innerWidth, u = window.innerHeight, v = (this.getAttribute("vertical-position") || "auto").toLowerCase(), c = u - r.bottom, s = r.top, w = a + i, p = c >= w, f = s >= w;
88
+ const r = this.getBoundingClientRect(), l = t.offsetWidth, a = t.offsetHeight, h = window.innerWidth, u = window.innerHeight, v = (this.getAttribute("vertical-position") || "auto").toLowerCase(), c = u - r.bottom, o = r.top, w = a + i, p = c >= w, f = o >= w;
89
89
  let b = r.height + i;
90
- v === "up" ? b = f || !p ? -(a + i) : r.height + i : v === "down" ? b = p || !f ? r.height + i : -(a + i) : !p && s > c && (b = -(a + i));
90
+ v === "up" ? b = f || !p ? -(a + i) : r.height + i : v === "down" ? b = p || !f ? r.height + i : -(a + i) : !p && o > c && (b = -(a + i));
91
91
  let m = 0;
92
92
  switch (this.getAttribute("position") || "left") {
93
93
  case "left":
@@ -168,6 +168,6 @@ const o = class o extends HTMLElement {
168
168
  `;
169
169
  }
170
170
  };
171
- o.openDropdown = null;
172
- let g = o;
171
+ s.openDropdown = null;
172
+ let g = s;
173
173
  customElements.get("mui-dropdown") || customElements.define("mui-dropdown", g);
@@ -1,17 +1,17 @@
1
- class y extends HTMLElement {
1
+ class T extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this.openTimer = null, this.closeTimer = null, this.hasOpenedOnce = !1, this.boundReposition = () => this.positionTooltip(), this.boundDocPointer = (t) => {
4
4
  t.composedPath().includes(this) || this.close(!0);
5
5
  }, this.attachShadow({ mode: "open" });
6
6
  }
7
7
  static get observedAttributes() {
8
- return ["placement", "open", "delay", "initial-delay"];
8
+ return ["placement", "open", "delay", "initial-delay", "size"];
9
9
  }
10
10
  connectedCallback() {
11
- this.hasAttribute("placement") || this.setAttribute("placement", "top"), this.render(), this.setupEvents();
11
+ this.hasAttribute("placement") || this.setAttribute("placement", "top"), this.render(), this.setupEvents(), this.syncTriggerSize();
12
12
  }
13
13
  attributeChangedCallback() {
14
- this.shadowRoot && this.hasAttribute("open") && requestAnimationFrame(() => this.positionTooltip());
14
+ this.shadowRoot && (this.syncTriggerSize(), this.hasAttribute("open") && requestAnimationFrame(() => this.positionTooltip()));
15
15
  }
16
16
  render() {
17
17
  if (!this.shadowRoot) return;
@@ -102,11 +102,32 @@ class y extends HTMLElement {
102
102
  `;
103
103
  }
104
104
  setupEvents() {
105
- var o;
106
- const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".trigger");
107
- t && (t.addEventListener("mouseenter", () => this.openWithDelay()), t.addEventListener("mouseleave", () => this.closeWithDelay()), t.addEventListener("focusin", () => this.openWithDelay()), t.addEventListener("focusout", () => this.close(!0)), this.addEventListener("keydown", (h) => {
108
- h.key === "Escape" && this.close(!0);
109
- }));
105
+ var r, p;
106
+ const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".trigger");
107
+ if (!t) return;
108
+ const o = (p = this.shadowRoot) == null ? void 0 : p.querySelector('slot[name="trigger"]');
109
+ t.addEventListener("mouseenter", () => this.openWithDelay()), t.addEventListener("mouseleave", () => this.closeWithDelay()), t.addEventListener("focusin", () => this.openWithDelay()), t.addEventListener("focusout", () => this.close(!0)), o == null || o.addEventListener("slotchange", () => this.syncTriggerSize()), this.addEventListener("keydown", (m) => {
110
+ m.key === "Escape" && this.close(!0);
111
+ });
112
+ }
113
+ syncTriggerSize() {
114
+ var u, i;
115
+ const t = (u = this.shadowRoot) == null ? void 0 : u.querySelector('slot[name="trigger"]');
116
+ if (!t) return;
117
+ const o = this.getAttribute("size") || ((i = this.closest("mui-body")) == null ? void 0 : i.getAttribute("size")) || "medium", r = {
118
+ "x-small": "x-small",
119
+ small: "small",
120
+ medium: "small",
121
+ large: "medium"
122
+ }, p = {
123
+ "x-small": "xx-small",
124
+ small: "x-small",
125
+ medium: "small",
126
+ large: "medium"
127
+ }, m = r[o] || "small", h = p[o] || "small";
128
+ t.assignedElements({ flatten: !0 }).forEach((s) => {
129
+ s.tagName.startsWith("MUI-ICON-") && !s.hasAttribute("size") && s.setAttribute("size", m), s.tagName === "MUI-BADGE" && !s.hasAttribute("size") && s.setAttribute("size", h);
130
+ });
110
131
  }
111
132
  getDelay() {
112
133
  const t = Number(this.getAttribute("delay"));
@@ -131,16 +152,16 @@ class y extends HTMLElement {
131
152
  this.openTimer && (window.clearTimeout(this.openTimer), this.openTimer = null), this.closeTimer && (window.clearTimeout(this.closeTimer), this.closeTimer = null), t && this.setAttribute("closing-immediate", ""), this.removeAttribute("open"), t && requestAnimationFrame(() => this.removeAttribute("closing-immediate")), window.removeEventListener("resize", this.boundReposition), window.removeEventListener("scroll", this.boundReposition, !0), document.removeEventListener("pointerdown", this.boundDocPointer, !0);
132
153
  }
133
154
  positionTooltip() {
134
- var u, g, b, f;
135
- const t = (u = this.shadowRoot) == null ? void 0 : u.querySelector(".trigger"), o = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".tooltip");
155
+ var b, f, w, v;
156
+ const t = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".trigger"), o = (f = this.shadowRoot) == null ? void 0 : f.querySelector(".tooltip");
136
157
  if (!o || !t) return;
137
- const h = (b = this.shadowRoot) == null ? void 0 : b.querySelector('slot[name="trigger"]'), w = ((f = h == null ? void 0 : h.assignedElements({ flatten: !0 })) == null ? void 0 : f[0]) || null || t, d = this.getAttribute("placement") || "top", e = w.getBoundingClientRect(), p = this.getBoundingClientRect(), i = o.getBoundingClientRect(), c = window.innerHeight, m = window.innerWidth, n = 8, r = 8;
138
- let s = d;
139
- d === "top" && e.top - i.height - r < n && (s = "bottom"), d === "bottom" && e.bottom + i.height + r > c - n && (s = "top"), d === "left" && e.left - i.width - r < n && (s = "right"), d === "right" && e.right + i.width + r > m - n && (s = "left"), o.setAttribute("data-placement", s);
140
- let a = 0, l = 0;
141
- s === "top" ? (a = e.top - i.height - r, l = e.left + e.width / 2 - i.width / 2) : s === "bottom" ? (a = e.bottom + r, l = e.left + e.width / 2 - i.width / 2) : s === "left" ? (a = e.top + e.height / 2 - i.height / 2, l = e.left - i.width - r) : (a = e.top + e.height / 2 - i.height / 2, l = e.right + r), a = Math.max(n, Math.min(a, c - i.height - n)), l = Math.max(n, Math.min(l, m - i.width - n));
142
- const v = a - p.top, x = l - p.left;
143
- o.style.top = `${v}px`, o.style.left = `${x}px`;
158
+ const r = (w = this.shadowRoot) == null ? void 0 : w.querySelector('slot[name="trigger"]'), m = ((v = r == null ? void 0 : r.assignedElements({ flatten: !0 })) == null ? void 0 : v[0]) || null || t, h = this.getAttribute("placement") || "top", e = m.getBoundingClientRect(), u = this.getBoundingClientRect(), i = o.getBoundingClientRect(), s = window.innerHeight, g = window.innerWidth, n = 8, a = 8;
159
+ let l = h;
160
+ h === "top" && e.top - i.height - a < n && (l = "bottom"), h === "bottom" && e.bottom + i.height + a > s - n && (l = "top"), h === "left" && e.left - i.width - a < n && (l = "right"), h === "right" && e.right + i.width + a > g - n && (l = "left"), o.setAttribute("data-placement", l);
161
+ let d = 0, c = 0;
162
+ l === "top" ? (d = e.top - i.height - a, c = e.left + e.width / 2 - i.width / 2) : l === "bottom" ? (d = e.bottom + a, c = e.left + e.width / 2 - i.width / 2) : l === "left" ? (d = e.top + e.height / 2 - i.height / 2, c = e.left - i.width - a) : (d = e.top + e.height / 2 - i.height / 2, c = e.right + a), d = Math.max(n, Math.min(d, s - i.height - n)), c = Math.max(n, Math.min(c, g - i.width - n));
163
+ const x = d - u.top, y = c - u.left;
164
+ o.style.top = `${x}px`, o.style.left = `${y}px`;
144
165
  }
145
166
  }
146
- customElements.get("mui-hint") || customElements.define("mui-hint", y);
167
+ customElements.get("mui-hint") || customElements.define("mui-hint", T);
@@ -46,11 +46,11 @@ class l extends HTMLElement {
46
46
  h && (this.setActiveTab(h), h.focus());
47
47
  }), s.forEach((t, i) => {
48
48
  t.classList.remove("first", "middle", "last", "only"), s.length === 1 ? t.classList.add("only") : i === 0 ? t.classList.add("first") : i === s.length - 1 ? t.classList.add("last") : t.classList.add("middle");
49
- }), s.forEach((t) => {
50
- const i = t;
51
- i.addEventListener("click", () => {
52
- this.setActiveTab(i);
53
- });
49
+ }), this.addEventListener("click", (t) => {
50
+ const r = (typeof t.composedPath == "function" ? t.composedPath() : []).find(
51
+ (h) => h instanceof HTMLElement && h.tagName.toLowerCase() === "mui-tab-item"
52
+ ), n = t.target instanceof HTMLElement ? t.target.closest("mui-tab-item") : null, o = r || n;
53
+ !o || !this.contains(o) || this.setActiveTab(o);
54
54
  }), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
55
55
  `
56
56
  <style>
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Thu, 19 Mar 2026 13:05:27 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Sat, 21 Mar 2026 05:19:16 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -172,6 +172,7 @@
172
172
  --stroke-size-300: 3px;
173
173
  --stroke-size-400: 4px;
174
174
  --stroke-size-500: 5px;
175
+ --stroke-size-050: 0.5px;
175
176
  --stroke-solid: solid;
176
177
  --stroke-outset: outset;
177
178
  --speed-100: 0.1s;