@bluepic/embed 0.4.0-next.157 → 0.4.0-next.159
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/bluepic-embed.iife.js +241 -203
- package/dist/bluepic-embed.umd.js +241 -203
- package/dist/c-B4BAHWS4.cjs +1 -0
- package/dist/{c-Bz1-FJiA.js → c-C0DTNf68.js} +122 -63
- package/dist/components/BxDatePickerPopover.vue.d.ts +1 -1
- package/dist/components/BxInput.vue.d.ts +1 -1
- package/dist/components/BxPopover.vue.d.ts +7 -0
- package/dist/components/BxTag.vue.d.ts +1 -1
- package/dist/components/PopoverElement.vue.d.ts +7 -0
- package/dist/components/TemplateEditor/BxTemplateEditor.vue.d.ts +64 -80
- package/dist/components/TemplateEditor/TemplateView.vue.d.ts +16 -20
- package/dist/components/directives/usePopup.d.ts +5 -0
- package/dist/cpp-BfO2fOQK.cjs +1 -0
- package/dist/{cpp-Cx0NomaW.js → cpp-DxGBPWa5.js} +65 -48
- package/dist/{css-BCTOmdxR.js → css-Cx1gP-zj.js} +17 -6
- package/dist/css-DTF39MN3.cjs +1 -0
- package/dist/embed/embed.d.ts +2314 -5218
- package/dist/{go-BpetKc7b.cjs → go-By8nj0Vi.cjs} +1 -1
- package/dist/{go-CkZ9_bn0.js → go-C8VcBUsu.js} +7 -2
- package/dist/{java-BicX26Pg.js → java-BoRJOXvw.js} +48 -39
- package/dist/java-DFXAwvvK.cjs +1 -0
- package/dist/javascript-C2jY0XE6.cjs +1 -0
- package/dist/{javascript-DII1YQGr.js → javascript-CgRUYx2b.js} +4 -2
- package/dist/json-C4rahuoJ.cjs +1 -0
- package/dist/{json-C_6Prymp.js → json-DYK-YbD3.js} +15 -9
- package/dist/main.cjs +180 -142
- package/dist/main.mjs +27239 -24738
- package/dist/markdown-BmL9j9cU.cjs +1 -0
- package/dist/{markdown-ga2-2-T7.js → markdown-D19noYwn.js} +9 -10
- package/dist/{python-CymlFLB0.js → python-BBUuE3AY.js} +20 -15
- package/dist/python-Clt6L10q.cjs +1 -0
- package/dist/{rust-BocnJ3Ns.js → rust-DY-oA2gr.js} +40 -26
- package/dist/rust-_vvcEGSJ.cjs +1 -0
- package/dist/{scss-CknrYxoA.js → scss-BWo_aR1L.js} +36 -25
- package/dist/scss-ex7iHSUb.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +289 -282
- package/dist/{typescript-SNUkGeOU.js → typescript-BHqLHF13.js} +4 -2
- package/dist/typescript-DYRnLHqF.cjs +1 -0
- package/dist/unzipit.module-4zGfAuq6.cjs +1 -0
- package/dist/unzipit.module-qN5XWVVT.js +649 -0
- package/dist/util/scrollPassthrough.d.ts +9 -0
- package/dist/{xml-B7THKYqr.js → xml-Bse49fPV.js} +9 -16
- package/dist/{xml-CII3FKiI.cjs → xml-CVmug_x4.cjs} +1 -1
- package/package.json +2 -2
- package/dist/c-C_Sx7N-F.cjs +0 -1
- package/dist/cpp-DaPzgJ_t.cjs +0 -1
- package/dist/css-UgpohNaw.cjs +0 -1
- package/dist/java-BIk0G-rH.cjs +0 -1
- package/dist/javascript-C_6NC1K7.cjs +0 -1
- package/dist/json-DEcHyC5F.cjs +0 -1
- package/dist/markdown-BbPYOuo6.cjs +0 -1
- package/dist/python-B6_9AjJr.cjs +0 -1
- package/dist/rust-DKnYCg2f.cjs +0 -1
- package/dist/scss-DpqvoUEp.cjs +0 -1
- package/dist/typescript-Cjpf3bLL.cjs +0 -1
- package/dist/unzipit.module-B5yfSJfb.js +0 -556
- package/dist/unzipit.module-TGsYEkT7.cjs +0 -1
package/dist/theme.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const dr = [
|
|
2
2
|
/* mode */
|
|
3
3
|
"color-scheme",
|
|
4
4
|
// 'dark' | 'light' — feeds the CSS `color-scheme` property
|
|
@@ -140,7 +140,7 @@ const sr = [
|
|
|
140
140
|
"on-canvas-control",
|
|
141
141
|
/* disabled */
|
|
142
142
|
"disabled-opacity"
|
|
143
|
-
],
|
|
143
|
+
], br = "--bx-", Lo = [
|
|
144
144
|
{ label: "Surfaces", tokens: ["surface", "surface-1", "surface-2", "surface-3", "surface-inverse", "scrim"] },
|
|
145
145
|
{ label: "Text", tokens: ["text", "text-muted", "text-faint", "text-inverse"] },
|
|
146
146
|
{ label: "Borders", tokens: ["border", "border-strong", "divider"] },
|
|
@@ -152,11 +152,11 @@ const sr = [
|
|
|
152
152
|
{ label: "Info", tokens: ["info", "on-info", "info-text", "info-soft", "info-border"] },
|
|
153
153
|
{ label: "Shape & type", tokens: ["radius-sm", "radius-md", "radius-lg", "radius-full", "font-family", "font-family-heading", "font-size"] },
|
|
154
154
|
{ label: "Canvas", tokens: ["canvas", "canvas-control", "on-canvas-control"] }
|
|
155
|
-
],
|
|
155
|
+
], io = {
|
|
156
156
|
// Same surfaces as the historical presets so existing campaigns keep their background.
|
|
157
157
|
dark: { surface: "#27262e", primary: "#4472c7" },
|
|
158
158
|
light: { surface: "#f2f2f2", primary: "#124bba" }
|
|
159
|
-
},
|
|
159
|
+
}, Ho = [
|
|
160
160
|
{ key: "light", label: "Light", description: "Neutral light surfaces, Bluepic blue.", input: { version: 2, preset: "light" } },
|
|
161
161
|
{ key: "dark", label: "Dark", description: "Neutral dark surfaces, Bluepic blue.", input: { version: 2, preset: "dark" } },
|
|
162
162
|
{ key: "midnight", label: "Midnight", description: "Near-black with cool, slightly tinted surfaces.", input: { version: 2, surface: "#0f1117", primary: "#7da8f7", tint: 0.35 } },
|
|
@@ -168,12 +168,12 @@ const sr = [
|
|
|
168
168
|
{ key: "graphite", label: "Graphite", description: "Pure black, high contrast, sharp corners — signage and dark brands.", input: { version: 2, surface: "#000000", primary: "#ffffff", radius: "none", contrast: "high" } },
|
|
169
169
|
{ key: "plum", label: "Plum", description: "Deep aubergine surfaces with a warm coral accent.", input: { version: 2, surface: "#1f1423", primary: "#ff7a59", tint: 0.45, radius: "lg" } },
|
|
170
170
|
{ key: "linen", label: "Linen", description: "Soft white linen with a muted navy accent, rounded.", input: { version: 2, surface: "#f7f7f4", primary: "#2f3e5c", tint: 0.15, radius: "lg" } }
|
|
171
|
-
],
|
|
171
|
+
], lo = {
|
|
172
172
|
success: "#28a552",
|
|
173
173
|
warning: "#d9a400",
|
|
174
174
|
error: "#dc2f2f",
|
|
175
175
|
info: "#3b82f6"
|
|
176
|
-
}, I = Object.freeze({ r: 255, g: 255, b: 255, a: 1 }), Z = Object.freeze({ r: 0, g: 0, b: 0, a: 1 }),
|
|
176
|
+
}, I = Object.freeze({ r: 255, g: 255, b: 255, a: 1 }), Z = Object.freeze({ r: 0, g: 0, b: 0, a: 1 }), Pr = [I, Object.freeze({ r: 17, g: 17, b: 17, a: 1 })], pr = (o, e, t) => o < e ? e : o > t ? t : o, w = (o) => pr(o, 0, 1), y = (o, e = 0) => Number.isFinite(o) ? o : e, k = (o, e, t, a = 1) => ({ r: o, g: e, b: t, a }), B = (o) => Math.round(pr(y(o), 0, 255)), ur = (o) => B(o).toString(16).padStart(2, "0"), uo = {
|
|
177
177
|
aliceblue: 15792383,
|
|
178
178
|
antiquewhite: 16444375,
|
|
179
179
|
aqua: 65535,
|
|
@@ -322,29 +322,29 @@ const sr = [
|
|
|
322
322
|
whitesmoke: 16119285,
|
|
323
323
|
yellow: 16776960,
|
|
324
324
|
yellowgreen: 10145074
|
|
325
|
-
},
|
|
326
|
-
function
|
|
325
|
+
}, Br = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/, bo = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/, go = /^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;
|
|
326
|
+
function xr(o) {
|
|
327
327
|
if (o === "none") return { value: 0, percent: !1 };
|
|
328
328
|
const e = o.endsWith("%"), t = e ? o.slice(0, -1) : o;
|
|
329
|
-
if (!
|
|
329
|
+
if (!Br.test(t)) return null;
|
|
330
330
|
const a = Number(t);
|
|
331
331
|
return Number.isFinite(a) ? { value: a, percent: e } : null;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const e =
|
|
335
|
-
return e ?
|
|
333
|
+
function hr(o) {
|
|
334
|
+
const e = xr(o);
|
|
335
|
+
return e ? pr(e.percent ? e.value * 255 / 100 : e.value, 0, 255) : null;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
const e =
|
|
337
|
+
function fo(o) {
|
|
338
|
+
const e = xr(o);
|
|
339
339
|
return e ? w(e.percent ? e.value / 100 : e.value) : null;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const e =
|
|
341
|
+
function jr(o) {
|
|
342
|
+
const e = xr(o);
|
|
343
343
|
return e ? w(e.value / 100) : null;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function po(o) {
|
|
346
346
|
if (o === "none") return 0;
|
|
347
|
-
const e =
|
|
347
|
+
const e = bo.exec(o);
|
|
348
348
|
if (!e) return null;
|
|
349
349
|
let t = Number(e[1]);
|
|
350
350
|
if (!Number.isFinite(t)) return null;
|
|
@@ -361,7 +361,7 @@ function uo(o) {
|
|
|
361
361
|
}
|
|
362
362
|
return t %= 360, t < 0 && (t += 360), t;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ho(o) {
|
|
365
365
|
if (o.includes(",")) {
|
|
366
366
|
if (o.includes("/")) return null;
|
|
367
367
|
const n = o.split(",").map((c) => c.trim());
|
|
@@ -374,7 +374,7 @@ function bo(o) {
|
|
|
374
374
|
let a;
|
|
375
375
|
return e.length === 2 && (a = e[1].trim(), a === "" || /\s/.test(a)) ? null : { ch: [t[0], t[1], t[2]], alpha: a };
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function mo(o, e, t) {
|
|
378
378
|
const a = (n) => {
|
|
379
379
|
const c = (n + o / 30) % 12, s = e * Math.min(t, 1 - t);
|
|
380
380
|
return t - s * Math.max(-1, Math.min(c - 3, 9 - c, 1));
|
|
@@ -385,46 +385,46 @@ function _(o) {
|
|
|
385
385
|
if (typeof o != "string") return null;
|
|
386
386
|
const e = o.trim().toLowerCase();
|
|
387
387
|
if (!e) return null;
|
|
388
|
-
if (e === "transparent") return
|
|
389
|
-
const t =
|
|
390
|
-
if (t !== void 0) return
|
|
388
|
+
if (e === "transparent") return k(0, 0, 0, 0);
|
|
389
|
+
const t = uo[e];
|
|
390
|
+
if (t !== void 0) return k(t >> 16, t >> 8 & 255, t & 255, 1);
|
|
391
391
|
if (e[0] === "#") {
|
|
392
392
|
const n = e.slice(1);
|
|
393
393
|
if (!/^[0-9a-f]+$/.test(n)) return null;
|
|
394
394
|
const c = (i) => parseInt(n[i], 16), s = (i) => parseInt(n.slice(i, i + 2), 16);
|
|
395
395
|
switch (n.length) {
|
|
396
396
|
case 3:
|
|
397
|
-
return
|
|
397
|
+
return k(c(0) * 17, c(1) * 17, c(2) * 17, 1);
|
|
398
398
|
case 4:
|
|
399
|
-
return
|
|
399
|
+
return k(c(0) * 17, c(1) * 17, c(2) * 17, c(3) * 17 / 255);
|
|
400
400
|
case 6:
|
|
401
|
-
return
|
|
401
|
+
return k(s(0), s(2), s(4), 1);
|
|
402
402
|
case 8:
|
|
403
|
-
return
|
|
403
|
+
return k(s(0), s(2), s(4), s(6) / 255);
|
|
404
404
|
default:
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
const a =
|
|
408
|
+
const a = go.exec(e);
|
|
409
409
|
if (a) {
|
|
410
|
-
const n =
|
|
410
|
+
const n = ho(a[2]);
|
|
411
411
|
if (!n) return null;
|
|
412
|
-
const c = n.alpha === void 0 ? 1 :
|
|
412
|
+
const c = n.alpha === void 0 ? 1 : fo(n.alpha);
|
|
413
413
|
if (c === null) return null;
|
|
414
414
|
if (a[1] === "rgb" || a[1] === "rgba") {
|
|
415
|
-
const
|
|
416
|
-
return
|
|
415
|
+
const x = hr(n.ch[0]), P = hr(n.ch[1]), p = hr(n.ch[2]);
|
|
416
|
+
return x === null || P === null || p === null ? null : k(x, P, p, c);
|
|
417
417
|
}
|
|
418
|
-
const s =
|
|
418
|
+
const s = po(n.ch[0]), i = jr(n.ch[1]), d = jr(n.ch[2]);
|
|
419
419
|
if (s === null || i === null || d === null) return null;
|
|
420
|
-
const [
|
|
421
|
-
return
|
|
420
|
+
const [g, C, b] = mo(s, i, d);
|
|
421
|
+
return k(g, C, b, c);
|
|
422
422
|
}
|
|
423
423
|
if (e.includes(",")) {
|
|
424
424
|
const n = e.split(",").map((d) => d.trim());
|
|
425
|
-
if (n.length !== 3 || !n.every((d) =>
|
|
426
|
-
const [c, s, i] = n.map((d) =>
|
|
427
|
-
return
|
|
425
|
+
if (n.length !== 3 || !n.every((d) => Br.test(d))) return null;
|
|
426
|
+
const [c, s, i] = n.map((d) => pr(Number(d), 0, 255));
|
|
427
|
+
return k(c, s, i, 1);
|
|
428
428
|
}
|
|
429
429
|
return null;
|
|
430
430
|
}
|
|
@@ -432,11 +432,11 @@ function q(o) {
|
|
|
432
432
|
const e = w(o);
|
|
433
433
|
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function mr(o) {
|
|
436
436
|
const e = w(o);
|
|
437
437
|
return e <= 31308e-7 ? e * 12.92 : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function vo(o, e, t) {
|
|
440
440
|
const a = 0.4122214708 * o + 0.5363325363 * e + 0.0514459929 * t, n = 0.2119034982 * o + 0.6806995451 * e + 0.1073969566 * t, c = 0.0883024619 * o + 0.2817188376 * e + 0.6299787005 * t, s = Math.cbrt(a), i = Math.cbrt(n), d = Math.cbrt(c);
|
|
441
441
|
return {
|
|
442
442
|
L: 0.2104542553 * s + 0.793617785 * i - 0.0040720468 * d,
|
|
@@ -444,7 +444,7 @@ function fo(o, e, t) {
|
|
|
444
444
|
b: 0.0259040371 * s + 0.7827717662 * i - 0.808675766 * d
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function vr(o, e, t) {
|
|
448
448
|
const a = o + 0.3963377774 * e + 0.2158037573 * t, n = o - 0.1055613458 * e - 0.0638541728 * t, c = o - 0.0894841775 * e - 1.291485548 * t, s = a * a * a, i = n * n * n, d = c * c * c;
|
|
449
449
|
return [
|
|
450
450
|
4.0767416621 * s - 3.3077115913 * i + 0.2309699292 * d,
|
|
@@ -452,152 +452,152 @@ function pr(o, e, t) {
|
|
|
452
452
|
-0.0041960863 * s - 0.7034186147 * i + 1.707614701 * d
|
|
453
453
|
];
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return
|
|
455
|
+
function gr(o) {
|
|
456
|
+
return vo(q(o.r / 255), q(o.g / 255), q(o.b / 255));
|
|
457
457
|
}
|
|
458
|
-
const
|
|
459
|
-
function
|
|
458
|
+
const yo = 1e-6;
|
|
459
|
+
function Fr(o) {
|
|
460
460
|
const e = Math.hypot(o.a, o.b);
|
|
461
|
-
let t = e <
|
|
461
|
+
let t = e < yo ? 0 : Math.atan2(o.b, o.a) * 180 / Math.PI;
|
|
462
462
|
return t < 0 && (t += 360), t >= 360 && (t -= 360), { l: o.L, c: e, h: t };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function yr(o, e, t) {
|
|
465
465
|
const a = t * Math.PI / 180;
|
|
466
466
|
return { L: o, a: e * Math.cos(a), b: e * Math.sin(a) };
|
|
467
467
|
}
|
|
468
|
-
const
|
|
469
|
-
function
|
|
470
|
-
const n = w(
|
|
471
|
-
let c = Math.max(0,
|
|
472
|
-
const s =
|
|
473
|
-
let i =
|
|
474
|
-
if (!
|
|
475
|
-
let
|
|
476
|
-
for (let
|
|
477
|
-
const
|
|
478
|
-
|
|
468
|
+
const z = 1e-6, Rr = (o) => o[0] >= -z && o[0] <= 1 + z && o[1] >= -z && o[1] <= 1 + z && o[2] >= -z && o[2] <= 1 + z;
|
|
469
|
+
function nr(o, e, t, a) {
|
|
470
|
+
const n = w(y(o));
|
|
471
|
+
let c = Math.max(0, y(e));
|
|
472
|
+
const s = y(t);
|
|
473
|
+
let i = yr(n, c, s), d = vr(i.L, i.a, i.b);
|
|
474
|
+
if (!Rr(d)) {
|
|
475
|
+
let g = 0, C = c;
|
|
476
|
+
for (let b = 0; b < 24; b++) {
|
|
477
|
+
const x = (g + C) / 2, P = yr(n, x, s);
|
|
478
|
+
Rr(vr(P.L, P.a, P.b)) ? g = x : C = x;
|
|
479
479
|
}
|
|
480
|
-
c =
|
|
480
|
+
c = g, i = yr(n, c, s), d = vr(i.L, i.a, i.b);
|
|
481
481
|
}
|
|
482
|
-
return
|
|
482
|
+
return k(mr(d[0]) * 255, mr(d[1]) * 255, mr(d[2]) * 255, w(y(a, 1)));
|
|
483
483
|
}
|
|
484
484
|
function J(o) {
|
|
485
|
-
const e =
|
|
486
|
-
return { l: e.l, c: e.c, h: e.h, a: w(
|
|
485
|
+
const e = Fr(gr(o));
|
|
486
|
+
return { l: e.l, c: e.c, h: e.h, a: w(y(o.a, 1)) };
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
488
|
+
function fr(o) {
|
|
489
|
+
return nr(o.l, o.c, o.h, o.a);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
const e = w(
|
|
493
|
-
return e < 1 ? `${t}${
|
|
491
|
+
function xo(o) {
|
|
492
|
+
const e = w(y(o.a, 1)), t = `#${ur(o.r)}${ur(o.g)}${ur(o.b)}`;
|
|
493
|
+
return e < 1 ? `${t}${ur(e * 255)}` : t;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
const e = w(
|
|
495
|
+
function kr(o) {
|
|
496
|
+
const e = w(y(o.a, 1)), t = B(o.r), a = B(o.g), n = B(o.b);
|
|
497
497
|
return e >= 1 ? `rgb(${t}, ${a}, ${n})` : `rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
return `${
|
|
499
|
+
function Wr(o) {
|
|
500
|
+
return `${B(o.r)}, ${B(o.g)}, ${B(o.b)}`;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
return 0.2126 * q(
|
|
502
|
+
function or(o) {
|
|
503
|
+
return 0.2126 * q(y(o.r) / 255) + 0.7152 * q(y(o.g) / 255) + 0.0722 * q(y(o.b) / 255);
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
const t = e.a >= 1 ? e :
|
|
505
|
+
function m(o, e) {
|
|
506
|
+
const t = e.a >= 1 ? e : k(e.r, e.g, e.b, 1), a = o.a < 1 ? er(o, t) : o, n = or(a), c = or(t), s = Math.max(n, c), i = Math.min(n, c);
|
|
507
507
|
return (s + 0.05) / (i + 0.05);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
const t = w(
|
|
511
|
-
if (n <= 0) return
|
|
509
|
+
function er(o, e) {
|
|
510
|
+
const t = w(y(o.a, 1)), a = w(y(e.a, 1)), n = t + a * (1 - t);
|
|
511
|
+
if (n <= 0) return k(0, 0, 0, 0);
|
|
512
512
|
const c = a * (1 - t) / n, s = t / n;
|
|
513
|
-
return
|
|
513
|
+
return k(o.r * s + e.r * c, o.g * s + e.g * c, o.b * s + e.b * c, n);
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const a = w(
|
|
517
|
-
if (a <= 0) return
|
|
518
|
-
if (a >= 1) return
|
|
519
|
-
const n = w(
|
|
520
|
-
return
|
|
515
|
+
function tr(o, e, t) {
|
|
516
|
+
const a = w(y(t));
|
|
517
|
+
if (a <= 0) return k(o.r, o.g, o.b, w(y(o.a, 1)));
|
|
518
|
+
if (a >= 1) return k(e.r, e.g, e.b, w(y(e.a, 1)));
|
|
519
|
+
const n = w(y(o.a, 1)), c = w(y(e.a, 1)), s = gr(o), i = gr(e), d = n + (c - n) * a, g = d > 0 ? n * (1 - a) / d : 1 - a, C = d > 0 ? c * a / d : a, b = { L: s.L * g + i.L * C, a: s.a * g + i.a * C, b: s.b * g + i.b * C }, x = Fr(b);
|
|
520
|
+
return nr(x.l, x.c, x.h, d);
|
|
521
521
|
}
|
|
522
522
|
function D(o, e) {
|
|
523
|
-
return
|
|
523
|
+
return k(o.r, o.g, o.b, w(y(e, 1)));
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
return
|
|
525
|
+
function ko(o) {
|
|
526
|
+
return gr(o).L;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function E(o, e) {
|
|
529
529
|
const t = J(o);
|
|
530
|
-
return
|
|
530
|
+
return nr(w(t.l + y(e)), t.c, t.h, t.a);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function wo(o, e) {
|
|
533
533
|
const t = J(o);
|
|
534
|
-
return
|
|
534
|
+
return nr(w(y(e)), t.c, t.h, t.a);
|
|
535
535
|
}
|
|
536
|
-
const
|
|
537
|
-
function
|
|
538
|
-
const n =
|
|
539
|
-
if (
|
|
540
|
-
const c = J(o), s =
|
|
541
|
-
const A = f === "lighter" ? 1 : 0, j = (
|
|
542
|
-
let
|
|
543
|
-
for (const
|
|
544
|
-
const
|
|
545
|
-
if ((!
|
|
546
|
-
let
|
|
547
|
-
for (let
|
|
548
|
-
const
|
|
549
|
-
Y(d(
|
|
536
|
+
const Io = [1, 0.75, 0.5, 0.25, 0], Mo = 24;
|
|
537
|
+
function R(o, e, t, a = "auto") {
|
|
538
|
+
const n = y(t, 1);
|
|
539
|
+
if (m(o, e) >= n) return o;
|
|
540
|
+
const c = J(o), s = k(e.r, e.g, e.b, 1), i = or(s), d = (f, A) => nr(f, A, c.h, c.a), g = (f) => m(f, s), C = (f) => or(f.a < 1 ? er(f, s) : f), b = (f) => k(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), x = (f) => {
|
|
541
|
+
const A = f === "lighter" ? 1 : 0, j = (L) => f === "lighter" ? C(L) >= i : C(L) <= i, H = (L) => j(L) && g(L) >= n, Y = (L) => H(L) && H(b(L));
|
|
542
|
+
let U = null;
|
|
543
|
+
for (const L of Io) {
|
|
544
|
+
const O = c.c * L, K = d(A, O), ar = g(K);
|
|
545
|
+
if ((!U || ar > U.ratio) && (U = { color: K, ratio: ar }), !Y(K)) continue;
|
|
546
|
+
let cr = c.l, V = A;
|
|
547
|
+
for (let ir = 0; ir < Mo; ir++) {
|
|
548
|
+
const F = (cr + V) / 2;
|
|
549
|
+
Y(d(F, O)) ? V = F : cr = F;
|
|
550
550
|
}
|
|
551
|
-
const
|
|
552
|
-
return { color:
|
|
551
|
+
const sr = d(V, O);
|
|
552
|
+
return { color: sr, ratio: g(sr) };
|
|
553
553
|
}
|
|
554
|
-
return
|
|
554
|
+
return U;
|
|
555
555
|
};
|
|
556
|
-
if (a === "lighter" || a === "darker") return
|
|
557
|
-
const P =
|
|
558
|
-
return
|
|
556
|
+
if (a === "lighter" || a === "darker") return x(a).color;
|
|
557
|
+
const P = g(d(1, 0)), p = g(d(0, 0));
|
|
558
|
+
return x(P >= p ? "lighter" : "darker").color;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return
|
|
560
|
+
function zr(o) {
|
|
561
|
+
return m(I, o) >= m(Z, o);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
const t = e.length ? e :
|
|
563
|
+
function Gr(o, e = Pr) {
|
|
564
|
+
const t = e.length ? e : Pr;
|
|
565
565
|
let a = t[0], n = -1;
|
|
566
566
|
for (const c of t) {
|
|
567
|
-
const s =
|
|
567
|
+
const s = m(c, o);
|
|
568
568
|
s > n && (n = s, a = c);
|
|
569
569
|
}
|
|
570
|
-
return
|
|
570
|
+
return k(a.r, a.g, a.b, a.a);
|
|
571
571
|
}
|
|
572
|
-
const
|
|
572
|
+
const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
573
573
|
__proto__: null,
|
|
574
574
|
BLACK: Z,
|
|
575
575
|
WHITE: I,
|
|
576
|
-
adjustL:
|
|
577
|
-
bestOn:
|
|
578
|
-
composite:
|
|
579
|
-
contrastRatio:
|
|
580
|
-
ensureContrast:
|
|
581
|
-
formatHex:
|
|
582
|
-
formatRgb:
|
|
583
|
-
formatTriplet:
|
|
584
|
-
fromOklch:
|
|
585
|
-
isDarkSurface:
|
|
586
|
-
lightness:
|
|
587
|
-
mix:
|
|
576
|
+
adjustL: E,
|
|
577
|
+
bestOn: Gr,
|
|
578
|
+
composite: er,
|
|
579
|
+
contrastRatio: m,
|
|
580
|
+
ensureContrast: R,
|
|
581
|
+
formatHex: xo,
|
|
582
|
+
formatRgb: kr,
|
|
583
|
+
formatTriplet: Wr,
|
|
584
|
+
fromOklch: fr,
|
|
585
|
+
isDarkSurface: zr,
|
|
586
|
+
lightness: ko,
|
|
587
|
+
mix: tr,
|
|
588
588
|
parseColor: _,
|
|
589
|
-
relativeLuminance:
|
|
590
|
-
setL:
|
|
589
|
+
relativeLuminance: or,
|
|
590
|
+
setL: wo,
|
|
591
591
|
toOklch: J,
|
|
592
592
|
withAlpha: D
|
|
593
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
593
|
+
}, Symbol.toStringTag, { value: "Module" })), So = {
|
|
594
594
|
none: ["0px", "0px", "0px", "0px"],
|
|
595
595
|
sm: ["3px", "4px", "6px", "9999px"],
|
|
596
596
|
md: ["4px", "6px", "10px", "9999px"],
|
|
597
597
|
lg: ["6px", "10px", "16px", "9999px"],
|
|
598
598
|
full: ["10px", "16px", "24px", "9999px"]
|
|
599
|
-
},
|
|
600
|
-
function
|
|
599
|
+
}, $o = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')", Ao = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";
|
|
600
|
+
function To(o, e) {
|
|
601
601
|
const t = o === "dark", a = e ? 0.06 : 0;
|
|
602
602
|
return {
|
|
603
603
|
text: e ? 1 : t ? 0.92 : 0.88,
|
|
@@ -619,129 +619,131 @@ function Mo(o, e) {
|
|
|
619
619
|
elevationMin: e ? 1.3 : t ? 1.18 : 1.06
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
const
|
|
623
|
-
function
|
|
624
|
-
let c = t, s =
|
|
625
|
-
for (;
|
|
626
|
-
c = Math.min(1, c + 0.02), s =
|
|
622
|
+
const v = (o) => kr(o), M = (o) => Wr(o), $ = (o, e) => kr(D(o, e)), Ur = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
|
|
623
|
+
function G(o, e, t, a, n = (c) => c) {
|
|
624
|
+
let c = t, s = Ur(n(tr(o, e, c))), i = 0;
|
|
625
|
+
for (; m(s, o) < a && c < 1 && i++ < 40; )
|
|
626
|
+
c = Math.min(1, c + 0.02), s = Ur(n(tr(o, e, c)));
|
|
627
627
|
return D(s, 1);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function Or(o, e, t) {
|
|
630
630
|
if (t <= 0) return o;
|
|
631
631
|
const a = J(o), n = J(e);
|
|
632
|
-
return
|
|
632
|
+
return fr({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
var
|
|
636
|
-
const e = { version: 2, ...o ?? {} }, t =
|
|
634
|
+
function Do(o) {
|
|
635
|
+
var Tr, Nr, Cr, Er, Lr, Hr, _r;
|
|
636
|
+
const e = { version: 2, ...o ?? {} }, t = io[e.preset ?? "dark"], a = [];
|
|
637
637
|
let n = _(e.surface) ?? null;
|
|
638
638
|
n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = D(n, 1);
|
|
639
639
|
let c = _(e.primary) ?? null;
|
|
640
640
|
c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = D(c, 1);
|
|
641
|
-
const s =
|
|
641
|
+
const s = zr(n) ? "dark" : "light", i = s === "dark", d = e.contrast === "high", g = To(s, d), C = Math.max(0, Math.min(1, e.tint ?? 0)), b = d ? 7 : 4.5, x = d ? 4.5 : 3, p = Or(i ? I : { r: 17, g: 17, b: 17, a: 1 }, c, C);
|
|
642
642
|
let f, A, j;
|
|
643
|
-
const H = (l) =>
|
|
643
|
+
const H = (l) => Or(l, c, C);
|
|
644
644
|
if (i) {
|
|
645
|
-
const l =
|
|
646
|
-
f =
|
|
645
|
+
const l = m(I, n) >= 6 ? I : Z;
|
|
646
|
+
f = G(n, l, 0.07, g.elevationMin, H), A = G(f, l, 0.05, 1.12, H), j = G(A, l, 0.05, 1.12, H);
|
|
647
647
|
} else {
|
|
648
|
-
const l =
|
|
649
|
-
if (l >=
|
|
650
|
-
const u = l >= 1.149995 ? 1.1 :
|
|
651
|
-
f =
|
|
648
|
+
const l = m(I, n);
|
|
649
|
+
if (l >= g.elevationMin * 1.01) {
|
|
650
|
+
const u = l >= 1.149995 ? 1.1 : g.elevationMin;
|
|
651
|
+
f = G(n, I, 0.5, u, H), A = m(I, f) >= 1.03 ? G(f, I, 0.6, 1.03, H) : D(I, 1), j = H(tr(A, Z, 0.035));
|
|
652
652
|
}
|
|
653
|
-
(!f ||
|
|
653
|
+
(!f || m(f, n) < g.elevationMin) && (f = G(n, Z, 0.03, g.elevationMin, H), A = D(I, 1), j = H(tr(A, Z, 0.05)));
|
|
654
654
|
}
|
|
655
655
|
if (!f || !A || !j) throw new Error("theme: elevation ladder not resolved");
|
|
656
|
-
const Y =
|
|
657
|
-
let S = l,
|
|
658
|
-
for (;
|
|
656
|
+
const Y = fr(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), U = Gr(Y), L = (l) => [n, f, A, j].reduce((u, N) => m(l, N) < m(l, u) ? N : u, n), O = (l, u, N) => {
|
|
657
|
+
let S = l, W = 0;
|
|
658
|
+
for (; m(D(p, S), L(D(p, S))) < u && S < 1 && W++ < 25; ) S = Math.min(1, S + 0.04);
|
|
659
659
|
return S !== l && a.push({ token: N, reason: `raised opacity ${l}→${S.toFixed(2)} to reach ${u}:1 on surfaces` }), S;
|
|
660
|
-
}, K =
|
|
661
|
-
const l =
|
|
662
|
-
if (l >=
|
|
660
|
+
}, K = O(g.text, b, "text"), ar = O(g.textMuted, b, "text-muted"), cr = O(g.textFaint, x, "text-faint"), V = (() => {
|
|
661
|
+
const l = m(I, c), u = m({ r: 17, g: 17, b: 17, a: 1 }, c);
|
|
662
|
+
if (l >= b) return I;
|
|
663
663
|
const N = u > l ? { r: 17, g: 17, b: 17, a: 1 } : I;
|
|
664
|
-
return Math.max(l, u) <
|
|
665
|
-
})(),
|
|
666
|
-
|
|
667
|
-
const
|
|
668
|
-
const u = _(
|
|
664
|
+
return Math.max(l, u) < b && a.push({ token: "on-primary", reason: `neither white nor black reaches ${b}:1 on primary (best ${Math.max(l, u).toFixed(2)}:1)` }), N;
|
|
665
|
+
})(), sr = E(c, i ? 0.06 : -0.06), ir = E(c, i ? 0.1 : -0.1), F = R(c, n, b, "auto");
|
|
666
|
+
m(F, n) > m(c, n) + 0.01 && a.push({ token: "primary-text", reason: `primary lightened/darkened to reach ${b}:1 as text on surface` });
|
|
667
|
+
const qr = R(c, n, x, "auto"), Jr = R(c, n, x, "auto"), lr = (l) => {
|
|
668
|
+
const u = _(lo[l]), N = m(I, u), S = m({ r: 17, g: 17, b: 17, a: 1 }, u), W = N >= b ? I : S > N ? { r: 17, g: 17, b: 17, a: 1 } : I, Q = D(u, g.soft), X = er(Q, n), Dr = (rr) => R(R(u, n, b, rr), X, b, rr), co = R(u, n, b, "auto"), so = [Dr("darker"), Dr("lighter")].find(
|
|
669
|
+
(rr) => m(rr, n) >= b && m(rr, X) >= b
|
|
670
|
+
);
|
|
669
671
|
return {
|
|
670
672
|
base: u,
|
|
671
|
-
on:
|
|
672
|
-
text:
|
|
673
|
-
soft:
|
|
674
|
-
border:
|
|
675
|
-
dark:
|
|
676
|
-
light:
|
|
677
|
-
darker:
|
|
678
|
-
bright:
|
|
673
|
+
on: W,
|
|
674
|
+
text: so ?? co,
|
|
675
|
+
soft: Q,
|
|
676
|
+
border: R(u, n, x, "auto"),
|
|
677
|
+
dark: E(u, -0.1),
|
|
678
|
+
light: E(u, 0.12),
|
|
679
|
+
darker: E(u, -0.18),
|
|
680
|
+
bright: E(u, 0.22)
|
|
679
681
|
};
|
|
680
|
-
},
|
|
682
|
+
}, Yr = lr("success"), Kr = lr("warning"), Vr = lr("error"), Qr = lr("info"), [Xr, ro, oo, eo] = So[e.radius ?? "md"], wr = "'Inter', sans-serif", Ir = (l) => {
|
|
681
683
|
var u;
|
|
682
|
-
return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${
|
|
683
|
-
},
|
|
684
|
+
return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${wr}` : wr;
|
|
685
|
+
}, Mr = Ir((Tr = e.fonts) == null ? void 0 : Tr.ui), to = (Nr = e.fonts) != null && Nr.heading ? Ir(e.fonts.heading) : Mr, no = Array.from(new Set([(Er = (Cr = e.fonts) == null ? void 0 : Cr.ui) == null ? void 0 : Er.src, (Hr = (Lr = e.fonts) == null ? void 0 : Lr.heading) == null ? void 0 : Hr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), Sr = (_r = e.font) != null && _r.size && e.font.size > 0 ? e.font.size : 14, T = {
|
|
684
686
|
"color-scheme": s,
|
|
685
|
-
surface:
|
|
687
|
+
surface: v(n),
|
|
686
688
|
"surface-rgb": M(n),
|
|
687
|
-
"surface-1":
|
|
689
|
+
"surface-1": v(f),
|
|
688
690
|
"surface-1-rgb": M(f),
|
|
689
|
-
"surface-2":
|
|
691
|
+
"surface-2": v(A),
|
|
690
692
|
"surface-2-rgb": M(A),
|
|
691
|
-
"surface-3":
|
|
692
|
-
"surface-inverse":
|
|
693
|
+
"surface-3": v(j),
|
|
694
|
+
"surface-inverse": v(Y),
|
|
693
695
|
scrim: "rgba(0, 0, 0, 0.5)",
|
|
694
|
-
ink:
|
|
696
|
+
ink: v(p),
|
|
695
697
|
"ink-rgb": M(p),
|
|
696
698
|
text: $(p, K),
|
|
697
|
-
"text-muted": $(p,
|
|
698
|
-
"text-faint": $(p,
|
|
699
|
-
"text-inverse":
|
|
699
|
+
"text-muted": $(p, ar),
|
|
700
|
+
"text-faint": $(p, cr),
|
|
701
|
+
"text-inverse": v(U),
|
|
700
702
|
"text-on-surface-rgb": M(p),
|
|
701
|
-
"text-on-inverse-rgb": M(
|
|
702
|
-
border: $(p,
|
|
703
|
-
"border-strong": $(p,
|
|
704
|
-
divider: $(p,
|
|
703
|
+
"text-on-inverse-rgb": M(U),
|
|
704
|
+
border: $(p, g.border),
|
|
705
|
+
"border-strong": $(p, g.borderStrong),
|
|
706
|
+
divider: $(p, g.divider),
|
|
705
707
|
"border-rgb": M(p),
|
|
706
|
-
fill: $(p,
|
|
707
|
-
"fill-hover": $(p,
|
|
708
|
-
"fill-active": $(p,
|
|
709
|
-
field: $(p,
|
|
710
|
-
"field-hover": $(p,
|
|
711
|
-
"field-focus": $(p,
|
|
712
|
-
hover: $(p,
|
|
713
|
-
pressed: $(p,
|
|
714
|
-
primary:
|
|
708
|
+
fill: $(p, g.fill),
|
|
709
|
+
"fill-hover": $(p, g.fillHover),
|
|
710
|
+
"fill-active": $(p, g.fillActive),
|
|
711
|
+
field: $(p, g.field),
|
|
712
|
+
"field-hover": $(p, g.fieldHover),
|
|
713
|
+
"field-focus": $(p, g.fieldFocus),
|
|
714
|
+
hover: $(p, g.hover),
|
|
715
|
+
pressed: $(p, g.pressed),
|
|
716
|
+
primary: v(c),
|
|
715
717
|
"primary-rgb": M(c),
|
|
716
|
-
"primary-hover":
|
|
717
|
-
"primary-active":
|
|
718
|
-
"on-primary":
|
|
719
|
-
"primary-text":
|
|
720
|
-
"primary-border":
|
|
721
|
-
"primary-soft": $(c,
|
|
722
|
-
"primary-soft-hover": $(c,
|
|
723
|
-
"focus-ring":
|
|
718
|
+
"primary-hover": v(sr),
|
|
719
|
+
"primary-active": v(ir),
|
|
720
|
+
"on-primary": v(V),
|
|
721
|
+
"primary-text": v(F),
|
|
722
|
+
"primary-border": v(qr),
|
|
723
|
+
"primary-soft": $(c, g.soft),
|
|
724
|
+
"primary-soft-hover": $(c, g.softHover),
|
|
725
|
+
"focus-ring": v(Jr),
|
|
724
726
|
"focus-ring-width": d ? "3px" : "2px",
|
|
725
727
|
"focus-ring-offset": "2px",
|
|
726
|
-
"primary-dark":
|
|
727
|
-
"primary-dark-rgb": M(
|
|
728
|
-
"primary-light":
|
|
729
|
-
"primary-light-rgb": M(
|
|
730
|
-
"primary-bright":
|
|
731
|
-
"primary-bright-rgb": M(
|
|
728
|
+
"primary-dark": v(E(c, -0.1)),
|
|
729
|
+
"primary-dark-rgb": M(E(c, -0.1)),
|
|
730
|
+
"primary-light": v(E(c, 0.1)),
|
|
731
|
+
"primary-light-rgb": M(E(c, 0.1)),
|
|
732
|
+
"primary-bright": v(E(c, 0.2)),
|
|
733
|
+
"primary-bright-rgb": M(E(c, 0.2)),
|
|
732
734
|
"shadow-1": i ? "0 1px 2px rgba(0, 0, 0, 0.4)" : "0 1px 2px rgba(0, 0, 0, 0.08)",
|
|
733
735
|
"shadow-2": i ? "0 6px 20px rgba(0, 0, 0, 0.45)" : "0 6px 20px rgba(0, 0, 0, 0.12)",
|
|
734
736
|
"shadow-3": i ? "0 12px 40px rgba(0, 0, 0, 0.5)" : "0 12px 40px rgba(0, 0, 0, 0.16)",
|
|
735
|
-
"radius-sm":
|
|
736
|
-
"radius-md":
|
|
737
|
-
"radius-lg":
|
|
738
|
-
"radius-full":
|
|
739
|
-
"font-family":
|
|
740
|
-
"font-family-heading":
|
|
741
|
-
"font-size": `${
|
|
742
|
-
"root-font-size": String(
|
|
737
|
+
"radius-sm": Xr,
|
|
738
|
+
"radius-md": ro,
|
|
739
|
+
"radius-lg": oo,
|
|
740
|
+
"radius-full": eo,
|
|
741
|
+
"font-family": Mr,
|
|
742
|
+
"font-family-heading": to,
|
|
743
|
+
"font-size": `${Sr}px`,
|
|
744
|
+
"root-font-size": String(Sr),
|
|
743
745
|
canvas: i ? "rgba(0, 0, 0, 0.25)" : "rgba(0, 0, 0, 0.04)",
|
|
744
|
-
"canvas-image": i ?
|
|
746
|
+
"canvas-image": i ? $o : Ao,
|
|
745
747
|
// Controls float over arbitrary artwork → mode-independent dark glass + white glyphs.
|
|
746
748
|
"canvas-control": "rgba(0, 0, 0, 0.45)",
|
|
747
749
|
"canvas-control-hover": "rgba(0, 0, 0, 0.6)",
|
|
@@ -749,51 +751,56 @@ function Lo(o) {
|
|
|
749
751
|
"disabled-opacity": "0.55"
|
|
750
752
|
};
|
|
751
753
|
for (const [l, u] of [
|
|
752
|
-
["success",
|
|
753
|
-
["warning",
|
|
754
|
-
["error",
|
|
755
|
-
["info",
|
|
754
|
+
["success", Yr],
|
|
755
|
+
["warning", Kr],
|
|
756
|
+
["error", Vr],
|
|
757
|
+
["info", Qr]
|
|
756
758
|
])
|
|
757
|
-
T[l] =
|
|
759
|
+
T[l] = v(u.base), T[`${l}-rgb`] = M(u.base), T[`on-${l}`] = v(u.on), T[`${l}-text`] = v(u.text), T[`${l}-soft`] = v(u.soft), T[`${l}-border`] = v(u.border), T[`${l}-dark-rgb`] = M(u.dark), T[`${l}-light-rgb`] = M(u.light), l === "info" ? T["info-bright-rgb"] = M(u.bright) : T[`${l}-darker-rgb`] = M(u.darker);
|
|
758
760
|
if (e.overrides)
|
|
759
761
|
for (const [l, u] of Object.entries(e.overrides)) {
|
|
760
|
-
if (!u || !
|
|
762
|
+
if (!u || !dr.includes(l)) continue;
|
|
761
763
|
T[l] = u;
|
|
762
764
|
const N = `${l}-rgb`;
|
|
763
|
-
if (
|
|
765
|
+
if (dr.includes(N)) {
|
|
764
766
|
const S = _(u);
|
|
765
767
|
S && (T[N] = M(S));
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
|
-
for (const l of
|
|
769
|
-
const
|
|
770
|
-
const
|
|
771
|
-
return { label: l, fg: u, bg: N, ratio: Math.round(
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
770
|
+
for (const l of dr) T[l] === void 0 && (T[l] = "");
|
|
771
|
+
const $r = T, Ar = (l) => _($r[l]), h = (l, u, N, S) => {
|
|
772
|
+
const W = Ar(u), Q = Ar(N), X = W && Q ? m(W, er(Q, n)) : 0;
|
|
773
|
+
return { label: l, fg: u, bg: N, ratio: Math.round(X * 100) / 100, min: S, pass: X >= S };
|
|
774
|
+
}, ao = [
|
|
775
|
+
h("Text on surface", "text", "surface", b),
|
|
776
|
+
h("Muted text on surface", "text-muted", "surface", b),
|
|
777
|
+
h("Faint text on surface", "text-faint", "surface", x),
|
|
778
|
+
h("Text on cards (surface-1)", "text", "surface-1", b),
|
|
779
|
+
h("Text on popovers (surface-2)", "text", "surface-2", b),
|
|
780
|
+
h("Cards distinguishable from surface", "surface-1", "surface", g.elevationMin),
|
|
781
|
+
h("Popovers distinguishable from cards", "surface-2", "surface-1", i ? 1.12 : 1),
|
|
782
|
+
h("Strong border on surface", "border-strong", "surface", d ? 3 : 1.5),
|
|
783
|
+
h("Text on primary", "on-primary", "primary", b),
|
|
784
|
+
h("Primary as text on surface", "primary-text", "surface", b),
|
|
785
|
+
h("Primary border on surface", "primary-border", "surface", x),
|
|
786
|
+
h("Focus ring on surface", "focus-ring", "surface", x),
|
|
787
|
+
h("Success text on surface", "success-text", "surface", b),
|
|
788
|
+
h("Warning text on surface", "warning-text", "surface", b),
|
|
789
|
+
h("Error text on surface", "error-text", "surface", b),
|
|
790
|
+
h("Info text on surface", "info-text", "surface", b),
|
|
791
|
+
// Where status text is actually read: on its own tint (alerts, tags, banners).
|
|
792
|
+
h("Success text on success tint", "success-text", "success-soft", b),
|
|
793
|
+
h("Warning text on warning tint", "warning-text", "warning-soft", b),
|
|
794
|
+
h("Error text on error tint", "error-text", "error-soft", b),
|
|
795
|
+
h("Info text on info tint", "info-text", "info-soft", b),
|
|
796
|
+
h("Text on success", "on-success", "success", b),
|
|
797
|
+
h("Text on warning", "on-warning", "warning", b),
|
|
798
|
+
h("Text on error", "on-error", "error", b),
|
|
799
|
+
h("Text on tooltip", "text-inverse", "surface-inverse", b)
|
|
793
800
|
];
|
|
794
|
-
return { input: e, mode: s, tokens:
|
|
801
|
+
return { input: e, mode: s, tokens: $r, report: { mode: s, checks: ao, adjustments: a }, fontUrls: no };
|
|
795
802
|
}
|
|
796
|
-
const r = (o) => `var(${
|
|
803
|
+
const r = (o) => `var(${br}${o})`, Zr = {
|
|
797
804
|
/* ------------------------------------------------------------------ */
|
|
798
805
|
/* Typography & focus ring */
|
|
799
806
|
/* ------------------------------------------------------------------ */
|
|
@@ -1256,47 +1263,47 @@ const r = (o) => `var(${ir}${o})`, zr = {
|
|
|
1256
1263
|
/* Misc */
|
|
1257
1264
|
/* ------------------------------------------------------------------ */
|
|
1258
1265
|
"spinner-color": r("text")
|
|
1259
|
-
},
|
|
1260
|
-
Object.keys(
|
|
1261
|
-
(o) => `--${o}`.startsWith(
|
|
1266
|
+
}, No = new Set(
|
|
1267
|
+
Object.keys(Zr).filter(
|
|
1268
|
+
(o) => `--${o}`.startsWith(br) && dr.includes(`--${o}`.slice(br.length))
|
|
1262
1269
|
)
|
|
1263
|
-
),
|
|
1264
|
-
|
|
1265
|
-
).filter(([o]) => !
|
|
1266
|
-
function
|
|
1270
|
+
), Co = Object.entries(
|
|
1271
|
+
Zr
|
|
1272
|
+
).filter(([o]) => !No.has(o));
|
|
1273
|
+
function Eo(o) {
|
|
1267
1274
|
const e = {};
|
|
1268
1275
|
for (const [t, a] of Object.entries(o.tokens))
|
|
1269
|
-
a !== "" && (e[`${
|
|
1270
|
-
for (const [t, a] of
|
|
1276
|
+
a !== "" && (e[`${br}${t}`] = a);
|
|
1277
|
+
for (const [t, a] of Co)
|
|
1271
1278
|
e[`--${t}`] = a;
|
|
1272
1279
|
if (o.input.customStyle)
|
|
1273
1280
|
for (const [t, a] of Object.entries(o.input.customStyle))
|
|
1274
1281
|
t === "key" || a == null || a === "" || (e[t.startsWith("--") ? t : `--${t}`] = String(a));
|
|
1275
1282
|
return e;
|
|
1276
1283
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const t = Array.isArray(e) ? e.join(", ") : e, a =
|
|
1284
|
+
function Po(o, e) {
|
|
1285
|
+
const t = Array.isArray(e) ? e.join(", ") : e, a = Eo(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
|
|
1279
1286
|
return `${t} { color-scheme: ${o.mode}; ${n} }`;
|
|
1280
1287
|
}
|
|
1281
|
-
function
|
|
1288
|
+
function jo(o) {
|
|
1282
1289
|
return !!o && typeof o == "object" && o.version === 2;
|
|
1283
1290
|
}
|
|
1284
|
-
function
|
|
1291
|
+
function Ro(o) {
|
|
1285
1292
|
const e = o ?? {}, t = e["editor-view-background-color"] || (e["app-background-color-rgb"] ? `rgb(${e["app-background-color-rgb"]})` : void 0) || e["popup-background-color"], a = e["primary-color-base"] ? `rgb(${e["primary-color-base"]})` : void 0, n = _(t) ? t : void 0, c = _(a) ? a : void 0, s = typeof e.key == "string" && e.key.endsWith("-wcag"), i = { version: 2 };
|
|
1286
1293
|
return n && (i.surface = n), c && (i.primary = c), s && (i.contrast = "high"), typeof e.key == "string" && (i.preset = e.key.startsWith("light") ? "light" : "dark"), i;
|
|
1287
1294
|
}
|
|
1288
1295
|
export {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1296
|
+
Zr as LEGACY_BRIDGE,
|
|
1297
|
+
br as SEMANTIC_PREFIX,
|
|
1298
|
+
Lo as SEMANTIC_TOKEN_GROUPS,
|
|
1299
|
+
dr as SEMANTIC_TOKEN_NAMES,
|
|
1300
|
+
lo as STATUS_BASES,
|
|
1301
|
+
Ho as THEME_HOUSE_PRESETS,
|
|
1302
|
+
io as THEME_PRESETS,
|
|
1303
|
+
jo as looksLikeThemeInput,
|
|
1304
|
+
Do as resolveTheme,
|
|
1305
|
+
_o as themeColor,
|
|
1306
|
+
Ro as themeInputFromLegacyCustomStyle,
|
|
1307
|
+
Po as themeToCssText,
|
|
1308
|
+
Eo as themeToCssVars
|
|
1302
1309
|
};
|