@muibook/components 7.1.0 → 8.0.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.
Files changed (86) hide show
  1. package/dist/esm/agent/keywords/index.js +1 -0
  2. package/dist/esm/agent/prompts/index.js +13 -1
  3. package/dist/esm/components/mui-addon/index.js +0 -1
  4. package/dist/esm/components/mui-avatar/index.js +136 -0
  5. package/dist/esm/components/mui-button/index.js +91 -47
  6. package/dist/esm/components/mui-checkbox/index.js +30 -56
  7. package/dist/esm/components/mui-chip/index.js +17 -10
  8. package/dist/esm/components/mui-dialog/index.js +17 -17
  9. package/dist/esm/components/mui-drawer/index.js +38 -39
  10. package/dist/esm/components/mui-file-upload/index.js +6 -6
  11. package/dist/esm/components/mui-icons/checkmark/index.js +53 -0
  12. package/dist/esm/components/mui-icons/game-controller/index.js +55 -0
  13. package/dist/esm/components/mui-icons/home/index.js +55 -0
  14. package/dist/esm/components/mui-icons/index.js +8 -0
  15. package/dist/esm/components/mui-icons/list-and-film/index.js +55 -0
  16. package/dist/esm/components/mui-icons/movie-clapper/index.js +55 -0
  17. package/dist/esm/components/mui-icons/music-microphone/index.js +55 -0
  18. package/dist/esm/components/mui-icons/music-quarter-note/index.js +55 -0
  19. package/dist/esm/components/mui-icons/play-rectangle/index.js +55 -0
  20. package/dist/esm/components/mui-icons/play-stack/index.js +55 -0
  21. package/dist/esm/components/mui-icons/search/index.js +53 -0
  22. package/dist/esm/components/mui-input/index.js +43 -19
  23. package/dist/esm/components/mui-link/index.js +120 -42
  24. package/dist/esm/components/mui-select/index.js +2 -1
  25. package/dist/esm/components/mui-slat/index.js +0 -1
  26. package/dist/esm/components/mui-slat/slat/index.js +36 -9
  27. package/dist/esm/components/mui-switch/index.js +23 -13
  28. package/dist/esm/css/mui-tokens.css +120 -12
  29. package/dist/esm/custom-elements.json +6186 -0
  30. package/dist/esm/index.js +15 -5
  31. package/dist/types/components/mui-accordion/doc.d.ts +2 -0
  32. package/dist/types/components/mui-addon/doc.d.ts +2 -0
  33. package/dist/types/components/mui-alert/doc.d.ts +2 -0
  34. package/dist/types/components/mui-avatar/doc.d.ts +2 -0
  35. package/dist/types/components/mui-avatar/index.d.ts +1 -0
  36. package/dist/types/components/mui-badge/doc.d.ts +2 -0
  37. package/dist/types/components/mui-body/doc.d.ts +2 -0
  38. package/dist/types/components/mui-button/doc.d.ts +2 -0
  39. package/dist/types/components/mui-button-group/doc.d.ts +2 -0
  40. package/dist/types/components/mui-card/doc.d.ts +2 -0
  41. package/dist/types/components/mui-carousel/doc.d.ts +2 -0
  42. package/dist/types/components/mui-checkbox/doc.d.ts +2 -0
  43. package/dist/types/components/mui-chip/doc.d.ts +2 -0
  44. package/dist/types/components/mui-code/doc.d.ts +2 -0
  45. package/dist/types/components/mui-container/doc.d.ts +2 -0
  46. package/dist/types/components/mui-dialog/doc.d.ts +2 -0
  47. package/dist/types/components/mui-drawer/doc.d.ts +2 -0
  48. package/dist/types/components/mui-dropdown/doc.d.ts +2 -0
  49. package/dist/types/components/mui-field/doc.d.ts +2 -0
  50. package/dist/types/components/mui-file-upload/doc.d.ts +2 -0
  51. package/dist/types/components/mui-grid/doc.d.ts +2 -0
  52. package/dist/types/components/mui-heading/doc.d.ts +2 -0
  53. package/dist/types/components/mui-icons/checkmark.d.ts +1 -0
  54. package/dist/types/components/mui-icons/doc.d.ts +2 -0
  55. package/dist/types/components/mui-icons/game-controller.d.ts +1 -0
  56. package/dist/types/components/mui-icons/home.d.ts +1 -0
  57. package/dist/types/components/mui-icons/index.d.ts +8 -0
  58. package/dist/types/components/mui-icons/list-and-film.d.ts +1 -0
  59. package/dist/types/components/mui-icons/movie-clapper.d.ts +1 -0
  60. package/dist/types/components/mui-icons/music-microphone.d.ts +1 -0
  61. package/dist/types/components/mui-icons/music-quarter-note.d.ts +1 -0
  62. package/dist/types/components/mui-icons/play-rectangle.d.ts +1 -0
  63. package/dist/types/components/mui-icons/play-stack.d.ts +1 -0
  64. package/dist/types/components/mui-icons/search.d.ts +1 -0
  65. package/dist/types/components/mui-image/doc.d.ts +2 -0
  66. package/dist/types/components/mui-input/doc.d.ts +2 -0
  67. package/dist/types/components/mui-link/doc.d.ts +2 -0
  68. package/dist/types/components/mui-list/doc.d.ts +2 -0
  69. package/dist/types/components/mui-loader/doc.d.ts +2 -0
  70. package/dist/types/components/mui-message/doc.d.ts +2 -0
  71. package/dist/types/components/mui-progress/doc.d.ts +2 -0
  72. package/dist/types/components/mui-quote/doc.d.ts +2 -0
  73. package/dist/types/components/mui-responsive/doc.d.ts +2 -0
  74. package/dist/types/components/mui-rule/doc.d.ts +2 -0
  75. package/dist/types/components/mui-select/doc.d.ts +2 -0
  76. package/dist/types/components/mui-slat/doc.d.ts +67 -0
  77. package/dist/types/components/mui-slat/index.d.ts +0 -1
  78. package/dist/types/components/mui-smart-card/doc.d.ts +2 -0
  79. package/dist/types/components/mui-stack/doc.d.ts +2 -0
  80. package/dist/types/components/mui-stepper/doc.d.ts +2 -0
  81. package/dist/types/components/mui-switch/doc.d.ts +2 -0
  82. package/dist/types/components/mui-table/doc.d.ts +2 -0
  83. package/dist/types/components/mui-tabs/doc.d.ts +2 -0
  84. package/dist/types/index.d.ts +11 -1
  85. package/package.json +55 -9
  86. package/dist/esm/components/mui-slat/accessory/index.js +0 -29
@@ -1,7 +1,7 @@
1
- import { getPartMap as v } from "../../utils/part-map/index.js";
2
- class f extends HTMLElement {
1
+ import { getPartMap as h } from "../../utils/part-map/index.js";
2
+ class u extends HTMLElement {
3
3
  static get observedAttributes() {
4
- return ["target", "href", "variant", "weight", "size", "download", "usage"];
4
+ return ["target", "href", "variant", "disabled", "weight", "size", "download", "usage"];
5
5
  }
6
6
  constructor() {
7
7
  super(), this.attachShadow({ mode: "open" });
@@ -19,6 +19,10 @@ class f extends HTMLElement {
19
19
  const t = this.shadowRoot.querySelector("a");
20
20
  t && t.setAttribute("target", e || "_self");
21
21
  }
22
+ if (a === "disabled") {
23
+ const t = this.shadowRoot.querySelector("a");
24
+ t && (e !== null ? (t.setAttribute("aria-disabled", "true"), t.setAttribute("href", "javascript:void(0)")) : (t.setAttribute("aria-disabled", "false"), t.setAttribute("href", this.getAttribute("href") || "#")));
25
+ }
22
26
  if (a === "download") {
23
27
  const t = this.shadowRoot.querySelector("a");
24
28
  if (!t) return;
@@ -27,44 +31,44 @@ class f extends HTMLElement {
27
31
  a === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => {
28
32
  const t = this.shadowRoot;
29
33
  if (!t) return;
30
- const l = [
34
+ const d = [
31
35
  t.querySelector("slot:not([name])"),
32
36
  t.querySelector('slot[name="before"]'),
33
37
  t.querySelector('slot[name="after"]')
34
- ], d = this.hasAttribute("icon-only");
35
- l.forEach((r) => {
38
+ ], s = this.hasAttribute("icon-only");
39
+ d.forEach((r) => {
36
40
  if (r) {
37
- const n = r.assignedNodes({ flatten: !0 });
38
- this.updateIconSizes(n, d);
41
+ const i = r.assignedNodes({ flatten: !0 });
42
+ this.updateIconSizes(i, s), this.updateAvatarSizes(i);
39
43
  }
40
44
  });
41
45
  });
42
46
  }
43
47
  }
44
48
  updateSlotState() {
45
- const a = this.shadowRoot, o = a.querySelector("slot:not([name])"), e = a.querySelector('slot[name="before"]'), t = a.querySelector('slot[name="after"]'), l = (s) => !!s && s.assignedNodes({ flatten: !0 }).some(
46
- (i) => {
49
+ const a = this.shadowRoot, o = a.querySelector("slot:not([name])"), e = a.querySelector('slot[name="before"]'), t = a.querySelector('slot[name="after"]'), d = (l) => !!l && l.assignedNodes({ flatten: !0 }).some(
50
+ (n) => {
47
51
  var c;
48
- return i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && !!((c = i.textContent) != null && c.trim());
52
+ return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!((c = n.textContent) != null && c.trim());
49
53
  }
50
- ), d = l(e), r = l(t);
51
- this.classList.toggle("has-before", d), this.classList.toggle("has-after", r);
52
- const n = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], h = n.length > 0 && n.every(
53
- (s) => {
54
- var i;
55
- return s.nodeType === Node.ELEMENT_NODE ? s.classList.contains("mui-icon") || s.tagName.toLowerCase() === "svg" : !((i = s.textContent) != null && i.trim());
54
+ ), s = d(e), r = d(t);
55
+ this.classList.toggle("has-before", s), this.classList.toggle("has-after", r);
56
+ const i = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], v = i.length > 0 && i.every(
57
+ (l) => {
58
+ var n;
59
+ return l.nodeType === Node.ELEMENT_NODE ? l.classList.contains("mui-icon") || l.tagName.toLowerCase() === "svg" : !((n = l.textContent) != null && n.trim());
56
60
  }
57
61
  );
58
- this.toggleAttribute("icon-only", h), h ? this.updateIconSizes(n, !0) : [e, o, t].forEach((i) => {
59
- if (i) {
60
- const c = i.assignedNodes({ flatten: !0 });
61
- this.updateIconSizes(c, !1);
62
+ this.toggleAttribute("icon-only", v), v ? this.updateIconSizes(i, !0) : [e, o, t].forEach((n) => {
63
+ if (n) {
64
+ const c = n.assignedNodes({ flatten: !0 });
65
+ this.updateIconSizes(c, !1), this.updateAvatarSizes(c);
62
66
  }
63
67
  });
64
68
  }
65
69
  render() {
66
70
  if (!this.shadowRoot) return;
67
- const a = v("text", "spacing", "layout", "visual");
71
+ const a = h("text", "spacing", "layout", "visual");
68
72
  this.shadowRoot.innerHTML = /*html*/
69
73
  `
70
74
  <style>
@@ -88,7 +92,7 @@ class f extends HTMLElement {
88
92
  a:focus, a:active, a:hover { outline: var(--space-000); }
89
93
  a:hover { color: var(--link-text-color-default-hover); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-hover) 80%, transparent); }
90
94
  a:focus { color: var(--link-text-color-default-focus); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-focus) 80%, transparent); }
91
- a:disabled { color: var(--link-text-color-default-disabled); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-disabled) 80%, transparent); cursor: not-allowed; }
95
+ a[aria-disabled="true"] { color: var(--link-text-color-default-disabled); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-disabled) 80%, transparent); cursor: not-allowed; }
92
96
  a, a:before, a:after {box-sizing: border-box;}
93
97
  a:focus-visible { outline: var(--outline-thick); }
94
98
 
@@ -165,7 +169,7 @@ class f extends HTMLElement {
165
169
  border: var(--action-primary-border-focus);
166
170
  }
167
171
 
168
- :host([variant="primary"]) a:disabled {
172
+ :host([variant="primary"]) a[aria-disabled="true"] {
169
173
  background: var(--action-primary-background-disabled);
170
174
  color: var(--action-primary-text-color-disabled);
171
175
  border: var(--action-primary-border-disabled);
@@ -175,7 +179,7 @@ class f extends HTMLElement {
175
179
  :host([variant="primary"]) a ::slotted(.mui-icon) { fill: var(--action-primary-text-color); }
176
180
  :host([variant="primary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-primary-text-color-hover); }
177
181
  :host([variant="primary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-primary-text-color-focus); }
178
- :host([variant="primary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-primary-text-color-disabled); }
182
+ :host([variant="primary"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-primary-text-color-disabled); }
179
183
 
180
184
  /* Button Secondary
181
185
  ========================================= */
@@ -197,7 +201,7 @@ class f extends HTMLElement {
197
201
  border: var(--action-secondary-border-focus);
198
202
  }
199
203
 
200
- :host([variant="secondary"]) a:disabled {
204
+ :host([variant="secondary"]) a[aria-disabled="true"] {
201
205
  background: var(--action-secondary-background-disabled);
202
206
  color: var(--action-secondary-text-color-disabled);
203
207
  border: var(--action-secondary-border-disabled);
@@ -207,7 +211,7 @@ class f extends HTMLElement {
207
211
  :host([variant="secondary"]) a ::slotted(.mui-icon) { fill: var(--action-secondary-text-color); }
208
212
  :host([variant="secondary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-hover); }
209
213
  :host([variant="secondary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-focus); }
210
- :host([variant="secondary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-disabled); }
214
+ :host([variant="secondary"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-disabled); }
211
215
 
212
216
  /* Button Tertiary
213
217
  ========================================= */
@@ -229,7 +233,7 @@ class f extends HTMLElement {
229
233
  border: var(--action-tertiary-border-focus);
230
234
  }
231
235
 
232
- :host([variant="tertiary"]) a:disabled {
236
+ :host([variant="tertiary"]) a[aria-disabled="true"] {
233
237
  background: var(--action-tertiary-background-disabled);
234
238
  color: var(--action-tertiary-text-color-disabled);
235
239
  border: var(--action-tertiary-border-disabled);
@@ -239,7 +243,7 @@ class f extends HTMLElement {
239
243
  :host([variant="tertiary"]) a ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color); }
240
244
  :host([variant="tertiary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-hover); }
241
245
  :host([variant="tertiary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-focus); }
242
- :host([variant="tertiary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-disabled); }
246
+ :host([variant="tertiary"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-disabled); }
243
247
 
244
248
  /* Button Attention
245
249
  ========================================= */
@@ -261,7 +265,7 @@ class f extends HTMLElement {
261
265
  border: var(--action-attention-border-focus);
262
266
  }
263
267
 
264
- :host([variant="attention"]) a:disabled {
268
+ :host([variant="attention"]) a[aria-disabled="true"] {
265
269
  background: var(--action-attention-background-disabled);
266
270
  color: var(--action-attention-text-color-disabled);
267
271
  border: var(--action-attention-border-disabled);
@@ -271,7 +275,7 @@ class f extends HTMLElement {
271
275
  :host([variant="attention"]) a ::slotted(.mui-icon) { fill: var(--action-attention-text-color); }
272
276
  :host([variant="attention"]) a:hover ::slotted(.mui-icon) { fill: var(--action-attention-text-color-hover); }
273
277
  :host([variant="attention"]) a:focus ::slotted(.mui-icon) { fill: var(--action-attention-text-color-focus); }
274
- :host([variant="attention"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
278
+ :host([variant="attention"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
275
279
 
276
280
  /* Icon only
277
281
  ========================================= */
@@ -326,6 +330,54 @@ class f extends HTMLElement {
326
330
  fill: var(--alert-icon);
327
331
  }
328
332
 
333
+ /* AVATAR */
334
+
335
+ /* Link - Default */
336
+ :host([variant="default"][size="x-small"]) a ::slotted(mui-avatar) {
337
+ margin-right: var(--space-025);
338
+ }
339
+ :host([variant="default"][size="small"]) a ::slotted(mui-avatar),
340
+ :host([variant="default"][size="medium"]) a ::slotted(mui-avatar),
341
+ :host([variant="default"][size="large"]) a ::slotted(mui-avatar) {
342
+ margin-right: var(--space-025);
343
+ }
344
+
345
+ /* Link Button */
346
+ :host(:not([variant="default"])) a ::slotted(mui-avatar) {
347
+ --avatar-background-override: var(--action-avatar-background);
348
+ }
349
+
350
+ /* Link Button: Sizes */
351
+ :host(:not([variant="default"])[size="x-small"]) a ::slotted(mui-avatar) {
352
+ margin-right: var(--space-025);
353
+ }
354
+ :host(:not([variant="default"])[size="small"]) a ::slotted(mui-avatar),
355
+ :host(:not([variant="default"])[size="medium"]) a ::slotted(mui-avatar),
356
+ :host(:not([variant="default"])[size="large"]) a ::slotted(mui-avatar) {
357
+ margin-right: var(--space-050);
358
+ }
359
+
360
+ /* Link Button: Background */
361
+ :host(:not([variant="default"])) a[aria-disabled="true"] ::slotted(mui-avatar),
362
+ :host(:not([variant="default"])) a[aria-disabled="true"]:hover ::slotted(mui-avatar),
363
+ :host(:not([variant="default"])) a[aria-disabled="true"]:focus ::slotted(mui-avatar) {
364
+ --avatar-background-override: var(--action-avatar-background);
365
+ }
366
+
367
+ /* Disabled */
368
+ :host a[aria-disabled="true"] ::slotted(mui-avatar),
369
+ :host a[aria-disabled="true"]:hover ::slotted(mui-avatar),
370
+ :host a[aria-disabled="true"]:focus ::slotted(mui-avatar) {
371
+ opacity: 0.5;
372
+ }
373
+
374
+ :host(:not([variant="default"])) a:hover ::slotted(mui-avatar),
375
+ :host(:not([variant="default"])) a:focus ::slotted(mui-avatar) {
376
+ --avatar-background-override: var(--action-avatar-background-hover);
377
+ }
378
+
379
+
380
+
329
381
  /* Before & After Icon
330
382
  ========================================= */
331
383
  :host(.has-after) a,
@@ -438,30 +490,35 @@ class f extends HTMLElement {
438
490
 
439
491
  :host([size="x-small"][variant]:not([variant="default"])) a,
440
492
  :host([size="x-small"][variant]:not([variant="default"])) a:hover,
441
- :host([size="x-small"][variant]:not([variant="default"])) a:focus {
493
+ :host([size="x-small"][variant]:not([variant="default"])) a:focus,
494
+ :host([size="x-small"][variant]:not([variant="default"])) a[aria-disabled="true"] {
442
495
  font-size: var(--text-font-size-xs);
443
496
  line-height: var(--text-line-height-xs);
444
497
  font-weight: var(--font-weight-semi-bold);
445
498
  padding: var(--action-padding-x-small);
446
499
  border-width: var(--stroke-size-100);
500
+ border-radius: var(--action-radius-x-small);
447
501
  }
448
502
 
449
503
  :host([size="small"][variant]:not([variant="default"])) a {
450
504
  font-size: var(--text-font-size-s);
451
505
  line-height: var(--text-line-height-s);
452
506
  padding: var(--action-padding-small);
507
+ border-radius: var(--action-radius-small);
453
508
  }
454
509
 
455
510
  :host([size="medium"][variant]:not([variant="default"])) a {
456
511
  font-size: var(--text-font-size-m);
457
512
  line-height: var(--text-line-height-m);
458
513
  padding: var(--action-padding);
514
+ border-radius: var(--action-radius-medium);
459
515
  }
460
516
 
461
517
  :host([size="large"][variant]:not([variant="default"])) a {
462
518
  font-size: var(--text-font-size-l);
463
519
  line-height: var(--text-line-height-l);
464
520
  padding: var(--action-padding-large);
521
+ border-radius: var(--action-radius-large);
465
522
  }
466
523
 
467
524
  /* Icon-only size variants */
@@ -569,8 +626,9 @@ class f extends HTMLElement {
569
626
  <a
570
627
  part="${a}"
571
628
  target="${this.getAttribute("target") || "_self"}"
572
- href="${this.getAttribute("href") || "#"}"
573
- ${this.hasAttribute("download") ? `download="${this.getAttribute("download") || ""}"` : ""}
629
+ href="${this.hasAttribute("disabled") ? "javascript:void(0)" : this.getAttribute("href") || "#"}"
630
+ aria-disabled="${this.hasAttribute("disabled") ? "true" : "false"}"
631
+ ${this.hasAttribute("download") && !this.hasAttribute("disabled") ? `download="${this.getAttribute("download") || ""}"` : ""}
574
632
  >
575
633
  <slot name="before"></slot>
576
634
  <slot></slot>
@@ -578,28 +636,48 @@ class f extends HTMLElement {
578
636
  </a>
579
637
  `;
580
638
  }
639
+ // Update avatar sizes based on button size
640
+ updateAvatarSizes(a) {
641
+ const o = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
642
+ "x-small": "x-small",
643
+ small: "x-small",
644
+ medium: "x-small",
645
+ large: "small"
646
+ } : {
647
+ "x-small": "x-small",
648
+ small: "x-small",
649
+ medium: "small",
650
+ large: "medium"
651
+ })[o] || "small";
652
+ a.forEach((r) => {
653
+ if (r.nodeType === Node.ELEMENT_NODE) {
654
+ const i = r;
655
+ i.tagName.toLowerCase() === "mui-avatar" && i.setAttribute("size", s);
656
+ }
657
+ });
658
+ }
581
659
  updateIconSizes(a, o) {
582
- const e = this.getAttribute("size") || "medium", l = {
660
+ const e = this.getAttribute("size") || "medium", d = {
583
661
  "x-small": "x-small",
584
662
  small: "x-small",
585
663
  medium: o ? "medium" : "small",
586
664
  large: o ? "large" : "medium"
587
665
  }[e] || "small";
588
- a.forEach((d) => {
589
- if (d.nodeType === Node.ELEMENT_NODE) {
590
- const r = d, n = r.tagName.toLowerCase();
591
- (n === "svg" || r.classList.contains("mui-icon") || n === "mui-icon") && !r.hasAttribute("size") && r.setAttribute("size", l);
666
+ a.forEach((s) => {
667
+ if (s.nodeType === Node.ELEMENT_NODE) {
668
+ const r = s, i = r.tagName.toLowerCase();
669
+ (i === "svg" || r.classList.contains("mui-icon") || i === "mui-icon") && !r.hasAttribute("size") && r.setAttribute("size", d);
592
670
  }
593
671
  });
594
672
  }
595
673
  waitForPartMap() {
596
674
  return new Promise((a) => {
597
- if (typeof v == "function") return a();
675
+ if (typeof h == "function") return a();
598
676
  const o = () => {
599
- typeof v == "function" ? a() : requestAnimationFrame(o);
677
+ typeof h == "function" ? a() : requestAnimationFrame(o);
600
678
  };
601
679
  o();
602
680
  });
603
681
  }
604
682
  }
605
- customElements.get("mui-link") || customElements.define("mui-link", f);
683
+ customElements.get("mui-link") || customElements.define("mui-link", u);
@@ -67,7 +67,7 @@ class p extends HTMLElement {
67
67
  border: var(--border-thin);
68
68
  border-color: var(--form-default-border-color);
69
69
  border-radius: var(--radius-100);
70
- color: var(--text-color);
70
+ color: var(--form-default-text-color);
71
71
  background: var(--input-background);
72
72
  width: 100%;
73
73
  box-sizing: border-box;
@@ -75,6 +75,7 @@ class p extends HTMLElement {
75
75
  }
76
76
  select:hover {
77
77
  border-color: var(--form-default-border-color-hover);
78
+ color: var(--form-default-text-color-hover);
78
79
  }
79
80
  select:focus {
80
81
  outline: var(--outline-thick);
@@ -1,3 +1,2 @@
1
1
  import "./slat/index.js";
2
- import "./accessory/index.js";
3
2
  import "./group/index.js";
@@ -9,16 +9,27 @@ class i extends HTMLElement {
9
9
  static get observedAttributes() {
10
10
  return ["variant", "col", "space"];
11
11
  }
12
- attributeChangedCallback(t, a, r) {
13
- t === "variant" && (this.variant = r), this.render();
12
+ attributeChangedCallback(a, t, r) {
13
+ a === "variant" && (this.variant = r), this.render();
14
+ }
15
+ enforceAvatarSizes() {
16
+ var t;
17
+ const a = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("slot");
18
+ a == null || a.forEach((r) => {
19
+ r.assignedElements({ flatten: !0 }).forEach((s) => {
20
+ s.tagName.toLowerCase() === "mui-avatar" && s.setAttribute("size", "small");
21
+ });
22
+ });
14
23
  }
15
24
  connectedCallback() {
16
- this.variant = this.getAttribute("variant") || "", this.setAttribute("role", "row"), this.render();
25
+ this.variant = this.getAttribute("variant") || "", this.setAttribute("role", "row"), this.render(), requestAnimationFrame(() => {
26
+ this.enforceAvatarSizes();
27
+ });
17
28
  }
18
29
  applyCellRoles() {
19
- var a;
20
- const t = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll("slot");
21
- t == null || t.forEach((r) => {
30
+ var t;
31
+ const a = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("slot");
32
+ a == null || a.forEach((r) => {
22
33
  r.assignedElements({ flatten: !0 }).forEach((s) => {
23
34
  s.setAttribute("role", "cell");
24
35
  });
@@ -28,12 +39,12 @@ class i extends HTMLElement {
28
39
  return this.querySelector('[slot="accessory"]') !== null;
29
40
  }
30
41
  render() {
31
- const t = this.variant === "action", a = this.getAttribute("col") || "1fr 1fr", r = this.getAttribute("space") || "var(--space-500)", e = this.hasAccessorySlot(), s = (
42
+ const a = this.variant === "action", t = this.getAttribute("col") || "1fr 1fr", r = this.getAttribute("space") || "var(--space-500)", e = this.hasAccessorySlot(), s = (
32
43
  /*css*/
33
44
  `
34
45
  :host {
35
46
  display: grid;
36
- grid-template-columns: ${a};
47
+ grid-template-columns: ${t};
37
48
  align-items: center;
38
49
  gap: ${r};
39
50
  box-sizing: border-box;
@@ -106,6 +117,22 @@ class i extends HTMLElement {
106
117
  border-bottom-right-radius: var(--card-radius);
107
118
  }
108
119
 
120
+ ::slotted(mui-avatar) {
121
+ --avatar-background-override: var(--slat-avatar-background);
122
+ }
123
+ .action:hover ::slotted(mui-avatar),
124
+ .action:focus ::slotted(mui-avatar) {
125
+ --avatar-background-override: var(--slat-avatar-background-hover);
126
+ }
127
+
128
+ :host(.card-slot) ::slotted(mui-avatar) {
129
+ --avatar-background-override: var(--slat-card-avatar-background);
130
+ }
131
+ :host(.card-slot) .action:hover ::slotted(mui-avatar),
132
+ :host(.card-slot) .action:focus ::slotted(mui-avatar) {
133
+ --avatar-background-override: var(--slat-card-avatar-background-hover);
134
+ }
135
+
109
136
  `
110
137
  ), o = e ? `
111
138
  <mui-h-stack alignY="center" space="var(--space-400)">
@@ -113,7 +140,7 @@ class i extends HTMLElement {
113
140
  <slot name="start"></slot>
114
141
  </mui-h-stack>
115
142
  ` : '<slot name="start"></slot>';
116
- this.shadowRoot.innerHTML = t ? (
143
+ this.shadowRoot.innerHTML = a ? (
117
144
  /*html*/
118
145
  `
119
146
  <style>${s}</style>
@@ -4,7 +4,7 @@ class h extends HTMLElement {
4
4
  }
5
5
  connectedCallback() {
6
6
  var t;
7
- this.render(), this._checkbox = this.shadowRoot.querySelector('input[type="checkbox"]'), this._checked = this.hasAttribute("checked"), this._checkbox && (this._checkbox.checked = this._checked), this._updateIcons(), this._updateDisabledState(), (t = this._checkbox) == null || t.addEventListener("change", () => {
7
+ this.render(), this._checkbox = this.shadowRoot.querySelector('input[type="checkbox"]'), this._checked = this.hasAttribute("checked"), this._checkbox && (this._checkbox.checked = this._checked), this._updateIcons(), this._updateDisabledState(), this._enforceIconSize(), (t = this._checkbox) == null || t.addEventListener("change", () => {
8
8
  this._checkbox && (this.checked = this._checkbox.checked, this.dispatchEvent(
9
9
  new CustomEvent("change", {
10
10
  detail: { checked: this.checked },
@@ -17,10 +17,10 @@ class h extends HTMLElement {
17
17
  static get observedAttributes() {
18
18
  return ["label", "disabled", "checked"];
19
19
  }
20
- attributeChangedCallback(t, e, i) {
21
- if (t === "checked" && e !== i && (this._checked = i !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), t === "disabled" && e !== i) {
22
- const s = i !== null;
23
- this._checkbox && (this._checkbox.disabled = s, this._checkbox.setAttribute("aria-disabled", s.toString())), this._updateDisabledState();
20
+ attributeChangedCallback(t, e, s) {
21
+ if (t === "checked" && e !== s && (this._checked = s !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), t === "disabled" && e !== s) {
22
+ const i = s !== null;
23
+ this._checkbox && (this._checkbox.disabled = i, this._checkbox.setAttribute("aria-disabled", i.toString())), this._updateDisabledState();
24
24
  }
25
25
  }
26
26
  get checked() {
@@ -31,15 +31,27 @@ class h extends HTMLElement {
31
31
  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()));
32
32
  }
33
33
  _updateDisabledState() {
34
- var e, i, s, c;
35
- this.hasAttribute("disabled") ? (this.shadowRoot.host.classList.add("disabled"), (e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (i = this._checkbox) == null || i.setAttribute("tabindex", "-1")) : (this.shadowRoot.host.classList.remove("disabled"), (s = this._checkbox) == null || s.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
34
+ var e, s, i, c;
35
+ this.hasAttribute("disabled") ? (this.shadowRoot.host.classList.add("disabled"), (e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (s = this._checkbox) == null || s.setAttribute("tabindex", "-1")) : (this.shadowRoot.host.classList.remove("disabled"), (i = this._checkbox) == null || i.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
36
+ }
37
+ _enforceIconSize() {
38
+ const t = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]'), s = (i) => {
39
+ if (!i) return;
40
+ const c = () => {
41
+ i.assignedElements().forEach((o) => {
42
+ o.tagName.toLowerCase().startsWith("mui-icon") && o.setAttribute("size", "x-small");
43
+ });
44
+ };
45
+ i.addEventListener("slotchange", c), setTimeout(c, 0);
46
+ };
47
+ s(t), s(e);
36
48
  }
37
49
  _updateIcons() {
38
50
  const t = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]');
39
- t && t.assignedElements().forEach((i) => {
40
- i.style.display = this._checked ? "inline" : "none";
41
- }), e && e.assignedElements().forEach((i) => {
42
- i.style.display = this._checked ? "none" : "inline";
51
+ t && t.assignedElements().forEach((s) => {
52
+ s.style.display = this._checked ? "inline" : "none";
53
+ }), e && e.assignedElements().forEach((s) => {
54
+ s.style.display = this._checked ? "none" : "inline";
43
55
  });
44
56
  }
45
57
  render() {
@@ -102,8 +114,6 @@ class h extends HTMLElement {
102
114
 
103
115
  ::slotted([slot="on-icon"]),
104
116
  ::slotted([slot="off-icon"]) {
105
- width: 16px;
106
- height: 16px;
107
117
  fill: var(--switch-icon);
108
118
  }
109
119