@vokril/ui-solid 0.24.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +16 -6
  3. package/dist/CommandPalette-Bf8flX2t.cjs +2 -0
  4. package/dist/{CommandPalette-CBA_Shqx.js → CommandPalette-CoIdCmZ0.js} +1287 -1278
  5. package/dist/_internal/platform/settings/settingsTypes.d.cts +7 -0
  6. package/dist/_internal/platform/settings/settingsTypes.d.ts +7 -0
  7. package/dist/appThemeDerivation-Be_oKljl.cjs +1 -0
  8. package/dist/{server/appThemeDerivation-B7-DjMIM.js → appThemeDerivation-CKoSe4KP.js} +334 -252
  9. package/dist/fonts/manrope.css +10 -0
  10. package/dist/fonts.css +2 -0
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +476 -472
  13. package/dist/overlay/Drawer.d.cts +8 -0
  14. package/dist/overlay/Drawer.d.ts +8 -0
  15. package/dist/overlay/index.cjs +1 -1
  16. package/dist/overlay/index.js +1 -1
  17. package/dist/server/{CommandPalette-DE59Rq-n.js → CommandPalette-COVjWlx9.js} +772 -764
  18. package/dist/server/CommandPalette-C_9Z8gVc.cjs +1 -0
  19. package/dist/server/appThemeDerivation-Be_oKljl.cjs +1 -0
  20. package/dist/{appThemeDerivation-B7-DjMIM.js → server/appThemeDerivation-CKoSe4KP.js} +334 -252
  21. package/dist/server/index.cjs +1 -1
  22. package/dist/server/index.js +468 -464
  23. package/dist/server/overlay/index.cjs +1 -1
  24. package/dist/server/overlay/index.js +1 -1
  25. package/dist/server/tokens/index.cjs +1 -1
  26. package/dist/server/tokens/index.js +33 -29
  27. package/dist/solid/overlay/Drawer.jsx +18 -7
  28. package/dist/solid/overlay/Drawer.module.css.js +1 -0
  29. package/dist/solid/tokens/index.js +1 -1
  30. package/dist/solid/tokens/palette/palettes.js +62 -4
  31. package/dist/solid/tokens/palette/themeRegistry.js +30 -7
  32. package/dist/solid/tokens/theme.jsx +12 -5
  33. package/dist/style.css +288 -9
  34. package/dist/theme.css +287 -8
  35. package/dist/tokens/index.cjs +1 -1
  36. package/dist/tokens/index.d.cts +2 -2
  37. package/dist/tokens/index.d.ts +2 -2
  38. package/dist/tokens/index.js +33 -29
  39. package/dist/tokens/palette/palettes.d.cts +13 -13
  40. package/dist/tokens/palette/palettes.d.ts +13 -13
  41. package/dist/tokens/palette/themeRegistry.d.cts +27 -6
  42. package/dist/tokens/palette/themeRegistry.d.ts +27 -6
  43. package/dist/tokens/theme.d.cts +11 -8
  44. package/dist/tokens/theme.d.ts +11 -8
  45. package/dist/tokens/tokens.css +287 -8
  46. package/dist/ui.css +1 -1
  47. package/package.json +3 -2
  48. package/dist/CommandPalette-CBFIo0FX.cjs +0 -2
  49. package/dist/appThemeDerivation-NS3Vws8q.cjs +0 -1
  50. package/dist/server/CommandPalette-CRT5VEoR.cjs +0 -1
  51. package/dist/server/appThemeDerivation-NS3Vws8q.cjs +0 -1
@@ -1,11 +1,12 @@
1
- import { createComponent as cn, isDev as sn } from "solid-js/web";
2
- import { createSignal as I, onCleanup as an, createMemo as V, createEffect as un, useContext as dn, createContext as fn } from "solid-js";
3
- import { B as z } from "./bugIndicatingError-h3J5qkL6.js";
4
- const x = [
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: "vokril-dark",
7
- label: "Vokril Dark",
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: "Vokril Light",
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
- ], C = "vokril-dark", ln = { darcula: "vokril-dark" }, J = (n) => ln[n] ?? n, E = [];
114
- function Xn(n) {
115
- return E.push(n), {
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 = E.indexOf(n);
118
- r !== -1 && E.splice(r, 1);
194
+ const r = v.indexOf(n);
195
+ r !== -1 && v.splice(r, 1);
119
196
  }
120
197
  };
