@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.
@@ -49,16 +49,16 @@ class n extends HTMLElement {
49
49
  small: "xx-small",
50
50
  medium: "x-small",
51
51
  large: "x-small"
52
- }[e] || "x-small", a = (h) => {
52
+ }[e] || "x-small", o = (h) => {
53
53
  if (!h) return;
54
- const o = () => {
54
+ const a = () => {
55
55
  h.assignedElements().forEach((r) => {
56
56
  r.tagName.toLowerCase().startsWith("mui-icon") && r.setAttribute("size", c);
57
57
  });
58
58
  };
59
- h.addEventListener("slotchange", o), setTimeout(o, 0);
59
+ h.addEventListener("slotchange", a), setTimeout(a, 0);
60
60
  };
61
- a(s), a(t);
61
+ o(s), o(t);
62
62
  }
63
63
  _updateIcons() {
64
64
  const s = this.shadowRoot.querySelector('slot[name="on-icon"]'), t = this.shadowRoot.querySelector('slot[name="off-icon"]');
@@ -78,8 +78,8 @@ class n extends HTMLElement {
78
78
  .switch {
79
79
  position: relative;
80
80
  display: inline-block;
81
- width: var(--_switch-width, var(--switch-width));
82
- height: var(--_switch-height, var(--switch-height));
81
+ width: var(--switch-width-computed, var(--switch-width));
82
+ height: var(--switch-height-computed, var(--switch-height));
83
83
  }
84
84
 
85
85
  .switch input {
@@ -101,15 +101,15 @@ class n extends HTMLElement {
101
101
  bottom: 0;
102
102
  background-color: var(--switch-track-background);
103
103
  transition: background-color var(--speed-200);
104
- border-radius: var(--_switch-height, var(--switch-height));
104
+ border-radius: var(--switch-height-computed, var(--switch-height));
105
105
  }
106
106
 
107
107
  .thumb {
108
108
  position: absolute;
109
- top: var(--_switch-offset, var(--switch-offset));
110
- left: var(--_switch-offset, var(--switch-offset));
111
- width: var(--_switch-thumb-size, var(--switch-thumb-size));
112
- height: var(--_switch-thumb-size, var(--switch-thumb-size));
109
+ top: var(--switch-offset-computed, var(--switch-offset));
110
+ left: var(--switch-offset-computed, var(--switch-offset));
111
+ width: var(--switch-thumb-size-computed, var(--switch-thumb-size));
112
+ height: var(--switch-thumb-size-computed, var(--switch-thumb-size));
113
113
  background-color: var(--switch-thumb-bg);
114
114
  transition: transform var(--speed-200);
115
115
  border-radius: 50%;
@@ -125,36 +125,36 @@ class n extends HTMLElement {
125
125
  input:checked + .track .thumb {
126
126
  transform: translateX(
127
127
  calc(
128
- var(--_switch-width, var(--switch-width)) -
129
- var(--_switch-thumb-size, var(--switch-thumb-size)) -
130
- (var(--_switch-offset, var(--switch-offset)) * 2)
128
+ var(--switch-width-computed, var(--switch-width)) -
129
+ var(--switch-thumb-size-computed, var(--switch-thumb-size)) -
130
+ (var(--switch-offset-computed, var(--switch-offset)) * 2)
131
131
  )
132
132
  );
133
133
  }
134
134
 
135
135
  :host([size="x-small"]) {
136
- --_switch-offset: var(--stroke-size-100);
137
- --_switch-thumb-size: calc(var(--action-icon-only-size-x-small) - var(--space-200));
138
- --_switch-height: calc(var(--_switch-thumb-size) + (var(--_switch-offset) * 2));
139
- --_switch-width: calc(var(--_switch-height) * 1.6);
136
+ --switch-offset-computed: var(--stroke-size-100);
137
+ --switch-thumb-size-computed: calc(var(--action-icon-only-size-x-small) - var(--space-200));
138
+ --switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
139
+ --switch-width-computed: calc(var(--switch-height-computed) * 1.6);
140
140
  }
141
141
  :host([size="small"]) {
142
- --_switch-offset: var(--stroke-size-100);
143
- --_switch-thumb-size: calc(var(--action-icon-only-size-small) - var(--space-200));
144
- --_switch-height: calc(var(--_switch-thumb-size) + (var(--_switch-offset) * 2));
145
- --_switch-width: calc(var(--_switch-height) * 1.6);
142
+ --switch-offset-computed: var(--stroke-size-100);
143
+ --switch-thumb-size-computed: calc(var(--action-icon-only-size-small) - var(--space-200));
144
+ --switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
145
+ --switch-width-computed: calc(var(--switch-height-computed) * 1.6);
146
146
  }
147
147
  :host([size="medium"]) {
148
- --_switch-offset: var(--stroke-size-100);
149
- --_switch-thumb-size: calc(var(--switch-thumb-size) - var(--space-100));
150
- --_switch-height: calc(var(--_switch-thumb-size) + (var(--_switch-offset) * 2));
151
- --_switch-width: calc(var(--_switch-height) * 1.6);
148
+ --switch-offset-computed: var(--stroke-size-100);
149
+ --switch-thumb-size-computed: calc(var(--switch-thumb-size) - var(--space-100));
150
+ --switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
151
+ --switch-width-computed: calc(var(--switch-height-computed) * 1.6);
152
152
  }
153
153
  :host([size="large"]) {
154
- --_switch-offset: var(--switch-offset);
155
- --_switch-thumb-size: var(--switch-thumb-size);
156
- --_switch-height: var(--switch-height);
157
- --_switch-width: var(--switch-width);
154
+ --switch-offset-computed: var(--switch-offset);
155
+ --switch-thumb-size-computed: var(--switch-thumb-size);
156
+ --switch-height-computed: var(--switch-height);
157
+ --switch-width-computed: var(--switch-width);
158
158
  }
159
159
 
160
160
  ::slotted([slot="on-icon"]),
@@ -106,7 +106,7 @@ class l extends HTMLElement {
106
106
  z-index: 0;
107
107
  padding: var(--space-200) var(--space-400);
108
108
  box-sizing: border-box;
109
- box-shadow: 0 0 4px 4px var(--tab-shadow-active);
109
+ box-shadow: var(--tab-shadow-active);
110
110
  will-change: transform, width;
111
111
  transform: translateX(0) translateZ(0);
112
112
  width: 0;
@@ -1,4 +1,4 @@
1
- class b extends HTMLElement {
1
+ class p extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return [
4
4
  "name",
@@ -68,7 +68,7 @@ class b extends HTMLElement {
68
68
  !e || !a || e.maxLength <= 0 || (a.textContent = `${e.value.length}/${e.maxLength}`);
69
69
  }
70
70
  render() {
71
- const e = this.getAttribute("name") || "", a = this.getAttribute("value") || "", r = this.getAttribute("placeholder") || "", t = this.getAttribute("id") || `mui-textarea-${Math.random().toString(36).substr(2, 9)}`, o = this.getAttribute("label") || "", c = this.hasAttribute("optional"), l = this.hasAttribute("hide-label"), d = this.hasAttribute("disabled"), v = this.getAttribute("rows") || "4", i = this.getAttribute("max-length"), s = i && Number(i) > 0 ? String(Number(i)) : "", n = this.getAttribute("size") || "medium", x = ["x-small", "small", "medium", "large"].includes(n) ? n : "medium", u = l && o ? `aria-label="${o}"` : "", h = this.getAttribute("variant") || "", g = h || "", m = (
71
+ const e = this.getAttribute("name") || "", a = this.getAttribute("value") || "", r = this.getAttribute("placeholder") || "", t = this.getAttribute("id") || `mui-textarea-${Math.random().toString(36).substr(2, 9)}`, o = this.getAttribute("label") || "", d = this.hasAttribute("optional"), n = this.hasAttribute("hide-label"), x = this.hasAttribute("disabled"), l = this.getAttribute("rows") || "4", i = this.getAttribute("max-length"), s = i && Number(i) > 0 ? String(Number(i)) : "", c = this.getAttribute("size") || "medium", u = ["x-small", "small", "medium", "large"].includes(c) ? c : "medium", v = n && o ? `aria-label="${o}"` : "", h = this.getAttribute("variant") || "", g = h || "", b = (
72
72
  /*html*/
73
73
  `
74
74
  <style>
@@ -104,11 +104,16 @@ class b extends HTMLElement {
104
104
 
105
105
  textarea {
106
106
  width: 100%;
107
- min-height: 9.6rem;
108
- line-height: var(--text-line-height);
109
- padding: var(--space-200) var(--space-300);
107
+ min-height: calc(
108
+ (var(--textarea-line-height-current) * var(--textarea-rows, 4)) +
109
+ (var(--textarea-padding-block-current) * 2) +
110
+ (var(--stroke-size-100) * 2)
111
+ );
112
+ line-height: var(--textarea-line-height-current);
113
+ padding-block: var(--textarea-padding-block-current);
114
+ padding-inline: var(--textarea-padding-inline-current);
110
115
  box-sizing: border-box;
111
- font-size: var(--text-font-size);
116
+ font-size: var(--textarea-font-size-current);
112
117
  border-radius: var(--radius-100);
113
118
  border: var(--border-thin);
114
119
  border-color: var(--form-default-border-color);
@@ -116,30 +121,34 @@ class b extends HTMLElement {
116
121
  background: var(--input-background);
117
122
  resize: vertical;
118
123
  font-family: var(--font-family);
124
+ --textarea-font-size-current: var(--text-font-size);
125
+ --textarea-line-height-current: var(--text-line-height);
126
+ --textarea-padding-block-current: var(--space-200);
127
+ --textarea-padding-inline-current: var(--space-300);
119
128
  }
120
129
  textarea.size-x-small {
121
- min-height: 7.2rem;
122
- padding: var(--action-padding-x-small);
123
- font-size: var(--text-font-size-xs);
124
- line-height: var(--text-line-height-xs);
130
+ --textarea-font-size-current: var(--text-font-size-xs);
131
+ --textarea-line-height-current: var(--text-line-height-xs);
132
+ --textarea-padding-block-current: var(--space-050);
133
+ --textarea-padding-inline-current: var(--space-200);
125
134
  }
126
135
  textarea.size-small {
127
- min-height: 8.4rem;
128
- padding: var(--action-padding-small);
129
- font-size: var(--text-font-size-s);
130
- line-height: var(--text-line-height-s);
136
+ --textarea-font-size-current: var(--text-font-size-s);
137
+ --textarea-line-height-current: var(--text-line-height-s);
138
+ --textarea-padding-block-current: calc(var(--space-100) - (var(--stroke-size-100) / 2));
139
+ --textarea-padding-inline-current: var(--space-300);
131
140
  }
132
141
  textarea.size-medium {
133
- min-height: 9.6rem;
134
- padding: var(--space-200) var(--space-300);
135
- font-size: var(--text-font-size);
136
- line-height: var(--text-line-height);
142
+ --textarea-font-size-current: var(--text-font-size);
143
+ --textarea-line-height-current: var(--text-line-height);
144
+ --textarea-padding-block-current: var(--space-200);
145
+ --textarea-padding-inline-current: var(--space-300);
137
146
  }
138
147
  textarea.size-large {
139
- min-height: 11.2rem;
140
- padding: var(--space-300) var(--space-400);
141
- font-size: var(--text-font-size-l);
142
- line-height: var(--text-line-height-l);
148
+ --textarea-font-size-current: var(--text-font-size-l);
149
+ --textarea-line-height-current: var(--text-line-height-l);
150
+ --textarea-padding-block-current: var(--space-300);
151
+ --textarea-padding-inline-current: var(--space-400);
143
152
  }
144
153
 
145
154
  textarea:hover {
@@ -269,22 +278,23 @@ class b extends HTMLElement {
269
278
  }
270
279
  </style>
271
280
 
272
- ${o ? `<label for="${t}" class="${l ? "vh" : ""}">${o}${c ? ' <span class="optional"><span class="optional-dot" aria-hidden="true">•</span><span class="optional-text">Optional</span></span>' : ""}</label>` : ""}
281
+ ${o ? `<label for="${t}" class="${n ? "vh" : ""}">${o}${d ? ' <span class="optional"><span class="optional-dot" aria-hidden="true">•</span><span class="optional-text">Optional</span></span>' : ""}</label>` : ""}
273
282
 
274
283
  <textarea
275
284
  id="${t}"
276
285
  name="${e}"
277
- class="${[g, `size-${x}`].filter(Boolean).join(" ")}"
278
- rows="${v}"
286
+ class="${[g, `size-${u}`].filter(Boolean).join(" ")}"
287
+ style="--textarea-rows: ${l};"
288
+ rows="${l}"
279
289
  placeholder="${r}"
280
290
  ${s ? `maxlength="${s}"` : ""}
281
- ${d ? "disabled" : ""}
282
- ${u}
291
+ ${x ? "disabled" : ""}
292
+ ${v}
283
293
  >${a}</textarea>
284
294
  ${s ? '<div class="meta"><span class="char-count"></span></div>' : ""}
285
295
  `
286
296
  );
287
- this.shadowRoot.innerHTML = m, o || console.warn("mui-textarea: Missing required 'label' attribute for accessibility.");
297
+ this.shadowRoot.innerHTML = b, o || console.warn("mui-textarea: Missing required 'label' attribute for accessibility.");
288
298
  }
289
299
  }
290
- customElements.get("mui-textarea") || customElements.define("mui-textarea", b);
300
+ customElements.get("mui-textarea") || customElements.define("mui-textarea", p);
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Thu, 07 May 2026 04:13:10 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Mon, 25 May 2026 10:00:49 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -179,11 +179,13 @@ html[data-theme="light"] {
179
179
  --surface-elevated-alpha: var(--white-opacity-50);
180
180
  --surface-elevated-100: var(--white);
181
181
  --surface-elevated-200: var(--grey-100);
182
+ --code-background: var(--surface-elevated-200);
182
183
  --prompt-preview-dismiss-border-color: var(--black-opacity-30);
183
184
  --prompt-preview-box-drop-shadow: drop-shadow(
184
185
  0 var(--stroke-size-100) var(--stroke-size-200) var(--black-opacity-10)
185
186
  );
186
187
  --prompt-preview-surface: var(--surface-elevated-100);
188
+ --prompt-preview-code-background: var(--code-background);
187
189
  --prompt-preview-accent-mix-100: 10%;
188
190
  --prompt-preview-accent-mix-200: 8%;
189
191
  --prompt-preview-accent-mix-300: 6%;
@@ -314,7 +316,8 @@ html[data-theme="light"] {
314
316
  --tab-background-active: var(--white);
315
317
  --tab-icon-active: var(--black);
316
318
  --tab-text-color-active: var(--black);
317
- --tab-shadow-active: var(--black-opacity-10);
319
+ --tab-shadow-active-color: var(--black-opacity-10);
320
+ --tab-shadow-active: 0 0 var(--stroke-size-400) var(--stroke-size-400) var(--tab-shadow-active-color);
318
321
  --tabs-ghost-box-shadow: none;
319
322
 
320
323
  /* Carousel */
@@ -395,6 +398,7 @@ html[data-theme="light"] {
395
398
 
396
399
  /* Dialog */
397
400
  --dialog-background: var(--white);
401
+ --dialog-border: none;
398
402
 
399
403
  /* Drawer */
400
404
  --drawer-background: var(--white);
@@ -529,11 +533,13 @@ html[data-theme="dark"] {
529
533
  --surface-elevated-alpha: var(--white-opacity-10);
530
534
  --surface-elevated-100: var(--grey-800);
531
535
  --surface-elevated-200: var(--grey-900);
536
+ --code-background: var(--surface-elevated-200);
532
537
  --prompt-preview-dismiss-border-color: var(--white-opacity-30);
533
538
  --prompt-preview-box-drop-shadow: drop-shadow(
534
539
  0 var(--stroke-size-100) var(--stroke-size-200) var(--black-opacity-20)
535
540
  );
536
541
  --prompt-preview-surface: var(--surface-elevated-200);
542
+ --prompt-preview-code-background: var(--code-background);
537
543
  --prompt-preview-accent-mix-100: 14%;
538
544
  --prompt-preview-accent-mix-200: 10%;
539
545
  --prompt-preview-accent-mix-300: 8%;
@@ -663,7 +669,8 @@ html[data-theme="dark"] {
663
669
  --tab-background-active: var(--grey-700);
664
670
  --tab-icon-active: var(--white);
665
671
  --tab-text-color-active: var(--white);
666
- --tab-shadow-active: var(--black-opacity-40);
672
+ --tab-shadow-active-color: var(--black-opacity-40);
673
+ --tab-shadow-active: 0 0 var(--stroke-size-400) var(--stroke-size-400) var(--tab-shadow-active-color);
667
674
  --tabs-ghost-box-shadow: none;
668
675
 
669
676
  /* Carousel */
@@ -744,6 +751,7 @@ html[data-theme="dark"] {
744
751
 
745
752
  /* Dialog */
746
753
  --dialog-background: var(--grey-800);
754
+ --dialog-border: none;
747
755
 
748
756
  /* Drawer */
749
757
  --drawer-background: var(--grey-800);
@@ -974,7 +982,8 @@ html[data-theme="dark"] {
974
982
  /* Dialog */
975
983
  --dialog-radius: var(--radius-150);
976
984
  /* Avatar */
977
- --avatar-x-small: var(--space-500); /* 24px */
985
+ --avatar-xx-small: var(--space-500); /* 24px */
986
+ --avatar-x-small: calc(var(--space-500) + var(--space-200)); /* 32px */
978
987
  --avatar-small: calc(var(--space-600) + var(--space-025)); /* 38px */
979
988
  --avatar-medium: var(--space-700); /* 48px */
980
989
  --avatar-large: calc(var(--space-700) + var(--space-200)); /* 56px */