@takazudo/zdtp 0.7.0 → 0.8.1

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.
@@ -1,408 +1,456 @@
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());
1
+ import { jsxs as v, jsx as m } from "preact/jsx-runtime";
2
+ import { r as P } from "../mode-dependence-Ci9avNt8.js";
3
+ import { i as re, s as ae } from "../mode-dependence-Ci9avNt8.js";
4
+ const U = 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(" "));
5
+ function A(r) {
6
+ return r.startsWith("#") || r.includes("(") || U.has(r.toLowerCase());
5
7
  }
6
- const O = [
8
+ const W = [
7
9
  "background",
8
10
  "foreground",
9
11
  "cursor",
10
12
  "selectionBg",
11
13
  "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;
14
+ ], F = /^--[\w\u0080-\uffff-]+$/u;
15
+ function G(r) {
16
+ let f = "", i = 0;
17
+ for (let a = 0; a < r.length; a++) {
18
+ const d = r[a];
19
+ if (d === '"' || d === "'") {
20
+ const o = d;
21
+ let w = !1;
22
+ for (a++; a < r.length; a++)
23
+ if (r[a] === "\\") a++;
24
+ else if (r[a] === o) {
25
+ w = !0;
24
26
  break;
25
- } else if (/[\n\r\f]/.test(l[r])) return { syntax: f, safe: !1 };
26
- if (!a) return { syntax: f, safe: !1 };
27
+ } else if (/[\n\r\f]/.test(r[a])) return { syntax: f, safe: !1 };
28
+ if (!w) return { syntax: f, safe: !1 };
27
29
  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;
30
+ } else if (d === "/" && r[a + 1] === "*") {
31
+ const o = r.indexOf("*/", a + 2);
32
+ if (o === -1) return { syntax: f, safe: !1 };
33
+ f += " ", a = o + 1;
32
34
  } else {
33
- const c = h.charCodeAt(0);
34
- if (/[;{}\\@]/.test(h) || c <= 8 || c === 11 || c >= 14 && c <= 31 || c === 127)
35
+ const o = d.charCodeAt(0);
36
+ if (/[;{}\\@]/.test(d) || o <= 8 || o === 11 || o >= 14 && o <= 31 || o === 127)
35
37
  return { syntax: f, safe: !1 };
36
- if (h === "(" && o++, h === ")" && --o < 0) return { syntax: f, safe: !1 };
37
- f += h;
38
+ if (d === "(" && i++, d === ")" && --i < 0) return { syntax: f, safe: !1 };
39
+ f += d;
38
40
  }
39
41
  }
40
42
  return {
41
43
  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)
44
+ safe: i === 0 && !/\b(?:url|(?:-webkit-)?image-set|image|cross-fade|element|paint|src)\s*\(/i.test(f) && !/!\s*important\b/i.test(f)
43
45
  };
44
46
  }
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);
47
+ function L(r, f) {
48
+ const i = /* @__PURE__ */ new Map();
49
+ for (const a of r) {
50
+ const d = f(a), o = i.get(d) ?? [];
51
+ o.push(a), i.set(d, o);
50
52
  }
51
- return o;
53
+ return i;
52
54
  }
