@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
|
@@ -42,7 +42,7 @@ const f = ["neutral", "positive", "info", "warning", "attention"], h = {
|
|
|
42
42
|
warning: "mui-icon-warning",
|
|
43
43
|
attention: "mui-icon-attention"
|
|
44
44
|
};
|
|
45
|
-
class
|
|
45
|
+
class y extends HTMLElement {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(), this.contentSlotListener = null, this.attachShadow({ mode: "open" });
|
|
48
48
|
}
|
|
@@ -77,7 +77,7 @@ class C extends HTMLElement {
|
|
|
77
77
|
this.contentSlotListener = n, t.addEventListener("slotchange", this.contentSlotListener), requestAnimationFrame(n);
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
const e = this.getAttribute("variant") || "neutral", t = f.includes(e) ? e : "neutral", n = this.getMessageSize(), i = this.getAttribute("heading") || "Heading...", r = this.getAttribute("icon") || z[t], o = S[t], a = w[t], c = h[t], l = p[t], d = k[t], g = n === "large" ? "var(--message-gap-horizontal)" : n === "medium" ? "var(--space-200)" : "var(--space-100)", u = n === "large" ? "var(--message-gap-vertical)" : n === "medium" ? "var(--space-100)" : "var(--space-050)", v = n === "large" ? "var(--font-size-200)" : "var(--font-size-100)",
|
|
80
|
+
const e = this.getAttribute("variant") || "neutral", t = f.includes(e) ? e : "neutral", n = this.getMessageSize(), i = this.getAttribute("heading") || "Heading...", r = this.getAttribute("icon") || z[t], o = S[t], a = w[t], c = h[t], l = p[t], d = k[t], g = n === "large" ? "var(--message-gap-horizontal)" : n === "medium" ? "var(--space-200)" : "var(--space-100)", u = n === "large" ? "var(--message-gap-vertical)" : n === "medium" ? "var(--space-100)" : "var(--space-050)", v = n === "large" ? "var(--font-size-200)" : "var(--font-size-100)", m = n === "large" ? "medium" : "small", b = (
|
|
81
81
|
/*css*/
|
|
82
82
|
`
|
|
83
83
|
:host {
|
|
@@ -98,7 +98,8 @@ class C extends HTMLElement {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.heading {
|
|
101
|
-
font-
|
|
101
|
+
font-family: var(--heading-font-family);
|
|
102
|
+
font-weight: var(--heading-font-weight);
|
|
102
103
|
font-size: ${v};
|
|
103
104
|
${a}
|
|
104
105
|
}
|
|
@@ -106,12 +107,12 @@ class C extends HTMLElement {
|
|
|
106
107
|
);
|
|
107
108
|
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
108
109
|
`
|
|
109
|
-
<style>${
|
|
110
|
+
<style>${b}</style>
|
|
110
111
|
|
|
111
112
|
<section aria-labelledby="message-heading" aria-live="${l}" role="${d}">
|
|
112
113
|
<mui-h-stack space="${g}">
|
|
113
114
|
<div class="icon">
|
|
114
|
-
<${r} size="${
|
|
115
|
+
<${r} size="${m}" color="var(${o})"></${r}>
|
|
115
116
|
</div>
|
|
116
117
|
<mui-v-stack space="${u}">
|
|
117
118
|
<div class="heading" id="message-heading">${i}</div>
|
|
@@ -122,4 +123,4 @@ class C extends HTMLElement {
|
|
|
122
123
|
`, this.setupContentSlot(n));
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
customElements.get("mui-message") || customElements.define("mui-message",
|
|
126
|
+
customElements.get("mui-message") || customElements.define("mui-message", y);
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
const a = class a extends HTMLElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super(), this.supportsNativeModel = !1, this.scriptLoaded = !1, this.isModelLoading = !0, this.loadError = !1, this.attachShadow({ mode: "open" }), this.supportsNativeModel = typeof window < "u" && "HTMLModelElement" in window;
|
|
4
|
+
}
|
|
5
|
+
static get observedAttributes() {
|
|
6
|
+
return [
|
|
7
|
+
"src",
|
|
8
|
+
"ios-src",
|
|
9
|
+
"poster",
|
|
10
|
+
"alt",
|
|
11
|
+
"controls",
|
|
12
|
+
"camera-controls",
|
|
13
|
+
"auto-rotate",
|
|
14
|
+
"ar",
|
|
15
|
+
"loading"
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
static loadModelViewerScript() {
|
|
19
|
+
return this.loadScriptPromise ? this.loadScriptPromise : (this.loadScriptPromise = new Promise((e, r) => {
|
|
20
|
+
if (customElements.get("model-viewer")) {
|
|
21
|
+
e();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const t = document.querySelector('script[src*="model-viewer"]');
|
|
25
|
+
if (t) {
|
|
26
|
+
t.addEventListener("load", () => e()), t.addEventListener("error", (i) => r(i));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const o = document.createElement("script");
|
|
30
|
+
o.type = "module", o.src = "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js", o.onload = () => e(), o.onerror = (i) => r(i), document.head.appendChild(o);
|
|
31
|
+
}), this.loadScriptPromise);
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
this.render(), this.supportsNativeModel ? this.bindViewerEvents() : a.loadModelViewerScript().then(() => {
|
|
35
|
+
this.scriptLoaded = !0, this.render(), this.bindViewerEvents();
|
|
36
|
+
}).catch((e) => {
|
|
37
|
+
console.error("Failed to load <model-viewer> library", e), this.loadError = !0, this.isModelLoading = !1, this.render();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
}
|
|
42
|
+
attributeChangedCallback(e, r, t) {
|
|
43
|
+
r !== t && (this.render(), (this.scriptLoaded || this.supportsNativeModel) && this.bindViewerEvents());
|
|
44
|
+
}
|
|
45
|
+
bindViewerEvents() {
|
|
46
|
+
const e = this.shadowRoot;
|
|
47
|
+
if (!e) return;
|
|
48
|
+
const r = e.querySelector("model-viewer") || e.querySelector("model");
|
|
49
|
+
r && (r.addEventListener("load", () => {
|
|
50
|
+
this.isModelLoading = !1, this.loadError = !1, this.updateLoadingState();
|
|
51
|
+
}), r.addEventListener("error", () => {
|
|
52
|
+
this.isModelLoading = !1, this.loadError = !0, this.updateLoadingState();
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
updateLoadingState() {
|
|
56
|
+
const e = this.shadowRoot;
|
|
57
|
+
if (!e) return;
|
|
58
|
+
const r = e.querySelector(".loading-overlay");
|
|
59
|
+
r && (this.isModelLoading ? r.classList.remove("hidden") : r.classList.add("hidden"));
|
|
60
|
+
const t = e.querySelector(".error-message");
|
|
61
|
+
t && (this.loadError ? t.classList.remove("hidden") : t.classList.add("hidden"));
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
if (!this.shadowRoot) return;
|
|
65
|
+
const e = this.getAttribute("src") || "", r = this.getAttribute("ios-src") || "", t = this.getAttribute("poster") || "", o = this.getAttribute("alt") || "3D model", i = this.hasAttribute("controls") || this.hasAttribute("camera-controls"), l = this.hasAttribute("auto-rotate"), n = this.hasAttribute("ar"), c = this.getAttribute("loading") || "lazy", u = this.style.getPropertyValue("--mui-model-viewer-background") || "var(--surface-elevated-200, #f5f5f7)", m = this.style.getPropertyValue("--mui-model-viewer-radius") || "var(--radius-300, 1.2rem)", h = this.style.getPropertyValue("--mui-model-viewer-aspect-ratio") || "16/9", p = (
|
|
66
|
+
/*css*/
|
|
67
|
+
`
|
|
68
|
+
:host {
|
|
69
|
+
display: block;
|
|
70
|
+
width: 100%;
|
|
71
|
+
--mui-model-viewer-background: ${u};
|
|
72
|
+
--mui-model-viewer-radius: ${m};
|
|
73
|
+
--mui-model-viewer-aspect-ratio: ${h};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.container {
|
|
77
|
+
position: relative;
|
|
78
|
+
background: var(--mui-model-viewer-background);
|
|
79
|
+
border-radius: var(--mui-model-viewer-radius);
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
aspect-ratio: var(--mui-model-viewer-aspect-ratio);
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
box-shadow: var(--shadow-300, 0 4px 12px rgba(0, 0, 0, 0.08));
|
|
86
|
+
border: var(--stroke-size-100, 1px) solid var(--border-color, rgba(0, 0, 0, 0.1));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
model-viewer, model, .fallback-poster {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fallback-poster {
|
|
96
|
+
background-size: cover;
|
|
97
|
+
background-position: center;
|
|
98
|
+
background-repeat: no-repeat;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Premium Glassmorphic Loading Overlay */
|
|
102
|
+
.loading-overlay {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 0;
|
|
105
|
+
background: rgba(255, 255, 255, 0.4);
|
|
106
|
+
backdrop-filter: blur(8px);
|
|
107
|
+
-webkit-backdrop-filter: blur(8px);
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
113
|
+
z-index: 10;
|
|
114
|
+
gap: var(--space-300, 1.2rem);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host([data-theme="dark"]) .loading-overlay {
|
|
118
|
+
background: rgba(0, 0, 0, 0.4);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.loading-overlay.hidden {
|
|
122
|
+
opacity: 0;
|
|
123
|
+
visibility: hidden;
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Premium micro-animated spinner */
|
|
128
|
+
.spinner {
|
|
129
|
+
width: 2.8rem;
|
|
130
|
+
height: 2.8rem;
|
|
131
|
+
border: 3px solid var(--border-color, rgba(0, 0, 0, 0.1));
|
|
132
|
+
border-top-color: var(--action-primary-background, #0071e3);
|
|
133
|
+
border-radius: 50%;
|
|
134
|
+
animation: spin 0.8s linear infinite;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes spin {
|
|
138
|
+
to { transform: rotate(360deg); }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.error-message {
|
|
142
|
+
position: absolute;
|
|
143
|
+
background: var(--feedback-error-background, rgba(255, 235, 235, 0.9));
|
|
144
|
+
border: var(--stroke-size-100, 1px) solid var(--feedback-error-border-color, #ff453a);
|
|
145
|
+
color: var(--text-color-error, #ff453a);
|
|
146
|
+
padding: var(--space-300, 1.2rem) var(--space-400, 1.6rem);
|
|
147
|
+
border-radius: var(--radius-200, 0.8rem);
|
|
148
|
+
font-family: var(--font-family, system-ui, sans-serif);
|
|
149
|
+
font-size: var(--text-font-size-xs, 1.2rem);
|
|
150
|
+
z-index: 20;
|
|
151
|
+
text-align: center;
|
|
152
|
+
max-width: 80%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.error-message.hidden {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* AR trigger quick-look style overlay on iOS when fallback is preferred */
|
|
160
|
+
.ar-button {
|
|
161
|
+
position: absolute;
|
|
162
|
+
bottom: var(--space-400, 1.6rem);
|
|
163
|
+
right: var(--space-400, 1.6rem);
|
|
164
|
+
background: var(--surface-elevated-100, #ffffff);
|
|
165
|
+
color: var(--text-color, #1d1d1f);
|
|
166
|
+
border: var(--stroke-size-100, 1px) solid var(--border-color, rgba(0, 0, 0, 0.15));
|
|
167
|
+
padding: var(--space-200, 0.8rem) var(--space-300, 1.2rem);
|
|
168
|
+
border-radius: var(--radius-pill, 9999px);
|
|
169
|
+
font-family: var(--font-family, system-ui, sans-serif);
|
|
170
|
+
font-size: var(--text-font-size-xs, 1.2rem);
|
|
171
|
+
font-weight: var(--font-weight-medium, 500);
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: var(--space-100, 0.6rem);
|
|
176
|
+
box-shadow: var(--shadow-200, 0 2px 8px rgba(0, 0, 0, 0.1));
|
|
177
|
+
z-index: 5;
|
|
178
|
+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease;
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ar-button:hover {
|
|
183
|
+
transform: scale(1.04);
|
|
184
|
+
background: var(--surface-elevated-200, #f5f5f7);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ar-icon {
|
|
188
|
+
width: 1.6rem;
|
|
189
|
+
height: 1.6rem;
|
|
190
|
+
fill: currentColor;
|
|
191
|
+
}
|
|
192
|
+
`
|
|
193
|
+
);
|
|
194
|
+
let s = "";
|
|
195
|
+
this.supportsNativeModel ? s = /*html*/
|
|
196
|
+
`
|
|
197
|
+
<model
|
|
198
|
+
src="${r || e}"
|
|
199
|
+
alt="${o}"
|
|
200
|
+
${i ? "interactive" : ""}
|
|
201
|
+
></model>
|
|
202
|
+
` : this.scriptLoaded ? s = /*html*/
|
|
203
|
+
`
|
|
204
|
+
<model-viewer
|
|
205
|
+
src="${e}"
|
|
206
|
+
ios-src="${r}"
|
|
207
|
+
poster="${t}"
|
|
208
|
+
alt="${o}"
|
|
209
|
+
loading="${c}"
|
|
210
|
+
${i ? "camera-controls" : ""}
|
|
211
|
+
${l ? "auto-rotate" : ""}
|
|
212
|
+
${n ? "ar" : ""}
|
|
213
|
+
>
|
|
214
|
+
<slot name="poster"></slot>
|
|
215
|
+
<slot></slot>
|
|
216
|
+
</model-viewer>
|
|
217
|
+
` : s = /*html*/
|
|
218
|
+
`
|
|
219
|
+
<div class="fallback-poster" style="background-image: url('${t}');" aria-label="${o}">
|
|
220
|
+
<slot></slot>
|
|
221
|
+
</div>
|
|
222
|
+
`;
|
|
223
|
+
const v = n && r && /iPad|iPhone|iPod/.test(navigator.userAgent) && !this.supportsNativeModel ? (
|
|
224
|
+
/*html*/
|
|
225
|
+
`
|
|
226
|
+
<a class="ar-button" rel="ar" href="${r}">
|
|
227
|
+
<svg class="ar-icon" viewBox="0 0 24 24">
|
|
228
|
+
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
|
229
|
+
</svg>
|
|
230
|
+
View in AR
|
|
231
|
+
</a>
|
|
232
|
+
`
|
|
233
|
+
) : "";
|
|
234
|
+
this.shadowRoot.innerHTML = /*html*/
|
|
235
|
+
`
|
|
236
|
+
<style>${p}</style>
|
|
237
|
+
<div class="container">
|
|
238
|
+
${s}
|
|
239
|
+
${v}
|
|
240
|
+
|
|
241
|
+
<div class="loading-overlay ${this.isModelLoading ? "" : "hidden"}">
|
|
242
|
+
<div class="spinner"></div>
|
|
243
|
+
<slot name="loading-text"></slot>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<div class="error-message ${this.loadError ? "" : "hidden"}">
|
|
247
|
+
Failed to load 3D model scene. Please check the source URL or CORS configuration.
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
`, this.updateLoadingState();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
a.loadScriptPromise = null;
|
|
254
|
+
let d = a;
|
|
255
|
+
customElements.get("mui-model-viewer") || customElements.define("mui-model-viewer", d);
|
|
256
|
+
export {
|
|
257
|
+
d as MuiModelViewer
|
|
258
|
+
};
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import "../mui-icons/checkmark/index.js";
|
|
2
|
+
class E extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(), this.tooltipOpen = !1, this.boundReposition = () => this.positionTooltip(), this.boundDocPointer = (t) => {
|
|
5
|
+
t.composedPath().includes(this) || this.closeTooltip(!0);
|
|
6
|
+
}, this.attachShadow({ mode: "open" });
|
|
7
|
+
}
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return [
|
|
10
|
+
"progress",
|
|
11
|
+
"value",
|
|
12
|
+
"max",
|
|
13
|
+
"label",
|
|
14
|
+
"size",
|
|
15
|
+
"display",
|
|
16
|
+
"display-value",
|
|
17
|
+
"color",
|
|
18
|
+
"tooltip",
|
|
19
|
+
"tooltip-trigger",
|
|
20
|
+
"tooltip-placement"
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
if (!this.hasAttribute("size")) {
|
|
25
|
+
this.setAttribute("size", "medium");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.render();
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
this.closeTooltip(!0);
|
|
32
|
+
}
|
|
33
|
+
attributeChangedCallback() {
|
|
34
|
+
this.render();
|
|
35
|
+
}
|
|
36
|
+
getProgress() {
|
|
37
|
+
const t = this.getAttribute("progress");
|
|
38
|
+
if (t !== null)
|
|
39
|
+
return Math.min(Math.max(Number(t) || 0, 0), 100);
|
|
40
|
+
const e = Number(this.getAttribute("value") || 0), r = Number(this.getAttribute("max") || 100);
|
|
41
|
+
return !Number.isFinite(r) || r <= 0 ? 0 : Math.min(Math.max(e / r * 100, 0), 100);
|
|
42
|
+
}
|
|
43
|
+
getDisplayContent(t, e) {
|
|
44
|
+
const r = this.getAttribute("display") || "auto", i = this.getAttribute("display-value"), o = this.getAttribute("value"), s = this.getAttribute("max");
|
|
45
|
+
if (r === "none") return { text: "", variant: "empty" };
|
|
46
|
+
if (i !== null) {
|
|
47
|
+
const c = i.trim();
|
|
48
|
+
return c ? { text: c, variant: "text" } : { text: "", variant: "empty" };
|
|
49
|
+
}
|
|
50
|
+
return r === "value" ? o !== null && s !== null ? this.getFractionContent(o, s, e) : { text: String(Math.round(t)), variant: "text" } : r === "fraction" && o !== null && s !== null ? this.getFractionContent(o, s, e) : r === "percent" ? { text: String(Math.round(t)), variant: "text" } : { text: "", variant: "empty" };
|
|
51
|
+
}
|
|
52
|
+
getFractionContent(t, e, r) {
|
|
53
|
+
const i = t.trim(), o = e.trim(), s = `${i}/${o}`, c = /^\d+$/.test(i) && /^\d+$/.test(o);
|
|
54
|
+
return s.length <= 3 ? { text: s, variant: "text" } : c && i.length <= 2 && o.length <= 2 && (r === "small" || r === "medium" || r === "large") ? { text: s, value: i, max: o, variant: "fraction" } : { text: "", variant: "empty" };
|
|
55
|
+
}
|
|
56
|
+
getTooltipText(t) {
|
|
57
|
+
var i;
|
|
58
|
+
if (this.hasAttribute("tooltip")) return ((i = this.getAttribute("tooltip")) == null ? void 0 : i.trim()) || "";
|
|
59
|
+
const e = this.getAttribute("value"), r = this.getAttribute("max");
|
|
60
|
+
return e !== null && r !== null ? `${e} of ${r}` : this.hasAttribute("progress") ? `${Math.round(t)}% complete` : "";
|
|
61
|
+
}
|
|
62
|
+
escapeHtml(t) {
|
|
63
|
+
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
64
|
+
}
|
|
65
|
+
getTooltipTrigger() {
|
|
66
|
+
return (this.getAttribute("tooltip-trigger") || "hover") === "click" ? "click" : "hover";
|
|
67
|
+
}
|
|
68
|
+
getTooltipPlacement() {
|
|
69
|
+
const t = this.getAttribute("tooltip-placement") || "top";
|
|
70
|
+
return ["top", "bottom", "left", "right"].includes(t) ? t : "top";
|
|
71
|
+
}
|
|
72
|
+
getIndicatorColor() {
|
|
73
|
+
const t = this.getAttribute("color"), e = {
|
|
74
|
+
positive: "var(--progress-bar-background-positive)",
|
|
75
|
+
warning: "var(--progress-bar-background-warning)",
|
|
76
|
+
attention: "var(--progress-bar-background-attention)"
|
|
77
|
+
};
|
|
78
|
+
return t && e[t] ? e[t] : "var(--progress-bar-background)";
|
|
79
|
+
}
|
|
80
|
+
hasTooltip() {
|
|
81
|
+
return !!this.getTooltipText(this.getProgress());
|
|
82
|
+
}
|
|
83
|
+
syncAria(t) {
|
|
84
|
+
const e = this.getAttribute("value"), r = this.getAttribute("max"), i = this.getAttribute("label");
|
|
85
|
+
this.setAttribute("role", "progressbar"), this.setAttribute("aria-valuemin", "0"), this.setAttribute("aria-valuemax", r || "100"), this.setAttribute("aria-valuenow", e || String(Math.round(t))), i && this.setAttribute("aria-label", i);
|
|
86
|
+
}
|
|
87
|
+
setupTooltipEvents() {
|
|
88
|
+
var r;
|
|
89
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".shell");
|
|
90
|
+
if (!t || !this.hasTooltip()) return;
|
|
91
|
+
const e = this.getTooltipTrigger();
|
|
92
|
+
e === "click" ? t.addEventListener("click", () => {
|
|
93
|
+
if (this.tooltipOpen) {
|
|
94
|
+
this.closeTooltip(!0);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.openTooltip();
|
|
98
|
+
}) : (t.addEventListener("mouseenter", () => this.openTooltip()), t.addEventListener("mouseleave", () => this.closeTooltip()), t.addEventListener("focusin", () => this.openTooltip()), t.addEventListener("focusout", () => this.closeTooltip(!0))), t.addEventListener("keydown", (i) => {
|
|
99
|
+
const o = i.key;
|
|
100
|
+
if (o === "Escape") {
|
|
101
|
+
this.closeTooltip(!0);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (e === "click" && (o === "Enter" || o === " ")) {
|
|
105
|
+
if (i.preventDefault(), this.tooltipOpen) {
|
|
106
|
+
this.closeTooltip(!0);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.openTooltip();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
openTooltip() {
|
|
114
|
+
var e;
|
|
115
|
+
if (!this.hasTooltip()) return;
|
|
116
|
+
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".tooltip");
|
|
117
|
+
t && (this.tooltipOpen = !0, t.classList.add("is-open"), requestAnimationFrame(() => this.positionTooltip()), window.addEventListener("resize", this.boundReposition), window.addEventListener("scroll", this.boundReposition, !0), document.addEventListener("pointerdown", this.boundDocPointer, !0));
|
|
118
|
+
}
|
|
119
|
+
closeTooltip(t = !1) {
|
|
120
|
+
var r;
|
|
121
|
+
this.tooltipOpen = !1;
|
|
122
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".tooltip");
|
|
123
|
+
e && (e.classList.toggle("is-immediate", t), e.classList.remove("is-open"), t && requestAnimationFrame(() => e.classList.remove("is-immediate"))), window.removeEventListener("resize", this.boundReposition), window.removeEventListener("scroll", this.boundReposition, !0), document.removeEventListener("pointerdown", this.boundDocPointer, !0);
|
|
124
|
+
}
|
|
125
|
+
positionTooltip() {
|
|
126
|
+
var g, m;
|
|
127
|
+
const t = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".shell"), e = (m = this.shadowRoot) == null ? void 0 : m.querySelector(".tooltip");
|
|
128
|
+
if (!t || !e || !this.tooltipOpen) return;
|
|
129
|
+
const r = this.getTooltipPlacement(), i = t.getBoundingClientRect(), o = e.getBoundingClientRect(), s = window.innerHeight, c = window.innerWidth, n = 8, a = 8, u = {
|
|
130
|
+
top: i.top - n,
|
|
131
|
+
bottom: s - i.bottom - n,
|
|
132
|
+
left: i.left - n,
|
|
133
|
+
right: c - i.right - n
|
|
134
|
+
}, b = {
|
|
135
|
+
top: o.height + a,
|
|
136
|
+
bottom: o.height + a,
|
|
137
|
+
left: o.width + a,
|
|
138
|
+
right: o.width + a
|
|
139
|
+
}, z = {
|
|
140
|
+
top: "bottom",
|
|
141
|
+
bottom: "top",
|
|
142
|
+
left: "right",
|
|
143
|
+
right: "left"
|
|
144
|
+
}, x = ["top", "bottom", "right", "left"];
|
|
145
|
+
let l = r;
|
|
146
|
+
const d = z[l];
|
|
147
|
+
u[l] < b[l] && (u[d] >= b[d] ? l = d : l = x.reduce(
|
|
148
|
+
(v, f) => u[f] > u[v] ? f : v,
|
|
149
|
+
l
|
|
150
|
+
));
|
|
151
|
+
let h = 0, p = 0;
|
|
152
|
+
l === "top" ? (h = i.top - o.height - a, p = i.left + i.width / 2 - o.width / 2) : l === "bottom" ? (h = i.bottom + a, p = i.left + i.width / 2 - o.width / 2) : l === "left" ? (h = i.top + i.height / 2 - o.height / 2, p = i.left - o.width - a) : (h = i.top + i.height / 2 - o.height / 2, p = i.right + a), h = Math.max(n, Math.min(h, s - o.height - n)), p = Math.max(n, Math.min(p, c - o.width - n)), e.setAttribute("data-placement", l), e.style.top = `${h}px`, e.style.left = `${p}px`;
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
var $;
|
|
156
|
+
this.closeTooltip(!0);
|
|
157
|
+
const t = this.getProgress(), e = this.getAttribute("size") || "medium", r = e !== "x-small", i = this.hasAttribute("display-value") && !!(($ = this.getAttribute("display-value")) != null && $.trim()), o = t >= 100, s = r && (!o || i) ? this.getDisplayContent(t, e) : { text: "", variant: "empty" }, c = o && !(r && i), n = e === "x-small" ? 6 : 5, a = 21 - n / 2, u = 2 * Math.PI * a, b = t / 100 * u, z = t > 0 && t < 100 ? n * 1.4 : 0, x = t >= 100 ? u : Math.max(0, Math.min(b, u - z)), l = u - x, d = t <= 0 ? "butt" : "round", h = {
|
|
158
|
+
"x-small": "var(--action-icon-only-size-x-small)",
|
|
159
|
+
small: "var(--action-icon-only-size-small)",
|
|
160
|
+
medium: "var(--action-icon-only-size-medium)",
|
|
161
|
+
large: "var(--action-icon-only-size-large)"
|
|
162
|
+
}, p = {
|
|
163
|
+
"x-small": {
|
|
164
|
+
fontSize: "calc(var(--text-font-size-s) * 0.8)",
|
|
165
|
+
lineHeight: "1"
|
|
166
|
+
},
|
|
167
|
+
small: {
|
|
168
|
+
fontSize: "calc(var(--text-font-size-s) * 0.9)",
|
|
169
|
+
lineHeight: "1"
|
|
170
|
+
},
|
|
171
|
+
medium: {
|
|
172
|
+
fontSize: "var(--text-font-size-s)",
|
|
173
|
+
lineHeight: "1"
|
|
174
|
+
},
|
|
175
|
+
large: {
|
|
176
|
+
fontSize: "var(--text-font-size-s)",
|
|
177
|
+
lineHeight: "1"
|
|
178
|
+
}
|
|
179
|
+
}, g = {
|
|
180
|
+
"x-small": {
|
|
181
|
+
fontSize: "0",
|
|
182
|
+
lineHeight: "1",
|
|
183
|
+
width: "0",
|
|
184
|
+
dividerMargin: "0"
|
|
185
|
+
},
|
|
186
|
+
small: {
|
|
187
|
+
fontSize: "var(--font-size-10)",
|
|
188
|
+
lineHeight: "1",
|
|
189
|
+
width: "1em",
|
|
190
|
+
dividerMargin: "var(--stroke-size-100)"
|
|
191
|
+
},
|
|
192
|
+
medium: {
|
|
193
|
+
fontSize: "var(--font-size-15)",
|
|
194
|
+
lineHeight: "1",
|
|
195
|
+
width: "1em",
|
|
196
|
+
dividerMargin: "var(--stroke-size-200)"
|
|
197
|
+
},
|
|
198
|
+
large: {
|
|
199
|
+
fontSize: "var(--font-size-50)",
|
|
200
|
+
lineHeight: "1",
|
|
201
|
+
width: "1.2em",
|
|
202
|
+
dividerMargin: "var(--stroke-size-200)"
|
|
203
|
+
}
|
|
204
|
+
}, m = {
|
|
205
|
+
"x-small": "xx-small",
|
|
206
|
+
small: "x-small",
|
|
207
|
+
medium: "small",
|
|
208
|
+
large: "medium"
|
|
209
|
+
}, v = h[e] || h.medium, f = p[e] || p.medium, w = g[e] || g.medium, M = m[e] || m.medium, T = this.getTooltipText(t), y = !!T, A = "progress-ring-tooltip", S = this.getTooltipTrigger(), C = this.getTooltipPlacement(), L = this.getIndicatorColor();
|
|
210
|
+
let k = this.escapeHtml(s.text);
|
|
211
|
+
c ? k = `<mui-icon-checkmark class="complete-icon" size="${M}" color="currentColor" aria-hidden="true"></mui-icon-checkmark>` : s.variant === "fraction" && (k = `<span class="fraction" aria-hidden="true"><span class="fraction__value">${this.escapeHtml(s.value)}</span><span class="fraction__divider"></span><span class="fraction__max">${this.escapeHtml(s.max)}</span></span>`), this.syncAria(t);
|
|
212
|
+
const H = (
|
|
213
|
+
/*css*/
|
|
214
|
+
`
|
|
215
|
+
:host {
|
|
216
|
+
display: inline-flex;
|
|
217
|
+
place-items: center;
|
|
218
|
+
inline-size: ${v};
|
|
219
|
+
block-size: ${v};
|
|
220
|
+
color: var(--text-color);
|
|
221
|
+
--progress-ring-fraction-font-size: ${w.fontSize};
|
|
222
|
+
--progress-ring-fraction-line-height: ${w.lineHeight};
|
|
223
|
+
--progress-ring-fraction-width: ${w.width};
|
|
224
|
+
--progress-ring-fraction-divider-margin: ${w.dividerMargin};
|
|
225
|
+
}
|
|
226
|
+
.ring {
|
|
227
|
+
inline-size: 100%;
|
|
228
|
+
block-size: 100%;
|
|
229
|
+
overflow: visible;
|
|
230
|
+
transform: rotate(-90deg);
|
|
231
|
+
}
|
|
232
|
+
.track,
|
|
233
|
+
.indicator {
|
|
234
|
+
fill: none;
|
|
235
|
+
stroke-width: ${n};
|
|
236
|
+
}
|
|
237
|
+
.track {
|
|
238
|
+
stroke: var(--progress-track-background);
|
|
239
|
+
}
|
|
240
|
+
.indicator {
|
|
241
|
+
stroke: ${L};
|
|
242
|
+
stroke-linecap: ${d};
|
|
243
|
+
stroke-dasharray: ${x} ${l};
|
|
244
|
+
stroke-dashoffset: 0;
|
|
245
|
+
transition: stroke-dasharray var(--speed-300) ease;
|
|
246
|
+
}
|
|
247
|
+
.content {
|
|
248
|
+
position: absolute;
|
|
249
|
+
inset: 0;
|
|
250
|
+
display: ${s.text || c ? "grid" : "none"};
|
|
251
|
+
place-items: center;
|
|
252
|
+
font-size: ${f.fontSize};
|
|
253
|
+
line-height: ${f.lineHeight};
|
|
254
|
+
font-weight: var(--font-weight-semi-bold);
|
|
255
|
+
text-align: center;
|
|
256
|
+
pointer-events: none;
|
|
257
|
+
max-inline-size: 64%;
|
|
258
|
+
margin: auto;
|
|
259
|
+
overflow: hidden;
|
|
260
|
+
text-overflow: ellipsis;
|
|
261
|
+
white-space: nowrap;
|
|
262
|
+
}
|
|
263
|
+
.fraction {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: minmax(0, 1fr);
|
|
266
|
+
grid-template-rows: auto auto auto;
|
|
267
|
+
align-items: center;
|
|
268
|
+
justify-content: center;
|
|
269
|
+
justify-items: center;
|
|
270
|
+
inline-size: min(var(--progress-ring-fraction-width), 100%);
|
|
271
|
+
line-height: var(--progress-ring-fraction-line-height);
|
|
272
|
+
font-size: var(--progress-ring-fraction-font-size);
|
|
273
|
+
}
|
|
274
|
+
.fraction__value {
|
|
275
|
+
justify-self: center;
|
|
276
|
+
}
|
|
277
|
+
.fraction__divider {
|
|
278
|
+
inline-size: 100%;
|
|
279
|
+
block-size: var(--stroke-size-100);
|
|
280
|
+
margin-block: var(--progress-ring-fraction-divider-margin);
|
|
281
|
+
border-radius: var(--radius-500);
|
|
282
|
+
background: currentColor;
|
|
283
|
+
opacity: 0.7;
|
|
284
|
+
}
|
|
285
|
+
.fraction__max {
|
|
286
|
+
justify-self: center;
|
|
287
|
+
}
|
|
288
|
+
mui-icon-checkmark.complete-icon {
|
|
289
|
+
color: currentColor;
|
|
290
|
+
fill: currentColor;
|
|
291
|
+
}
|
|
292
|
+
.shell {
|
|
293
|
+
position: relative;
|
|
294
|
+
inline-size: 100%;
|
|
295
|
+
block-size: 100%;
|
|
296
|
+
border-radius: 50%;
|
|
297
|
+
outline: none;
|
|
298
|
+
cursor: ${y ? S === "click" ? "pointer" : "help" : "default"};
|
|
299
|
+
}
|
|
300
|
+
.shell:focus-visible {
|
|
301
|
+
outline: var(--hint-focus-outline, var(--stroke-size-400) var(--stroke-outset) var(--outline-color));
|
|
302
|
+
outline-offset: var(--hint-focus-outline-offset, var(--stroke-size-200));
|
|
303
|
+
}
|
|
304
|
+
.tooltip {
|
|
305
|
+
display: none;
|
|
306
|
+
position: fixed;
|
|
307
|
+
z-index: 1000;
|
|
308
|
+
min-width: max-content;
|
|
309
|
+
max-width: var(--hint-max-width, 28rem);
|
|
310
|
+
padding: var(--space-200) var(--space-300);
|
|
311
|
+
border-radius: var(--radius-200);
|
|
312
|
+
border: var(--border-thin);
|
|
313
|
+
border-color: var(--hint-border-color, var(--border-color));
|
|
314
|
+
background: var(--hint-background, var(--surface-elevated-100));
|
|
315
|
+
color: var(--hint-text-color, var(--text-color));
|
|
316
|
+
box-shadow: var(--hint-shadow, var(--shadow-medium, 0 6px 20px rgba(0,0,0,0.18)));
|
|
317
|
+
opacity: 0;
|
|
318
|
+
pointer-events: none;
|
|
319
|
+
transition: opacity var(--speed-300, 160ms) ease;
|
|
320
|
+
font-size: var(--text-font-size-xs);
|
|
321
|
+
line-height: var(--text-line-height-xs);
|
|
322
|
+
box-sizing: border-box;
|
|
323
|
+
top: 0;
|
|
324
|
+
left: 0;
|
|
325
|
+
}
|
|
326
|
+
.tooltip.is-immediate {
|
|
327
|
+
transition-duration: 0ms;
|
|
328
|
+
}
|
|
329
|
+
.tooltip.is-open {
|
|
330
|
+
display: block;
|
|
331
|
+
opacity: 1;
|
|
332
|
+
}
|
|
333
|
+
`
|
|
334
|
+
);
|
|
335
|
+
this.shadowRoot.innerHTML = /*html*/
|
|
336
|
+
`
|
|
337
|
+
<style>${H}</style>
|
|
338
|
+
<div class="shell" ${y ? `tabindex="0" aria-describedby="${A}"` : ""}>
|
|
339
|
+
<svg class="ring" viewBox="0 0 42 42" aria-hidden="true">
|
|
340
|
+
<circle class="track" cx="21" cy="21" r="${a}"></circle>
|
|
341
|
+
<circle class="indicator" cx="21" cy="21" r="${a}"></circle>
|
|
342
|
+
</svg>
|
|
343
|
+
<div class="content">${k}</div>
|
|
344
|
+
</div>
|
|
345
|
+
${y ? `<div id="${A}" class="tooltip" role="tooltip" data-placement="${C}">${this.escapeHtml(T)}</div>` : ""}
|
|
346
|
+
`, this.setupTooltipEvents();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
customElements.get("mui-progress-ring") || customElements.define("mui-progress-ring", E);
|