@takazudo/zdtp 0.4.12 → 0.4.14
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 +86 -27
- package/PORTABLE-CONTRACT.md +36 -6
- package/README.md +4 -4
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CTDDBxI8.js → autoload-state-IlkEci88.js} +1 -1
- package/dist/components/palette-chart/palette-chart.d.ts +14 -3
- package/dist/config/panel-config.d.ts +0 -25
- package/dist/index-Ds4bCeiC.js +7591 -0
- package/dist/{index-C8GR1TU-.js → index-EdhZv8Ru.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{panel-config-7Xg59uKj.js → panel-config-SgA84Uqe.js} +139 -114
- package/dist/tabs/palette/palette-check-view.d.ts +0 -13
- package/dist/testing.js +2 -2
- package/dist/tokens/tier-model.d.ts +7 -5
- package/dist/{tweak-state-DRKV1uYj.js → tweak-state-DGLrzIwq.js} +259 -237
- package/dist/utils/color-oklch.d.ts +13 -0
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/index-BeYH-tJD.js +0 -7582
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as y, jsxs as K, Fragment as kt } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect as P, useState as Y, useRef as O, useMemo as J, useCallback as X } from "preact/hooks";
|
|
3
|
-
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-
|
|
4
|
-
import { g as vt, m as j } from "./panel-config-
|
|
3
|
+
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-Ds4bCeiC.js";
|
|
4
|
+
import { g as vt, m as j } from "./panel-config-SgA84Uqe.js";
|
|
5
5
|
const xt = (e, o) => {
|
|
6
6
|
const t = new Array(e.length + o.length);
|
|
7
7
|
for (let r = 0; r < e.length; r++)
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "preact/jsx-runtime";
|
|
2
2
|
import "preact";
|
|
3
|
-
import { S as t, c as i, d as n, _ as l, e as d, f as _, g as p, h as g, i as m, j as P, k as u, l as A, m as C, n as S, o as T, q as c, r as f, s as K, t as M, v, w as E, x as F, y as h, z as w } from "./index-
|
|
4
|
-
import { Z as y,
|
|
5
|
-
import { c as
|
|
6
|
-
import "./autoload-state-
|
|
3
|
+
import { S as t, c as i, d as n, _ as l, e as d, f as _, g as p, h as g, i as m, j as P, k as u, l as A, m as C, n as S, o as T, q as c, r as f, s as K, t as M, v, w as E, x as F, y as h, z as w } from "./index-Ds4bCeiC.js";
|
|
4
|
+
import { Z as y, V as D, v as k, u as H, Y as L } from "./tweak-state-DGLrzIwq.js";
|
|
5
|
+
import { c as Y, s as b } from "./panel-config-SgA84Uqe.js";
|
|
6
|
+
import "./autoload-state-IlkEci88.js";
|
|
7
7
|
export {
|
|
8
8
|
t as SCHEMA_V1,
|
|
9
9
|
i as SCHEMA_V2,
|
|
@@ -14,7 +14,7 @@ export {
|
|
|
14
14
|
_ as __reapplyFromStorageForTests,
|
|
15
15
|
p as __resetInstanceBindingsForTests,
|
|
16
16
|
g as __resetSpawnSlotsForTests,
|
|
17
|
-
|
|
17
|
+
Y as configurePanel,
|
|
18
18
|
m as disableAutoload,
|
|
19
19
|
D as emptyOverrides,
|
|
20
20
|
P as enableAutoload,
|
|
@@ -32,7 +32,7 @@ export {
|
|
|
32
32
|
H as resolvePerModeLiteral,
|
|
33
33
|
L as resolveSemanticPreviewColor,
|
|
34
34
|
E as setLifecycleAdapter,
|
|
35
|
-
|
|
35
|
+
b as setPanelColorPresets,
|
|
36
36
|
F as shouldAutoload,
|
|
37
37
|
h as showDesignTokenPanel,
|
|
38
38
|
w as toggleDesignPanel
|
|
@@ -3,14 +3,14 @@ class b extends Error {
|
|
|
3
3
|
super(t), this.name = "TierResolverError", Object.setPrototypeOf(this, b.prototype);
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function v(e, t) {
|
|
7
7
|
return e.tiers.find((n) => n.id === t);
|
|
8
8
|
}
|
|
9
9
|
function $(e, t) {
|
|
10
10
|
return e.items.find((n) => n.id === t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const g =
|
|
12
|
+
function Q(e, t, n, i) {
|
|
13
|
+
const g = v(e, t);
|
|
14
14
|
if (!g)
|
|
15
15
|
throw new b(
|
|
16
16
|
`Tier "${t}" not found in tab "${e.id}". Available tiers: ${e.tiers.map((l) => l.id).join(", ")}.`
|
|
@@ -22,7 +22,7 @@ function Y(e, t, n, i) {
|
|
|
22
22
|
);
|
|
23
23
|
const a = i[t]?.[n];
|
|
24
24
|
if (g.referencesTier !== void 0) {
|
|
25
|
-
const l = g.referencesTier, f =
|
|
25
|
+
const l = g.referencesTier, f = v(e, l);
|
|
26
26
|
if (!f)
|
|
27
27
|
throw new b(
|
|
28
28
|
`Tier "${t}" declares referencesTier "${l}" but that tier does not exist in tab "${e.id}".`
|
|
@@ -40,16 +40,16 @@ function Y(e, t, n, i) {
|
|
|
40
40
|
}
|
|
41
41
|
return a !== void 0 ? c.pill && a === c.pill.value ? { kind: "literal", value: c.pill.value } : { kind: "literal", value: a } : c.pill ? { kind: "literal", value: c.pill.customDefault } : { kind: "literal", value: c.default };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function I(e) {
|
|
44
44
|
return e.kind === "literal" ? e.value : `var(${e.targetCssVar})`;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function N(e, t, n = [t]) {
|
|
47
47
|
const i = e.tab === void 0 || e.tab === t.id ? t : n.find((s) => s.id === e.tab);
|
|
48
48
|
if (!i)
|
|
49
49
|
throw new b(
|
|
50
50
|
`Cross-tab ref target tab "${e.tab}" not found. Available tabs: ${n.map((s) => s.id).join(", ")}.`
|
|
51
51
|
);
|
|
52
|
-
const g =
|
|
52
|
+
const g = v(i, e.tier);
|
|
53
53
|
if (!g)
|
|
54
54
|
throw new b(
|
|
55
55
|
`Cross-tab ref target tier "${e.tier}" not found in tab "${i.id}". Available tiers: ${i.tiers.map((s) => s.id).join(", ")}.`
|
|
@@ -61,10 +61,10 @@ function M(e, t, n = [t]) {
|
|
|
61
61
|
);
|
|
62
62
|
return c.cssVar;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ee(e, t) {
|
|
65
65
|
return e.paletteCssVarTemplate.replace("{n}", String(t));
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const z = /* @__PURE__ */ new Set([
|
|
68
68
|
"aliceblue",
|
|
69
69
|
"antiquewhite",
|
|
70
70
|
"aqua",
|
|
@@ -221,10 +221,10 @@ const N = /* @__PURE__ */ new Set([
|
|
|
221
221
|
"revert",
|
|
222
222
|
"revert-layer"
|
|
223
223
|
]);
|
|
224
|
-
function
|
|
225
|
-
return e.startsWith("#") || e.includes("(") ||
|
|
224
|
+
function H(e) {
|
|
225
|
+
return e.startsWith("#") || e.includes("(") || z.has(e.toLowerCase());
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function K(e, t, n, i) {
|
|
228
228
|
const g = [], c = e.indexOf(":");
|
|
229
229
|
if (c !== -1) {
|
|
230
230
|
const a = e.slice(0, c), l = e.slice(c + 1), f = t.find((r) => r.tier === a);
|
|
@@ -234,18 +234,18 @@ function H(e, t, n, i) {
|
|
|
234
234
|
g.push({ tab: s.tab, tier: s.tier, item: e });
|
|
235
235
|
for (const a of g)
|
|
236
236
|
try {
|
|
237
|
-
return
|
|
237
|
+
return N(a, n, i), { ref: a };
|
|
238
238
|
} catch {
|
|
239
239
|
}
|
|
240
240
|
return { ref: g[0] };
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function L(e, t, n, i, g, c) {
|
|
243
243
|
const s = t.get(e.default);
|
|
244
|
-
return s !== void 0 ? s : e.default === "bg" || e.default === "fg" ? e.default : n && n.length > 0 && !
|
|
244
|
+
return s !== void 0 ? s : e.default === "bg" || e.default === "fg" ? e.default : n && n.length > 0 && !H(e.default) ? K(e.default, n, i, g) : c ? (console.warn(
|
|
245
245
|
`[design-token-panel] semantic item "${e.id}" default "${e.default}" names no palette item; falling back to palette index 0`
|
|
246
246
|
), 0) : { literal: e.default };
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function O(e, t = [e]) {
|
|
249
249
|
const n = e.colorExtras;
|
|
250
250
|
if (!n) return;
|
|
251
251
|
const i = e.tiers.find(
|
|
@@ -274,7 +274,7 @@ function V(e, t = [e]) {
|
|
|
274
274
|
if (g) {
|
|
275
275
|
const o = !g.semantic, d = n.semanticDefaults;
|
|
276
276
|
for (const u of g.items)
|
|
277
|
-
r[u.id] = u.cssVar, f[u.id] = d && u.id in d ? d[u.id] :
|
|
277
|
+
r[u.id] = u.cssVar, f[u.id] = d && u.id in d ? d[u.id] : L(
|
|
278
278
|
u,
|
|
279
279
|
l,
|
|
280
280
|
g.referencesRamps,
|
|
@@ -297,14 +297,14 @@ function V(e, t = [e]) {
|
|
|
297
297
|
panelSettings: n.panelSettings
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function te(e) {
|
|
301
301
|
const t = e.find((n) => n.id === "color");
|
|
302
302
|
if (t)
|
|
303
|
-
return
|
|
303
|
+
return O(t, e);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function F(e) {
|
|
306
306
|
const t = e.find((n) => n.id === "color-secondary");
|
|
307
|
-
return t ?
|
|
307
|
+
return t ? O(t, e) ?? null : null;
|
|
308
308
|
}
|
|
309
309
|
function S(e, t) {
|
|
310
310
|
if (Object.is(e, t)) return !0;
|
|
@@ -324,7 +324,7 @@ function S(e, t) {
|
|
|
324
324
|
return !1;
|
|
325
325
|
return !0;
|
|
326
326
|
}
|
|
327
|
-
const
|
|
327
|
+
const V = {
|
|
328
328
|
storagePrefix: "zudo-design-token-panel",
|
|
329
329
|
consoleNamespace: "zudo",
|
|
330
330
|
modalClassPrefix: "zudo-design-token-panel-modal",
|
|
@@ -336,10 +336,10 @@ const _ = {
|
|
|
336
336
|
// No bundled apply endpoint / routing — hosts wire their own.
|
|
337
337
|
applyEndpoint: void 0,
|
|
338
338
|
applyRouting: void 0
|
|
339
|
-
},
|
|
339
|
+
}, R = /* @__PURE__ */ Symbol.for("@takazudo/zdtp:singleton");
|
|
340
340
|
function m() {
|
|
341
341
|
const e = globalThis;
|
|
342
|
-
let t = e[
|
|
342
|
+
let t = e[R];
|
|
343
343
|
return t || (t = {
|
|
344
344
|
instances: /* @__PURE__ */ new Map(),
|
|
345
345
|
defaultPrefix: null,
|
|
@@ -347,9 +347,9 @@ function m() {
|
|
|
347
347
|
pendingPostConfigureHooks: [],
|
|
348
348
|
lifecycleHooks: {},
|
|
349
349
|
colorSchemeOwners: /* @__PURE__ */ new Set()
|
|
350
|
-
}, e[
|
|
350
|
+
}, e[R] = t), t;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function J(e) {
|
|
353
353
|
return {
|
|
354
354
|
instanceId: e,
|
|
355
355
|
open() {
|
|
@@ -371,7 +371,7 @@ function F(e) {
|
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function ne(e) {
|
|
375
375
|
m().lifecycleHooks = {
|
|
376
376
|
configured: e.configured,
|
|
377
377
|
open: e.open,
|
|
@@ -380,7 +380,7 @@ function I(e) {
|
|
|
380
380
|
destroy: e.destroy
|
|
381
381
|
};
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function re(e) {
|
|
384
384
|
const t = m(), n = e.storagePrefix, i = t.instances.get(n);
|
|
385
385
|
if (i) {
|
|
386
386
|
const f = (r) => ({ ...r, applySink: void 0 });
|
|
@@ -402,7 +402,7 @@ function ee(e) {
|
|
|
402
402
|
suppliedConfig: { ...e },
|
|
403
403
|
pendingColorPresets: null,
|
|
404
404
|
postConfigureHooks: a,
|
|
405
|
-
handle:
|
|
405
|
+
handle: J(n)
|
|
406
406
|
};
|
|
407
407
|
t.instances.set(n, l), t.defaultPrefix = n;
|
|
408
408
|
for (const f of l.postConfigureHooks)
|
|
@@ -413,7 +413,7 @@ function x() {
|
|
|
413
413
|
const e = m();
|
|
414
414
|
return e.defaultPrefix === null ? null : e.instances.get(e.defaultPrefix) ?? null;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function oe(e) {
|
|
417
417
|
const t = x();
|
|
418
418
|
if (t === null) {
|
|
419
419
|
const n = m();
|
|
@@ -423,97 +423,118 @@ function te(e) {
|
|
|
423
423
|
}
|
|
424
424
|
t.postConfigureHooks.includes(e) || (t.postConfigureHooks.push(e), e());
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
return x()?.config ??
|
|
426
|
+
function _() {
|
|
427
|
+
return x()?.config ?? V;
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function ie() {
|
|
430
430
|
return [...m().instances.values()].map((e) => e.config);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function se(e) {
|
|
433
433
|
return m().instances.get(e)?.config ?? null;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function ae() {
|
|
436
436
|
const e = m();
|
|
437
|
-
e.instances.clear(), e.defaultPrefix = null, e.pendingColorPresets = null, e.pendingPostConfigureHooks.length = 0,
|
|
437
|
+
e.instances.clear(), e.defaultPrefix = null, e.pendingColorPresets = null, e.pendingPostConfigureHooks.length = 0, A().clear();
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function A() {
|
|
440
440
|
const e = m();
|
|
441
441
|
return e.colorSchemeOwners || (e.colorSchemeOwners = /* @__PURE__ */ new Set()), e.colorSchemeOwners;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
|
|
443
|
+
function le(e) {
|
|
444
|
+
A().add(e);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
446
|
+
function fe(e) {
|
|
447
|
+
A().delete(e);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
449
|
+
function ce(e) {
|
|
450
|
+
return A().has(e);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
452
|
+
function ge(e = _()) {
|
|
453
|
+
return F(e.tabs);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function de(e) {
|
|
456
456
|
return `${e.storagePrefix}-state-v2`;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function ue(e) {
|
|
459
459
|
return `${e.storagePrefix}-state-v3`;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function pe(e) {
|
|
462
462
|
return `${e.storagePrefix}-state-v4`;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ye(e) {
|
|
465
465
|
return `${e.storagePrefix}-state`;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function me(e) {
|
|
468
468
|
return `${e.storagePrefix}-open`;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function he(e) {
|
|
471
471
|
return `${e.storagePrefix}-position`;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function we(e) {
|
|
474
474
|
return `${e.storagePrefix}-size`;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function be(e) {
|
|
477
477
|
return `${e.storagePrefix}-density`;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function ke(e) {
|
|
480
480
|
return `${e.storagePrefix}:visible`;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function $e(e) {
|
|
483
483
|
return `${e.storagePrefix}:autoload`;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function Ce(e) {
|
|
486
486
|
return `${e.storagePrefix}-root`;
|
|
487
487
|
}
|
|
488
|
-
const
|
|
489
|
-
function
|
|
490
|
-
return e.storagePrefix ===
|
|
488
|
+
const q = V.storagePrefix, G = "toggle-design-token-panel";
|
|
489
|
+
function Pe(e) {
|
|
490
|
+
return e.storagePrefix === q ? G : e.toggleEvent ?? `toggle-${e.storagePrefix}`;
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
function
|
|
494
|
-
return `${
|
|
492
|
+
const B = "__zdtp:open-state-changed";
|
|
493
|
+
function Ee(e) {
|
|
494
|
+
return `${B}:${e.storagePrefix}`;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function Ae(e, t) {
|
|
497
497
|
return `${e.modalClassPrefix}${t}`;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function ve(e) {
|
|
500
500
|
return `${e.exportFilenameBase}.json`;
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
function
|
|
502
|
+
const D = /* @__PURE__ */ Symbol.for("@takazudo/zdtp:global-alias-marker");
|
|
503
|
+
function M(e) {
|
|
504
|
+
return typeof e == "object" && e !== null || typeof e == "function";
|
|
505
|
+
}
|
|
506
|
+
function U(e) {
|
|
507
|
+
if (!M(e)) return !1;
|
|
508
|
+
try {
|
|
509
|
+
return e[D] === !0;
|
|
510
|
+
} catch {
|
|
511
|
+
return !1;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function W(e) {
|
|
515
|
+
if (!M(e)) return !1;
|
|
516
|
+
try {
|
|
517
|
+
const t = e;
|
|
518
|
+
return typeof t.show == "function" && typeof t.hide == "function" && typeof t.toggle == "function";
|
|
519
|
+
} catch {
|
|
520
|
+
return !1;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function Se(e) {
|
|
504
524
|
if (typeof window > "u") return;
|
|
505
525
|
const t = window, n = t.zdtp;
|
|
506
526
|
if (n !== void 0) {
|
|
507
|
-
if ((
|
|
527
|
+
if (U(n) || W(n))
|
|
528
|
+
return;
|
|
508
529
|
console.warn(
|
|
509
530
|
"[design-token-panel] window.zdtp already exists and was not installed by this package. Skipping the zdtp.show() / zdtp.hide() / zdtp.toggle() global alias to avoid clobbering it. Use window[consoleNamespace].* or the configurePanel(cfg) handle instead."
|
|
510
531
|
);
|
|
511
532
|
return;
|
|
512
533
|
}
|
|
513
534
|
const i = { ...e };
|
|
514
|
-
i[
|
|
535
|
+
i[D] = !0, t.zdtp = i;
|
|
515
536
|
}
|
|
516
|
-
function
|
|
537
|
+
function xe(e) {
|
|
517
538
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
518
539
|
throw new Error("[design-token-panel] PanelConfig must be a non-null object");
|
|
519
540
|
const t = e;
|
|
@@ -528,7 +549,7 @@ function ve(e) {
|
|
|
528
549
|
throw new Error(
|
|
529
550
|
`[design-token-panel] PanelConfig.${n} must be a non-empty string (got ${typeof t[n]})`
|
|
530
551
|
);
|
|
531
|
-
if (
|
|
552
|
+
if (Z(t.tabs), t.toggleEvent !== void 0 && (typeof t.toggleEvent != "string" || t.toggleEvent.length === 0))
|
|
532
553
|
throw new Error(
|
|
533
554
|
`[design-token-panel] PanelConfig.toggleEvent must be a non-empty string when set (got ${typeof t.toggleEvent})`
|
|
534
555
|
);
|
|
@@ -579,7 +600,7 @@ function ve(e) {
|
|
|
579
600
|
);
|
|
580
601
|
}
|
|
581
602
|
}
|
|
582
|
-
function
|
|
603
|
+
function Z(e) {
|
|
583
604
|
if (!Array.isArray(e))
|
|
584
605
|
throw new Error("[design-token-panel] PanelConfig.tabs must be an array");
|
|
585
606
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -593,10 +614,10 @@ function B(e) {
|
|
|
593
614
|
throw new Error(
|
|
594
615
|
`[design-token-panel] PanelConfig.tabs: duplicate tab id "${i.id}"`
|
|
595
616
|
);
|
|
596
|
-
t.add(i.id),
|
|
617
|
+
t.add(i.id), X(i.id, i, e);
|
|
597
618
|
}
|
|
598
619
|
}
|
|
599
|
-
function
|
|
620
|
+
function Y(e) {
|
|
600
621
|
if (typeof e == "number" || e === "bg" || e === "fg") return !0;
|
|
601
622
|
if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
|
|
602
623
|
const t = e;
|
|
@@ -615,7 +636,7 @@ function U(e) {
|
|
|
615
636
|
}
|
|
616
637
|
return !1;
|
|
617
638
|
}
|
|
618
|
-
function
|
|
639
|
+
function X(e, t, n) {
|
|
619
640
|
if (!Array.isArray(t.tiers))
|
|
620
641
|
throw new Error(
|
|
621
642
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers must be an array`
|
|
@@ -737,6 +758,10 @@ function W(e, t, n) {
|
|
|
737
758
|
throw new Error(
|
|
738
759
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps must be an array`
|
|
739
760
|
);
|
|
761
|
+
if (e !== "color" && e !== "color-secondary")
|
|
762
|
+
throw new Error(
|
|
763
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps is only supported on tabs with id "color" or "color-secondary" (got "${e}")`
|
|
764
|
+
);
|
|
740
765
|
const f = g.get(l), r = a.referencesRamps;
|
|
741
766
|
for (let o = 0; o < r.length; o++) {
|
|
742
767
|
const d = r[o];
|
|
@@ -848,7 +873,7 @@ function W(e, t, n) {
|
|
|
848
873
|
);
|
|
849
874
|
const r = s.semanticDefaults;
|
|
850
875
|
for (const [o, d] of Object.entries(r))
|
|
851
|
-
if (!
|
|
876
|
+
if (!Y(d))
|
|
852
877
|
throw new Error(
|
|
853
878
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.semanticDefaults["${o}"] must be a valid SemanticValue (number | 'bg' | 'fg' | { literal: string } | { literal: { light, dark } } | { ref: { tier, item, tab? } }), got ${JSON.stringify(d)}`
|
|
854
879
|
);
|
|
@@ -905,10 +930,10 @@ function W(e, t, n) {
|
|
|
905
930
|
`[design-token-panel] PanelConfig.tabs["${e}"].notesExtras must only be set on a tab with id "notes"`
|
|
906
931
|
);
|
|
907
932
|
}
|
|
908
|
-
function
|
|
933
|
+
function Te(e = _()) {
|
|
909
934
|
return e.applyRouting ?? {};
|
|
910
935
|
}
|
|
911
|
-
function
|
|
936
|
+
function je(e) {
|
|
912
937
|
const t = x();
|
|
913
938
|
if (t === null) {
|
|
914
939
|
m().pendingColorPresets = e;
|
|
@@ -917,42 +942,42 @@ function Se(e) {
|
|
|
917
942
|
t.config = { ...t.config, colorPresets: e };
|
|
918
943
|
}
|
|
919
944
|
export {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
945
|
+
ve as A,
|
|
946
|
+
Te as B,
|
|
947
|
+
O as C,
|
|
948
|
+
Ee as D,
|
|
949
|
+
ne as E,
|
|
950
|
+
oe as F,
|
|
951
|
+
Pe as G,
|
|
952
|
+
G as H,
|
|
953
|
+
ie as I,
|
|
954
|
+
se as J,
|
|
955
|
+
Ce as K,
|
|
956
|
+
ae as _,
|
|
957
|
+
ke as a,
|
|
958
|
+
xe as b,
|
|
959
|
+
re as c,
|
|
960
|
+
me as d,
|
|
961
|
+
he as e,
|
|
962
|
+
ye as f,
|
|
963
|
+
_ as g,
|
|
964
|
+
de as h,
|
|
965
|
+
Se as i,
|
|
966
|
+
$e as j,
|
|
967
|
+
pe as k,
|
|
968
|
+
ue as l,
|
|
969
|
+
Ae as m,
|
|
970
|
+
fe as n,
|
|
971
|
+
ge as o,
|
|
972
|
+
Q as p,
|
|
973
|
+
I as q,
|
|
974
|
+
te as r,
|
|
975
|
+
je as s,
|
|
976
|
+
we as t,
|
|
977
|
+
be as u,
|
|
978
|
+
ee as v,
|
|
979
|
+
le as w,
|
|
980
|
+
ce as x,
|
|
981
|
+
N as y,
|
|
957
982
|
S as z
|
|
958
983
|
};
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PaletteCheckView — Check mode Left/Right contrast checker (#394).
|
|
3
|
-
*
|
|
4
|
-
* Left column: full palette as selectable base rows (div[role="button"]).
|
|
5
|
-
* Right column: every palette color annotated against the selected base:
|
|
6
|
-
* - Live "Aa" sample (candidate foreground on base background)
|
|
7
|
-
* - WCAG ratio (contrastRatio)
|
|
8
|
-
* - Fail/AA/AAA chip using fixed semantic colors (not theme tokens)
|
|
9
|
-
*
|
|
10
|
-
* WCAG contrast is symmetric; ratio is computed once per candidate pair.
|
|
11
|
-
*
|
|
12
|
-
* Toggles: grouped↔flat listing; normal/large text thresholds.
|
|
13
|
-
*/
|
|
14
1
|
import type { TabConfig } from '../../tokens/tier-model';
|
|
15
2
|
import type { TabOverrides } from '../../apply/tier-resolver';
|
|
16
3
|
export interface PaletteCheckViewProps {
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as r, c as _, d as i, e as n, f as g, h as R, a as p } from "./panel-config-
|
|
2
|
-
import { a as l, b as y, l as O } from "./tweak-state-
|
|
1
|
+
import { _ as r, c as _, d as i, e as n, f as g, h as R, a as p } from "./panel-config-SgA84Uqe.js";
|
|
2
|
+
import { a as l, b as y, l as O } from "./tweak-state-DGLrzIwq.js";
|
|
3
3
|
import { F as K, G as E, a as S, S as u } from "./manifest-DCReQE0k.js";
|
|
4
4
|
async function s(e, a) {
|
|
5
5
|
await e.fill(a), await e.dispatchEvent("input");
|
|
@@ -119,11 +119,13 @@ export interface TierConfig {
|
|
|
119
119
|
*/
|
|
120
120
|
semantic?: true;
|
|
121
121
|
/**
|
|
122
|
-
* Cross-tab ramp-source declaration for a semantic tier
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* `
|
|
126
|
-
* tab
|
|
122
|
+
* Cross-tab ramp-source declaration for a semantic tier owned by a tab whose
|
|
123
|
+
* id is exactly `color` or `color-secondary`; `assertValidPanelConfig`
|
|
124
|
+
* rejects every other owning tab id. The ramp tier(s) are the sources this
|
|
125
|
+
* tier's `{ ref }` mappings may point into. Each entry names a tier id and an
|
|
126
|
+
* optional tab id (omitted `tab` means "this tab"). The validator also checks
|
|
127
|
+
* every declared source up front (the tab/tier must exist and share this
|
|
128
|
+
* tier's kind); `resolveColorClusterFromTab`
|
|
127
129
|
* (`config/cluster-config.ts`) uses the allow-list to derive each row's
|
|
128
130
|
* `SemanticValue`; the grouped `TierRefSelector` picker
|
|
129
131
|
* (`controls/tier-ref-selector.tsx`) renders one `<optgroup>` per declared
|