53
- function B(l, f = "light") {
54
- const o = {
55
- mode: f,
55
+ function K(r, f = {}) {
56
+ const { mode: i = "light", include: a = "all" } = typeof f == "string" ? { mode: f } : f, d = {
57
+ mode: i,
58
+ include: a,
56
59
  tabs: [],
57
60
  rows: [],
58
61
  declarations: /* @__PURE__ */ Object.create(null),
59
62
  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));
63
+ }, o = [], w = r.filter((e) => e.id !== "notes"), z = L(w, (e) => e.id);
64
+ function n(e, t, s, c = "error") {
65
+ const u = { code: t, severity: c, message: s, ...e ? { rowKey: e.row.key } : {} };
66
+ e?.row.diagnostics.some((l) => l.code === t && l.message === s) || (e?.row.diagnostics.push(u), d.diagnostics.push(u));
64
67
  }
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 });
68
+ function _(e, t, s, c, u, l) {
69
+ t.rows.push(s), d.rows.push(s), o.push({ row: s, tab: e, tier: u, item: c, baseRole: l, dependencies: [], contextDependent: !1 });
67
70
  }
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,
71
+ w.forEach((e, t) => {
72
+ const s = { key: `tab-${t}`, id: e.id, label: e.label, tiers: [] };
73
+ d.tabs.push(s), e.tiers.forEach((l, V) => {
74
+ const h = {
75
+ key: `${s.key}-tier-${V}`,
76
+ id: l.id,
77
+ label: l.label,
78
+ palette: !l.semantic && !l.referencesTier && !l.referencesRamps?.length && l.items.length > 0 && l.items.every(($) => $.type.kind === "color"),
79
+ preview: l.preview,
80
+ previewBase: l.previewBase,
78
81
  rows: []
79
82
  };
80
- t.tiers.push(y), i.items.forEach((u, V) => m(e, y, {
81
- key: `${y.key}-item-${V}`,
83
+ s.tiers.push(h), l.items.forEach(($, C) => _(e, h, {
84
+ key: `${h.key}-item-${C}`,
82
85
  tabId: e.id,
83
- tierId: i.id,
84
- itemId: u.id,
85
- label: u.label,
86
- cssVar: u.cssVar,
87
- kind: u.type.kind,
86
+ tierId: l.id,
87
+ itemId: $.id,
88
+ label: $.label,
89
+ cssVar: $.cssVar,
90
+ kind: $.type.kind,
88
91
  source: "item",
89
- defaultValue: u.default,
90
- declaredValue: u.default,
92
+ defaultValue: $.default,
93
+ declaredValue: $.default,
94
+ modeDependent: !1,
95
+ sides: null,
96
+ origin: null,
91
97
  cssValue: null,
92
98
  resolvedValue: null,
93
99
  references: [],
94
100
  diagnostics: []
95
- }, u, i));
101
+ }, $, l));
96
102
  });
97
- const n = e.colorExtras;
98
- if (!n) return;
99
- const d = {
100
- key: `${t.key}-base-roles`,
103
+ const c = e.colorExtras;
104
+ if (!c) return;
105
+ const u = {
106
+ key: `${s.key}-base-roles`,
101
107
  id: "base-roles",
102
108
  label: "Base roles",
103
109
  rows: []
104
110
  };
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
+ for (const l of W) {
112
+ const V = c.baseRoles[l];
113
+ if (V === void 0) continue;
114
+ const h = c.baseDefaults[l];
115
+ _(e, u, {
116
+ key: `${u.key}-${l}`,
111
117
  tabId: e.id,
112
- tierId: d.id,
113
- itemId: i,
114
- label: i,
115
- cssVar: w,
118
+ tierId: u.id,
119
+ itemId: l,
120
+ label: l,
121
+ cssVar: V,
116
122
  kind: "color",
117
123
  source: "base-role",
118
- defaultValue: y === void 0 ? "" : String(y),
119
- declaredValue: y === void 0 ? "(no declared default)" : `palette[${y}]`,
124
+ modeDependent: !1,
125
+ sides: null,
126
+ origin: null,
127
+ defaultValue: h === void 0 ? "" : String(h),
128
+ declaredValue: h === void 0 ? "(no declared default)" : `palette[${h}]`,
120
129
  cssValue: null,
121
130
  resolvedValue: null,
122
131
  references: [],
123
132
  diagnostics: []
124
- }, void 0, void 0, i);
133
+ }, void 0, void 0, l);
125
134
  }
126
- d.rows.length > 0 && t.tiers.push(d);
135
+ u.rows.length > 0 && s.tiers.push(u);
127
136
  });
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})`;
137
+ const x = L(o, (e) => e.row.cssVar);
138
+ for (const e of o)
139
+ F.test(e.row.cssVar) || n(e, "invalid-variable", `Unsupported CSS custom property name: ${e.row.cssVar}.`), x.get(e.row.cssVar).length > 1 && n(e, "duplicate-variable", `Multiple declarations use ${e.row.cssVar}; none is selected.`), z.get(e.tab.id).length > 1 && n(e, "duplicate-tab", `Multiple tabs use the id ${e.tab.id}.`), e.tier && (e.tab.tiers.filter((t) => t.id === e.tier.id).length > 1 && n(e, "duplicate-tier", `Multiple tiers use the id ${e.tier.id} in tab ${e.tab.id}.`), e.tier.items.filter((t) => t.id === e.item.id).length > 1 && n(e, "duplicate-item", `Multiple items use the id ${e.item.id} in tier ${e.tier.id}.`));
140
+ function k(e, t) {
141
+ e.directReference = t, e.row.cssValue = `var(${t.row.cssVar})`;
133
142
  }
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"}.`);
143
+ function g(e, t, s, c) {
144
+ const u = z.get(t) ?? [];
145
+ if (u.length !== 1) {
146
+ n(e, u.length ? "ambiguous-reference" : "missing-reference", `Reference tab ${t} ${u.length ? "is ambiguous" : "does not exist"}.`);
138
147
  return;
139
148
  }
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"}.`);
149
+ const l = u[0].tiers.filter((h) => h.id === s);
150
+ if (l.length !== 1) {
151
+ n(e, l.length ? "ambiguous-reference" : "missing-reference", `Reference tier ${t}/${s} ${l.length ? "is ambiguous" : "does not exist"}.`);
143
152
  return;
144
153
  }
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"}.`);
154
+ const V = o.filter((h) => h.tab === u[0] && h.tier === l[0] && h.item?.id === c);
155
+ if (V.length !== 1) {
156
+ n(e, V.length ? "ambiguous-reference" : "missing-reference", `Reference item ${t}/${s}/${c} ${V.length ? "is ambiguous" : "does not exist"}.`);
148
157
  return;
149
158
  }
150
- return w[0];
159
+ return V[0];
151
160
  }
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"));
161
+ function N(e) {
162
+ return e.tab.tiers.filter((t) => !t.semantic && !t.referencesTier && t.items.length > 0 && t.items.every((s) => s.type.kind === "color"));
154
163
  }
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}.`);
164
+ function b(e, t) {
165
+ const s = N(e), c = e.tier?.referencesTier ? s.filter((V) => V.id === e.tier.referencesTier) : s;
166
+ if (c.length !== 1) {
167
+ n(e, "unsupported-palette", `A palette index requires one unambiguous declared palette tier; found ${c.length}.`);
159
168
  return;
160
169
  }
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.`);
170
+ if (!Number.isInteger(t) || t < 0 || t >= c[0].items.length) {
171
+ n(e, "invalid-palette-index", `Palette index ${t} is outside the declared palette.`);
163
172
  return;
164
173
  }