121
198
  }
122
- function Q(n) {
123
- for (const r of E) {
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
- function M(n) {
130
- const r = J(n);
131
- return x.find((e) => e.id === r) ?? Q(r) ?? x[0];
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 gn() {
134
- return [...x, ...E.flatMap((n) => n.options())];
211
+ function pn() {
212
+ return [...w.filter(tn), ...v.flatMap((n) => n.options())];
135
213
  }
136
- function Yn(n) {
137
- const r = J(n);
138
- return x.some((e) => e.id === r) || Q(r) !== null;
214
+ function tr(n) {
215
+ const r = rn(n);
216
+ return S(r) !== void 0 || en(r) !== null;
139
217
  }
140
- const w = 4.5, mn = 3;
141
- function yn(n) {
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 bn({ r: n, g: r, b: e }) {
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 D(n) {
154
- const r = yn(n);
231
+ function H(n) {
232
+ const r = xn(n);
155
233
  if (!r)
156
- throw new z(
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 _(n) {
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 T(n) {
166
- const { r, g: e, b: t } = D(n);
167
- return 0.2126 * _(r) + 0.7152 * _(e) + 0.0722 * _(t);
168
- }
169
- function y(n, r) {
170
- const e = T(n), t = T(r), [o, c] = e > t ? [e, t] : [t, e];
171
- return (o + 0.05) / (c + 0.05);
172
- }
173
- function hn(n, r, e) {
174
- const t = D(n), o = D(r), c = Math.max(0, Math.min(1, e));
175
- return bn({
176
- r: t.r + (o.r - t.r) * (1 - c),
177
- g: t.g + (o.g - t.g) * (1 - c),
178
- b: t.b + (o.b - t.b) * (1 - c)
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 Fn(n) {
185
- const r = T(n);
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 L = (n) => {
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
- }, xn = (n) => (n <= 31308e-7 ? 12.92 * n : 1.055 * Math.pow(n, 0.4166666666666667) - 0.055) * 255;
192
- function kn(n) {
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 z(
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 pn(n) {
205
- const { r, g: e, b: t } = kn(n), o = L(r), c = L(e), s = L(t), u = Math.cbrt(0.4122214708 * o + 0.5363325363 * c + 0.0514459929 * s), i = Math.cbrt(0.2119034982 * o + 0.6806995451 * c + 0.1073969566 * s), d = Math.cbrt(0.0883024619 * o + 0.2817188376 * c + 0.6299787005 * s), l = 0.2104542553 * u + 0.793617785 * i - 0.0040720468 * d, m = 1.9779984951 * u - 2.428592205 * i + 0.4505937099 * d, f = 0.0259040371 * u + 0.7827717662 * i - 0.808675766 * d, g = Math.atan2(f, m) * 180 / Math.PI;
206
- return { l, c: Math.hypot(m, f), h: g < 0 ? g + 360 : g };
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 O({ l: n, c: r, h: e }) {
209
- const t = e * Math.PI / 180, o = r * Math.cos(t), c = r * Math.sin(t), s = (n + 0.3963377774 * o + 0.2158037573 * c) ** 3, u = (n - 0.1055613458 * o - 0.0638541728 * c) ** 3, i = (n - 0.0894841775 * o - 1.291485548 * c) ** 3;
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 * s - 3.3077115913 * u + 0.2309699292 * i,
212
- g: -1.2684380046 * s + 2.6097574011 * u - 0.3413193965 * i,
213
- b: -0.0041960863 * s - 0.7034186147 * u + 1.707614701 * i
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 F = 1e-4, W = ({ r: n, g: r, b: e }) => n >= -F && n <= 1 + F && r >= -F && r <= 1 + F && e >= -F && e <= 1 + F;
217
- function En({ l: n, c: r, h: e }) {
218
- if (W(O({ l: n, c: r, h: e }))) return r;
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 c = 0; c < 24; c++) {
221
- const s = (t + o) / 2;
222
- W(O({ l: n, c: s, h: e })) ? t = s : o = s;
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 N(n) {
227
- const r = En(n), e = O({ ...n, c: r }), t = (o) => Math.max(0, Math.min(255, Math.round(xn(o)))).toString(16).padStart(2, "0");
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 G(n, r, e, t) {
231
- const o = pn(n), c = t === "lighter" ? 1 : 0, s = N({ ...o, l: c });
232
- if (!k(y(s, r), e)) return s;
233
- let u = o.l, i = c;
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(y(N({ ...o, l }), r), e) ? i = l : u = l;
314
+ k(m(O({ ...o, l }), r), e) ? i = l : u = l;
237
315
  }
238
- return N({ ...o, l: i });
316
+ return O({ ...o, l: i });
239
317
  }
240
- function K(n, r, e) {
241
- if (k(y(n, r), e)) return n;
242
- const t = T(n) < T(r), o = G(
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(y(o, r), e)) return o;
249
- const c = G(
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 y(c, r) > y(o, r) ? c : o;
333
+ return m(s, r) > m(o, r) ? s : o;
256
334
  }
257
- function Tn(n, r, e) {
335
+ function wn(n, r, e) {
258
336
  let t = n;
259
337
  for (let o = 0; o < 8; o++) {
260
- let c = !1;
261
- for (const s of r) {
262
- const u = K(t, s, e);
263
- u !== t && (t = u, c = !0);
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 (!c) break;
343
+ if (!s) break;
266
344
  }
267
345
  return t;
268
346
  }
269
- function An(n, r, e) {
347
+ function Dn(n, r, e) {
270
348
  let t = r[0] ?? "#ffffff", o = -1;
271
- for (const c of r) {
272
- const s = y(c, n);
273
- if (k(s, e)) return c;
274
- s > o && (o = s, t = c);
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 vn = "#2A2C31", Sn = "#1C1E23", Z = 0.25, zn = Z;
279
- function Cn(n) {
280
- return K(n.inputBorder, n.input, mn);
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 wn(n, r, e) {
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(vn, Sn), t.flatMap((o) => [
366
+ return e === "dark" && t.push(In, Mn), t.flatMap((o) => [
289
367
  o,
290
- hn(n, o, Z)
368
+ An(n, o, on)
291
369
  ]);
292
370
  }
293
- function Bn(n, r, e) {
294
- return Tn(
371
+ function Nn(n, r, e) {
372
+ return wn(
295
373
  n,
296
- wn(n, r, e),
297
- w
374
+ Ln(n, r, e),
375
+ D
298
376
  );
299
377
  }
300
- const Jn = [
378
+ const sr = [
301
379
  "error",
302
380
  "brand",
303
381
  "success",
304
382
  "warning",
305
383
  "info"
306
- ], In = 60;
307
- function A(n) {
308
- return k(y("#ffffff", n), w) || Fn(n) >= In ? n : K(n, "#ffffff", w);
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 Mn(n, r) {
311
- return An(
388
+ function Hn(n, r) {
389
+ return Dn(
312
390
  n,
313
391
  ["#ffffff", r.surfaceAlt, "#000000"],
314
- w
392
+ D
315
393
  );
316
394
  }
317
- const Qn = ["brand", "error", "success", "warning"], _n = "#D76CB7", Ln = "data-colorblind-safe", H = {
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
- }, q = {
327
- added: H.success,
328
- deleted: H.error
404
+ }, j = {
405
+ added: P.success,
406
+ deleted: P.error
329
407
  };
330
- function Nn(n) {
331
- return { ...n, ...H };
408
+ function Rn(n) {
409
+ return { ...n, ...P };
332
410
  }
333
- function Zn() {
334
- return typeof document > "u" ? !1 : document.documentElement.hasAttribute(Ln);
411
+ function ir() {
412
+ return typeof document > "u" ? !1 : document.documentElement.hasAttribute(Pn);
335
413
  }
336
- function Dn(n, r, e) {
337
- const t = (d) => Bn(d, n, r), o = A(n.brand), c = A(n.error), s = A(n.success), u = A(n.warning), i = (d) => Mn(d, n);
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": Cn(n),
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(_n),
443
+ "--color-unique-text": t(Kn),
366
444
  "--color-brand-surface": o,
367
- "--color-error-surface": c,
368
- "--color-success-surface": s,
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(c),
372
- "--color-on-success": i(s),
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 ? q.added : "",
376
- "--color-diff-deleted": e ? q.deleted : "",
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 U = "data-colorblind-safe";
386
- function nn(n, r = !1) {
387
- return M(n === "system" ? r ? "light" : C : n === "dark" ? C : n);
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 On(n, r = {}) {
467
+ function Vn(n, r = {}) {
390
468
  var u, i;
391
- const e = typeof n == "string" ? nn(n) : n, t = r.document ?? (typeof document < "u" ? document : void 0);
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, c = r.colorVisionSafe ?? !1;
394
- c ? o.setAttribute(U, "") : o.removeAttribute(U);
395
- const s = c ? Nn(e.palette) : e.palette;
396
- for (const [d, l] of Object.entries(Dn(s, e.type, c)))
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 nr() {
401
- return gn();
478
+ function ar() {
479
+ return pn();
402
480
  }
403
- const Hn = "vokril-ui-theme", Pn = "(prefers-color-scheme: light)";
404
- function Kn() {
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 rn = fn(), rr = (n) => {
412
- var R, $;
413
- const r = n.storageKey === void 0 ? Hn : n.storageKey, e = n.storage === void 0 ? Kn() : n.storage, t = () => {
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 = ((R = n.document) == null ? void 0 : R.defaultView) ?? (typeof window > "u" ? void 0 : window), c = ($ = o == null ? void 0 : o.matchMedia) == null ? void 0 : $.call(o, Pn), [s, u] = I(t() ?? n.defaultTheme ?? "dark"), [i, d] = I((c == null ? void 0 : c.matches) ?? !1), [l, m] = I(n.colorVisionSafe ?? !1);
421
- if (c) {
422
- const p = (on) => d(on.matches);
423
- c.addEventListener("change", p), an(() => c.removeEventListener("change", p));
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 = V(() => nn(s(), i())), g = V(() => f().type), b = (p) => {
426
- if (u(p), !(!e || !r))
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, p);
506
+ e.setItem(r, x);
429
507
  } catch {
430
508
  }
431
- }, B = () => b(g() === "dark" ? "light" : "dark");
432
- un(() => {
433
- On(f(), {
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 tn = {
439
- theme: s,
516
+ const un = {
517
+ theme: c,
440
518
  resolvedTheme: g,
441
519
  themeId: () => f().id,
442
520
  setTheme: b,
443
- toggleTheme: B,
521
+ toggleTheme: M,
444
522
  colorVisionSafe: l,
445
- setColorVisionSafe: m
523
+ setColorVisionSafe: y
446
524
  };
447
- return cn(rn.Provider, {
448
- value: tn,
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 j = !1;
455
- function er() {
456
- const n = dn(rn);
457
- return n || (sn && !j && (j = !0, console.warn("@vokril/ui-solid: useTheme() was called outside <ThemeProvider>; it reports Vokril Dark and ignores setTheme.")), {
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: () => C,
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 Y;
471
- const X = ((Y = x.find((n) => n.id === C)) == null ? void 0 : Y.palette) ?? x[0].palette;
472
- function Rn(n) {
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 P(n) {
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 S({ r: n, g: r, b: e }) {
484
- const t = (o) => Rn(o).toString(16).padStart(2, "0");
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 = P(n);
489
- return e ? S(e) : r;
566
+ const e = R(n);
567
+ return e ? B(e) : r;
490
568
  }
491
- function h(n, r, e) {
492
- const t = P(n), o = P(r);
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 S(o);
495
- if (!o) return S(t);
496
- const c = Math.max(0, Math.min(1, e));
497
- return S({
498
- r: t.r + (o.r - t.r) * c,
499
- g: t.g + (o.g - t.g) * c,
500
- b: t.b + (o.b - t.b) * c
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 $n = "#ffffff", Vn = "#000000";
504
- function en(n, r) {
505
- return h(n, $n, r);
581
+ const jn = "#ffffff", Xn = "#000000";
582
+ function an(n, r) {
583
+ return F(n, jn, r);
506
584
  }
507
- function Wn(n, r) {
508
- return h(n, Vn, r);
585
+ function Yn(n, r) {
586
+ return F(n, Xn, r);
509
587
  }
510
- function Gn(n, r, e) {
511
- return r === "dark" ? en(n, e) : Wn(n, e);
588
+ function zn(n, r, e) {
589
+ return r === "dark" ? an(n, e) : Yn(n, e);
512
590
  }
513
- function v(n, r) {
591
+ function C(n, r) {
514
592
  return `${a(n)}${r}`;
515
593
  }
516
- function tr() {
517
- if (typeof document > "u") return X;
518
- const n = getComputedStyle(document.documentElement), r = (t, o) => n.getPropertyValue(t).trim() || o, e = X;
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 or() {
620
+ function lr() {
543
621
  return typeof document > "u" ? "dark" : document.body.classList.contains("light") ? "light" : "dark";
544
622
  }
545
- function cr() {
623
+ function gr() {
546
624
  return typeof document > "u" ? "" : document.documentElement.getAttribute("data-app-theme") ?? "";
547
625
  }
548
- function sr(n, r) {
549
- const e = a(n.syntaxKeyword), t = a(n.syntaxString), o = a(n.syntaxFunction), c = a(n.syntaxComment), s = a(n.syntaxNumber), u = a(n.syntaxType), i = a(n.content), d = a(n.brand), l = a(n.error), m = [
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: c.slice(1), fontStyle: "italic" },
629
+ { token: "comment", foreground: s.slice(1), fontStyle: "italic" },
552
630
  {
553
631
  token: "comment.quote",
554
- foreground: c.slice(1),
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: s.slice(1) },
565
- { token: "number.float", foreground: s.slice(1) },
566
- { token: "number.hex", foreground: s.slice(1) },
567
- { token: "constant", foreground: s.slice(1) },
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), B = {
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": h(g, d, 0.32),
589
- "editor.inactiveSelectionBackground": h(g, d, 0.18),
590
- "editor.lineHighlightBackground": h(f, g, 0.55),
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": v(d, "40"),
677
+ "inputOption.activeBackground": C(d, "40"),
600
678
  "inputOption.activeBorder": d,
601
679
  "inputOption.activeForeground": i,
602
680
  focusBorder: d,
603
- "editor.findMatchBackground": v(a(n.warning), "80"),
604
- "editor.findMatchHighlightBackground": v(a(n.warning), "40"),
605
- "editor.findRangeHighlightBackground": v(b, "60")
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: m,
611
- colors: B
688
+ rules: y,
689
+ colors: M
612
690
  };
613
691
  }
614
- function ir(n, r) {
615
- const e = a(n.surface), t = a(n.surfaceElevated), o = a(n.content), c = a(n.contentSecondary), s = a(n.brand), u = a(n.error), i = a(n.success), d = a(n.warning), l = a(n.info), m = a(n.syntaxKeyword), f = (b) => Gn(b, r, 0.22), g = {
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: s,
621
- magenta: m,
698
+ blue: c,
699
+ magenta: y,
622
700
  cyan: l,
623
- white: c,
624
- brightBlack: h(t, o, 0.4),
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(s),
629
- brightMagenta: f(m),
706
+ brightBlue: f(c),
707
+ brightMagenta: f(y),
630
708
  brightCyan: f(l),
631
- brightWhite: r === "dark" ? en(o, 0.25) : o
709
+ brightWhite: r === "dark" ? an(o, 0.25) : o
632
710
  };
633
711
  return {
634
712
  background: e,
635
713
  foreground: o,
636
- cursor: s,
637
- selectionBackground: h(t, s, 0.2),
714
+ cursor: c,
715
+ selectionBackground: F(t, c, 0.2),
638
716
  ...g
639
717
  };
640
718
  }
641
719
  export {
642
- C as D,
643
- Qn as I,
644
- ln as L,
645
- zn as M,
646
- q as O,
647
- Jn as T,
648
- _n as U,
649
- Sn as W,
650
- rr as a,
651
- vn as b,
652
- A as c,
653
- Cn as d,
654
- Mn as e,
655
- Bn as f,
656
- On as g,
657
- Dn as h,
658
- sr as i,
659
- ir as j,
660
- M as k,
661
- gn as l,
662
- nr as m,
663
- Zn as n,
664
- Yn as o,
665
- cr as p,
666
- or as q,
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
- Xn as s,
669
- nn as t,
670
- wn as u,
671
- x as v,
672
- Nn as w,
673
- er as x
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
  };