@muibook/components 19.6.0 → 20.1.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 (172) hide show
  1. package/AGENTS.md +67 -0
  2. package/DESIGN.md +358 -0
  3. package/README.md +53 -2
  4. package/dist/esm/agent/keywords/index.js +2 -173
  5. package/dist/esm/agent/prompts/index.js +6 -432
  6. package/dist/esm/components/mui-accordion/core/index.js +25 -17
  7. package/dist/esm/components/mui-addon/index.js +14 -14
  8. package/dist/esm/components/mui-avatar/index.js +103 -43
  9. package/dist/esm/components/mui-avatar-chip/index.js +158 -0
  10. package/dist/esm/components/mui-avatar-group/index.js +88 -0
  11. package/dist/esm/components/mui-badge/index.js +37 -20
  12. package/dist/esm/components/mui-body/index.js +20 -11
  13. package/dist/esm/components/mui-button/index.js +265 -78
  14. package/dist/esm/components/mui-calendar/index.js +199 -0
  15. package/dist/esm/components/mui-card/body/index.js +33 -18
  16. package/dist/esm/components/mui-card/footer/index.js +11 -9
  17. package/dist/esm/components/mui-carousel/controller/index.js +1 -1
  18. package/dist/esm/components/mui-checkbox/index.js +23 -18
  19. package/dist/esm/components/mui-chip/index.js +219 -73
  20. package/dist/esm/components/mui-chip-input/index.js +146 -137
  21. package/dist/esm/components/mui-chip-rail/index.js +342 -0
  22. package/dist/esm/components/mui-code/index.js +26 -7
  23. package/dist/esm/components/mui-container/index.js +68 -45
  24. package/dist/esm/components/mui-date-picker/index.js +169 -0
  25. package/dist/esm/components/mui-drawer/index.js +968 -100
  26. package/dist/esm/components/mui-dropdown/index.js +255 -59
  27. package/dist/esm/components/mui-field/index.js +1 -1
  28. package/dist/esm/components/mui-file-upload/index.js +14 -4
  29. package/dist/esm/components/mui-form-group/index.js +1 -2
  30. package/dist/esm/components/mui-form-message/index.js +4 -9
  31. package/dist/esm/components/mui-heading/index.js +3 -2
  32. package/dist/esm/components/mui-hint/index.js +178 -72
  33. package/dist/esm/components/mui-icons/copy/index.js +54 -0
  34. package/dist/esm/components/mui-icons/fullscreen/index.js +5 -0
  35. package/dist/esm/components/mui-icons/icon-helper/index.js +56 -0
  36. package/dist/esm/components/mui-icons/index.js +14 -1
  37. package/dist/esm/components/mui-icons/moon/index.js +3 -1
  38. package/dist/esm/components/mui-icons/{rectangle-bottom-panel → panel}/index.js +6 -6
  39. package/dist/esm/components/mui-icons/pause/index.js +5 -0
  40. package/dist/esm/components/mui-icons/picture-in-picture/index.js +5 -0
  41. package/dist/esm/components/mui-icons/play-fill/index.js +5 -0
  42. package/dist/esm/components/mui-icons/rectangle-right-drawer/index.js +56 -0
  43. package/dist/esm/components/mui-icons/reload/index.js +5 -0
  44. package/dist/esm/components/mui-icons/speaker-mute/index.js +5 -0
  45. package/dist/esm/components/mui-icons/speaker-one-wave/index.js +5 -0
  46. package/dist/esm/components/mui-icons/speaker-two-wave/index.js +5 -0
  47. package/dist/esm/components/mui-icons/spinner/index.js +7 -5
  48. package/dist/esm/components/mui-icons/stop-fill/index.js +5 -0
  49. package/dist/esm/components/mui-icons/sun/index.js +5 -5
  50. package/dist/esm/components/mui-icons/timer/index.js +54 -0
  51. package/dist/esm/components/mui-icons/toggle/index.js +16 -6
  52. package/dist/esm/components/mui-icons/vertical-ellipsis/index.js +5 -0
  53. package/dist/esm/components/mui-illustrations/trash/index.js +6 -5
  54. package/dist/esm/components/mui-input/index.js +96 -67
  55. package/dist/esm/components/mui-link/index.js +352 -96
  56. package/dist/esm/components/mui-media-player/index.js +1577 -83
  57. package/dist/esm/components/mui-message/index.js +7 -6
  58. package/dist/esm/components/mui-model-viewer/index.js +258 -0
  59. package/dist/esm/components/mui-progress-ring/index.js +349 -0
  60. package/dist/esm/components/mui-prompt/index.js +143 -115
  61. package/dist/esm/components/mui-prompt-preview/index.js +11 -23
  62. package/dist/esm/components/mui-radio/index.js +38 -17
  63. package/dist/esm/components/mui-range-input/index.js +9 -4
  64. package/dist/esm/components/mui-responsive/index.js +60 -27
  65. package/dist/esm/components/mui-search-input/index.js +300 -0
  66. package/dist/esm/components/mui-select/index.js +235 -46
  67. package/dist/esm/components/mui-slat/slat/index.js +40 -12
  68. package/dist/esm/components/mui-spinner/index.js +11 -9
  69. package/dist/esm/components/mui-stack/hstack/index.js +10 -5
  70. package/dist/esm/components/mui-status/index.js +239 -0
  71. package/dist/esm/components/mui-stepper/step/index.js +46 -32
  72. package/dist/esm/components/mui-switch/index.js +37 -26
  73. package/dist/esm/components/mui-table/row/index.js +2 -6
  74. package/dist/esm/components/mui-table/table/index.js +157 -14
  75. package/dist/esm/components/mui-tabs/controller/index.js +17 -6
  76. package/dist/esm/components/mui-tabs/item/index.js +17 -5
  77. package/dist/esm/components/mui-tabs/tab-bar/index.js +93 -39
  78. package/dist/esm/components/mui-textarea/index.js +43 -26
  79. package/dist/esm/components/mui-time/index/index.js +336 -0
  80. package/dist/esm/components/mui-time-picker/index.js +126 -0
  81. package/dist/esm/components/mui-video-thumbnail/index.js +205 -0
  82. package/dist/esm/css/mui-brand.css +12 -8
  83. package/dist/esm/css/mui-tokens.css +646 -344
  84. package/dist/esm/css/readme.md +2 -2
  85. package/dist/esm/custom-elements.json +4506 -1707
  86. package/dist/esm/dynamic-attrs.json +271 -54
  87. package/dist/esm/index.js +33 -6
  88. package/dist/esm/knowledge/compositions/index.js +1560 -0
  89. package/dist/esm/knowledge/index.js +28 -0
  90. package/dist/esm/knowledge/keywords/index.js +306 -0
  91. package/dist/esm/knowledge/rules/index.js +199 -0
  92. package/dist/esm/tokens/js/index.js +143 -139
  93. package/dist/types/agent/keywords/index.d.ts +1 -1
  94. package/dist/types/components/mui-avatar-chip/api.d.ts +28 -0
  95. package/dist/types/components/mui-avatar-chip/index.d.ts +18 -0
  96. package/dist/types/components/mui-avatar-group/api.d.ts +28 -0
  97. package/dist/types/components/mui-avatar-group/doc.d.ts +2 -0
  98. package/dist/types/components/mui-avatar-group/index.d.ts +1 -0
  99. package/dist/types/components/mui-button/api.d.ts +6 -2
  100. package/dist/types/components/mui-calendar/api.d.ts +41 -0
  101. package/dist/types/components/mui-calendar/doc.d.ts +2 -0
  102. package/dist/types/components/mui-calendar/index.d.ts +3 -0
  103. package/dist/types/components/mui-checkbox/api.d.ts +4 -0
  104. package/dist/types/components/mui-chip/api.d.ts +4 -0
  105. package/dist/types/components/mui-chip-input/api.d.ts +4 -0
  106. package/dist/types/components/mui-chip-rail/api.d.ts +21 -0
  107. package/dist/types/components/mui-chip-rail/doc.d.ts +2 -0
  108. package/dist/types/components/mui-chip-rail/index.d.ts +4 -0
  109. package/dist/types/components/mui-date-picker/api.d.ts +38 -0
  110. package/dist/types/components/mui-date-picker/doc.d.ts +2 -0
  111. package/dist/types/components/mui-date-picker/index.d.ts +6 -0
  112. package/dist/types/components/mui-drawer/api.d.ts +4 -0
  113. package/dist/types/components/mui-drawer/index.d.ts +2 -0
  114. package/dist/types/components/mui-file-upload/api.d.ts +4 -0
  115. package/dist/types/components/mui-icons/fullscreen.d.ts +1 -0
  116. package/dist/types/components/mui-icons/icon-helper.d.ts +1 -0
  117. package/dist/types/components/mui-icons/index.d.ts +14 -1
  118. package/dist/types/components/mui-icons/panel.d.ts +1 -0
  119. package/dist/types/components/mui-icons/pause.d.ts +1 -0
  120. package/dist/types/components/mui-icons/picture-in-picture.d.ts +1 -0
  121. package/dist/types/components/mui-icons/play-fill.d.ts +1 -0
  122. package/dist/types/components/mui-icons/rectangle-right-drawer.d.ts +1 -0
  123. package/dist/types/components/mui-icons/reload.d.ts +1 -0
  124. package/dist/types/components/mui-icons/speaker-mute.d.ts +1 -0
  125. package/dist/types/components/mui-icons/speaker-one-wave.d.ts +1 -0
  126. package/dist/types/components/mui-icons/speaker-two-wave.d.ts +1 -0
  127. package/dist/types/components/mui-icons/stop-fill.d.ts +1 -0
  128. package/dist/types/components/mui-icons/timer.d.ts +1 -0
  129. package/dist/types/components/mui-icons/vertical-ellipsis.d.ts +1 -0
  130. package/dist/types/components/mui-input/api.d.ts +12 -0
  131. package/dist/types/components/mui-link/api.d.ts +4 -0
  132. package/dist/types/components/mui-media-player/api.d.ts +4 -0
  133. package/dist/types/components/mui-media-player/index.d.ts +13 -4
  134. package/dist/types/components/mui-model-viewer/api.d.ts +28 -0
  135. package/dist/types/components/mui-model-viewer/doc.d.ts +2 -0
  136. package/dist/types/components/mui-model-viewer/index.d.ts +17 -0
  137. package/dist/types/components/mui-progress-ring/api.d.ts +24 -0
  138. package/dist/types/components/mui-progress-ring/doc.d.ts +2 -0
  139. package/dist/types/components/mui-progress-ring/index.d.ts +1 -0
  140. package/dist/types/components/mui-radio/api.d.ts +12 -0
  141. package/dist/types/components/mui-range-input/api.d.ts +4 -0
  142. package/dist/types/components/mui-responsive/api.d.ts +10 -2
  143. package/dist/types/components/mui-search-input/api.d.ts +40 -0
  144. package/dist/types/components/mui-search-input/doc.d.ts +2 -0
  145. package/dist/types/components/mui-search-input/index.d.ts +3 -0
  146. package/dist/types/components/mui-select/api.d.ts +12 -0
  147. package/dist/types/components/mui-status/api.d.ts +24 -0
  148. package/dist/types/components/mui-status/doc.d.ts +2 -0
  149. package/dist/types/components/mui-status/index.d.ts +1 -0
  150. package/dist/types/components/mui-switch/api.d.ts +4 -0
  151. package/dist/types/components/mui-table/api.d.ts +15 -0
  152. package/dist/types/components/mui-textarea/api.d.ts +12 -0
  153. package/dist/types/components/mui-time/api.d.ts +41 -0
  154. package/dist/types/components/mui-time/doc.d.ts +2 -0
  155. package/dist/types/components/mui-time/index.d.ts +1 -0
  156. package/dist/types/components/mui-time-picker/api.d.ts +38 -0
  157. package/dist/types/components/mui-time-picker/doc.d.ts +2 -0
  158. package/dist/types/components/mui-time-picker/index.d.ts +4 -0
  159. package/dist/types/components/mui-video-thumbnail/api.d.ts +28 -0
  160. package/dist/types/components/mui-video-thumbnail/doc.d.ts +2 -0
  161. package/dist/types/components/mui-video-thumbnail/index.d.ts +1 -0
  162. package/dist/types/index.d.ts +27 -2
  163. package/dist/types/knowledge/compositions.d.ts +4644 -0
  164. package/dist/types/knowledge/index.d.ts +4657 -0
  165. package/dist/types/knowledge/keywords.d.ts +4 -0
  166. package/dist/types/knowledge/rules.d.ts +1 -0
  167. package/dist/types/tokens/js/index.d.ts +11 -7
  168. package/package.json +131 -12
  169. package/dist/esm/components/mui-form-hint/index.js +0 -1
  170. package/dist/types/components/mui-form-hint/index.d.ts +0 -1
  171. /package/dist/types/components/{mui-form-hint → mui-avatar-chip}/doc.d.ts +0 -0
  172. /package/dist/types/components/mui-icons/{rectangle-bottom-panel.d.ts → copy.d.ts} +0 -0