165
- const d = n[0].items[s], i = p(e, e.tab.id, n[0].id, d.id);
166
- i && g(e, i);
174
+ const u = c[0].items[t], l = g(e, e.tab.id, c[0].id, u.id);
175
+ l && k(e, l);
167
176
  }
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.`);
177
+ function p(e, t) {
178
+ const s = e.tab.colorExtras?.baseDefaults[t];
179
+ if (s === void 0) {
180
+ n(e, "missing-base-default", `Base role ${t} has no explicit baseDefaults mapping.`);
172
181
  return;
173
182
  }
174
- z(e, t);
183
+ b(e, s);
175
184
  }
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);
185
+ function D(e) {
186
+ return i === "host" ? `light-dark(${e.light}, ${e.dark})` : e[i];
187
+ }
188
+ function O(e, t) {
189
+ if (typeof t == "number")
190
+ e.row.declaredValue = `palette[${t}]`, b(e, t);
191
+ else if (t === "bg" || t === "fg")
192
+ e.row.declaredValue = t, p(e, t === "bg" ? "background" : "foreground");
193
+ else if (typeof t == "object" && t !== null && "literal" in t) {
194
+ const s = typeof t.literal == "string" ? t.literal : D(t.literal);
195
+ e.row.declaredValue = s, e.row.cssValue = s;
196
+ } else if (typeof t == "object" && t !== null && "ref" in t) {
197
+ const { tab: s = e.tab.id, tier: c, item: u } = t.ref;
198
+ e.row.declaredValue = `${s}/${c}/${u}`;
199
+ const l = g(e, s, c, u);
200
+ l && k(e, l);
189
201
  } else
190
- a(e, "invalid-semantic-default", "Unsupported semantic default mapping.");
202
+ n(e, "invalid-semantic-default", "Unsupported semantic default mapping.");
191
203
  }
192
- for (const e of r) {
204
+ for (const e of o) {
193
205
  if (e.baseRole) {
194
- x(e, e.baseRole);
206
+ p(e, e.baseRole);
195
207
  continue;
196
208
  }
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.`);
209
+ const t = e.tier, s = e.item, c = N(e), u = t.semantic || e.tab.colorExtras && c.some((y) => y.id === t.referencesTier), V = (t.referencesTier === void 0 ? c : c.filter((y) => y.id === t.referencesTier)).flatMap((y) => y.items.filter((R) => R.id === s.default).map(() => y)), h = e.tab.colorExtras?.semanticDefaults, $ = u && h && Object.hasOwn(h, s.id) ? h[s.id] : void 0, C = P(s, $);
210
+ if (C !== null)
211
+ e.row.modeDependent = !0, e.row.sides = C, e.row.origin = s.modes !== void 0 ? "modes" : typeof $ == "object" && $ !== null && "literal" in $ && typeof $.literal != "string" ? "semantic" : "default", e.row.declaredValue = D(C), e.row.cssValue = e.row.declaredValue;
212
+ else if (u && h && Object.hasOwn(h, s.id))
213
+ O(e, h[s.id]);
214
+ else if (u && V.length > 0)
215
+ if (V.length > 1)
216
+ n(e, "ambiguous-reference", `Default ${s.default} names multiple palette items.`);
203
217
  else {
204
- const u = p(e, e.tab.id, w[0].id, t.default);
205
- u && g(e, u);
218
+ const y = g(e, e.tab.id, V[0].id, s.default);
219
+ y && k(e, y);
206
220
  }
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"}.`);
221
+ else if (u && (s.default === "bg" || s.default === "fg"))
222
+ p(e, s.default === "bg" ? "background" : "foreground");
223
+ else if (t.referencesTier !== void 0 && !(u && t.referencesRamps?.length) && !(t.semantic && A(s.default))) {
224
+ const y = g(e, e.tab.id, t.referencesTier, s.default);
225
+ y && k(e, y);
226
+ } else if (u)
227
+ if (t.referencesRamps?.length && !A(s.default)) {
228
+ const y = s.default.indexOf(":"), R = y === -1 ? [t.referencesRamps[0]] : t.referencesRamps.filter((M) => M.tier === s.default.slice(0, y));
229
+ if (R.length !== 1)
230
+ n(e, R.length ? "ambiguous-reference" : "missing-reference", `Ramp source for ${s.default} ${R.length ? "is ambiguous" : "does not exist"}.`);
217
231
  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);
