@muibook/components 9.1.0 → 10.0.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 (40) hide show
  1. package/dist/esm/components/mui-accordion/block/index.js +6 -6
  2. package/dist/esm/components/mui-alert/index.js +43 -40
  3. package/dist/esm/components/mui-badge/index.js +15 -7
  4. package/dist/esm/components/mui-button/index.js +41 -42
  5. package/dist/esm/components/mui-card/body/index.js +31 -31
  6. package/dist/esm/components/mui-card/card/index.js +6 -6
  7. package/dist/esm/components/mui-card/footer/index.js +10 -10
  8. package/dist/esm/components/mui-carousel/controller/index.js +75 -9
  9. package/dist/esm/components/mui-chip/index.js +40 -31
  10. package/dist/esm/components/mui-dropdown/index.js +45 -44
  11. package/dist/esm/components/mui-icons/ai/index.js +58 -0
  12. package/dist/esm/components/mui-icons/index.js +8 -0
  13. package/dist/esm/components/mui-icons/pin/index.js +53 -0
  14. package/dist/esm/components/mui-icons/pin-slash/index.js +53 -0
  15. package/dist/esm/components/mui-icons/rectangle/index.js +55 -0
  16. package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +58 -0
  17. package/dist/esm/components/mui-icons/rectangle-dashed/index.js +55 -0
  18. package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +55 -0
  19. package/dist/esm/components/mui-icons/rectangle-media-text/index.js +55 -0
  20. package/dist/esm/components/mui-link/index.js +44 -44
  21. package/dist/esm/components/mui-slat/slat/index.js +6 -6
  22. package/dist/esm/components/mui-switch/index.js +19 -19
  23. package/dist/esm/components/mui-table/cell/index.js +4 -4
  24. package/dist/esm/components/mui-tabs/item/index.js +9 -9
  25. package/dist/esm/components/mui-tabs/tab-bar/index.js +17 -16
  26. package/dist/esm/css/mui-brand.css +1 -1
  27. package/dist/esm/css/mui-tokens.css +4 -0
  28. package/dist/esm/custom-elements.json +705 -275
  29. package/dist/esm/index.js +12 -4
  30. package/dist/types/components/mui-icons/ai.d.ts +1 -0
  31. package/dist/types/components/mui-icons/index.d.ts +8 -0
  32. package/dist/types/components/mui-icons/pin-slash.d.ts +1 -0
  33. package/dist/types/components/mui-icons/pin.d.ts +1 -0
  34. package/dist/types/components/mui-icons/rectangle-bottom-panel.d.ts +1 -0
  35. package/dist/types/components/mui-icons/rectangle-dashed.d.ts +1 -0
  36. package/dist/types/components/mui-icons/rectangle-left-drawer.d.ts +1 -0
  37. package/dist/types/components/mui-icons/rectangle-media-text.d.ts +1 -0
  38. package/dist/types/components/mui-icons/rectangle.d.ts +1 -0
  39. package/dist/types/index.d.ts +8 -0
  40. package/package.json +29 -1
