@muibook/components 20.0.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.
- package/AGENTS.md +67 -0
- package/DESIGN.md +358 -0
- package/README.md +52 -1
- package/dist/esm/agent/keywords/index.js +2 -204
- package/dist/esm/agent/prompts/index.js +6 -434
- package/dist/esm/components/mui-accordion/core/index.js +25 -17
- package/dist/esm/components/mui-avatar/index.js +99 -42
- package/dist/esm/components/mui-avatar-chip/index.js +158 -0
- package/dist/esm/components/mui-avatar-group/index.js +88 -0
- package/dist/esm/components/mui-badge/index.js +2 -2
- package/dist/esm/components/mui-body/index.js +20 -11
- package/dist/esm/components/mui-button/index.js +117 -65
- package/dist/esm/components/mui-calendar/index.js +199 -0
- package/dist/esm/components/mui-card/body/index.js +32 -17
- package/dist/esm/components/mui-card/footer/index.js +11 -9
- package/dist/esm/components/mui-carousel/controller/index.js +1 -1
- package/dist/esm/components/mui-checkbox/index.js +23 -18
- package/dist/esm/components/mui-chip/index.js +184 -68
- package/dist/esm/components/mui-chip-input/index.js +146 -137
- package/dist/esm/components/mui-chip-rail/index.js +154 -51
- package/dist/esm/components/mui-code/index.js +27 -8
- package/dist/esm/components/mui-container/index.js +68 -45
- package/dist/esm/components/mui-date-picker/index.js +169 -0
- package/dist/esm/components/mui-drawer/index.js +968 -100
- package/dist/esm/components/mui-dropdown/index.js +250 -63
- package/dist/esm/components/mui-field/index.js +1 -1
- package/dist/esm/components/mui-file-upload/index.js +13 -4
- package/dist/esm/components/mui-form-group/index.js +1 -2
- package/dist/esm/components/mui-form-message/index.js +4 -9
- package/dist/esm/components/mui-hint/index.js +178 -72
- package/dist/esm/components/mui-icons/copy/index.js +54 -0
- package/dist/esm/components/mui-icons/fullscreen/index.js +5 -0
- package/dist/esm/components/mui-icons/icon-helper/index.js +56 -0
- package/dist/esm/components/mui-icons/index.js +14 -1
- package/dist/esm/components/mui-icons/moon/index.js +3 -1
- package/dist/esm/components/mui-icons/{rectangle-bottom-panel → panel}/index.js +6 -6
- package/dist/esm/components/mui-icons/pause/index.js +5 -0
- package/dist/esm/components/mui-icons/picture-in-picture/index.js +5 -0
- package/dist/esm/components/mui-icons/play-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/rectangle-right-drawer/index.js +56 -0
- package/dist/esm/components/mui-icons/reload/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-mute/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-one-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-two-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/spinner/index.js +7 -5
- package/dist/esm/components/mui-icons/stop-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/sun/index.js +5 -5
- package/dist/esm/components/mui-icons/timer/index.js +54 -0
- package/dist/esm/components/mui-icons/toggle/index.js +16 -6
- package/dist/esm/components/mui-icons/vertical-ellipsis/index.js +5 -0
- package/dist/esm/components/mui-illustrations/trash/index.js +6 -5
- package/dist/esm/components/mui-input/index.js +87 -62
- package/dist/esm/components/mui-link/index.js +195 -83
- package/dist/esm/components/mui-media-player/index.js +1577 -83
- package/dist/esm/components/mui-model-viewer/index.js +258 -0
- package/dist/esm/components/mui-progress-ring/index.js +349 -0
- package/dist/esm/components/mui-prompt/index.js +99 -71
- package/dist/esm/components/mui-prompt-preview/index.js +11 -23
- package/dist/esm/components/mui-radio/index.js +38 -17
- package/dist/esm/components/mui-range-input/index.js +9 -4
- package/dist/esm/components/mui-responsive/index.js +60 -27
- package/dist/esm/components/mui-search-input/index.js +300 -0
- package/dist/esm/components/mui-select/index.js +231 -42
- package/dist/esm/components/mui-slat/slat/index.js +40 -12
- package/dist/esm/components/mui-spinner/index.js +11 -9
- package/dist/esm/components/mui-switch/index.js +23 -20
- package/dist/esm/components/mui-table/row/index.js +2 -6
- package/dist/esm/components/mui-table/table/index.js +157 -14
- package/dist/esm/components/mui-textarea/index.js +43 -26
- package/dist/esm/components/mui-time/index/index.js +336 -0
- package/dist/esm/components/mui-time-picker/index.js +126 -0
- package/dist/esm/components/mui-video-thumbnail/index.js +5 -5
- package/dist/esm/css/mui-brand.css +12 -8
- package/dist/esm/css/mui-tokens.css +417 -305
- package/dist/esm/css/readme.md +2 -2
- package/dist/esm/custom-elements.json +3678 -1553
- package/dist/esm/dynamic-attrs.json +263 -66
- package/dist/esm/index.js +30 -6
- package/dist/esm/knowledge/compositions/index.js +1560 -0
- package/dist/esm/knowledge/index.js +28 -0
- package/dist/esm/knowledge/keywords/index.js +306 -0
- package/dist/esm/knowledge/rules/index.js +199 -0
- package/dist/esm/tokens/js/index.js +143 -139
- package/dist/types/agent/keywords/index.d.ts +1 -1
- package/dist/types/components/mui-avatar-chip/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-chip/index.d.ts +18 -0
- package/dist/types/components/mui-avatar-group/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-group/doc.d.ts +2 -0
- package/dist/types/components/mui-avatar-group/index.d.ts +1 -0
- package/dist/types/components/mui-button/api.d.ts +2 -2
- package/dist/types/components/mui-calendar/api.d.ts +41 -0
- package/dist/types/components/mui-calendar/doc.d.ts +2 -0
- package/dist/types/components/mui-calendar/index.d.ts +3 -0
- package/dist/types/components/mui-checkbox/api.d.ts +4 -0
- package/dist/types/components/mui-chip-input/api.d.ts +4 -0
- package/dist/types/components/mui-chip-rail/index.d.ts +1 -0
- package/dist/types/components/mui-date-picker/api.d.ts +38 -0
- package/dist/types/components/mui-date-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-date-picker/index.d.ts +6 -0
- package/dist/types/components/mui-drawer/api.d.ts +4 -0
- package/dist/types/components/mui-drawer/index.d.ts +2 -0
- package/dist/types/components/mui-file-upload/api.d.ts +4 -0
- package/dist/types/components/mui-icons/fullscreen.d.ts +1 -0
- package/dist/types/components/mui-icons/icon-helper.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +14 -1
- package/dist/types/components/mui-icons/panel.d.ts +1 -0
- package/dist/types/components/mui-icons/pause.d.ts +1 -0
- package/dist/types/components/mui-icons/picture-in-picture.d.ts +1 -0
- package/dist/types/components/mui-icons/play-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-right-drawer.d.ts +1 -0
- package/dist/types/components/mui-icons/reload.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-mute.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-one-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-two-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/stop-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/timer.d.ts +1 -0
- package/dist/types/components/mui-icons/vertical-ellipsis.d.ts +1 -0
- package/dist/types/components/mui-input/api.d.ts +12 -0
- package/dist/types/components/mui-media-player/api.d.ts +4 -0
- package/dist/types/components/mui-media-player/index.d.ts +13 -4
- package/dist/types/components/mui-model-viewer/api.d.ts +28 -0
- package/dist/types/components/mui-model-viewer/doc.d.ts +2 -0
- package/dist/types/components/mui-model-viewer/index.d.ts +17 -0
- package/dist/types/components/mui-progress-ring/api.d.ts +24 -0
- package/dist/types/components/mui-progress-ring/doc.d.ts +2 -0
- package/dist/types/components/mui-progress-ring/index.d.ts +1 -0
- package/dist/types/components/mui-radio/api.d.ts +12 -0
- package/dist/types/components/mui-range-input/api.d.ts +4 -0
- package/dist/types/components/mui-responsive/api.d.ts +10 -2
- package/dist/types/components/mui-search-input/api.d.ts +40 -0
- package/dist/types/components/mui-search-input/doc.d.ts +2 -0
- package/dist/types/components/mui-search-input/index.d.ts +3 -0
- package/dist/types/components/mui-select/api.d.ts +12 -0
- package/dist/types/components/mui-switch/api.d.ts +4 -0
- package/dist/types/components/mui-table/api.d.ts +15 -0
- package/dist/types/components/mui-textarea/api.d.ts +12 -0
- package/dist/types/components/mui-time/api.d.ts +41 -0
- package/dist/types/components/mui-time/doc.d.ts +2 -0
- package/dist/types/components/mui-time/index.d.ts +1 -0
- package/dist/types/components/mui-time-picker/api.d.ts +38 -0
- package/dist/types/components/mui-time-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-time-picker/index.d.ts +4 -0
- package/dist/types/index.d.ts +24 -2
- package/dist/types/knowledge/compositions.d.ts +4644 -0
- package/dist/types/knowledge/index.d.ts +4657 -0
- package/dist/types/knowledge/keywords.d.ts +4 -0
- package/dist/types/knowledge/rules.d.ts +1 -0
- package/dist/types/tokens/js/index.d.ts +11 -7
- package/package.json +119 -12
- package/dist/esm/components/mui-form-hint/index.js +0 -1
- package/dist/types/components/mui-form-hint/index.d.ts +0 -1
- /package/dist/types/components/{mui-form-hint → mui-avatar-chip}/doc.d.ts +0 -0
- /package/dist/types/components/mui-icons/{rectangle-bottom-panel.d.ts → copy.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getPartMap as
|
|
2
|
-
class
|
|
1
|
+
import { getPartMap as f } from "../../utils/part-map/index.js";
|
|
2
|
+
class b extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
4
|
return [
|
|
5
5
|
"target",
|
|
@@ -18,81 +18,112 @@ class g extends HTMLElement {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super(), this.attachShadow({ mode: "open" });
|
|
20
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
|
+
}
|
|
21
26
|
async connectedCallback() {
|
|
22
|
-
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()
|
|
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());
|
|
23
35
|
}
|
|
24
|
-
attributeChangedCallback(
|
|
36
|
+
attributeChangedCallback(a, o, r) {
|
|
25
37
|
if (this.shadowRoot) {
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
r !== null ?
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
this.updateIconSizes(
|
|
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);
|
|
55
67
|
}
|
|
56
68
|
});
|
|
57
|
-
}),
|
|
69
|
+
}), a === "stroke-ring-size" && o !== r && this.syncRingSizeAttribute();
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
syncRingSizeAttribute() {
|
|
61
|
-
var
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
73
|
+
var t;
|
|
74
|
+
const a = (t = this.getAttribute("stroke-ring-size")) == null ? void 0 : t.trim();
|
|
75
|
+
if (!a) {
|
|
64
76
|
this.style.removeProperty("--action-ring-size");
|
|
65
77
|
return;
|
|
66
78
|
}
|
|
67
|
-
const o =
|
|
68
|
-
this.style.setProperty("--action-ring-size", r ? `var(--stroke-size-${o})` :
|
|
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");
|
|
69
93
|
}
|
|
70
94
|
updateSlotState() {
|
|
71
|
-
const
|
|
72
|
-
(d) => {
|
|
73
|
-
var c;
|
|
74
|
-
return d.nodeType === Node.ELEMENT_NODE || d.nodeType === Node.TEXT_NODE && !!((c = d.textContent) != null && c.trim());
|
|
75
|
-
}
|
|
76
|
-
), s = n(r), i = n(a);
|
|
77
|
-
this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
|
|
78
|
-
const e = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], h = ((o == null ? void 0 : o.assignedElements({ flatten: !0 })) ?? []).some((l) => l.tagName.toLowerCase() === "mui-video-thumbnail");
|
|
79
|
-
this.toggleAttribute("has-video", h);
|
|
80
|
-
const f = !h && e.length > 0 && e.every(
|
|
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(
|
|
81
96
|
(l) => {
|
|
82
|
-
var
|
|
83
|
-
return l.nodeType === Node.ELEMENT_NODE
|
|
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());
|
|
84
108
|
}
|
|
85
109
|
);
|
|
86
|
-
this.toggleAttribute("
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
110
|
+
this.toggleAttribute("avatar-only", u);
|
|
111
|
+
const g = !u && !h && n.length > 0 && n.every(
|
|
112
|
+
(s) => {
|
|
113
|
+
var l;
|
|
114
|
+
return s.nodeType === Node.ELEMENT_NODE ? s.classList.contains("mui-icon") || s.tagName.toLowerCase() === "svg" : !((l = s.textContent) != null && l.trim());
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
this.toggleAttribute("icon-only", g), g ? this.updateIconSizes(n, !0) : [r, o, t].forEach((l) => {
|
|
118
|
+
if (l) {
|
|
119
|
+
const v = l.assignedNodes({ flatten: !0 });
|
|
120
|
+
this.updateIconSizes(v, !1), u || this.updateAvatarSizes(v), this.updateBadgeSizes(v);
|
|
90
121
|
}
|
|
91
122
|
});
|
|
92
123
|
}
|
|
93
124
|
render() {
|
|
94
125
|
if (!this.shadowRoot) return;
|
|
95
|
-
const
|
|
126
|
+
const a = f("text", "spacing", "layout", "visual");
|
|
96
127
|
this.shadowRoot.innerHTML = /*html*/
|
|
97
128
|
`
|
|
98
129
|
<style>
|
|
@@ -132,8 +163,8 @@ class g extends HTMLElement {
|
|
|
132
163
|
}
|
|
133
164
|
|
|
134
165
|
:host([size="xx-small"]) a {
|
|
135
|
-
font-size: var(--font-size-
|
|
136
|
-
line-height: var(--line-height-
|
|
166
|
+
font-size: var(--text-font-size-xxs);
|
|
167
|
+
line-height: var(--text-line-height-xxs);
|
|
137
168
|
}
|
|
138
169
|
|
|
139
170
|
:host([size="x-small"]) a {
|
|
@@ -183,7 +214,7 @@ class g extends HTMLElement {
|
|
|
183
214
|
text-decoration: none;
|
|
184
215
|
padding: var(--action-padding);
|
|
185
216
|
min-height: var(--action-size-medium);
|
|
186
|
-
border-radius: var(--action-radius);
|
|
217
|
+
border-radius: var(--action-radius-medium);
|
|
187
218
|
font-size: var(--action-font-size);
|
|
188
219
|
font-weight: var(--action-font-weight);
|
|
189
220
|
line-height: var(--action-line-height);
|
|
@@ -441,6 +472,44 @@ class g extends HTMLElement {
|
|
|
441
472
|
}
|
|
442
473
|
/* ===================================== */
|
|
443
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
|
+
|
|
444
513
|
:host([alert-positive-slot]) {
|
|
445
514
|
--alert-text: var(--feedback-positive-text);
|
|
446
515
|
--alert-icon: var(--feedback-positive-icon);
|
|
@@ -530,6 +599,15 @@ class g extends HTMLElement {
|
|
|
530
599
|
--avatar-background-override: var(--action-avatar-background-hover);
|
|
531
600
|
}
|
|
532
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
|
+
|
|
533
611
|
/* Badge Spacing */
|
|
534
612
|
:host([has-before]) a ::slotted(mui-badge[slot="before"]) {
|
|
535
613
|
margin-right: var(--space-025);
|
|
@@ -674,8 +752,8 @@ class g extends HTMLElement {
|
|
|
674
752
|
:host([size="xx-small"][usage="input"]) a:hover,
|
|
675
753
|
:host([size="xx-small"][usage="input"]) a:focus,
|
|
676
754
|
:host([size="xx-small"][usage="input"]) a[aria-disabled="true"] {
|
|
677
|
-
font-size: var(--font-size-
|
|
678
|
-
line-height: var(--line-height-
|
|
755
|
+
font-size: var(--text-font-size-xxs);
|
|
756
|
+
line-height: var(--text-line-height-xxs);
|
|
679
757
|
font-weight: var(--font-weight-semi-bold);
|
|
680
758
|
min-height: var(--action-size-xx-small);
|
|
681
759
|
padding: var(--space-025) var(--space-100);
|
|
@@ -727,6 +805,40 @@ class g extends HTMLElement {
|
|
|
727
805
|
border-radius: var(--action-radius-large);
|
|
728
806
|
}
|
|
729
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
|
+
|
|
730
842
|
/* Keep input-composed links flush against the input edge after size radius applies. */
|
|
731
843
|
:host([slot="before"][usage="input"]) a,
|
|
732
844
|
:host([slot="before"][usage="input"]) a:hover,
|
|
@@ -908,7 +1020,7 @@ class g extends HTMLElement {
|
|
|
908
1020
|
</style>
|
|
909
1021
|
|
|
910
1022
|
<a
|
|
911
|
-
part="${
|
|
1023
|
+
part="${a}"
|
|
912
1024
|
target="${this.getAttribute("target") || "_self"}"
|
|
913
1025
|
href="${this.hasAttribute("disabled") ? "javascript:void(0)" : this.getAttribute("href") || "#"}"
|
|
914
1026
|
aria-disabled="${this.hasAttribute("disabled") ? "true" : "false"}"
|
|
@@ -921,8 +1033,8 @@ class g extends HTMLElement {
|
|
|
921
1033
|
`;
|
|
922
1034
|
}
|
|
923
1035
|
// Update avatar sizes based on button size
|
|
924
|
-
updateAvatarSizes(
|
|
925
|
-
const o = this.getAttribute("size") || "medium",
|
|
1036
|
+
updateAvatarSizes(a) {
|
|
1037
|
+
const o = this.getAttribute("size") || "medium", e = ((this.getAttribute("variant") || "default") === "default" ? {
|
|
926
1038
|
"xx-small": "xx-small",
|
|
927
1039
|
"x-small": "xx-small",
|
|
928
1040
|
small: "xx-small",
|
|
@@ -935,51 +1047,51 @@ class g extends HTMLElement {
|
|
|
935
1047
|
medium: "small",
|
|
936
1048
|
large: "medium"
|
|
937
1049
|
})[o] || "small";
|
|
938
|
-
|
|
1050
|
+
a.forEach((i) => {
|
|
939
1051
|
if (i.nodeType === Node.ELEMENT_NODE) {
|
|
940
|
-
const
|
|
941
|
-
|
|
1052
|
+
const n = i;
|
|
1053
|
+
n.tagName.toLowerCase() === "mui-avatar" && n.setAttribute("size", e);
|
|
942
1054
|
}
|
|
943
1055
|
});
|
|
944
1056
|
}
|
|
945
|
-
updateIconSizes(
|
|
946
|
-
const r = this.getAttribute("size") || "medium",
|
|
1057
|
+
updateIconSizes(a, o) {
|
|
1058
|
+
const r = this.getAttribute("size") || "medium", d = {
|
|
947
1059
|
"xx-small": "xx-small",
|
|
948
1060
|
"x-small": "x-small",
|
|
949
1061
|
small: "x-small",
|
|
950
1062
|
medium: o ? "medium" : "small",
|
|
951
1063
|
large: o ? "large" : "medium"
|
|
952
1064
|
}[r] || "small";
|
|
953
|
-
|
|
954
|
-
if (
|
|
955
|
-
const i =
|
|
956
|
-
(
|
|
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);
|
|
957
1069
|
}
|
|
958
1070
|
});
|
|
959
1071
|
}
|
|
960
|
-
updateBadgeSizes(
|
|
961
|
-
const o = this.getAttribute("size") || "medium",
|
|
1072
|
+
updateBadgeSizes(a) {
|
|
1073
|
+
const o = this.getAttribute("size") || "medium", t = {
|
|
962
1074
|
"xx-small": "x-small",
|
|
963
1075
|
"x-small": "x-small",
|
|
964
1076
|
small: "small",
|
|
965
1077
|
medium: "medium",
|
|
966
1078
|
large: "large"
|
|
967
1079
|
}[o] || "medium";
|
|
968
|
-
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
|
|
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);
|
|
972
1084
|
}
|
|
973
1085
|
});
|
|
974
1086
|
}
|
|
975
1087
|
waitForPartMap() {
|
|
976
|
-
return new Promise((
|
|
977
|
-
if (typeof
|
|
1088
|
+
return new Promise((a) => {
|
|
1089
|
+
if (typeof f == "function") return a();
|
|
978
1090
|
const o = () => {
|
|
979
|
-
typeof
|
|
1091
|
+
typeof f == "function" ? a() : requestAnimationFrame(o);
|
|
980
1092
|
};
|
|
981
1093
|
o();
|
|
982
1094
|
});
|
|
983
1095
|
}
|
|
984
1096
|
}
|
|
985
|
-
customElements.get("mui-link") || customElements.define("mui-link",
|
|
1097
|
+
customElements.get("mui-link") || customElements.define("mui-link", b);
|