232
+ const M = g(e, R[0].tab ?? e.tab.id, R[0].tier, y === -1 ? s.default : s.default.slice(y + 1));
233
+ M && k(e, M);
220
234
  }
221
235
  } else
222
- e.row.cssValue = t.default;
236
+ e.row.cssValue = s.default;
223
237
  else
224
- e.row.cssValue = t.default;
238
+ e.row.cssValue = s.default;
225
239
  }
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.");
240
+ for (const e of o) {
241
+ const t = e.row.cssValue;
242
+ if (t === null) continue;
243
+ const s = G(t);
244
+ if (!s.safe) {
245
+ n(e, "unsafe-css", "This declaration contains unsupported CSS syntax or a resource-loading function; preview omitted.");
232
246
  continue;
233
247
  }
234
248
  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"));
249
+ for (const c of s.syntax.matchAll(/\bvar\(\s*(--[\w\u0080-\uffff-]+)\s*(?=[,)])/giu)) {
250
+ const u = x.get(c[1]) ?? [];
251
+ u.length > 1 ? n(e, "ambiguous-reference", `CSS reference ${c[1]} has multiple declarations.`) : u.length === 1 ? e.dependencies.push(u[0]) : (e.contextDependent = !0, n(e, "external-reference", `CSS reference ${c[1]} is not in this inventory; its value depends on the host context or fallback.`, "warning"));
238
252
  }
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"));
253
+ e.dependencies = [...new Set(e.dependencies)], e.row.references = e.dependencies.map(({ row: c }) => ({ key: c.key, cssVar: c.cssVar, label: c.label })), /(?:^|[^\w-])(?:currentcolor|initial|inherit|unset|revert|revert-layer)(?=$|[^\w-])|\b(?:env|attr)\s*\(/i.test(s.syntax) && (e.contextDependent = !0, n(e, "context-dependent", "This CSS value depends on the surrounding document; no computed preview is claimed.", "warning"));
240
254
  }
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.");
255
+ const S = /* @__PURE__ */ new Map();
256
+ for (const e of o)
257
+ for (const t of e.dependencies) {
258
+ const s = S.get(t) ?? [];
259
+ s.push(e), S.set(t, s);
260
+ }
261
+ const T = o.filter((e) => e.row.modeDependent);
262
+ for (let e = 0; e < T.length; e++)
263
+ for (const t of S.get(T[e]) ?? [])
264
+ t.row.modeDependent || (t.row.modeDependent = !0, t.row.origin = "reference", T.push(t));
265
+ const j = /* @__PURE__ */ new Set(), E = [];
266
+ function q(e) {
267
+ if (j.has(e)) return;
268
+ const t = E.indexOf(e);
269
+ if (t !== -1) {
270
+ for (const s of E.slice(t)) n(s, "cyclic-reference", "Declared references form a cycle.");
247
271
  return;
248
272
  }
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);
273
+ E.push(e);
274
+ for (const s of e.dependencies)
275
+ q(s), s.row.diagnostics.some((c) => c.severity === "error") ? n(e, "invalid-reference", `Referenced declaration ${s.row.cssVar} is invalid.`) : s.contextDependent && (e.contextDependent = !0, n(e, "context-dependent", `Referenced declaration ${s.row.cssVar} depends on the host context.`, "warning"));
276
+ E.pop(), j.add(e), e.row.diagnostics.some((s) => s.severity === "error") ? e.row.cssValue = null : !e.contextDependent && !(i === "host" && e.row.modeDependent) && (e.row.resolvedValue = e.directReference?.row.resolvedValue ?? e.row.cssValue);
277
+ }
278
+ for (const e of o) q(e);
279
+ d.declarations = Object.fromEntries(o.filter((e) => e.row.cssValue !== null).map((e) => [e.row.cssVar, e.row.cssValue]));
280
+ for (const e of d.tabs) {
281
+ for (const t of e.tiers)
282
+ t.rows = t.rows.filter((s) => a === "all" || s.modeDependent === (a === "mode-dependent"));
283
+ e.tiers = e.tiers.filter((t) => t.rows.length > 0);
253
284
  }
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;
285
+ return d.tabs = d.tabs.filter((e) => e.tiers.length > 0), d;
256
286
  }
