@stackific/md3 0.1.0 → 0.1.2
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 -43
- package/dist/md3.css +1 -1
- package/dist/md3.js +1 -621
- package/package.json +2 -5
- package/src/main.js +0 -5
- package/src/runtime/elements/dialogs.js +0 -72
- package/src/runtime/elements/fields.js +0 -181
- package/src/runtime/elements/menus.js +0 -42
- package/src/runtime/elements/pages.js +0 -7
- package/src/runtime/elements/progress.js +0 -35
- package/src/runtime/elements/sliders.js +0 -78
- package/src/runtime/elements/snackbars.js +0 -27
- package/src/runtime/helpers/ripples.js +0 -46
- package/src/runtime/md3.js +0 -141
- package/src/runtime/palette.js +0 -64
- package/src/runtime/settings/theme.js +0 -194
- package/src/runtime/utils.js +0 -165
- package/src/styles/_config.scss +0 -142
- package/src/styles/_mixins.scss +0 -80
- package/src/styles/elements/_badges.scss +0 -65
- package/src/styles/elements/_bars.scss +0 -83
- package/src/styles/elements/_buttons.scss +0 -119
- package/src/styles/elements/_cards.scss +0 -32
- package/src/styles/elements/_chips.scss +0 -46
- package/src/styles/elements/_dialogs.scss +0 -143
- package/src/styles/elements/_dividers.scss +0 -46
- package/src/styles/elements/_expansions.scss +0 -19
- package/src/styles/elements/_fields.scss +0 -458
- package/src/styles/elements/_grids.scss +0 -35
- package/src/styles/elements/_icons.scss +0 -70
- package/src/styles/elements/_layouts.scss +0 -24
- package/src/styles/elements/_lists.scss +0 -76
- package/src/styles/elements/_main-layouts.scss +0 -45
- package/src/styles/elements/_media.scss +0 -104
- package/src/styles/elements/_menus.scss +0 -289
- package/src/styles/elements/_navigations.scss +0 -450
- package/src/styles/elements/_overlays.scss +0 -34
- package/src/styles/elements/_pages.scss +0 -28
- package/src/styles/elements/_progress.scss +0 -141
- package/src/styles/elements/_selections.scss +0 -248
- package/src/styles/elements/_shapes.scss +0 -151
- package/src/styles/elements/_sliders.scss +0 -336
- package/src/styles/elements/_snackbars.scss +0 -44
- package/src/styles/elements/_tables.scss +0 -67
- package/src/styles/elements/_tabs.scss +0 -49
- package/src/styles/elements/_tooltips.scss +0 -125
- package/src/styles/helpers/_alignments.scss +0 -29
- package/src/styles/helpers/_blurs.scss +0 -26
- package/src/styles/helpers/_colors.scss +0 -39
- package/src/styles/helpers/_directions.scss +0 -30
- package/src/styles/helpers/_elevates.scss +0 -20
- package/src/styles/helpers/_forms.scss +0 -76
- package/src/styles/helpers/_margins.scss +0 -39
- package/src/styles/helpers/_opacities.scss +0 -18
- package/src/styles/helpers/_paddings.scss +0 -35
- package/src/styles/helpers/_positions.scss +0 -44
- package/src/styles/helpers/_responsive.scss +0 -24
- package/src/styles/helpers/_ripples.scss +0 -40
- package/src/styles/helpers/_scrolls.scss +0 -7
- package/src/styles/helpers/_shadows.scss +0 -22
- package/src/styles/helpers/_sizes.scss +0 -34
- package/src/styles/helpers/_spaces.scss +0 -22
- package/src/styles/helpers/_typography.scss +0 -132
- package/src/styles/helpers/_waves.scss +0 -52
- package/src/styles/helpers/_zoom.scss +0 -18
- package/src/styles/md3.scss +0 -61
- package/src/styles/settings/_fonts.scss +0 -42
- package/src/styles/settings/_globals.scss +0 -104
- package/src/styles/settings/_reset.scss +0 -82
- package/src/styles/settings/_theme.scss +0 -126
- package/src/styles/settings/_themes.scss +0 -1525
- /package/dist/{shapes → assets}/arch.svg +0 -0
- /package/dist/{shapes → assets}/arrow.svg +0 -0
- /package/dist/{shapes → assets}/boom.svg +0 -0
- /package/dist/{shapes → assets}/bun.svg +0 -0
- /package/dist/{shapes → assets}/burst.svg +0 -0
- /package/dist/{shapes → assets}/circle.svg +0 -0
- /package/dist/{shapes → assets}/clamshell.svg +0 -0
- /package/dist/{shapes → assets}/diamond.svg +0 -0
- /package/dist/{shapes → assets}/fan.svg +0 -0
- /package/dist/{shapes → assets}/flower.svg +0 -0
- /package/dist/{shapes → assets}/gem.svg +0 -0
- /package/dist/{shapes → assets}/ghost-ish.svg +0 -0
- /package/dist/{shapes → assets}/heart.svg +0 -0
- /package/dist/{shapes → assets}/leaf-clover4.svg +0 -0
- /package/dist/{shapes → assets}/leaf-clover8.svg +0 -0
- /package/dist/{shapes → assets}/loading-indicator.svg +0 -0
- /package/dist/{fonts → assets}/material-symbols-outlined.woff2 +0 -0
- /package/dist/{fonts → assets}/material-symbols-rounded.woff2 +0 -0
- /package/dist/{fonts → assets}/material-symbols-sharp.woff2 +0 -0
- /package/dist/{fonts → assets}/material-symbols-subset.woff2 +0 -0
- /package/dist/{shapes → assets}/oval.svg +0 -0
- /package/dist/{shapes → assets}/pentagon.svg +0 -0
- /package/dist/{shapes → assets}/pill.svg +0 -0
- /package/dist/{shapes → assets}/pixel-circle.svg +0 -0
- /package/dist/{shapes → assets}/pixel-triangle.svg +0 -0
- /package/dist/{shapes → assets}/puffy-diamond.svg +0 -0
- /package/dist/{shapes → assets}/puffy.svg +0 -0
- /package/dist/{shapes → assets}/semicircle.svg +0 -0
- /package/dist/{shapes → assets}/sided-cookie12.svg +0 -0
- /package/dist/{shapes → assets}/sided-cookie4.svg +0 -0
- /package/dist/{shapes → assets}/sided-cookie6.svg +0 -0
- /package/dist/{shapes → assets}/sided-cookie7.svg +0 -0
- /package/dist/{shapes → assets}/sided-cookie9.svg +0 -0
- /package/dist/{shapes → assets}/slanted.svg +0 -0
- /package/dist/{shapes → assets}/soft-boom.svg +0 -0
- /package/dist/{shapes → assets}/soft-burst.svg +0 -0
- /package/dist/{shapes → assets}/square.svg +0 -0
- /package/dist/{shapes → assets}/sunny.svg +0 -0
- /package/dist/{shapes → assets}/triangle.svg +0 -0
- /package/dist/{shapes → assets}/very-sunny.svg +0 -0
- /package/dist/{shapes → assets}/wavy-circle.svg +0 -0
- /package/dist/{shapes → assets}/wavy.svg +0 -0
package/dist/md3.js
CHANGED
|
@@ -1,621 +1 @@
|
|
|
1
|
-
const G = [], H = /* @__PURE__ */ new WeakMap(), E = navigator.userAgent.includes("Chrome");
|
|
2
|
-
navigator.userAgent.includes("Firefox");
|
|
3
|
-
navigator.userAgent.includes("Safari");
|
|
4
|
-
navigator.userAgent.includes("Windows");
|
|
5
|
-
const et = navigator.userAgent.includes("Macintosh");
|
|
6
|
-
navigator.userAgent.includes("Linux");
|
|
7
|
-
navigator.userAgent.includes("Android");
|
|
8
|
-
const nt = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
9
|
-
function Ft() {
|
|
10
|
-
var t, e;
|
|
11
|
-
return ((e = (t = window == null ? void 0 : window.matchMedia) == null ? void 0 : t.call(window, "(prefers-color-scheme: dark)")) == null ? void 0 : e.matches) ?? !1;
|
|
12
|
-
}
|
|
13
|
-
async function it(t) {
|
|
14
|
-
await new Promise((e) => setTimeout(e, t));
|
|
15
|
-
}
|
|
16
|
-
function St() {
|
|
17
|
-
return "fxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
18
|
-
const e = Math.random() * 16 | 0;
|
|
19
|
-
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function v(t, e) {
|
|
23
|
-
try {
|
|
24
|
-
return typeof t == "string" ? (e ?? document).querySelector(t) : t;
|
|
25
|
-
} catch {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function f(t, e) {
|
|
30
|
-
try {
|
|
31
|
-
return typeof t == "string" ? (e ?? document).querySelectorAll(t) : t ?? G;
|
|
32
|
-
} catch {
|
|
33
|
-
return G;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function s(t, e) {
|
|
37
|
-
return (t == null ? void 0 : t.classList.contains(e)) ?? !1;
|
|
38
|
-
}
|
|
39
|
-
function h(t, e) {
|
|
40
|
-
var n;
|
|
41
|
-
return ((n = t == null ? void 0 : t.tagName) == null ? void 0 : n.toLowerCase()) === e;
|
|
42
|
-
}
|
|
43
|
-
function A(t, e) {
|
|
44
|
-
var n;
|
|
45
|
-
return ((n = t == null ? void 0 : t.type) == null ? void 0 : n.toLowerCase()) === e;
|
|
46
|
-
}
|
|
47
|
-
function y(t, e) {
|
|
48
|
-
if (t instanceof NodeList) for (let n = 0; n < t.length; n++) t[n].classList.add(e);
|
|
49
|
-
else t == null || t.classList.add(e);
|
|
50
|
-
}
|
|
51
|
-
function g(t, e) {
|
|
52
|
-
if (t instanceof NodeList) for (let n = 0; n < t.length; n++) t[n].classList.remove(e);
|
|
53
|
-
else t == null || t.classList.remove(e);
|
|
54
|
-
}
|
|
55
|
-
function x(t, e, n, i = !0) {
|
|
56
|
-
t != null && t.addEventListener && t.addEventListener(e, n, i);
|
|
57
|
-
}
|
|
58
|
-
function c(t, e, n, i = !0) {
|
|
59
|
-
if (!t) return;
|
|
60
|
-
let o = H.get(t);
|
|
61
|
-
o || (o = /* @__PURE__ */ new Map(), H.set(t, o));
|
|
62
|
-
const u = e + (i ? "1" : "0");
|
|
63
|
-
let r = o.get(u);
|
|
64
|
-
r || (r = /* @__PURE__ */ new Set(), o.set(u, r)), !r.has(n) && (r.add(n), x(t, e, n, i));
|
|
65
|
-
}
|
|
66
|
-
function F(t, e, n, i = !0) {
|
|
67
|
-
t != null && t.removeEventListener && t.removeEventListener(e, n, i);
|
|
68
|
-
}
|
|
69
|
-
function Mt(t, e) {
|
|
70
|
-
var n;
|
|
71
|
-
(n = e == null ? void 0 : e.parentNode) == null || n.insertBefore(t, e);
|
|
72
|
-
}
|
|
73
|
-
function B(t) {
|
|
74
|
-
return t == null ? void 0 : t.previousElementSibling;
|
|
75
|
-
}
|
|
76
|
-
function O(t) {
|
|
77
|
-
return t == null ? void 0 : t.nextElementSibling;
|
|
78
|
-
}
|
|
79
|
-
function w(t) {
|
|
80
|
-
return t == null ? void 0 : t.parentElement;
|
|
81
|
-
}
|
|
82
|
-
function Dt(t) {
|
|
83
|
-
const e = document.createElement("div");
|
|
84
|
-
for (const n of Object.keys(t))
|
|
85
|
-
e.setAttribute(n, t[n]);
|
|
86
|
-
return e;
|
|
87
|
-
}
|
|
88
|
-
function P() {
|
|
89
|
-
var t, e;
|
|
90
|
-
(e = (t = document.activeElement) == null ? void 0 : t.blur) == null || e.call(t);
|
|
91
|
-
}
|
|
92
|
-
function Lt(t) {
|
|
93
|
-
return f(`[data-ui="#${t}"]`);
|
|
94
|
-
}
|
|
95
|
-
function It(t) {
|
|
96
|
-
return v(`[data-ui="#${t}"]`);
|
|
97
|
-
}
|
|
98
|
-
function _t(t) {
|
|
99
|
-
t.id && s(t, "page") && (t = It(t.id) ?? t);
|
|
100
|
-
const e = w(t);
|
|
101
|
-
if (!s(e, "tabs") && !s(e, "tabbed") && !h(e, "nav")) return;
|
|
102
|
-
const n = f("a", e);
|
|
103
|
-
for (let i = 0; i < n.length; i++) g(n[i], "active");
|
|
104
|
-
!h(t, "button") && !s(t, "button") && !s(t, "chip") && y(t, "active");
|
|
105
|
-
}
|
|
106
|
-
function rt() {
|
|
107
|
-
const t = getComputedStyle(document.documentElement).getPropertyValue("--size") || "16px";
|
|
108
|
-
return t.includes("%") ? parseInt(t) * 16 / 100 : t.includes("em") ? parseInt(t) * 16 : parseInt(t);
|
|
109
|
-
}
|
|
110
|
-
function q(t) {
|
|
111
|
-
t.placeholder || (t.placeholder = " ");
|
|
112
|
-
}
|
|
113
|
-
function Bt(t) {
|
|
114
|
-
const e = t.currentTarget, n = w(e), i = v("input:not([type=file], [type=checkbox], [type=radio]), select, textarea", n);
|
|
115
|
-
i && i.focus();
|
|
116
|
-
}
|
|
117
|
-
function $(t) {
|
|
118
|
-
T(t.currentTarget);
|
|
119
|
-
}
|
|
120
|
-
function R(t) {
|
|
121
|
-
T(t.currentTarget);
|
|
122
|
-
}
|
|
123
|
-
function Ot(t) {
|
|
124
|
-
z(t.currentTarget);
|
|
125
|
-
}
|
|
126
|
-
function Pt(t) {
|
|
127
|
-
j(t.currentTarget);
|
|
128
|
-
}
|
|
129
|
-
function qt(t) {
|
|
130
|
-
z(t.currentTarget, t);
|
|
131
|
-
}
|
|
132
|
-
function $t(t) {
|
|
133
|
-
j(t.currentTarget, t);
|
|
134
|
-
}
|
|
135
|
-
function Rt(t) {
|
|
136
|
-
var i;
|
|
137
|
-
const e = t.currentTarget, n = v("input", w(e));
|
|
138
|
-
n && ((i = e.textContent) != null && i.includes("visibility")) && (n.type === "password" ? (n.type = "text", e.textContent = "visibility_off") : (n.type = "password", e.textContent = "visibility"));
|
|
139
|
-
}
|
|
140
|
-
function zt(t) {
|
|
141
|
-
ot(t.currentTarget);
|
|
142
|
-
}
|
|
143
|
-
function jt(t) {
|
|
144
|
-
const e = t.target.closest(".field > label");
|
|
145
|
-
e && (Object.defineProperty(t, "currentTarget", { value: e, configurable: !0 }), Bt(t));
|
|
146
|
-
}
|
|
147
|
-
function Kt() {
|
|
148
|
-
const t = document.body;
|
|
149
|
-
t && c(t, "click", jt);
|
|
150
|
-
}
|
|
151
|
-
function Nt() {
|
|
152
|
-
const t = f(".field > input:not([type=file], [type=color], [type=range])");
|
|
153
|
-
for (let e = 0; e < t.length; e++)
|
|
154
|
-
c(t[e], "focus", $), c(t[e], "blur", R), T(t[e]);
|
|
155
|
-
}
|
|
156
|
-
function Ut() {
|
|
157
|
-
const t = f(".field > select");
|
|
158
|
-
for (let e = 0; e < t.length; e++)
|
|
159
|
-
c(t[e], "focus", $), c(t[e], "blur", R);
|
|
160
|
-
}
|
|
161
|
-
function Wt() {
|
|
162
|
-
const t = f(".field > input[type=file]");
|
|
163
|
-
for (let e = 0; e < t.length; e++)
|
|
164
|
-
c(t[e], "change", Ot), z(t[e]);
|
|
165
|
-
}
|
|
166
|
-
function Yt() {
|
|
167
|
-
const t = f(".field > input[type=color]");
|
|
168
|
-
for (let e = 0; e < t.length; e++)
|
|
169
|
-
c(t[e], "change", Pt), j(t[e]);
|
|
170
|
-
}
|
|
171
|
-
function Gt() {
|
|
172
|
-
const t = f(".field > textarea");
|
|
173
|
-
for (let e = 0; e < t.length; e++)
|
|
174
|
-
c(t[e], "focus", $), c(t[e], "blur", R), q(t[e]), !(E && !et && !nt) && (c(t[e], "input", zt), ot(t[e]));
|
|
175
|
-
}
|
|
176
|
-
function Ht() {
|
|
177
|
-
const t = f(".field:has(> input[type=password]) > i, a");
|
|
178
|
-
for (let e = 0; e < t.length; e++) c(t[e], "click", Rt);
|
|
179
|
-
}
|
|
180
|
-
function T(t) {
|
|
181
|
-
A(t, "number") && !t.value && (t.value = ""), q(t);
|
|
182
|
-
}
|
|
183
|
-
function z(t, e) {
|
|
184
|
-
if ((e == null ? void 0 : e.key) === "Enter") {
|
|
185
|
-
const i = B(t);
|
|
186
|
-
if (!A(i, "file")) return;
|
|
187
|
-
i.click();
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const n = O(t);
|
|
191
|
-
A(n, "text") && (n.value = t.files ? Array.from(t.files).map((i) => i.name).join(", ") : "", n.readOnly = !0, c(n, "keydown", qt, !1), T(n));
|
|
192
|
-
}
|
|
193
|
-
function j(t, e) {
|
|
194
|
-
if ((e == null ? void 0 : e.key) === "Enter") {
|
|
195
|
-
const i = B(t);
|
|
196
|
-
if (!A(i, "color")) return;
|
|
197
|
-
i.click();
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const n = O(t);
|
|
201
|
-
A(n, "text") && (n.readOnly = !0, n.value = t.value, c(n, "keydown", $t, !1), T(n));
|
|
202
|
-
}
|
|
203
|
-
function ot(t) {
|
|
204
|
-
if (q(t), t.hasAttribute("rows")) return;
|
|
205
|
-
const e = rt();
|
|
206
|
-
t.style.blockSize = "auto", t.style.blockSize = `${t.scrollHeight - e}px`;
|
|
207
|
-
}
|
|
208
|
-
function Vt() {
|
|
209
|
-
Kt(), Nt(), Ut(), Wt(), Yt(), Gt(), Ht();
|
|
210
|
-
}
|
|
211
|
-
function V(t) {
|
|
212
|
-
const e = t.target;
|
|
213
|
-
!h(e, "input") && !h(e, "select") || (e.type === "range" ? (e.focus(), ct(e)) : at());
|
|
214
|
-
}
|
|
215
|
-
function Zt(t) {
|
|
216
|
-
if (!window.matchMedia("(pointer: coarse)").matches) return;
|
|
217
|
-
t.target.blur();
|
|
218
|
-
}
|
|
219
|
-
function at() {
|
|
220
|
-
const t = document.body, e = f(".slider > input[type=range]");
|
|
221
|
-
e.length ? x(t, "input", V, !1) : F(t, "input", V, !1);
|
|
222
|
-
for (let n = 0; n < e.length; n++) ct(e[n]);
|
|
223
|
-
}
|
|
224
|
-
function ct(t) {
|
|
225
|
-
c(t, "change", Zt);
|
|
226
|
-
const e = w(t), n = v("span", e), i = f("input", e);
|
|
227
|
-
if (!i.length || !n) return;
|
|
228
|
-
const o = rt(), u = s(e, "max") ? 0 : 0.25 * o * 100 / i[0].offsetWidth, r = [], l = [];
|
|
229
|
-
for (let m = 0, Tt = i.length; m < Tt; m++) {
|
|
230
|
-
const U = parseFloat(i[m].min) || 0, Ct = parseFloat(i[m].max) || 100, W = parseFloat(i[m].value) || 0, Y = (W - U) * 100 / (Ct - U), Et = u / 2 - u * Y / 100;
|
|
231
|
-
r.push(Y + Et), l.push(W);
|
|
232
|
-
}
|
|
233
|
-
let p = r[0], d = 0, N = 100 - d - p, S = l[0], M = l[1] || 0;
|
|
234
|
-
i.length > 1 && (p = Math.abs(r[1] - r[0]), d = r[1] > r[0] ? r[0] : r[1], N = 100 - d - p, M > S && (S = l[1] || 0, M = l[0])), requestAnimationFrame(() => {
|
|
235
|
-
e.style.cssText = `--_start: ${d}%; --_end: ${N}%; --_value1: '${S}'; --_value2: '${M}';`;
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function Xt() {
|
|
239
|
-
at();
|
|
240
|
-
}
|
|
241
|
-
const Z = {
|
|
242
|
-
red: "#F44336",
|
|
243
|
-
pink: "#E91E63",
|
|
244
|
-
purple: "#9C27B0",
|
|
245
|
-
"deep-purple": "#673AB7",
|
|
246
|
-
blue: "#2196F3",
|
|
247
|
-
"light-blue": "#03A9F4",
|
|
248
|
-
cyan: "#00BCD4",
|
|
249
|
-
green: "#4CAF50",
|
|
250
|
-
"light-green": "#8BC34A",
|
|
251
|
-
lime: "#CDDC39",
|
|
252
|
-
yellow: "#FFEB3B",
|
|
253
|
-
amber: "#FFC107",
|
|
254
|
-
orange: "#FF9800",
|
|
255
|
-
"deep-orange": "#FF5722",
|
|
256
|
-
brown: "#795548",
|
|
257
|
-
"blue-grey": "#607D8B",
|
|
258
|
-
stackific: "#1447E6",
|
|
259
|
-
"hello-pumpkin": "#FF8F00",
|
|
260
|
-
"sea-lettuce": "#63A002",
|
|
261
|
-
olive: "#7C7C67",
|
|
262
|
-
nord: "#5E81AC",
|
|
263
|
-
"vega-violet": "#AD46FF",
|
|
264
|
-
"wild-strawberry": "#F6339A",
|
|
265
|
-
"heliotrope-magenta": "#E12AFB",
|
|
266
|
-
"voodoo-violet": "#804792",
|
|
267
|
-
"red-orchid": "#C0001C",
|
|
268
|
-
"green-brown": "#6E5D00",
|
|
269
|
-
shakshuka: "#AB350F",
|
|
270
|
-
"purple-honeycreeper": "#8E51FF",
|
|
271
|
-
maldives: "#00B8DB",
|
|
272
|
-
verditer: "#00BBA7",
|
|
273
|
-
fennel: "#00BC7D",
|
|
274
|
-
gold: "#EFB100",
|
|
275
|
-
"vitamin-c": "#FD9A00",
|
|
276
|
-
burtuqali: "#FF6900"
|
|
277
|
-
}, ut = [
|
|
278
|
-
"stackific",
|
|
279
|
-
"hello-pumpkin",
|
|
280
|
-
"sea-lettuce",
|
|
281
|
-
"olive",
|
|
282
|
-
"nord",
|
|
283
|
-
"vega-violet",
|
|
284
|
-
"wild-strawberry",
|
|
285
|
-
"heliotrope-magenta",
|
|
286
|
-
"voodoo-violet",
|
|
287
|
-
"red-orchid",
|
|
288
|
-
"green-brown",
|
|
289
|
-
"shakshuka",
|
|
290
|
-
"purple-honeycreeper",
|
|
291
|
-
"maldives",
|
|
292
|
-
"verditer",
|
|
293
|
-
"fennel",
|
|
294
|
-
"gold",
|
|
295
|
-
"vitamin-c",
|
|
296
|
-
"burtuqali"
|
|
297
|
-
], a = {
|
|
298
|
-
light: "",
|
|
299
|
-
dark: ""
|
|
300
|
-
}, st = "md3:mode", lt = "md3:theme";
|
|
301
|
-
function Qt() {
|
|
302
|
-
return ut.slice();
|
|
303
|
-
}
|
|
304
|
-
function Jt() {
|
|
305
|
-
var t;
|
|
306
|
-
try {
|
|
307
|
-
return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(lt)) || null;
|
|
308
|
-
} catch {
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
function te(t) {
|
|
313
|
-
var e;
|
|
314
|
-
try {
|
|
315
|
-
(e = globalThis.localStorage) == null || e.setItem(lt, t);
|
|
316
|
-
} catch {
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
function b() {
|
|
320
|
-
return document == null ? void 0 : document.documentElement;
|
|
321
|
-
}
|
|
322
|
-
function ft() {
|
|
323
|
-
var t;
|
|
324
|
-
try {
|
|
325
|
-
return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(st)) || null;
|
|
326
|
-
} catch {
|
|
327
|
-
return null;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
function ee(t) {
|
|
331
|
-
var e;
|
|
332
|
-
try {
|
|
333
|
-
(e = globalThis.localStorage) == null || e.setItem(st, t);
|
|
334
|
-
} catch {
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
function X() {
|
|
338
|
-
var e, n;
|
|
339
|
-
const t = (n = (e = b()) == null ? void 0 : e.dataset) == null ? void 0 : n.mode;
|
|
340
|
-
return t === "auto" || t === "light" || t === "dark" ? t : ft() || "auto";
|
|
341
|
-
}
|
|
342
|
-
function _() {
|
|
343
|
-
var e, n;
|
|
344
|
-
const t = (n = (e = b()) == null ? void 0 : e.dataset) == null ? void 0 : n.mode;
|
|
345
|
-
return t === "light" || t === "dark" ? t : Ft() ? "dark" : "light";
|
|
346
|
-
}
|
|
347
|
-
function ne() {
|
|
348
|
-
if (a.light && a.dark) return a;
|
|
349
|
-
const t = b();
|
|
350
|
-
if (!t) return a;
|
|
351
|
-
const e = t.dataset.mode, n = (i) => {
|
|
352
|
-
t.dataset.mode = i;
|
|
353
|
-
const o = getComputedStyle(t), u = [
|
|
354
|
-
"--primary",
|
|
355
|
-
"--on-primary",
|
|
356
|
-
"--primary-container",
|
|
357
|
-
"--on-primary-container",
|
|
358
|
-
"--secondary",
|
|
359
|
-
"--on-secondary",
|
|
360
|
-
"--secondary-container",
|
|
361
|
-
"--on-secondary-container",
|
|
362
|
-
"--tertiary",
|
|
363
|
-
"--on-tertiary",
|
|
364
|
-
"--tertiary-container",
|
|
365
|
-
"--on-tertiary-container",
|
|
366
|
-
"--error",
|
|
367
|
-
"--on-error",
|
|
368
|
-
"--error-container",
|
|
369
|
-
"--on-error-container",
|
|
370
|
-
"--background",
|
|
371
|
-
"--on-background",
|
|
372
|
-
"--surface",
|
|
373
|
-
"--on-surface",
|
|
374
|
-
"--surface-variant",
|
|
375
|
-
"--on-surface-variant",
|
|
376
|
-
"--outline",
|
|
377
|
-
"--outline-variant",
|
|
378
|
-
"--shadow",
|
|
379
|
-
"--scrim",
|
|
380
|
-
"--inverse-surface",
|
|
381
|
-
"--inverse-on-surface",
|
|
382
|
-
"--inverse-primary",
|
|
383
|
-
"--surface-dim",
|
|
384
|
-
"--surface-bright",
|
|
385
|
-
"--surface-container-lowest",
|
|
386
|
-
"--surface-container-low",
|
|
387
|
-
"--surface-container",
|
|
388
|
-
"--surface-container-high",
|
|
389
|
-
"--surface-container-highest"
|
|
390
|
-
];
|
|
391
|
-
let r = "";
|
|
392
|
-
for (let l = 0, p = u.length; l < p; l++)
|
|
393
|
-
r += u[l] + ":" + o.getPropertyValue(u[l]) + ";";
|
|
394
|
-
return r;
|
|
395
|
-
};
|
|
396
|
-
try {
|
|
397
|
-
a.light = n("light"), a.dark = n("dark");
|
|
398
|
-
} finally {
|
|
399
|
-
e === void 0 ? delete t.dataset.mode : t.dataset.mode = e;
|
|
400
|
-
}
|
|
401
|
-
return a;
|
|
402
|
-
}
|
|
403
|
-
async function dt(t) {
|
|
404
|
-
const e = b();
|
|
405
|
-
if (!t) return ne();
|
|
406
|
-
if (t.light && t.dark)
|
|
407
|
-
return a.light = t.light, a.dark = t.dark, e.setAttribute("style", t[_()]), t;
|
|
408
|
-
if (typeof t == "string" && ut.includes(t))
|
|
409
|
-
return te(t), e.dataset.theme = t, e.removeAttribute("style"), a.light = "", a.dark = "", { light: "", dark: "" };
|
|
410
|
-
typeof t == "string" && Z[t] && (t = Z[t]);
|
|
411
|
-
const n = globalThis.materialDynamicColors;
|
|
412
|
-
if (typeof n != "function")
|
|
413
|
-
throw new Error(
|
|
414
|
-
'ui("theme", source) requires material-dynamic-colors. Install it and `import "material-dynamic-colors"` once at app entry, or include the CDN script.'
|
|
415
|
-
);
|
|
416
|
-
return n(t).then((i) => {
|
|
417
|
-
const o = (u) => {
|
|
418
|
-
let r = "";
|
|
419
|
-
for (const l of Object.keys(u)) {
|
|
420
|
-
const p = u[l], d = l.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
421
|
-
r += "--" + d + ":" + p + ";";
|
|
422
|
-
}
|
|
423
|
-
return r;
|
|
424
|
-
};
|
|
425
|
-
return a.light = o(i.light), a.dark = o(i.dark), e.setAttribute("style", a[_()]), a;
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
function pt(t) {
|
|
429
|
-
const e = b();
|
|
430
|
-
return e ? (t && (t !== "auto" && t !== "light" && t !== "dark" && (t = "auto"), ee(t), e.dataset.mode = t, a.light && a.dark && e.setAttribute("style", a[_()])), X()) : t;
|
|
431
|
-
}
|
|
432
|
-
let Q = !1;
|
|
433
|
-
function ie() {
|
|
434
|
-
if (Q || typeof globalThis.matchMedia != "function") return;
|
|
435
|
-
const t = globalThis.matchMedia("(prefers-color-scheme: dark)"), e = () => {
|
|
436
|
-
const n = b();
|
|
437
|
-
!n || n.dataset.mode !== "auto" || !a.light || !a.dark || n.setAttribute("style", a[t.matches ? "dark" : "light"]);
|
|
438
|
-
};
|
|
439
|
-
t.addEventListener ? t.addEventListener("change", e) : t.addListener && t.addListener(e), Q = !0;
|
|
440
|
-
}
|
|
441
|
-
const C = [];
|
|
442
|
-
function gt(t) {
|
|
443
|
-
if (t.key === "Escape") {
|
|
444
|
-
const e = t.currentTarget;
|
|
445
|
-
yt(e, e);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
function re(t) {
|
|
449
|
-
(v("[autofocus]", t) ?? t).focus();
|
|
450
|
-
}
|
|
451
|
-
function ht(t, e) {
|
|
452
|
-
g(Lt(t.id), "active"), g(t, "active"), g(e, "active"), t.close(), C.pop();
|
|
453
|
-
const n = C[C.length - 1];
|
|
454
|
-
n && n.focus();
|
|
455
|
-
}
|
|
456
|
-
async function oe(t, e, n, i) {
|
|
457
|
-
!h(i, "button") && !s(i, "button") && !s(i, "chip") && y(i, "active"), y(e, "active"), y(t, "active"), n ? t.showModal() : t.show(), await it(90), n || x(t, "keydown", gt, !1), C.push(t), re(t);
|
|
458
|
-
}
|
|
459
|
-
function ae(t) {
|
|
460
|
-
const e = t.currentTarget, n = O(e);
|
|
461
|
-
h(n, "dialog") && ht(n, e);
|
|
462
|
-
}
|
|
463
|
-
async function yt(t, e) {
|
|
464
|
-
P();
|
|
465
|
-
let n = B(e);
|
|
466
|
-
const i = s(e, "active") || e.open, o = s(e, "modal");
|
|
467
|
-
o || F(e, "keydown", gt, !1), s(n, "overlay") || (n = Dt({ class: "overlay" }), Mt(n, e), await it(90)), o || c(n, "click", ae, !1), i ? ht(e, n) : oe(e, n, o, t);
|
|
468
|
-
}
|
|
469
|
-
let D;
|
|
470
|
-
function vt(t) {
|
|
471
|
-
F(document.body, "click", vt);
|
|
472
|
-
const e = t.target, n = f("menu.active");
|
|
473
|
-
for (let i = 0; i < n.length; i++) bt(e, n[i], t);
|
|
474
|
-
}
|
|
475
|
-
function ce(t) {
|
|
476
|
-
setTimeout(() => {
|
|
477
|
-
const e = v(".field > input", t);
|
|
478
|
-
e ? e.focus() : t.focus();
|
|
479
|
-
}, 90);
|
|
480
|
-
}
|
|
481
|
-
function bt(t, e, n) {
|
|
482
|
-
D && clearTimeout(D), D = setTimeout(() => {
|
|
483
|
-
x(document.body, "click", vt), h(document.activeElement, "input") || P();
|
|
484
|
-
const i = s(e, "active"), o = (n == null ? void 0 : n.target) === t, u = !!t.closest("menu");
|
|
485
|
-
if (!i && u || i && o) {
|
|
486
|
-
g(e, "active");
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
g(f("menu.active"), "active"), y(e, "active"), ce(e);
|
|
490
|
-
}, 90);
|
|
491
|
-
}
|
|
492
|
-
let k;
|
|
493
|
-
function ue(t) {
|
|
494
|
-
const e = t.currentTarget;
|
|
495
|
-
g(e, "active"), k && clearTimeout(k);
|
|
496
|
-
}
|
|
497
|
-
function se(t, e) {
|
|
498
|
-
P();
|
|
499
|
-
const n = f(".snackbar.active");
|
|
500
|
-
for (let i = 0; i < n.length; i++) g(n[i], "active");
|
|
501
|
-
y(t, "active"), c(t, "click", ue), k && clearTimeout(k), e !== -1 && (k = setTimeout(() => {
|
|
502
|
-
g(t, "active");
|
|
503
|
-
}, e ?? 6e3));
|
|
504
|
-
}
|
|
505
|
-
function le(t) {
|
|
506
|
-
const e = w(t);
|
|
507
|
-
e && g(f(":scope > .page", e), "active"), y(t, "active");
|
|
508
|
-
}
|
|
509
|
-
function mt(t) {
|
|
510
|
-
const e = t instanceof MouseEvent, n = t.currentTarget, i = n.getBoundingClientRect(), o = Math.max(i.width, i.height), u = o / 2, r = e ? t.clientX - i.left - u : i.width / 2 - u, l = e ? t.clientY - i.top - u : i.height / 2 - u, p = document.createElement("div");
|
|
511
|
-
p.className = "ripple-js";
|
|
512
|
-
const d = document.createElement("div");
|
|
513
|
-
d.style.inlineSize = d.style.blockSize = `${o}px`, d.style.left = `${r}px`, d.style.top = `${l}px`, c(d, "animationend", () => {
|
|
514
|
-
p.remove();
|
|
515
|
-
}), p.appendChild(d), n.appendChild(p);
|
|
516
|
-
}
|
|
517
|
-
function fe(t) {
|
|
518
|
-
const e = t.target.closest(".slow-ripple, .ripple, .fast-ripple");
|
|
519
|
-
e && (Object.defineProperty(t, "currentTarget", { value: e, configurable: !0 }), mt(t));
|
|
520
|
-
}
|
|
521
|
-
function de(t) {
|
|
522
|
-
const e = t.target.closest(".slow-ripple, .ripple, .fast-ripple");
|
|
523
|
-
!e || t.key !== " " || (Object.defineProperty(t, "currentTarget", { value: e, configurable: !0 }), mt(t));
|
|
524
|
-
}
|
|
525
|
-
function pe() {
|
|
526
|
-
const t = document.body;
|
|
527
|
-
t && (c(t, "mousedown", fe), c(t, "keydown", de));
|
|
528
|
-
}
|
|
529
|
-
function J(t) {
|
|
530
|
-
const e = t.target;
|
|
531
|
-
h(e, "progress") ? kt(e) : At();
|
|
532
|
-
}
|
|
533
|
-
function kt(t) {
|
|
534
|
-
requestAnimationFrame(() => {
|
|
535
|
-
if (!t.hasAttribute("value") && !t.hasAttribute("max")) {
|
|
536
|
-
const e = s(t, "circle") ? "50" : "100";
|
|
537
|
-
t.style.setProperty("--_value", e), t.setAttribute("value", e), t.setAttribute("max", "100"), t.classList.add("indeterminate");
|
|
538
|
-
} else
|
|
539
|
-
t.style.setProperty("--_value", String(t.value));
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
function At() {
|
|
543
|
-
if (E && !et && !nt) return;
|
|
544
|
-
const t = document.body, e = f("progress");
|
|
545
|
-
e.length ? x(t, "input", J, !1) : F(t, "input", J, !1);
|
|
546
|
-
for (let n = 0; n < e.length; n++) kt(e[n]);
|
|
547
|
-
}
|
|
548
|
-
let L, I = null;
|
|
549
|
-
function tt() {
|
|
550
|
-
L && clearTimeout(L), L = setTimeout(() => wt(), 180);
|
|
551
|
-
}
|
|
552
|
-
async function K(t, e, n, i) {
|
|
553
|
-
if (!e && (e = v(t.getAttribute("data-ui")), !e)) {
|
|
554
|
-
t.classList.toggle("active");
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
if (_t(t), h(e, "dialog")) {
|
|
558
|
-
requestAnimationFrame(() => yt(t, e));
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
if (h(e, "menu")) {
|
|
562
|
-
requestAnimationFrame(() => bt(t, e, i));
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
if (s(e, "snackbar")) {
|
|
566
|
-
requestAnimationFrame(() => se(e, n));
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
if (s(e, "page")) {
|
|
570
|
-
requestAnimationFrame(() => le(e));
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
if (s(e, "active")) {
|
|
574
|
-
g(t, "active"), g(e, "active");
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
y(e, "active");
|
|
578
|
-
}
|
|
579
|
-
function xt() {
|
|
580
|
-
globalThis.ui || I || !globalThis.MutationObserver || (I = new MutationObserver(tt), I.observe(document.body, { childList: !0, subtree: !0 }), tt());
|
|
581
|
-
}
|
|
582
|
-
function ge(t) {
|
|
583
|
-
const e = t.target.closest("[data-ui]");
|
|
584
|
-
e && K(e, null, null, t);
|
|
585
|
-
}
|
|
586
|
-
function he(t) {
|
|
587
|
-
const e = t.target.closest("[data-ui]");
|
|
588
|
-
e && h(e, "a") && !e.getAttribute("href") && t.key === "Enter" && K(e, null, null, t);
|
|
589
|
-
}
|
|
590
|
-
function ye() {
|
|
591
|
-
const t = document.body;
|
|
592
|
-
t && (c(t, "click", ge), c(t, "keydown", he));
|
|
593
|
-
}
|
|
594
|
-
function wt(t, e) {
|
|
595
|
-
if (t) {
|
|
596
|
-
if (t === "setup") {
|
|
597
|
-
xt();
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
if (t === "guid") return St();
|
|
601
|
-
if (t === "mode") return pt(e);
|
|
602
|
-
if (t === "theme") return dt(e);
|
|
603
|
-
if (t === "themes") return Qt();
|
|
604
|
-
const n = v(t);
|
|
605
|
-
if (!n) return;
|
|
606
|
-
K(n, n, e);
|
|
607
|
-
}
|
|
608
|
-
ye(), Vt(), pe(), Xt(), At();
|
|
609
|
-
}
|
|
610
|
-
function ve() {
|
|
611
|
-
var e;
|
|
612
|
-
if (globalThis.ui) return;
|
|
613
|
-
const t = (e = globalThis.document) == null ? void 0 : e.documentElement;
|
|
614
|
-
if (t) {
|
|
615
|
-
pt(ft() || t.dataset.mode || "auto");
|
|
616
|
-
const n = Jt();
|
|
617
|
-
n && dt(n);
|
|
618
|
-
}
|
|
619
|
-
ie(), xt(), globalThis.ui = wt;
|
|
620
|
-
}
|
|
621
|
-
ve();
|
|
1
|
+
const G=[],H=new WeakMap,E=navigator.userAgent.includes("Chrome");navigator.userAgent.includes("Firefox");navigator.userAgent.includes("Safari");navigator.userAgent.includes("Windows");const et=navigator.userAgent.includes("Macintosh");navigator.userAgent.includes("Linux");navigator.userAgent.includes("Android");const nt=/iPad|iPhone|iPod/.test(navigator.userAgent);function Ft(){var t,e;return((e=(t=window==null?void 0:window.matchMedia)==null?void 0:t.call(window,"(prefers-color-scheme: dark)"))==null?void 0:e.matches)??!1}async function it(t){await new Promise(e=>setTimeout(e,t))}function St(){return"fxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function v(t,e){try{return typeof t=="string"?(e??document).querySelector(t):t}catch{return null}}function f(t,e){try{return typeof t=="string"?(e??document).querySelectorAll(t):t??G}catch{return G}}function s(t,e){return(t==null?void 0:t.classList.contains(e))??!1}function h(t,e){var n;return((n=t==null?void 0:t.tagName)==null?void 0:n.toLowerCase())===e}function A(t,e){var n;return((n=t==null?void 0:t.type)==null?void 0:n.toLowerCase())===e}function y(t,e){if(t instanceof NodeList)for(let n=0;n<t.length;n++)t[n].classList.add(e);else t==null||t.classList.add(e)}function g(t,e){if(t instanceof NodeList)for(let n=0;n<t.length;n++)t[n].classList.remove(e);else t==null||t.classList.remove(e)}function x(t,e,n,i=!0){t!=null&&t.addEventListener&&t.addEventListener(e,n,i)}function c(t,e,n,i=!0){if(!t)return;let o=H.get(t);o||(o=new Map,H.set(t,o));const u=e+(i?"1":"0");let r=o.get(u);r||(r=new Set,o.set(u,r)),!r.has(n)&&(r.add(n),x(t,e,n,i))}function F(t,e,n,i=!0){t!=null&&t.removeEventListener&&t.removeEventListener(e,n,i)}function Mt(t,e){var n;(n=e==null?void 0:e.parentNode)==null||n.insertBefore(t,e)}function B(t){return t==null?void 0:t.previousElementSibling}function O(t){return t==null?void 0:t.nextElementSibling}function w(t){return t==null?void 0:t.parentElement}function Dt(t){const e=document.createElement("div");for(const n of Object.keys(t))e.setAttribute(n,t[n]);return e}function P(){var t,e;(e=(t=document.activeElement)==null?void 0:t.blur)==null||e.call(t)}function Lt(t){return f(`[data-ui="#${t}"]`)}function It(t){return v(`[data-ui="#${t}"]`)}function _t(t){t.id&&s(t,"page")&&(t=It(t.id)??t);const e=w(t);if(!s(e,"tabs")&&!s(e,"tabbed")&&!h(e,"nav"))return;const n=f("a",e);for(let i=0;i<n.length;i++)g(n[i],"active");!h(t,"button")&&!s(t,"button")&&!s(t,"chip")&&y(t,"active")}function rt(){const t=getComputedStyle(document.documentElement).getPropertyValue("--size")||"16px";return t.includes("%")?parseInt(t)*16/100:t.includes("em")?parseInt(t)*16:parseInt(t)}function q(t){t.placeholder||(t.placeholder=" ")}function Bt(t){const e=t.currentTarget,n=w(e),i=v("input:not([type=file], [type=checkbox], [type=radio]), select, textarea",n);i&&i.focus()}function $(t){T(t.currentTarget)}function R(t){T(t.currentTarget)}function Ot(t){z(t.currentTarget)}function Pt(t){j(t.currentTarget)}function qt(t){z(t.currentTarget,t)}function $t(t){j(t.currentTarget,t)}function Rt(t){var i;const e=t.currentTarget,n=v("input",w(e));n&&((i=e.textContent)!=null&&i.includes("visibility"))&&(n.type==="password"?(n.type="text",e.textContent="visibility_off"):(n.type="password",e.textContent="visibility"))}function zt(t){ot(t.currentTarget)}function jt(t){const e=t.target.closest(".field > label");e&&(Object.defineProperty(t,"currentTarget",{value:e,configurable:!0}),Bt(t))}function Kt(){const t=document.body;t&&c(t,"click",jt)}function Nt(){const t=f(".field > input:not([type=file], [type=color], [type=range])");for(let e=0;e<t.length;e++)c(t[e],"focus",$),c(t[e],"blur",R),T(t[e])}function Ut(){const t=f(".field > select");for(let e=0;e<t.length;e++)c(t[e],"focus",$),c(t[e],"blur",R)}function Wt(){const t=f(".field > input[type=file]");for(let e=0;e<t.length;e++)c(t[e],"change",Ot),z(t[e])}function Yt(){const t=f(".field > input[type=color]");for(let e=0;e<t.length;e++)c(t[e],"change",Pt),j(t[e])}function Gt(){const t=f(".field > textarea");for(let e=0;e<t.length;e++)c(t[e],"focus",$),c(t[e],"blur",R),q(t[e]),!(E&&!et&&!nt)&&(c(t[e],"input",zt),ot(t[e]))}function Ht(){const t=f(".field:has(> input[type=password]) > i, a");for(let e=0;e<t.length;e++)c(t[e],"click",Rt)}function T(t){A(t,"number")&&!t.value&&(t.value=""),q(t)}function z(t,e){if((e==null?void 0:e.key)==="Enter"){const i=B(t);if(!A(i,"file"))return;i.click();return}const n=O(t);A(n,"text")&&(n.value=t.files?Array.from(t.files).map(i=>i.name).join(", "):"",n.readOnly=!0,c(n,"keydown",qt,!1),T(n))}function j(t,e){if((e==null?void 0:e.key)==="Enter"){const i=B(t);if(!A(i,"color"))return;i.click();return}const n=O(t);A(n,"text")&&(n.readOnly=!0,n.value=t.value,c(n,"keydown",$t,!1),T(n))}function ot(t){if(q(t),t.hasAttribute("rows"))return;const e=rt();t.style.blockSize="auto",t.style.blockSize=`${t.scrollHeight-e}px`}function Vt(){Kt(),Nt(),Ut(),Wt(),Yt(),Gt(),Ht()}function V(t){const e=t.target;!h(e,"input")&&!h(e,"select")||(e.type==="range"?(e.focus(),ct(e)):at())}function Zt(t){if(!window.matchMedia("(pointer: coarse)").matches)return;t.target.blur()}function at(){const t=document.body,e=f(".slider > input[type=range]");e.length?x(t,"input",V,!1):F(t,"input",V,!1);for(let n=0;n<e.length;n++)ct(e[n])}function ct(t){c(t,"change",Zt);const e=w(t),n=v("span",e),i=f("input",e);if(!i.length||!n)return;const o=rt(),u=s(e,"max")?0:.25*o*100/i[0].offsetWidth,r=[],l=[];for(let m=0,Tt=i.length;m<Tt;m++){const U=parseFloat(i[m].min)||0,Ct=parseFloat(i[m].max)||100,W=parseFloat(i[m].value)||0,Y=(W-U)*100/(Ct-U),Et=u/2-u*Y/100;r.push(Y+Et),l.push(W)}let p=r[0],d=0,N=100-d-p,S=l[0],M=l[1]||0;i.length>1&&(p=Math.abs(r[1]-r[0]),d=r[1]>r[0]?r[0]:r[1],N=100-d-p,M>S&&(S=l[1]||0,M=l[0])),requestAnimationFrame(()=>{e.style.cssText=`--_start: ${d}%; --_end: ${N}%; --_value1: '${S}'; --_value2: '${M}';`})}function Xt(){at()}const Z={red:"#F44336",pink:"#E91E63",purple:"#9C27B0","deep-purple":"#673AB7",blue:"#2196F3","light-blue":"#03A9F4",cyan:"#00BCD4",green:"#4CAF50","light-green":"#8BC34A",lime:"#CDDC39",yellow:"#FFEB3B",amber:"#FFC107",orange:"#FF9800","deep-orange":"#FF5722",brown:"#795548","blue-grey":"#607D8B",stackific:"#1447E6","hello-pumpkin":"#FF8F00","sea-lettuce":"#63A002",olive:"#7C7C67",nord:"#5E81AC","vega-violet":"#AD46FF","wild-strawberry":"#F6339A","heliotrope-magenta":"#E12AFB","voodoo-violet":"#804792","red-orchid":"#C0001C","green-brown":"#6E5D00",shakshuka:"#AB350F","purple-honeycreeper":"#8E51FF",maldives:"#00B8DB",verditer:"#00BBA7",fennel:"#00BC7D",gold:"#EFB100","vitamin-c":"#FD9A00",burtuqali:"#FF6900"},ut=["stackific","hello-pumpkin","sea-lettuce","olive","nord","vega-violet","wild-strawberry","heliotrope-magenta","voodoo-violet","red-orchid","green-brown","shakshuka","purple-honeycreeper","maldives","verditer","fennel","gold","vitamin-c","burtuqali"],a={light:"",dark:""},st="md3:mode",lt="md3:theme";function Qt(){return ut.slice()}function Jt(){var t;try{return((t=globalThis.localStorage)==null?void 0:t.getItem(lt))||null}catch{return null}}function te(t){var e;try{(e=globalThis.localStorage)==null||e.setItem(lt,t)}catch{}}function b(){return document==null?void 0:document.documentElement}function ft(){var t;try{return((t=globalThis.localStorage)==null?void 0:t.getItem(st))||null}catch{return null}}function ee(t){var e;try{(e=globalThis.localStorage)==null||e.setItem(st,t)}catch{}}function X(){var e,n;const t=(n=(e=b())==null?void 0:e.dataset)==null?void 0:n.mode;return t==="auto"||t==="light"||t==="dark"?t:ft()||"auto"}function _(){var e,n;const t=(n=(e=b())==null?void 0:e.dataset)==null?void 0:n.mode;return t==="light"||t==="dark"?t:Ft()?"dark":"light"}function ne(){if(a.light&&a.dark)return a;const t=b();if(!t)return a;const e=t.dataset.mode,n=i=>{t.dataset.mode=i;const o=getComputedStyle(t),u=["--primary","--on-primary","--primary-container","--on-primary-container","--secondary","--on-secondary","--secondary-container","--on-secondary-container","--tertiary","--on-tertiary","--tertiary-container","--on-tertiary-container","--error","--on-error","--error-container","--on-error-container","--background","--on-background","--surface","--on-surface","--surface-variant","--on-surface-variant","--outline","--outline-variant","--shadow","--scrim","--inverse-surface","--inverse-on-surface","--inverse-primary","--surface-dim","--surface-bright","--surface-container-lowest","--surface-container-low","--surface-container","--surface-container-high","--surface-container-highest"];let r="";for(let l=0,p=u.length;l<p;l++)r+=u[l]+":"+o.getPropertyValue(u[l])+";";return r};try{a.light=n("light"),a.dark=n("dark")}finally{e===void 0?delete t.dataset.mode:t.dataset.mode=e}return a}async function dt(t){const e=b();if(!t)return ne();if(t.light&&t.dark)return a.light=t.light,a.dark=t.dark,e.setAttribute("style",t[_()]),t;if(typeof t=="string"&&ut.includes(t))return te(t),e.dataset.theme=t,e.removeAttribute("style"),a.light="",a.dark="",{light:"",dark:""};typeof t=="string"&&Z[t]&&(t=Z[t]);const n=globalThis.materialDynamicColors;if(typeof n!="function")throw new Error('ui("theme", source) requires material-dynamic-colors. Install it and `import "material-dynamic-colors"` once at app entry, or include the CDN script.');return n(t).then(i=>{const o=u=>{let r="";for(const l of Object.keys(u)){const p=u[l],d=l.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();r+="--"+d+":"+p+";"}return r};return a.light=o(i.light),a.dark=o(i.dark),e.setAttribute("style",a[_()]),a})}function pt(t){const e=b();return e?(t&&(t!=="auto"&&t!=="light"&&t!=="dark"&&(t="auto"),ee(t),e.dataset.mode=t,a.light&&a.dark&&e.setAttribute("style",a[_()])),X()):t}let Q=!1;function ie(){if(Q||typeof globalThis.matchMedia!="function")return;const t=globalThis.matchMedia("(prefers-color-scheme: dark)"),e=()=>{const n=b();!n||n.dataset.mode!=="auto"||!a.light||!a.dark||n.setAttribute("style",a[t.matches?"dark":"light"])};t.addEventListener?t.addEventListener("change",e):t.addListener&&t.addListener(e),Q=!0}const C=[];function gt(t){if(t.key==="Escape"){const e=t.currentTarget;yt(e,e)}}function re(t){(v("[autofocus]",t)??t).focus()}function ht(t,e){g(Lt(t.id),"active"),g(t,"active"),g(e,"active"),t.close(),C.pop();const n=C[C.length-1];n&&n.focus()}async function oe(t,e,n,i){!h(i,"button")&&!s(i,"button")&&!s(i,"chip")&&y(i,"active"),y(e,"active"),y(t,"active"),n?t.showModal():t.show(),await it(90),n||x(t,"keydown",gt,!1),C.push(t),re(t)}function ae(t){const e=t.currentTarget,n=O(e);h(n,"dialog")&&ht(n,e)}async function yt(t,e){P();let n=B(e);const i=s(e,"active")||e.open,o=s(e,"modal");o||F(e,"keydown",gt,!1),s(n,"overlay")||(n=Dt({class:"overlay"}),Mt(n,e),await it(90)),o||c(n,"click",ae,!1),i?ht(e,n):oe(e,n,o,t)}let D;function vt(t){F(document.body,"click",vt);const e=t.target,n=f("menu.active");for(let i=0;i<n.length;i++)bt(e,n[i],t)}function ce(t){setTimeout(()=>{const e=v(".field > input",t);e?e.focus():t.focus()},90)}function bt(t,e,n){D&&clearTimeout(D),D=setTimeout(()=>{x(document.body,"click",vt),h(document.activeElement,"input")||P();const i=s(e,"active"),o=(n==null?void 0:n.target)===t,u=!!t.closest("menu");if(!i&&u||i&&o){g(e,"active");return}g(f("menu.active"),"active"),y(e,"active"),ce(e)},90)}let k;function ue(t){const e=t.currentTarget;g(e,"active"),k&&clearTimeout(k)}function se(t,e){P();const n=f(".snackbar.active");for(let i=0;i<n.length;i++)g(n[i],"active");y(t,"active"),c(t,"click",ue),k&&clearTimeout(k),e!==-1&&(k=setTimeout(()=>{g(t,"active")},e??6e3))}function le(t){const e=w(t);e&&g(f(":scope > .page",e),"active"),y(t,"active")}function mt(t){const e=t instanceof MouseEvent,n=t.currentTarget,i=n.getBoundingClientRect(),o=Math.max(i.width,i.height),u=o/2,r=e?t.clientX-i.left-u:i.width/2-u,l=e?t.clientY-i.top-u:i.height/2-u,p=document.createElement("div");p.className="ripple-js";const d=document.createElement("div");d.style.inlineSize=d.style.blockSize=`${o}px`,d.style.left=`${r}px`,d.style.top=`${l}px`,c(d,"animationend",()=>{p.remove()}),p.appendChild(d),n.appendChild(p)}function fe(t){const e=t.target.closest(".slow-ripple, .ripple, .fast-ripple");e&&(Object.defineProperty(t,"currentTarget",{value:e,configurable:!0}),mt(t))}function de(t){const e=t.target.closest(".slow-ripple, .ripple, .fast-ripple");!e||t.key!==" "||(Object.defineProperty(t,"currentTarget",{value:e,configurable:!0}),mt(t))}function pe(){const t=document.body;t&&(c(t,"mousedown",fe),c(t,"keydown",de))}function J(t){const e=t.target;h(e,"progress")?kt(e):At()}function kt(t){requestAnimationFrame(()=>{if(!t.hasAttribute("value")&&!t.hasAttribute("max")){const e=s(t,"circle")?"50":"100";t.style.setProperty("--_value",e),t.setAttribute("value",e),t.setAttribute("max","100"),t.classList.add("indeterminate")}else t.style.setProperty("--_value",String(t.value))})}function At(){if(E&&!et&&!nt)return;const t=document.body,e=f("progress");e.length?x(t,"input",J,!1):F(t,"input",J,!1);for(let n=0;n<e.length;n++)kt(e[n])}let L,I=null;function tt(){L&&clearTimeout(L),L=setTimeout(()=>wt(),180)}async function K(t,e,n,i){if(!e&&(e=v(t.getAttribute("data-ui")),!e)){t.classList.toggle("active");return}if(_t(t),h(e,"dialog")){requestAnimationFrame(()=>yt(t,e));return}if(h(e,"menu")){requestAnimationFrame(()=>bt(t,e,i));return}if(s(e,"snackbar")){requestAnimationFrame(()=>se(e,n));return}if(s(e,"page")){requestAnimationFrame(()=>le(e));return}if(s(e,"active")){g(t,"active"),g(e,"active");return}y(e,"active")}function xt(){globalThis.ui||I||!globalThis.MutationObserver||(I=new MutationObserver(tt),I.observe(document.body,{childList:!0,subtree:!0}),tt())}function ge(t){const e=t.target.closest("[data-ui]");e&&K(e,null,null,t)}function he(t){const e=t.target.closest("[data-ui]");e&&h(e,"a")&&!e.getAttribute("href")&&t.key==="Enter"&&K(e,null,null,t)}function ye(){const t=document.body;t&&(c(t,"click",ge),c(t,"keydown",he))}function wt(t,e){if(t){if(t==="setup"){xt();return}if(t==="guid")return St();if(t==="mode")return pt(e);if(t==="theme")return dt(e);if(t==="themes")return Qt();const n=v(t);if(!n)return;K(n,n,e)}ye(),Vt(),pe(),Xt(),At()}function ve(){var e;if(globalThis.ui)return;const t=(e=globalThis.document)==null?void 0:e.documentElement;if(t){pt(ft()||t.dataset.mode||"auto");const n=Jt();n&&dt(n)}ie(),xt(),globalThis.ui=wt}ve();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackific/md3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Material Design 3 framework — SCSS + plain-JS. M3 tokens, palette utilities, dialogs, menus, sliders, snackbars; optional runtime theme generation when the consumer brings material-dynamic-colors.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,14 +28,11 @@
|
|
|
28
28
|
"exports": {
|
|
29
29
|
".": "./dist/md3.js",
|
|
30
30
|
"./style": "./dist/md3.css",
|
|
31
|
-
"./
|
|
32
|
-
"./shapes/*": "./dist/shapes/*",
|
|
33
|
-
"./src/*": "./src/*",
|
|
31
|
+
"./assets/*": "./dist/assets/*",
|
|
34
32
|
"./package.json": "./package.json"
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
35
|
"dist",
|
|
38
|
-
"src",
|
|
39
36
|
"NOTICE",
|
|
40
37
|
"THIRD-PARTY-NOTICES"
|
|
41
38
|
],
|