@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.
- package/AGENTS.md +67 -0
- package/DESIGN.md +358 -0
- package/README.md +53 -2
- package/dist/esm/agent/keywords/index.js +2 -173
- package/dist/esm/agent/prompts/index.js +6 -432
- package/dist/esm/components/mui-accordion/core/index.js +25 -17
- package/dist/esm/components/mui-addon/index.js +14 -14
- package/dist/esm/components/mui-avatar/index.js +103 -43
- 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 +37 -20
- package/dist/esm/components/mui-body/index.js +20 -11
- package/dist/esm/components/mui-button/index.js +265 -78
- package/dist/esm/components/mui-calendar/index.js +199 -0
- package/dist/esm/components/mui-card/body/index.js +33 -18
- 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 +219 -73
- package/dist/esm/components/mui-chip-input/index.js +146 -137
- package/dist/esm/components/mui-chip-rail/index.js +342 -0
- package/dist/esm/components/mui-code/index.js +26 -7
- 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 +255 -59
- package/dist/esm/components/mui-field/index.js +1 -1
- package/dist/esm/components/mui-file-upload/index.js +14 -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-heading/index.js +3 -2
- 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 +96 -67
- package/dist/esm/components/mui-link/index.js +352 -96
- package/dist/esm/components/mui-media-player/index.js +1577 -83
- package/dist/esm/components/mui-message/index.js +7 -6
- 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 +143 -115
- 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 +235 -46
- 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-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 +37 -26
- 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-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-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 +205 -0
- package/dist/esm/css/mui-brand.css +12 -8
- package/dist/esm/css/mui-tokens.css +646 -344
- package/dist/esm/css/readme.md +2 -2
- package/dist/esm/custom-elements.json +4506 -1707
- package/dist/esm/dynamic-attrs.json +271 -54
- package/dist/esm/index.js +33 -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 +6 -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/api.d.ts +4 -0
- package/dist/types/components/mui-chip-input/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 +4 -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-link/api.d.ts +4 -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-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-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/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 +27 -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 +131 -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
|
@@ -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
|
}
|
|
@@ -11,26 +11,29 @@ class n extends HTMLElement {
|
|
|
11
11
|
static get observedAttributes() {
|
|
12
12
|
return ["label", "disabled", "checked", "size"];
|
|
13
13
|
}
|
|
14
|
-
attributeChangedCallback(
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
this._checkbox && (this._checkbox.disabled =
|
|
14
|
+
attributeChangedCallback(e, t, c) {
|
|
15
|
+
if (e === "checked" && t !== c && (this._checked = c !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), e === "disabled" && t !== c) {
|
|
16
|
+
const s = c !== null;
|
|
17
|
+
this._checkbox && (this._checkbox.disabled = s, this._checkbox.setAttribute("aria-disabled", s.toString())), this._updateDisabledState();
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
e === "size" && t !== c && this._enforceIconSize();
|
|
20
20
|
}
|
|
21
21
|
get checked() {
|
|
22
22
|
return this._checked;
|
|
23
23
|
}
|
|
24
|
-
set checked(
|
|
25
|
-
const t = !!
|
|
24
|
+
set checked(e) {
|
|
25
|
+
const t = !!e;
|
|
26
26
|
this._checked !== t && (this._checked = t, t ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checkbox && (this._checkbox.checked = this._checked, this._checkbox.setAttribute("aria-checked", this._checked.toString()), this._updateIcons()));
|
|
27
27
|
}
|
|
28
|
+
focus(e) {
|
|
29
|
+
this._checkbox ? this._checkbox.focus(e) : super.focus(e);
|
|
30
|
+
}
|
|
28
31
|
_cleanupListeners() {
|
|
29
32
|
this._checkbox && this._changeHandler && this._checkbox.removeEventListener("change", this._changeHandler);
|
|
30
33
|
}
|
|
31
34
|
_updateDisabledState() {
|
|
32
|
-
var t,
|
|
33
|
-
this.hasAttribute("disabled") ? ((t = this._checkbox) == null || t.setAttribute("aria-disabled", "true"), (
|
|
35
|
+
var t, c, s, i;
|
|
36
|
+
this.hasAttribute("disabled") ? ((t = this._checkbox) == null || t.setAttribute("aria-disabled", "true"), (c = this._checkbox) == null || c.setAttribute("tabindex", "-1")) : ((s = this._checkbox) == null || s.removeAttribute("aria-disabled"), (i = this._checkbox) == null || i.removeAttribute("tabindex"));
|
|
34
37
|
}
|
|
35
38
|
_setupListener() {
|
|
36
39
|
this._checkbox && (this._cleanupListeners(), this._changeHandler = () => {
|
|
@@ -44,32 +47,32 @@ class n extends HTMLElement {
|
|
|
44
47
|
}, this._checkbox.addEventListener("change", this._changeHandler));
|
|
45
48
|
}
|
|
46
49
|
_enforceIconSize() {
|
|
47
|
-
const
|
|
50
|
+
const e = this.shadowRoot.querySelector('slot[name="on-icon"]'), t = this.shadowRoot.querySelector('slot[name="off-icon"]'), c = this.getAttribute("size") || "large", i = {
|
|
48
51
|
"x-small": "xx-small",
|
|
49
52
|
small: "xx-small",
|
|
50
53
|
medium: "x-small",
|
|
51
54
|
large: "x-small"
|
|
52
|
-
}[
|
|
55
|
+
}[c] || "x-small", o = (h) => {
|
|
53
56
|
if (!h) return;
|
|
54
57
|
const a = () => {
|
|
55
58
|
h.assignedElements().forEach((r) => {
|
|
56
|
-
r.tagName.toLowerCase().startsWith("mui-icon") && r.setAttribute("size",
|
|
59
|
+
r.tagName.toLowerCase().startsWith("mui-icon") && r.setAttribute("size", i);
|
|
57
60
|
});
|
|
58
61
|
};
|
|
59
62
|
h.addEventListener("slotchange", a), setTimeout(a, 0);
|
|
60
63
|
};
|
|
61
|
-
o(
|
|
64
|
+
o(e), o(t);
|
|
62
65
|
}
|
|
63
66
|
_updateIcons() {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}), t && t.assignedElements().forEach((
|
|
68
|
-
|
|
67
|
+
const e = this.shadowRoot.querySelector('slot[name="on-icon"]'), t = this.shadowRoot.querySelector('slot[name="off-icon"]');
|
|
68
|
+
e && e.assignedElements().forEach((c) => {
|
|
69
|
+
c.style.display = this._checked ? "inline" : "none";
|
|
70
|
+
}), t && t.assignedElements().forEach((c) => {
|
|
71
|
+
c.style.display = this._checked ? "none" : "inline";
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
74
|
render() {
|
|
72
|
-
const
|
|
75
|
+
const e = this.getAttribute("label"), t = this.getAttribute("size") || "large", s = ["x-small", "small", "medium", "large"].includes(t) ? t : "large";
|
|
73
76
|
this.shadowRoot.innerHTML = /*html*/
|
|
74
77
|
`
|
|
75
78
|
<style>
|
|
@@ -111,7 +114,9 @@ class n extends HTMLElement {
|
|
|
111
114
|
width: var(--switch-thumb-size-computed, var(--switch-thumb-size));
|
|
112
115
|
height: var(--switch-thumb-size-computed, var(--switch-thumb-size));
|
|
113
116
|
background-color: var(--switch-thumb-bg);
|
|
114
|
-
transition:
|
|
117
|
+
transition:
|
|
118
|
+
background-color var(--speed-200),
|
|
119
|
+
transform var(--speed-200);
|
|
115
120
|
border-radius: 50%;
|
|
116
121
|
display: flex;
|
|
117
122
|
align-items: center;
|
|
@@ -123,6 +128,7 @@ class n extends HTMLElement {
|
|
|
123
128
|
}
|
|
124
129
|
|
|
125
130
|
input:checked + .track .thumb {
|
|
131
|
+
background-color: var(--switch-thumb-bg-checked, var(--switch-thumb-bg));
|
|
126
132
|
transform: translateX(
|
|
127
133
|
calc(
|
|
128
134
|
var(--switch-width-computed, var(--switch-width)) -
|
|
@@ -134,13 +140,13 @@ class n extends HTMLElement {
|
|
|
134
140
|
|
|
135
141
|
:host([size="x-small"]) {
|
|
136
142
|
--switch-offset-computed: var(--stroke-size-100);
|
|
137
|
-
--switch-thumb-size-computed: calc(var(--action-
|
|
143
|
+
--switch-thumb-size-computed: calc(var(--action-size-x-small) - var(--space-200));
|
|
138
144
|
--switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
|
|
139
145
|
--switch-width-computed: calc(var(--switch-height-computed) * 1.6);
|
|
140
146
|
}
|
|
141
147
|
:host([size="small"]) {
|
|
142
148
|
--switch-offset-computed: var(--stroke-size-100);
|
|
143
|
-
--switch-thumb-size-computed: calc(var(--action-
|
|
149
|
+
--switch-thumb-size-computed: calc(var(--action-size-small) - var(--space-200));
|
|
144
150
|
--switch-height-computed: calc(var(--switch-thumb-size-computed) + (var(--switch-offset-computed) * 2));
|
|
145
151
|
--switch-width-computed: calc(var(--switch-height-computed) * 1.6);
|
|
146
152
|
}
|
|
@@ -162,6 +168,11 @@ class n extends HTMLElement {
|
|
|
162
168
|
fill: var(--switch-icon);
|
|
163
169
|
}
|
|
164
170
|
|
|
171
|
+
:host([checked]) ::slotted([slot="on-icon"]),
|
|
172
|
+
:host([checked]) ::slotted([slot="off-icon"]) {
|
|
173
|
+
fill: var(--switch-icon-checked, var(--switch-icon));
|
|
174
|
+
}
|
|
175
|
+
|
|
165
176
|
:host([disabled]) {
|
|
166
177
|
cursor: not-allowed;
|
|
167
178
|
}
|
|
@@ -177,7 +188,7 @@ class n extends HTMLElement {
|
|
|
177
188
|
type="checkbox"
|
|
178
189
|
role="switch"
|
|
179
190
|
aria-checked="${this._checked}"
|
|
180
|
-
${
|
|
191
|
+
${e ? `aria-label="${e}"` : ""}
|
|
181
192
|
>
|
|
182
193
|
<span class="track">
|
|
183
194
|
<span class="thumb">
|
|
@@ -186,7 +197,7 @@ class n extends HTMLElement {
|
|
|
186
197
|
</span>
|
|
187
198
|
</span>
|
|
188
199
|
</label>
|
|
189
|
-
`, this.setAttribute("size",
|
|
200
|
+
`, this.setAttribute("size", s);
|
|
190
201
|
}
|
|
191
202
|
}
|
|
192
|
-
customElements.get("mui-switch") || customElements.define("mui-switch",
|
|
203
|
+
customElements.get("mui-switch") || customElements.define("mui-switch", d);
|
|
@@ -45,16 +45,12 @@ class a extends HTMLElement {
|
|
|
45
45
|
(i) => i.tagName.toLowerCase() === "mui-cell"
|
|
46
46
|
), r = o[o.length - 1];
|
|
47
47
|
if (!r) return;
|
|
48
|
-
const s = o.some(
|
|
49
|
-
(i) => i.hasAttribute("action")
|
|
50
|
-
);
|
|
48
|
+
const s = o.some((i) => i.hasAttribute("action"));
|
|
51
49
|
if (!e || s) {
|
|
52
50
|
this.clearActionPlaceholderStyles(r);
|
|
53
51
|
return;
|
|
54
52
|
}
|
|
55
|
-
const n = Array.from(r.children).some(
|
|
56
|
-
(i) => i.nodeType === Node.ELEMENT_NODE
|
|
57
|
-
), l = (r.textContent || "").trim();
|
|
53
|
+
const n = Array.from(r.children).some((i) => i.nodeType === Node.ELEMENT_NODE), l = (r.textContent || "").trim();
|
|
58
54
|
if (!(!n && l.length === 0)) {
|
|
59
55
|
this.clearActionPlaceholderStyles(r);
|
|
60
56
|
return;
|