@muibook/components 19.6.0 → 20.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.
- package/README.md +1 -1
- package/dist/esm/agent/keywords/index.js +32 -1
- package/dist/esm/agent/prompts/index.js +10 -8
- package/dist/esm/components/mui-addon/index.js +14 -14
- package/dist/esm/components/mui-avatar/index.js +4 -1
- package/dist/esm/components/mui-badge/index.js +35 -18
- package/dist/esm/components/mui-button/index.js +187 -52
- package/dist/esm/components/mui-card/body/index.js +1 -1
- package/dist/esm/components/mui-chip/index.js +56 -26
- package/dist/esm/components/mui-chip-rail/index.js +239 -0
- package/dist/esm/components/mui-code/index.js +5 -5
- package/dist/esm/components/mui-dropdown/index.js +55 -46
- package/dist/esm/components/mui-file-upload/index.js +1 -0
- package/dist/esm/components/mui-heading/index.js +3 -2
- package/dist/esm/components/mui-input/index.js +21 -17
- package/dist/esm/components/mui-link/index.js +199 -55
- package/dist/esm/components/mui-message/index.js +7 -6
- package/dist/esm/components/mui-prompt/index.js +102 -102
- package/dist/esm/components/mui-select/index.js +4 -4
- package/dist/esm/components/mui-stack/hstack/index.js +10 -5
- package/dist/esm/components/mui-status/index.js +239 -0
- package/dist/esm/components/mui-stepper/step/index.js +46 -32
- package/dist/esm/components/mui-switch/index.js +21 -13
- package/dist/esm/components/mui-tabs/controller/index.js +17 -6
- package/dist/esm/components/mui-tabs/item/index.js +17 -5
- package/dist/esm/components/mui-tabs/tab-bar/index.js +93 -39
- package/dist/esm/components/mui-video-thumbnail/index.js +205 -0
- package/dist/esm/css/mui-brand.css +1 -1
- package/dist/esm/css/mui-tokens.css +267 -77
- package/dist/esm/custom-elements.json +2212 -1538
- package/dist/esm/dynamic-attrs.json +26 -6
- package/dist/esm/index.js +7 -4
- package/dist/types/components/mui-button/api.d.ts +4 -0
- package/dist/types/components/mui-chip/api.d.ts +4 -0
- package/dist/types/components/mui-chip-rail/api.d.ts +21 -0
- package/dist/types/components/mui-chip-rail/doc.d.ts +2 -0
- package/dist/types/components/mui-chip-rail/index.d.ts +3 -0
- package/dist/types/components/mui-link/api.d.ts +4 -0
- package/dist/types/components/mui-status/api.d.ts +24 -0
- package/dist/types/components/mui-status/doc.d.ts +2 -0
- package/dist/types/components/mui-status/index.d.ts +1 -0
- package/dist/types/components/mui-video-thumbnail/api.d.ts +28 -0
- package/dist/types/components/mui-video-thumbnail/doc.d.ts +2 -0
- package/dist/types/components/mui-video-thumbnail/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +13 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
class g extends HTMLElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super(), this.handleActionKeyDown = (t) => {
|
|
4
|
+
this.hasAttribute("action") && (t.key !== "Enter" && t.key !== " " || this.getAttribute("slot") === "action" && this.closest("mui-dropdown") || (t.preventDefault(), t.stopImmediatePropagation(), this.click()));
|
|
5
|
+
}, this.attachShadow({ mode: "open" });
|
|
6
|
+
}
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return ["variant", "size", "color", "action"];
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
this.hasAttribute("size") || this.setAttribute("size", "medium"), this.addEventListener("keydown", this.handleActionKeyDown), this.render();
|
|
12
|
+
}
|
|
13
|
+
disconnectedCallback() {
|
|
14
|
+
this.removeEventListener("keydown", this.handleActionKeyDown);
|
|
15
|
+
}
|
|
16
|
+
attributeChangedCallback() {
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
19
|
+
getAriaLive(t) {
|
|
20
|
+
return t ? t === "warning" || t === "attention" ? "assertive" : t === "positive" || t === "info" ? "polite" : "off" : "off";
|
|
21
|
+
}
|
|
22
|
+
syncSlotIcons() {
|
|
23
|
+
if (!this.shadowRoot) return;
|
|
24
|
+
const t = this.shadowRoot.querySelector('slot[name="before"]'), i = this.shadowRoot.querySelector('slot[name="after"]'), e = t == null ? void 0 : t.assignedElements({ flatten: !0 }), a = i == null ? void 0 : i.assignedElements({ flatten: !0 });
|
|
25
|
+
this.toggleAttribute("has-before", !!(e != null && e.length)), this.toggleAttribute("has-after", !!(a != null && a.length)), [e, a].forEach((n) => {
|
|
26
|
+
n == null || n.forEach((s) => {
|
|
27
|
+
[s, ...Array.from(s.querySelectorAll("*"))].forEach((r) => {
|
|
28
|
+
r.tagName.toLowerCase().startsWith("mui-icon-") && (r.setAttribute("size", "xx-small"), r.hasAttribute("color") || r.setAttribute("color", "currentColor"));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const t = this.getAttribute("variant"), i = this.getAttribute("size") || "medium", e = this.getAttribute("color"), a = this.hasAttribute("action"), n = {
|
|
35
|
+
background: "var(--status-grey-background)",
|
|
36
|
+
color: "var(--status-grey-text-color)",
|
|
37
|
+
border: "var(--stroke-size-100) var(--stroke-solid) var(--status-grey-border-color)"
|
|
38
|
+
}, s = {
|
|
39
|
+
info: {
|
|
40
|
+
background: "var(--status-info-background)",
|
|
41
|
+
color: "var(--status-info-text-color)",
|
|
42
|
+
border: "var(--stroke-size-100) var(--stroke-solid) var(--status-info-border-color)"
|
|
43
|
+
},
|
|
44
|
+
positive: {
|
|
45
|
+
background: "var(--status-positive-background)",
|
|
46
|
+
color: "var(--status-positive-text-color)",
|
|
47
|
+
border: "var(--stroke-size-100) var(--stroke-solid) var(--status-positive-border-color)"
|
|
48
|
+
},
|
|
49
|
+
warning: {
|
|
50
|
+
background: "var(--status-warning-background)",
|
|
51
|
+
color: "var(--status-warning-text-color)",
|
|
52
|
+
border: "var(--stroke-size-100) var(--stroke-solid) var(--status-warning-border-color)"
|
|
53
|
+
},
|
|
54
|
+
attention: {
|
|
55
|
+
background: "var(--status-attention-background)",
|
|
56
|
+
color: "var(--status-attention-text-color)",
|
|
57
|
+
border: "var(--stroke-size-100) var(--stroke-solid) var(--status-attention-border-color)"
|
|
58
|
+
}
|
|
59
|
+
}, c = {
|
|
60
|
+
small: {
|
|
61
|
+
fontSize: "var(--text-font-size-xs)",
|
|
62
|
+
minHeight: "2.2rem",
|
|
63
|
+
padding: "0 var(--space-050)",
|
|
64
|
+
gap: "var(--space-050)"
|
|
65
|
+
},
|
|
66
|
+
medium: {
|
|
67
|
+
fontSize: "var(--text-font-size-xs)",
|
|
68
|
+
minHeight: "2.6rem",
|
|
69
|
+
padding: "0 var(--space-100)",
|
|
70
|
+
gap: "var(--space-050)"
|
|
71
|
+
}
|
|
72
|
+
}, r = t && s[t] ? s[t] : n, l = c[i] || c.medium, o = e ? {
|
|
73
|
+
grey: {
|
|
74
|
+
background: "var(--status-grey-background)",
|
|
75
|
+
borderColor: "var(--status-grey-border-color)",
|
|
76
|
+
color: "var(--status-grey-text-color)"
|
|
77
|
+
},
|
|
78
|
+
purple: {
|
|
79
|
+
background: "var(--status-purple-background)",
|
|
80
|
+
borderColor: "var(--status-purple-border-color)",
|
|
81
|
+
color: "var(--status-purple-text-color)"
|
|
82
|
+
},
|
|
83
|
+
violet: {
|
|
84
|
+
background: "var(--status-violet-background)",
|
|
85
|
+
borderColor: "var(--status-violet-border-color)",
|
|
86
|
+
color: "var(--status-violet-text-color)"
|
|
87
|
+
},
|
|
88
|
+
pink: {
|
|
89
|
+
background: "var(--status-pink-background)",
|
|
90
|
+
borderColor: "var(--status-pink-border-color)",
|
|
91
|
+
color: "var(--status-pink-text-color)"
|
|
92
|
+
},
|
|
93
|
+
magenta: {
|
|
94
|
+
background: "var(--status-magenta-background)",
|
|
95
|
+
borderColor: "var(--status-magenta-border-color)",
|
|
96
|
+
color: "var(--status-magenta-text-color)"
|
|
97
|
+
},
|
|
98
|
+
red: {
|
|
99
|
+
background: "var(--status-red-background)",
|
|
100
|
+
borderColor: "var(--status-red-border-color)",
|
|
101
|
+
color: "var(--status-red-text-color)"
|
|
102
|
+
},
|
|
103
|
+
orange: {
|
|
104
|
+
background: "var(--status-orange-background)",
|
|
105
|
+
borderColor: "var(--status-orange-border-color)",
|
|
106
|
+
color: "var(--status-orange-text-color)"
|
|
107
|
+
},
|
|
108
|
+
amber: {
|
|
109
|
+
background: "var(--status-amber-background)",
|
|
110
|
+
borderColor: "var(--status-amber-border-color)",
|
|
111
|
+
color: "var(--status-amber-text-color)"
|
|
112
|
+
},
|
|
113
|
+
yellow: {
|
|
114
|
+
background: "var(--status-yellow-background)",
|
|
115
|
+
borderColor: "var(--status-yellow-border-color)",
|
|
116
|
+
color: "var(--status-yellow-text-color)"
|
|
117
|
+
},
|
|
118
|
+
lime: {
|
|
119
|
+
background: "var(--status-lime-background)",
|
|
120
|
+
borderColor: "var(--status-lime-border-color)",
|
|
121
|
+
color: "var(--status-lime-text-color)"
|
|
122
|
+
},
|
|
123
|
+
green: {
|
|
124
|
+
background: "var(--status-green-background)",
|
|
125
|
+
borderColor: "var(--status-green-border-color)",
|
|
126
|
+
color: "var(--status-green-text-color)"
|
|
127
|
+
},
|
|
128
|
+
teal: {
|
|
129
|
+
background: "var(--status-teal-background)",
|
|
130
|
+
borderColor: "var(--status-teal-border-color)",
|
|
131
|
+
color: "var(--status-teal-text-color)"
|
|
132
|
+
},
|
|
133
|
+
cyan: {
|
|
134
|
+
background: "var(--status-cyan-background)",
|
|
135
|
+
borderColor: "var(--status-cyan-border-color)",
|
|
136
|
+
color: "var(--status-cyan-text-color)"
|
|
137
|
+
},
|
|
138
|
+
blue: {
|
|
139
|
+
background: "var(--status-blue-background)",
|
|
140
|
+
borderColor: "var(--status-blue-border-color)",
|
|
141
|
+
color: "var(--status-blue-text-color)"
|
|
142
|
+
},
|
|
143
|
+
indigo: {
|
|
144
|
+
background: "var(--status-indigo-background)",
|
|
145
|
+
borderColor: "var(--status-indigo-border-color)",
|
|
146
|
+
color: "var(--status-indigo-text-color)"
|
|
147
|
+
}
|
|
148
|
+
}[e] : null, u = this.getAriaLive(t && s[t] ? t : null);
|
|
149
|
+
a ? (this.setAttribute("role", "button"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.removeAttribute("aria-live")) : (this.setAttribute("role", "status"), this.setAttribute("aria-live", u), this.getAttribute("tabindex") === "0" && this.removeAttribute("tabindex"));
|
|
150
|
+
const d = (
|
|
151
|
+
/*css*/
|
|
152
|
+
`
|
|
153
|
+
:host {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
vertical-align: middle;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.status {
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
min-width: 0;
|
|
165
|
+
min-height: ${l.minHeight};
|
|
166
|
+
gap: ${l.gap};
|
|
167
|
+
padding: ${l.padding};
|
|
168
|
+
border: ${o ? `var(--stroke-size-100) var(--stroke-solid) ${o.borderColor}` : r.border};
|
|
169
|
+
border-radius: var(--radius-100);
|
|
170
|
+
background: ${(o == null ? void 0 : o.background) || r.background};
|
|
171
|
+
color: ${(o == null ? void 0 : o.color) || r.color};
|
|
172
|
+
font-family: var(--font-family);
|
|
173
|
+
font-size: ${l.fontSize};
|
|
174
|
+
font-weight: var(--font-weight-medium);
|
|
175
|
+
line-height: 1;
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:host([action]) .status {
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host([action]:hover) .status {
|
|
184
|
+
filter: brightness(1.04);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host([action]:focus-visible) {
|
|
188
|
+
outline: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host([action]:focus-visible) .status {
|
|
192
|
+
outline: var(--outline-thick);
|
|
193
|
+
outline-offset: var(--space-050);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([size="medium"][has-before]:not([has-after])) .status {
|
|
197
|
+
padding-inline-end: calc(var(--space-100) + var(--space-050));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host([size="small"][has-before]:not([has-after])) .status {
|
|
201
|
+
padding-inline-end: var(--space-100);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([size="medium"][has-after]:not([has-before])) .status {
|
|
205
|
+
padding-inline-start: calc(var(--space-100) + var(--space-050));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host([size="small"][has-after]:not([has-before])) .status {
|
|
209
|
+
padding-inline-start: var(--space-100);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
slot[name="before"],
|
|
213
|
+
slot[name="after"] {
|
|
214
|
+
display: contents;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
::slotted([slot="before"]),
|
|
218
|
+
::slotted([slot="after"]) {
|
|
219
|
+
flex: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
::slotted(.mui-icon) {
|
|
223
|
+
color: currentColor;
|
|
224
|
+
fill: currentColor;
|
|
225
|
+
}
|
|
226
|
+
`
|
|
227
|
+
);
|
|
228
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
229
|
+
`
|
|
230
|
+
<style>${d}</style>
|
|
231
|
+
<span class="status" part="status">
|
|
232
|
+
<slot name="before"></slot>
|
|
233
|
+
<slot></slot>
|
|
234
|
+
<slot name="after"></slot>
|
|
235
|
+
</span>
|
|
236
|
+
`, this.shadowRoot.querySelectorAll('slot[name="before"], slot[name="after"]').forEach((b) => b.addEventListener("slotchange", () => this.syncSlotIcons())), this.syncSlotIcons());
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
customElements.get("mui-status") || customElements.define("mui-status", g);
|
|
@@ -2,7 +2,7 @@ import "../../mui-body/index.js";
|
|
|
2
2
|
import "../../mui-icons/checkmark/index.js";
|
|
3
3
|
import "../../mui-icons/exclamationmark/index.js";
|
|
4
4
|
import "../../mui-icons/notification/index.js";
|
|
5
|
-
class
|
|
5
|
+
class h extends HTMLElement {
|
|
6
6
|
static get observedAttributes() {
|
|
7
7
|
return ["state", "resolved-state", "title", "direction", "hide-icon", "size"];
|
|
8
8
|
}
|
|
@@ -15,42 +15,51 @@ class g extends HTMLElement {
|
|
|
15
15
|
attributeChangedCallback() {
|
|
16
16
|
this.render();
|
|
17
17
|
}
|
|
18
|
+
syncContentState() {
|
|
19
|
+
if (!this.shadowRoot) return;
|
|
20
|
+
const r = this.shadowRoot.querySelector(".content"), e = this.shadowRoot.querySelector('slot[name="secondary"]'), s = !!(e != null && e.assignedNodes({ flatten: !0 }).some((t) => {
|
|
21
|
+
var i;
|
|
22
|
+
return t.nodeType === Node.ELEMENT_NODE || !!((i = t.textContent) != null && i.trim());
|
|
23
|
+
}));
|
|
24
|
+
r == null || r.classList.toggle("title-only", !s);
|
|
25
|
+
}
|
|
18
26
|
render() {
|
|
19
27
|
if (!this.shadowRoot) return;
|
|
20
|
-
const
|
|
21
|
-
success: `<mui-icon-checkmark class="dot-icon" size="${
|
|
22
|
-
completed: `<mui-icon-checkmark class="dot-icon" size="${
|
|
23
|
-
active: `<mui-icon-notification class="dot-icon" size="${
|
|
24
|
-
error: `<mui-icon-exclamationmark class="dot-icon" size="${
|
|
25
|
-
pending: `<mui-icon-exclamationmark class="dot-icon" size="${
|
|
28
|
+
const r = this.getAttribute("resolved-state") || this.getAttribute("state") || "upcoming", e = this.getAttribute("direction") || "horizontal", s = this.getAttribute("size"), t = s === "x-small" || s === "small" ? s : "medium", i = this.getAttribute("title") || "", d = this.hasAttribute("hide-icon"), p = r === "active" || r === "error" || r === "pending", a = t === "x-small" ? "xx-small" : t === "small" ? "x-small" : "small", v = t === "medium" ? "small" : "x-small", b = {
|
|
29
|
+
success: `<mui-icon-checkmark class="dot-icon" size="${a}" color="var(--stepper-icon-color)"></mui-icon-checkmark>`,
|
|
30
|
+
completed: `<mui-icon-checkmark class="dot-icon" size="${a}" color="var(--stepper-icon-color)"></mui-icon-checkmark>`,
|
|
31
|
+
active: `<mui-icon-notification class="dot-icon" size="${a}" color="var(--stepper-icon-color)"></mui-icon-notification>`,
|
|
32
|
+
error: `<mui-icon-exclamationmark class="dot-icon" size="${a}" color="var(--stepper-icon-color)"></mui-icon-exclamationmark>`,
|
|
33
|
+
pending: `<mui-icon-exclamationmark class="dot-icon" size="${a}" color="var(--stepper-icon-color)"></mui-icon-exclamationmark>`,
|
|
26
34
|
disabled: ""
|
|
27
|
-
},
|
|
35
|
+
}, c = `
|
|
28
36
|
<div class="content">
|
|
29
37
|
<mui-body
|
|
30
|
-
size="${
|
|
31
|
-
${
|
|
32
|
-
class="${
|
|
38
|
+
size="${v}"
|
|
39
|
+
${p ? "weight='bold'" : ""}
|
|
40
|
+
class="${r === "active" ? "active" : ""}"
|
|
33
41
|
>
|
|
34
|
-
${
|
|
42
|
+
${i}
|
|
35
43
|
</mui-body>
|
|
36
44
|
<slot name="secondary"></slot>
|
|
37
45
|
</div>
|
|
38
|
-
`,
|
|
46
|
+
`, l = `
|
|
39
47
|
<div class="dotwrapper">
|
|
40
|
-
<div class="dot ${
|
|
41
|
-
${
|
|
48
|
+
<div class="dot ${r}">
|
|
49
|
+
${d ? "" : b[r] || ""}
|
|
42
50
|
</div>
|
|
43
|
-
${
|
|
51
|
+
${e === "horizontal" ? `<div class="line before ${e}"></div><div class="line after ${e}"></div>` : ""}
|
|
44
52
|
</div>
|
|
45
|
-
`,
|
|
53
|
+
`, g = e === "horizontal" ? c + l : l + c, o = t === "x-small" ? "var(--stepper-dot-size-x-small)" : t === "small" ? "var(--stepper-dot-size-small)" : "var(--stepper-dot-size)";
|
|
46
54
|
this.shadowRoot.innerHTML = /*html*/
|
|
47
55
|
`
|
|
48
56
|
<style>
|
|
49
57
|
:host {
|
|
50
58
|
display: flex;
|
|
51
|
-
flex-direction: ${
|
|
52
|
-
align-items: ${
|
|
59
|
+
flex-direction: ${e === "horizontal" ? "column" : "row"};
|
|
60
|
+
align-items: ${e === "horizontal" ? "center" : "flex-start"};
|
|
53
61
|
flex: 1;
|
|
62
|
+
--stepper-title-only: 12px;
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
.dotwrapper {
|
|
@@ -58,13 +67,13 @@ class g extends HTMLElement {
|
|
|
58
67
|
display: flex;
|
|
59
68
|
align-items: center;
|
|
60
69
|
justify-content: center; /* keeps dot centered */
|
|
61
|
-
width: ${
|
|
70
|
+
width: ${e === "horizontal" ? "100%" : "auto"};
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
/* .dot stays unchanged */
|
|
65
74
|
.dot {
|
|
66
|
-
width: ${
|
|
67
|
-
height: ${
|
|
75
|
+
width: ${o};
|
|
76
|
+
height: ${o};
|
|
68
77
|
display: flex;
|
|
69
78
|
align-items: center;
|
|
70
79
|
justify-content: center;
|
|
@@ -241,13 +250,16 @@ class g extends HTMLElement {
|
|
|
241
250
|
}
|
|
242
251
|
|
|
243
252
|
:host([direction="vertical"]) .content {
|
|
244
|
-
margin-left: calc( -1 * ((${
|
|
245
|
-
padding-left: ${
|
|
246
|
-
padding-bottom: ${
|
|
253
|
+
margin-left: calc( -1 * ((${o} / 2) + var(--stroke-size-100)));
|
|
254
|
+
padding-left: ${o};
|
|
255
|
+
padding-bottom: ${o};
|
|
247
256
|
align-items: start;
|
|
248
257
|
text-align: left;
|
|
249
258
|
position: relative;
|
|
250
259
|
}
|
|
260
|
+
:host([direction="vertical"]) .content.title-only {
|
|
261
|
+
padding-top: var(--stepper-title-only);
|
|
262
|
+
}
|
|
251
263
|
|
|
252
264
|
:host([direction="vertical"]) .content:before {
|
|
253
265
|
content: "";
|
|
@@ -255,8 +267,8 @@ class g extends HTMLElement {
|
|
|
255
267
|
height: 100%;
|
|
256
268
|
position: absolute;
|
|
257
269
|
background: var(--stepper-border-color);
|
|
258
|
-
margin-left: calc(-1 * ${
|
|
259
|
-
height: calc(100% - ${
|
|
270
|
+
margin-left: calc(-1 * ${o});
|
|
271
|
+
height: calc(100% - ${o});
|
|
260
272
|
bottom: calc(-1 * var(--stroke-size-100));
|
|
261
273
|
|
|
262
274
|
}
|
|
@@ -303,9 +315,9 @@ class g extends HTMLElement {
|
|
|
303
315
|
|
|
304
316
|
|
|
305
317
|
:host([direction="vertical"]) .dotwrapper {
|
|
306
|
-
width: ${
|
|
307
|
-
min-width: ${
|
|
308
|
-
flex: 0 0 ${
|
|
318
|
+
width: ${o};
|
|
319
|
+
min-width: ${o};
|
|
320
|
+
flex: 0 0 ${o};
|
|
309
321
|
margin-top: var(--space-200);
|
|
310
322
|
margin-bottom: var(--space-200);
|
|
311
323
|
}
|
|
@@ -386,9 +398,11 @@ class g extends HTMLElement {
|
|
|
386
398
|
|
|
387
399
|
</style>
|
|
388
400
|
|
|
389
|
-
${
|
|
401
|
+
${g}
|
|
390
402
|
|
|
391
403
|
`;
|
|
404
|
+
const n = this.shadowRoot.querySelector('slot[name="secondary"]');
|
|
405
|
+
n == null || n.addEventListener("slotchange", () => this.syncContentState()), this.syncContentState();
|
|
392
406
|
}
|
|
393
407
|
}
|
|
394
|
-
customElements.get("mui-step") || customElements.define("mui-step",
|
|
408
|
+
customElements.get("mui-step") || customElements.define("mui-step", h);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class d extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
3
|
super(), this._checked = !1, this._checkbox = null, this.attachShadow({ mode: "open" }), this._checked = !1;
|
|
4
4
|
}
|
|
@@ -13,8 +13,8 @@ class n extends HTMLElement {
|
|
|
13
13
|
}
|
|
14
14
|
attributeChangedCallback(s, t, e) {
|
|
15
15
|
if (s === "checked" && t !== e && (this._checked = e !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), s === "disabled" && t !== e) {
|
|
16
|
-
const
|
|
17
|
-
this._checkbox && (this._checkbox.disabled =
|
|
16
|
+
const c = e !== null;
|
|
17
|
+
this._checkbox && (this._checkbox.disabled = c, this._checkbox.setAttribute("aria-disabled", c.toString())), this._updateDisabledState();
|
|
18
18
|
}
|
|
19
19
|
s === "size" && t !== e && this._enforceIconSize();
|
|
20
20
|
}
|
|
@@ -29,8 +29,8 @@ class n extends HTMLElement {
|
|
|
29
29
|
this._checkbox && this._changeHandler && this._checkbox.removeEventListener("change", this._changeHandler);
|
|
30
30
|
}
|
|
31
31
|
_updateDisabledState() {
|
|
32
|
-
var t, e,
|
|
33
|
-
this.hasAttribute("disabled") ? ((t = this._checkbox) == null || t.setAttribute("aria-disabled", "true"), (e = this._checkbox) == null || e.setAttribute("tabindex", "-1")) : ((
|
|
32
|
+
var t, e, c, i;
|
|
33
|
+
this.hasAttribute("disabled") ? ((t = this._checkbox) == null || t.setAttribute("aria-disabled", "true"), (e = this._checkbox) == null || e.setAttribute("tabindex", "-1")) : ((c = this._checkbox) == null || c.removeAttribute("aria-disabled"), (i = this._checkbox) == null || i.removeAttribute("tabindex"));
|
|
34
34
|
}
|
|
35
35
|
_setupListener() {
|
|
36
36
|
this._checkbox && (this._cleanupListeners(), this._changeHandler = () => {
|
|
@@ -44,7 +44,7 @@ class n extends HTMLElement {
|
|
|
44
44
|
}, this._checkbox.addEventListener("change", this._changeHandler));
|
|
45
45
|
}
|
|
46
46
|
_enforceIconSize() {
|
|
47
|
-
const s = this.shadowRoot.querySelector('slot[name="on-icon"]'), t = this.shadowRoot.querySelector('slot[name="off-icon"]'), e = this.getAttribute("size") || "large",
|
|
47
|
+
const s = this.shadowRoot.querySelector('slot[name="on-icon"]'), t = this.shadowRoot.querySelector('slot[name="off-icon"]'), e = this.getAttribute("size") || "large", i = {
|
|
48
48
|
"x-small": "xx-small",
|
|
49
49
|
small: "xx-small",
|
|
50
50
|
medium: "x-small",
|
|
@@ -53,7 +53,7 @@ class n extends HTMLElement {
|
|
|
53
53
|
if (!h) return;
|
|
54
54
|
const a = () => {
|
|
55
55
|
h.assignedElements().forEach((r) => {
|
|
56
|
-
r.tagName.toLowerCase().startsWith("mui-icon") && r.setAttribute("size",
|
|
56
|
+
r.tagName.toLowerCase().startsWith("mui-icon") && r.setAttribute("size", i);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
h.addEventListener("slotchange", a), setTimeout(a, 0);
|
|
@@ -69,7 +69,7 @@ class n extends HTMLElement {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
const s = this.getAttribute("label"), t = this.getAttribute("size") || "large",
|
|
72
|
+
const s = this.getAttribute("label"), t = this.getAttribute("size") || "large", c = ["x-small", "small", "medium", "large"].includes(t) ? t : "large";
|
|
73
73
|
this.shadowRoot.innerHTML = /*html*/
|
|
74
74
|
`
|
|
75
75
|
<style>
|
|
@@ -111,7 +111,9 @@ class n extends HTMLElement {
|
|
|
111
111
|
width: var(--switch-thumb-size-computed, var(--switch-thumb-size));
|
|
112
112
|
height: var(--switch-thumb-size-computed, var(--switch-thumb-size));
|
|
113
113
|
background-color: var(--switch-thumb-bg);
|
|
114
|
-
transition:
|
|
114
|
+
transition:
|
|
115
|
+
background-color var(--speed-200),
|
|
116
|
+
transform var(--speed-200);
|
|
115
117
|
border-radius: 50%;
|
|
116
118
|
display: flex;
|
|
117
119
|
align-items: center;
|
|
@@ -123,6 +125,7 @@ class n extends HTMLElement {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
input:checked + .track .thumb {
|
|
128
|
+
background-color: var(--switch-thumb-bg-checked, var(--switch-thumb-bg));
|
|
126
129
|
transform: translateX(
|
|
127
130
|
calc(
|
|
128
131
|
var(--switch-width-computed, var(--switch-width)) -
|
|
@@ -134,13 +137,13 @@ class n extends HTMLElement {
|
|
|
134
137
|
|
|
135
138
|
:host([size="x-small"]) {
|
|
136
139
|
--switch-offset-computed: var(--stroke-size-100);
|
|
137
|
-
--switch-thumb-size-computed: calc(var(--action-
|
|
140
|
+
--switch-thumb-size-computed: calc(var(--action-size-x-small) - var(--space-200));
|
|
138
141
|
--switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
|
|
139
142
|
--switch-width-computed: calc(var(--switch-height-computed) * 1.6);
|
|
140
143
|
}
|
|
141
144
|
:host([size="small"]) {
|
|
142
145
|
--switch-offset-computed: var(--stroke-size-100);
|
|
143
|
-
--switch-thumb-size-computed: calc(var(--action-
|
|
146
|
+
--switch-thumb-size-computed: calc(var(--action-size-small) - var(--space-200));
|
|
144
147
|
--switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
|
|
145
148
|
--switch-width-computed: calc(var(--switch-height-computed) * 1.6);
|
|
146
149
|
}
|
|
@@ -162,6 +165,11 @@ class n extends HTMLElement {
|
|
|
162
165
|
fill: var(--switch-icon);
|
|
163
166
|
}
|
|
164
167
|
|
|
168
|
+
:host([checked]) ::slotted([slot="on-icon"]),
|
|
169
|
+
:host([checked]) ::slotted([slot="off-icon"]) {
|
|
170
|
+
fill: var(--switch-icon-checked, var(--switch-icon));
|
|
171
|
+
}
|
|
172
|
+
|
|
165
173
|
:host([disabled]) {
|
|
166
174
|
cursor: not-allowed;
|
|
167
175
|
}
|
|
@@ -186,7 +194,7 @@ class n extends HTMLElement {
|
|
|
186
194
|
</span>
|
|
187
195
|
</span>
|
|
188
196
|
</label>
|
|
189
|
-
`, this.setAttribute("size",
|
|
197
|
+
`, this.setAttribute("size", c);
|
|
190
198
|
}
|
|
191
199
|
}
|
|
192
|
-
customElements.get("mui-switch") || customElements.define("mui-switch",
|
|
200
|
+
customElements.get("mui-switch") || customElements.define("mui-switch", d);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
class
|
|
1
|
+
class a extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
|
-
super(), this.handleTabChange = this.handleTabChange.bind(this);
|
|
3
|
+
super(), this.handleTabChange = this.handleTabChange.bind(this), this.attachShadow({ mode: "open" });
|
|
4
4
|
}
|
|
5
5
|
connectedCallback() {
|
|
6
|
-
this.addEventListener("tab-change", this.handleTabChange), requestAnimationFrame(() => this.initializePanels());
|
|
6
|
+
this.render(), this.addEventListener("tab-change", this.handleTabChange), requestAnimationFrame(() => this.initializePanels());
|
|
7
7
|
}
|
|
8
8
|
disconnectedCallback() {
|
|
9
9
|
this.removeEventListener("tab-change", this.handleTabChange);
|
|
@@ -22,9 +22,20 @@ class s extends HTMLElement {
|
|
|
22
22
|
if (!e.length) return;
|
|
23
23
|
let n = e.find((t) => t.getAttribute("item") === i) || null;
|
|
24
24
|
n || (n = e[0]), e.forEach((t) => {
|
|
25
|
-
const
|
|
26
|
-
t.toggleAttribute("hidden", !
|
|
25
|
+
const s = t === n;
|
|
26
|
+
t.toggleAttribute("hidden", !s), t.setAttribute("aria-hidden", String(!s)), t.style.display = s ? "" : "none";
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
render() {
|
|
30
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
31
|
+
`
|
|
32
|
+
<style>
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
<slot></slot>
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
29
40
|
}
|
|
30
|
-
customElements.get("mui-tab-controller") || customElements.define("mui-tab-controller",
|
|
41
|
+
customElements.get("mui-tab-controller") || customElements.define("mui-tab-controller", a);
|
|
@@ -5,7 +5,7 @@ class i extends HTMLElement {
|
|
|
5
5
|
}
|
|
6
6
|
getBadgeSizeFromTabSize() {
|
|
7
7
|
const t = this.getAttribute("size") || "medium";
|
|
8
|
-
return t === "x-small" ? "
|
|
8
|
+
return t === "x-small" ? "xx-small" : t === "small" ? "x-small" : t === "large" ? "large" : "medium";
|
|
9
9
|
}
|
|
10
10
|
hasAssignedContent(t) {
|
|
11
11
|
return t ? t.assignedNodes({ flatten: !0 }).some(
|
|
@@ -55,7 +55,7 @@ class i extends HTMLElement {
|
|
|
55
55
|
background: transparent;
|
|
56
56
|
white-space: nowrap;
|
|
57
57
|
cursor: pointer;
|
|
58
|
-
min-height: var(--
|
|
58
|
+
min-height: var(--tab-item-size-medium, var(--action-size-medium));
|
|
59
59
|
box-sizing: border-box;
|
|
60
60
|
border-radius: calc(var(--tab-radius) - 0.2rem);
|
|
61
61
|
}
|
|
@@ -140,12 +140,24 @@ class i extends HTMLElement {
|
|
|
140
140
|
margin-left: var(--tab-badge-offset-large);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
:host ::slotted(mui-badge[variant="neutral"]:not([color])[slot="before"]),
|
|
144
|
+
:host ::slotted(mui-badge[variant="neutral"]:not([color])[slot="after"]) {
|
|
145
|
+
--badge-background: var(--tab-text-color);
|
|
146
|
+
--badge-text-color: var(--tab-background);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host([active]) ::slotted(mui-badge[variant="neutral"]:not([color])[slot="before"]),
|
|
150
|
+
:host([active]) ::slotted(mui-badge[variant="neutral"]:not([color])[slot="after"]) {
|
|
151
|
+
--badge-background: var(--tab-text-color-active);
|
|
152
|
+
--badge-text-color: var(--tab-background-active);
|
|
153
|
+
}
|
|
154
|
+
|
|
143
155
|
:host([size="x-small"]) {
|
|
144
156
|
font-size: var(--text-font-size-xs);
|
|
145
157
|
line-height: var(--text-line-height-xs);
|
|
146
158
|
font-weight: var(--font-weight-semi-bold);
|
|
147
159
|
padding: var(--action-padding-x-small);
|
|
148
|
-
min-height: var(--
|
|
160
|
+
min-height: var(--tab-item-size-x-small, var(--action-size-x-small));
|
|
149
161
|
}
|
|
150
162
|
|
|
151
163
|
:host([size="x-small"][has-after]) {
|
|
@@ -169,7 +181,7 @@ class i extends HTMLElement {
|
|
|
169
181
|
font-size: var(--text-font-size-s);
|
|
170
182
|
line-height: var(--text-line-height-s);
|
|
171
183
|
padding: var(--action-padding-small);
|
|
172
|
-
min-height: var(--
|
|
184
|
+
min-height: var(--tab-item-size-small, var(--action-size-small));
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
:host([size="small"][has-after]) {
|
|
@@ -193,7 +205,7 @@ class i extends HTMLElement {
|
|
|
193
205
|
font-size: var(--text-font-size-l);
|
|
194
206
|
line-height: var(--text-line-height-l);
|
|
195
207
|
padding: var(--action-padding-large);
|
|
196
|
-
min-height: var(--
|
|
208
|
+
min-height: var(--tab-item-size-large, var(--action-size-large));
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
:host([size="large"][has-after]) {
|