@@ -11,25 +11,25 @@ class o extends HTMLElement {
11
11
  static get observedAttributes() {
12
12
  return ["label", "disabled", "checked"];
13
13
  }
14
- attributeChangedCallback(s, e, t) {
15
- if (s === "checked" && e !== t && (this._checked = t !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), s === "disabled" && e !== t) {
16
- const i = t !== null;
17
- this._checkbox && (this._checkbox.disabled = i, this._checkbox.setAttribute("aria-disabled", i.toString())), this._updateDisabledState();
14
+ attributeChangedCallback(i, e, t) {
15
+ if (i === "checked" && e !== t && (this._checked = t !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), i === "disabled" && e !== t) {
16
+ const s = t !== null;
17
+ this._checkbox && (this._checkbox.disabled = s, this._checkbox.setAttribute("aria-disabled", s.toString())), this._updateDisabledState();
18
18
  }
19
19
  }
20
20
  get checked() {
21
21
  return this._checked;
22
22
  }
23
- set checked(s) {
24
- const e = !!s;
23
+ set checked(i) {
24
+ const e = !!i;
25
25
  this._checked !== e && (this._checked = e, e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checkbox && (this._checkbox.checked = this._checked, this._checkbox.setAttribute("aria-checked", this._checked.toString()), this._updateIcons()));
26
26
  }
27
27
  _cleanupListeners() {
28
28
  this._checkbox && this._changeHandler && this._checkbox.removeEventListener("change", this._changeHandler);
29
29
  }
30
30
  _updateDisabledState() {
31
- var e, t, i, c;
32
- this.hasAttribute("disabled") ? (this.shadowRoot.host.classList.add("disabled"), (e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (t = this._checkbox) == null || t.setAttribute("tabindex", "-1")) : (this.shadowRoot.host.classList.remove("disabled"), (i = this._checkbox) == null || i.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
31
+ var e, t, s, c;
32
+ this.hasAttribute("disabled") ? ((e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (t = this._checkbox) == null || t.setAttribute("tabindex", "-1")) : ((s = this._checkbox) == null || s.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
33
33
  }
34
34
  _setupListener() {
35
35
  this._checkbox && (this._cleanupListeners(), this._changeHandler = () => {
@@ -43,27 +43,27 @@ class o extends HTMLElement {
43
43
  }, this._checkbox.addEventListener("change", this._changeHandler));
44
44
  }
45
45
  _enforceIconSize() {
46
- const s = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]'), t = (i) => {
47
- if (!i) return;
46
+ const i = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]'), t = (s) => {
47
+ if (!s) return;
48
48
  const c = () => {
49
- i.assignedElements().forEach((h) => {
49
+ s.assignedElements().forEach((h) => {
50
50
  h.tagName.toLowerCase().startsWith("mui-icon") && h.setAttribute("size", "x-small");
51
51
  });
52
52
  };
53
- i.addEventListener("slotchange", c), setTimeout(c, 0);
53
+ s.addEventListener("slotchange", c), setTimeout(c, 0);
54
54
  };
55
- t(s), t(e);
55
+ t(i), t(e);
56
56
  }
57
57
  _updateIcons() {
58
- const s = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]');
59
- s && s.assignedElements().forEach((t) => {
58
+ const i = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]');
59
+ i && i.assignedElements().forEach((t) => {
60
60
  t.style.display = this._checked ? "inline" : "none";
61
61
  }), e && e.assignedElements().forEach((t) => {
62
62
  t.style.display = this._checked ? "none" : "inline";
63
63
  });
64
64
  }
65
65
  render() {
66
- const s = this.getAttribute("label");
66
+ const i = this.getAttribute("label");
67
67
  this.shadowRoot.innerHTML = /*html*/
68
68
  `
69
69
  <style>
@@ -125,11 +125,11 @@ class o extends HTMLElement {
125
125
  fill: var(--switch-icon);
126
126
  }
127
127
 
128
- :host(.disabled) {
128
+ :host([disabled]) {
129
129
  cursor: not-allowed;
130
130
  }
131
131
 
132
- :host(.disabled) .switch {
132
+ :host([disabled]) .switch {
133
133
  opacity: 0.4;
134
134
  pointer-events: none;
135
135
  }
@@ -140,7 +140,7 @@ class o extends HTMLElement {
140
140
  type="checkbox"
141
141
  role="switch"
142
142
  aria-checked="${this._checked}"
143
- ${s ? `aria-label="${s}"` : ""}
143
+ ${i ? `aria-label="${i}"` : ""}
144
144
  >
145
145
  <span class="track">
146
146
  <span class="thumb">
@@ -30,10 +30,10 @@ class t extends HTMLElement {
30
30
  }
31
31
 
32
32
  /* Card Slot (Supports: Table Cell, Accordion Block) */
33
- :host(.card-slot:first-of-type) {
33
+ :host([card-slot]:first-of-type) {
34
34
  padding-left: var(--space-500);
35
35
  }
36
- :host(.card-slot:last-of-type) {
36
+ :host([card-slot]:last-of-type) {
37
37
  padding-right: var(--space-500);
38
38
  }
39
39
  @media (min-width: 768px) {
@@ -43,10 +43,10 @@ class t extends HTMLElement {
43
43
  :host(*:last-of-type) {
44
44
  padding-right: var(--space-600);
45
45
  }
46
- :host(.card-slot:first-of-type) {
46
+ :host([card-slot]:first-of-type) {
47
47
  padding-left: var(--space-600);
48
48
  }
49
- :host(.card-slot:last-of-type) {
49
+ :host([card-slot]:last-of-type) {
50
50
  padding-right: var(--space-600);
51
51
  }
52
52
  }
@@ -1,4 +1,4 @@
1
- class o extends HTMLElement {
1
+ class s extends HTMLElement {
2
2
  updateIcon(t) {
3
3
  if (this.shadowRoot && (this.iconEl && (this.shadowRoot.removeChild(this.iconEl), this.iconEl = void 0), t && t.trim() !== "" && customElements.get(t))) {
4
4
  const e = document.createElement(t);
@@ -11,8 +11,8 @@ class o extends HTMLElement {
11
11
  static get observedAttributes() {
12
12
  return ["active", "icon"];
13
13
  }
14
- attributeChangedCallback(t, e, s) {
15
- t === "active" ? this.updateActiveState() : t === "icon" && this.updateIcon(s);
14
+ attributeChangedCallback(t, e, o) {
15
+ t === "active" ? this.updateActiveState() : t === "icon" && this.updateIcon(o);
16
16
  }
17
17
  connectedCallback() {
18
18
  if (!this.shadowRoot) return;
@@ -40,11 +40,11 @@ class o extends HTMLElement {
40
40
  border-radius: calc(var(--tab-radius) - 0.2rem);
41
41
  }
42
42
 
43
- :host(.active) {
43
+ :host([active]) {
44
44
  color: var(--tab-text-color-active);
45
45
  }
46
46
 
47
- :host(.active:focus-visible) {
47
+ :host([active]:focus-visible) {
48
48
  outline: var(--outline-thick);
49
49
  outline-offset: -5px;
50
50
  }
@@ -56,12 +56,12 @@ class o extends HTMLElement {
56
56
  const i = document.createElement(t);
57
57
  i.setAttribute("color", "var(--tab-icon)"), i.setAttribute("size", "small"), this.shadowRoot.appendChild(i), this.iconEl = i;
58
58
  }
59
- const s = document.createElement("slot");
60
- this.shadowRoot.appendChild(s), this.updateActiveState();
59
+ const o = document.createElement("slot");
60
+ this.shadowRoot.appendChild(o), this.updateActiveState();
61
61
  }
62
62
  updateActiveState() {
63
63
  const t = this.hasAttribute("active");
64
- this.classList.toggle("active", t), this.setAttribute("role", "tab"), this.setAttribute("aria-selected", t ? "true" : "false"), this.setAttribute("tabindex", t ? "0" : "-1"), this.iconEl && this.iconEl.setAttribute("color", t ? "var(--tab-icon-active)" : "var(--tab-icon)");
64
+ this.setAttribute("role", "tab"), this.setAttribute("aria-selected", t ? "true" : "false"), this.setAttribute("tabindex", t ? "0" : "-1"), this.iconEl && this.iconEl.setAttribute("color", t ? "var(--tab-icon-active)" : "var(--tab-icon)");
65
65
  }
66
66
  }
67
- customElements.get("mui-tab-item") || customElements.define("mui-tab-item", o);
67
+ customElements.get("mui-tab-item") || customElements.define("mui-tab-item", s);
@@ -1,4 +1,4 @@
1
- class c extends HTMLElement {
1
+ class l extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this._animationSpeed = 200, this.attachShadow({ mode: "open" }), this._handleResize = this._handleResize.bind(this), this._hasInitialized = !1, this._resizeTimeout = null, this._observedTab = null, this._activeTab = null, this._resizeObserver = new ResizeObserver(() => {
4
4
  this._activeTab && this._updateHighlight(this._activeTab);
@@ -8,23 +8,23 @@ class c extends HTMLElement {
8
8
  const i = this.getAttribute("speed") || "200";
9
9
  this._animationSpeed = parseInt(i, 10);
10
10
  const s = Array.from(this.children);
11
- this.hasAttribute("full-width") && this.classList.add("full-width"), this.setAttribute("role", "tablist");
12
- const n = this.getAttribute("orientation") || "horizontal";
13
- this.setAttribute("aria-orientation", n), this.addEventListener("keydown", (e) => {
14
- const t = Array.from(this.children), r = t.findIndex((l) => l.hasAttribute("active")), h = this.getAttribute("aria-orientation") || "horizontal";
11
+ this.setAttribute("role", "tablist");
12
+ const a = this.getAttribute("orientation") || "horizontal";
13
+ this.setAttribute("aria-orientation", a), this.addEventListener("keydown", (e) => {
14
+ const t = Array.from(this.children), r = t.findIndex((d) => d.hasAttribute("active")), n = this.getAttribute("aria-orientation") || "horizontal";
15
15
  let o = r;
16
16
  switch (e.key) {
17
17
  case "ArrowRight":
18
- h === "horizontal" && (o = (r + 1) % t.length, e.preventDefault());
18
+ n === "horizontal" && (o = (r + 1) % t.length, e.preventDefault());
19
19
  break;
20
20
  case "ArrowLeft":
21
- h === "horizontal" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
21
+ n === "horizontal" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
22
22
  break;
23
23
  case "ArrowDown":
24
- h === "vertical" && (o = (r + 1) % t.length, e.preventDefault());
24
+ n === "vertical" && (o = (r + 1) % t.length, e.preventDefault());
25
25
  break;
26
26
  case "ArrowUp":
27
- h === "vertical" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
27
+ n === "vertical" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
28
28
  break;
29
29
  case "Home":
30
30
  o = 0, e.preventDefault();
@@ -35,8 +35,8 @@ class c extends HTMLElement {
35
35
  default:
36
36
  return;
37
37
  }
38
- const d = t[o];
39
- d && (this.setActiveTab(d), d.focus());
38
+ const h = t[o];
39
+ h && (this.setActiveTab(h), h.focus());
40
40
  }), s.forEach((e, t) => {
41
41
  e.classList.remove("first", "middle", "last", "only"), s.length === 1 ? e.classList.add("only") : t === 0 ? e.classList.add("first") : t === s.length - 1 ? e.classList.add("last") : e.classList.add("middle");
42
42
  }), s.forEach((e) => {
@@ -61,7 +61,7 @@ class c extends HTMLElement {
61
61
  overflow: hidden;
62
62
  }
63
63
 
64
- :host(.full-width) {
64
+ :host([full-width]) {
65
65
  display: flex;
66
66
  width: 100%;
67
67
  }
@@ -78,7 +78,7 @@ class c extends HTMLElement {
78
78
  box-sizing: border-box;
79
79
  box-shadow: 0 0 4px 4px var(--tab-shadow-active);
80
80
  will-change: transform, width;
81
- transform: translateX(0);
81
+ transform: translateX(0) translateZ(0);
82
82
  width: 0;
83
83
  }
84
84
 
@@ -87,6 +87,7 @@ class c extends HTMLElement {
87
87
  z-index: 1;
88
88
  flex: 1;
89
89
  contain: content; /* Performance optimization */
90
+ transform: translateZ(0);
90
91
  }
91
92
  </style>
92
93
  <div class="highlight"></div>
@@ -114,8 +115,8 @@ class c extends HTMLElement {
114
115
  }, 100));
115
116
  }
116
117
  _updateHighlight(i) {
117
- const s = this.shadowRoot.querySelector(".highlight"), a = i.getBoundingClientRect(), n = this.getBoundingClientRect(), e = parseFloat(getComputedStyle(this).borderWidth) || 0, t = a.left - n.left - e;
118
- s.style.transform = `translateX(${t}px)`, s.style.width = `${a.width}px`;
118
+ const s = this.shadowRoot.querySelector(".highlight"), a = i.getBoundingClientRect(), e = this.getBoundingClientRect(), t = parseFloat(getComputedStyle(this).borderWidth) || 0, r = a.left - e.left - t;
119
+ s.style.transform = `translateX(${r}px) translateZ(0)`, s.style.width = `${a.width}px`;
119
120
  }
120
121
  setActiveTab(i) {
121
122
  if (Array.from(this.children).forEach((a) => a.removeAttribute("active")), i.setAttribute("active", ""), this._activeTab = i, this._observedTab && this._observedTab !== i && this._resizeObserver.unobserve(this._observedTab), this._observedTab = i, this._resizeObserver.observe(i), this._hasInitialized)
@@ -133,4 +134,4 @@ class c extends HTMLElement {
133
134
  );
134
135
  }
135
136
  }
136
- customElements.get("mui-tab-bar") || customElements.define("mui-tab-bar", c);
137
+ customElements.get("mui-tab-bar") || customElements.define("mui-tab-bar", l);
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Thu, 08 Jan 2026 02:39:52 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Wed, 04 Feb 2026 04:53:47 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -555,6 +555,10 @@ html[data-theme="dark"] {
555
555
  /* 4. SET THE FOUNDATION */
556
556
  /* ==================================================================================================== */
557
557
  :where(html) {
558
+ /* Dropdown */
559
+ --dropdown-offset: var(--space-200);
560
+ --dropdown-min-width: 15rem;
561
+
558
562
  /* Feedback - Border (Alerts & Messages) */
559
563
  --feedback-neutral-border: var(--stroke-size-200) var(--stroke-solid) var(--feedback-neutral-border-color);
560
564
  --feedback-positive-border: var(--stroke-size-200) var(--stroke-solid) var(--feedback-positive-border-color);