257
- function L(l, f, o) {
258
- return o?.[l.cssVar] ?? f.preview ?? (l.kind === "color" ? "color" : "text");
287
+ function H(r, f, i) {
288
+ return i?.[r.cssVar] ?? f.preview ?? (r.kind === "color" ? "color" : "text");
259
289
  }
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.
290
+ const X = `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
291
 
262
292
  読みやすさは、文字の大きさだけでは決まりません。行間と余白を比べて、心地よいリズムを探しましょう。0123456789`;
263
- function E(l) {
264
- return ["size", "family", "weight", "line-height"].includes(l);
293
+ function I(r) {
294
+ return ["size", "family", "weight", "line-height"].includes(r);
295
+ }
296
+ function B(r, f) {
297
+ return r.flatMap((i) => {
298
+ const a = i.tiers.flatMap((d) => {
299
+ const o = d.rows.filter((w) => w.modeDependent === f);
300
+ return o.length > 0 ? [{ ...d, rows: o }] : [];
301
+ });
302
+ return a.length > 0 ? [{ ...i, tiers: a }] : [];
303
+ });
265
304
  }
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];
305
+ function Y(r, f) {
306
+ const i = /* @__PURE__ */ new Set();
307
+ let a = r;
308
+ for (; a.cssValue !== null && a.resolvedValue !== null && !i.has(a.key); ) {
309
+ i.add(a.key);
310
+ const d = a.resolvedValue.trim();
311
+ if (/^(?:0|\+?(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem))$/i.test(d)) return d;
312
+ const o = /^var\(\s*(--[a-zA-Z0-9_-]+)\s*\)$/.exec(d);
313
+ if (!o) return null;
314
+ const w = f.rows.filter((z) => z.cssVar === o[1]);
315
+ if (w.length !== 1) return null;
316
+ a = w[0];
278
317
  }
279
318
  return null;
280
319
  }
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" }) })
320
+ function Z({ row: r, tier: f, kind: i, model: a, previewText: d, colorScheme: o }) {
321
+ if (i === "bar") {
322
+ const k = Y(r, a);
323
+ return k === null ? /* @__PURE__ */ m("div", { className: "zdtp-dashboard__preview-unavailable", children: "Ruler unavailable: requires a nonnegative px/rem length or a resolved direct alias." }) : /* @__PURE__ */ v("div", { className: "zdtp-dashboard__ruler-wrap", children: [
324
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__ruler-caption", children: "Actual size · ticks every 8 CSS px · major ticks every 64 CSS px" }),
325
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__scroll zdtp-dashboard__ruler-scroll", role: "region", tabIndex: 0, "aria-label": `${r.label} (${r.cssVar}) actual-size ruler`, children: /* @__PURE__ */ v("div", { className: "zdtp-dashboard__ruler", style: { inlineSize: `max(100%, ${k})` }, children: [
326
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__ruler-origin", children: "0" }),
327
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__specimen", style: { colorScheme: o }, children: /* @__PURE__ */ m("span", { className: "zdtp-dashboard__sample zdtp-dashboard__sample--bar", style: { inlineSize: k }, "aria-hidden": "true" }) })
289
328
  ] }) })
290
329
  ] });
