@vokril/ui-solid 0.25.0 → 0.26.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/CHANGELOG.md +11 -0
- package/README.md +16 -6
- package/dist/_internal/platform/settings/settingsTypes.d.cts +7 -0
- package/dist/_internal/platform/settings/settingsTypes.d.ts +7 -0
- package/dist/appThemeDerivation-Be_oKljl.cjs +1 -0
- package/dist/{appThemeDerivation-B7-DjMIM.js → appThemeDerivation-CKoSe4KP.js} +334 -252
- package/dist/fonts/manrope.css +10 -0
- package/dist/fonts.css +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +476 -472
- package/dist/server/appThemeDerivation-Be_oKljl.cjs +1 -0
- package/dist/server/{appThemeDerivation-B7-DjMIM.js → appThemeDerivation-CKoSe4KP.js} +334 -252
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +468 -464
- package/dist/server/tokens/index.cjs +1 -1
- package/dist/server/tokens/index.js +33 -29
- package/dist/solid/tokens/index.js +1 -1
- package/dist/solid/tokens/palette/palettes.js +62 -4
- package/dist/solid/tokens/palette/themeRegistry.js +30 -7
- package/dist/solid/tokens/theme.jsx +12 -5
- package/dist/style.css +288 -9
- package/dist/theme.css +287 -8
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +33 -29
- package/dist/tokens/palette/palettes.d.cts +13 -13
- package/dist/tokens/palette/palettes.d.ts +13 -13
- package/dist/tokens/palette/themeRegistry.d.cts +27 -6
- package/dist/tokens/palette/themeRegistry.d.ts +27 -6
- package/dist/tokens/theme.d.cts +11 -8
- package/dist/tokens/theme.d.ts +11 -8
- package/dist/tokens/tokens.css +287 -8
- package/dist/ui.css +1 -1
- package/package.json +3 -2
- package/dist/appThemeDerivation-NS3Vws8q.cjs +0 -1
- package/dist/server/appThemeDerivation-NS3Vws8q.cjs +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { B as
|
|
4
|
-
const
|
|
1
|
+
import { createComponent as fn, isDev as ln } from "solid-js/web";
|
|
2
|
+
import { createSignal as _, onCleanup as gn, createMemo as W, createEffect as yn, useContext as mn, createContext as bn } from "solid-js";
|
|
3
|
+
import { B as Z } from "./bugIndicatingError-h3J5qkL6.js";
|
|
4
|
+
const w = [
|
|
5
5
|
{
|
|
6
|
-
id: "
|
|
7
|
-
label: "
|
|
6
|
+
id: "viper-dark",
|
|
7
|
+
label: "Viper Dark",
|
|
8
8
|
type: "dark",
|
|
9
|
+
design: "viper",
|
|
9
10
|
palette: {
|
|
10
11
|
surface: "#212329",
|
|
11
12
|
surfaceAlt: "#181A1F",
|
|
@@ -30,9 +31,10 @@ const x = [
|
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
|
-
id: "light",
|
|
34
|
-
label: "
|
|
34
|
+
id: "viper-light",
|
|
35
|
+
label: "Viper Light",
|
|
35
36
|
type: "light",
|
|
37
|
+
design: "viper",
|
|
36
38
|
palette: {
|
|
37
39
|
surface: "#FFFFFF",
|
|
38
40
|
surfaceAlt: "#F3F4F8",
|
|
@@ -56,6 +58,62 @@ const x = [
|
|
|
56
58
|
syntaxComment: "#696D79"
|
|
57
59
|
}
|
|
58
60
|
},
|
|
61
|
+
{
|
|
62
|
+
id: "vokril-dark",
|
|
63
|
+
label: "Vokril Dark",
|
|
64
|
+
type: "dark",
|
|
65
|
+
design: "vokril",
|
|
66
|
+
palette: {
|
|
67
|
+
surface: "#121018",
|
|
68
|
+
surfaceAlt: "#1C1925",
|
|
69
|
+
surfaceElevated: "#121018",
|
|
70
|
+
brand: "#8C75F2",
|
|
71
|
+
brandHover: "#A593F6",
|
|
72
|
+
content: "#F0EDF7",
|
|
73
|
+
contentSecondary: "#A8A1B8",
|
|
74
|
+
border: "#2C2838",
|
|
75
|
+
input: "#1C1925",
|
|
76
|
+
inputBorder: "#2C2838",
|
|
77
|
+
success: "#4FB772",
|
|
78
|
+
error: "#FF8A80",
|
|
79
|
+
warning: "#F0A945",
|
|
80
|
+
info: "#55A8DB",
|
|
81
|
+
syntaxKeyword: "#BC97E8",
|
|
82
|
+
syntaxString: "#92C487",
|
|
83
|
+
syntaxFunction: "#F0C77C",
|
|
84
|
+
syntaxNumber: "#6FBCE3",
|
|
85
|
+
syntaxType: "#76CDC5",
|
|
86
|
+
syntaxComment: "#8F939F"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "vokril-light",
|
|
91
|
+
label: "Vokril Light",
|
|
92
|
+
type: "light",
|
|
93
|
+
design: "vokril",
|
|
94
|
+
palette: {
|
|
95
|
+
surface: "#FFFFFF",
|
|
96
|
+
surfaceAlt: "#F3F1F7",
|
|
97
|
+
surfaceElevated: "#FFFFFF",
|
|
98
|
+
brand: "#593BD8",
|
|
99
|
+
brandHover: "#4227B4",
|
|
100
|
+
content: "#24212D",
|
|
101
|
+
contentSecondary: "#5E596B",
|
|
102
|
+
border: "#DEDBE5",
|
|
103
|
+
input: "#FFFFFF",
|
|
104
|
+
inputBorder: "#DEDBE5",
|
|
105
|
+
success: "#048A45",
|
|
106
|
+
error: "#B42318",
|
|
107
|
+
warning: "#C27400",
|
|
108
|
+
info: "#007AB0",
|
|
109
|
+
syntaxKeyword: "#7D3AB7",
|
|
110
|
+
syntaxString: "#357426",
|
|
111
|
+
syntaxFunction: "#895709",
|
|
112
|
+
syntaxNumber: "#006A9D",
|
|
113
|
+
syntaxType: "#007973",
|
|
114
|
+
syntaxComment: "#696D79"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
59
117
|
{
|
|
60
118
|
id: "high-contrast-dark",
|
|
61
119
|
label: "High Contrast Dark",
|
|
@@ -110,35 +168,55 @@ const x = [
|
|
|
110
168
|
syntaxComment: "#404040"
|
|
111
169
|
}
|
|
112
170
|
}
|
|
113
|
-
],
|
|
114
|
-
|
|
115
|
-
|
|
171
|
+
], nn = {
|
|
172
|
+
viper: { dark: "viper-dark", light: "viper-light" },
|
|
173
|
+
vokril: { dark: "vokril-dark", light: "vokril-light" }
|
|
174
|
+
}, Fn = "viper-dark", hn = {
|
|
175
|
+
darcula: "viper-dark",
|
|
176
|
+
light: "viper-light"
|
|
177
|
+
}, rn = (n) => hn[n] ?? n;
|
|
178
|
+
let I = "viper";
|
|
179
|
+
function nr(n) {
|
|
180
|
+
if (!Object.prototype.hasOwnProperty.call(nn, n))
|
|
181
|
+
throw new Error(`Unknown theme design: ${String(n)}`);
|
|
182
|
+
I = n;
|
|
183
|
+
}
|
|
184
|
+
function rr() {
|
|
185
|
+
return I;
|
|
186
|
+
}
|
|
187
|
+
function p(n = "dark") {
|
|
188
|
+
return nn[I][n];
|
|
189
|
+
}
|
|
190
|
+
const v = [];
|
|
191
|
+
function er(n) {
|
|
192
|
+
return v.push(n), {
|
|
116
193
|
dispose: () => {
|
|
117
|
-
const r =
|
|
118
|
-
r !== -1 &&
|
|
194
|
+
const r = v.indexOf(n);
|
|
195
|
+
r !== -1 && v.splice(r, 1);
|
|
119
196
|
}
|
|
120
197
|
};
|
|
121
198
|
}
|
|
122
|
-
function
|
|
123
|
-
for (const r of
|
|
199
|
+
function en(n) {
|
|
200
|
+
for (const r of v) {
|
|
124
201
|
const e = r.byId(n);
|
|
125
202
|
if (e !== null) return e;
|
|
126
203
|
}
|
|
127
204
|
return null;
|
|
128
205
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
206
|
+
const tn = (n) => n.design === void 0 || n.design === I, S = (n) => w.find((r) => r.id === n);
|
|
207
|
+
function E(n) {
|
|
208
|
+
const r = rn(n), e = S(r);
|
|
209
|
+
return e && !tn(e) ? S(p(e.type)) : e ?? en(r) ?? S(p());
|
|
132
210
|
}
|
|
133
|
-
function
|
|
134
|
-
return [...
|
|
211
|
+
function pn() {
|
|
212
|
+
return [...w.filter(tn), ...v.flatMap((n) => n.options())];
|
|
135
213
|
}
|
|
136
|
-
function
|
|
137
|
-
const r =
|
|
138
|
-
return
|
|
214
|
+
function tr(n) {
|
|
215
|
+
const r = rn(n);
|
|
216
|
+
return S(r) !== void 0 || en(r) !== null;
|
|
139
217
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
218
|
+
const D = 4.5, kn = 3;
|
|
219
|
+
function xn(n) {
|
|
142
220
|
const r = n.trim().replace(/^#/, ""), e = r.length === 3 ? r.split("").map((t) => t + t).join("") : r;
|
|
143
221
|
return e.length !== 6 || /[^0-9a-fA-F]/.test(e) ? null : {
|
|
144
222
|
r: Number.parseInt(e.slice(0, 2), 16),
|
|
@@ -146,53 +224,53 @@ function yn(n) {
|
|
|
146
224
|
b: Number.parseInt(e.slice(4, 6), 16)
|
|
147
225
|
};
|
|
148
226
|
}
|
|
149
|
-
function
|
|
227
|
+
function vn({ r: n, g: r, b: e }) {
|
|
150
228
|
const t = (o) => Math.max(0, Math.min(255, Math.round(o))).toString(16).padStart(2, "0");
|
|
151
229
|
return `#${t(n)}${t(r)}${t(e)}`;
|
|
152
230
|
}
|
|
153
|
-
function
|
|
154
|
-
const r =
|
|
231
|
+
function H(n) {
|
|
232
|
+
const r = xn(n);
|
|
155
233
|
if (!r)
|
|
156
|
-
throw new
|
|
234
|
+
throw new Z(
|
|
157
235
|
`contrast: expected #rgb/#rrggbb, got ${JSON.stringify(n)}. Resolve var()/transparent/color-mix to a literal hex before measuring.`
|
|
158
236
|
);
|
|
159
237
|
return r;
|
|
160
238
|
}
|
|
161
|
-
function
|
|
239
|
+
function L(n) {
|
|
162
240
|
const r = n / 255;
|
|
163
241
|
return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
164
242
|
}
|
|
165
|
-
function
|
|
166
|
-
const { r, g: e, b: t } =
|
|
167
|
-
return 0.2126 *
|
|
168
|
-
}
|
|
169
|
-
function
|
|
170
|
-
const e =
|
|
171
|
-
return (o + 0.05) / (
|
|
172
|
-
}
|
|
173
|
-
function
|
|
174
|
-
const t =
|
|
175
|
-
return
|
|
176
|
-
r: t.r + (o.r - t.r) * (1 -
|
|
177
|
-
g: t.g + (o.g - t.g) * (1 -
|
|
178
|
-
b: t.b + (o.b - t.b) * (1 -
|
|
243
|
+
function A(n) {
|
|
244
|
+
const { r, g: e, b: t } = H(n);
|
|
245
|
+
return 0.2126 * L(r) + 0.7152 * L(e) + 0.0722 * L(t);
|
|
246
|
+
}
|
|
247
|
+
function m(n, r) {
|
|
248
|
+
const e = A(n), t = A(r), [o, s] = e > t ? [e, t] : [t, e];
|
|
249
|
+
return (o + 0.05) / (s + 0.05);
|
|
250
|
+
}
|
|
251
|
+
function An(n, r, e) {
|
|
252
|
+
const t = H(n), o = H(r), s = Math.max(0, Math.min(1, e));
|
|
253
|
+
return vn({
|
|
254
|
+
r: t.r + (o.r - t.r) * (1 - s),
|
|
255
|
+
g: t.g + (o.g - t.g) * (1 - s),
|
|
256
|
+
b: t.b + (o.b - t.b) * (1 - s)
|
|
179
257
|
});
|
|
180
258
|
}
|
|
181
259
|
function k(n, r) {
|
|
182
260
|
return n + 1e-9 >= r;
|
|
183
261
|
}
|
|
184
|
-
function
|
|
185
|
-
const r =
|
|
262
|
+
function En(n) {
|
|
263
|
+
const r = A(n);
|
|
186
264
|
return 116 * (r > (6 / 29) ** 3 ? Math.cbrt(r) : r / (3 * (6 / 29) ** 2) + 4 / 29) - 16;
|
|
187
265
|
}
|
|
188
|
-
const
|
|
266
|
+
const N = (n) => {
|
|
189
267
|
const r = n / 255;
|
|
190
268
|
return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
191
|
-
},
|
|
192
|
-
function
|
|
269
|
+
}, Tn = (n) => (n <= 31308e-7 ? 12.92 * n : 1.055 * Math.pow(n, 0.4166666666666667) - 0.055) * 255;
|
|
270
|
+
function Cn(n) {
|
|
193
271
|
const r = n.trim().replace(/^#/, ""), e = r.length === 3 ? r.split("").map((t) => t + t).join("") : r;
|
|
194
272
|
if (e.length !== 6 || /[^0-9a-fA-F]/.test(e))
|
|
195
|
-
throw new
|
|
273
|
+
throw new Z(
|
|
196
274
|
`oklch: expected #rgb/#rrggbb, got ${JSON.stringify(n)}`
|
|
197
275
|
);
|
|
198
276
|
return {
|
|
@@ -201,120 +279,120 @@ function kn(n) {
|
|
|
201
279
|
b: Number.parseInt(e.slice(4, 6), 16)
|
|
202
280
|
};
|
|
203
281
|
}
|
|
204
|
-
function
|
|
205
|
-
const { r, g: e, b: t } =
|
|
206
|
-
return { l, c: Math.hypot(
|
|
282
|
+
function Sn(n) {
|
|
283
|
+
const { r, g: e, b: t } = Cn(n), o = N(r), s = N(e), c = N(t), u = Math.cbrt(0.4122214708 * o + 0.5363325363 * s + 0.0514459929 * c), i = Math.cbrt(0.2119034982 * o + 0.6806995451 * s + 0.1073969566 * c), d = Math.cbrt(0.0883024619 * o + 0.2817188376 * s + 0.6299787005 * c), l = 0.2104542553 * u + 0.793617785 * i - 0.0040720468 * d, y = 1.9779984951 * u - 2.428592205 * i + 0.4505937099 * d, f = 0.0259040371 * u + 0.7827717662 * i - 0.808675766 * d, g = Math.atan2(f, y) * 180 / Math.PI;
|
|
284
|
+
return { l, c: Math.hypot(y, f), h: g < 0 ? g + 360 : g };
|
|
207
285
|
}
|
|
208
|
-
function
|
|
209
|
-
const t = e * Math.PI / 180, o = r * Math.cos(t),
|
|
286
|
+
function K({ l: n, c: r, h: e }) {
|
|
287
|
+
const t = e * Math.PI / 180, o = r * Math.cos(t), s = r * Math.sin(t), c = (n + 0.3963377774 * o + 0.2158037573 * s) ** 3, u = (n - 0.1055613458 * o - 0.0638541728 * s) ** 3, i = (n - 0.0894841775 * o - 1.291485548 * s) ** 3;
|
|
210
288
|
return {
|
|
211
|
-
r: 4.0767416621 *
|
|
212
|
-
g: -1.2684380046 *
|
|
213
|
-
b: -0.0041960863 *
|
|
289
|
+
r: 4.0767416621 * c - 3.3077115913 * u + 0.2309699292 * i,
|
|
290
|
+
g: -1.2684380046 * c + 2.6097574011 * u - 0.3413193965 * i,
|
|
291
|
+
b: -0.0041960863 * c - 0.7034186147 * u + 1.707614701 * i
|
|
214
292
|
};
|
|
215
293
|
}
|
|
216
|
-
const
|
|
217
|
-
function
|
|
218
|
-
if (
|
|
294
|
+
const h = 1e-4, q = ({ r: n, g: r, b: e }) => n >= -h && n <= 1 + h && r >= -h && r <= 1 + h && e >= -h && e <= 1 + h;
|
|
295
|
+
function Bn({ l: n, c: r, h: e }) {
|
|
296
|
+
if (q(K({ l: n, c: r, h: e }))) return r;
|
|
219
297
|
let t = 0, o = r;
|
|
220
|
-
for (let
|
|
221
|
-
const
|
|
222
|
-
|
|
298
|
+
for (let s = 0; s < 24; s++) {
|
|
299
|
+
const c = (t + o) / 2;
|
|
300
|
+
q(K({ l: n, c, h: e })) ? t = c : o = c;
|
|
223
301
|
}
|
|
224
302
|
return t;
|
|
225
303
|
}
|
|
226
|
-
function
|
|
227
|
-
const r =
|
|
304
|
+
function O(n) {
|
|
305
|
+
const r = Bn(n), e = K({ ...n, c: r }), t = (o) => Math.max(0, Math.min(255, Math.round(Tn(o)))).toString(16).padStart(2, "0");
|
|
228
306
|
return `#${t(e.r)}${t(e.g)}${t(e.b)}`;
|
|
229
307
|
}
|
|
230
|
-
function
|
|
231
|
-
const o =
|
|
232
|
-
if (!k(
|
|
233
|
-
let u = o.l, i =
|
|
308
|
+
function U(n, r, e, t) {
|
|
309
|
+
const o = Sn(n), s = t === "lighter" ? 1 : 0, c = O({ ...o, l: s });
|
|
310
|
+
if (!k(m(c, r), e)) return c;
|
|
311
|
+
let u = o.l, i = s;
|
|
234
312
|
for (let d = 0; d < 24; d++) {
|
|
235
313
|
const l = (u + i) / 2;
|
|
236
|
-
k(
|
|
314
|
+
k(m(O({ ...o, l }), r), e) ? i = l : u = l;
|
|
237
315
|
}
|
|
238
|
-
return
|
|
316
|
+
return O({ ...o, l: i });
|
|
239
317
|
}
|
|
240
|
-
function
|
|
241
|
-
if (k(
|
|
242
|
-
const t =
|
|
318
|
+
function $(n, r, e) {
|
|
319
|
+
if (k(m(n, r), e)) return n;
|
|
320
|
+
const t = A(n) < A(r), o = U(
|
|
243
321
|
n,
|
|
244
322
|
r,
|
|
245
323
|
e,
|
|
246
324
|
t ? "darker" : "lighter"
|
|
247
325
|
);
|
|
248
|
-
if (k(
|
|
249
|
-
const
|
|
326
|
+
if (k(m(o, r), e)) return o;
|
|
327
|
+
const s = U(
|
|
250
328
|
n,
|
|
251
329
|
r,
|
|
252
330
|
e,
|
|
253
331
|
t ? "lighter" : "darker"
|
|
254
332
|
);
|
|
255
|
-
return
|
|
333
|
+
return m(s, r) > m(o, r) ? s : o;
|
|
256
334
|
}
|
|
257
|
-
function
|
|
335
|
+
function wn(n, r, e) {
|
|
258
336
|
let t = n;
|
|
259
337
|
for (let o = 0; o < 8; o++) {
|
|
260
|
-
let
|
|
261
|
-
for (const
|
|
262
|
-
const u =
|
|
263
|
-
u !== t && (t = u,
|
|
338
|
+
let s = !1;
|
|
339
|
+
for (const c of r) {
|
|
340
|
+
const u = $(t, c, e);
|
|
341
|
+
u !== t && (t = u, s = !0);
|
|
264
342
|
}
|
|
265
|
-
if (!
|
|
343
|
+
if (!s) break;
|
|
266
344
|
}
|
|
267
345
|
return t;
|
|
268
346
|
}
|
|
269
|
-
function
|
|
347
|
+
function Dn(n, r, e) {
|
|
270
348
|
let t = r[0] ?? "#ffffff", o = -1;
|
|
271
|
-
for (const
|
|
272
|
-
const
|
|
273
|
-
if (k(
|
|
274
|
-
|
|
349
|
+
for (const s of r) {
|
|
350
|
+
const c = m(s, n);
|
|
351
|
+
if (k(c, e)) return s;
|
|
352
|
+
c > o && (o = c, t = s);
|
|
275
353
|
}
|
|
276
354
|
return t;
|
|
277
355
|
}
|
|
278
|
-
const
|
|
279
|
-
function
|
|
280
|
-
return
|
|
356
|
+
const In = "#2A2C31", Mn = "#1C1E23", on = 0.25, or = on;
|
|
357
|
+
function _n(n) {
|
|
358
|
+
return $(n.inputBorder, n.input, kn);
|
|
281
359
|
}
|
|
282
|
-
function
|
|
360
|
+
function Ln(n, r, e) {
|
|
283
361
|
const t = [
|
|
284
362
|
r.surface,
|
|
285
363
|
r.surfaceAlt,
|
|
286
364
|
r.surfaceElevated
|
|
287
365
|
];
|
|
288
|
-
return e === "dark" && t.push(
|
|
366
|
+
return e === "dark" && t.push(In, Mn), t.flatMap((o) => [
|
|
289
367
|
o,
|
|
290
|
-
|
|
368
|
+
An(n, o, on)
|
|
291
369
|
]);
|
|
292
370
|
}
|
|
293
|
-
function
|
|
294
|
-
return
|
|
371
|
+
function Nn(n, r, e) {
|
|
372
|
+
return wn(
|
|
295
373
|
n,
|
|
296
|
-
|
|
297
|
-
|
|
374
|
+
Ln(n, r, e),
|
|
375
|
+
D
|
|
298
376
|
);
|
|
299
377
|
}
|
|
300
|
-
const
|
|
378
|
+
const sr = [
|
|
301
379
|
"error",
|
|
302
380
|
"brand",
|
|
303
381
|
"success",
|
|
304
382
|
"warning",
|
|
305
383
|
"info"
|
|
306
|
-
],
|
|
307
|
-
function
|
|
308
|
-
return k(
|
|
384
|
+
], On = 60;
|
|
385
|
+
function T(n) {
|
|
386
|
+
return k(m("#ffffff", n), D) || En(n) >= On ? n : $(n, "#ffffff", D);
|
|
309
387
|
}
|
|
310
|
-
function
|
|
311
|
-
return
|
|
388
|
+
function Hn(n, r) {
|
|
389
|
+
return Dn(
|
|
312
390
|
n,
|
|
313
391
|
["#ffffff", r.surfaceAlt, "#000000"],
|
|
314
|
-
|
|
392
|
+
D
|
|
315
393
|
);
|
|
316
394
|
}
|
|
317
|
-
const
|
|
395
|
+
const cr = ["brand", "error", "success", "warning"], Kn = "#D76CB7", Pn = "data-colorblind-safe", P = {
|
|
318
396
|
/** Bluish green. */
|
|
319
397
|
success: "#009e73",
|
|
320
398
|
/** Vermillion. */
|
|
@@ -323,18 +401,18 @@ const Qn = ["brand", "error", "success", "warning"], _n = "#D76CB7", Ln = "data-
|
|
|
323
401
|
warning: "#e69f00",
|
|
324
402
|
/** Sky blue. */
|
|
325
403
|
info: "#56b4e9"
|
|
326
|
-
},
|
|
327
|
-
added:
|
|
328
|
-
deleted:
|
|
404
|
+
}, j = {
|
|
405
|
+
added: P.success,
|
|
406
|
+
deleted: P.error
|
|
329
407
|
};
|
|
330
|
-
function
|
|
331
|
-
return { ...n, ...
|
|
408
|
+
function Rn(n) {
|
|
409
|
+
return { ...n, ...P };
|
|
332
410
|
}
|
|
333
|
-
function
|
|
334
|
-
return typeof document > "u" ? !1 : document.documentElement.hasAttribute(
|
|
411
|
+
function ir() {
|
|
412
|
+
return typeof document > "u" ? !1 : document.documentElement.hasAttribute(Pn);
|
|
335
413
|
}
|
|
336
|
-
function
|
|
337
|
-
const t = (d) =>
|
|
414
|
+
function $n(n, r, e) {
|
|
415
|
+
const t = (d) => Nn(d, n, r), o = T(n.brand), s = T(n.error), c = T(n.success), u = T(n.warning), i = (d) => Hn(d, n);
|
|
338
416
|
return {
|
|
339
417
|
"--color-surface": n.surface,
|
|
340
418
|
"--color-surface-alt": n.surfaceAlt,
|
|
@@ -350,7 +428,7 @@ function Dn(n, r, e) {
|
|
|
350
428
|
// best is 2.52:1), so this cannot be fixed by editing palettes — a theme added tomorrow
|
|
351
429
|
// would bring the same defect back. For a palette that already passes, the derivation is a
|
|
352
430
|
// no-op, and because it moves luminance in OKLCH the border keeps the theme's hue.
|
|
353
|
-
"--color-input-border":
|
|
431
|
+
"--color-input-border": _n(n),
|
|
354
432
|
"--color-success": n.success,
|
|
355
433
|
"--color-error": n.error,
|
|
356
434
|
"--color-warning": n.warning,
|
|
@@ -362,18 +440,18 @@ function Dn(n, r, e) {
|
|
|
362
440
|
"--color-brand-text": t(n.brand),
|
|
363
441
|
// `unique` is a constant, not a palette field — but the backgrounds it sits on are, so its
|
|
364
442
|
// text variant is derived per theme as well.
|
|
365
|
-
"--color-unique-text": t(
|
|
443
|
+
"--color-unique-text": t(Kn),
|
|
366
444
|
"--color-brand-surface": o,
|
|
367
|
-
"--color-error-surface":
|
|
368
|
-
"--color-success-surface":
|
|
445
|
+
"--color-error-surface": s,
|
|
446
|
+
"--color-success-surface": c,
|
|
369
447
|
"--color-warning-surface": u,
|
|
370
448
|
"--color-on-brand": i(o),
|
|
371
|
-
"--color-on-error": i(
|
|
372
|
-
"--color-on-success": i(
|
|
449
|
+
"--color-on-error": i(s),
|
|
450
|
+
"--color-on-success": i(c),
|
|
373
451
|
"--color-on-warning": i(u),
|
|
374
452
|
// The diff gutter rides on the same signal (added/deleted ≡ success/error).
|
|
375
|
-
"--color-diff-added": e ?
|
|
376
|
-
"--color-diff-deleted": e ?
|
|
453
|
+
"--color-diff-added": e ? j.added : "",
|
|
454
|
+
"--color-diff-deleted": e ? j.deleted : "",
|
|
377
455
|
"--color-syntax-keyword": n.syntaxKeyword,
|
|
378
456
|
"--color-syntax-string": n.syntaxString,
|
|
379
457
|
"--color-syntax-function": n.syntaxFunction,
|
|
@@ -382,82 +460,82 @@ function Dn(n, r, e) {
|
|
|
382
460
|
"--color-syntax-type": n.syntaxType
|
|
383
461
|
};
|
|
384
462
|
}
|
|
385
|
-
const
|
|
386
|
-
function
|
|
387
|
-
return
|
|
463
|
+
const X = "data-colorblind-safe", Y = "data-design";
|
|
464
|
+
function sn(n, r = !1) {
|
|
465
|
+
return E(n === "system" ? p(r ? "light" : "dark") : n === "dark" ? p("dark") : n === "light" ? p("light") : n);
|
|
388
466
|
}
|
|
389
|
-
function
|
|
467
|
+
function Vn(n, r = {}) {
|
|
390
468
|
var u, i;
|
|
391
|
-
const e = typeof n == "string" ?
|
|
469
|
+
const e = typeof n == "string" ? sn(n) : n, t = r.document ?? (typeof document < "u" ? document : void 0);
|
|
392
470
|
if (!t) return e;
|
|
393
|
-
const o = t.documentElement,
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
for (const [d, l] of Object.entries(
|
|
471
|
+
const o = t.documentElement, s = r.colorVisionSafe ?? !1;
|
|
472
|
+
s ? o.setAttribute(X, "") : o.removeAttribute(X);
|
|
473
|
+
const c = s ? Rn(e.palette) : e.palette;
|
|
474
|
+
for (const [d, l] of Object.entries($n(c, e.type, s)))
|
|
397
475
|
o.style.setProperty(d, l);
|
|
398
|
-
return (u = t.body) == null || u.classList.remove("light", "dark"), (i = t.body) == null || i.classList.add(e.type), o.classList.remove("light", "dark"), o.classList.add(e.type), o.style.colorScheme = e.type, o.setAttribute("data-app-theme", e.id), e;
|
|
476
|
+
return (u = t.body) == null || u.classList.remove("light", "dark"), (i = t.body) == null || i.classList.add(e.type), o.classList.remove("light", "dark"), o.classList.add(e.type), o.style.colorScheme = e.type, o.setAttribute("data-app-theme", e.id), e.design ? o.setAttribute(Y, e.design) : o.removeAttribute(Y), e;
|
|
399
477
|
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
478
|
+
function ar() {
|
|
479
|
+
return pn();
|
|
402
480
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
481
|
+
const Gn = "vokril-ui-theme", Wn = "(prefers-color-scheme: light)";
|
|
482
|
+
function qn() {
|
|
405
483
|
try {
|
|
406
484
|
return typeof localStorage > "u" ? null : localStorage;
|
|
407
485
|
} catch {
|
|
408
486
|
return null;
|
|
409
487
|
}
|
|
410
488
|
}
|
|
411
|
-
const
|
|
412
|
-
var
|
|
413
|
-
const r = n.storageKey === void 0 ?
|
|
489
|
+
const cn = bn(), ur = (n) => {
|
|
490
|
+
var V, G;
|
|
491
|
+
const r = n.storageKey === void 0 ? Gn : n.storageKey, e = n.storage === void 0 ? qn() : n.storage, t = () => {
|
|
414
492
|
if (!e || !r) return null;
|
|
415
493
|
try {
|
|
416
494
|
return e.getItem(r);
|
|
417
495
|
} catch {
|
|
418
496
|
return null;
|
|
419
497
|
}
|
|
420
|
-
}, o = ((
|
|
421
|
-
if (
|
|
422
|
-
const
|
|
423
|
-
|
|
498
|
+
}, o = ((V = n.document) == null ? void 0 : V.defaultView) ?? (typeof window > "u" ? void 0 : window), s = (G = o == null ? void 0 : o.matchMedia) == null ? void 0 : G.call(o, Wn), [c, u] = _(t() ?? n.defaultTheme ?? "dark"), [i, d] = _((s == null ? void 0 : s.matches) ?? !1), [l, y] = _(n.colorVisionSafe ?? !1);
|
|
499
|
+
if (s) {
|
|
500
|
+
const x = (dn) => d(dn.matches);
|
|
501
|
+
s.addEventListener("change", x), gn(() => s.removeEventListener("change", x));
|
|
424
502
|
}
|
|
425
|
-
const f =
|
|
426
|
-
if (u(
|
|
503
|
+
const f = W(() => sn(c(), i())), g = W(() => f().type), b = (x) => {
|
|
504
|
+
if (u(x), !(!e || !r))
|
|
427
505
|
try {
|
|
428
|
-
e.setItem(r,
|
|
506
|
+
e.setItem(r, x);
|
|
429
507
|
} catch {
|
|
430
508
|
}
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
|
|
509
|
+
}, M = () => b(g() === "dark" ? "light" : "dark");
|
|
510
|
+
yn(() => {
|
|
511
|
+
Vn(f(), {
|
|
434
512
|
colorVisionSafe: l(),
|
|
435
513
|
document: n.document
|
|
436
514
|
});
|
|
437
515
|
});
|
|
438
|
-
const
|
|
439
|
-
theme:
|
|
516
|
+
const un = {
|
|
517
|
+
theme: c,
|
|
440
518
|
resolvedTheme: g,
|
|
441
519
|
themeId: () => f().id,
|
|
442
520
|
setTheme: b,
|
|
443
|
-
toggleTheme:
|
|
521
|
+
toggleTheme: M,
|
|
444
522
|
colorVisionSafe: l,
|
|
445
|
-
setColorVisionSafe:
|
|
523
|
+
setColorVisionSafe: y
|
|
446
524
|
};
|
|
447
|
-
return cn
|
|
448
|
-
value:
|
|
525
|
+
return fn(cn.Provider, {
|
|
526
|
+
value: un,
|
|
449
527
|
get children() {
|
|
450
528
|
return n.children;
|
|
451
529
|
}
|
|
452
530
|
});
|
|
453
531
|
};
|
|
454
|
-
let
|
|
455
|
-
function
|
|
456
|
-
const n =
|
|
457
|
-
return n || (
|
|
532
|
+
let z = !1;
|
|
533
|
+
function dr() {
|
|
534
|
+
const n = mn(cn);
|
|
535
|
+
return n || (ln && !z && (z = !0, console.warn("@vokril/ui-solid: useTheme() was called outside <ThemeProvider>; it reports the design's dark theme and ignores setTheme.")), {
|
|
458
536
|
theme: () => "dark",
|
|
459
537
|
resolvedTheme: () => "dark",
|
|
460
|
-
themeId: () =>
|
|
538
|
+
themeId: () => p(),
|
|
461
539
|
setTheme: () => {
|
|
462
540
|
},
|
|
463
541
|
toggleTheme: () => {
|
|
@@ -467,12 +545,12 @@ function er() {
|
|
|
467
545
|
}
|
|
468
546
|
});
|
|
469
547
|
}
|
|
470
|
-
var
|
|
471
|
-
const
|
|
472
|
-
function
|
|
548
|
+
var Q;
|
|
549
|
+
const J = ((Q = w.find((n) => n.id === Fn)) == null ? void 0 : Q.palette) ?? w[0].palette;
|
|
550
|
+
function Un(n) {
|
|
473
551
|
return Math.max(0, Math.min(255, Math.round(n)));
|
|
474
552
|
}
|
|
475
|
-
function
|
|
553
|
+
function R(n) {
|
|
476
554
|
const r = n.trim().replace(/^#/, ""), e = r.length === 3 ? r.split("").map((t) => t + t).join("") : r;
|
|
477
555
|
return e.length !== 6 || /[^0-9a-fA-F]/.test(e) ? null : {
|
|
478
556
|
r: Number.parseInt(e.slice(0, 2), 16),
|
|
@@ -480,42 +558,42 @@ function P(n) {
|
|
|
480
558
|
b: Number.parseInt(e.slice(4, 6), 16)
|
|
481
559
|
};
|
|
482
560
|
}
|
|
483
|
-
function
|
|
484
|
-
const t = (o) =>
|
|
561
|
+
function B({ r: n, g: r, b: e }) {
|
|
562
|
+
const t = (o) => Un(o).toString(16).padStart(2, "0");
|
|
485
563
|
return `#${t(n)}${t(r)}${t(e)}`;
|
|
486
564
|
}
|
|
487
565
|
function a(n, r = "#000000") {
|
|
488
|
-
const e =
|
|
489
|
-
return e ?
|
|
566
|
+
const e = R(n);
|
|
567
|
+
return e ? B(e) : r;
|
|
490
568
|
}
|
|
491
|
-
function
|
|
492
|
-
const t =
|
|
569
|
+
function F(n, r, e) {
|
|
570
|
+
const t = R(n), o = R(r);
|
|
493
571
|
if (!t && !o) return "#000000";
|
|
494
|
-
if (!t) return
|
|
495
|
-
if (!o) return
|
|
496
|
-
const
|
|
497
|
-
return
|
|
498
|
-
r: t.r + (o.r - t.r) *
|
|
499
|
-
g: t.g + (o.g - t.g) *
|
|
500
|
-
b: t.b + (o.b - t.b) *
|
|
572
|
+
if (!t) return B(o);
|
|
573
|
+
if (!o) return B(t);
|
|
574
|
+
const s = Math.max(0, Math.min(1, e));
|
|
575
|
+
return B({
|
|
576
|
+
r: t.r + (o.r - t.r) * s,
|
|
577
|
+
g: t.g + (o.g - t.g) * s,
|
|
578
|
+
b: t.b + (o.b - t.b) * s
|
|
501
579
|
});
|
|
502
580
|
}
|
|
503
|
-
const
|
|
504
|
-
function
|
|
505
|
-
return
|
|
581
|
+
const jn = "#ffffff", Xn = "#000000";
|
|
582
|
+
function an(n, r) {
|
|
583
|
+
return F(n, jn, r);
|
|
506
584
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
585
|
+
function Yn(n, r) {
|
|
586
|
+
return F(n, Xn, r);
|
|
509
587
|
}
|
|
510
|
-
function
|
|
511
|
-
return r === "dark" ?
|
|
588
|
+
function zn(n, r, e) {
|
|
589
|
+
return r === "dark" ? an(n, e) : Yn(n, e);
|
|
512
590
|
}
|
|
513
|
-
function
|
|
591
|
+
function C(n, r) {
|
|
514
592
|
return `${a(n)}${r}`;
|
|
515
593
|
}
|
|
516
|
-
function
|
|
517
|
-
if (typeof document > "u") return
|
|
518
|
-
const n = getComputedStyle(document.documentElement), r = (t, o) => n.getPropertyValue(t).trim() || o, e =
|
|
594
|
+
function fr() {
|
|
595
|
+
if (typeof document > "u") return J;
|
|
596
|
+
const n = getComputedStyle(document.documentElement), r = (t, o) => n.getPropertyValue(t).trim() || o, e = J;
|
|
519
597
|
return {
|
|
520
598
|
surface: r("--color-surface", e.surface),
|
|
521
599
|
surfaceAlt: r("--color-surface-alt", e.surfaceAlt),
|
|
@@ -539,19 +617,19 @@ function tr() {
|
|
|
539
617
|
syntaxType: r("--color-syntax-type", e.syntaxType)
|
|
540
618
|
};
|
|
541
619
|
}
|
|
542
|
-
function
|
|
620
|
+
function lr() {
|
|
543
621
|
return typeof document > "u" ? "dark" : document.body.classList.contains("light") ? "light" : "dark";
|
|
544
622
|
}
|
|
545
|
-
function
|
|
623
|
+
function gr() {
|
|
546
624
|
return typeof document > "u" ? "" : document.documentElement.getAttribute("data-app-theme") ?? "";
|
|
547
625
|
}
|
|
548
|
-
function
|
|
549
|
-
const e = a(n.syntaxKeyword), t = a(n.syntaxString), o = a(n.syntaxFunction),
|
|
626
|
+
function yr(n, r) {
|
|
627
|
+
const e = a(n.syntaxKeyword), t = a(n.syntaxString), o = a(n.syntaxFunction), s = a(n.syntaxComment), c = a(n.syntaxNumber), u = a(n.syntaxType), i = a(n.content), d = a(n.brand), l = a(n.error), y = [
|
|
550
628
|
{ token: "", foreground: i.slice(1) },
|
|
551
|
-
{ token: "comment", foreground:
|
|
629
|
+
{ token: "comment", foreground: s.slice(1), fontStyle: "italic" },
|
|
552
630
|
{
|
|
553
631
|
token: "comment.quote",
|
|
554
|
-
foreground:
|
|
632
|
+
foreground: s.slice(1),
|
|
555
633
|
fontStyle: "italic"
|
|
556
634
|
},
|
|
557
635
|
{ token: "keyword", foreground: e.slice(1) },
|
|
@@ -561,10 +639,10 @@ function sr(n, r) {
|
|
|
561
639
|
{ token: "string", foreground: t.slice(1) },
|
|
562
640
|
{ token: "string.sql", foreground: t.slice(1) },
|
|
563
641
|
{ token: "string.escape", foreground: e.slice(1) },
|
|
564
|
-
{ token: "number", foreground:
|
|
565
|
-
{ token: "number.float", foreground:
|
|
566
|
-
{ token: "number.hex", foreground:
|
|
567
|
-
{ token: "constant", foreground:
|
|
642
|
+
{ token: "number", foreground: c.slice(1) },
|
|
643
|
+
{ token: "number.float", foreground: c.slice(1) },
|
|
644
|
+
{ token: "number.hex", foreground: c.slice(1) },
|
|
645
|
+
{ token: "constant", foreground: c.slice(1) },
|
|
568
646
|
{ token: "type", foreground: u.slice(1) },
|
|
569
647
|
{ token: "type.identifier", foreground: u.slice(1) },
|
|
570
648
|
{ token: "predefined", foreground: o.slice(1) },
|
|
@@ -579,15 +657,15 @@ function sr(n, r) {
|
|
|
579
657
|
{ token: "attribute.value", foreground: t.slice(1) },
|
|
580
658
|
{ token: "annotation", foreground: n.warning.replace(/^#/, "") },
|
|
581
659
|
{ token: "regexp", foreground: l.slice(1) }
|
|
582
|
-
], f = a(n.surfaceAlt), g = a(n.surface), b = a(n.surfaceElevated),
|
|
660
|
+
], f = a(n.surfaceAlt), g = a(n.surface), b = a(n.surfaceElevated), M = {
|
|
583
661
|
"editor.background": f,
|
|
584
662
|
"editor.foreground": i,
|
|
585
663
|
"editorLineNumber.foreground": a(n.contentSecondary),
|
|
586
664
|
"editorLineNumber.activeForeground": i,
|
|
587
665
|
"editorCursor.foreground": d,
|
|
588
|
-
"editor.selectionBackground":
|
|
589
|
-
"editor.inactiveSelectionBackground":
|
|
590
|
-
"editor.lineHighlightBackground":
|
|
666
|
+
"editor.selectionBackground": F(g, d, 0.32),
|
|
667
|
+
"editor.inactiveSelectionBackground": F(g, d, 0.18),
|
|
668
|
+
"editor.lineHighlightBackground": F(f, g, 0.55),
|
|
591
669
|
"editorWidget.background": b,
|
|
592
670
|
"editorWidget.foreground": i,
|
|
593
671
|
"editorWidget.border": a(n.border),
|
|
@@ -596,79 +674,83 @@ function sr(n, r) {
|
|
|
596
674
|
"input.foreground": i,
|
|
597
675
|
"input.border": a(n.inputBorder),
|
|
598
676
|
"input.placeholderForeground": a(n.contentSecondary),
|
|
599
|
-
"inputOption.activeBackground":
|
|
677
|
+
"inputOption.activeBackground": C(d, "40"),
|
|
600
678
|
"inputOption.activeBorder": d,
|
|
601
679
|
"inputOption.activeForeground": i,
|
|
602
680
|
focusBorder: d,
|
|
603
|
-
"editor.findMatchBackground":
|
|
604
|
-
"editor.findMatchHighlightBackground":
|
|
605
|
-
"editor.findRangeHighlightBackground":
|
|
681
|
+
"editor.findMatchBackground": C(a(n.warning), "80"),
|
|
682
|
+
"editor.findMatchHighlightBackground": C(a(n.warning), "40"),
|
|
683
|
+
"editor.findRangeHighlightBackground": C(b, "60")
|
|
606
684
|
};
|
|
607
685
|
return {
|
|
608
686
|
base: r === "dark" ? "vs-dark" : "vs",
|
|
609
687
|
inherit: !0,
|
|
610
|
-
rules:
|
|
611
|
-
colors:
|
|
688
|
+
rules: y,
|
|
689
|
+
colors: M
|
|
612
690
|
};
|
|
613
691
|
}
|
|
614
|
-
function
|
|
615
|
-
const e = a(n.surface), t = a(n.surfaceElevated), o = a(n.content),
|
|
692
|
+
function mr(n, r) {
|
|
693
|
+
const e = a(n.surface), t = a(n.surfaceElevated), o = a(n.content), s = a(n.contentSecondary), c = a(n.brand), u = a(n.error), i = a(n.success), d = a(n.warning), l = a(n.info), y = a(n.syntaxKeyword), f = (b) => zn(b, r, 0.22), g = {
|
|
616
694
|
black: t,
|
|
617
695
|
red: u,
|
|
618
696
|
green: i,
|
|
619
697
|
yellow: d,
|
|
620
|
-
blue:
|
|
621
|
-
magenta:
|
|
698
|
+
blue: c,
|
|
699
|
+
magenta: y,
|
|
622
700
|
cyan: l,
|
|
623
|
-
white:
|
|
624
|
-
brightBlack:
|
|
701
|
+
white: s,
|
|
702
|
+
brightBlack: F(t, o, 0.4),
|
|
625
703
|
brightRed: f(u),
|
|
626
704
|
brightGreen: f(i),
|
|
627
705
|
brightYellow: f(d),
|
|
628
|
-
brightBlue: f(
|
|
629
|
-
brightMagenta: f(
|
|
706
|
+
brightBlue: f(c),
|
|
707
|
+
brightMagenta: f(y),
|
|
630
708
|
brightCyan: f(l),
|
|
631
|
-
brightWhite: r === "dark" ?
|
|
709
|
+
brightWhite: r === "dark" ? an(o, 0.25) : o
|
|
632
710
|
};
|
|
633
711
|
return {
|
|
634
712
|
background: e,
|
|
635
713
|
foreground: o,
|
|
636
|
-
cursor:
|
|
637
|
-
selectionBackground:
|
|
714
|
+
cursor: c,
|
|
715
|
+
selectionBackground: F(t, c, 0.2),
|
|
638
716
|
...g
|
|
639
717
|
};
|
|
640
718
|
}
|
|
641
719
|
export {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
720
|
+
Rn as A,
|
|
721
|
+
dr as B,
|
|
722
|
+
Fn as D,
|
|
723
|
+
cr as I,
|
|
724
|
+
hn as L,
|
|
725
|
+
or as M,
|
|
726
|
+
j as O,
|
|
727
|
+
sr as T,
|
|
728
|
+
Kn as U,
|
|
729
|
+
Mn as W,
|
|
730
|
+
nn as a,
|
|
731
|
+
ur as b,
|
|
732
|
+
In as c,
|
|
733
|
+
T as d,
|
|
734
|
+
_n as e,
|
|
735
|
+
Hn as f,
|
|
736
|
+
Nn as g,
|
|
737
|
+
Vn as h,
|
|
738
|
+
$n as i,
|
|
739
|
+
yr as j,
|
|
740
|
+
mr as k,
|
|
741
|
+
p as l,
|
|
742
|
+
E as m,
|
|
743
|
+
rr as n,
|
|
744
|
+
pn as o,
|
|
745
|
+
ar as p,
|
|
746
|
+
ir as q,
|
|
667
747
|
tr as r,
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
748
|
+
fr as s,
|
|
749
|
+
gr as t,
|
|
750
|
+
lr as u,
|
|
751
|
+
er as v,
|
|
752
|
+
sn as w,
|
|
753
|
+
nr as x,
|
|
754
|
+
Ln as y,
|
|
755
|
+
w as z
|
|
674
756
|
};
|