@starasia/theme 3.5.0 → 3.6.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/dist/index.es.js +296 -262
- package/dist/index.umd.js +6 -6
- package/dist/theme/basePalette.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as C, jsxs as ae } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as me, useState as _, useMemo as Q, useEffect as I, useRef as ye, useCallback as $, useContext as be } from "react";
|
|
3
|
+
const he = (e, r) => {
|
|
4
4
|
if (typeof document > "u")
|
|
5
5
|
return;
|
|
6
6
|
const a = document.getElementById(r);
|
|
@@ -10,7 +10,7 @@ const me = (e, r) => {
|
|
|
10
10
|
const s = document.createElement("style");
|
|
11
11
|
s.id = r, s.textContent = e, document.head.appendChild(s);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, we = (e) => {
|
|
14
14
|
if (typeof document > "u")
|
|
15
15
|
return null;
|
|
16
16
|
const r = document.getElementById(e);
|
|
@@ -19,7 +19,7 @@ const me = (e, r) => {
|
|
|
19
19
|
const a = document.createElement("style");
|
|
20
20
|
return a.id = e, document.head.appendChild(a), a;
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function T(e) {
|
|
23
23
|
let r = e.trim().replace(/^#/, "");
|
|
24
24
|
r.length === 3 && (r = r.split("").map((s) => s + s).join("")), r.length === 8 && (r = r.slice(0, 6));
|
|
25
25
|
const a = parseInt(r, 16);
|
|
@@ -29,12 +29,12 @@ function j(e) {
|
|
|
29
29
|
b: (a & 255) / 255
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
return `#${
|
|
32
|
+
const Y = (e) => Math.max(0, Math.min(255, Math.round(e * 255))).toString(16).padStart(2, "0");
|
|
33
|
+
function xe({ r: e, g: r, b: a }) {
|
|
34
|
+
return `#${Y(e)}${Y(r)}${Y(a)}`;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
36
|
+
const A = (e) => e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4), z = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
|
|
37
|
+
function Se(e, r, a) {
|
|
38
38
|
const s = 0.4122214708 * e + 0.5363325363 * r + 0.0514459929 * a, c = 0.2119034982 * e + 0.6806995451 * r + 0.1073969566 * a, o = 0.0883024619 * e + 0.2817188376 * r + 0.6299787005 * a, n = Math.cbrt(s), d = Math.cbrt(c), t = Math.cbrt(o);
|
|
39
39
|
return {
|
|
40
40
|
L: 0.2104542553 * n + 0.793617785 * d - 0.0040720468 * t,
|
|
@@ -42,7 +42,7 @@ function we(e, r, a) {
|
|
|
42
42
|
b: 0.0259040371 * n + 0.7827717662 * d - 0.808675766 * t
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ee(e, r, a) {
|
|
46
46
|
const s = e + 0.3963377774 * r + 0.2158037573 * a, c = e - 0.1055613458 * r - 0.0638541728 * a, o = e - 0.0894841775 * r - 1.291485548 * a, n = s * s * s, d = c * c * c, t = o * o * o;
|
|
47
47
|
return {
|
|
48
48
|
r: 4.0767416621 * n - 3.3077115913 * d + 0.2309699292 * t,
|
|
@@ -50,53 +50,53 @@ function xe(e, r, a) {
|
|
|
50
50
|
b: -0.0041960863 * n - 0.7034186147 * d + 1.707614701 * t
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const { L: s, a: c, b: o } =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
function Me({ r: e, g: r, b: a }) {
|
|
54
|
+
const { L: s, a: c, b: o } = Se(
|
|
55
|
+
A(e),
|
|
56
|
+
A(r),
|
|
57
|
+
A(a)
|
|
58
58
|
), n = Math.sqrt(c * c + o * o);
|
|
59
59
|
let d = Math.atan2(o, c) * 180 / Math.PI;
|
|
60
60
|
return d < 0 && (d += 360), { l: s, c: n, h: d };
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
64
|
-
const s = a * Math.PI / 180, c = (n) =>
|
|
62
|
+
const w = (e) => Me(T(e)), se = ({ r: e, g: r, b: a }, s = 1e-4) => e >= -s && e <= 1 + s && r >= -s && r <= 1 + s && a >= -s && a <= 1 + s;
|
|
63
|
+
function Ce({ l: e, c: r, h: a }) {
|
|
64
|
+
const s = a * Math.PI / 180, c = (n) => Ee(e, n * Math.cos(s), n * Math.sin(s));
|
|
65
65
|
let o = c(r);
|
|
66
|
-
if (!
|
|
66
|
+
if (!se(o)) {
|
|
67
67
|
let n = 0, d = r;
|
|
68
68
|
for (let t = 0; t < 20; t++) {
|
|
69
69
|
const b = (n + d) / 2;
|
|
70
|
-
o = c(b),
|
|
70
|
+
o = c(b), se(o) ? n = b : d = b;
|
|
71
71
|
}
|
|
72
72
|
o = c(n);
|
|
73
73
|
}
|
|
74
74
|
return {
|
|
75
|
-
r: Math.min(1, Math.max(0,
|
|
76
|
-
g: Math.min(1, Math.max(0,
|
|
77
|
-
b: Math.min(1, Math.max(0,
|
|
75
|
+
r: Math.min(1, Math.max(0, z(o.r))),
|
|
76
|
+
g: Math.min(1, Math.max(0, z(o.g))),
|
|
77
|
+
b: Math.min(1, Math.max(0, z(o.b)))
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
return 0.2126 *
|
|
80
|
+
const N = (e) => xe(Ce(e));
|
|
81
|
+
function V({ r: e, g: r, b: a }) {
|
|
82
|
+
return 0.2126 * A(e) + 0.7152 * A(r) + 0.0722 * A(a);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const a =
|
|
84
|
+
function X(e, r) {
|
|
85
|
+
const a = V(T(e)), s = V(T(r)), c = Math.max(a, s), o = Math.min(a, s);
|
|
86
86
|
return (c + 0.05) / (o + 0.05);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function R(e, r = ["#ffffff", "#1e1f21"]) {
|
|
89
89
|
let a = r[0], s = -1;
|
|
90
90
|
for (const c of r) {
|
|
91
|
-
const o =
|
|
91
|
+
const o = X(e, c);
|
|
92
92
|
o > s && (s = o, a = c);
|
|
93
93
|
}
|
|
94
94
|
return a;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return
|
|
96
|
+
function fe(e) {
|
|
97
|
+
return V(T(e)) < 0.4;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const F = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"], P = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "1100"], U = {
|
|
100
100
|
brand: {
|
|
101
101
|
L: [0.9434, 0.8816, 0.7612, 0.6375, 0.5179, 0.4415, 0.2695, 0.2429, 0.2155, 0.1878],
|
|
102
102
|
C: [0.0143, 0.031, 0.0645, 0.1017, 0.1394, 0.1429, 0.086, 0.0761, 0.066, 0.0549]
|
|
@@ -117,40 +117,40 @@ const T = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
|
|
|
117
117
|
L: [0.9673, 0.9003, 0.8504, 0.8055, 0.7624, 0.6961, 0.5244, 0.3979, 0.2567, 0.2201],
|
|
118
118
|
C: [0.0205, 0.0679, 0.0991, 0.1284, 0.1495, 0.1346, 0.0998, 0.0731, 0.0415, 0.0332]
|
|
119
119
|
}
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
const { c: a, h: s } =
|
|
120
|
+
}, Ae = [1, 0.9791, 0.9577, 0.9007, 0.7857, 0.6501, 0.6028, 0.5383, 0.4389, 0.36, 0.2856, 0.239], Le = [0.2127, 0.2401, 0.3133, 0.3673, 0.4198, 0.5093, 0.603, 0.682, 0.7408, 0.8102, 0.8546, 0.9153], $e = 0.02;
|
|
121
|
+
function H(e, r) {
|
|
122
|
+
const { c: a, h: s } = w(e), c = Math.max(...r.C) || 1;
|
|
123
123
|
return r.L.map(
|
|
124
|
-
(o, n) =>
|
|
124
|
+
(o, n) => N({ l: o, c: a * (r.C[n] / c), h: s })
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
const { c: a, h: s } =
|
|
127
|
+
function oe(e, r) {
|
|
128
|
+
const { c: a, h: s } = w(e), c = Math.min(a, $e), o = r.length;
|
|
129
129
|
return r.map((n, d) => {
|
|
130
130
|
const t = d / (o - 1), b = 1 - Math.abs(2 * t - 1);
|
|
131
|
-
return
|
|
131
|
+
return N({ l: n, c: c * b, h: s });
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const o =
|
|
134
|
+
function ce(e, r, a, s, c = 0.018) {
|
|
135
|
+
const o = w(e).l, n = w(r).l;
|
|
136
136
|
return Array.from({ length: a }, (d, t) => {
|
|
137
137
|
if (t === 0)
|
|
138
138
|
return e;
|
|
139
139
|
if (t === a - 1)
|
|
140
140
|
return r;
|
|
141
|
-
const b = t / (a - 1),
|
|
142
|
-
return
|
|
141
|
+
const b = t / (a - 1), g = o + (n - o) * b, k = 1 - Math.abs(2 * b - 1);
|
|
142
|
+
return N({ l: g, c: c * k, h: s });
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function qe(e, r) {
|
|
146
146
|
let a = e[0], s = 1 / 0;
|
|
147
147
|
for (const c of e) {
|
|
148
|
-
const o = Math.abs(
|
|
148
|
+
const o = Math.abs(w(c).l - r);
|
|
149
149
|
o < s && (s = o, a = c);
|
|
150
150
|
}
|
|
151
151
|
return a;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const ue = [
|
|
154
154
|
{ token: "--sa-text-primary", recipe: "var(--sa-color-gray-1000, #292a2e)", scale: "gray" },
|
|
155
155
|
{ token: "--sa-text-primary-inverse", recipe: "var(--sa-color-gray-50, #ffffff)", scale: "gray" },
|
|
156
156
|
{ token: "--sa-text-on-brand", recipe: "var(--sa-color-gray-50, #ffffff)", scale: "gray" },
|
|
@@ -333,7 +333,7 @@ const be = [
|
|
|
333
333
|
{ token: "--sa-text-on-accent", recipe: "var(--sa-color-gray-1100, #1e1f21)", scale: "gray" },
|
|
334
334
|
{ token: "--sa-icon-accent", recipe: "var(--sa-color-amber-700, #a8690b)", scale: "amber" },
|
|
335
335
|
{ token: "--sa-border-accent", recipe: "var(--sa-color-amber-500, #f5a524)", scale: "amber" }
|
|
336
|
-
],
|
|
336
|
+
], ke = [
|
|
337
337
|
{ token: "--sa-text-primary", recipe: "var(--sa-color-dark-1100, #e2e3e4)", scale: "dark" },
|
|
338
338
|
{ token: "--sa-text-primary-inverse", recipe: "var(--sa-color-gray-1100, #1e1f21)", scale: "gray" },
|
|
339
339
|
{ token: "--sa-text-brand", recipe: "var(--sa-color-brand-300, #668cc9)", scale: "brand" },
|
|
@@ -423,7 +423,7 @@ const be = [
|
|
|
423
423
|
{ token: "--sa-background-disable", recipe: "var(--sa-color-white-alpha-a5, #bdbdbd0d)", scale: "white" },
|
|
424
424
|
{ token: "--sa-background-overlay", recipe: "var(--sa-color-black-alpha-a45, #00000073)", scale: "black" },
|
|
425
425
|
{ token: "--sa-background-brand", recipe: "#3b6fe0", scale: null },
|
|
426
|
-
{ token: "--sa-background-brand-hover", recipe: "#
|
|
426
|
+
{ token: "--sa-background-brand-hover", recipe: "#3565d9", scale: null },
|
|
427
427
|
{ token: "--sa-background-brand-pressed", recipe: "#2f5ad2", scale: null },
|
|
428
428
|
{ token: "--sa-background-brand-disable", recipe: "var(--sa-color-brand-600, #04254f)", scale: "brand" },
|
|
429
429
|
{ token: "--sa-background-brand-subtle", recipe: "var(--sa-color-brand-400, #3366b7)", scale: "brand" },
|
|
@@ -512,43 +512,77 @@ const be = [
|
|
|
512
512
|
{ token: "--sa-icon-accent", recipe: "var(--sa-color-amber-400, #ffb63f)", scale: "amber" },
|
|
513
513
|
{ token: "--sa-border-accent", recipe: "var(--sa-color-amber-400, #ffb63f)", scale: "amber" }
|
|
514
514
|
];
|
|
515
|
-
function
|
|
515
|
+
function _e(e, r) {
|
|
516
516
|
const a = e.match(/var\(--sa-color-([a-z]+)-(\d+),\s*([^)]+)\)/);
|
|
517
517
|
if (!a)
|
|
518
518
|
return e;
|
|
519
519
|
const [, s, c, o] = a, n = r[s];
|
|
520
520
|
if (!n)
|
|
521
521
|
return o.trim();
|
|
522
|
-
const t = (n.length === 12 ?
|
|
522
|
+
const t = (n.length === 12 ? P : F).indexOf(c);
|
|
523
523
|
return t >= 0 ? n[t] : o.trim();
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
const a =
|
|
527
|
-
return
|
|
525
|
+
function Z(e, r) {
|
|
526
|
+
const a = w(e);
|
|
527
|
+
return N({ ...a, l: Math.min(0.98, Math.max(0.02, a.l + r)) });
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
|
|
529
|
+
function q(e, r, a = 4.5) {
|
|
530
|
+
if (X(e, r) >= a)
|
|
531
|
+
return e;
|
|
532
|
+
const s = w(e).l >= w(r).l ? 1 : -1;
|
|
533
|
+
for (const c of [s, -s])
|
|
534
|
+
for (let o = 1; o <= 96; o++) {
|
|
535
|
+
const n = Z(e, c * o * 0.01);
|
|
536
|
+
if (X(n, r) >= a)
|
|
537
|
+
return n;
|
|
538
|
+
}
|
|
539
|
+
return R(r);
|
|
540
|
+
}
|
|
541
|
+
function Re(e) {
|
|
542
|
+
const r = e.base, a = fe(r), s = w(r), c = N({
|
|
531
543
|
l: a ? 0.96 : 0.22,
|
|
532
544
|
c: Math.min(s.c * 0.5, 0.02),
|
|
533
545
|
h: s.h
|
|
534
|
-
}), o = a ? c : r, n = a ? r : c, d =
|
|
535
|
-
["error", "success", "info", "warning"].forEach((
|
|
536
|
-
const
|
|
537
|
-
|
|
546
|
+
}), o = a ? c : r, n = a ? r : c, d = ce(o, n, 12, s.h), t = ce(n, o, 12, s.h), b = H(e.brand, U.brand), g = { gray: d, dark: t, brand: b };
|
|
547
|
+
["error", "success", "info", "warning"].forEach((u) => {
|
|
548
|
+
const v = e[u];
|
|
549
|
+
v && (g[u] = H(v, U[u]));
|
|
538
550
|
});
|
|
539
|
-
const
|
|
540
|
-
for (const
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
551
|
+
const k = a ? ke : ue, f = {};
|
|
552
|
+
for (const u of k)
|
|
553
|
+
u.token !== "--sa-text-on-brand" && (f[u.token] = _e(u.recipe, g));
|
|
554
|
+
const p = R(e.brand.toLowerCase()), m = q(e.brand.toLowerCase(), p), E = p === "#ffffff" ? -1 : 1;
|
|
555
|
+
f["--sa-background-brand"] = m, f["--sa-background-brand-hover"] = Z(m, E * 0.06), f["--sa-background-brand-pressed"] = Z(m, E * 0.12), f["--sa-text-on-brand"] = p;
|
|
556
|
+
const h = f["--sa-background-primary"], x = (u, v) => {
|
|
557
|
+
f[u] && /^#[0-9a-f]{6}$/i.test(f[u]) && (f[u] = q(f[u], v));
|
|
558
|
+
};
|
|
559
|
+
for (const u of [
|
|
560
|
+
"--sa-text-primary",
|
|
561
|
+
"--sa-text-subtle",
|
|
562
|
+
"--sa-text-brand",
|
|
563
|
+
"--sa-text-brand-hover",
|
|
564
|
+
"--sa-text-brand-pressed",
|
|
565
|
+
"--sa-text-secondary",
|
|
566
|
+
"--sa-text-error",
|
|
567
|
+
"--sa-text-success",
|
|
568
|
+
"--sa-text-info",
|
|
569
|
+
"--sa-text-warning"
|
|
570
|
+
])
|
|
571
|
+
x(u, h);
|
|
572
|
+
for (const u of ["--sa-background-neutral", "--sa-background-neutral-hover"])
|
|
573
|
+
x(u, f["--sa-text-primary"]);
|
|
574
|
+
if (f["--sa-text-on-accent"] = R("#f5a524"), a)
|
|
575
|
+
for (const u of ["error", "success", "info", "warning"])
|
|
576
|
+
for (const v of ["", "-hover", "-pressed"])
|
|
577
|
+
x(`--sa-background-${u}${v}`, f["--sa-text-primary-inverse"]);
|
|
578
|
+
const M = {};
|
|
579
|
+
for (const [u, v] of Object.entries(g))
|
|
580
|
+
(v.length === 12 ? P : F).forEach((l, y) => {
|
|
581
|
+
M[`--sa-color-${u}-${l}`] = v[y];
|
|
548
582
|
});
|
|
549
|
-
return { tokens: { ...
|
|
583
|
+
return { tokens: { ...M, ...f }, isDark: a, brand: b, gray: d };
|
|
550
584
|
}
|
|
551
|
-
const
|
|
585
|
+
const er = {
|
|
552
586
|
name: "starasia",
|
|
553
587
|
brand: "#1a4fa0",
|
|
554
588
|
neutral: "#7d818a",
|
|
@@ -558,46 +592,46 @@ const qe = {
|
|
|
558
592
|
warning: "#ed9f30",
|
|
559
593
|
radius: 8,
|
|
560
594
|
font: { body: "Inter" }
|
|
561
|
-
},
|
|
562
|
-
function
|
|
595
|
+
}, ne = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', De = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', S = (e) => Math.round(e * 10) / 10;
|
|
596
|
+
function B(e, r, a, s) {
|
|
563
597
|
s.forEach((c, o) => {
|
|
564
598
|
e[`--sa-color-${r}-${c}`] = a[o];
|
|
565
599
|
});
|
|
566
600
|
}
|
|
567
|
-
function
|
|
601
|
+
function Ne(e, r = {}) {
|
|
568
602
|
const a = r.as ?? "root";
|
|
569
603
|
if (a === "skin" && !r.name)
|
|
570
604
|
throw new Error('buildTheme: options.name wajib saat as:"skin"');
|
|
571
605
|
const s = a === "skin" ? `[data-skin="${r.name}"]` : r.selector ?? ":root";
|
|
572
606
|
if (e.base)
|
|
573
|
-
return
|
|
574
|
-
const c = r.darkPrimary ?? !0, o = {}, n = {}, d = { brand: [] }, t = /* @__PURE__ */ new Set(["brand"]), b =
|
|
575
|
-
if (d.brand = b,
|
|
576
|
-
const
|
|
577
|
-
if (!
|
|
607
|
+
return Oe(e, s);
|
|
608
|
+
const c = r.darkPrimary ?? !0, o = {}, n = {}, d = { brand: [] }, t = /* @__PURE__ */ new Set(["brand"]), b = H(e.brand, U.brand);
|
|
609
|
+
if (d.brand = b, B(o, "brand", b, F), o["--sa-text-on-brand"] = R(b[6]), ["error", "success", "info", "warning"].forEach((k) => {
|
|
610
|
+
const f = e[k];
|
|
611
|
+
if (!f)
|
|
578
612
|
return;
|
|
579
|
-
const
|
|
580
|
-
d[
|
|
613
|
+
const p = H(f, U[k]);
|
|
614
|
+
d[k] = p, B(o, k, p, F), t.add(k);
|
|
581
615
|
}), e.neutral) {
|
|
582
|
-
const
|
|
583
|
-
d.gray =
|
|
616
|
+
const k = oe(e.neutral, Ae), f = oe(e.neutral, Le);
|
|
617
|
+
d.gray = k, d.dark = f, B(o, "gray", k, P), B(o, "dark", f, P), t.add("gray"), t.add("dark");
|
|
584
618
|
}
|
|
585
|
-
if (
|
|
586
|
-
const f = b[4];
|
|
587
|
-
n["--sa-background-brand"] = f, n["--sa-background-brand-hover"] = b[3], n["--sa-background-brand-pressed"] = b[
|
|
619
|
+
if (pe(o, e), c) {
|
|
620
|
+
const k = R(b[4]), f = q(b[4], k), p = k === "#ffffff";
|
|
621
|
+
n["--sa-background-brand"] = f, n["--sa-background-brand-hover"] = p ? b[5] : b[3], n["--sa-background-brand-pressed"] = p ? b[6] : b[2], n["--sa-text-on-brand"] = k;
|
|
588
622
|
}
|
|
589
|
-
return { css: a === "skin" ?
|
|
623
|
+
return { css: a === "skin" ? Be(s, o, n, t) : Ie(s, o, n), rootTokens: o, darkTokens: n, ramps: d };
|
|
590
624
|
}
|
|
591
|
-
function
|
|
625
|
+
function pe(e, r) {
|
|
592
626
|
var a, s, c;
|
|
593
627
|
if (typeof r.radius == "number") {
|
|
594
628
|
const o = r.radius;
|
|
595
|
-
e["--sa-radii-xs"] = `${
|
|
629
|
+
e["--sa-radii-xs"] = `${S(o * 0.5)}px`, e["--sa-radii-sm"] = `${S(o * 0.75)}px`, e["--sa-radii-md"] = `${S(o)}px`, e["--sa-radii-lg"] = `${S(o * 1.5)}px`, e["--sa-radii-xl"] = `${S(o * 1.75)}px`, e["--sa-radii-2xl"] = `${S(o * 2)}px`, e["--sa-radii-rounded"] = `${S(o)}px`;
|
|
596
630
|
}
|
|
597
|
-
(a = r.font) != null && a.body && (e["--sa-font-family"] = `"${r.font.body}", ${
|
|
631
|
+
(a = r.font) != null && a.body && (e["--sa-font-family"] = `"${r.font.body}", ${ne}`), (s = r.font) != null && s.heading && (e["--sa-font-family-heading"] = `"${r.font.heading}", ${ne}`), (c = r.font) != null && c.mono && (e["--sa-font-family-mono"] = `"${r.font.mono}", ${De}`);
|
|
598
632
|
}
|
|
599
|
-
function
|
|
600
|
-
const { tokens: a, brand: s, gray: c, isDark: o } =
|
|
633
|
+
function Oe(e, r) {
|
|
634
|
+
const { tokens: a, brand: s, gray: c, isDark: o } = Re({
|
|
601
635
|
base: e.base,
|
|
602
636
|
brand: e.brand,
|
|
603
637
|
error: e.error,
|
|
@@ -605,46 +639,46 @@ function Ne(e, r) {
|
|
|
605
639
|
info: e.info,
|
|
606
640
|
warning: e.warning
|
|
607
641
|
});
|
|
608
|
-
|
|
642
|
+
pe(a, e);
|
|
609
643
|
const n = o ? "dark" : "light", d = `${r},
|
|
610
644
|
${r}[data-theme="dark"]`;
|
|
611
645
|
return {
|
|
612
646
|
// color-scheme → scrollbar & kontrol native browser ikut terang/gelap tema.
|
|
613
647
|
// Bukan token, jadi tidak masuk rootTokens.
|
|
614
|
-
css:
|
|
648
|
+
css: D(d, { ...a, "color-scheme": n }),
|
|
615
649
|
rootTokens: a,
|
|
616
650
|
darkTokens: {},
|
|
617
651
|
ramps: { brand: s, gray: c },
|
|
618
652
|
scheme: n
|
|
619
653
|
};
|
|
620
654
|
}
|
|
621
|
-
function
|
|
655
|
+
function D(e, r) {
|
|
622
656
|
const a = Object.entries(r).map(([s, c]) => ` ${s}: ${c};`);
|
|
623
657
|
return a.length ? `${e} {
|
|
624
658
|
${a.join(`
|
|
625
659
|
`)}
|
|
626
660
|
}` : "";
|
|
627
661
|
}
|
|
628
|
-
function
|
|
662
|
+
function Ie(e, r, a) {
|
|
629
663
|
const s = e === ":root" ? '[data-theme="dark"]' : `${e}[data-theme="dark"], ${e} [data-theme="dark"]`;
|
|
630
|
-
return [
|
|
664
|
+
return [D(e, r), D(s, a)].filter(Boolean).join(`
|
|
631
665
|
|
|
632
666
|
`);
|
|
633
667
|
}
|
|
634
|
-
function
|
|
668
|
+
function Be(e, r, a, s) {
|
|
635
669
|
const c = {};
|
|
636
|
-
for (const t of
|
|
670
|
+
for (const t of ue)
|
|
637
671
|
t.scale && s.has(t.scale) && t.token !== "--sa-text-on-brand" && (c[t.token] = t.recipe);
|
|
638
672
|
const o = { ...r, ...c }, n = {};
|
|
639
|
-
for (const t of
|
|
673
|
+
for (const t of ke)
|
|
640
674
|
(t.scale && s.has(t.scale) || t.token in o) && (n[t.token] = t.recipe);
|
|
641
675
|
const d = { ...n, ...a };
|
|
642
|
-
return [
|
|
676
|
+
return [D(e, o), D(`${e}[data-theme="dark"]`, d)].filter(Boolean).join(`
|
|
643
677
|
|
|
644
678
|
`);
|
|
645
679
|
}
|
|
646
|
-
const
|
|
647
|
-
function
|
|
680
|
+
const O = "sa-theme";
|
|
681
|
+
function j(e = O) {
|
|
648
682
|
try {
|
|
649
683
|
if (typeof localStorage > "u")
|
|
650
684
|
return null;
|
|
@@ -654,7 +688,7 @@ function B(e = N) {
|
|
|
654
688
|
return null;
|
|
655
689
|
}
|
|
656
690
|
}
|
|
657
|
-
function
|
|
691
|
+
function je(e, r = O) {
|
|
658
692
|
try {
|
|
659
693
|
if (typeof localStorage > "u")
|
|
660
694
|
return;
|
|
@@ -662,7 +696,7 @@ function Be(e, r = N) {
|
|
|
662
696
|
} catch {
|
|
663
697
|
}
|
|
664
698
|
}
|
|
665
|
-
function
|
|
699
|
+
function Te(e = O) {
|
|
666
700
|
try {
|
|
667
701
|
if (typeof localStorage > "u")
|
|
668
702
|
return;
|
|
@@ -670,7 +704,7 @@ function je(e = N) {
|
|
|
670
704
|
} catch {
|
|
671
705
|
}
|
|
672
706
|
}
|
|
673
|
-
function
|
|
707
|
+
function Fe(e) {
|
|
674
708
|
if (e === "system")
|
|
675
709
|
try {
|
|
676
710
|
return typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -679,22 +713,22 @@ function Te(e) {
|
|
|
679
713
|
}
|
|
680
714
|
return e;
|
|
681
715
|
}
|
|
682
|
-
function
|
|
716
|
+
function G(e) {
|
|
683
717
|
if (typeof document > "u")
|
|
684
718
|
return;
|
|
685
719
|
const r = document.documentElement;
|
|
686
|
-
|
|
720
|
+
Fe(e) === "dark" ? r.setAttribute("data-theme", "dark") : r.removeAttribute("data-theme");
|
|
687
721
|
}
|
|
688
|
-
function
|
|
722
|
+
function te(e) {
|
|
689
723
|
if (typeof document > "u")
|
|
690
724
|
return;
|
|
691
725
|
const r = document.documentElement;
|
|
692
726
|
e ? r.setAttribute("data-skin", e) : r.removeAttribute("data-skin");
|
|
693
727
|
}
|
|
694
|
-
function
|
|
728
|
+
function rr(e = O) {
|
|
695
729
|
return "(function(){try{var p=JSON.parse(localStorage.getItem(" + JSON.stringify(e) + ")||'{}');var d=document.documentElement;var m=p.mode==='system'?((window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light'):p.mode;if(m==='dark')d.setAttribute('data-theme','dark');if(p.skin)d.setAttribute('data-skin',p.skin);}catch(e){}})();";
|
|
696
730
|
}
|
|
697
|
-
const
|
|
731
|
+
const Pe = {
|
|
698
732
|
raw: {
|
|
699
733
|
white: {
|
|
700
734
|
900: "255, 255, 255"
|
|
@@ -793,7 +827,7 @@ const Fe = {
|
|
|
793
827
|
tertiary: "230, 237, 246"
|
|
794
828
|
}
|
|
795
829
|
}
|
|
796
|
-
},
|
|
830
|
+
}, Ue = {
|
|
797
831
|
radii: {
|
|
798
832
|
none: "0",
|
|
799
833
|
xs: "0.25rem",
|
|
@@ -851,7 +885,7 @@ const Fe = {
|
|
|
851
885
|
inner: "inset 0 2px 4px 0 #0000000d",
|
|
852
886
|
card: "0px 4px 35px 0px #7090b040"
|
|
853
887
|
}
|
|
854
|
-
},
|
|
888
|
+
}, He = {
|
|
855
889
|
fontSizes: {
|
|
856
890
|
xs: "0.625rem",
|
|
857
891
|
sm: "0.75rem",
|
|
@@ -891,11 +925,11 @@ const Fe = {
|
|
|
891
925
|
relaxed: 1.625,
|
|
892
926
|
loose: 2
|
|
893
927
|
}
|
|
894
|
-
},
|
|
895
|
-
colors:
|
|
896
|
-
metrics:
|
|
897
|
-
font:
|
|
898
|
-
},
|
|
928
|
+
}, ve = {
|
|
929
|
+
colors: Pe,
|
|
930
|
+
metrics: Ue,
|
|
931
|
+
font: He
|
|
932
|
+
}, ee = me({
|
|
899
933
|
theme: void 0,
|
|
900
934
|
setTheme: () => {
|
|
901
935
|
},
|
|
@@ -908,20 +942,20 @@ const Fe = {
|
|
|
908
942
|
},
|
|
909
943
|
resetTheme: () => {
|
|
910
944
|
}
|
|
911
|
-
}),
|
|
912
|
-
function
|
|
945
|
+
}), Je = "sa-theme-style", W = "sa-theme-seed-style";
|
|
946
|
+
function Ye(e) {
|
|
913
947
|
const r = e.split(",").map((a) => Number(a.trim()));
|
|
914
948
|
return r.length !== 3 || r.some((a) => !Number.isFinite(a) || a < 0 || a > 255) ? null : "#" + r.map((a) => Math.round(a).toString(16).padStart(2, "0")).join("");
|
|
915
949
|
}
|
|
916
|
-
var
|
|
917
|
-
const
|
|
918
|
-
function
|
|
950
|
+
var ie, de;
|
|
951
|
+
const ze = ((de = (ie = ve.colors) == null ? void 0 : ie.raw) == null ? void 0 : de.blue) ?? {}, le = (e) => (e ?? "").replace(/\s+/g, "");
|
|
952
|
+
function Ge(e) {
|
|
919
953
|
if (!e)
|
|
920
954
|
return "";
|
|
921
955
|
const r = /* @__PURE__ */ new Set(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), a = Object.entries(e).filter(([s]) => r.has(s)).filter(
|
|
922
|
-
([s, c]) =>
|
|
956
|
+
([s, c]) => le(c) !== le(ze[s])
|
|
923
957
|
).map(([s, c]) => {
|
|
924
|
-
const o =
|
|
958
|
+
const o = Ye(c);
|
|
925
959
|
return o ? ` --sa-color-brand-${s}: ${o};` : "";
|
|
926
960
|
}).filter(Boolean).join(`
|
|
927
961
|
`);
|
|
@@ -929,122 +963,122 @@ function ze(e) {
|
|
|
929
963
|
${a}
|
|
930
964
|
}` : "";
|
|
931
965
|
}
|
|
932
|
-
function
|
|
966
|
+
function ar({
|
|
933
967
|
value: e,
|
|
934
968
|
seed: r,
|
|
935
969
|
persist: a = !0,
|
|
936
|
-
storageKey: s =
|
|
970
|
+
storageKey: s = O,
|
|
937
971
|
manageAttributes: c = !1,
|
|
938
972
|
children: o
|
|
939
973
|
}) {
|
|
940
|
-
const [n, d] = _(e), t = r !== void 0, [b,
|
|
974
|
+
const [n, d] = _(e), t = r !== void 0, [b, g] = _(() => {
|
|
941
975
|
if (t)
|
|
942
976
|
return r;
|
|
943
977
|
if (a) {
|
|
944
|
-
const i =
|
|
978
|
+
const i = j(s);
|
|
945
979
|
if (i != null && i.seed)
|
|
946
980
|
return i.seed;
|
|
947
981
|
}
|
|
948
982
|
return null;
|
|
949
|
-
}),
|
|
950
|
-
() =>
|
|
951
|
-
[
|
|
983
|
+
}), k = t ? r : b, f = Q(
|
|
984
|
+
() => k ? JSON.stringify(k) : "",
|
|
985
|
+
[k]
|
|
952
986
|
);
|
|
953
|
-
|
|
987
|
+
I(() => {
|
|
954
988
|
if (typeof document > "u")
|
|
955
989
|
return;
|
|
956
|
-
if (!
|
|
957
|
-
const l = document.getElementById(
|
|
990
|
+
if (!f) {
|
|
991
|
+
const l = document.getElementById(W);
|
|
958
992
|
l && (l.textContent = "");
|
|
959
993
|
return;
|
|
960
994
|
}
|
|
961
|
-
const { css: i } =
|
|
962
|
-
|
|
963
|
-
}, [
|
|
995
|
+
const { css: i } = Ne(JSON.parse(f));
|
|
996
|
+
he(i, W);
|
|
997
|
+
}, [f]), I(() => {
|
|
964
998
|
var l;
|
|
965
999
|
if (!c || !a)
|
|
966
1000
|
return;
|
|
967
|
-
const i =
|
|
968
|
-
if (i && (i.mode &&
|
|
969
|
-
const
|
|
970
|
-
return (l =
|
|
971
|
-
var
|
|
972
|
-
return (
|
|
1001
|
+
const i = j(s);
|
|
1002
|
+
if (i && (i.mode && G(i.mode), i.skin !== void 0 && te(i.skin), i.mode === "system" && typeof window < "u")) {
|
|
1003
|
+
const y = window.matchMedia("(prefers-color-scheme: dark)"), L = () => G("system");
|
|
1004
|
+
return (l = y.addEventListener) == null || l.call(y, "change", L), () => {
|
|
1005
|
+
var re;
|
|
1006
|
+
return (re = y.removeEventListener) == null ? void 0 : re.call(y, "change", L);
|
|
973
1007
|
};
|
|
974
1008
|
}
|
|
975
1009
|
}, [c, a, s]);
|
|
976
|
-
const
|
|
1010
|
+
const p = Q(
|
|
977
1011
|
() => n ? JSON.stringify(n) : "",
|
|
978
1012
|
[n]
|
|
979
|
-
), m =
|
|
980
|
-
|
|
981
|
-
var
|
|
982
|
-
m.current || (m.current =
|
|
1013
|
+
), m = ye(null);
|
|
1014
|
+
I(() => {
|
|
1015
|
+
var y, L;
|
|
1016
|
+
m.current || (m.current = we(Je));
|
|
983
1017
|
const i = m.current;
|
|
984
1018
|
if (!i)
|
|
985
1019
|
return;
|
|
986
|
-
const l =
|
|
987
|
-
i.textContent = l ?
|
|
988
|
-
}, [
|
|
1020
|
+
const l = p ? JSON.parse(p) : void 0;
|
|
1021
|
+
i.textContent = l ? Ge((L = (y = l == null ? void 0 : l.colors) == null ? void 0 : y.raw) == null ? void 0 : L.blue) : "";
|
|
1022
|
+
}, [p]), I(() => () => {
|
|
989
1023
|
m.current && (m.current.textContent = "");
|
|
990
1024
|
}, []);
|
|
991
|
-
const
|
|
1025
|
+
const E = (i) => {
|
|
992
1026
|
i && d(i);
|
|
993
|
-
},
|
|
1027
|
+
}, h = $(
|
|
994
1028
|
(i) => {
|
|
995
1029
|
if (!a)
|
|
996
1030
|
return;
|
|
997
|
-
const l =
|
|
998
|
-
|
|
1031
|
+
const l = j(s) || {};
|
|
1032
|
+
je({ ...l, ...i }, s);
|
|
999
1033
|
},
|
|
1000
1034
|
[a, s]
|
|
1001
|
-
),
|
|
1035
|
+
), x = $(
|
|
1002
1036
|
(i) => {
|
|
1003
|
-
t || (
|
|
1037
|
+
t || (g(i), h({ seed: i }));
|
|
1004
1038
|
},
|
|
1005
|
-
[t,
|
|
1006
|
-
),
|
|
1039
|
+
[t, h]
|
|
1040
|
+
), M = $(
|
|
1007
1041
|
(i) => {
|
|
1008
|
-
|
|
1042
|
+
G(i), h({ mode: i });
|
|
1009
1043
|
},
|
|
1010
|
-
[
|
|
1011
|
-
),
|
|
1044
|
+
[h]
|
|
1045
|
+
), u = $(
|
|
1012
1046
|
(i) => {
|
|
1013
|
-
|
|
1047
|
+
te(i), h({ skin: i });
|
|
1014
1048
|
},
|
|
1015
|
-
[
|
|
1016
|
-
),
|
|
1017
|
-
if (t ||
|
|
1018
|
-
const i = document.getElementById(
|
|
1049
|
+
[h]
|
|
1050
|
+
), v = $(() => {
|
|
1051
|
+
if (t || g(null), Te(s), typeof document < "u") {
|
|
1052
|
+
const i = document.getElementById(W);
|
|
1019
1053
|
i && (i.textContent = "");
|
|
1020
1054
|
}
|
|
1021
1055
|
}, [t, s]);
|
|
1022
|
-
return /* @__PURE__ */
|
|
1023
|
-
|
|
1056
|
+
return /* @__PURE__ */ C(
|
|
1057
|
+
ee.Provider,
|
|
1024
1058
|
{
|
|
1025
1059
|
value: {
|
|
1026
1060
|
theme: n,
|
|
1027
|
-
setTheme:
|
|
1028
|
-
seed:
|
|
1029
|
-
setSeed:
|
|
1030
|
-
setMode:
|
|
1031
|
-
setSkin:
|
|
1032
|
-
resetTheme:
|
|
1061
|
+
setTheme: E,
|
|
1062
|
+
seed: k,
|
|
1063
|
+
setSeed: x,
|
|
1064
|
+
setMode: M,
|
|
1065
|
+
setSkin: u,
|
|
1066
|
+
resetTheme: v
|
|
1033
1067
|
},
|
|
1034
1068
|
children: o
|
|
1035
1069
|
}
|
|
1036
1070
|
);
|
|
1037
1071
|
}
|
|
1038
|
-
const
|
|
1072
|
+
const We = [
|
|
1039
1073
|
{ name: null, label: "Default" },
|
|
1040
1074
|
{ name: "tech", label: "Tech" }
|
|
1041
|
-
],
|
|
1075
|
+
], Ke = [
|
|
1042
1076
|
{ value: "light", label: "Light" },
|
|
1043
1077
|
{ value: "dark", label: "Dark" },
|
|
1044
1078
|
{ value: "system", label: "System" }
|
|
1045
1079
|
];
|
|
1046
|
-
function
|
|
1047
|
-
skins: e =
|
|
1080
|
+
function sr({
|
|
1081
|
+
skins: e = We,
|
|
1048
1082
|
showMode: r = !0,
|
|
1049
1083
|
allowCustom: a = !1,
|
|
1050
1084
|
storageKey: s,
|
|
@@ -1052,23 +1086,23 @@ function ar({
|
|
|
1052
1086
|
style: o
|
|
1053
1087
|
}) {
|
|
1054
1088
|
var i;
|
|
1055
|
-
const { setMode: n, setSkin: d, setSeed: t } =
|
|
1089
|
+
const { setMode: n, setSkin: d, setSeed: t } = be(ee), b = typeof window < "u" ? j(s) : null, [g, k] = _(
|
|
1056
1090
|
(b == null ? void 0 : b.mode) ?? (typeof document < "u" && document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light")
|
|
1057
|
-
), [
|
|
1091
|
+
), [f, p] = _(
|
|
1058
1092
|
(b == null ? void 0 : b.skin) ?? (typeof document < "u" ? document.documentElement.getAttribute("data-skin") : null)
|
|
1059
|
-
), [m,
|
|
1060
|
-
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
|
|
1065
|
-
},
|
|
1093
|
+
), [m, E] = _(((i = b == null ? void 0 : b.seed) == null ? void 0 : i.brand) ?? "#1a4fa0"), h = (l) => {
|
|
1094
|
+
k(l), n(l);
|
|
1095
|
+
}, x = (l) => {
|
|
1096
|
+
p(l), d(l);
|
|
1097
|
+
}, M = (l) => {
|
|
1098
|
+
E(l), t({ brand: l });
|
|
1099
|
+
}, u = {
|
|
1066
1100
|
display: "inline-flex",
|
|
1067
1101
|
gap: 4,
|
|
1068
1102
|
padding: 4,
|
|
1069
1103
|
borderRadius: "var(--sa-radii-md)",
|
|
1070
1104
|
background: "var(--sa-background-neutral)"
|
|
1071
|
-
},
|
|
1105
|
+
}, v = (l) => ({
|
|
1072
1106
|
border: "none",
|
|
1073
1107
|
cursor: "pointer",
|
|
1074
1108
|
fontSize: 12,
|
|
@@ -1079,35 +1113,35 @@ function ar({
|
|
|
1079
1113
|
color: l ? "var(--sa-text-primary)" : "var(--sa-text-subtle)",
|
|
1080
1114
|
boxShadow: l ? "var(--sa-shadow-sm)" : "none"
|
|
1081
1115
|
});
|
|
1082
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ ae(
|
|
1083
1117
|
"div",
|
|
1084
1118
|
{
|
|
1085
1119
|
className: c,
|
|
1086
1120
|
style: { display: "flex", gap: 12, flexWrap: "wrap", alignItems: "center", ...o },
|
|
1087
1121
|
children: [
|
|
1088
|
-
r && /* @__PURE__ */
|
|
1122
|
+
r && /* @__PURE__ */ C("div", { role: "group", "aria-label": "Mode", style: u, children: Ke.map((l) => /* @__PURE__ */ C(
|
|
1089
1123
|
"button",
|
|
1090
1124
|
{
|
|
1091
1125
|
type: "button",
|
|
1092
|
-
"aria-pressed":
|
|
1093
|
-
style:
|
|
1094
|
-
onClick: () =>
|
|
1126
|
+
"aria-pressed": g === l.value,
|
|
1127
|
+
style: v(g === l.value),
|
|
1128
|
+
onClick: () => h(l.value),
|
|
1095
1129
|
children: l.label
|
|
1096
1130
|
},
|
|
1097
1131
|
l.value
|
|
1098
1132
|
)) }),
|
|
1099
|
-
e.length > 0 && /* @__PURE__ */
|
|
1133
|
+
e.length > 0 && /* @__PURE__ */ C("div", { role: "group", "aria-label": "Skin", style: u, children: e.map((l) => /* @__PURE__ */ C(
|
|
1100
1134
|
"button",
|
|
1101
1135
|
{
|
|
1102
1136
|
type: "button",
|
|
1103
|
-
"aria-pressed":
|
|
1104
|
-
style:
|
|
1105
|
-
onClick: () =>
|
|
1137
|
+
"aria-pressed": f === l.name,
|
|
1138
|
+
style: v(f === l.name),
|
|
1139
|
+
onClick: () => x(l.name),
|
|
1106
1140
|
children: l.label
|
|
1107
1141
|
},
|
|
1108
1142
|
l.name ?? "default"
|
|
1109
1143
|
)) }),
|
|
1110
|
-
a && /* @__PURE__ */
|
|
1144
|
+
a && /* @__PURE__ */ ae(
|
|
1111
1145
|
"label",
|
|
1112
1146
|
{
|
|
1113
1147
|
style: {
|
|
@@ -1119,12 +1153,12 @@ function ar({
|
|
|
1119
1153
|
},
|
|
1120
1154
|
children: [
|
|
1121
1155
|
"Brand",
|
|
1122
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ C(
|
|
1123
1157
|
"input",
|
|
1124
1158
|
{
|
|
1125
1159
|
type: "color",
|
|
1126
1160
|
value: m,
|
|
1127
|
-
onChange: (l) =>
|
|
1161
|
+
onChange: (l) => M(l.target.value),
|
|
1128
1162
|
"aria-label": "Custom brand color",
|
|
1129
1163
|
style: {
|
|
1130
1164
|
width: 28,
|
|
@@ -1144,57 +1178,57 @@ function ar({
|
|
|
1144
1178
|
}
|
|
1145
1179
|
);
|
|
1146
1180
|
}
|
|
1147
|
-
const
|
|
1181
|
+
const K = ve, ge = (e, r) => {
|
|
1148
1182
|
const a = {};
|
|
1149
1183
|
return Object.keys(e).forEach((s) => {
|
|
1150
1184
|
if (e != null && e[s] && typeof (e == null ? void 0 : e[s]) == "object") {
|
|
1151
1185
|
a[s] = {
|
|
1152
1186
|
...e == null ? void 0 : e[s],
|
|
1153
1187
|
...r == null ? void 0 : r[s],
|
|
1154
|
-
...
|
|
1188
|
+
...ge(e == null ? void 0 : e[s], r == null ? void 0 : r[s])
|
|
1155
1189
|
};
|
|
1156
1190
|
return;
|
|
1157
1191
|
}
|
|
1158
1192
|
a[s] = (r == null ? void 0 : r[s]) || (e == null ? void 0 : e[s]);
|
|
1159
1193
|
}), a;
|
|
1160
1194
|
};
|
|
1161
|
-
function
|
|
1162
|
-
const e =
|
|
1195
|
+
function J() {
|
|
1196
|
+
const e = be(ee), r = Q(
|
|
1163
1197
|
() => ({
|
|
1164
|
-
...
|
|
1198
|
+
...K,
|
|
1165
1199
|
...e.theme,
|
|
1166
|
-
...
|
|
1200
|
+
...ge(K, e.theme)
|
|
1167
1201
|
}),
|
|
1168
|
-
[e.theme,
|
|
1202
|
+
[e.theme, K]
|
|
1169
1203
|
);
|
|
1170
1204
|
return { ...e, theme: r };
|
|
1171
1205
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const { theme: e } =
|
|
1206
|
+
function or() {
|
|
1207
|
+
const { theme: e } = J();
|
|
1174
1208
|
return e.colors;
|
|
1175
1209
|
}
|
|
1176
|
-
function
|
|
1210
|
+
function cr() {
|
|
1177
1211
|
var r;
|
|
1178
|
-
const { theme: e } =
|
|
1212
|
+
const { theme: e } = J();
|
|
1179
1213
|
return (r = e.metrics) == null ? void 0 : r.spacing;
|
|
1180
1214
|
}
|
|
1181
|
-
function
|
|
1215
|
+
function nr() {
|
|
1182
1216
|
var r;
|
|
1183
|
-
const { theme: e } =
|
|
1217
|
+
const { theme: e } = J();
|
|
1184
1218
|
return (r = e.metrics) == null ? void 0 : r.radii;
|
|
1185
1219
|
}
|
|
1186
|
-
function
|
|
1220
|
+
function tr() {
|
|
1187
1221
|
var r;
|
|
1188
|
-
const { theme: e } =
|
|
1222
|
+
const { theme: e } = J();
|
|
1189
1223
|
return (r = e == null ? void 0 : e.metrics) == null ? void 0 : r.shadows;
|
|
1190
1224
|
}
|
|
1191
|
-
function
|
|
1225
|
+
function lr(e) {
|
|
1192
1226
|
return e;
|
|
1193
1227
|
}
|
|
1194
|
-
function
|
|
1195
|
-
return
|
|
1228
|
+
function Qe(e) {
|
|
1229
|
+
return fe(e) ? "dark" : "light";
|
|
1196
1230
|
}
|
|
1197
|
-
const
|
|
1231
|
+
const Ve = [
|
|
1198
1232
|
// terang
|
|
1199
1233
|
{ name: "light", base: "#ffffff", brand: "#2563eb" },
|
|
1200
1234
|
{ name: "cupcake", base: "#faf7f5", brand: "#65c3c8" },
|
|
@@ -1230,50 +1264,50 @@ const Qe = [
|
|
|
1230
1264
|
{ name: "sunset", base: "#1b2433", brand: "#ff865b" },
|
|
1231
1265
|
{ name: "black", base: "#000000", brand: "#6a6a6a" },
|
|
1232
1266
|
{ name: "abyss", base: "#001a1a", brand: "#18c9b4" }
|
|
1233
|
-
],
|
|
1267
|
+
], ir = Ve.map((e) => ({
|
|
1234
1268
|
name: e.name,
|
|
1235
1269
|
label: e.label ?? e.name.charAt(0).toUpperCase() + e.name.slice(1),
|
|
1236
1270
|
base: e.base,
|
|
1237
1271
|
brand: e.brand,
|
|
1238
|
-
scheme:
|
|
1272
|
+
scheme: Qe(e.base)
|
|
1239
1273
|
}));
|
|
1240
1274
|
export {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1275
|
+
O as DEFAULT_STORAGE_KEY,
|
|
1276
|
+
U as LADDERS,
|
|
1277
|
+
Le as NEUTRAL_LADDER_DARK,
|
|
1278
|
+
Ae as NEUTRAL_LADDER_GRAY,
|
|
1279
|
+
er as SA_DEFAULT_SEED,
|
|
1280
|
+
F as SCALE_KEYS_10,
|
|
1281
|
+
P as SCALE_KEYS_12,
|
|
1282
|
+
ir as THEME_PRESETS,
|
|
1283
|
+
ee as ThemeContext,
|
|
1284
|
+
ar as ThemeProvider,
|
|
1285
|
+
sr as ThemeSwitcher,
|
|
1286
|
+
G as applyMode,
|
|
1287
|
+
te as applySkin,
|
|
1288
|
+
Ne as buildTheme,
|
|
1289
|
+
Te as clearPref,
|
|
1290
|
+
X as contrastRatio,
|
|
1291
|
+
lr as createTheme,
|
|
1292
|
+
Qe as getThemeScheme,
|
|
1293
|
+
w as hexToOklch,
|
|
1294
|
+
T as hexToRgb,
|
|
1295
|
+
fe as isDarkColor,
|
|
1296
|
+
oe as neutralRamp,
|
|
1297
|
+
N as oklchToHex,
|
|
1298
|
+
qe as pickByLightness,
|
|
1299
|
+
R as pickTextOn,
|
|
1300
|
+
ce as rampBetween,
|
|
1301
|
+
H as rampFromSeed,
|
|
1302
|
+
j as readPref,
|
|
1303
|
+
Fe as resolveMode,
|
|
1304
|
+
xe as rgbToHex,
|
|
1305
|
+
Me as rgbToOklch,
|
|
1306
|
+
rr as themeBootScript,
|
|
1307
|
+
or as useColor,
|
|
1308
|
+
nr as useRadius,
|
|
1309
|
+
tr as useShadow,
|
|
1310
|
+
cr as useSpacing,
|
|
1311
|
+
J as useTheme,
|
|
1312
|
+
je as writePref
|
|
1279
1313
|
};
|