@@ -1,79 +1,141 @@
1
- import { getPartMap as v } from "../../utils/part-map/index.js";
2
- class h extends HTMLElement {
1
+ import { getPartMap as f } from "../../utils/part-map/index.js";
2
+ class b extends HTMLElement {
3
3
  static get observedAttributes() {
4
- return ["target", "href", "variant", "disabled", "weight", "size", "download", "usage"];
4
+ return [
5
+ "target",
6
+ "href",
7
+ "variant",
8
+ "disabled",
9
+ "weight",
10
+ "stroke",
11
+ "stroke-ring-size",
12
+ "focus-ring",
13
+ "size",
14
+ "download",
15
+ "usage"
16
+ ];
5
17
  }
6
18
  constructor() {
7
19
  super(), this.attachShadow({ mode: "open" });
8
20
  }
21
+ focus(a) {
22
+ var r;
23
+ const o = (r = this.shadowRoot) == null ? void 0 : r.querySelector("a");
24
+ o ? o.focus(a) : super.focus(a);
25
+ }
9
26
  async connectedCallback() {
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());
27
+ this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("weight") || this.setAttribute("weight", "regular"), this.hasAttribute("variant") || this.setAttribute("variant", "default"), this.syncRingSizeAttribute(), await this.waitForPartMap(), this.render();
28
+ const a = this.shadowRoot;
29
+ if (!a) return;
30
+ [
31
+ a.querySelector("slot:not([name])"),
32
+ a.querySelector('slot[name="before"]'),
33
+ a.querySelector('slot[name="after"]')
34
+ ].forEach((r) => r == null ? void 0 : r.addEventListener("slotchange", () => this.updateSlotState())), requestAnimationFrame(() => this.updateSlotState());
11
35
  }
12
- attributeChangedCallback(t, e, o) {
36
+ attributeChangedCallback(a, o, r) {
13
37
  if (this.shadowRoot) {
14
- if (t === "href") {
15
- const a = this.shadowRoot.querySelector("a");
16
- a && a.setAttribute("href", o || "#");
17
- }
18
- if (t === "target") {
19
- const a = this.shadowRoot.querySelector("a");
20
- a && a.setAttribute("target", o || "_self");
21
- }
22
- if (t === "disabled") {
23
- const a = this.shadowRoot.querySelector("a");
24
- a && (o !== 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
- o !== null ? a.setAttribute("download", o === "" ? "" : o) : a.removeAttribute("download");
30
- }
31
- t === "size" && e !== o && 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
- ], s = this.hasAttribute("icon-only");
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);
38
+ if (a === "href") {
39
+ const t = this.shadowRoot.querySelector("a");
40
+ t && t.setAttribute("href", r || "#");
41
+ }
42
+ if (a === "target") {
43
+ const t = this.shadowRoot.querySelector("a");
44
+ t && t.setAttribute("target", r || "_self");
45
+ }
46
+ if (a === "disabled") {
47
+ const t = this.shadowRoot.querySelector("a");
48
+ t && (r !== null ? (t.setAttribute("aria-disabled", "true"), t.setAttribute("href", "javascript:void(0)")) : (t.setAttribute("aria-disabled", "false"), t.setAttribute("href", this.getAttribute("href") || "#")));
49
+ }
50
+ if (a === "download") {
51
+ const t = this.shadowRoot.querySelector("a");
52
+ if (!t) return;
53
+ r !== null ? t.setAttribute("download", r === "" ? "" : r) : t.removeAttribute("download");
54
+ }
55
+ a === "size" && o !== r && this.shadowRoot && requestAnimationFrame(() => {
56
+ const t = this.shadowRoot;
57
+ if (!t) return;
58
+ const d = [
59
+ t.querySelector("slot:not([name])"),
60
+ t.querySelector('slot[name="before"]'),
61
+ t.querySelector('slot[name="after"]')
62
+ ], e = this.hasAttribute("icon-only"), i = this.hasAttribute("avatar-only");
63
+ d.forEach((n) => {
64
+ if (n) {
65
+ const c = n.assignedNodes({ flatten: !0 });
66
+ this.updateIconSizes(c, e), i || this.updateAvatarSizes(c), this.updateBadgeSizes(c);
43
67
  }
44
68
  });
45
- });
69
+ }), a === "stroke-ring-size" && o !== r && this.syncRingSizeAttribute();
70
+ }
71
+ }
72
+ syncRingSizeAttribute() {
73
+ var t;
74
+ const a = (t = this.getAttribute("stroke-ring-size")) == null ? void 0 : t.trim();
75
+ if (!a) {
76
+ this.style.removeProperty("--action-ring-size");
77
+ return;
46
78
  }
79
+ const o = a.startsWith("stroke-size-") ? a.replace("stroke-size-", "") : a, r = /^(100|200|300|400|500)$/.test(o);
80
+ this.style.setProperty("--action-ring-size", r ? `var(--stroke-size-${o})` : a);
81
+ }
82
+ isAvatarOnlyElement(a) {
83
+ const o = a.tagName.toLowerCase();
84
+ if (o === "mui-avatar") return !0;
85
+ if (o !== "mui-responsive") return !1;
86
+ const r = Array.from(a.childNodes), t = r.filter((e) => e.nodeType === Node.ELEMENT_NODE);
87
+ return r.every(
88
+ (e) => {
89
+ var i;
90
+ return e.nodeType === Node.TEXT_NODE ? !((i = e.textContent) != null && i.trim()) : e.nodeType === Node.ELEMENT_NODE;
91
+ }
92
+ ) && t.length > 0 && t.every((e) => e.tagName.toLowerCase() === "mui-avatar");
47
93
  }
