@muibook/components 10.0.1 → 11.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 (150) hide show
  1. package/LICENSE +27 -11
  2. package/README.md +4 -0
  3. package/dist/esm/components/mui-accordion/block/index.js +9 -5
  4. package/dist/esm/components/mui-alert/index.js +88 -52
  5. package/dist/esm/components/mui-badge/index.js +61 -16
  6. package/dist/esm/components/mui-body/index.js +76 -10
  7. package/dist/esm/components/mui-button/index.js +152 -32
  8. package/dist/esm/components/mui-card/card/index.js +13 -8
  9. package/dist/esm/components/mui-checkbox/index.js +64 -30
  10. package/dist/esm/components/mui-chip/index.js +153 -33
  11. package/dist/esm/components/mui-chip-input/index.js +407 -0
  12. package/dist/esm/components/mui-code/index.js +11 -9
  13. package/dist/esm/components/mui-dialog/index.js +17 -8
  14. package/dist/esm/components/mui-dropdown/index.js +44 -44
  15. package/dist/esm/components/mui-field/index.js +56 -21
  16. package/dist/esm/components/mui-form-group/index.js +88 -0
  17. package/dist/esm/components/mui-form-hint/index.js +1 -0
  18. package/dist/esm/components/mui-form-message/index.js +72 -0
  19. package/dist/esm/components/mui-form-section/index.js +108 -0
  20. package/dist/esm/components/mui-form-section-footer/index.js +46 -0
  21. package/dist/esm/components/mui-hint/index.js +146 -0
  22. package/dist/esm/components/mui-icons/accessibility/index.js +5 -4
  23. package/dist/esm/components/mui-icons/add/index.js +1 -0
  24. package/dist/esm/components/mui-icons/ai/index.js +5 -4
  25. package/dist/esm/components/mui-icons/attention/index.js +1 -0
  26. package/dist/esm/components/mui-icons/calendar/index.js +5 -4
  27. package/dist/esm/components/mui-icons/check/index.js +6 -5
  28. package/dist/esm/components/mui-icons/checkmark/index.js +9 -8
  29. package/dist/esm/components/mui-icons/close/index.js +6 -5
  30. package/dist/esm/components/mui-icons/down-arrow-circle/index.js +9 -8
  31. package/dist/esm/components/mui-icons/down-chevron/index.js +8 -7
  32. package/dist/esm/components/mui-icons/ellipsis/index.js +1 -0
  33. package/dist/esm/components/mui-icons/exclamationmark/index.js +49 -0
  34. package/dist/esm/components/mui-icons/game-controller/index.js +8 -7
  35. package/dist/esm/components/mui-icons/gear/index.js +5 -4
  36. package/dist/esm/components/mui-icons/globe/index.js +8 -7
  37. package/dist/esm/components/mui-icons/grid/index.js +1 -0
  38. package/dist/esm/components/mui-icons/home/index.js +9 -8
  39. package/dist/esm/components/mui-icons/index.js +3 -0
  40. package/dist/esm/components/mui-icons/info/index.js +3 -2
  41. package/dist/esm/components/mui-icons/left-arrow/index.js +1 -0
  42. package/dist/esm/components/mui-icons/left-chevron/index.js +6 -5
  43. package/dist/esm/components/mui-icons/left-sidebar/index.js +6 -5
  44. package/dist/esm/components/mui-icons/list-and-film/index.js +1 -0
  45. package/dist/esm/components/mui-icons/menu/index.js +8 -7
  46. package/dist/esm/components/mui-icons/message/index.js +5 -4
  47. package/dist/esm/components/mui-icons/moon/index.js +3 -2
  48. package/dist/esm/components/mui-icons/movie-clapper/index.js +5 -4
  49. package/dist/esm/components/mui-icons/music-microphone/index.js +6 -5
  50. package/dist/esm/components/mui-icons/music-quarter-note/index.js +1 -0
  51. package/dist/esm/components/mui-icons/notification/index.js +5 -4
  52. package/dist/esm/components/mui-icons/pin/index.js +3 -2
  53. package/dist/esm/components/mui-icons/pin-slash/index.js +6 -5
  54. package/dist/esm/components/mui-icons/play-rectangle/index.js +9 -8
  55. package/dist/esm/components/mui-icons/play-stack/index.js +5 -4
  56. package/dist/esm/components/mui-icons/rectangle/index.js +6 -5
  57. package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +1 -0
  58. package/dist/esm/components/mui-icons/rectangle-dashed/index.js +1 -0
  59. package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +1 -0
  60. package/dist/esm/components/mui-icons/rectangle-media-text/index.js +6 -5
  61. package/dist/esm/components/mui-icons/right-chevron/index.js +1 -0
  62. package/dist/esm/components/mui-icons/search/index.js +6 -5
  63. package/dist/esm/components/mui-icons/spinner/index.js +56 -0
  64. package/dist/esm/components/mui-icons/stop/index.js +3 -2
  65. package/dist/esm/components/mui-icons/subtract/index.js +1 -0
  66. package/dist/esm/components/mui-icons/sun/index.js +1 -0
  67. package/dist/esm/components/mui-icons/text-below-folder/index.js +55 -0
  68. package/dist/esm/components/mui-icons/toggle/index.js +8 -6
  69. package/dist/esm/components/mui-icons/translate/index.js +5 -4
  70. package/dist/esm/components/mui-icons/up-arrow/index.js +5 -4
  71. package/dist/esm/components/mui-icons/up-chevron/index.js +6 -5
  72. package/dist/esm/components/mui-icons/warning/index.js +7 -6
  73. package/dist/esm/components/mui-input/index.js +298 -47
  74. package/dist/esm/components/mui-link/index.js +187 -59
  75. package/dist/esm/components/mui-list/item/index.js +3 -0
  76. package/dist/esm/components/mui-markdown/index.js +149 -0
  77. package/dist/esm/components/mui-media-player/index.js +184 -0
  78. package/dist/esm/components/mui-message/index.js +50 -20
  79. package/dist/esm/components/mui-progress/index.js +15 -15
  80. package/dist/esm/components/mui-prompt/index.js +1461 -0
  81. package/dist/esm/components/mui-prompt-message/index.js +114 -0
  82. package/dist/esm/components/mui-prompt-preview/index.js +497 -0
  83. package/dist/esm/components/mui-prompt-toggle/index.js +48 -0
  84. package/dist/esm/components/mui-radio/index.js +155 -0
  85. package/dist/esm/components/mui-radio-group/index.js +104 -0
  86. package/dist/esm/components/mui-range-input/index.js +122 -0
  87. package/dist/esm/components/mui-rule/index.js +11 -3
  88. package/dist/esm/components/mui-select/index.js +89 -30
  89. package/dist/esm/components/mui-spinner/index.js +70 -0
  90. package/dist/esm/components/mui-stepper/step/index.js +255 -18
  91. package/dist/esm/components/mui-stepper/stepper/index.js +68 -72
  92. package/dist/esm/components/mui-table/row/index.js +16 -3
  93. package/dist/esm/components/mui-tabs/controller/index.js +21 -14
  94. package/dist/esm/components/mui-tabs/item/index.js +285 -29
  95. package/dist/esm/components/mui-tabs/panel/index.js +3 -0
  96. package/dist/esm/components/mui-tabs/tab-bar/index.js +85 -34
  97. package/dist/esm/components/mui-textarea/index.js +257 -0
  98. package/dist/esm/css/mui-base.css +27 -0
  99. package/dist/esm/css/mui-brand.css +3 -1
  100. package/dist/esm/css/mui-tokens.css +234 -7
  101. package/dist/esm/custom-elements.json +5113 -1702
  102. package/dist/esm/index.js +24 -4
  103. package/dist/esm/tokens/js/index.js +107 -105
  104. package/dist/types/components/mui-agent-bubble/doc.d.ts +2 -0
  105. package/dist/types/components/mui-agent-bubble/index.d.ts +1 -0
  106. package/dist/types/components/mui-agent-prompt/doc.d.ts +2 -0
  107. package/dist/types/components/mui-agent-prompt/index.d.ts +1 -0
  108. package/dist/types/components/mui-chip-input/doc.d.ts +2 -0
  109. package/dist/types/components/mui-chip-input/index.d.ts +3 -0
  110. package/dist/types/components/mui-form-group/doc.d.ts +2 -0
  111. package/dist/types/components/mui-form-group/index.d.ts +2 -0
  112. package/dist/types/components/mui-form-group-horizontal/index.d.ts +1 -0
  113. package/dist/types/components/mui-form-hint/doc.d.ts +2 -0
  114. package/dist/types/components/mui-form-hint/index.d.ts +1 -0
  115. package/dist/types/components/mui-form-message/index.d.ts +2 -0
  116. package/dist/types/components/mui-form-section/doc.d.ts +2 -0
  117. package/dist/types/components/mui-form-section/index.d.ts +1 -0
  118. package/dist/types/components/mui-form-section-footer/doc.d.ts +2 -0
  119. package/dist/types/components/mui-form-section-footer/index.d.ts +1 -0
  120. package/dist/types/components/mui-hint/doc.d.ts +2 -0
  121. package/dist/types/components/mui-hint/index.d.ts +1 -0
  122. package/dist/types/components/mui-icons/exclamationmark.d.ts +1 -0
  123. package/dist/types/components/mui-icons/index.d.ts +3 -0
  124. package/dist/types/components/mui-icons/spinner.d.ts +1 -0
  125. package/dist/types/components/mui-icons/text-below-folder.d.ts +1 -0
  126. package/dist/types/components/mui-markdown/doc.d.ts +2 -0
  127. package/dist/types/components/mui-markdown/index.d.ts +1 -0
  128. package/dist/types/components/mui-media-player/doc.d.ts +2 -0
  129. package/dist/types/components/mui-media-player/index.d.ts +8 -0
  130. package/dist/types/components/mui-prompt/doc.d.ts +2 -0
  131. package/dist/types/components/mui-prompt/index.d.ts +18 -0
  132. package/dist/types/components/mui-prompt-chip/index.d.ts +1 -0
  133. package/dist/types/components/mui-prompt-message/doc.d.ts +2 -0
  134. package/dist/types/components/mui-prompt-message/index.d.ts +1 -0
  135. package/dist/types/components/mui-prompt-preview/doc.d.ts +2 -0
  136. package/dist/types/components/mui-prompt-preview/index.d.ts +7 -0
  137. package/dist/types/components/mui-prompt-toggle/index.d.ts +1 -0
  138. package/dist/types/components/mui-radio/doc.d.ts +2 -0
  139. package/dist/types/components/mui-radio/index.d.ts +1 -0
  140. package/dist/types/components/mui-radio-group/index.d.ts +1 -0
  141. package/dist/types/components/mui-range-input/doc.d.ts +2 -0
  142. package/dist/types/components/mui-range-input/index.d.ts +1 -0
  143. package/dist/types/components/mui-spinner/doc.d.ts +2 -0
  144. package/dist/types/components/mui-spinner/index.d.ts +1 -0
  145. package/dist/types/components/mui-stepper/step/index.d.ts +4 -1
  146. package/dist/types/components/mui-textarea/doc.d.ts +2 -0
  147. package/dist/types/components/mui-textarea/index.d.ts +1 -0
  148. package/dist/types/index.d.ts +21 -0
  149. package/dist/types/tokens/js/index.d.ts +2 -0
  150. package/package.json +88 -1
