@takazudo/zdtp 0.6.0 → 0.7.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.
@@ -0,0 +1,408 @@
1
+ import { jsxs as _, jsx as v } from "preact/jsx-runtime";
2
+ const q = new Set("aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen transparent currentcolor inherit initial unset revert revert-layer".split(" "));
3
+ function C(l) {
4
+ return l.startsWith("#") || l.includes("(") || q.has(l.toLowerCase());
5
+ }
6
+ const O = [
7
+ "background",
8
+ "foreground",
9
+ "cursor",
10
+ "selectionBg",
11
+ "selectionFg"
12
+ ], j = /^--[\w\u0080-\uffff-]+$/u;
13
+ function A(l) {
14
+ let f = "", o = 0;
15
+ for (let r = 0; r < l.length; r++) {
16
+ const h = l[r];
17
+ if (h === '"' || h === "'") {
18
+ const c = h;
19
+ let a = !1;
20
+ for (r++; r < l.length; r++)
21
+ if (l[r] === "\\") r++;
22
+ else if (l[r] === c) {
23
+ a = !0;
24
+ break;
25
+ } else if (/[\n\r\f]/.test(l[r])) return { syntax: f, safe: !1 };
26
+ if (!a) return { syntax: f, safe: !1 };
27
+ f += '""';
28
+ } else if (h === "/" && l[r + 1] === "*") {
29
+ const c = l.indexOf("*/", r + 2);
30
+ if (c === -1) return { syntax: f, safe: !1 };
31
+ f += " ", r = c + 1;
32
+ } else {
33
+ const c = h.charCodeAt(0);
34
+ if (/[;{}\\@]/.test(h) || c <= 8 || c === 11 || c >= 14 && c <= 31 || c === 127)
35
+ return { syntax: f, safe: !1 };
36
+ if (h === "(" && o++, h === ")" && --o < 0) return { syntax: f, safe: !1 };
37
+ f += h;
38
+ }
39
+ }
40
+ return {
41
+ syntax: f,
42
+ safe: o === 0 && !/\b(?:url|(?:-webkit-)?image-set|image|cross-fade|element|paint|src)\s*\(/i.test(f) && !/!\s*important\b/i.test(f)
43
+ };
44
+ }
45
+ function D(l, f) {
46
+ const o = /* @__PURE__ */ new Map();
47
+ for (const r of l) {
48
+ const h = f(r), c = o.get(h) ?? [];
49
+ c.push(r), o.set(h, c);
50
+ }
51
+ return o;
52
+ }
53
+ function B(l, f = "light") {
54
+ const o = {
55
+ mode: f,
56
+ tabs: [],
57
+ rows: [],
58
+ declarations: /* @__PURE__ */ Object.create(null),
59
+ diagnostics: []
60
+ }, r = [], h = l.filter((e) => e.id !== "notes"), c = D(h, (e) => e.id);
61
+ function a(e, s, t, n = "error") {
62
+ const d = { code: s, severity: n, message: t, ...e ? { rowKey: e.row.key } : {} };
63
+ e?.row.diagnostics.some((i) => i.code === s && i.message === t) || (e?.row.diagnostics.push(d), o.diagnostics.push(d));
64
+ }
65
+ function m(e, s, t, n, d, i) {
66
+ s.rows.push(t), o.rows.push(t), r.push({ row: t, tab: e, tier: d, item: n, baseRole: i, dependencies: [], contextDependent: !1 });
67
+ }
68
+ h.forEach((e, s) => {
69
+ const t = { key: `tab-${s}`, id: e.id, label: e.label, tiers: [] };
70
+ o.tabs.push(t), e.tiers.forEach((i, w) => {
71
+ const y = {
72
+ key: `${t.key}-tier-${w}`,
73
+ id: i.id,
74
+ label: i.label,
75
+ palette: !i.semantic && !i.referencesTier && !i.referencesRamps?.length && i.items.length > 0 && i.items.every((u) => u.type.kind === "color"),
76
+ preview: i.preview,
77
+ previewBase: i.previewBase,
78
+ rows: []
79
+ };
80
+ t.tiers.push(y), i.items.forEach((u, V) => m(e, y, {
81
+ key: `${y.key}-item-${V}`,
82
+ tabId: e.id,
83
+ tierId: i.id,
84
+ itemId: u.id,
85
+ label: u.label,
86
+ cssVar: u.cssVar,
87
+ kind: u.type.kind,
88
+ source: "item",
89
+ defaultValue: u.default,
90
+ declaredValue: u.default,
91
+ cssValue: null,
92
+ resolvedValue: null,
93
+ references: [],
94
+ diagnostics: []
95
+ }, u, i));
96
+ });
97
+ const n = e.colorExtras;
98
+ if (!n) return;
99
+ const d = {
100
+ key: `${t.key}-base-roles`,
101
+ id: "base-roles",
102
+ label: "Base roles",
103
+ rows: []
104
+ };
105
+ for (const i of O) {
106
+ const w = n.baseRoles[i];
107
+ if (w === void 0) continue;
108
+ const y = n.baseDefaults[i];
109
+ m(e, d, {
110
+ key: `${d.key}-${i}`,
111
+ tabId: e.id,
112
+ tierId: d.id,
113
+ itemId: i,
114
+ label: i,
115
+ cssVar: w,
116
+ kind: "color",
117
+ source: "base-role",
118
+ defaultValue: y === void 0 ? "" : String(y),
119
+ declaredValue: y === void 0 ? "(no declared default)" : `palette[${y}]`,
120
+ cssValue: null,
121
+ resolvedValue: null,
122
+ references: [],
123
+ diagnostics: []
124
+ }, void 0, void 0, i);
125
+ }
126
+ d.rows.length > 0 && t.tiers.push(d);
127
+ });
128
+ const k = D(r, (e) => e.row.cssVar);
129
+ for (const e of r)
130
+ j.test(e.row.cssVar) || a(e, "invalid-variable", `Unsupported CSS custom property name: ${e.row.cssVar}.`), k.get(e.row.cssVar).length > 1 && a(e, "duplicate-variable", `Multiple declarations use ${e.row.cssVar}; none is selected.`), c.get(e.tab.id).length > 1 && a(e, "duplicate-tab", `Multiple tabs use the id ${e.tab.id}.`), e.tier && (e.tab.tiers.filter((s) => s.id === e.tier.id).length > 1 && a(e, "duplicate-tier", `Multiple tiers use the id ${e.tier.id} in tab ${e.tab.id}.`), e.tier.items.filter((s) => s.id === e.item.id).length > 1 && a(e, "duplicate-item", `Multiple items use the id ${e.item.id} in tier ${e.tier.id}.`));
131
+ function g(e, s) {
132
+ e.directReference = s, e.row.cssValue = `var(${s.row.cssVar})`;
133
+ }
134
+ function p(e, s, t, n) {
135
+ const d = c.get(s) ?? [];
136
+ if (d.length !== 1) {
137
+ a(e, d.length ? "ambiguous-reference" : "missing-reference", `Reference tab ${s} ${d.length ? "is ambiguous" : "does not exist"}.`);
138
+ return;
139
+ }
140
+ const i = d[0].tiers.filter((y) => y.id === t);
141
+ if (i.length !== 1) {
142
+ a(e, i.length ? "ambiguous-reference" : "missing-reference", `Reference tier ${s}/${t} ${i.length ? "is ambiguous" : "does not exist"}.`);
143
+ return;
144
+ }
145
+ const w = r.filter((y) => y.tab === d[0] && y.tier === i[0] && y.item?.id === n);
146
+ if (w.length !== 1) {
147
+ a(e, w.length ? "ambiguous-reference" : "missing-reference", `Reference item ${s}/${t}/${n} ${w.length ? "is ambiguous" : "does not exist"}.`);
148
+ return;
149
+ }
150
+ return w[0];
151
+ }
152
+ function b(e) {
153
+ return e.tab.tiers.filter((s) => !s.semantic && !s.referencesTier && s.items.length > 0 && s.items.every((t) => t.type.kind === "color"));
154
+ }
155
+ function z(e, s) {
156
+ const t = b(e), n = e.tier?.referencesTier ? t.filter((w) => w.id === e.tier.referencesTier) : t;
157
+ if (n.length !== 1) {
158
+ a(e, "unsupported-palette", `A palette index requires one unambiguous declared palette tier; found ${n.length}.`);
159
+ return;
160
+ }
161
+ if (!Number.isInteger(s) || s < 0 || s >= n[0].items.length) {
162
+ a(e, "invalid-palette-index", `Palette index ${s} is outside the declared palette.`);
163
+ return;
164
+ }
165
+ const d = n[0].items[s], i = p(e, e.tab.id, n[0].id, d.id);
166
+ i && g(e, i);
167
+ }
168
+ function x(e, s) {
169
+ const t = e.tab.colorExtras?.baseDefaults[s];
170
+ if (t === void 0) {
171
+ a(e, "missing-base-default", `Base role ${s} has no explicit baseDefaults mapping.`);
172
+ return;
173
+ }
174
+ z(e, t);
175
+ }
176
+ function $(e, s) {
177
+ if (typeof s == "number")
178
+ e.row.declaredValue = `palette[${s}]`, z(e, s);
179
+ else if (s === "bg" || s === "fg")
180
+ e.row.declaredValue = s, x(e, s === "bg" ? "background" : "foreground");
181
+ else if (typeof s == "object" && s !== null && "literal" in s) {
182
+ const t = typeof s.literal == "string" ? s.literal : s.literal[f];
183
+ e.row.declaredValue = t, e.row.cssValue = t;
184
+ } else if (typeof s == "object" && s !== null && "ref" in s) {
185
+ const { tab: t = e.tab.id, tier: n, item: d } = s.ref;
186
+ e.row.declaredValue = `${t}/${n}/${d}`;
187
+ const i = p(e, t, n, d);
188
+ i && g(e, i);
189
+ } else
190
+ a(e, "invalid-semantic-default", "Unsupported semantic default mapping.");
191
+ }
192
+ for (const e of r) {
193
+ if (e.baseRole) {
194
+ x(e, e.baseRole);
195
+ continue;
196
+ }
197
+ const s = e.tier, t = e.item, n = b(e), d = s.semantic || e.tab.colorExtras && n.some((u) => u.id === s.referencesTier), w = (s.referencesTier === void 0 ? n : n.filter((u) => u.id === s.referencesTier)).flatMap((u) => u.items.filter((V) => V.id === t.default).map(() => u)), y = e.tab.colorExtras?.semanticDefaults;
198
+ if (d && y && Object.hasOwn(y, t.id))
199
+ $(e, y[t.id]);
200
+ else if (d && w.length > 0)
201
+ if (w.length > 1)
202
+ a(e, "ambiguous-reference", `Default ${t.default} names multiple palette items.`);
203
+ else {
204
+ const u = p(e, e.tab.id, w[0].id, t.default);
205
+ u && g(e, u);
206
+ }
207
+ else if (d && (t.default === "bg" || t.default === "fg"))
208
+ x(e, t.default === "bg" ? "background" : "foreground");
209
+ else if (s.referencesTier !== void 0 && !(d && s.referencesRamps?.length) && !(s.semantic && C(t.default))) {
210
+ const u = p(e, e.tab.id, s.referencesTier, t.default);
211
+ u && g(e, u);
212
+ } else if (d)
213
+ if (s.referencesRamps?.length && !C(t.default)) {
214
+ const u = t.default.indexOf(":"), V = u === -1 ? [s.referencesRamps[0]] : s.referencesRamps.filter((R) => R.tier === t.default.slice(0, u));
215
+ if (V.length !== 1)
216
+ a(e, V.length ? "ambiguous-reference" : "missing-reference", `Ramp source for ${t.default} ${V.length ? "is ambiguous" : "does not exist"}.`);
217
+ else {
218
+ const R = p(e, V[0].tab ?? e.tab.id, V[0].tier, u === -1 ? t.default : t.default.slice(u + 1));
219
+ R && g(e, R);
220
+ }
221
+ } else
222
+ e.row.cssValue = t.default;
223
+ else
224
+ e.row.cssValue = t.default;
225
+ }
226
+ for (const e of r) {
227
+ const s = e.row.cssValue;
228
+ if (s === null) continue;
229
+ const t = A(s);
230
+ if (!t.safe) {
231
+ a(e, "unsafe-css", "This declaration contains unsupported CSS syntax or a resource-loading function; preview omitted.");
232
+ continue;
233
+ }
234
+ e.directReference && e.dependencies.push(e.directReference);
235
+ for (const n of t.syntax.matchAll(/\bvar\(\s*(--[\w\u0080-\uffff-]+)\s*(?=[,)])/giu)) {
236
+ const d = k.get(n[1]) ?? [];
237
+ d.length > 1 ? a(e, "ambiguous-reference", `CSS reference ${n[1]} has multiple declarations.`) : d.length === 1 ? e.dependencies.push(d[0]) : (e.contextDependent = !0, a(e, "external-reference", `CSS reference ${n[1]} is not in this inventory; its value depends on the host context or fallback.`, "warning"));
238
+ }
239
+ e.dependencies = [...new Set(e.dependencies)], e.row.references = e.dependencies.map(({ row: n }) => ({ key: n.key, cssVar: n.cssVar, label: n.label })), /(?:^|[^\w-])(?:currentcolor|initial|inherit|unset|revert|revert-layer)(?=$|[^\w-])|\b(?:env|attr)\s*\(/i.test(t.syntax) && (e.contextDependent = !0, a(e, "context-dependent", "This CSS value depends on the surrounding document; no computed preview is claimed.", "warning"));
240
+ }
241
+ const N = /* @__PURE__ */ new Set(), S = [];
242
+ function T(e) {
243
+ if (N.has(e)) return;
244
+ const s = S.indexOf(e);
245
+ if (s !== -1) {
246
+ for (const t of S.slice(s)) a(t, "cyclic-reference", "Declared references form a cycle.");
247
+ return;
248
+ }
249
+ S.push(e);
250
+ for (const t of e.dependencies)
251
+ T(t), t.row.diagnostics.some((n) => n.severity === "error") ? a(e, "invalid-reference", `Referenced declaration ${t.row.cssVar} is invalid.`) : t.contextDependent && (e.contextDependent = !0, a(e, "context-dependent", `Referenced declaration ${t.row.cssVar} depends on the host context.`, "warning"));
252
+ S.pop(), N.add(e), e.row.diagnostics.some((t) => t.severity === "error") ? e.row.cssValue = null : e.contextDependent || (e.row.resolvedValue = e.directReference?.row.resolvedValue ?? e.row.cssValue);
253
+ }
254
+ for (const e of r) T(e);
255
+ return o.declarations = Object.fromEntries(r.filter((e) => e.row.cssValue !== null).map((e) => [e.row.cssVar, e.row.cssValue])), o;
256
+ }
257
+ function L(l, f, o) {
258
+ return o?.[l.cssVar] ?? f.preview ?? (l.kind === "color" ? "color" : "text");
259
+ }
260
+ const M = `Good typography gives every idea room to breathe. Compare the rhythm of several lines, the shapes of letters, and the distance between words. A token becomes useful when you can see it in context.
261
+
262
+ 読みやすさは、文字の大きさだけでは決まりません。行間と余白を比べて、心地よいリズムを探しましょう。0123456789`;
263
+ function E(l) {
264
+ return ["size", "family", "weight", "line-height"].includes(l);
265
+ }
266
+ function I(l, f) {
267
+ const o = /* @__PURE__ */ new Set();
268
+ let r = l;
269
+ for (; r.cssValue !== null && r.resolvedValue !== null && !o.has(r.key); ) {
270
+ o.add(r.key);
271
+ const h = r.resolvedValue.trim();
272
+ if (/^(?:0|\+?(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem))$/i.test(h)) return h;
273
+ const c = /^var\(\s*(--[a-zA-Z0-9_-]+)\s*\)$/.exec(h);
274
+ if (!c) return null;
275
+ const a = f.rows.filter((m) => m.cssVar === c[1]);
276
+ if (a.length !== 1) return null;
277
+ r = a[0];
278
+ }
279
+ return null;
280
+ }
281
+ function P({ row: l, tier: f, kind: o, model: r, previewText: h }) {
282
+ if (o === "bar") {
283
+ const g = I(l, r);
284
+ return g === null ? /* @__PURE__ */ v("div", { className: "zdtp-dashboard__preview-unavailable", children: "Ruler unavailable: requires a nonnegative px/rem length or a resolved direct alias." }) : /* @__PURE__ */ _("div", { className: "zdtp-dashboard__ruler-wrap", children: [
285
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__ruler-caption", children: "Actual size · ticks every 8 CSS px · major ticks every 64 CSS px" }),
286
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__scroll zdtp-dashboard__ruler-scroll", role: "region", tabIndex: 0, "aria-label": `${l.label} (${l.cssVar}) actual-size ruler`, children: /* @__PURE__ */ _("div", { className: "zdtp-dashboard__ruler", style: { inlineSize: `max(100%, ${g})` }, children: [
287
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__ruler-origin", children: "0" }),
288
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__specimen", style: { colorScheme: r.mode }, children: /* @__PURE__ */ v("span", { className: "zdtp-dashboard__sample zdtp-dashboard__sample--bar", style: { inlineSize: g }, "aria-hidden": "true" }) })
289
+ ] }) })
290
+ ] });
291
+ }
292
+ if (l.cssValue === null || l.resolvedValue === null || o === "text" || o === "duration") return null;
293
+ const c = l.resolvedValue.trim().toLowerCase();
294
+ if (!c || (o === "radius" || o === "size") && (/^(?:auto|none|normal|(?:min|max)-content|stretch|content)$|^fit-content(?:\(|$)/.test(c) || /^[+-]?(?:\d*\.)?\d+(?:ms|s)$/.test(c) || /^[+-]?(?:\d*\.)?\d+$/.test(c) && Number(c) !== 0))
295
+ return null;
296
+ const a = l.cssValue;
297
+ let m;
298
+ switch (o) {
299
+ case "color":
300
+ m = { backgroundColor: a };
301
+ break;
302
+ case "radius":
303
+ m = { borderRadius: a };
304
+ break;
305
+ case "shadow":
306
+ m = { boxShadow: a };
307
+ break;
308
+ case "size":
309
+ m = { fontSize: a };
310
+ break;
311
+ case "family":
312
+ m = { fontFamily: a };
313
+ break;
314
+ case "weight":
315
+ m = { fontWeight: a };
316
+ break;
317
+ case "line-height": {
318
+ const g = r.rows.find((p) => p.cssVar === f.previewBase);
319
+ m = { lineHeight: a, ...g?.cssValue !== null && g?.resolvedValue != null ? { fontSize: `var(${g.cssVar})` } : {} };
320
+ break;
321
+ }
322
+ }
323
+ const k = E(o);
324
+ return /* @__PURE__ */ v(
325
+ "div",
326
+ {
327
+ className: `zdtp-dashboard__preview zdtp-dashboard__preview--${o}${k ? " zdtp-dashboard__preview--typography zdtp-dashboard__scroll" : ""}`,
328
+ "aria-hidden": k ? void 0 : "true",
329
+ role: k ? "region" : void 0,
330
+ tabIndex: k ? 0 : void 0,
331
+ "aria-label": k ? `${l.label} (${l.cssVar}) typography specimen` : void 0,
332
+ children: /* @__PURE__ */ v("div", { className: "zdtp-dashboard__specimen", style: { colorScheme: r.mode }, children: /* @__PURE__ */ v("span", { className: `zdtp-dashboard__sample zdtp-dashboard__sample--${o}`, style: m, children: k ? h : "" }) })
333
+ }
334
+ );
335
+ }
336
+ function W({
337
+ tabs: l,
338
+ mode: f = "light",
339
+ chrome: o = "light",
340
+ title: r = "Token dashboard",
341
+ id: h,
342
+ previewOverrides: c,
343
+ previewText: a = M
344
+ }) {
345
+ const m = B(l, f), k = m.rows.filter((g) => g.diagnostics.length > 0).length;
346
+ return /* @__PURE__ */ _("div", { id: h, className: "zdtp-dashboard", role: "region", "aria-label": r, "data-mode": f, "data-chrome": o, children: [
347
+ /* @__PURE__ */ _("div", { className: "zdtp-dashboard__header", children: [
348
+ /* @__PURE__ */ v("div", { role: "heading", "aria-level": 2, className: "zdtp-dashboard__title", children: r }),
349
+ /* @__PURE__ */ _("div", { className: "zdtp-dashboard__summary", children: [
350
+ /* @__PURE__ */ _("span", { className: "zdtp-dashboard__count", children: [
351
+ m.rows.length,
352
+ " tokens"
353
+ ] }),
354
+ /* @__PURE__ */ _("span", { children: [
355
+ "Declared defaults · ",
356
+ f,
357
+ " mode"
358
+ ] }),
359
+ k > 0 && /* @__PURE__ */ _("span", { children: [
360
+ k,
361
+ " with diagnostics"
362
+ ] })
363
+ ] })
364
+ ] }),
365
+ /* @__PURE__ */ _("div", { className: "zdtp-dashboard__inventory", style: m.declarations, children: [
366
+ m.rows.length === 0 && /* @__PURE__ */ v("div", { className: "zdtp-dashboard__empty", children: "No tokens declared." }),
367
+ m.tabs.map((g) => /* @__PURE__ */ _("div", { className: "zdtp-dashboard__tab", role: "group", "aria-label": g.label, children: [
368
+ /* @__PURE__ */ _("div", { className: "zdtp-dashboard__tab-header", children: [
369
+ /* @__PURE__ */ v("div", { role: "heading", "aria-level": 3, className: "zdtp-dashboard__tab-title", children: g.label }),
370
+ /* @__PURE__ */ _("span", { className: "zdtp-dashboard__tab-count", children: [
371
+ g.tiers.reduce((p, b) => p + b.rows.length, 0),
372
+ " tokens"
373
+ ] })
374
+ ] }),
375
+ g.tiers.map((p) => /* @__PURE__ */ _("div", { className: "zdtp-dashboard__tier", children: [
376
+ /* @__PURE__ */ v("div", { role: "heading", "aria-level": 4, className: "zdtp-dashboard__tier-title", children: p.label }),
377
+ /* @__PURE__ */ v("div", { className: p.palette ? "zdtp-dashboard__scroll zdtp-dashboard__palette-scroll" : void 0, role: p.palette ? "region" : void 0, tabIndex: p.palette ? 0 : void 0, "aria-label": p.palette ? `${p.label} palette stops` : void 0, children: /* @__PURE__ */ v("div", { className: `zdtp-dashboard__grid${p.palette ? " zdtp-dashboard__palette" : ""}`, role: "list", "aria-label": p.label, children: p.rows.map((b) => {
378
+ const z = L(b, p, c), x = !p.palette && (z === "bar" || E(z));
379
+ return /* @__PURE__ */ _("div", { className: `zdtp-dashboard__token${x ? " zdtp-dashboard__token--wide" : ""}`, role: "listitem", "data-css-var": b.cssVar, children: [
380
+ /* @__PURE__ */ v(P, { row: b, tier: p, kind: z, model: m, previewText: a }),
381
+ /* @__PURE__ */ _("div", { className: "zdtp-dashboard__token-content", children: [
382
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__name", children: b.label }),
383
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__variable", children: b.cssVar }),
384
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__value", children: b.declaredValue || "(empty)" }),
385
+ b.cssValue !== null && b.cssValue !== b.declaredValue && /* @__PURE__ */ _("div", { className: "zdtp-dashboard__reference", children: [
386
+ "CSS: ",
387
+ b.cssValue
388
+ ] }),
389
+ b.references.length > 0 && /* @__PURE__ */ _("div", { className: "zdtp-dashboard__reference", children: [
390
+ "References: ",
391
+ b.references.map(($) => $.cssVar).join(", ")
392
+ ] }),
393
+ b.diagnostics.map(($, N) => /* @__PURE__ */ _("div", { className: "zdtp-dashboard__diagnostic", "data-diagnostic": $.code, children: [
394
+ $.severity === "error" ? "Unavailable" : "Context needed",
395
+ ": ",
396
+ $.message
397
+ ] }, N))
398
+ ] })
399
+ ] }, b.key);
400
+ }) }) })
401
+ ] }, p.key))
402
+ ] }, g.key))
403
+ ] })
404
+ ] });
405
+ }
406
+ export {
407
+ W as TokenDashboard
408
+ };
@@ -0,0 +1,7 @@
1
+ import type { TabConfig } from "../tokens/tier-model.js";
2
+ import type { DashboardMode, DashboardModel } from "./types.js";
3
+ /**
4
+ * Normalize the authored inventory for a static dashboard. Named color schemes,
5
+ * stored changes, editor fallback values and pill.customDefault are not inputs.
6
+ */
7
+ export declare function buildDashboardModel(tabs: readonly TabConfig[], mode?: DashboardMode): DashboardModel;