@muibook/components 18.1.0 → 18.1.1

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.
@@ -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 {
@@ -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,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 Thu, 19 Mar 2026 13:50:01 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */