@muibook/components 9.0.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 (47) hide show
  1. package/dist/esm/agent/keywords/index.js +2 -2
  2. package/dist/esm/agent/prompts/index.js +855 -3
  3. package/dist/esm/components/mui-accordion/block/index.js +6 -6
  4. package/dist/esm/components/mui-alert/index.js +43 -40
  5. package/dist/esm/components/mui-badge/index.js +15 -7
  6. package/dist/esm/components/mui-body/index.js +8 -0
  7. package/dist/esm/components/mui-button/index.js +86 -82
  8. package/dist/esm/components/mui-card/body/index.js +31 -31
  9. package/dist/esm/components/mui-card/card/index.js +6 -6
  10. package/dist/esm/components/mui-card/footer/index.js +10 -10
  11. package/dist/esm/components/mui-carousel/controller/index.js +75 -9
  12. package/dist/esm/components/mui-chip/index.js +40 -31
  13. package/dist/esm/components/mui-dropdown/index.js +45 -44
  14. package/dist/esm/components/mui-icons/ai/index.js +58 -0
  15. package/dist/esm/components/mui-icons/index.js +8 -0
  16. package/dist/esm/components/mui-icons/pin/index.js +53 -0
  17. package/dist/esm/components/mui-icons/pin-slash/index.js +53 -0
  18. package/dist/esm/components/mui-icons/rectangle/index.js +55 -0
  19. package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +58 -0
  20. package/dist/esm/components/mui-icons/rectangle-dashed/index.js +55 -0
  21. package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +55 -0
  22. package/dist/esm/components/mui-icons/rectangle-media-text/index.js +55 -0
  23. package/dist/esm/components/mui-input/index.js +20 -10
  24. package/dist/esm/components/mui-link/index.js +44 -44
  25. package/dist/esm/components/mui-select/index.js +9 -1
  26. package/dist/esm/components/mui-slat/slat/index.js +6 -6
  27. package/dist/esm/components/mui-smart-card/index.js +1 -0
  28. package/dist/esm/components/mui-switch/index.js +19 -19
  29. package/dist/esm/components/mui-table/cell/index.js +4 -4
  30. package/dist/esm/components/mui-tabs/item/index.js +9 -9
  31. package/dist/esm/components/mui-tabs/tab-bar/index.js +17 -16
  32. package/dist/esm/css/mui-brand.css +1 -1
  33. package/dist/esm/css/mui-tokens.css +6 -2
  34. package/dist/esm/custom-elements.json +986 -556
  35. package/dist/esm/index.js +12 -4
  36. package/dist/types/agent/prompts/index.d.ts +9 -0
  37. package/dist/types/components/mui-icons/ai.d.ts +1 -0
  38. package/dist/types/components/mui-icons/index.d.ts +8 -0
  39. package/dist/types/components/mui-icons/pin-slash.d.ts +1 -0
  40. package/dist/types/components/mui-icons/pin.d.ts +1 -0
  41. package/dist/types/components/mui-icons/rectangle-bottom-panel.d.ts +1 -0
  42. package/dist/types/components/mui-icons/rectangle-dashed.d.ts +1 -0
  43. package/dist/types/components/mui-icons/rectangle-left-drawer.d.ts +1 -0
  44. package/dist/types/components/mui-icons/rectangle-media-text.d.ts +1 -0
  45. package/dist/types/components/mui-icons/rectangle.d.ts +1 -0
  46. package/dist/types/index.d.ts +8 -0
  47. package/package.json +29 -1
@@ -99,31 +99,31 @@ class u extends HTMLElement {
99
99
  }
100
100
 
101
101
  /* Card Slot (Supports: Table Cell, Accordion Block) */
102
- :host(.card-slot) .accordion-summary {
102
+ :host([card-slot]) .accordion-summary {
103
103
  padding-left: var(--space-500);
104
104
  padding-right: var(--space-500);
105
105
  }
106
106
  @media (min-width: 768px) {
107
- :host(.card-slot) .accordion-summary {
107
+ :host([card-slot]) .accordion-summary {
108
108
  padding-left: var(--space-600);
109
109
  padding-right: var(--space-600);
110
110
  }
111
111
  }
112
- :host(.card-slot) .accordion-detail-inner {
112
+ :host([card-slot]) .accordion-detail-inner {
113
113
  padding-left: var(--space-500);
114
114
  padding-right: var(--space-500);
115
115
  }
116
116
  @media (min-width: 768px) {
117
- :host(.card-slot) .accordion-detail-inner {
117
+ :host([card-slot]) .accordion-detail-inner {
118
118
  padding-left: var(--space-600);
119
119
  padding-right: var(--space-600);
120
120
  }
121
121
  }
122
- :host(.card-slot) .detail-space-none {
122
+ :host([card-slot]) .detail-space-none {
123
123
  padding: 0;
124
124
  }
125
125
  @media (min-width: 768px) {
126
- :host(.card-slot) .detail-space-none {
126
+ :host([card-slot]) .detail-space-none {
127
127
  padding: 0;
128
128
  }
129
129
  }
@@ -3,10 +3,10 @@ import "../mui-icons/check/index.js";
3
3
  import "../mui-icons/info/index.js";
4
4
  import "../mui-icons/warning/index.js";
5
5
  import "../mui-icons/attention/index.js";
6
- function b(d) {
6
+ function g(d) {
7
7
  return ["positive", "info", "warning", "attention"].includes(d);
8
8
  }
9
- class m extends HTMLElement {
9
+ class v extends HTMLElement {
10
10
  constructor() {
11
11
  super(), this.actionSlotListener = null, this.attachShadow({ mode: "open" });
12
12
  }
@@ -16,26 +16,26 @@ class m extends HTMLElement {
16
16
  connectedCallback() {
17
17
  this.render();
18
18
  }
19
- attributeChangedCallback(i, o, t) {
20
- i === "variant" && o !== t && this.shadowRoot && this.render();
19
+ attributeChangedCallback(e, o, t) {
20
+ e === "variant" && o !== t && this.shadowRoot && this.render();
21
21
  }
22
22
  render() {
23
- const i = this.getAttribute("variant") || "positive", o = {
23
+ const e = this.getAttribute("variant") || "positive", o = {
24
24
  success: "positive",
25
25
  error: "attention"
26
- }, t = b(i) ? i : o[i] || "positive";
27
- if (i !== t) {
26
+ }, t = g(e) ? e : o[e] || "positive";
27
+ if (e !== t) {
28
28
  this.setAttribute("variant", t);
29
29
  return;
30
30
  }
31
- const s = {
31
+ const c = {
32
32
  positive: "polite",
33
33
  info: "polite",
34
34
  warning: "assertive",
35
35
  attention: "assertive"
36
36
  };
37
- this.setAttribute("role", "alert"), this.setAttribute("aria-live", s[t] || "polite");
38
- const r = {
37
+ this.setAttribute("role", "alert"), this.setAttribute("aria-live", c[t] || "polite");
38
+ const l = {
39
39
  positive: "mui-icon-check",
40
40
  info: "mui-icon-info",
41
41
  warning: "mui-icon-warning",
@@ -45,20 +45,27 @@ class m extends HTMLElement {
45
45
  info: "--feedback-info-icon",
46
46
  warning: "--feedback-warning-icon",
47
47
  attention: "--feedback-attention-icon"
48
- }, e = {
48
+ }, n = {
49
49
  positive: "--feedback-positive-text",
50
50
  info: "--feedback-info-text",
51
51
  warning: "--feedback-warning-text",
52
52
  attention: "--feedback-attention-text"
53
- }, n = {
53
+ }, s = {
54
54
  positive: "Success!",
55
55
  info: "Info:",
56
56
  warning: "Warning!",
57
57
  attention: "Error!"
58
- }, c = r[t], p = a[t], g = e[t], u = n[t], h = (
58
+ }, i = l[t], r = a[t], p = n[t], u = s[t], b = (
59
59
  /*css*/
60
60
  `
61
+
61
62
  :host {
63
+ display: block;
64
+ width: 100%;
65
+ box-sizing: border-box;
66
+ }
67
+
68
+ section {
62
69
  border-radius: var(--alert-radius);
63
70
  padding-left: var(--alert-padding);
64
71
  padding-right: var(--alert-padding);
@@ -69,6 +76,8 @@ class m extends HTMLElement {
69
76
  align-items: start;
70
77
  gap: var(--alert-gap-horizontal-mobile);
71
78
  box-sizing: border-box;
79
+ border: var(--feedback-${t}-border);
80
+ background: var(--feedback-${t}-background);
72
81
  }
73
82
 
74
83
  .icon,
@@ -77,7 +86,7 @@ class m extends HTMLElement {
77
86
  padding-bottom: var(--alert-padding);
78
87
  }
79
88
 
80
- :host([has-action]) {
89
+ section[has-action] {
81
90
  padding-right: var(--space-100);
82
91
  grid-template-columns: auto 1fr auto;
83
92
  }
@@ -86,14 +95,14 @@ class m extends HTMLElement {
86
95
  ::slotted(mui-link[slot="action"]) { padding-top: var(--space-100); }
87
96
 
88
97
  @media (min-width: 600px) {
89
- :host { gap: var(--alert-gap-horizontal-desktop); }
90
- :host([has-action]) { padding-right: var(--space-100); }
98
+ :section { gap: var(--alert-gap-horizontal-desktop); }
99
+ :section([has-action]) { padding-right: var(--space-100); }
91
100
  ::slotted(mui-button[slot="action"]),
92
101
  ::slotted(mui-link[slot="action"]) { align-self: center; padding-top: var(--space-000); }
93
102
  }
94
103
 
95
104
  .label {
96
- color: var(${g});
105
+ color: var(${p});
97
106
  font-weight: var(--font-weight-bold);
98
107
  }
99
108
 
@@ -105,45 +114,39 @@ class m extends HTMLElement {
105
114
  gap: var(--space-000);
106
115
  }
107
116
 
108
- ${["positive", "info", "warning", "attention"].map(
109
- (l) => (
110
- /*css*/
111
- `
112
- :host([variant="${l}"]) {
113
- border: var(--feedback-${l}-border);
114
- background: var(--feedback-${l}-background);
115
- }
116
- `
117
- )
118
- ).join("")}
119
117
  `
120
118
  );
121
119
  this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
122
120
  `
123
- <style>${h}</style>
124
- <${c} size="medium" color="var(${p})" class="icon"></${c}>
121
+ <style>${b}</style>
122
+ <section>
123
+ <${i} size="medium" color="var(${r})" class="icon"></${i}>
125
124
  <mui-body>
126
125
  <span class="label">${u}</span>
127
126
  <slot></slot>
128
127
  </mui-body>
129
128
  <slot name="action"></slot>
129
+ </section>
130
130
  `, this.setupActionSlot());
131
131
  }
132
132
  setupActionSlot() {
133
133
  var o;
134
- const i = (o = this.shadowRoot) == null ? void 0 : o.querySelector('slot[name="action"]');
135
- if (i) {
136
- this.actionSlotListener && i.removeEventListener("slotchange", this.actionSlotListener);
134
+ const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector('slot[name="action"]');
135
+ if (e) {
136
+ this.actionSlotListener && e.removeEventListener("slotchange", this.actionSlotListener);
137
137
  const t = () => {
138
- const s = this.getAttribute("variant") || "positive", r = i.assignedElements();
138
+ var s;
139
+ const c = this.getAttribute("variant") || "positive", l = e.assignedElements();
139
140
  let a = !1;
140
- r.forEach((e) => {
141
- const n = e.tagName;
142
- (n === "MUI-BUTTON" || n === "MUI-LINK") && (a = !0, e.setAttribute("variant", "tertiary"), e.classList.add("alert-slot", `alert-${s}-slot`));
143
- }), a ? this.setAttribute("has-action", "") : this.removeAttribute("has-action");
141
+ l.forEach((i) => {
142
+ const r = i.tagName;
143
+ (r === "MUI-BUTTON" || r === "MUI-LINK") && (a = !0, i.setAttribute("variant", "tertiary"), i.removeAttribute("alert-slot"), i.removeAttribute("alert-positive-slot"), i.removeAttribute("alert-info-slot"), i.removeAttribute("alert-warning-slot"), i.removeAttribute("alert-attention-slot"), i.setAttribute("alert-slot", ""), i.setAttribute(`alert-${c}-slot`, ""));
144
+ });
145
+ const n = (s = this.shadowRoot) == null ? void 0 : s.querySelector("section");
146
+ n && (a ? n.setAttribute("has-action", "") : n.removeAttribute("has-action"));
144
147
  };
145
- this.actionSlotListener = t, i.addEventListener("slotchange", this.actionSlotListener), requestAnimationFrame(t);
148
+ this.actionSlotListener = t, e.addEventListener("slotchange", this.actionSlotListener), requestAnimationFrame(t);
146
149
  }
147
150
  }
148
151
  }
149
- customElements.get("mui-alert") || customElements.define("mui-alert", m);
152
+ customElements.get("mui-alert") || customElements.define("mui-alert", v);
@@ -12,23 +12,29 @@ class n extends HTMLElement {
12
12
  this.render();
13
13
  }
14
14
  render() {
15
- const t = this.getAttribute("variant") || "neutral", a = {
15
+ const t = this.getAttribute("variant") || "neutral", e = {
16
16
  neutral: "var(--badge-background-neutral)",
17
17
  positive: "var(--badge-background-positive)",
18
18
  warning: "var(--badge-background-warning)",
19
19
  attention: "var(--badge-background-attention)"
20
- }, e = {
20
+ }, a = {
21
21
  neutral: "off",
22
22
  positive: "polite",
23
23
  warning: "assertive",
24
24
  attention: "assertive"
25
- }, r = a[t], i = e[t], s = (
25
+ }, i = e[t], r = a[t], s = (
26
26
  /*css*/
27
27
  `
28
28
  :host {
29
- display: inline-block;
29
+ display: inline-flex;
30
+ box-sizing: border-box;
31
+ }
32
+
33
+ .badge {
34
+ display: inline-flex;
35
+ align-items: center;
30
36
  border-radius: var(--badge-radius);
31
- background: ${r};
37
+ background: ${i};
32
38
  font-size: var(--text-font-size-xs);
33
39
  font-weight: var(--badge-font-weight);
34
40
  color: var(--badge-text-color);
@@ -41,10 +47,12 @@ class n extends HTMLElement {
41
47
  }
42
48
  `
43
49
  );
44
- this.setAttribute("role", "status"), this.setAttribute("aria-live", i), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
50
+ this.setAttribute("role", "status"), this.setAttribute("aria-live", r), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
45
51
  `
46
52
  <style>${s}</style>
47
- <slot></slot>
53
+ <span class="badge">
54
+ <slot></slot>
55
+ </span>
48
56
  `);
49
57
  }
50
58
  }
@@ -55,6 +55,11 @@ class r extends HTMLElement {
55
55
  :host([variant="default"]) p {
56
56
  color: var(--text-color);
57
57
  }
58
+
59
+ :host([variant="optional"]) p {
60
+ color: var(--text-color-optional);
61
+ }
62
+
58
63
  :host([variant="success"]) p {
59
64
  color: var(--text-color-success);
60
65
  }
@@ -68,6 +73,9 @@ class r extends HTMLElement {
68
73
  :host([variant="default"]) ::slotted(.mui-icon) {
69
74
  fill: var(--text-color);
70
75
  }
76
+ :host([variant="optional"]) ::slotted(.mui-icon) {
77
+ fill: var(--text-color-optional);
78
+ }
71
79
  :host([variant="success"]) ::slotted(.mui-icon) {
72
80
  fill: var(--text-color-success);
73
81
  }
@@ -1,4 +1,4 @@
1
- import { getPartMap as u } from "../../utils/part-map/index.js";
1
+ import { getPartMap as b } from "../../utils/part-map/index.js";
2
2
  class h extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ["onclick", "type", "aria-label", "disabled", "variant", "size", "usage"];
@@ -8,7 +8,7 @@ class h extends HTMLElement {
8
8
  }
9
9
  async connectedCallback() {
10
10
  if (this.hasAttribute("size") || this.setAttribute("size", "medium"), await this.waitForPartMap(), !this.shadowRoot) return;
11
- let a = (
11
+ let o = (
12
12
  /*html*/
13
13
  `
14
14
  <style>
@@ -295,63 +295,63 @@ class h extends HTMLElement {
295
295
  /* ========================================================================== */
296
296
 
297
297
 
298
- :host(.alert-positive-slot) {
298
+ :host([alert-positive-slot]) {
299
299
  --alert-text: var(--feedback-positive-text);
300
300
  --alert-icon: var(--feedback-positive-icon);
301
301
  --alert-bg-hover: var(--feedback-positive-action-background);
302
302
  }
303
303
 
304
- :host(.alert-info-slot) {
304
+ :host([alert-info-slot]) {
305
305
  --alert-text: var(--feedback-info-text);
306
306
  --alert-icon: var(--feedback-info-icon);
307
307
  --alert-bg-hover: var(--feedback-info-action-background);
308
308
  }
309
309
 
310
- :host(.alert-warning-slot) {
310
+ :host([alert-warning-slot]) {
311
311
  --alert-text: var(--feedback-warning-text);
312
312
  --alert-icon: var(--feedback-warning-icon);
313
313
  --alert-bg-hover: var(--feedback-warning-action-background);
314
314
  }
315
315
 
316
- :host(.alert-attention-slot) {
316
+ :host([alert-attention-slot]) {
317
317
  --alert-text: var(--feedback-attention-text);
318
318
  --alert-icon: var(--feedback-attention-icon);
319
319
  --alert-bg-hover: var(--feedback-attention-action-background);
320
320
  }
321
321
 
322
- :host(.alert-slot) button {
322
+ :host([alert-slot]) button {
323
323
  font-weight: var(--font-weight-semi-bold);
324
324
  color: var(--alert-text);
325
325
  }
326
326
 
327
- :host(.alert-slot) button:hover,
328
- :host(.alert-slot) button:focus-visible {
327
+ :host([alert-slot]) button:hover,
328
+ :host([alert-slot]) button:focus-visible {
329
329
  background: var(--alert-bg-hover);
330
330
  color: var(--alert-text);
331
331
  }
332
332
 
333
- :host(.alert-slot) ::slotted(.mui-icon),
334
- :host(.alert-slot):hover ::slotted(.mui-icon),
335
- :host(.alert-slot):focus-visible ::slotted(.mui-icon) {
333
+ :host([alert-slot]) ::slotted(.mui-icon),
334
+ :host([alert-slot]):hover ::slotted(.mui-icon),
335
+ :host([alert-slot]):focus-visible ::slotted(.mui-icon) {
336
336
  fill: var(--alert-icon);
337
337
  }
338
338
 
339
339
  /* Dropdown Slot */
340
- :host([size].dropdown-slot) button {
340
+ :host([size][dropdown-slot]) button {
341
341
  border-radius: var(--radius-000);
342
342
  }
343
343
 
344
- :host(.dropdown-slot) button:hover,
345
- :host(.dropdown-slot) button:focus {
344
+ :host([dropdown-slot]) button:hover,
345
+ :host([dropdown-slot]) button:focus {
346
346
  background: var(--dropdown-button-background-hover);
347
347
  }
348
348
 
349
- :host([size].dropdown-slot-first) button {
349
+ :host([size][dropdown-slot-first]) button {
350
350
  border-top-left-radius: calc(var(--radius-100) / 2);
351
351
  border-top-right-radius: calc(var(--radius-100) / 2);
352
352
  }
353
353
 
354
- :host([size].dropdown-slot-last) button {
354
+ :host([size][dropdown-slot-last]) button {
355
355
  border-bottom-left-radius: calc(var(--radius-100) / 2);
356
356
  border-bottom-right-radius: calc(var(--radius-100) / 2);
357
357
  }
@@ -383,31 +383,30 @@ class h extends HTMLElement {
383
383
 
384
384
  /* Before & After Icon
385
385
  ========================================= */
386
- :host(.has-after) button,
387
- :host(.has-before) button,
388
- :host(.has-after.has-before) button {
386
+ :host([has-after]) button,
387
+ :host([has-before]) button,
388
+ :host([has-after][has-before]) button {
389
389
  display: grid;
390
390
  align-items: center;
391
391
  gap: var(--space-100);
392
392
  }
393
-
394
- :host(.has-after.has-before) button {
393
+
394
+ :host([has-after][has-before]) button {
395
395
  grid-template-columns: auto 1fr auto;
396
396
  padding-right: var(--action-after-slot-padding);
397
397
  padding-left: var(--action-before-slot-padding);
398
398
  }
399
399
 
400
- :host(.has-after) button {
400
+ :host([has-after]) button {
401
401
  grid-template-columns: 1fr auto;
402
402
  padding-right: var(--action-after-slot-padding);
403
403
  }
404
404
 
405
- :host(.has-before) button {
405
+ :host([has-before]) button {
406
406
  grid-template-columns: auto 1fr;
407
407
  padding-left: var(--action-before-slot-padding);
408
408
  }
409
409
 
410
-
411
410
  /* Size Variants
412
411
  ========================================= */
413
412
  :host([size="x-small"]) button,
@@ -463,60 +462,60 @@ class h extends HTMLElement {
463
462
 
464
463
  /* Before & After Icon
465
464
  ========================================= */
466
- :host([size="x-small"].has-after) button,
467
- :host([size="x-small"].has-before) button,
468
- :host([size="x-small"].has-after.has-before) button {
465
+ :host([size="x-small"][has-after]) button,
466
+ :host([size="x-small"][has-before]) button,
467
+ :host([size="x-small"][has-after][has-before]) button {
469
468
  gap: var(--space-025);
470
469
  }
471
470
 
472
- :host([size="x-small"].has-after.has-before) button {
471
+ :host([size="x-small"][has-after][has-before]) button {
473
472
  padding-right: var(--action-after-slot-padding-x-small);
474
473
  padding-left: var(--action-before-slot-padding-x-small);
475
474
  }
476
475
 
477
- :host([size="x-small"].has-after) button {
476
+ :host([size="x-small"][has-after]) button {
478
477
  padding-right: var(--action-after-slot-padding-x-small);
479
478
  }
480
479
 
481
- :host([size="x-small"].has-before) button {
480
+ :host([size="x-small"][has-before]) button {
482
481
  padding-left: var(--action-before-slot-padding-x-small);
483
482
  }
484
483
 
485
- :host([size="small"].has-after) button,
486
- :host([size="small"].has-before) button,
487
- :host([size="small"].has-after.has-before) button {
484
+ :host([size="small"][has-after]) button,
485
+ :host([size="small"][has-before]) button,
486
+ :host([size="small"][has-after][has-before]) button {
488
487
  gap: var(--space-050);
489
488
  }
490
489
 
491
- :host([size="small"].has-after.has-before) button {
490
+ :host([size="small"][has-after][has-before]) button {
492
491
  padding-right: var(--action-after-slot-padding-small);
493
492
  padding-left: var(--action-before-slot-padding-small);
494
493
  }
495
494
 
496
- :host([size="small"].has-after) button {
495
+ :host([size="small"][has-after]) button {
497
496
  padding-right: var(--action-after-slot-padding-small);
498
497
  }
499
498
 
500
- :host([size="small"].has-before) button {
499
+ :host([size="small"][has-before]) button {
501
500
  padding-left: var(--action-before-slot-padding-small);
502
501
  }
503
502
 
504
- :host([size="large"].has-after) button,
505
- :host([size="large"].has-before) button,
506
- :host([size="large"].has-after.has-before) button {
503
+ :host([size="large"][has-after]) button,
504
+ :host([size="large"][has-before]) button,
505
+ :host([size="large"][has-after][has-before]) button {
507
506
  gap: var(--space-200);
508
507
  }
509
508
 
510
- :host([size="large"].has-after.has-before) button {
509
+ :host([size="large"][has-after][has-before]) button {
511
510
  padding-right: var(--action-after-slot-padding-large);
512
511
  padding-left: var(--action-before-slot-padding-large);
513
512
  }
514
513
 
515
- :host([size="large"].has-after) button {
514
+ :host([size="large"][has-after]) button {
516
515
  padding-right: var(--action-after-slot-padding-large);
517
516
  }
518
517
 
519
- :host([size="large"].has-before) button {
518
+ :host([size="large"][has-before]) button {
520
519
  padding-left: var(--action-before-slot-padding-large);
521
520
  }
522
521
 
@@ -524,7 +523,7 @@ class h extends HTMLElement {
524
523
  </style>
525
524
 
526
525
  <button
527
- part="${u("text", "spacing", "layout", "visual")}"
526
+ part="${b("text", "spacing", "layout", "visual")}"
528
527
  onclick="${this.getAttribute("onclick")}"
529
528
  type="${this.getAttribute("type") || "button"}"
530
529
  aria-label="${this.getAttribute("aria-label") || ""}"
@@ -537,23 +536,23 @@ class h extends HTMLElement {
537
536
 
538
537
  `
539
538
  );
540
- this.shadowRoot.innerHTML = a, await customElements.whenDefined("mui-button"), requestAnimationFrame(() => {
541
- const i = this.shadowRoot;
542
- if (!i) return;
543
- const t = i.querySelector("slot:not([name])"), n = i.querySelector('slot[name="before"]'), r = i.querySelector('slot[name="after"]'), o = (l) => l ? l.assignedNodes({ flatten: !0 }).some((s) => {
539
+ this.shadowRoot.innerHTML = o, await customElements.whenDefined("mui-button"), requestAnimationFrame(() => {
540
+ const n = this.shadowRoot;
541
+ if (!n) return;
542
+ const e = n.querySelector("slot:not([name])"), t = n.querySelector('slot[name="before"]'), i = n.querySelector('slot[name="after"]'), a = (l) => l ? l.assignedNodes({ flatten: !0 }).some((s) => {
544
543
  var c;
545
544
  return s.nodeType === Node.ELEMENT_NODE || s.nodeType === Node.TEXT_NODE && !!((c = s.textContent) != null && c.trim());
546
- }) : !1, d = o(n), v = o(r);
547
- this.classList.toggle("has-before", d), this.classList.toggle("has-after", v);
548
- const b = (t == null ? void 0 : t.assignedNodes({ flatten: !0 })) ?? [];
549
- b.every((l) => {
545
+ }) : !1, d = a(t), u = a(i);
546
+ this.toggleAttribute("has-before", d), this.toggleAttribute("has-after", u);
547
+ const v = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) ?? [];
548
+ v.every((l) => {
550
549
  var s;
551
550
  if (l.nodeType === Node.ELEMENT_NODE) {
552
551
  const c = l;
553
552
  return c.tagName.toLowerCase() === "svg" || c.classList.contains("mui-icon");
554
553
  }
555
554
  return l.nodeType === Node.TEXT_NODE && !((s = l.textContent) != null && s.trim());
556
- }) ? (this.setAttribute("icon-only", ""), this.updateIconSizes(b, !0)) : (this.removeAttribute("icon-only"), [n, t, r].forEach((s) => {
555
+ }) ? (this.setAttribute("icon-only", ""), this.updateIconSizes(v, !0)) : (this.removeAttribute("icon-only"), [t, e, i].forEach((s) => {
557
556
  if (s) {
558
557
  const c = s.assignedNodes({ flatten: !0 });
559
558
  this.updateIconSizes(c, !1), this.updateAvatarSizes(c);
@@ -561,60 +560,65 @@ class h extends HTMLElement {
561
560
  }));
562
561
  });
563
562
  }
564
- attributeChangedCallback(e, a, i) {
565
- e === "size" && a !== i && this.shadowRoot && requestAnimationFrame(() => {
563
+ attributeChangedCallback(r, o, n) {
564
+ var e;
565
+ if (r === "disabled") {
566
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("button");
567
+ t && (this.hasAttribute("disabled") ? t.setAttribute("disabled", "") : t.removeAttribute("disabled"));
568
+ }
569
+ r === "size" && o !== n && this.shadowRoot && requestAnimationFrame(() => {
566
570
  const t = this.shadowRoot;
567
571
  if (!t) return;
568
- const n = [
572
+ const i = [
569
573
  t.querySelector("slot:not([name])"),
570
574
  t.querySelector('slot[name="before"]'),
571
575
  t.querySelector('slot[name="after"]')
572
- ], r = this.hasAttribute("icon-only");
573
- n.forEach((o) => {
574
- if (o) {
575
- const d = o.assignedNodes({ flatten: !0 });
576
- this.updateIconSizes(d, r), this.updateAvatarSizes(d);
576
+ ], a = this.hasAttribute("icon-only");
577
+ i.forEach((d) => {
578
+ if (d) {
579
+ const u = d.assignedNodes({ flatten: !0 });
580
+ this.updateIconSizes(u, a), this.updateAvatarSizes(u);
577
581
  }
578
582
  });
579
583
  });
580
584
  }
581
585
  // Update avatar sizes based on button size
582
- updateAvatarSizes(e) {
583
- const a = this.getAttribute("size") || "medium", t = {
586
+ updateAvatarSizes(r) {
587
+ const o = this.getAttribute("size") || "medium", e = {
584
588
  "x-small": "x-small",
585
589
  small: "x-small",
586
590
  medium: "small",
587
591
  large: "medium"
588
- }[a] || "small";
589
- e.forEach((n) => {
590
- if (n.nodeType === Node.ELEMENT_NODE) {
591
- const r = n;
592
- r.tagName.toLowerCase() === "mui-avatar" && r.setAttribute("size", t);
592
+ }[o] || "small";
593
+ r.forEach((t) => {
594
+ if (t.nodeType === Node.ELEMENT_NODE) {
595
+ const i = t;
596
+ i.tagName.toLowerCase() === "mui-avatar" && i.setAttribute("size", e);
593
597
  }
594
598
  });
595
599
  }
596
- updateIconSizes(e, a) {
597
- const i = this.getAttribute("size") || "medium", n = {
600
+ updateIconSizes(r, o) {
601
+ const n = this.getAttribute("size") || "medium", t = {
598
602
  "x-small": "x-small",
599
603
  small: "x-small",
600
- medium: a ? "medium" : "small",
604
+ medium: o ? "medium" : "small",
601
605
  // small for regular, medium for icon-only
602
- large: a ? "large" : "medium"
603
- }[i] || "small";
604
- e.forEach((r) => {
605
- if (r.nodeType === Node.ELEMENT_NODE) {
606
- const o = r;
607
- (o.tagName.toLowerCase() === "svg" || o.classList.contains("mui-icon") || o.tagName.toLowerCase() === "mui-icon") && !o.hasAttribute("size") && o.setAttribute("size", n);
606
+ large: o ? "large" : "medium"
607
+ }[n] || "small";
608
+ r.forEach((i) => {
609
+ if (i.nodeType === Node.ELEMENT_NODE) {
610
+ const a = i;
611
+ (a.tagName.toLowerCase() === "svg" || a.classList.contains("mui-icon") || a.tagName.toLowerCase() === "mui-icon") && !a.hasAttribute("size") && a.setAttribute("size", t);
608
612
  }
609
613
  });
610
614
  }
611
615
  waitForPartMap() {
612
- return new Promise((e) => {
613
- if (typeof u == "function") return e();
614
- const a = () => {
615
- typeof u == "function" ? e() : requestAnimationFrame(a);
616
+ return new Promise((r) => {
617
+ if (typeof b == "function") return r();
618
+ const o = () => {
619
+ typeof b == "function" ? r() : requestAnimationFrame(o);
616
620
  };
617
- a();
621
+ o();
618
622
  });
619
623
  }
620
624
  }