291
330
  }
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))
331
+ const w = r.resolvedValue ?? (a.mode === "host" && r.modeDependent && i === "color" && r.diagnostics.length === 0 ? r.cssValue : null);
332
+ if (r.cssValue === null || w === null || i === "text" || i === "duration") return null;
333
+ const z = w.trim().toLowerCase();
334
+ if (!z || (i === "radius" || i === "size") && (/^(?:auto|none|normal|(?:min|max)-content|stretch|content)$|^fit-content(?:\(|$)/.test(z) || /^[+-]?(?:\d*\.)?\d+(?:ms|s)$/.test(z) || /^[+-]?(?:\d*\.)?\d+$/.test(z) && Number(z) !== 0))
295
335
  return null;
296
- const a = l.cssValue;
297
- let m;
298
- switch (o) {
336
+ const n = r.cssValue;
337
+ let _;
338
+ switch (i) {
299
339
  case "color":
300
- m = { backgroundColor: a };
340
+ _ = { backgroundColor: n };
301
341
  break;
302
342
  case "radius":
303
- m = { borderRadius: a };
343
+ _ = { borderRadius: n };
304
344
  break;
305
345
  case "shadow":
306
- m = { boxShadow: a };
346
+ _ = { boxShadow: n };
307
347
  break;
308
348
  case "size":
309
- m = { fontSize: a };
349
+ _ = { fontSize: n };
310
350
  break;
311
351
  case "family":
312
- m = { fontFamily: a };
352
+ _ = { fontFamily: n };
313
353
  break;
314
354
  case "weight":
315
- m = { fontWeight: a };
355
+ _ = { fontWeight: n };
316
356
  break;
317
357
  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})` } : {} };
358
+ const k = a.rows.find((g) => g.cssVar === f.previewBase);
359
+ _ = { lineHeight: n, ...k?.cssValue !== null && k?.resolvedValue != null ? { fontSize: `var(${k.cssVar})` } : {} };
320
360
  break;
321
361
  }
322
362
  }
323
- const k = E(o);
324
- return /* @__PURE__ */ v(
363
+ const x = I(i);
364
+ return /* @__PURE__ */ m(
325
365
  "div",
326
366
  {
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 : "" }) })
367
+ className: `zdtp-dashboard__preview zdtp-dashboard__preview--${i}${x ? " zdtp-dashboard__preview--typography zdtp-dashboard__scroll" : ""}`,
368
+ "aria-hidden": x ? void 0 : "true",
369
+ role: x ? "region" : void 0,
370
+ tabIndex: x ? 0 : void 0,
371
+ "aria-label": x ? `${r.label} (${r.cssVar}) typography specimen` : void 0,
372
+ children: /* @__PURE__ */ m("div", { className: "zdtp-dashboard__specimen", style: { colorScheme: o }, children: /* @__PURE__ */ m("span", { className: `zdtp-dashboard__sample zdtp-dashboard__sample--${i}`, style: _, children: x ? d : "" }) })
333
373
  }
334
374
  );
335
375
  }
336
- function W({
337
- tabs: l,
376
+ function ee({
377
+ tabs: r,
338
378
  mode: f = "light",
339
- chrome: o = "light",
340
- title: r = "Token dashboard",
341
- id: h,
342
- previewOverrides: c,
343
- previewText: a = M
379
+ include: i = "all",
380
+ chrome: a = "light",
381
+ title: d = "Token dashboard",
382
+ id: o,
383
+ previewOverrides: w,
384
+ previewText: z = X
344
385
  }) {
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,
386
+ const n = K(r, { mode: f, include: i }), _ = n.tabs.flatMap((g) => g.tiers.flatMap((N) => N.rows)), x = _.filter((g) => g.diagnostics.length > 0).length, k = [
387
+ { key: "mode-dependent", scheme: f, tabs: B(n.tabs, !0) },
388
+ { key: "mode-independent", scheme: a, tabs: B(n.tabs, !1) }
389
+ ].filter((g) => g.tabs.length > 0);
390
+ return /* @__PURE__ */ v("div", { id: o, className: "zdtp-dashboard", role: "region", "aria-label": d, "data-mode": f, "data-include": i, "data-chrome": a, children: [
391
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__header", children: [
392
+ /* @__PURE__ */ m("div", { role: "heading", "aria-level": 2, className: "zdtp-dashboard__title", children: d }),
393
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__summary", children: [
394
+ /* @__PURE__ */ v("span", { className: "zdtp-dashboard__count", children: [
395
+ _.length,
352
396
  " tokens"
353
397
  ] }),
354
- /* @__PURE__ */ _("span", { children: [
398
+ /* @__PURE__ */ v("span", { children: [
355
399
  "Declared defaults · ",
356
400
  f,
357
- " mode"
401
+ " mode",
402
+ i !== "all" ? ` · ${i} only` : ""
358
403
  ] }),
359
- k > 0 && /* @__PURE__ */ _("span", { children: [
360
- k,
404
+ x > 0 && /* @__PURE__ */ v("span", { children: [
405
+ x,
361
406
  " with diagnostics"
362
407
  ] })
363
408
  ] })
364
409
  ] }),
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),
410
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__inventory", style: n.declarations, children: [
411
+ _.length === 0 && /* @__PURE__ */ m("div", { className: "zdtp-dashboard__empty", style: { colorScheme: a === "host" ? "inherit" : a }, children: n.rows.length === 0 ? "No tokens declared." : "No tokens match this view." }),
412
+ k.map((g) => /* @__PURE__ */ m("div", { className: "zdtp-dashboard__region", "data-scheme": g.scheme, children: g.tabs.map((N) => /* @__PURE__ */ v("div", { className: "zdtp-dashboard__tab", role: "group", "aria-label": N.label, children: [
413
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__tab-header", children: [
414
+ /* @__PURE__ */ m("div", { role: "heading", "aria-level": 3, className: "zdtp-dashboard__tab-title", children: N.label }),
415
+ /* @__PURE__ */ v("span", { className: "zdtp-dashboard__tab-count", children: [
416
+ N.tiers.reduce((b, p) => b + p.rows.length, 0),
372
417
  " tokens"
373
418
  ] })
374
419
  ] }),
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: [
420
+ N.tiers.map((b) => /* @__PURE__ */ v("div", { className: "zdtp-dashboard__tier", children: [
421
+ /* @__PURE__ */ m("div", { role: "heading", "aria-level": 4, className: "zdtp-dashboard__tier-title", children: b.label }),
422
+ /* @__PURE__ */ m("div", { className: b.palette ? "zdtp-dashboard__scroll zdtp-dashboard__palette-scroll" : void 0, role: b.palette ? "region" : void 0, tabIndex: b.palette ? 0 : void 0, "aria-label": b.palette ? `${b.label} palette stops` : void 0, children: /* @__PURE__ */ m("div", { className: `zdtp-dashboard__grid${b.palette ? " zdtp-dashboard__palette" : ""}`, role: "list", "aria-label": b.label, children: b.rows.map((p) => {
423
+ const D = H(p, b, w), O = !b.palette && (D === "bar" || I(D));
424
+ return /* @__PURE__ */ v("div", { className: `zdtp-dashboard__token${O ? " zdtp-dashboard__token--wide" : ""}`, role: "listitem", "data-css-var": p.cssVar, children: [
425
+ /* @__PURE__ */ m(Z, { row: p, tier: b, kind: D, model: n, previewText: z, colorScheme: g.scheme === "host" ? "inherit" : g.scheme }),
426
+ /* @__PURE__ */ v("div", { className: "zdtp-dashboard__token-content", children: [
427
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__name", children: p.label }),
428
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__variable", children: p.cssVar }),
429
+ /* @__PURE__ */ m("div", { className: "zdtp-dashboard__value", children: p.declaredValue || "(empty)" }),
430
+ p.cssValue !== null && p.cssValue !== p.declaredValue && /* @__PURE__ */ v("div", { className: "zdtp-dashboard__reference", children: [
386
431
  "CSS: ",
387
- b.cssValue
432
+ p.cssValue
388
433
  ] }),
389
- b.references.length > 0 && /* @__PURE__ */ _("div", { className: "zdtp-dashboard__reference", children: [
434
+ p.references.length > 0 && /* @__PURE__ */ v("div", { className: "zdtp-dashboard__reference", children: [
390
435
  "References: ",
391
- b.references.map(($) => $.cssVar).join(", ")
436
+ p.references.map((S) => S.cssVar).join(", ")
392
437
  ] }),
393
- b.diagnostics.map(($, N) => /* @__PURE__ */ _("div", { className: "zdtp-dashboard__diagnostic", "data-diagnostic": $.code, children: [
394
- $.severity === "error" ? "Unavailable" : "Context needed",
438
+ p.diagnostics.map((S, T) => /* @__PURE__ */ v("div", { className: "zdtp-dashboard__diagnostic", "data-diagnostic": S.code, children: [
439
+ S.severity === "error" ? "Unavailable" : "Context needed",
395
440
  ": ",
396
- $.message
397
- ] }, N))
441
+ S.message
442
+ ] }, T))
398
443
  ] })
399
- ] }, b.key);
444
+ ] }, p.key);
400
445
  }) }) })
401
- ] }, p.key))
402
- ] }, g.key))
446
+ ] }, b.key))
447
+ ] }, N.key)) }, g.key))
403
448
  ] })
404
449
  ] });
405
450
  }
406
451
  export {
407
- W as TokenDashboard
452
+ ee as TokenDashboard,
453
+ re as isModeDependent,
454
+ P as resolveModeSides,
455
+ ae as splitLightDark
408
456
  };