@gryt/theme 0.9.0 → 0.9.1
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +105 -98
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ne = [
|
|
2
2
|
0,
|
|
3
3
|
0.1217,
|
|
4
4
|
0.3812,
|
|
@@ -54,7 +54,7 @@ const re = [
|
|
|
54
54
|
0.9981,
|
|
55
55
|
0.9986,
|
|
56
56
|
1
|
|
57
|
-
],
|
|
57
|
+
], ce = {
|
|
58
58
|
/** Most interactions. */
|
|
59
59
|
spring: 500,
|
|
60
60
|
/** Drawer, where the travel is the width of a panel. */
|
|
@@ -99,10 +99,10 @@ function Y(e) {
|
|
|
99
99
|
function $(e) {
|
|
100
100
|
return e <= 31308e-7 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - 0.055;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function w(e) {
|
|
103
103
|
return Math.min(1, Math.max(0, e));
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function v(e) {
|
|
106
106
|
const a = e.replace("#", ""), n = a.length === 3 ? a.split("").map((r) => r + r).join("") : a;
|
|
107
107
|
return [
|
|
108
108
|
parseInt(n.slice(0, 2), 16) / 255,
|
|
@@ -111,11 +111,11 @@ function w(e) {
|
|
|
111
111
|
];
|
|
112
112
|
}
|
|
113
113
|
function B([e, a, n]) {
|
|
114
|
-
const r = (o) => Math.round(
|
|
114
|
+
const r = (o) => Math.round(w(o) * 255).toString(16).padStart(2, "0");
|
|
115
115
|
return `#${r(e)}${r(a)}${r(n)}`;
|
|
116
116
|
}
|
|
117
117
|
function A(e) {
|
|
118
|
-
const [a, n, r] =
|
|
118
|
+
const [a, n, r] = v(e).map(Y), o = Math.cbrt(
|
|
119
119
|
0.4122214708 * a + 0.5363325363 * n + 0.0514459929 * r
|
|
120
120
|
), t = Math.cbrt(
|
|
121
121
|
0.2119034982 * a + 0.6806995451 * n + 0.1073969566 * r
|
|
@@ -131,19 +131,19 @@ function A(e) {
|
|
|
131
131
|
function L({ l: e, c: a, h: n }) {
|
|
132
132
|
const r = a * Math.cos(n * Math.PI / 180), o = a * Math.sin(n * Math.PI / 180), t = (e + 0.3963377774 * r + 0.2158037573 * o) ** 3, c = (e - 0.1055613458 * r - 0.0638541728 * o) ** 3, s = (e - 0.0894841775 * r - 1.291485548 * o) ** 3;
|
|
133
133
|
return B([
|
|
134
|
-
$(
|
|
135
|
-
$(
|
|
136
|
-
$(
|
|
134
|
+
$(w(4.0767416621 * t - 3.3077115913 * c + 0.2309699292 * s)),
|
|
135
|
+
$(w(-1.2684380046 * t + 2.6097574011 * c - 0.3413193965 * s)),
|
|
136
|
+
$(w(-0.0041960863 * t - 0.7034186147 * c + 1.707614701 * s))
|
|
137
137
|
]);
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const oe = [0.195, 0.24, 0.27, 0.3, 0.33, 0.37, 0.43, 0.52], se = [0.014, 0.026, 0.04, 0.052, 0.062, 0.072, 0.084, 0.1];
|
|
140
140
|
function y(e, a) {
|
|
141
|
-
const { h: n } = A(e), r =
|
|
141
|
+
const { h: n } = A(e), r = oe.map((s, i) => L({ l: s, c: se[i], h: n }));
|
|
142
142
|
r.push(e, a);
|
|
143
143
|
const o = A(a).l, t = Math.min(0.95, Math.max(0.84, o + 0.04)), c = Math.min(0.98, Math.max(t + 0.06, 0.93));
|
|
144
144
|
return r.push(L({ l: t, c: 0.11, h: n })), r.push(L({ l: c, c: 0.055, h: n })), r;
|
|
145
145
|
}
|
|
146
|
-
const
|
|
146
|
+
const fe = [
|
|
147
147
|
0.187,
|
|
148
148
|
0.231,
|
|
149
149
|
0.245,
|
|
@@ -156,7 +156,7 @@ const ce = [
|
|
|
156
156
|
0.57,
|
|
157
157
|
0.627,
|
|
158
158
|
0.908
|
|
159
|
-
],
|
|
159
|
+
], de = [
|
|
160
160
|
0.011,
|
|
161
161
|
0.014,
|
|
162
162
|
0.016,
|
|
@@ -179,14 +179,14 @@ function z(e) {
|
|
|
179
179
|
10: e.muted,
|
|
180
180
|
11: e.text
|
|
181
181
|
}, n = A(e.border).h;
|
|
182
|
-
return
|
|
183
|
-
(r, o) => a[o] ?? L({ l: r, c:
|
|
182
|
+
return fe.map(
|
|
183
|
+
(r, o) => a[o] ?? L({ l: r, c: de[o], h: n })
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
186
|
function S(e, a) {
|
|
187
|
-
const n =
|
|
187
|
+
const n = v(a);
|
|
188
188
|
return e.map((r) => {
|
|
189
|
-
const o =
|
|
189
|
+
const o = v(r);
|
|
190
190
|
let t = 0;
|
|
191
191
|
for (let l = 0; l < 3; l++) {
|
|
192
192
|
const u = o[l], d = n[l];
|
|
@@ -194,12 +194,12 @@ function S(e, a) {
|
|
|
194
194
|
}
|
|
195
195
|
if (t < 1e-6) return "transparent";
|
|
196
196
|
const c = B(
|
|
197
|
-
o.map((l, u) =>
|
|
198
|
-
), [s, i, g] =
|
|
197
|
+
o.map((l, u) => w(n[u] + (l - n[u]) / t))
|
|
198
|
+
), [s, i, g] = v(c).map((l) => Math.round(l * 255));
|
|
199
199
|
return `rgb(${s} ${i} ${g} / ${(t * 100).toFixed(1)}%)`;
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
|
-
const
|
|
202
|
+
const ie = [
|
|
203
203
|
0.962,
|
|
204
204
|
1,
|
|
205
205
|
0.978,
|
|
@@ -212,7 +212,7 @@ const se = [
|
|
|
212
212
|
0.61,
|
|
213
213
|
0.48,
|
|
214
214
|
0.25
|
|
215
|
-
],
|
|
215
|
+
], ue = [
|
|
216
216
|
6e-3,
|
|
217
217
|
0,
|
|
218
218
|
4e-3,
|
|
@@ -225,7 +225,7 @@ const se = [
|
|
|
225
225
|
0.014,
|
|
226
226
|
0.012,
|
|
227
227
|
0.014
|
|
228
|
-
],
|
|
228
|
+
], ge = [0.975, 0.955, 0.93, 0.905, 0.878, 0.845, 0.795, 0.72], le = [0.012, 0.024, 0.038, 0.05, 0.062, 0.074, 0.09, 0.11];
|
|
229
229
|
function W(e) {
|
|
230
230
|
const a = {
|
|
231
231
|
0: e.bg,
|
|
@@ -235,18 +235,18 @@ function W(e) {
|
|
|
235
235
|
10: e.muted,
|
|
236
236
|
11: e.text
|
|
237
237
|
}, n = A(e.border).h;
|
|
238
|
-
return
|
|
239
|
-
(r, o) => a[o] ?? L({ l: r, c:
|
|
238
|
+
return ie.map(
|
|
239
|
+
(r, o) => a[o] ?? L({ l: r, c: ue[o], h: n })
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
function m(e) {
|
|
243
|
-
const { l: a, c: n, h: r } = A(e), o =
|
|
244
|
-
(t, c) => L({ l: t, c:
|
|
243
|
+
const { l: a, c: n, h: r } = A(e), o = ge.map(
|
|
244
|
+
(t, c) => L({ l: t, c: le[c], h: r })
|
|
245
245
|
);
|
|
246
246
|
return o.push(e), o.push(L({ l: Math.max(0, a - 0.07), c: n, h: r })), o.push(L({ l: 0.46, c: 0.15, h: r })), o.push(L({ l: 0.33, c: 0.1, h: r })), o;
|
|
247
247
|
}
|
|
248
248
|
function F(e) {
|
|
249
|
-
const [a, n, r] =
|
|
249
|
+
const [a, n, r] = v(e).map(Y);
|
|
250
250
|
return 0.2126 * a + 0.7152 * n + 0.0722 * r;
|
|
251
251
|
}
|
|
252
252
|
function Se(e, a) {
|
|
@@ -284,7 +284,7 @@ const f = {
|
|
|
284
284
|
xl: 28,
|
|
285
285
|
full: 999
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, h = {
|
|
288
288
|
bg: "#f1f2f7",
|
|
289
289
|
surface: "#ffffff",
|
|
290
290
|
surfaceRaised: "#f7f8fb",
|
|
@@ -309,7 +309,7 @@ const f = {
|
|
|
309
309
|
danger: y(f.color.danger, f.color.dangerLight),
|
|
310
310
|
warning: y(f.color.warning, f.color.warning)
|
|
311
311
|
}, G = {
|
|
312
|
-
neutral: W(
|
|
312
|
+
neutral: W(h),
|
|
313
313
|
accent: m(f.color.accent),
|
|
314
314
|
secondary: m(f.color.secondary),
|
|
315
315
|
success: m(f.color.success),
|
|
@@ -319,13 +319,13 @@ const f = {
|
|
|
319
319
|
neutral: S(O.neutral, f.color.bg),
|
|
320
320
|
accent: S(O.accent, f.color.bg)
|
|
321
321
|
}, Te = {
|
|
322
|
-
neutral: S(G.neutral,
|
|
323
|
-
accent: S(G.accent,
|
|
322
|
+
neutral: S(G.neutral, h.bg),
|
|
323
|
+
accent: S(G.accent, h.bg)
|
|
324
324
|
};
|
|
325
325
|
function Me(e = {}) {
|
|
326
326
|
const a = e.appearance === "light", r = { ...a ? {
|
|
327
327
|
...f.color,
|
|
328
|
-
...
|
|
328
|
+
...h,
|
|
329
329
|
surfaceHover: K
|
|
330
330
|
} : f.color, ...e.color }, o = { ...f.radius, ...e.radius }, t = {
|
|
331
331
|
bg: r.bg,
|
|
@@ -350,25 +350,25 @@ function Me(e = {}) {
|
|
|
350
350
|
warning: y(r.warning, r.warning)
|
|
351
351
|
}, s = {};
|
|
352
352
|
for (const [u, d] of Object.entries(c))
|
|
353
|
-
d.forEach((
|
|
354
|
-
s[`--gryt-${u}-${k + 1}`] =
|
|
353
|
+
d.forEach((b, k) => {
|
|
354
|
+
s[`--gryt-${u}-${k + 1}`] = b, s[`--color-gryt-${u}-${k + 1}`] = b;
|
|
355
355
|
});
|
|
356
356
|
for (const u of ["neutral", "accent"])
|
|
357
|
-
S(c[u], r.bg).forEach((d,
|
|
358
|
-
s[`--gryt-${u}-a${
|
|
357
|
+
S(c[u], r.bg).forEach((d, b) => {
|
|
358
|
+
s[`--gryt-${u}-a${b + 1}`] = d, s[`--color-gryt-${u}-a${b + 1}`] = d;
|
|
359
359
|
});
|
|
360
360
|
const i = (u) => `linear(${u.map((d) => Number(d.toFixed(4))).join(", ")})`, g = {};
|
|
361
361
|
if (e.motion !== void 0) {
|
|
362
362
|
const { scale: u, curve: d } = e.motion;
|
|
363
363
|
if (u !== 1)
|
|
364
|
-
for (const [
|
|
365
|
-
const
|
|
366
|
-
g[`--gryt-dur-${
|
|
364
|
+
for (const [b, k] of Object.entries(ce)) {
|
|
365
|
+
const ae = b.replace(/[A-Z]/g, (te) => `-${te.toLowerCase()}`);
|
|
366
|
+
g[`--gryt-dur-${ae}`] = `${Math.round(k * u)}ms`;
|
|
367
367
|
}
|
|
368
368
|
if (Array.isArray(d)) {
|
|
369
|
-
const
|
|
370
|
-
g["--ease-spring"] =
|
|
371
|
-
} else d === "smooth" ? (g["--ease-spring"] = i(M), g["--ease-spring-tight"] = i(M)) : d === "linear" ? (g["--ease-spring"] = "linear", g["--ease-spring-tight"] = "linear") : (g["--ease-spring"] = i(
|
|
369
|
+
const b = `cubic-bezier(${d.join(", ")})`;
|
|
370
|
+
g["--ease-spring"] = b, g["--ease-spring-tight"] = b;
|
|
371
|
+
} else d === "smooth" ? (g["--ease-spring"] = i(M), g["--ease-spring-tight"] = i(M)) : d === "linear" ? (g["--ease-spring"] = "linear", g["--ease-spring-tight"] = "linear") : (g["--ease-spring"] = i(ne), g["--ease-spring-tight"] = i(M));
|
|
372
372
|
}
|
|
373
373
|
const l = {};
|
|
374
374
|
for (const [u, d] of Object.entries(e.fonts ?? {}))
|
|
@@ -443,29 +443,29 @@ const T = [
|
|
|
443
443
|
"border",
|
|
444
444
|
"muted",
|
|
445
445
|
"text"
|
|
446
|
-
], E = ["sm", "md", "lg", "xl", "full"],
|
|
446
|
+
], E = ["sm", "md", "lg", "xl", "full"], N = ["body", "display", "mono"], X = ["spring", "smooth", "linear"], _ = {
|
|
447
447
|
body: '"Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif',
|
|
448
448
|
display: '"Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif',
|
|
449
449
|
mono: '"Atkinson Hyperlegible Mono", ui-monospace, Menlo, Consolas, monospace'
|
|
450
|
-
},
|
|
451
|
-
function
|
|
450
|
+
}, x = { scale: 1, curve: "spring" }, q = 3;
|
|
451
|
+
function J(e) {
|
|
452
452
|
return Array.isArray(e);
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Z(e) {
|
|
455
455
|
if (!Array.isArray(e) || e.length !== 4) return !1;
|
|
456
456
|
const [a, n, r, o] = e;
|
|
457
457
|
return ![a, n, r, o].every((t) => typeof t == "number" && Number.isFinite(t)) || a < 0 || a > 1 || r < 0 || r > 1 ? !1 : Math.abs(n) <= 10 && Math.abs(o) <= 10;
|
|
458
458
|
}
|
|
459
|
-
const
|
|
460
|
-
function
|
|
459
|
+
const be = 200;
|
|
460
|
+
function Q(e) {
|
|
461
461
|
const a = e.trim();
|
|
462
|
-
return a === "" || a.length >
|
|
462
|
+
return a === "" || a.length > be ? !1 : !/[;{}()<>\\]|\/\*|@import|url\s*\(/i.test(a);
|
|
463
463
|
}
|
|
464
|
-
const
|
|
464
|
+
const he = 60;
|
|
465
465
|
function C(e) {
|
|
466
|
-
return e.replace(/\s+/g, " ").trim().slice(0,
|
|
466
|
+
return e.replace(/\s+/g, " ").trim().slice(0, he);
|
|
467
467
|
}
|
|
468
|
-
const
|
|
468
|
+
const H = {
|
|
469
469
|
hue: {
|
|
470
470
|
accent: f.color.accent,
|
|
471
471
|
accentLight: f.color.accentLight,
|
|
@@ -490,13 +490,13 @@ const x = {
|
|
|
490
490
|
text: f.color.text
|
|
491
491
|
},
|
|
492
492
|
light: {
|
|
493
|
-
bg:
|
|
494
|
-
surface:
|
|
495
|
-
surfaceRaised:
|
|
493
|
+
bg: h.bg,
|
|
494
|
+
surface: h.surface,
|
|
495
|
+
surfaceRaised: h.surfaceRaised,
|
|
496
496
|
surfaceHover: K,
|
|
497
|
-
border:
|
|
498
|
-
muted:
|
|
499
|
-
text:
|
|
497
|
+
border: h.border,
|
|
498
|
+
muted: h.muted,
|
|
499
|
+
text: h.text
|
|
500
500
|
},
|
|
501
501
|
radius: { ...f.radius }
|
|
502
502
|
};
|
|
@@ -512,7 +512,7 @@ function I(e) {
|
|
|
512
512
|
...e.motion == null ? {} : {
|
|
513
513
|
motion: {
|
|
514
514
|
scale: e.motion.scale,
|
|
515
|
-
curve:
|
|
515
|
+
curve: J(e.motion.curve) ? [...e.motion.curve] : e.motion.curve
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
};
|
|
@@ -543,7 +543,7 @@ const R = {
|
|
|
543
543
|
onAccent: "on-accent",
|
|
544
544
|
onSecondary: "on-secondary",
|
|
545
545
|
onDanger: "on-danger"
|
|
546
|
-
},
|
|
546
|
+
}, ee = {
|
|
547
547
|
bg: "bg",
|
|
548
548
|
surface: "surface",
|
|
549
549
|
surfaceRaised: "raised",
|
|
@@ -552,7 +552,7 @@ const R = {
|
|
|
552
552
|
muted: "muted",
|
|
553
553
|
text: "text"
|
|
554
554
|
}, me = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
555
|
-
function
|
|
555
|
+
function re(e) {
|
|
556
556
|
return me.test(e.trim());
|
|
557
557
|
}
|
|
558
558
|
function P(e) {
|
|
@@ -563,23 +563,23 @@ function De(e, a) {
|
|
|
563
563
|
const n = new URLSearchParams(), r = (t) => P(t).slice(1), o = C(e.name ?? "");
|
|
564
564
|
o !== "" && n.set("name", o);
|
|
565
565
|
for (const t of T)
|
|
566
|
-
e.hue[t] !==
|
|
566
|
+
e.hue[t] !== H.hue[t] && n.set(R[t], r(e.hue[t]));
|
|
567
567
|
if (e.lightHue !== null)
|
|
568
568
|
for (const t of T)
|
|
569
569
|
n.set(`lh-${R[t]}`, r(e.lightHue[t]));
|
|
570
570
|
for (const t of ["dark", "light"]) {
|
|
571
571
|
const c = t === "dark" ? "d" : "l";
|
|
572
572
|
for (const s of V)
|
|
573
|
-
e[t][s] !==
|
|
573
|
+
e[t][s] !== H[t][s] && n.set(`${c}-${ee[s]}`, r(e[t][s]));
|
|
574
574
|
}
|
|
575
575
|
for (const t of E)
|
|
576
|
-
e.radius[t] !==
|
|
577
|
-
if (e.motion != null && (e.motion.scale !==
|
|
576
|
+
e.radius[t] !== H.radius[t] && n.set(`r-${t}`, String(e.radius[t]));
|
|
577
|
+
if (e.motion != null && (e.motion.scale !== x.scale && n.set("m-scale", String(e.motion.scale)), e.motion.curve !== x.curve && n.set(
|
|
578
578
|
"m-curve",
|
|
579
|
-
|
|
579
|
+
J(e.motion.curve) ? e.motion.curve.join(",") : e.motion.curve
|
|
580
580
|
)), e.fonts != null)
|
|
581
|
-
for (const t of
|
|
582
|
-
e.fonts[t] !==
|
|
581
|
+
for (const t of N)
|
|
582
|
+
e.fonts[t] !== _[t] && n.set(`f-${t}`, e.fonts[t]);
|
|
583
583
|
return a === "light" && n.set("mode", "light"), n;
|
|
584
584
|
}
|
|
585
585
|
function Ge(e) {
|
|
@@ -590,13 +590,13 @@ function Ge(e) {
|
|
|
590
590
|
return pe(new URLSearchParams(n));
|
|
591
591
|
}
|
|
592
592
|
function pe(e) {
|
|
593
|
-
const a = I(
|
|
593
|
+
const a = I(H);
|
|
594
594
|
let n = !1;
|
|
595
595
|
const r = (t) => {
|
|
596
596
|
const c = e.get(t);
|
|
597
597
|
if (c === null) return null;
|
|
598
598
|
const s = c.startsWith("#") ? c : `#${c}`;
|
|
599
|
-
return
|
|
599
|
+
return re(s) ? (n = !0, P(s)) : null;
|
|
600
600
|
}, o = C(e.get("name") ?? "");
|
|
601
601
|
o !== "" && (a.name = o, n = !0);
|
|
602
602
|
for (const t of T) {
|
|
@@ -614,7 +614,7 @@ function pe(e) {
|
|
|
614
614
|
for (const t of ["dark", "light"]) {
|
|
615
615
|
const c = t === "dark" ? "d" : "l";
|
|
616
616
|
for (const s of V) {
|
|
617
|
-
const i = r(`${c}-${
|
|
617
|
+
const i = r(`${c}-${ee[s]}`);
|
|
618
618
|
i !== null && (a[t][s] = i);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
@@ -626,23 +626,23 @@ function pe(e) {
|
|
|
626
626
|
const t = e.get("m-scale");
|
|
627
627
|
if (t !== null) {
|
|
628
628
|
const s = Number(t);
|
|
629
|
-
Number.isFinite(s) && s >= 0 && s <=
|
|
629
|
+
Number.isFinite(s) && s >= 0 && s <= q && (a.motion = { ...a.motion ?? x, scale: s }, n = !0);
|
|
630
630
|
}
|
|
631
631
|
const c = e.get("m-curve");
|
|
632
632
|
if (c !== null)
|
|
633
|
-
if (
|
|
633
|
+
if (X.includes(c))
|
|
634
634
|
a.motion = {
|
|
635
|
-
...a.motion ??
|
|
635
|
+
...a.motion ?? x,
|
|
636
636
|
curve: c
|
|
637
637
|
}, n = !0;
|
|
638
638
|
else {
|
|
639
639
|
const s = c.split(",").map(Number);
|
|
640
|
-
|
|
640
|
+
Z(s) && (a.motion = { ...a.motion ?? x, curve: s }, n = !0);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
for (const t of
|
|
643
|
+
for (const t of N) {
|
|
644
644
|
const c = e.get(`f-${t}`);
|
|
645
|
-
c !== null &&
|
|
645
|
+
c !== null && Q(c) && (a.fonts = { ...a.fonts ?? _, [t]: c.trim() }, n = !0);
|
|
646
646
|
}
|
|
647
647
|
return n ? {
|
|
648
648
|
theme: a,
|
|
@@ -657,12 +657,12 @@ function Le(e) {
|
|
|
657
657
|
return null;
|
|
658
658
|
}
|
|
659
659
|
if (typeof a != "object" || a === null) return null;
|
|
660
|
-
const n = a, r = I(
|
|
660
|
+
const n = a, r = I(H);
|
|
661
661
|
let o = !1;
|
|
662
662
|
const t = (c, s) => {
|
|
663
663
|
if (!(typeof c != "object" || c === null))
|
|
664
664
|
for (const [i, g] of Object.entries(c))
|
|
665
|
-
typeof g == "string" &&
|
|
665
|
+
typeof g == "string" && re(g) && i in s && (s[i] = P(g), o = !0);
|
|
666
666
|
};
|
|
667
667
|
if (typeof n.name == "string") {
|
|
668
668
|
const c = C(n.name);
|
|
@@ -672,11 +672,18 @@ function Le(e) {
|
|
|
672
672
|
const c = { ...r.hue };
|
|
673
673
|
t(n.lightHue, c), r.lightHue = c;
|
|
674
674
|
}
|
|
675
|
+
if (typeof n.motion == "object" && n.motion !== null) {
|
|
676
|
+
const c = n.motion, s = Number(c.scale);
|
|
677
|
+
Number.isFinite(s) && s >= 0 && s <= q && (r.motion = { ...r.motion ?? x, scale: s }, o = !0), typeof c.curve == "string" ? X.includes(c.curve) && (r.motion = {
|
|
678
|
+
...r.motion ?? x,
|
|
679
|
+
curve: c.curve
|
|
680
|
+
}, o = !0) : Z(c.curve) && (r.motion = { ...r.motion ?? x, curve: c.curve }, o = !0);
|
|
681
|
+
}
|
|
675
682
|
if (typeof n.fonts == "object" && n.fonts !== null)
|
|
676
683
|
for (const [c, s] of Object.entries(
|
|
677
684
|
n.fonts
|
|
678
685
|
))
|
|
679
|
-
|
|
686
|
+
N.includes(c) && (typeof s != "string" || !Q(s) || (r.fonts = { ...r.fonts ?? _, [c]: s.trim() }, o = !0));
|
|
680
687
|
if (typeof n.radius == "object" && n.radius !== null)
|
|
681
688
|
for (const [c, s] of Object.entries(
|
|
682
689
|
n.radius
|
|
@@ -693,7 +700,7 @@ const p = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, D = { sm: 6, md: 8, lg:
|
|
|
693
700
|
note: "What the library ships, from the Gryt code-theme.",
|
|
694
701
|
group: "Gryt",
|
|
695
702
|
source: "github.com/Gryt-chat/code-theme",
|
|
696
|
-
theme:
|
|
703
|
+
theme: H
|
|
697
704
|
},
|
|
698
705
|
{
|
|
699
706
|
/* Credits to Carlo, who made this in the generator and sent the link.
|
|
@@ -706,7 +713,7 @@ const p = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, D = { sm: 6, md: 8, lg:
|
|
|
706
713
|
note: "The shipped palette, every corner at eight pixels. Made by Carlo.",
|
|
707
714
|
group: "Gryt",
|
|
708
715
|
source: "Carlo",
|
|
709
|
-
theme: { ...I(
|
|
716
|
+
theme: { ...I(H), name: "Gryt Rounded", radius: He }
|
|
710
717
|
},
|
|
711
718
|
{
|
|
712
719
|
id: "ember",
|
|
@@ -1581,14 +1588,14 @@ const p = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, D = { sm: 6, md: 8, lg:
|
|
|
1581
1588
|
we.map((e) => [e.id, e])
|
|
1582
1589
|
);
|
|
1583
1590
|
export {
|
|
1584
|
-
|
|
1585
|
-
|
|
1591
|
+
N as GRYT_FONT_KEYS,
|
|
1592
|
+
be as GRYT_FONT_STACK_MAX,
|
|
1586
1593
|
T as GRYT_HUE_KEYS,
|
|
1587
|
-
|
|
1588
|
-
|
|
1594
|
+
X as GRYT_MOTION_CURVES,
|
|
1595
|
+
q as GRYT_MOTION_SCALE_MAX,
|
|
1589
1596
|
V as GRYT_NEUTRAL_KEYS,
|
|
1590
1597
|
E as GRYT_RADIUS_KEYS,
|
|
1591
|
-
|
|
1598
|
+
he as GRYT_THEME_NAME_MAX,
|
|
1592
1599
|
S as alphaScale,
|
|
1593
1600
|
I as cloneGrytTheme,
|
|
1594
1601
|
Se as contrast,
|
|
@@ -1598,27 +1605,27 @@ export {
|
|
|
1598
1605
|
ke as grytAlphaScales,
|
|
1599
1606
|
Te as grytAlphaScalesLight,
|
|
1600
1607
|
Re as grytDrawerBleed,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1608
|
+
ce as grytDurations,
|
|
1609
|
+
_ as grytFonts,
|
|
1610
|
+
h as grytLightTokens,
|
|
1611
|
+
x as grytMotion,
|
|
1605
1612
|
we as grytPresets,
|
|
1606
1613
|
Ee as grytPresetsById,
|
|
1607
1614
|
ve as grytScaleSteps,
|
|
1608
1615
|
O as grytScales,
|
|
1609
1616
|
G as grytScalesLight,
|
|
1610
|
-
|
|
1617
|
+
H as grytTheme,
|
|
1611
1618
|
ye as grytThemeHues,
|
|
1612
1619
|
$e as grytThemeToOptions,
|
|
1613
1620
|
f as grytTokens,
|
|
1614
1621
|
A as hexToOklch,
|
|
1615
|
-
|
|
1622
|
+
v as hexToRgb,
|
|
1616
1623
|
y as hueScale,
|
|
1617
1624
|
m as hueScaleLight,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1625
|
+
J as isBezier,
|
|
1626
|
+
Q as isFontStack,
|
|
1627
|
+
re as isHexColor,
|
|
1628
|
+
Z as isValidBezier,
|
|
1622
1629
|
z as neutralScale,
|
|
1623
1630
|
W as neutralScaleLight,
|
|
1624
1631
|
P as normalizeHexColor,
|
|
@@ -1626,7 +1633,7 @@ export {
|
|
|
1626
1633
|
L as oklchToHex,
|
|
1627
1634
|
B as rgbToHex,
|
|
1628
1635
|
Ae as sampleCurve,
|
|
1629
|
-
|
|
1636
|
+
ne as springSamples,
|
|
1630
1637
|
M as springTightSamples
|
|
1631
1638
|
};
|
|
1632
1639
|
//# sourceMappingURL=index.js.map
|