@@ -9,66 +9,66 @@ class u extends HTMLElement {
9
9
  async connectedCallback() {
10
10
  this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("weight") || this.setAttribute("weight", "regular"), this.hasAttribute("variant") || this.setAttribute("variant", "default"), await this.waitForPartMap(), this.render(), requestAnimationFrame(() => this.updateSlotState());
11
11
  }
12
- attributeChangedCallback(a, o, e) {
12
+ attributeChangedCallback(t, o, e) {
13
13
  if (this.shadowRoot) {
14
- if (a === "href") {
15
- const t = this.shadowRoot.querySelector("a");
16
- t && t.setAttribute("href", e || "#");
17
- }
18
- if (a === "target") {
19
- const t = this.shadowRoot.querySelector("a");
20
- t && t.setAttribute("target", e || "_self");
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
- }
26
- if (a === "download") {
27
- const t = this.shadowRoot.querySelector("a");
28
- if (!t) return;
29
- e !== null ? t.setAttribute("download", e === "" ? "" : e) : t.removeAttribute("download");
30
- }
31
- a === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => {
32
- const t = this.shadowRoot;
33
- if (!t) return;
34
- const d = [
35
- t.querySelector("slot:not([name])"),
36
- t.querySelector('slot[name="before"]'),
37
- t.querySelector('slot[name="after"]')
14
+ if (t === "href") {
15
+ const a = this.shadowRoot.querySelector("a");
16
+ a && a.setAttribute("href", e || "#");
17
+ }
18
+ if (t === "target") {
19
+ const a = this.shadowRoot.querySelector("a");
20
+ a && a.setAttribute("target", e || "_self");
21
+ }
22
+ if (t === "disabled") {
23
+ const a = this.shadowRoot.querySelector("a");
24
+ a && (e !== null ? (a.setAttribute("aria-disabled", "true"), a.setAttribute("href", "javascript:void(0)")) : (a.setAttribute("aria-disabled", "false"), a.setAttribute("href", this.getAttribute("href") || "#")));
25
+ }
26
+ if (t === "download") {
27
+ const a = this.shadowRoot.querySelector("a");
28
+ if (!a) return;
29
+ e !== null ? a.setAttribute("download", e === "" ? "" : e) : a.removeAttribute("download");
30
+ }
31
+ t === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => {
32
+ const a = this.shadowRoot;
33
+ if (!a) return;
34
+ const n = [
35
+ a.querySelector("slot:not([name])"),
36
+ a.querySelector('slot[name="before"]'),
37
+ a.querySelector('slot[name="after"]')
38
38
  ], s = this.hasAttribute("icon-only");
39
- d.forEach((r) => {
40
- if (r) {
41
- const i = r.assignedNodes({ flatten: !0 });
42
- this.updateIconSizes(i, s), this.updateAvatarSizes(i);
39
+ n.forEach((i) => {
40
+ if (i) {
41
+ const r = i.assignedNodes({ flatten: !0 });
42
+ this.updateIconSizes(r, s), this.updateAvatarSizes(r), this.updateBadgeSizes(r);
43
43
  }
44
44
  });
45
45
  });
46
46
  }
47
47
  }
48
48
  updateSlotState() {
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) => {
49
+ const t = this.shadowRoot, o = t.querySelector("slot:not([name])"), e = t.querySelector('slot[name="before"]'), a = t.querySelector('slot[name="after"]'), n = (d) => !!d && d.assignedNodes({ flatten: !0 }).some(
50
+ (l) => {
51
51
  var c;
52
- return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!((c = n.textContent) != null && c.trim());
52
+ return l.nodeType === Node.ELEMENT_NODE || l.nodeType === Node.TEXT_NODE && !!((c = l.textContent) != null && c.trim());
53
53
  }
54
- ), s = d(e), r = d(t);
55
- this.toggleAttribute("has-before", s), this.toggleAttribute("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());
54
+ ), s = n(e), i = n(a);
55
+ this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
56
+ const r = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], v = r.length > 0 && r.every(
57
+ (d) => {
58
+ var l;
59
+ return d.nodeType === Node.ELEMENT_NODE ? d.classList.contains("mui-icon") || d.tagName.toLowerCase() === "svg" : !((l = d.textContent) != null && l.trim());
60
60
  }
61
61
  );
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
+ this.toggleAttribute("icon-only", v), v ? this.updateIconSizes(r, !0) : [e, o, a].forEach((l) => {
63
+ if (l) {
64
+ const c = l.assignedNodes({ flatten: !0 });
65
+ this.updateIconSizes(c, !1), this.updateAvatarSizes(c), this.updateBadgeSizes(c);
66
66
  }
67
67
  });
68
68
  }
69
69
  render() {
70
70
  if (!this.shadowRoot) return;
71
- const a = h("text", "spacing", "layout", "visual");
71
+ const t = h("text", "spacing", "layout", "visual");
72
72
  this.shadowRoot.innerHTML = /*html*/
73
73
  `
74
74
  <style>
@@ -96,6 +96,11 @@ class u extends HTMLElement {
96
96
  a, a:before, a:after {box-sizing: border-box;}
97
97
  a:focus-visible { outline: var(--outline-thick); }
98
98
 
99
+ :host([size="xx-small"]) a {
100
+ font-size: var(--font-size-15);
101
+ line-height: var(--line-height-25);
102
+ }
103
+
99
104
  :host([size="x-small"]) a {
100
105
  font-size: var(--text-font-size-xs);
101
106
  line-height: var(--text-line-height-xs);
@@ -127,12 +132,14 @@ class u extends HTMLElement {
127
132
  :host([variant="primary"]),
128
133
  :host([variant="secondary"]),
129
134
  :host([variant="tertiary"]),
135
+ :host([variant="overlay"]),
130
136
  :host([variant="attention"]),
131
137
  :host([usage="input"]) { display: inline-block; text-align: center; }
132
138
 
133
139
  :host([variant="primary"]) a,
134
140
  :host([variant="secondary"]) a,
135
141
  :host([variant="tertiary"]) a,
142
+ :host([variant="overlay"]) a,
136
143
  :host([variant="attention"]) a,
137
144
  :host([usage="input"]) a {
138
145
  display: inherit;
@@ -245,6 +252,46 @@ class u extends HTMLElement {
245
252
  :host([variant="tertiary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-focus); }
246
253
  :host([variant="tertiary"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-disabled); }
247
254
 
255
+ /* Button Overlay
256
+ ========================================= */
257
+ :host([variant="overlay"]) a {
258
+ background: color-mix(in srgb, var(--action-overlay-background) 85%, transparent);
259
+ color: var(--action-overlay-text-color);
260
+ border: var(--action-overlay-border);
261
+ -webkit-backdrop-filter: blur(var(--space-100)) saturate(120%);
262
+ backdrop-filter: blur(var(--space-100)) saturate(120%);
263
+ }
264
+
265
+ :host([variant="overlay"]) a:hover {
266
+ background: color-mix(in srgb, var(--action-overlay-background-hover) 85%, transparent);
267
+ color: var(--action-overlay-text-color-hover);
268
+ border: var(--action-overlay-border-hover);
269
+ -webkit-backdrop-filter: blur(var(--space-100)) saturate(120%);
270
+ backdrop-filter: blur(var(--space-100)) saturate(120%);
271
+ }
272
+
273
+ :host([variant="overlay"]) a:focus-visible {
274
+ background: color-mix(in srgb, var(--action-overlay-background-focus) 85%, transparent);
275
+ color: var(--action-overlay-text-color-focus);
276
+ border: var(--action-overlay-border-focus);
277
+ -webkit-backdrop-filter: blur(var(--space-100)) saturate(120%);
278
+ backdrop-filter: blur(var(--space-100)) saturate(120%);
279
+ }
280
+
281
+ :host([variant="overlay"]) a[aria-disabled="true"] {
282
+ background: color-mix(in srgb, var(--action-overlay-background-disabled) 85%, transparent);
283
+ color: var(--action-overlay-text-color-disabled);
284
+ border: var(--action-overlay-border-disabled);
285
+ -webkit-backdrop-filter: blur(var(--space-100)) saturate(120%);
286
+ backdrop-filter: blur(var(--space-100)) saturate(120%);
287
+ cursor: not-allowed;
288
+ }
289
+
290
+ :host([variant="overlay"]) a ::slotted(.mui-icon) { fill: var(--action-overlay-text-color); }
291
+ :host([variant="overlay"]) a:hover ::slotted(.mui-icon) { fill: var(--action-overlay-text-color-hover); }
292
+ :host([variant="overlay"]) a:focus ::slotted(.mui-icon) { fill: var(--action-overlay-text-color-focus); }
293
+ :host([variant="overlay"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-overlay-text-color-disabled); }
294
+
248
295
  /* Button Attention
249
296
  ========================================= */
250
297
  :host([variant="attention"]) a {
@@ -333,6 +380,7 @@ class u extends HTMLElement {
333
380
  /* AVATAR */
334
381
 
335
382
  /* Link - Default */
383
+ :host([variant="default"][size="xx-small"]) a ::slotted(mui-avatar),
336
384
  :host([variant="default"][size="x-small"]) a ::slotted(mui-avatar) {
337
385
  margin-right: var(--space-025);
338
386
  }
@@ -348,6 +396,7 @@ class u extends HTMLElement {
348
396
  }
349
397
 
350
398
  /* Link Button: Sizes */
399
+ :host(:not([variant="default"])[size="xx-small"]) a ::slotted(mui-avatar),
351
400
  :host(:not([variant="default"])[size="x-small"]) a ::slotted(mui-avatar) {
352
401
  margin-right: var(--space-025);
353
402
  }
@@ -376,6 +425,30 @@ class u extends HTMLElement {
376
425
  --avatar-background-override: var(--action-avatar-background-hover);
377
426
  }
378
427
 
428
+ /* Badge Spacing */
429
+ :host([has-before]) a ::slotted(mui-badge[slot="before"]) {
430
+ margin-right: var(--space-025);
431
+ }
432
+
433
+ :host([has-after]) a ::slotted(mui-badge[slot="after"]) {
434
+ margin-left: var(--space-025);
435
+ }
436
+
437
+ :host([size="x-small"][has-before]) a ::slotted(mui-badge[slot="before"]) {
438
+ margin-right: var(--space-025);
439
+ }
440
+
441
+ :host([size="x-small"][has-after]) a ::slotted(mui-badge[slot="after"]) {
442
+ margin-left: var(--space-025);
443
+ }
444
+
445
+ :host([size="large"][has-before]) a ::slotted(mui-badge[slot="before"]) {
446
+ margin-right: var(--space-050);
447
+ }
448
+
449
+ :host([size="large"][has-after]) a ::slotted(mui-badge[slot="after"]) {
450
+ margin-left: var(--space-050);
451
+ }
379
452
 
380
453
 
381
454
  /* Before & After Icon
@@ -488,6 +561,18 @@ class u extends HTMLElement {
488
561
  /* Size Variants with Before & After Icon padding adjustments */
489
562
  /* ========================================================================== */
490
563
 
564
+ :host([size="xx-small"][variant]:not([variant="default"])) a,
565
+ :host([size="xx-small"][variant]:not([variant="default"])) a:hover,
566
+ :host([size="xx-small"][variant]:not([variant="default"])) a:focus,
567
+ :host([size="xx-small"][variant]:not([variant="default"])) a[aria-disabled="true"] {
568
+ font-size: var(--font-size-15);
569
+ line-height: var(--line-height-25);
570
+ font-weight: var(--font-weight-semi-bold);
571
+ padding: var(--space-025) var(--space-100);
572
+ border-width: var(--stroke-size-100);
573
+ border-radius: var(--action-radius-x-small);
574
+ }
575
+
491
576
  :host([size="x-small"][variant]:not([variant="default"])) a,
492
577
  :host([size="x-small"][variant]:not([variant="default"])) a:hover,
493
578
  :host([size="x-small"][variant]:not([variant="default"])) a:focus,
@@ -522,6 +607,12 @@ class u extends HTMLElement {
522
607
  }
523
608
 
524
609
  /* Icon-only size variants */
610
+ :host([size="xx-small"][variant]:not([variant="default"])[icon-only]) a {
611
+ height: calc(var(--action-icon-only-size-x-small) - var(--space-100));
612
+ width: calc(var(--action-icon-only-size-x-small) - var(--space-100));
613
+ padding: var(--action-icon-only-padding);
614
+ }
615
+
525
616
  :host([size="x-small"][variant]:not([variant="default"])[icon-only]) a {
526
617
  height: var(--action-icon-only-size-x-small);
527
618
  width: var(--action-icon-only-size-x-small);
@@ -546,11 +637,30 @@ class u extends HTMLElement {
546
637
  padding: var(--action-icon-only-padding);
547
638
  }
548
639
 
640
+ :host([size="xx-small"][variant]:not([variant="default"])[has-after]) a,
641
+ :host([size="xx-small"][variant]:not([variant="default"])[has-before]) a,
642
+ :host([size="xx-small"][variant]:not([variant="default"])[has-after][has-before]) a {
643
+ gap: var(--space-050);
644
+ }
645
+
646
+ :host([size="xx-small"][variant]:not([variant="default"])[has-after][has-before]) a {
647
+ padding-right: var(--action-after-slot-padding-x-small);
648
+ padding-left: var(--action-before-slot-padding-x-small);
649
+ }
650
+
651
+ :host([size="xx-small"][variant]:not([variant="default"])[has-after]) a {
652
+ padding-right: var(--action-after-slot-padding-x-small);
653
+ }
654
+
655
+ :host([size="xx-small"][variant]:not([variant="default"])[has-before]) a {
656
+ padding-left: var(--action-before-slot-padding-x-small);
657
+ }
658
+
549
659
  /* Before & After Icon padding adjustments for x-small */
550
660
  :host([size="x-small"][variant]:not([variant="default"])[has-after]) a,
551
661
  :host([size="x-small"][variant]:not([variant="default"])[has-before]) a,
552
662
  :host([size="x-small"][variant]:not([variant="default"])[has-after][has-before]) a {
553
- gap: var(--space-025);
663
+ gap: var(--space-050);
554
664
  }
555
665
 
556
666
  :host([size="x-small"][variant]:not([variant="default"])[has-after][has-before]) a {
@@ -570,7 +680,7 @@ class u extends HTMLElement {
570
680
  :host([size="small"][variant]:not([variant="default"])[has-after]) a,
571
681
  :host([size="small"][variant]:not([variant="default"])[has-before]) a,
572
682
  :host([size="small"][variant]:not([variant="default"])[has-after][has-before]) a {
573
- gap: var(--space-050);
683
+ gap: var(--space-100);
574
684
  }
575
685
 
576
686
  :host([size="small"][variant]:not([variant="default"])[has-after][has-before]) a {
@@ -624,7 +734,7 @@ class u extends HTMLElement {
624
734
  </style>
625
735
 
626
736
  <a
627
- part="${a}"
737
+ part="${t}"
628
738
  target="${this.getAttribute("target") || "_self"}"
629
739
  href="${this.hasAttribute("disabled") ? "javascript:void(0)" : this.getAttribute("href") || "#"}"
630
740
  aria-disabled="${this.hasAttribute("disabled") ? "true" : "false"}"
@@ -637,44 +747,62 @@ class u extends HTMLElement {
637
747
  `;
638
748
  }
639
749
  // Update avatar sizes based on button size
640
- updateAvatarSizes(a) {
750
+ updateAvatarSizes(t) {
641
751
  const o = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
752
+ "xx-small": "x-small",
642
753
  "x-small": "x-small",
643
754
  small: "x-small",
644
755
  medium: "x-small",
645
756
  large: "small"
646
757
  } : {
758
+ "xx-small": "x-small",
647
759
  "x-small": "x-small",
648
760
  small: "x-small",
649
761
  medium: "small",
650
762
  large: "medium"
651
763
  })[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);
764
+ t.forEach((i) => {
765
+ if (i.nodeType === Node.ELEMENT_NODE) {
766
+ const r = i;
767
+ r.tagName.toLowerCase() === "mui-avatar" && r.setAttribute("size", s);
656
768
  }
657
769
  });
658
770
  }
659
- updateIconSizes(a, o) {
660
- const e = this.getAttribute("size") || "medium", d = {
771
+ updateIconSizes(t, o) {
772
+ const e = this.getAttribute("size") || "medium", n = {
773
+ "xx-small": "xx-small",
661
774
  "x-small": "x-small",
662
775
  small: "x-small",
663
776
  medium: o ? "medium" : "small",
664
777
  large: o ? "large" : "medium"
665
778
  }[e] || "small";
666
- a.forEach((s) => {
779
+ t.forEach((s) => {
667
780
  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);
781
+ const i = s, r = i.tagName.toLowerCase();
782
+ (r === "svg" || i.classList.contains("mui-icon") || r === "mui-icon") && !i.hasAttribute("size") && i.setAttribute("size", n);
783
+ }
784
+ });
785
+ }
786
+ updateBadgeSizes(t) {
787
+ const o = this.getAttribute("size") || "medium", a = {
788
+ "xx-small": "x-small",
789
+ "x-small": "x-small",
790
+ small: "small",
791
+ medium: "medium",
792
+ large: "large"
793
+ }[o] || "medium";
794
+ t.forEach((n) => {
795
+ if (n.nodeType === Node.ELEMENT_NODE) {
796
+ const s = n;
797
+ s.tagName.toLowerCase() === "mui-badge" && s.setAttribute("size", a);
670
798
  }
671
799
  });
672
800
  }
673
801
  waitForPartMap() {
674
- return new Promise((a) => {
675
- if (typeof h == "function") return a();
802
+ return new Promise((t) => {
803
+ if (typeof h == "function") return t();
676
804
  const o = () => {
677
- typeof h == "function" ? a() : requestAnimationFrame(o);
805
+ typeof h == "function" ? t() : requestAnimationFrame(o);
678
806
  };
679
807
  o();
680
808
  });
@@ -20,6 +20,9 @@ class e extends HTMLElement {
20
20
  margin: var(--space-000);
21
21
  color: var(--text-color);
22
22
  }
23
+ :host(:not(:last-child)) {
24
+ margin-bottom: var(--space-025);
25
+ }
23
26
 
24
27
  /* Size styles */
25
28
 
@@ -0,0 +1,149 @@
1
+ import { marked as m } from "../../node_modules/marked/lib/marked.esm/index.js";
2
+ const u = (n) => n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/'/g, "&#39;"), p = (n) => {
3
+ const i = n.split(`
4
+ `);
5
+ let d = !1, t = !1;
6
+ const o = [];
7
+ for (const e of i) {
8
+ if (e.match(/^--\s*box\s*--$/i)) {
9
+ t ? (o.push("</div>"), t = !1) : (o.push("<div>"), t = !0);
10
+ continue;
11
+ }
12
+ if (e.match(/^--\s*rule\s*--$/i)) {
13
+ o.push("<mui-rule></mui-rule>");
14
+ continue;
15
+ }
16
+ const c = e.match(/^--\s*space-(\d{3})\s*--$/i);
17
+ if (c) {
18
+ const l = c[1];
19
+ o.push(`<div style="height:var(--space-${l});"></div>`);
20
+ continue;
21
+ }
22
+ const r = e.match(/^--\s*grid-col-([^-]+(?:-[^-]+)*)\s*--$/);
23
+ if (r) {
24
+ if (d)
25
+ o.push("</div>"), d = !1;
26
+ else {
27
+ const l = r[1].split("-").join(" ");
28
+ o.push(
29
+ `<div style="display:grid;grid-template-columns:${l};gap:var(--space-300);align-items:start;">`
30
+ ), d = !0;
31
+ }
32
+ continue;
33
+ }
34
+ o.push(e);
35
+ }
36
+ return d && o.push("</div>"), t && o.push("</div>"), o.join(`
37
+ `);
38
+ }, h = (n) => n.toLowerCase().trim().replace(/<[^>]+>/g, "").replace(/[^\w\s-]/g, "").replace(/\s+/g, "-"), b = (n) => {
39
+ const { bodySize: i, codeSize: d } = n, t = new m.Renderer(), o = /* @__PURE__ */ new Map();
40
+ return t.heading = (e, s) => {
41
+ const a = {
42
+ 1: { size: "2", level: "2" },
43
+ 2: { size: "2", level: "2" },
44
+ 3: { size: "4", level: "4" },
45
+ 4: { size: "5", level: "5" },
46
+ 5: { size: "5", level: "5" },
47
+ 6: { size: "5", level: "5" }
48
+ }, c = a[s] ?? a[4], r = h(e), l = (o.get(r) ?? 0) + 1;
49
+ return o.set(r, l), `<mui-heading id="${l > 1 ? `${r}-${l}` : r}" size="${c.size}" level="${c.level}">${e}</mui-heading>`;
50
+ }, t.paragraph = (e) => `<mui-body size="${i}" weight="regular" variant="default">${e}</mui-body>`, t.link = (e, s, a) => {
51
+ const c = e ? u(e) : "", r = s ? ` title="${u(s)}"` : "";
52
+ return `<mui-link href="${c}"${r}>${a}</mui-link>`;
53
+ }, t.list = (e, s) => `<mui-list size="${i}" as="${s ? "ol" : "ul"}">${e}</mui-list>`, t.listitem = (e) => `<mui-list-item size="${i}">${e}</mui-list-item>`, t.hr = () => "<mui-rule></mui-rule>", t.blockquote = (e) => `<mui-quote>${e}</mui-quote>`, t.codespan = (e) => `<span class="md-inline-code">${u(e)}</span>`, t.code = (e) => `<div class="md-code-block">
54
+ <mui-button class="md-code-copy" size="x-small" variant="tertiary" data-copy-code>Copy</mui-button>
55
+ <mui-code size="${d}" scrollable>${u(e)}</mui-code>
56
+ </div>`, t.image = (e, s, a) => {
57
+ const c = e ? u(e) : "", r = a ? u(a) : "", l = s ? ` title="${u(s)}"` : "";
58
+ return `<mui-image src="${c}" alt="${r}"${l}></mui-image>`;
59
+ }, t.table = (e, s) => `<mui-card class="md-table-card">
60
+ <mui-card-body condensed>
61
+ <div class="md-table-scroll">
62
+ <mui-table class="md-table">
63
+ <mui-row-group heading>${e}</mui-row-group>
64
+ <mui-row-group>${s}</mui-row-group>
65
+ </mui-table>
66
+ </div>
67
+ </mui-card-body>
68
+ </mui-card>`, t.tablerow = (e) => {
69
+ const s = (e.match(/<mui-cell\b/g) || []).length;
70
+ return `<mui-row columns="${s ? Array(s).fill("1fr").join(" ") : "1fr"}">${e}</mui-row>`;
71
+ }, t.tablecell = (e) => `<mui-cell>${e}</mui-cell>`, t;
72
+ };
73
+ class g extends HTMLElement {
74
+ static get observedAttributes() {
75
+ return ["markdown", "body-size", "code-size"];
76
+ }
77
+ constructor() {
78
+ super(), this.attachShadow({ mode: "open" });
79
+ }
80
+ connectedCallback() {
81
+ this.render(), this.hasAttribute("markdown") || (this.observer = new MutationObserver(() => this.render()), this.observer.observe(this, { childList: !0, subtree: !0, characterData: !0 }));
82
+ }
83
+ disconnectedCallback() {
84
+ this.observer && this.observer.disconnect();
85
+ }
86
+ attributeChangedCallback() {
87
+ this.render();
88
+ }
89
+ getBodySize() {
90
+ const i = this.getAttribute("body-size");
91
+ return i || "small";
92
+ }
93
+ getCodeSize() {
94
+ const i = this.getAttribute("code-size");
95
+ return i || "x-small";
96
+ }
97
+ getMarkdown() {
98
+ const i = this.getAttribute("markdown");
99
+ return i !== null ? i : this.textContent ?? "";
100
+ }
101
+ render() {
102
+ if (!this.shadowRoot) return;
103
+ const i = this.getMarkdown(), d = p(i), t = b({
104
+ bodySize: this.getBodySize(),
105
+ codeSize: this.getCodeSize()
106
+ }), o = m.parse(d, { renderer: t, gfm: !0 });
107
+ this.shadowRoot.innerHTML = /*html*/
108
+ `
109
+ <style>
110
+ :host { display: block; }
111
+ .md-inline-code {
112
+ display: inline-block;
113
+ padding: var(--space-025) var(--space-050) var(--space-050);
114
+ border-radius: var(--radius-100);
115
+ background: var(--surface-recessed-200);
116
+ font-size: var(--text-font-size-xs);
117
+ line-height: 1;
118
+ }
119
+ .md-code-block {
120
+ position: relative;
121
+ }
122
+ .md-code-copy {
123
+ position: absolute;
124
+ top: var(--space-200);
125
+ right: var(--space-200);
126
+ z-index: 1;
127
+ }
128
+ .md-table-card {
129
+ overflow-x: auto;
130
+ }
131
+ .md-table-scroll {
132
+ overflow-x: auto;
133
+ }
134
+ .md-table {
135
+ min-width: 888px;
136
+ }
137
+ </style>
138
+ <div class="md-root">${o}</div>
139
+ `, this.shadowRoot.querySelectorAll("[data-copy-code]").forEach((s) => {
140
+ s.onclick = () => {
141
+ var l;
142
+ const a = s.closest(".md-code-block"), c = a == null ? void 0 : a.querySelector("mui-code"), r = (c == null ? void 0 : c.textContent) ?? "";
143
+ r && ((l = navigator.clipboard) == null || l.writeText(r).catch(() => {
144
+ }));
145
+ };
146
+ });
147
+ }
148
+ }
149
+ customElements.get("mui-markdown") || customElements.define("mui-markdown", g);