48
94
  updateSlotState() {
49
- const t = this.shadowRoot, e = t.querySelector("slot:not([name])"), o = t.querySelector('slot[name="before"]'), a = t.querySelector('slot[name="after"]'), n = (d) => !!d && d.assignedNodes({ flatten: !0 }).some(
95
+ const a = this.shadowRoot, o = a.querySelector("slot:not([name])"), r = a.querySelector('slot[name="before"]'), t = a.querySelector('slot[name="after"]'), d = (s) => !!s && s.assignedNodes({ flatten: !0 }).some(
50
96
  (l) => {
51
- var c;
52
- return l.nodeType === Node.ELEMENT_NODE || l.nodeType === Node.TEXT_NODE && !!((c = l.textContent) != null && c.trim());
97
+ var v;
98
+ return l.nodeType === Node.ELEMENT_NODE || l.nodeType === Node.TEXT_NODE && !!((v = l.textContent) != null && v.trim());
99
+ }
100
+ ), e = d(r), i = d(t);
101
+ this.toggleAttribute("has-before", e), this.toggleAttribute("has-after", i);
102
+ const n = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], c = (o == null ? void 0 : o.assignedElements({ flatten: !0 })) ?? [], h = c.some((s) => s.tagName.toLowerCase() === "mui-video-thumbnail");
103
+ this.toggleAttribute("has-video", h);
104
+ const u = !h && c.length === 1 && this.isAvatarOnlyElement(c[0]) && n.every(
105
+ (s) => {
106
+ var l;
107
+ return s.nodeType === Node.ELEMENT_NODE ? this.isAvatarOnlyElement(s) : !((l = s.textContent) != null && l.trim());
53
108
  }
54
- ), s = n(o), i = n(a);
55
- this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
56
- const r = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) ?? [], u = r.length > 0 && r.every(
57
- (d) => {
109
+ );
110
+ this.toggleAttribute("avatar-only", u);
111
+ const g = !u && !h && n.length > 0 && n.every(
112
+ (s) => {
58
113
  var l;
59
- return d.nodeType === Node.ELEMENT_NODE ? d.classList.contains("mui-icon") || d.tagName.toLowerCase() === "svg" : !((l = d.textContent) != null && l.trim());
114
+ return s.nodeType === Node.ELEMENT_NODE ? s.classList.contains("mui-icon") || s.tagName.toLowerCase() === "svg" : !((l = s.textContent) != null && l.trim());
60
115
  }
61
116
  );
62
- this.toggleAttribute("icon-only", u), u ? this.updateIconSizes(r, !0) : [o, e, a].forEach((l) => {
117
+ this.toggleAttribute("icon-only", g), g ? this.updateIconSizes(n, !0) : [r, o, t].forEach((l) => {
63
118
  if (l) {
64
- const c = l.assignedNodes({ flatten: !0 });
65
- this.updateIconSizes(c, !1), this.updateAvatarSizes(c), this.updateBadgeSizes(c);
119
+ const v = l.assignedNodes({ flatten: !0 });
120
+ this.updateIconSizes(v, !1), u || this.updateAvatarSizes(v), this.updateBadgeSizes(v);
66
121
  }
67
122
  });
68
123
  }
69
124
  render() {
70
125
  if (!this.shadowRoot) return;
71
- const t = v("text", "spacing", "layout", "visual");
126
+ const a = f("text", "spacing", "layout", "visual");
72
127
  this.shadowRoot.innerHTML = /*html*/
73
128
  `
74
129
  <style>
75
130
 
76
- :host { display: inline-flex; width: auto; text-align: initial }
131
+ :host {
132
+ display: inline-flex;
133
+ width: auto;
134
+ text-align: initial;
135
+ --action-focus-outline: var(--stroke-size-400) var(--stroke-outset) var(--outline-color);
136
+ --action-focus-outline-inset-offset: var(--stroke-size-400);
137
+ --action-focus-outline-offset: calc(-1 * var(--action-focus-outline-inset-offset));
138
+ }
77
139
 
78
140
  a {
79
141
  color: var(--link-text-color-default);
@@ -86,6 +148,7 @@ class h extends HTMLElement {
86
148
  text-decoration-color: color-mix(in srgb, var(--text-color) 50%, transparent);
87
149
  width: inherit;
88
150
  display: inherit;
151
+ border-radius: var(--link-focus-radius, var(--radius-200));
89
152
  }
90
153
 
91
154
  /* Turned back on for focus-visible */
@@ -94,11 +157,14 @@ class h extends HTMLElement {
94
157
  a:focus { color: var(--link-text-color-default-focus); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-focus) 80%, transparent); }
95
158
  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; }
96
159
  a, a:before, a:after {box-sizing: border-box;}
97
- a:focus-visible { outline: var(--outline-thick); }
160
+ a:focus-visible {
161
+ outline: var(--action-focus-outline);
162
+ outline-offset: var(--action-focus-outline-offset);
163
+ }
98
164
 
99
165
  :host([size="xx-small"]) a {
100
- font-size: var(--font-size-15);
101
- line-height: var(--line-height-25);
166
+ font-size: var(--text-font-size-xxs);
167
+ line-height: var(--text-line-height-xxs);
102
168
  }
103
169
 
104
170
  :host([size="x-small"]) a {
@@ -142,12 +208,13 @@ class h extends HTMLElement {
142
208
  :host([variant="overlay"]) a,
143
209
  :host([variant="attention"]) a,
144
210
  :host([usage="input"]) a {
145
- display: inherit;
211
+ display: inline-flex;
146
212
  text-align: inherit;
147
213
  width: 100%;
148
214
  text-decoration: none;
149
215
  padding: var(--action-padding);
150
- border-radius: var(--action-radius);
216
+ min-height: var(--action-size-medium);
217
+ border-radius: var(--action-radius-medium);
151
218
  font-size: var(--action-font-size);
152
219
  font-weight: var(--action-font-weight);
153
220
  line-height: var(--action-line-height);
@@ -324,18 +391,125 @@ class h extends HTMLElement {
324
391
  :host([variant="attention"]) a:focus ::slotted(.mui-icon) { fill: var(--action-attention-text-color-focus); }
325
392
  :host([variant="attention"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
326
393
 
394
+ :host,
395
+ :host([variant="primary"]) {
396
+ --action-ring-color: var(--action-primary-border-color);
397
+ --action-ring-color-hover: var(--action-primary-border-color-hover);
398
+ --action-ring-color-focus: var(--action-primary-border-color-focus);
399
+ --action-ring-color-disabled: var(--action-primary-border-color-disabled);
400
+ }
401
+
402
+ :host([variant="secondary"]) {
403
+ --action-ring-color: var(--action-secondary-border-color);
404
+ --action-ring-color-hover: var(--action-secondary-border-color-hover);
405
+ --action-ring-color-focus: var(--action-secondary-border-color-focus);
406
+ --action-ring-color-disabled: var(--action-secondary-border-color-disabled);
407
+ }
408
+
409
+ :host([variant="tertiary"]) {
410
+ --action-ring-color: var(--action-tertiary-border-color);
411
+ --action-ring-color-hover: var(--action-tertiary-border-color-hover);
412
+ --action-ring-color-focus: var(--action-tertiary-border-color-focus);
413
+ --action-ring-color-disabled: var(--action-tertiary-border-color-disabled);
414
+ }
415
+
416
+ :host([variant="overlay"]) {
417
+ --action-ring-size: var(--stroke-size-100);
418
+ --action-ring-color: var(--action-overlay-border-color);
419
+ --action-ring-color-hover: var(--action-overlay-border-color-hover);
420
+ --action-ring-color-focus: var(--action-overlay-border-color-focus);
421
+ --action-ring-color-disabled: var(--action-overlay-border-color-disabled);
422
+ }
423
+
424
+ :host([variant="attention"]) {
425
+ --action-ring-color: var(--action-attention-border-color);
426
+ --action-ring-color-hover: var(--action-attention-border-color-hover);
427
+ --action-ring-color-focus: var(--action-attention-border-color-focus);
428
+ --action-ring-color-disabled: var(--action-attention-border-color-disabled);
429
+ }
430
+
431
+ :host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a {
432
+ border: none;
433
+ box-shadow: var(
434
+ --action-ring-shadow,
435
+ inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color)
436
+ );
437
+ }
438
+
439
+ :host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a:hover {
440
+ border: none;
441
+ box-shadow: var(
442
+ --action-ring-shadow-hover,
443
+ inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-hover)
444
+ );
445
+ }
446
+
447
+ :host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a:focus-visible {
448
+ border: none;
449
+ box-shadow: var(
450
+ --action-ring-shadow-focus,
451
+ inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-focus)
452
+ );
453
+ }
454
+
455
+ :host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a[aria-disabled="true"] {
456
+ border: none;
457
+ box-shadow: var(
458
+ --action-ring-shadow-disabled,
459
+ inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-disabled)
460
+ );
461
+ }
462
+
327
463
  /* Icon only
328
464
  ========================================= */
329
465
  :host([icon-only]) a {
330
466
  display: flex;
331
467
  justify-content: center;
332
468
  align-items: center;
333
- height: 44px;
334
- width: 44px;
469
+ height: var(--action-size-medium);
470
+ width: var(--action-size-medium);
335
471
  padding: var(--action-icon-only-padding);
336
472
  }
337
473
  /* ===================================== */
338
474
 
475
+ :host([avatar-only]) {
476
+ width: auto;
477
+ display: flex;
478
+ }
479
+
480
+ :host([avatar-only]) a,
481
+ :host([avatar-only]) a:hover,
482
+ :host([avatar-only]) a:focus,
483
+ :host([avatar-only]) a:focus-visible,
484
+ :host([avatar-only]) a[aria-disabled="true"] {
485
+ width: auto;
486
+ min-width: 0;
487
+ min-height: 0;
488
+ padding: var(--space-000);
489
+ background: transparent;
490
+ display: inline-flex;
491
+ align-items: center;
492
+ justify-content: center;
493
+ gap: var(--space-000);
494
+ line-height: 0;
495
+ border-radius: 999rem;
496
+ text-decoration: none;
497
+ text-decoration-color: transparent;
498
+ }
499
+
500
+ :host([avatar-only]) a ::slotted(mui-avatar) {
501
+ margin-right: var(--space-000);
502
+ margin-left: var(--space-000);
503
+ }
504
+ :host([avatar-only]) a ::slotted(mui-responsive) {
505
+ display: flex;
506
+ margin-right: var(--space-000);
507
+ margin-left: var(--space-000);
508
+ line-height: 0;
509
+ text-decoration: none;
510
+ }
511
+ /* ===================================== */
512
+
339
513
  :host([alert-positive-slot]) {
340
514
  --alert-text: var(--feedback-positive-text);
341
515
  --alert-icon: var(--feedback-positive-icon);
@@ -425,6 +599,15 @@ class h extends HTMLElement {
425
599
  --avatar-background-override: var(--action-avatar-background-hover);
426
600
  }
427
601
 
602
+ :host([avatar-only][variant][size]) a ::slotted(mui-avatar) {
603
+ margin-right: var(--space-000);
604
+ margin-left: var(--space-000);
605
+ }
606
+ :host([avatar-only][variant][size]) a ::slotted(mui-responsive) {
607
+ margin-right: var(--space-000);
608
+ margin-left: var(--space-000);
609
+ }
610
+
428
611
  /* Badge Spacing */
429
612
  :host([has-before]) a ::slotted(mui-badge[slot="before"]) {
430
613
  margin-right: var(--space-025);
@@ -569,9 +752,10 @@ class h extends HTMLElement {
569
752
  :host([size="xx-small"][usage="input"]) a:hover,
570
753
  :host([size="xx-small"][usage="input"]) a:focus,
571
754
  :host([size="xx-small"][usage="input"]) a[aria-disabled="true"] {
572
- font-size: var(--font-size-15);
573
- line-height: var(--line-height-25);
755
+ font-size: var(--text-font-size-xxs);
756
+ line-height: var(--text-line-height-xxs);
574
757
  font-weight: var(--font-weight-semi-bold);
758
+ min-height: var(--action-size-xx-small);
575
759
  padding: var(--space-025) var(--space-100);
576
760
  border-width: var(--stroke-size-100);
577
761
  border-radius: var(--action-radius-x-small);
@@ -588,6 +772,7 @@ class h extends HTMLElement {
588
772
  font-size: var(--text-font-size-xs);
589
773
  line-height: var(--text-line-height-xs);
590
774
  font-weight: var(--font-weight-semi-bold);
775
+ min-height: var(--action-size-x-small);
591
776
  padding: var(--action-padding-x-small);
592
777
  border-width: var(--stroke-size-100);
593
778
  border-radius: var(--action-radius-x-small);
@@ -597,6 +782,7 @@ class h extends HTMLElement {
597
782
  :host([size="small"][usage="input"]) a {
598
783
  font-size: var(--text-font-size-s);
599
784
  line-height: var(--text-line-height-s);
785
+ min-height: var(--action-size-small);
600
786
  padding: var(--action-padding-small);
601
787
  border-radius: var(--action-radius-small);
602
788
  }
@@ -605,6 +791,7 @@ class h extends HTMLElement {
605
791
  :host([size="medium"][usage="input"]) a {
606
792
  font-size: var(--text-font-size-m);
607
793
  line-height: var(--text-line-height-m);
794
+ min-height: var(--action-size-medium);
608
795
  padding: var(--action-padding);
609
796
  border-radius: var(--action-radius-medium);
610
797
  }
@@ -613,10 +800,45 @@ class h extends HTMLElement {
613
800
  :host([size="large"][usage="input"]) a {
614
801
  font-size: var(--text-font-size-l);
615
802
  line-height: var(--text-line-height-l);
803
+ min-height: var(--action-size-large);
616
804
  padding: var(--action-padding-large);
617
805
  border-radius: var(--action-radius-large);
618
806
  }
619
807
 
808
+ :host([size][dropdown-slot]) a,
809
+ :host([size][dropdown-slot]) a:hover,
810
+ :host([size][dropdown-slot]) a:focus,
811
+ :host([size][dropdown-slot]) a[aria-disabled="true"],
812
+ :host([size][dropdown-slot][has-after]) a,
813
+ :host([size][dropdown-slot][has-before]) a,
814
+ :host([dropdown-slot]) a {
815
+ border-radius: var(--radius-000);
816
+ justify-content: flex-start;
817
+ white-space: nowrap;
818
+ }
819
+
820
+ :host([size][dropdown-slot-first]) a,
821
+ :host([size][dropdown-slot-first]) a:hover,
822
+ :host([size][dropdown-slot-first]) a:focus,
823
+ :host([size][dropdown-slot-first]) a[aria-disabled="true"],
824
+ :host([size][dropdown-slot-first][has-after]) a,
825
+ :host([size][dropdown-slot-first][has-before]) a,
826
+ :host([dropdown-slot-first]) a {
827
+ border-top-left-radius: calc(var(--radius-100) / 2);
828
+ border-top-right-radius: calc(var(--radius-100) / 2);
829
+ }
830
+
831
+ :host([size][dropdown-slot-last]) a,
832
+ :host([size][dropdown-slot-last]) a:hover,
833
+ :host([size][dropdown-slot-last]) a:focus,
834
+ :host([size][dropdown-slot-last]) a[aria-disabled="true"],
835
+ :host([size][dropdown-slot-last][has-after]) a,
836
+ :host([size][dropdown-slot-last][has-before]) a,
837
+ :host([dropdown-slot-last]) a {
838
+ border-bottom-left-radius: calc(var(--radius-100) / 2);
839
+ border-bottom-right-radius: calc(var(--radius-100) / 2);
840
+ }
841
+
620
842
  /* Keep input-composed links flush against the input edge after size radius applies. */
621
843
  :host([slot="before"][usage="input"]) a,
622
844
  :host([slot="before"][usage="input"]) a:hover,
@@ -638,32 +860,32 @@ class h extends HTMLElement {
638
860
 
639
861
  /* Icon-only size variants */
640
862
  :host([size="xx-small"][variant]:not([variant="default"])[icon-only]) a {
641
- height: calc(var(--action-icon-only-size-x-small) - var(--space-100));
642
- width: calc(var(--action-icon-only-size-x-small) - var(--space-100));
863
+ height: var(--action-size-xx-small);
864
+ width: var(--action-size-xx-small);
643
865
  padding: var(--action-icon-only-padding);
644
866
  }
645
867
 
646
868
  :host([size="x-small"][variant]:not([variant="default"])[icon-only]) a {
647
- height: var(--action-icon-only-size-x-small);
648
- width: var(--action-icon-only-size-x-small);
869
+ height: var(--action-size-x-small);
870
+ width: var(--action-size-x-small);
649
871
  padding: var(--action-icon-only-padding);
650
872
  }
651
873
 
652
874
  :host([size="small"][variant]:not([variant="default"])[icon-only]) a {
653
- height: var(--action-icon-only-size-small);
654
- width: var(--action-icon-only-size-small);
875
+ height: var(--action-size-small);
876
+ width: var(--action-size-small);
655
877
  padding: var(--action-icon-only-padding);
656
878
  }
657
879
 
658
880
  :host([size="medium"][variant]:not([variant="default"])[icon-only]) a {
659
- height: var(--action-icon-only-size);
660
- width: var(--action-icon-only-size);
881
+ height: var(--action-size-medium);
882
+ width: var(--action-size-medium);
661
883
  padding: var(--action-icon-only-padding);
662
884
  }
663
885
 
664
886
  :host([size="large"][variant]:not([variant="default"])[icon-only]) a {
665
- height: var(--action-icon-only-size-large);
666
- width: var(--action-icon-only-size-large);
887
+ height: var(--action-size-large);
888
+ width: var(--action-size-large);
667
889
  padding: var(--action-icon-only-padding);
668
890
  }
669
891
 
@@ -760,11 +982,45 @@ class h extends HTMLElement {
760
982
  padding-left: var(--action-before-slot-padding-large);
761
983
  }
762
984
 
985
+ :host([has-video]) {
986
+ display: inline-block;
987
+ width: auto;
988
+ text-align: initial;
989
+ }
990
+
991
+ :host([has-video]) a,
992
+ :host([has-video]) a:hover,
993
+ :host([has-video]) a:focus,
994
+ :host([has-video]) a:focus-visible,
995
+ :host([has-video]) a[aria-disabled="true"] {
996
+ display: block;
997
+ width: 100%;
998
+ min-height: 0;
999
+ padding: var(--space-000);
1000
+ border: none;
1001
+ border-radius: var(--radius-000);
1002
+ background: transparent;
1003
+ color: inherit;
1004
+ font-size: inherit;
1005
+ font-weight: inherit;
1006
+ line-height: inherit;
1007
+ text-align: initial;
1008
+ text-decoration: none;
1009
+ box-shadow: none;
1010
+ outline-offset: var(--video-thumbnail-action-focus-outline-offset, var(--space-300));
1011
+ -webkit-backdrop-filter: none;
1012
+ backdrop-filter: none;
1013
+ }
1014
+
1015
+ :host([focus-ring="outset"]) a:focus-visible {
1016
+ outline-offset: var(--action-focus-outline-outset-offset, var(--stroke-size-200));
1017
+ }
1018
+
763
1019
 
764
1020
  </style>
765
1021
 
766
1022
  <a
767
- part="${t}"
1023
+ part="${a}"
768
1024
  target="${this.getAttribute("target") || "_self"}"
769
1025
  href="${this.hasAttribute("disabled") ? "javascript:void(0)" : this.getAttribute("href") || "#"}"
770
1026
  aria-disabled="${this.hasAttribute("disabled") ? "true" : "false"}"
@@ -777,8 +1033,8 @@ class h extends HTMLElement {
777
1033
  `;
778
1034
  }
779
1035
  // Update avatar sizes based on button size
780
- updateAvatarSizes(t) {
781
- const e = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
1036
+ updateAvatarSizes(a) {
1037
+ const o = this.getAttribute("size") || "medium", e = ((this.getAttribute("variant") || "default") === "default" ? {
782
1038
  "xx-small": "xx-small",
783
1039
  "x-small": "xx-small",
784
1040
  small: "xx-small",
@@ -790,52 +1046,52 @@ class h extends HTMLElement {
790
1046
  small: "xx-small",
791
1047
  medium: "small",
792
1048
  large: "medium"
793
- })[e] || "small";
794
- t.forEach((i) => {
1049
+ })[o] || "small";
1050
+ a.forEach((i) => {
795
1051
  if (i.nodeType === Node.ELEMENT_NODE) {
796
- const r = i;
797
- r.tagName.toLowerCase() === "mui-avatar" && r.setAttribute("size", s);
1052
+ const n = i;
1053
+ n.tagName.toLowerCase() === "mui-avatar" && n.setAttribute("size", e);
798
1054
  }
799
1055
  });
800
1056
  }
801
- updateIconSizes(t, e) {
802
- const o = this.getAttribute("size") || "medium", n = {
1057
+ updateIconSizes(a, o) {
1058
+ const r = this.getAttribute("size") || "medium", d = {
803
1059
  "xx-small": "xx-small",
804
1060
  "x-small": "x-small",
805
1061
  small: "x-small",
806
- medium: e ? "medium" : "small",
807
- large: e ? "large" : "medium"
808
- }[o] || "small";
809
- t.forEach((s) => {
810
- if (s.nodeType === Node.ELEMENT_NODE) {
811
- const i = s, r = i.tagName.toLowerCase();
812
- (r === "svg" || i.classList.contains("mui-icon") || r === "mui-icon") && !i.hasAttribute("size") && i.setAttribute("size", n);
1062
+ medium: o ? "medium" : "small",
1063
+ large: o ? "large" : "medium"
1064
+ }[r] || "small";
1065
+ a.forEach((e) => {
1066
+ if (e.nodeType === Node.ELEMENT_NODE) {
1067
+ const i = e, n = i.tagName.toLowerCase();
1068
+ (n === "svg" || i.classList.contains("mui-icon") || n === "mui-icon") && !i.hasAttribute("size") && i.setAttribute("size", d);
813
1069
  }
814
1070
  });
815
1071
  }
816
- updateBadgeSizes(t) {
817
- const e = this.getAttribute("size") || "medium", a = {
1072
+ updateBadgeSizes(a) {
1073
+ const o = this.getAttribute("size") || "medium", t = {
818
1074
  "xx-small": "x-small",
819
1075
  "x-small": "x-small",
820
1076
  small: "small",
821
1077
  medium: "medium",
822
1078
  large: "large"
823
- }[e] || "medium";
824
- t.forEach((n) => {
825
- if (n.nodeType === Node.ELEMENT_NODE) {
826
- const s = n;
827
- s.tagName.toLowerCase() === "mui-badge" && s.setAttribute("size", a);
1079
+ }[o] || "medium";
1080
+ a.forEach((d) => {
1081
+ if (d.nodeType === Node.ELEMENT_NODE) {
1082
+ const e = d;
1083
+ e.tagName.toLowerCase() === "mui-badge" && e.setAttribute("size", t);
828
1084
  }
829
1085
  });
830
1086
  }
831
1087
  waitForPartMap() {
832
- return new Promise((t) => {
833
- if (typeof v == "function") return t();
834
- const e = () => {
835
- typeof v == "function" ? t() : requestAnimationFrame(e);
1088
+ return new Promise((a) => {
1089
+ if (typeof f == "function") return a();
1090
+ const o = () => {
1091
+ typeof f == "function" ? a() : requestAnimationFrame(o);
836
1092
  };
837
- e();
1093
+ o();
838
1094
  });
839
1095
  }
840
1096
  }
841
- customElements.get("mui-link") || customElements.define("mui-link", h);
1097
+ customElements.get("mui-link") || customElements.define("mui-link", b);