@gryt/theme 0.7.0 → 0.9.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/createGrytTheme.d.ts +16 -0
- package/dist/createGrytTheme.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +613 -455
- package/dist/index.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/dist/theme.d.ts +112 -0
- package/dist/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,54 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const re = [
|
|
2
|
+
0,
|
|
3
|
+
0.1217,
|
|
4
|
+
0.3812,
|
|
5
|
+
0.6579,
|
|
6
|
+
0.883,
|
|
7
|
+
1.0304,
|
|
8
|
+
1.1034,
|
|
9
|
+
1.12,
|
|
10
|
+
1.1025,
|
|
11
|
+
1.0705,
|
|
12
|
+
1.0376,
|
|
13
|
+
1.0115,
|
|
14
|
+
0.9949,
|
|
15
|
+
0.987,
|
|
16
|
+
0.9857,
|
|
17
|
+
0.9881,
|
|
18
|
+
0.992,
|
|
19
|
+
0.9959,
|
|
20
|
+
0.9989,
|
|
21
|
+
1.0008,
|
|
22
|
+
1.0016,
|
|
23
|
+
1.0017,
|
|
24
|
+
1.0014,
|
|
25
|
+
1.0009,
|
|
26
|
+
1.0004,
|
|
27
|
+
1.0001,
|
|
28
|
+
1
|
|
29
|
+
], M = [
|
|
30
|
+
0,
|
|
31
|
+
0.0496,
|
|
32
|
+
0.1585,
|
|
33
|
+
0.2869,
|
|
34
|
+
0.4135,
|
|
35
|
+
0.5279,
|
|
36
|
+
0.6263,
|
|
37
|
+
0.7079,
|
|
38
|
+
0.7741,
|
|
39
|
+
0.8268,
|
|
40
|
+
0.8681,
|
|
41
|
+
0.9002,
|
|
42
|
+
0.9249,
|
|
43
|
+
0.9437,
|
|
44
|
+
0.958,
|
|
45
|
+
0.9688,
|
|
46
|
+
0.9768,
|
|
47
|
+
0.9829,
|
|
48
|
+
0.9874,
|
|
49
|
+
0.9907,
|
|
50
|
+
0.9932,
|
|
51
|
+
0.995,
|
|
52
|
+
0.9963,
|
|
53
|
+
0.9973,
|
|
54
|
+
0.9981,
|
|
55
|
+
0.9986,
|
|
56
|
+
1
|
|
57
|
+
], ae = {
|
|
58
|
+
/** Most interactions. */
|
|
59
|
+
spring: 500,
|
|
60
|
+
/** Drawer, where the travel is the width of a panel. */
|
|
61
|
+
springSoft: 700,
|
|
62
|
+
/**
|
|
63
|
+
* For something that travels further than its own width.
|
|
64
|
+
*
|
|
65
|
+
* A bottom sheet comes up from off the screen and covers most of it, which is
|
|
66
|
+
* a longer journey than a drawer's. Reusing `springSoft` there meant the same
|
|
67
|
+
* time over more distance, and it read as a snap.
|
|
68
|
+
*/
|
|
69
|
+
springSlow: 900,
|
|
70
|
+
/** Colour changes, which should not feel sprung. */
|
|
71
|
+
fast: 150,
|
|
72
|
+
/**
|
|
73
|
+
* One pass of an indeterminate Progress bar across its track.
|
|
74
|
+
*
|
|
75
|
+
* Long enough to read as "working" rather than "flickering", short enough
|
|
76
|
+
* that a second pass starts before you wonder whether it has stopped.
|
|
77
|
+
*/
|
|
78
|
+
sweep: 1400
|
|
79
|
+
}, ve = {
|
|
80
|
+
button: { hover: 1.03, press: 0.96 },
|
|
81
|
+
iconButton: { hover: 1.06, press: 0.94 },
|
|
82
|
+
checkbox: { hover: 1.08, press: 0.92 },
|
|
83
|
+
radio: { hover: 1.08, press: 0.92 },
|
|
84
|
+
switch: { hover: 1.05, press: 0.95 },
|
|
85
|
+
toggle: { hover: 1.06, press: 0.94 },
|
|
86
|
+
toast: { hover: 1.04, press: 0.96 },
|
|
87
|
+
sliderThumb: { hover: 1.12, press: 0.94 }
|
|
88
|
+
}, Re = 64;
|
|
89
|
+
function Ae(e, a) {
|
|
90
|
+
if (e.length === 0) return a;
|
|
91
|
+
if (a <= 0) return e[0];
|
|
92
|
+
if (a >= 1) return e[e.length - 1];
|
|
93
|
+
const n = (e.length - 1) * a, r = Math.floor(n), o = n - r, t = e[r], c = e[r + 1] ?? t;
|
|
94
|
+
return t + (c - t) * o;
|
|
95
|
+
}
|
|
96
|
+
function Y(e) {
|
|
97
|
+
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
3
98
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
99
|
+
function $(e) {
|
|
100
|
+
return e <= 31308e-7 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - 0.055;
|
|
6
101
|
}
|
|
7
|
-
function
|
|
8
|
-
return Math.min(1, Math.max(0,
|
|
102
|
+
function H(e) {
|
|
103
|
+
return Math.min(1, Math.max(0, e));
|
|
9
104
|
}
|
|
10
|
-
function
|
|
11
|
-
const a =
|
|
105
|
+
function w(e) {
|
|
106
|
+
const a = e.replace("#", ""), n = a.length === 3 ? a.split("").map((r) => r + r).join("") : a;
|
|
12
107
|
return [
|
|
13
|
-
parseInt(
|
|
14
|
-
parseInt(
|
|
15
|
-
parseInt(
|
|
108
|
+
parseInt(n.slice(0, 2), 16) / 255,
|
|
109
|
+
parseInt(n.slice(2, 4), 16) / 255,
|
|
110
|
+
parseInt(n.slice(4, 6), 16) / 255
|
|
16
111
|
];
|
|
17
112
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return `#${e
|
|
113
|
+
function B([e, a, n]) {
|
|
114
|
+
const r = (o) => Math.round(H(o) * 255).toString(16).padStart(2, "0");
|
|
115
|
+
return `#${r(e)}${r(a)}${r(n)}`;
|
|
21
116
|
}
|
|
22
|
-
function
|
|
23
|
-
const [a,
|
|
24
|
-
0.4122214708 * a + 0.5363325363 *
|
|
117
|
+
function A(e) {
|
|
118
|
+
const [a, n, r] = w(e).map(Y), o = Math.cbrt(
|
|
119
|
+
0.4122214708 * a + 0.5363325363 * n + 0.0514459929 * r
|
|
120
|
+
), t = Math.cbrt(
|
|
121
|
+
0.2119034982 * a + 0.6806995451 * n + 0.1073969566 * r
|
|
25
122
|
), c = Math.cbrt(
|
|
26
|
-
0.
|
|
27
|
-
),
|
|
28
|
-
0.0883024619 * a + 0.2817188376 * t + 0.6299787005 * e
|
|
29
|
-
), d = 0.2104542553 * o + 0.793617785 * c - 0.0040720468 * n, f = 1.9779984951 * o - 2.428592205 * c + 0.4505937099 * n, g = 0.0259040371 * o + 0.7827717662 * c - 0.808675766 * n;
|
|
123
|
+
0.0883024619 * a + 0.2817188376 * n + 0.6299787005 * r
|
|
124
|
+
), s = 0.2104542553 * o + 0.793617785 * t - 0.0040720468 * c, i = 1.9779984951 * o - 2.428592205 * t + 0.4505937099 * c, g = 0.0259040371 * o + 0.7827717662 * t - 0.808675766 * c;
|
|
30
125
|
return {
|
|
31
|
-
l:
|
|
32
|
-
c: Math.hypot(
|
|
33
|
-
h: (Math.atan2(g,
|
|
126
|
+
l: s,
|
|
127
|
+
c: Math.hypot(i, g),
|
|
128
|
+
h: (Math.atan2(g, i) * 180 / Math.PI + 360) % 360
|
|
34
129
|
};
|
|
35
130
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
131
|
+
function L({ l: e, c: a, h: n }) {
|
|
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
|
+
return B([
|
|
134
|
+
$(H(4.0767416621 * t - 3.3077115913 * c + 0.2309699292 * s)),
|
|
135
|
+
$(H(-1.2684380046 * t + 2.6097574011 * c - 0.3413193965 * s)),
|
|
136
|
+
$(H(-0.0041960863 * t - 0.7034186147 * c + 1.707614701 * s))
|
|
42
137
|
]);
|
|
43
138
|
}
|
|
44
|
-
const
|
|
45
|
-
function
|
|
46
|
-
const { h:
|
|
47
|
-
|
|
48
|
-
const o =
|
|
49
|
-
return
|
|
139
|
+
const te = [0.195, 0.24, 0.27, 0.3, 0.33, 0.37, 0.43, 0.52], ne = [0.014, 0.026, 0.04, 0.052, 0.062, 0.072, 0.084, 0.1];
|
|
140
|
+
function y(e, a) {
|
|
141
|
+
const { h: n } = A(e), r = te.map((s, i) => L({ l: s, c: ne[i], h: n }));
|
|
142
|
+
r.push(e, a);
|
|
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
|
+
return r.push(L({ l: t, c: 0.11, h: n })), r.push(L({ l: c, c: 0.055, h: n })), r;
|
|
50
145
|
}
|
|
51
|
-
const
|
|
146
|
+
const ce = [
|
|
52
147
|
0.187,
|
|
53
148
|
0.231,
|
|
54
149
|
0.245,
|
|
@@ -61,7 +156,7 @@ const W = [
|
|
|
61
156
|
0.57,
|
|
62
157
|
0.627,
|
|
63
158
|
0.908
|
|
64
|
-
],
|
|
159
|
+
], oe = [
|
|
65
160
|
0.011,
|
|
66
161
|
0.014,
|
|
67
162
|
0.016,
|
|
@@ -75,36 +170,36 @@ const W = [
|
|
|
75
170
|
0,
|
|
76
171
|
8e-3
|
|
77
172
|
];
|
|
78
|
-
function
|
|
173
|
+
function z(e) {
|
|
79
174
|
const a = {
|
|
80
|
-
0:
|
|
81
|
-
1:
|
|
82
|
-
2:
|
|
83
|
-
5:
|
|
84
|
-
10:
|
|
85
|
-
11:
|
|
86
|
-
},
|
|
87
|
-
return
|
|
88
|
-
(
|
|
175
|
+
0: e.bg,
|
|
176
|
+
1: e.surface,
|
|
177
|
+
2: e.surfaceRaised,
|
|
178
|
+
5: e.border,
|
|
179
|
+
10: e.muted,
|
|
180
|
+
11: e.text
|
|
181
|
+
}, n = A(e.border).h;
|
|
182
|
+
return ce.map(
|
|
183
|
+
(r, o) => a[o] ?? L({ l: r, c: oe[o], h: n })
|
|
89
184
|
);
|
|
90
185
|
}
|
|
91
|
-
function S(
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
const o =
|
|
95
|
-
let
|
|
96
|
-
for (let
|
|
97
|
-
const
|
|
98
|
-
|
|
186
|
+
function S(e, a) {
|
|
187
|
+
const n = w(a);
|
|
188
|
+
return e.map((r) => {
|
|
189
|
+
const o = w(r);
|
|
190
|
+
let t = 0;
|
|
191
|
+
for (let l = 0; l < 3; l++) {
|
|
192
|
+
const u = o[l], d = n[l];
|
|
193
|
+
u > d ? t = Math.max(t, d < 1 ? (u - d) / (1 - d) : 0) : u < d && (t = Math.max(t, d > 0 ? (d - u) / d : 0));
|
|
99
194
|
}
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
o.map((
|
|
103
|
-
), [
|
|
104
|
-
return `rgb(${
|
|
195
|
+
if (t < 1e-6) return "transparent";
|
|
196
|
+
const c = B(
|
|
197
|
+
o.map((l, u) => H(n[u] + (l - n[u]) / t))
|
|
198
|
+
), [s, i, g] = w(c).map((l) => Math.round(l * 255));
|
|
199
|
+
return `rgb(${s} ${i} ${g} / ${(t * 100).toFixed(1)}%)`;
|
|
105
200
|
});
|
|
106
201
|
}
|
|
107
|
-
const
|
|
202
|
+
const se = [
|
|
108
203
|
0.962,
|
|
109
204
|
1,
|
|
110
205
|
0.978,
|
|
@@ -117,7 +212,7 @@ const K = [
|
|
|
117
212
|
0.61,
|
|
118
213
|
0.48,
|
|
119
214
|
0.25
|
|
120
|
-
],
|
|
215
|
+
], fe = [
|
|
121
216
|
6e-3,
|
|
122
217
|
0,
|
|
123
218
|
4e-3,
|
|
@@ -130,35 +225,35 @@ const K = [
|
|
|
130
225
|
0.014,
|
|
131
226
|
0.012,
|
|
132
227
|
0.014
|
|
133
|
-
],
|
|
134
|
-
function
|
|
228
|
+
], de = [0.975, 0.955, 0.93, 0.905, 0.878, 0.845, 0.795, 0.72], ie = [0.012, 0.024, 0.038, 0.05, 0.062, 0.074, 0.09, 0.11];
|
|
229
|
+
function W(e) {
|
|
135
230
|
const a = {
|
|
136
|
-
0:
|
|
137
|
-
1:
|
|
138
|
-
2:
|
|
139
|
-
5:
|
|
140
|
-
10:
|
|
141
|
-
11:
|
|
142
|
-
},
|
|
143
|
-
return
|
|
144
|
-
(
|
|
231
|
+
0: e.bg,
|
|
232
|
+
1: e.surface,
|
|
233
|
+
2: e.surfaceRaised,
|
|
234
|
+
5: e.border,
|
|
235
|
+
10: e.muted,
|
|
236
|
+
11: e.text
|
|
237
|
+
}, n = A(e.border).h;
|
|
238
|
+
return se.map(
|
|
239
|
+
(r, o) => a[o] ?? L({ l: r, c: fe[o], h: n })
|
|
145
240
|
);
|
|
146
241
|
}
|
|
147
|
-
function
|
|
148
|
-
const { l: a, c:
|
|
149
|
-
(
|
|
242
|
+
function m(e) {
|
|
243
|
+
const { l: a, c: n, h: r } = A(e), o = de.map(
|
|
244
|
+
(t, c) => L({ l: t, c: ie[c], h: r })
|
|
150
245
|
);
|
|
151
|
-
return o.push(
|
|
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;
|
|
152
247
|
}
|
|
153
|
-
function
|
|
154
|
-
const [a,
|
|
155
|
-
return 0.2126 * a + 0.7152 *
|
|
248
|
+
function F(e) {
|
|
249
|
+
const [a, n, r] = w(e).map(Y);
|
|
250
|
+
return 0.2126 * a + 0.7152 * n + 0.0722 * r;
|
|
156
251
|
}
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
return (Math.max(
|
|
252
|
+
function Se(e, a) {
|
|
253
|
+
const n = F(e), r = F(a);
|
|
254
|
+
return (Math.max(n, r) + 0.05) / (Math.min(n, r) + 0.05);
|
|
160
255
|
}
|
|
161
|
-
const
|
|
256
|
+
const f = {
|
|
162
257
|
color: {
|
|
163
258
|
bg: "#111318",
|
|
164
259
|
surface: "#1a1d24",
|
|
@@ -189,120 +284,138 @@ const s = {
|
|
|
189
284
|
xl: 28,
|
|
190
285
|
full: 999
|
|
191
286
|
}
|
|
192
|
-
},
|
|
287
|
+
}, b = {
|
|
193
288
|
bg: "#f1f2f7",
|
|
194
289
|
surface: "#ffffff",
|
|
195
290
|
surfaceRaised: "#f7f8fb",
|
|
196
291
|
border: "#dadde6",
|
|
197
292
|
muted: "#5b5d65",
|
|
198
293
|
text: "#1f2129"
|
|
199
|
-
},
|
|
200
|
-
neutral:
|
|
201
|
-
bg:
|
|
202
|
-
surface:
|
|
203
|
-
surfaceRaised:
|
|
204
|
-
border:
|
|
205
|
-
muted:
|
|
206
|
-
text:
|
|
294
|
+
}, O = {
|
|
295
|
+
neutral: z({
|
|
296
|
+
bg: f.color.bg,
|
|
297
|
+
surface: f.color.surface,
|
|
298
|
+
surfaceRaised: f.color.surfaceRaised,
|
|
299
|
+
border: f.color.border,
|
|
300
|
+
muted: f.color.muted,
|
|
301
|
+
text: f.color.text
|
|
207
302
|
}),
|
|
208
|
-
accent:
|
|
209
|
-
secondary:
|
|
210
|
-
|
|
211
|
-
|
|
303
|
+
accent: y(f.color.accent, f.color.accentLight),
|
|
304
|
+
secondary: y(
|
|
305
|
+
f.color.secondary,
|
|
306
|
+
f.color.secondaryLight
|
|
212
307
|
),
|
|
213
|
-
success:
|
|
214
|
-
danger:
|
|
215
|
-
warning:
|
|
216
|
-
},
|
|
217
|
-
neutral:
|
|
218
|
-
accent:
|
|
219
|
-
secondary:
|
|
220
|
-
success:
|
|
221
|
-
danger:
|
|
222
|
-
warning:
|
|
223
|
-
},
|
|
224
|
-
neutral: S(
|
|
225
|
-
accent: S(
|
|
226
|
-
},
|
|
227
|
-
neutral: S(
|
|
228
|
-
accent: S(
|
|
308
|
+
success: y(f.color.success, f.color.success),
|
|
309
|
+
danger: y(f.color.danger, f.color.dangerLight),
|
|
310
|
+
warning: y(f.color.warning, f.color.warning)
|
|
311
|
+
}, G = {
|
|
312
|
+
neutral: W(b),
|
|
313
|
+
accent: m(f.color.accent),
|
|
314
|
+
secondary: m(f.color.secondary),
|
|
315
|
+
success: m(f.color.success),
|
|
316
|
+
danger: m(f.color.danger),
|
|
317
|
+
warning: m(f.color.warning)
|
|
318
|
+
}, K = G.neutral[3], ke = {
|
|
319
|
+
neutral: S(O.neutral, f.color.bg),
|
|
320
|
+
accent: S(O.accent, f.color.bg)
|
|
321
|
+
}, Te = {
|
|
322
|
+
neutral: S(G.neutral, b.bg),
|
|
323
|
+
accent: S(G.accent, b.bg)
|
|
229
324
|
};
|
|
230
|
-
function
|
|
231
|
-
const a =
|
|
232
|
-
...
|
|
233
|
-
...
|
|
234
|
-
surfaceHover:
|
|
235
|
-
} :
|
|
236
|
-
bg:
|
|
237
|
-
surface:
|
|
238
|
-
surfaceRaised:
|
|
239
|
-
border:
|
|
240
|
-
muted:
|
|
241
|
-
text:
|
|
242
|
-
},
|
|
243
|
-
neutral:
|
|
244
|
-
accent:
|
|
245
|
-
secondary:
|
|
246
|
-
success:
|
|
247
|
-
danger:
|
|
248
|
-
warning:
|
|
325
|
+
function Me(e = {}) {
|
|
326
|
+
const a = e.appearance === "light", r = { ...a ? {
|
|
327
|
+
...f.color,
|
|
328
|
+
...b,
|
|
329
|
+
surfaceHover: K
|
|
330
|
+
} : f.color, ...e.color }, o = { ...f.radius, ...e.radius }, t = {
|
|
331
|
+
bg: r.bg,
|
|
332
|
+
surface: r.surface,
|
|
333
|
+
surfaceRaised: r.surfaceRaised,
|
|
334
|
+
border: r.border,
|
|
335
|
+
muted: r.muted,
|
|
336
|
+
text: r.text
|
|
337
|
+
}, c = a ? {
|
|
338
|
+
neutral: W(t),
|
|
339
|
+
accent: m(r.accent),
|
|
340
|
+
secondary: m(r.secondary),
|
|
341
|
+
success: m(r.success),
|
|
342
|
+
danger: m(r.danger),
|
|
343
|
+
warning: m(r.warning)
|
|
249
344
|
} : {
|
|
250
|
-
neutral:
|
|
251
|
-
accent:
|
|
252
|
-
secondary:
|
|
253
|
-
success:
|
|
254
|
-
danger:
|
|
255
|
-
warning:
|
|
256
|
-
},
|
|
257
|
-
for (const [
|
|
258
|
-
|
|
259
|
-
|
|
345
|
+
neutral: z(t),
|
|
346
|
+
accent: y(r.accent, r.accentLight),
|
|
347
|
+
secondary: y(r.secondary, r.secondaryLight),
|
|
348
|
+
success: y(r.success, r.success),
|
|
349
|
+
danger: y(r.danger, r.dangerLight),
|
|
350
|
+
warning: y(r.warning, r.warning)
|
|
351
|
+
}, s = {};
|
|
352
|
+
for (const [u, d] of Object.entries(c))
|
|
353
|
+
d.forEach((h, k) => {
|
|
354
|
+
s[`--gryt-${u}-${k + 1}`] = h, s[`--color-gryt-${u}-${k + 1}`] = h;
|
|
260
355
|
});
|
|
261
|
-
for (const
|
|
262
|
-
S(
|
|
263
|
-
|
|
356
|
+
for (const u of ["neutral", "accent"])
|
|
357
|
+
S(c[u], r.bg).forEach((d, h) => {
|
|
358
|
+
s[`--gryt-${u}-a${h + 1}`] = d, s[`--color-gryt-${u}-a${h + 1}`] = d;
|
|
264
359
|
});
|
|
360
|
+
const i = (u) => `linear(${u.map((d) => Number(d.toFixed(4))).join(", ")})`, g = {};
|
|
361
|
+
if (e.motion !== void 0) {
|
|
362
|
+
const { scale: u, curve: d } = e.motion;
|
|
363
|
+
if (u !== 1)
|
|
364
|
+
for (const [h, k] of Object.entries(ae)) {
|
|
365
|
+
const Q = h.replace(/[A-Z]/g, (ee) => `-${ee.toLowerCase()}`);
|
|
366
|
+
g[`--gryt-dur-${Q}`] = `${Math.round(k * u)}ms`;
|
|
367
|
+
}
|
|
368
|
+
if (Array.isArray(d)) {
|
|
369
|
+
const h = `cubic-bezier(${d.join(", ")})`;
|
|
370
|
+
g["--ease-spring"] = h, g["--ease-spring-tight"] = h;
|
|
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(re), g["--ease-spring-tight"] = i(M));
|
|
372
|
+
}
|
|
373
|
+
const l = {};
|
|
374
|
+
for (const [u, d] of Object.entries(e.fonts ?? {}))
|
|
375
|
+
typeof d == "string" && d.trim() !== "" && (l[`--gryt-font-${u}`] = d);
|
|
265
376
|
return {
|
|
266
|
-
...
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"--gryt-
|
|
270
|
-
"--gryt-surface
|
|
271
|
-
"--gryt-
|
|
272
|
-
"--gryt-
|
|
273
|
-
"--gryt-
|
|
274
|
-
"--gryt-
|
|
275
|
-
"--gryt-
|
|
276
|
-
"--gryt-
|
|
277
|
-
"--gryt-
|
|
278
|
-
"--gryt-
|
|
279
|
-
"--gryt-
|
|
280
|
-
"--gryt-
|
|
281
|
-
"--gryt-
|
|
282
|
-
"--gryt-
|
|
283
|
-
"--gryt-
|
|
284
|
-
"--gryt-on-
|
|
377
|
+
...s,
|
|
378
|
+
...g,
|
|
379
|
+
...l,
|
|
380
|
+
"--gryt-bg": r.bg,
|
|
381
|
+
"--gryt-surface": r.surface,
|
|
382
|
+
"--gryt-surface-raised": r.surfaceRaised,
|
|
383
|
+
"--gryt-surface-hover": r.surfaceHover,
|
|
384
|
+
"--gryt-border": r.border,
|
|
385
|
+
"--gryt-text": r.text,
|
|
386
|
+
"--gryt-muted": r.muted,
|
|
387
|
+
"--gryt-accent": r.accent,
|
|
388
|
+
"--gryt-accent-light": r.accentLight,
|
|
389
|
+
"--gryt-secondary": r.secondary,
|
|
390
|
+
"--gryt-secondary-light": r.secondaryLight,
|
|
391
|
+
"--gryt-success": r.success,
|
|
392
|
+
"--gryt-danger": r.danger,
|
|
393
|
+
"--gryt-danger-light": r.dangerLight,
|
|
394
|
+
"--gryt-warning": r.warning,
|
|
395
|
+
"--gryt-on-accent": r.onAccent,
|
|
396
|
+
"--gryt-on-secondary": r.onSecondary,
|
|
397
|
+
"--gryt-on-danger": r.onDanger,
|
|
285
398
|
// Tailwind's @theme emits --color-* names, and the utilities compile
|
|
286
399
|
// against those. Both sets have to move together or an override would
|
|
287
400
|
// change the raw var but not bg-gryt-accent.
|
|
288
|
-
"--color-gryt-bg":
|
|
289
|
-
"--color-gryt-surface":
|
|
290
|
-
"--color-gryt-surface-raised":
|
|
291
|
-
"--color-gryt-surface-hover":
|
|
292
|
-
"--color-gryt-border":
|
|
293
|
-
"--color-gryt-text":
|
|
294
|
-
"--color-gryt-muted":
|
|
295
|
-
"--color-gryt-accent":
|
|
296
|
-
"--color-gryt-accent-light":
|
|
297
|
-
"--color-gryt-secondary":
|
|
298
|
-
"--color-gryt-secondary-light":
|
|
299
|
-
"--color-gryt-success":
|
|
300
|
-
"--color-gryt-danger":
|
|
301
|
-
"--color-gryt-danger-light":
|
|
302
|
-
"--color-gryt-warning":
|
|
303
|
-
"--color-gryt-on-accent":
|
|
304
|
-
"--color-gryt-on-secondary":
|
|
305
|
-
"--color-gryt-on-danger":
|
|
401
|
+
"--color-gryt-bg": r.bg,
|
|
402
|
+
"--color-gryt-surface": r.surface,
|
|
403
|
+
"--color-gryt-surface-raised": r.surfaceRaised,
|
|
404
|
+
"--color-gryt-surface-hover": r.surfaceHover,
|
|
405
|
+
"--color-gryt-border": r.border,
|
|
406
|
+
"--color-gryt-text": r.text,
|
|
407
|
+
"--color-gryt-muted": r.muted,
|
|
408
|
+
"--color-gryt-accent": r.accent,
|
|
409
|
+
"--color-gryt-accent-light": r.accentLight,
|
|
410
|
+
"--color-gryt-secondary": r.secondary,
|
|
411
|
+
"--color-gryt-secondary-light": r.secondaryLight,
|
|
412
|
+
"--color-gryt-success": r.success,
|
|
413
|
+
"--color-gryt-danger": r.danger,
|
|
414
|
+
"--color-gryt-danger-light": r.dangerLight,
|
|
415
|
+
"--color-gryt-warning": r.warning,
|
|
416
|
+
"--color-gryt-on-accent": r.onAccent,
|
|
417
|
+
"--color-gryt-on-secondary": r.onSecondary,
|
|
418
|
+
"--color-gryt-on-danger": r.onDanger,
|
|
306
419
|
"--gryt-radius-sm": `${o.sm}px`,
|
|
307
420
|
"--gryt-radius-md": `${o.md}px`,
|
|
308
421
|
"--gryt-radius-lg": `${o.lg}px`,
|
|
@@ -310,7 +423,7 @@ function ue(r = {}) {
|
|
|
310
423
|
"--gryt-radius-full": `${o.full}px`
|
|
311
424
|
};
|
|
312
425
|
}
|
|
313
|
-
const
|
|
426
|
+
const T = [
|
|
314
427
|
"accent",
|
|
315
428
|
"accentLight",
|
|
316
429
|
"secondary",
|
|
@@ -322,7 +435,7 @@ const v = [
|
|
|
322
435
|
"onAccent",
|
|
323
436
|
"onSecondary",
|
|
324
437
|
"onDanger"
|
|
325
|
-
],
|
|
438
|
+
], V = [
|
|
326
439
|
"bg",
|
|
327
440
|
"surface",
|
|
328
441
|
"surfaceRaised",
|
|
@@ -330,66 +443,95 @@ const v = [
|
|
|
330
443
|
"border",
|
|
331
444
|
"muted",
|
|
332
445
|
"text"
|
|
333
|
-
],
|
|
334
|
-
|
|
335
|
-
|
|
446
|
+
], E = ["sm", "md", "lg", "xl", "full"], _ = ["body", "display", "mono"], ue = ["spring", "smooth", "linear"], N = {
|
|
447
|
+
body: '"Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif',
|
|
448
|
+
display: '"Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif',
|
|
449
|
+
mono: '"Atkinson Hyperlegible Mono", ui-monospace, Menlo, Consolas, monospace'
|
|
450
|
+
}, v = { scale: 1, curve: "spring" }, ge = 3;
|
|
451
|
+
function X(e) {
|
|
452
|
+
return Array.isArray(e);
|
|
453
|
+
}
|
|
454
|
+
function le(e) {
|
|
455
|
+
if (!Array.isArray(e) || e.length !== 4) return !1;
|
|
456
|
+
const [a, n, r, o] = e;
|
|
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;
|
|
336
458
|
}
|
|
337
|
-
const
|
|
459
|
+
const he = 200;
|
|
460
|
+
function q(e) {
|
|
461
|
+
const a = e.trim();
|
|
462
|
+
return a === "" || a.length > he ? !1 : !/[;{}()<>\\]|\/\*|@import|url\s*\(/i.test(a);
|
|
463
|
+
}
|
|
464
|
+
const be = 60;
|
|
465
|
+
function C(e) {
|
|
466
|
+
return e.replace(/\s+/g, " ").trim().slice(0, be);
|
|
467
|
+
}
|
|
468
|
+
const x = {
|
|
338
469
|
hue: {
|
|
339
|
-
accent:
|
|
340
|
-
accentLight:
|
|
341
|
-
secondary:
|
|
342
|
-
secondaryLight:
|
|
343
|
-
success:
|
|
344
|
-
danger:
|
|
345
|
-
dangerLight:
|
|
346
|
-
warning:
|
|
347
|
-
onAccent:
|
|
348
|
-
onSecondary:
|
|
349
|
-
onDanger:
|
|
470
|
+
accent: f.color.accent,
|
|
471
|
+
accentLight: f.color.accentLight,
|
|
472
|
+
secondary: f.color.secondary,
|
|
473
|
+
secondaryLight: f.color.secondaryLight,
|
|
474
|
+
success: f.color.success,
|
|
475
|
+
danger: f.color.danger,
|
|
476
|
+
dangerLight: f.color.dangerLight,
|
|
477
|
+
warning: f.color.warning,
|
|
478
|
+
onAccent: f.color.onAccent,
|
|
479
|
+
onSecondary: f.color.onSecondary,
|
|
480
|
+
onDanger: f.color.onDanger
|
|
350
481
|
},
|
|
351
482
|
lightHue: null,
|
|
352
483
|
dark: {
|
|
353
|
-
bg:
|
|
354
|
-
surface:
|
|
355
|
-
surfaceRaised:
|
|
356
|
-
surfaceHover:
|
|
357
|
-
border:
|
|
358
|
-
muted:
|
|
359
|
-
text:
|
|
484
|
+
bg: f.color.bg,
|
|
485
|
+
surface: f.color.surface,
|
|
486
|
+
surfaceRaised: f.color.surfaceRaised,
|
|
487
|
+
surfaceHover: f.color.surfaceHover,
|
|
488
|
+
border: f.color.border,
|
|
489
|
+
muted: f.color.muted,
|
|
490
|
+
text: f.color.text
|
|
360
491
|
},
|
|
361
492
|
light: {
|
|
362
|
-
bg:
|
|
363
|
-
surface:
|
|
364
|
-
surfaceRaised:
|
|
365
|
-
surfaceHover:
|
|
366
|
-
border:
|
|
367
|
-
muted:
|
|
368
|
-
text:
|
|
493
|
+
bg: b.bg,
|
|
494
|
+
surface: b.surface,
|
|
495
|
+
surfaceRaised: b.surfaceRaised,
|
|
496
|
+
surfaceHover: K,
|
|
497
|
+
border: b.border,
|
|
498
|
+
muted: b.muted,
|
|
499
|
+
text: b.text
|
|
369
500
|
},
|
|
370
|
-
radius: { ...
|
|
501
|
+
radius: { ...f.radius }
|
|
371
502
|
};
|
|
372
|
-
function
|
|
503
|
+
function I(e) {
|
|
373
504
|
return {
|
|
374
|
-
...
|
|
375
|
-
hue: { ...
|
|
376
|
-
lightHue:
|
|
377
|
-
dark: { ...
|
|
378
|
-
light: { ...
|
|
379
|
-
radius: { ...
|
|
505
|
+
...e.name === void 0 ? {} : { name: e.name },
|
|
506
|
+
hue: { ...e.hue },
|
|
507
|
+
lightHue: e.lightHue === null ? null : { ...e.lightHue },
|
|
508
|
+
dark: { ...e.dark },
|
|
509
|
+
light: { ...e.light },
|
|
510
|
+
radius: { ...e.radius },
|
|
511
|
+
...e.fonts == null ? {} : { fonts: { ...e.fonts } },
|
|
512
|
+
...e.motion == null ? {} : {
|
|
513
|
+
motion: {
|
|
514
|
+
scale: e.motion.scale,
|
|
515
|
+
curve: X(e.motion.curve) ? [...e.motion.curve] : e.motion.curve
|
|
516
|
+
}
|
|
517
|
+
}
|
|
380
518
|
};
|
|
381
519
|
}
|
|
382
|
-
function
|
|
383
|
-
return a === "light" &&
|
|
520
|
+
function ye(e, a) {
|
|
521
|
+
return a === "light" && e.lightHue !== null ? e.lightHue : e.hue;
|
|
384
522
|
}
|
|
385
|
-
function
|
|
523
|
+
function $e(e, a) {
|
|
386
524
|
return {
|
|
387
525
|
appearance: a,
|
|
388
|
-
color: { ...
|
|
389
|
-
radius: { ...
|
|
526
|
+
color: { ...ye(e, a), ...e[a] },
|
|
527
|
+
radius: { ...e.radius },
|
|
528
|
+
// Fonts do not vary by appearance — a theme that changed typeface when
|
|
529
|
+
// somebody flipped to light would be two themes. Nor does motion.
|
|
530
|
+
...e.fonts == null ? {} : { fonts: { ...e.fonts } },
|
|
531
|
+
...e.motion == null ? {} : { motion: e.motion }
|
|
390
532
|
};
|
|
391
533
|
}
|
|
392
|
-
const
|
|
534
|
+
const R = {
|
|
393
535
|
accent: "accent",
|
|
394
536
|
accentLight: "accent-light",
|
|
395
537
|
secondary: "secondary",
|
|
@@ -401,7 +543,7 @@ const w = {
|
|
|
401
543
|
onAccent: "on-accent",
|
|
402
544
|
onSecondary: "on-secondary",
|
|
403
545
|
onDanger: "on-danger"
|
|
404
|
-
},
|
|
546
|
+
}, J = {
|
|
405
547
|
bg: "bg",
|
|
406
548
|
surface: "surface",
|
|
407
549
|
surfaceRaised: "raised",
|
|
@@ -409,116 +551,149 @@ const w = {
|
|
|
409
551
|
border: "border",
|
|
410
552
|
muted: "muted",
|
|
411
553
|
text: "text"
|
|
412
|
-
},
|
|
413
|
-
function
|
|
414
|
-
return
|
|
554
|
+
}, me = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
555
|
+
function Z(e) {
|
|
556
|
+
return me.test(e.trim());
|
|
415
557
|
}
|
|
416
|
-
function
|
|
417
|
-
const a =
|
|
558
|
+
function P(e) {
|
|
559
|
+
const a = e.trim().toLowerCase();
|
|
418
560
|
return a.length === 4 ? `#${a[1]}${a[1]}${a[2]}${a[2]}${a[3]}${a[3]}` : a;
|
|
419
561
|
}
|
|
420
|
-
function
|
|
421
|
-
const
|
|
422
|
-
o !== "" &&
|
|
423
|
-
for (const
|
|
424
|
-
|
|
425
|
-
if (
|
|
426
|
-
for (const
|
|
427
|
-
|
|
428
|
-
for (const
|
|
429
|
-
const
|
|
430
|
-
for (const
|
|
431
|
-
|
|
562
|
+
function De(e, a) {
|
|
563
|
+
const n = new URLSearchParams(), r = (t) => P(t).slice(1), o = C(e.name ?? "");
|
|
564
|
+
o !== "" && n.set("name", o);
|
|
565
|
+
for (const t of T)
|
|
566
|
+
e.hue[t] !== x.hue[t] && n.set(R[t], r(e.hue[t]));
|
|
567
|
+
if (e.lightHue !== null)
|
|
568
|
+
for (const t of T)
|
|
569
|
+
n.set(`lh-${R[t]}`, r(e.lightHue[t]));
|
|
570
|
+
for (const t of ["dark", "light"]) {
|
|
571
|
+
const c = t === "dark" ? "d" : "l";
|
|
572
|
+
for (const s of V)
|
|
573
|
+
e[t][s] !== x[t][s] && n.set(`${c}-${J[s]}`, r(e[t][s]));
|
|
432
574
|
}
|
|
433
|
-
for (const
|
|
434
|
-
|
|
435
|
-
|
|
575
|
+
for (const t of E)
|
|
576
|
+
e.radius[t] !== x.radius[t] && n.set(`r-${t}`, String(e.radius[t]));
|
|
577
|
+
if (e.motion != null && (e.motion.scale !== v.scale && n.set("m-scale", String(e.motion.scale)), e.motion.curve !== v.curve && n.set(
|
|
578
|
+
"m-curve",
|
|
579
|
+
X(e.motion.curve) ? e.motion.curve.join(",") : e.motion.curve
|
|
580
|
+
)), e.fonts != null)
|
|
581
|
+
for (const t of _)
|
|
582
|
+
e.fonts[t] !== N[t] && n.set(`f-${t}`, e.fonts[t]);
|
|
583
|
+
return a === "light" && n.set("mode", "light"), n;
|
|
436
584
|
}
|
|
437
|
-
function
|
|
438
|
-
const a =
|
|
585
|
+
function Ge(e) {
|
|
586
|
+
const a = e.trim();
|
|
439
587
|
if (a === "") return null;
|
|
440
|
-
if (a.startsWith("{")) return
|
|
441
|
-
const
|
|
442
|
-
return
|
|
588
|
+
if (a.startsWith("{")) return Le(a);
|
|
589
|
+
const n = a.includes("?") ? a.slice(a.indexOf("?") + 1) : a;
|
|
590
|
+
return pe(new URLSearchParams(n));
|
|
443
591
|
}
|
|
444
|
-
function
|
|
445
|
-
const a =
|
|
446
|
-
let
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
451
|
-
return
|
|
452
|
-
}, o =
|
|
453
|
-
o !== "" && (a.name = o,
|
|
454
|
-
for (const
|
|
455
|
-
const
|
|
456
|
-
|
|
592
|
+
function pe(e) {
|
|
593
|
+
const a = I(x);
|
|
594
|
+
let n = !1;
|
|
595
|
+
const r = (t) => {
|
|
596
|
+
const c = e.get(t);
|
|
597
|
+
if (c === null) return null;
|
|
598
|
+
const s = c.startsWith("#") ? c : `#${c}`;
|
|
599
|
+
return Z(s) ? (n = !0, P(s)) : null;
|
|
600
|
+
}, o = C(e.get("name") ?? "");
|
|
601
|
+
o !== "" && (a.name = o, n = !0);
|
|
602
|
+
for (const t of T) {
|
|
603
|
+
const c = r(R[t]);
|
|
604
|
+
c !== null && (a.hue[t] = c);
|
|
457
605
|
}
|
|
458
|
-
if (
|
|
459
|
-
const
|
|
460
|
-
for (const
|
|
461
|
-
const
|
|
462
|
-
|
|
606
|
+
if (e.has(`lh-${R.accent}`)) {
|
|
607
|
+
const t = { ...a.hue };
|
|
608
|
+
for (const c of T) {
|
|
609
|
+
const s = r(`lh-${R[c]}`);
|
|
610
|
+
s !== null && (t[c] = s);
|
|
463
611
|
}
|
|
464
|
-
a.lightHue =
|
|
612
|
+
a.lightHue = t;
|
|
465
613
|
}
|
|
466
|
-
for (const
|
|
467
|
-
const
|
|
468
|
-
for (const
|
|
469
|
-
const
|
|
470
|
-
|
|
614
|
+
for (const t of ["dark", "light"]) {
|
|
615
|
+
const c = t === "dark" ? "d" : "l";
|
|
616
|
+
for (const s of V) {
|
|
617
|
+
const i = r(`${c}-${J[s]}`);
|
|
618
|
+
i !== null && (a[t][s] = i);
|
|
471
619
|
}
|
|
472
620
|
}
|
|
473
|
-
for (const
|
|
474
|
-
const
|
|
475
|
-
Number.isFinite(
|
|
621
|
+
for (const t of E) {
|
|
622
|
+
const c = Number(e.get(`r-${t}`));
|
|
623
|
+
Number.isFinite(c) && c >= 0 && c <= 999 && e.has(`r-${t}`) && (a.radius[t] = Math.round(c), n = !0);
|
|
476
624
|
}
|
|
477
|
-
|
|
625
|
+
{
|
|
626
|
+
const t = e.get("m-scale");
|
|
627
|
+
if (t !== null) {
|
|
628
|
+
const s = Number(t);
|
|
629
|
+
Number.isFinite(s) && s >= 0 && s <= ge && (a.motion = { ...a.motion ?? v, scale: s }, n = !0);
|
|
630
|
+
}
|
|
631
|
+
const c = e.get("m-curve");
|
|
632
|
+
if (c !== null)
|
|
633
|
+
if (ue.includes(c))
|
|
634
|
+
a.motion = {
|
|
635
|
+
...a.motion ?? v,
|
|
636
|
+
curve: c
|
|
637
|
+
}, n = !0;
|
|
638
|
+
else {
|
|
639
|
+
const s = c.split(",").map(Number);
|
|
640
|
+
le(s) && (a.motion = { ...a.motion ?? v, curve: s }, n = !0);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
for (const t of _) {
|
|
644
|
+
const c = e.get(`f-${t}`);
|
|
645
|
+
c !== null && q(c) && (a.fonts = { ...a.fonts ?? N, [t]: c.trim() }, n = !0);
|
|
646
|
+
}
|
|
647
|
+
return n ? {
|
|
478
648
|
theme: a,
|
|
479
|
-
appearance:
|
|
649
|
+
appearance: e.get("mode") === "light" ? "light" : "dark"
|
|
480
650
|
} : null;
|
|
481
651
|
}
|
|
482
|
-
function
|
|
652
|
+
function Le(e) {
|
|
483
653
|
let a;
|
|
484
654
|
try {
|
|
485
|
-
a = JSON.parse(
|
|
655
|
+
a = JSON.parse(e);
|
|
486
656
|
} catch {
|
|
487
657
|
return null;
|
|
488
658
|
}
|
|
489
659
|
if (typeof a != "object" || a === null) return null;
|
|
490
|
-
const
|
|
660
|
+
const n = a, r = I(x);
|
|
491
661
|
let o = !1;
|
|
492
|
-
const
|
|
493
|
-
if (!(typeof
|
|
494
|
-
for (const [
|
|
495
|
-
typeof g == "string" &&
|
|
662
|
+
const t = (c, s) => {
|
|
663
|
+
if (!(typeof c != "object" || c === null))
|
|
664
|
+
for (const [i, g] of Object.entries(c))
|
|
665
|
+
typeof g == "string" && Z(g) && i in s && (s[i] = P(g), o = !0);
|
|
496
666
|
};
|
|
497
|
-
if (typeof
|
|
498
|
-
const
|
|
499
|
-
|
|
667
|
+
if (typeof n.name == "string") {
|
|
668
|
+
const c = C(n.name);
|
|
669
|
+
c !== "" && (r.name = c, o = !0);
|
|
500
670
|
}
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
|
|
671
|
+
if (t(n.hue, r.hue), t(n.dark, r.dark), t(n.light, r.light), typeof n.lightHue == "object" && n.lightHue !== null) {
|
|
672
|
+
const c = { ...r.hue };
|
|
673
|
+
t(n.lightHue, c), r.lightHue = c;
|
|
504
674
|
}
|
|
505
|
-
if (typeof
|
|
506
|
-
for (const [
|
|
507
|
-
|
|
675
|
+
if (typeof n.fonts == "object" && n.fonts !== null)
|
|
676
|
+
for (const [c, s] of Object.entries(
|
|
677
|
+
n.fonts
|
|
678
|
+
))
|
|
679
|
+
_.includes(c) && (typeof s != "string" || !q(s) || (r.fonts = { ...r.fonts ?? N, [c]: s.trim() }, o = !0));
|
|
680
|
+
if (typeof n.radius == "object" && n.radius !== null)
|
|
681
|
+
for (const [c, s] of Object.entries(
|
|
682
|
+
n.radius
|
|
508
683
|
)) {
|
|
509
|
-
const
|
|
510
|
-
|
|
684
|
+
const i = Number(s);
|
|
685
|
+
E.includes(c) && Number.isFinite(i) && i >= 0 && i <= 999 && (r.radius[c] = Math.round(i), o = !0);
|
|
511
686
|
}
|
|
512
|
-
return o ? { theme:
|
|
687
|
+
return o ? { theme: r, appearance: "dark" } : null;
|
|
513
688
|
}
|
|
514
|
-
const
|
|
689
|
+
const p = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, D = { sm: 6, md: 8, lg: 14, xl: 18, full: 999 }, U = { sm: 4, md: 6, lg: 10, xl: 14, full: 6 }, xe = { sm: 6, md: 8, lg: 10, xl: 14, full: 10 }, j = { sm: 2, md: 4, lg: 6, xl: 8, full: 4 }, He = { sm: 8, md: 8, lg: 8, xl: 8, full: 8 }, we = [
|
|
515
690
|
{
|
|
516
691
|
id: "gryt",
|
|
517
692
|
name: "Gryt",
|
|
518
693
|
note: "What the library ships, from the Gryt code-theme.",
|
|
519
694
|
group: "Gryt",
|
|
520
695
|
source: "github.com/Gryt-chat/code-theme",
|
|
521
|
-
theme:
|
|
696
|
+
theme: x
|
|
522
697
|
},
|
|
523
698
|
{
|
|
524
699
|
/* Credits to Carlo, who made this in the generator and sent the link.
|
|
@@ -531,7 +706,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
531
706
|
note: "The shipped palette, every corner at eight pixels. Made by Carlo.",
|
|
532
707
|
group: "Gryt",
|
|
533
708
|
source: "Carlo",
|
|
534
|
-
theme: { ...
|
|
709
|
+
theme: { ...I(x), name: "Gryt Rounded", radius: He }
|
|
535
710
|
},
|
|
536
711
|
{
|
|
537
712
|
id: "ember",
|
|
@@ -572,7 +747,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
572
747
|
muted: "#6b5b50",
|
|
573
748
|
text: "#241a14"
|
|
574
749
|
},
|
|
575
|
-
radius:
|
|
750
|
+
radius: p
|
|
576
751
|
}
|
|
577
752
|
},
|
|
578
753
|
{
|
|
@@ -614,7 +789,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
614
789
|
muted: "#5b5b63",
|
|
615
790
|
text: "#17171a"
|
|
616
791
|
},
|
|
617
|
-
radius:
|
|
792
|
+
radius: D
|
|
618
793
|
}
|
|
619
794
|
},
|
|
620
795
|
/*
|
|
@@ -682,7 +857,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
682
857
|
muted: "#765b61",
|
|
683
858
|
text: "#31151d"
|
|
684
859
|
},
|
|
685
|
-
radius:
|
|
860
|
+
radius: p
|
|
686
861
|
}
|
|
687
862
|
},
|
|
688
863
|
{
|
|
@@ -725,7 +900,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
725
900
|
muted: "#6a5f69",
|
|
726
901
|
text: "#261b26"
|
|
727
902
|
},
|
|
728
|
-
radius:
|
|
903
|
+
radius: p
|
|
729
904
|
}
|
|
730
905
|
},
|
|
731
906
|
{
|
|
@@ -768,7 +943,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
768
943
|
muted: "#705d63",
|
|
769
944
|
text: "#2c191f"
|
|
770
945
|
},
|
|
771
|
-
radius:
|
|
946
|
+
radius: p
|
|
772
947
|
}
|
|
773
948
|
},
|
|
774
949
|
{
|
|
@@ -811,7 +986,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
811
986
|
muted: "#606272",
|
|
812
987
|
text: "#1c1d2f"
|
|
813
988
|
},
|
|
814
|
-
radius:
|
|
989
|
+
radius: p
|
|
815
990
|
}
|
|
816
991
|
},
|
|
817
992
|
{
|
|
@@ -854,7 +1029,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
854
1029
|
muted: "#616369",
|
|
855
1030
|
text: "#1d1f26"
|
|
856
1031
|
},
|
|
857
|
-
radius:
|
|
1032
|
+
radius: p
|
|
858
1033
|
}
|
|
859
1034
|
},
|
|
860
1035
|
{
|
|
@@ -897,7 +1072,75 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
897
1072
|
muted: "#5f6469",
|
|
898
1073
|
text: "#1a2025"
|
|
899
1074
|
},
|
|
900
|
-
radius:
|
|
1075
|
+
radius: p
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
/* Four photographs: snow-loaded spruces through a gym window, a dark room
|
|
1080
|
+
lit by white strips, a white can on black rubber, grey sweatpants.
|
|
1081
|
+
|
|
1082
|
+
Paper is already near-monochrome, so this earns its place by being cold
|
|
1083
|
+
rather than neutral. Every grey carries the blue that overcast snow
|
|
1084
|
+
light has — Paper's are hueless, and side by side the difference is the
|
|
1085
|
+
whole theme.
|
|
1086
|
+
|
|
1087
|
+
The accent is the white can on the black floor, which is why this is the
|
|
1088
|
+
only Gryt preset with a split `lightHue`. A near-white accent is the
|
|
1089
|
+
point in the dark half and invisible in the light one, so light gets the
|
|
1090
|
+
colour of a wet window frame instead and keeps the same job. */
|
|
1091
|
+
id: "winter-arc",
|
|
1092
|
+
name: "Winter Arc",
|
|
1093
|
+
note: "Cold monochrome. A near-white accent in the dark, snow-light greys.",
|
|
1094
|
+
group: "Gryt",
|
|
1095
|
+
theme: {
|
|
1096
|
+
name: "Winter Arc",
|
|
1097
|
+
hue: {
|
|
1098
|
+
accent: "#dce6ec",
|
|
1099
|
+
accentLight: "#f0f6f9",
|
|
1100
|
+
secondary: "#7d95a3",
|
|
1101
|
+
secondaryLight: "#9db1bc",
|
|
1102
|
+
success: "#7fa88d",
|
|
1103
|
+
danger: "#c2686b",
|
|
1104
|
+
dangerLight: "#d68b8d",
|
|
1105
|
+
warning: "#b9a068",
|
|
1106
|
+
onAccent: "#0b0d0f",
|
|
1107
|
+
onSecondary: "#0b1114",
|
|
1108
|
+
onDanger: "#1b0c0d"
|
|
1109
|
+
},
|
|
1110
|
+
lightHue: {
|
|
1111
|
+
accent: "#2b3a44",
|
|
1112
|
+
accentLight: "#43596a",
|
|
1113
|
+
secondary: "#55707f",
|
|
1114
|
+
secondaryLight: "#6f8b9a",
|
|
1115
|
+
success: "#4a7059",
|
|
1116
|
+
danger: "#a4494c",
|
|
1117
|
+
dangerLight: "#b96b6e",
|
|
1118
|
+
warning: "#856c33",
|
|
1119
|
+
onAccent: "#eef3f6",
|
|
1120
|
+
onSecondary: "#eef3f6",
|
|
1121
|
+
onDanger: "#fdf2f2"
|
|
1122
|
+
},
|
|
1123
|
+
dark: {
|
|
1124
|
+
bg: "#0b0d0f",
|
|
1125
|
+
surface: "#111417",
|
|
1126
|
+
surfaceRaised: "#171b1f",
|
|
1127
|
+
surfaceHover: "#1f252a",
|
|
1128
|
+
border: "#2a3238",
|
|
1129
|
+
muted: "#8b979f",
|
|
1130
|
+
text: "#eef3f6"
|
|
1131
|
+
},
|
|
1132
|
+
light: {
|
|
1133
|
+
bg: "#eaeef1",
|
|
1134
|
+
surface: "#ffffff",
|
|
1135
|
+
surfaceRaised: "#f4f7f9",
|
|
1136
|
+
surfaceHover: "#dde4e9",
|
|
1137
|
+
border: "#c6d0d7",
|
|
1138
|
+
muted: "#55626b",
|
|
1139
|
+
text: "#0f1417"
|
|
1140
|
+
},
|
|
1141
|
+
/* Hard corners on purpose. The reference is window mullions, plate
|
|
1142
|
+
edges and rubber floor tiles, and Paper already has the soft set. */
|
|
1143
|
+
radius: U
|
|
901
1144
|
}
|
|
902
1145
|
},
|
|
903
1146
|
{
|
|
@@ -939,7 +1182,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
939
1182
|
muted: "#3d3d3d",
|
|
940
1183
|
text: "#000000"
|
|
941
1184
|
},
|
|
942
|
-
radius:
|
|
1185
|
+
radius: j
|
|
943
1186
|
}
|
|
944
1187
|
},
|
|
945
1188
|
{
|
|
@@ -998,7 +1241,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
998
1241
|
muted: "#6c664b",
|
|
999
1242
|
text: "#1f1f1f"
|
|
1000
1243
|
},
|
|
1001
|
-
radius:
|
|
1244
|
+
radius: D
|
|
1002
1245
|
}
|
|
1003
1246
|
},
|
|
1004
1247
|
{
|
|
@@ -1056,7 +1299,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1056
1299
|
muted: "#4c566a",
|
|
1057
1300
|
text: "#2e3440"
|
|
1058
1301
|
},
|
|
1059
|
-
radius:
|
|
1302
|
+
radius: D
|
|
1060
1303
|
}
|
|
1061
1304
|
},
|
|
1062
1305
|
{
|
|
@@ -1115,7 +1358,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1115
1358
|
muted: "#6c6f85",
|
|
1116
1359
|
text: "#4c4f69"
|
|
1117
1360
|
},
|
|
1118
|
-
radius:
|
|
1361
|
+
radius: p
|
|
1119
1362
|
}
|
|
1120
1363
|
},
|
|
1121
1364
|
{
|
|
@@ -1175,7 +1418,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1175
1418
|
muted: "#59636e",
|
|
1176
1419
|
text: "#1f2328"
|
|
1177
1420
|
},
|
|
1178
|
-
radius:
|
|
1421
|
+
radius: U
|
|
1179
1422
|
}
|
|
1180
1423
|
},
|
|
1181
1424
|
{
|
|
@@ -1223,7 +1466,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1223
1466
|
muted: "#87867f",
|
|
1224
1467
|
text: "#141413"
|
|
1225
1468
|
},
|
|
1226
|
-
radius:
|
|
1469
|
+
radius: p
|
|
1227
1470
|
}
|
|
1228
1471
|
},
|
|
1229
1472
|
{
|
|
@@ -1284,7 +1527,7 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1284
1527
|
muted: "#71717a",
|
|
1285
1528
|
text: "#18181b"
|
|
1286
1529
|
},
|
|
1287
|
-
radius:
|
|
1530
|
+
radius: xe
|
|
1288
1531
|
}
|
|
1289
1532
|
},
|
|
1290
1533
|
{
|
|
@@ -1331,144 +1574,59 @@ const y = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 }, k = { sm: 6, md: 8, lg:
|
|
|
1331
1574
|
muted: "#586e75",
|
|
1332
1575
|
text: "#073642"
|
|
1333
1576
|
},
|
|
1334
|
-
radius:
|
|
1577
|
+
radius: j
|
|
1335
1578
|
}
|
|
1336
1579
|
}
|
|
1337
|
-
],
|
|
1338
|
-
|
|
1339
|
-
)
|
|
1340
|
-
0,
|
|
1341
|
-
0.1217,
|
|
1342
|
-
0.3812,
|
|
1343
|
-
0.6579,
|
|
1344
|
-
0.883,
|
|
1345
|
-
1.0304,
|
|
1346
|
-
1.1034,
|
|
1347
|
-
1.12,
|
|
1348
|
-
1.1025,
|
|
1349
|
-
1.0705,
|
|
1350
|
-
1.0376,
|
|
1351
|
-
1.0115,
|
|
1352
|
-
0.9949,
|
|
1353
|
-
0.987,
|
|
1354
|
-
0.9857,
|
|
1355
|
-
0.9881,
|
|
1356
|
-
0.992,
|
|
1357
|
-
0.9959,
|
|
1358
|
-
0.9989,
|
|
1359
|
-
1.0008,
|
|
1360
|
-
1.0016,
|
|
1361
|
-
1.0017,
|
|
1362
|
-
1.0014,
|
|
1363
|
-
1.0009,
|
|
1364
|
-
1.0004,
|
|
1365
|
-
1.0001,
|
|
1366
|
-
1
|
|
1367
|
-
], ye = [
|
|
1368
|
-
0,
|
|
1369
|
-
0.0496,
|
|
1370
|
-
0.1585,
|
|
1371
|
-
0.2869,
|
|
1372
|
-
0.4135,
|
|
1373
|
-
0.5279,
|
|
1374
|
-
0.6263,
|
|
1375
|
-
0.7079,
|
|
1376
|
-
0.7741,
|
|
1377
|
-
0.8268,
|
|
1378
|
-
0.8681,
|
|
1379
|
-
0.9002,
|
|
1380
|
-
0.9249,
|
|
1381
|
-
0.9437,
|
|
1382
|
-
0.958,
|
|
1383
|
-
0.9688,
|
|
1384
|
-
0.9768,
|
|
1385
|
-
0.9829,
|
|
1386
|
-
0.9874,
|
|
1387
|
-
0.9907,
|
|
1388
|
-
0.9932,
|
|
1389
|
-
0.995,
|
|
1390
|
-
0.9963,
|
|
1391
|
-
0.9973,
|
|
1392
|
-
0.9981,
|
|
1393
|
-
0.9986,
|
|
1394
|
-
1
|
|
1395
|
-
], me = {
|
|
1396
|
-
/** Most interactions. */
|
|
1397
|
-
spring: 500,
|
|
1398
|
-
/** Drawer, where the travel is the width of a panel. */
|
|
1399
|
-
springSoft: 700,
|
|
1400
|
-
/**
|
|
1401
|
-
* For something that travels further than its own width.
|
|
1402
|
-
*
|
|
1403
|
-
* A bottom sheet comes up from off the screen and covers most of it, which is
|
|
1404
|
-
* a longer journey than a drawer's. Reusing `springSoft` there meant the same
|
|
1405
|
-
* time over more distance, and it read as a snap.
|
|
1406
|
-
*/
|
|
1407
|
-
springSlow: 900,
|
|
1408
|
-
/** Colour changes, which should not feel sprung. */
|
|
1409
|
-
fast: 150,
|
|
1410
|
-
/**
|
|
1411
|
-
* One pass of an indeterminate Progress bar across its track.
|
|
1412
|
-
*
|
|
1413
|
-
* Long enough to read as "working" rather than "flickering", short enough
|
|
1414
|
-
* that a second pass starts before you wonder whether it has stopped.
|
|
1415
|
-
*/
|
|
1416
|
-
sweep: 1400
|
|
1417
|
-
}, pe = {
|
|
1418
|
-
button: { hover: 1.03, press: 0.96 },
|
|
1419
|
-
iconButton: { hover: 1.06, press: 0.94 },
|
|
1420
|
-
checkbox: { hover: 1.08, press: 0.92 },
|
|
1421
|
-
radio: { hover: 1.08, press: 0.92 },
|
|
1422
|
-
switch: { hover: 1.05, press: 0.95 },
|
|
1423
|
-
toggle: { hover: 1.06, press: 0.94 },
|
|
1424
|
-
toast: { hover: 1.04, press: 0.96 },
|
|
1425
|
-
sliderThumb: { hover: 1.12, press: 0.94 }
|
|
1426
|
-
}, Le = 64;
|
|
1427
|
-
function xe(r, a) {
|
|
1428
|
-
if (r.length === 0) return a;
|
|
1429
|
-
if (a <= 0) return r[0];
|
|
1430
|
-
if (a >= 1) return r[r.length - 1];
|
|
1431
|
-
const t = (r.length - 1) * a, e = Math.floor(t), o = t - e, c = r[e], n = r[e + 1] ?? c;
|
|
1432
|
-
return c + (n - c) * o;
|
|
1433
|
-
}
|
|
1580
|
+
], Ee = new Map(
|
|
1581
|
+
we.map((e) => [e.id, e])
|
|
1582
|
+
);
|
|
1434
1583
|
export {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1584
|
+
_ as GRYT_FONT_KEYS,
|
|
1585
|
+
he as GRYT_FONT_STACK_MAX,
|
|
1586
|
+
T as GRYT_HUE_KEYS,
|
|
1587
|
+
ue as GRYT_MOTION_CURVES,
|
|
1588
|
+
ge as GRYT_MOTION_SCALE_MAX,
|
|
1589
|
+
V as GRYT_NEUTRAL_KEYS,
|
|
1590
|
+
E as GRYT_RADIUS_KEYS,
|
|
1591
|
+
be as GRYT_THEME_NAME_MAX,
|
|
1439
1592
|
S as alphaScale,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1593
|
+
I as cloneGrytTheme,
|
|
1594
|
+
Se as contrast,
|
|
1595
|
+
Me as createGrytTheme,
|
|
1596
|
+
Ge as decodeGrytTheme,
|
|
1597
|
+
De as encodeGrytTheme,
|
|
1598
|
+
ke as grytAlphaScales,
|
|
1599
|
+
Te as grytAlphaScalesLight,
|
|
1600
|
+
Re as grytDrawerBleed,
|
|
1601
|
+
ae as grytDurations,
|
|
1602
|
+
N as grytFonts,
|
|
1603
|
+
b as grytLightTokens,
|
|
1604
|
+
v as grytMotion,
|
|
1605
|
+
we as grytPresets,
|
|
1606
|
+
Ee as grytPresetsById,
|
|
1607
|
+
ve as grytScaleSteps,
|
|
1608
|
+
O as grytScales,
|
|
1609
|
+
G as grytScalesLight,
|
|
1610
|
+
x as grytTheme,
|
|
1611
|
+
ye as grytThemeHues,
|
|
1612
|
+
$e as grytThemeToOptions,
|
|
1613
|
+
f as grytTokens,
|
|
1614
|
+
A as hexToOklch,
|
|
1615
|
+
w as hexToRgb,
|
|
1616
|
+
y as hueScale,
|
|
1617
|
+
m as hueScaleLight,
|
|
1618
|
+
X as isBezier,
|
|
1619
|
+
q as isFontStack,
|
|
1620
|
+
Z as isHexColor,
|
|
1621
|
+
le as isValidBezier,
|
|
1622
|
+
z as neutralScale,
|
|
1623
|
+
W as neutralScaleLight,
|
|
1624
|
+
P as normalizeHexColor,
|
|
1625
|
+
C as normalizeThemeName,
|
|
1626
|
+
L as oklchToHex,
|
|
1627
|
+
B as rgbToHex,
|
|
1628
|
+
Ae as sampleCurve,
|
|
1629
|
+
re as springSamples,
|
|
1630
|
+
M as springTightSamples
|
|
1473
1631
|
};
|
|
1474
1632
|
//# sourceMappingURL=index.js.map
|