@takazudo/zdtp 0.2.0-next.1 → 0.2.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.
- package/CHANGELOG.md +26 -0
- package/dist/controls/select-row.d.ts.map +1 -1
- package/dist/controls/slider-row.d.ts.map +1 -1
- package/dist/controls/text-row.d.ts.map +1 -1
- package/dist/controls/token-label.d.ts +17 -0
- package/dist/controls/token-label.d.ts.map +1 -0
- package/dist/index.js +968 -996
- package/dist/panel.d.ts.map +1 -1
- package/dist/tabs/_generic-item-editor.d.ts.map +1 -1
- package/dist/tabs/color-tab.d.ts.map +1 -1
- package/dist/tabs/font-tab.d.ts.map +1 -1
- package/dist/tabs/generic-tab.d.ts.map +1 -1
- package/dist/tabs/size-tab.d.ts.map +1 -1
- package/dist/tabs/spacing-tab.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useState as K, useRef as O, useMemo as Z, useEffect as X, useId as
|
|
4
|
-
import { b as
|
|
5
|
-
import { Z as
|
|
6
|
-
import { g as ne, j as
|
|
7
|
-
import { c as
|
|
8
|
-
import { c as
|
|
9
|
-
import { r as
|
|
10
|
-
import { useContext as
|
|
11
|
-
function
|
|
1
|
+
import { jsxs as k, jsx as s, Fragment as ue } from "preact/jsx-runtime";
|
|
2
|
+
import { createContext as hn, render as gn } from "preact";
|
|
3
|
+
import { useState as K, useRef as O, useMemo as Z, useEffect as X, useId as lt, useCallback as R, useLayoutEffect as po, useContext as fo, createPortal as kn, memo as Ke } from "preact/compat";
|
|
4
|
+
import { b as st, i as mn, s as ho, r as je, e as go, c as ko, d as tt, f as bn, D as jt, h as mo, j as bo, k as De, m as vo, n as wo, o as xo, p as yo, l as vn, q as Wt, t as kt, u as wn, v as No, w as Ze, x as mt, y as Xt, z as bt, A as Yt, B as vt, C as _o, a as Co } from "./tweak-state-DSJa5csL.js";
|
|
5
|
+
import { Z as tl } from "./tweak-state-DSJa5csL.js";
|
|
6
|
+
import { g as ne, j as fe, n as $o, o as P, p as Eo, r as So, q as Mo, t as qt, a as xn, u as To, v as Ao } from "./panel-config-DP2_P7dD.js";
|
|
7
|
+
import { c as ol, s as rl } from "./panel-config-DP2_P7dD.js";
|
|
8
|
+
import { c as Lo } from "./color-schemes-CgzOBqGO.js";
|
|
9
|
+
import { r as Po } from "./route-tokens-to-files-1DvmWBdj.js";
|
|
10
|
+
import { useContext as yn, useCallback as J, useRef as Ae, useEffect as Ce, useState as Ve, useMemo as Gt } from "preact/hooks";
|
|
11
|
+
function be(e) {
|
|
12
12
|
const t = ne().tabs.find((o) => o.id === e);
|
|
13
13
|
if (!t) return [];
|
|
14
14
|
const n = [];
|
|
@@ -17,54 +17,54 @@ function me(e) {
|
|
|
17
17
|
n.push(a);
|
|
18
18
|
return n;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
20
|
+
const Qe = "zudo-design-tokens/v2", wt = "zudo-design-tokens/v1";
|
|
21
|
+
function Nn() {
|
|
22
22
|
return {};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Io() {
|
|
25
25
|
return ne().schemaId;
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class Se extends Error {
|
|
28
28
|
reason;
|
|
29
29
|
actualSchema;
|
|
30
30
|
constructor(t, n, o) {
|
|
31
|
-
super(n), this.name = "DesignTokenSchemaError", this.reason = t, this.actualSchema = o, Object.setPrototypeOf(this,
|
|
31
|
+
super(n), this.name = "DesignTokenSchemaError", this.reason = t, this.actualSchema = o, Object.setPrototypeOf(this, Se.prototype);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function _n(e, t = {}) {
|
|
35
35
|
const n = t.now ? t.now() : /* @__PURE__ */ new Date(), o = {
|
|
36
|
-
$schema:
|
|
36
|
+
$schema: Qe,
|
|
37
37
|
exportedAt: n.toISOString()
|
|
38
|
-
}, a = {}, r =
|
|
38
|
+
}, a = {}, r = zo(e.color, t);
|
|
39
39
|
r && (a.color = r);
|
|
40
|
-
const i =
|
|
40
|
+
const i = xt(be("spacing"), e.spacing, t);
|
|
41
41
|
i && (a.spacing = i);
|
|
42
|
-
const l =
|
|
42
|
+
const l = xt(be("font"), e.typography, t);
|
|
43
43
|
l && (a.font = l);
|
|
44
|
-
const d =
|
|
44
|
+
const d = xt(be("size"), e.size, t);
|
|
45
45
|
return d && (a.size = d), Object.keys(a).length > 0 && (o.tabs = a), o;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const n = t.colorDefaults, o = t.includeDefaults === !0, a =
|
|
47
|
+
function zo(e, t) {
|
|
48
|
+
const n = t.colorDefaults, o = t.includeDefaults === !0, a = st(), r = {};
|
|
49
49
|
let i = !1;
|
|
50
50
|
const l = {};
|
|
51
51
|
let d = !1;
|
|
52
52
|
for (let p = 0; p < e.palette.length; p++) {
|
|
53
53
|
const f = n?.palette[p];
|
|
54
|
-
(o || f === void 0 || e.palette[p] !== f) && (l[
|
|
54
|
+
(o || f === void 0 || e.palette[p] !== f) && (l[fe(a, p)] = e.palette[p], d = !0);
|
|
55
55
|
}
|
|
56
56
|
d && (r.palette = l, i = !0);
|
|
57
57
|
const c = {};
|
|
58
58
|
let u = !1;
|
|
59
59
|
for (const [p, f] of Object.entries(a.semanticCssNames)) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
60
|
+
const g = e.semanticMappings[p];
|
|
61
|
+
if (g === void 0 || typeof g != "number") continue;
|
|
62
62
|
const _ = n?.semanticMappings[p];
|
|
63
|
-
(o || _ === void 0 ||
|
|
63
|
+
(o || _ === void 0 || g !== _) && (c[f] = g, u = !0);
|
|
64
64
|
}
|
|
65
65
|
return u && (r.semantic = c, i = !0), i ? r : void 0;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function xt(e, t, n) {
|
|
68
68
|
const o = n.includeDefaults === !0, a = {};
|
|
69
69
|
let r = !1;
|
|
70
70
|
if (o)
|
|
@@ -81,34 +81,34 @@ function wt(e, t, n) {
|
|
|
81
81
|
}
|
|
82
82
|
return r ? { raw: a } : void 0;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ro(e, t = {}) {
|
|
85
85
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
86
|
-
throw new
|
|
86
|
+
throw new Se("not-object", "Input is not a JSON object.");
|
|
87
87
|
const n = e, o = n.$schema;
|
|
88
88
|
if (o === void 0)
|
|
89
|
-
throw new
|
|
89
|
+
throw new Se(
|
|
90
90
|
"schema-missing",
|
|
91
|
-
`Missing "$schema" key. Expected "${
|
|
91
|
+
`Missing "$schema" key. Expected "${Qe}" or "${wt}".`
|
|
92
92
|
);
|
|
93
|
-
if (o ===
|
|
94
|
-
return
|
|
95
|
-
if (o ===
|
|
96
|
-
return
|
|
97
|
-
throw new
|
|
93
|
+
if (o === Qe)
|
|
94
|
+
return Oo(n, t);
|
|
95
|
+
if (o === wt)
|
|
96
|
+
return Vo(n, t);
|
|
97
|
+
throw new Se(
|
|
98
98
|
"schema-mismatch",
|
|
99
|
-
`Unsupported "$schema" value: ${JSON.stringify(o)}. Expected "${
|
|
99
|
+
`Unsupported "$schema" value: ${JSON.stringify(o)}. Expected "${Qe}" or "${wt}".`,
|
|
100
100
|
o
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const n = [], o = [], a = t.colorDefaults ??
|
|
103
|
+
function Oo(e, t) {
|
|
104
|
+
const n = [], o = [], a = t.colorDefaults ?? Cn(), r = st(), i = e.tabs && typeof e.tabs == "object" && !Array.isArray(e.tabs) ? e.tabs : {}, l = i.color, d = Do(l, a, r, n), c = i.spacing, u = c && typeof c == "object" ? c.raw : void 0, p = yt(u, be("spacing"), "spacing", o, n), f = i.font, g = f && typeof f == "object" ? f.raw : void 0, _ = yt(g, be("font"), "font.raw", o, n), b = i.size, v = b && typeof b == "object" ? b.raw : void 0, h = yt(v, be("size"), "size", o, n);
|
|
105
105
|
return {
|
|
106
106
|
state: { color: d, spacing: p, typography: _, size: h },
|
|
107
107
|
unknownTokens: o,
|
|
108
108
|
warnings: n
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Do(e, t, n, o) {
|
|
112
112
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
113
113
|
return { ...t, palette: [...t.palette], semanticMappings: { ...t.semanticMappings } };
|
|
114
114
|
const a = e;
|
|
@@ -116,7 +116,7 @@ function Oo(e, t, n, o) {
|
|
|
116
116
|
if (a.palette && typeof a.palette == "object" && !Array.isArray(a.palette)) {
|
|
117
117
|
const l = a.palette, d = [...t.palette];
|
|
118
118
|
for (let c = 0; c < n.paletteSize; c++) {
|
|
119
|
-
const u =
|
|
119
|
+
const u = fe(n, c), p = l[u];
|
|
120
120
|
typeof p == "string" && (d[c] = p);
|
|
121
121
|
}
|
|
122
122
|
r = d;
|
|
@@ -146,8 +146,8 @@ function Oo(e, t, n, o) {
|
|
|
146
146
|
shikiTheme: t.shikiTheme
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
if (!e || typeof e != "object") return
|
|
149
|
+
function yt(e, t, n, o, a) {
|
|
150
|
+
if (!e || typeof e != "object") return Nn();
|
|
151
151
|
const r = /* @__PURE__ */ new Map();
|
|
152
152
|
for (const l of t)
|
|
153
153
|
l.readonly || r.set(l.cssVar, l);
|
|
@@ -166,15 +166,15 @@ function xt(e, t, n, o, a) {
|
|
|
166
166
|
}
|
|
167
167
|
return i;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
const n = [], o = [], a = t.colorDefaults ??
|
|
169
|
+
function Vo(e, t) {
|
|
170
|
+
const n = [], o = [], a = t.colorDefaults ?? Cn(), r = Ho(e.color, a, n), i = Nt(e.spacing, be("spacing"), "spacing", o, n), l = Nt(e.typography, be("font"), "typography", o, n), d = Nt(e.size, be("size"), "size", o, n);
|
|
171
171
|
return {
|
|
172
172
|
state: { color: r, spacing: i, typography: l, size: d },
|
|
173
173
|
unknownTokens: o,
|
|
174
174
|
warnings: n
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Ho(e, t, n) {
|
|
178
178
|
if (!e || typeof e != "object")
|
|
179
179
|
return {
|
|
180
180
|
...t,
|
|
@@ -184,23 +184,23 @@ function Vo(e, t, n) {
|
|
|
184
184
|
const o = e;
|
|
185
185
|
let a = [...t.palette];
|
|
186
186
|
if (Array.isArray(o.palette)) {
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
a =
|
|
187
|
+
const g = o.palette.filter((_) => typeof _ == "string");
|
|
188
|
+
if (g.length === t.palette.length && g.length === o.palette.length)
|
|
189
|
+
a = g;
|
|
190
190
|
else if (o.palette.length > 0) {
|
|
191
|
-
const _ =
|
|
191
|
+
const _ = g.length < o.palette.length ? `${o.palette.length - g.length} non-string entries dropped, leaving ${g.length}` : `${o.palette.length} entries`;
|
|
192
192
|
n.push(
|
|
193
193
|
`color.palette: expected ${t.palette.length} string entries; got ${_}. Palette ignored.`
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const r = o.base && typeof o.base == "object" ? o.base : {}, i =
|
|
197
|
+
const r = o.base && typeof o.base == "object" ? o.base : {}, i = Ie(r.bg, t.background), l = Ie(r.fg, t.foreground), d = Ie(r.cursor, t.cursor), c = Ie(r["sel-bg"], t.selectionBg), u = Ie(r["sel-fg"], t.selectionFg), p = {
|
|
198
198
|
...t.semanticMappings
|
|
199
199
|
};
|
|
200
200
|
if (o.semantic && typeof o.semantic == "object")
|
|
201
|
-
for (const [
|
|
202
|
-
typeof _ == "number" || _ === "bg" || _ === "fg" ? p[
|
|
203
|
-
`color.semantic.${
|
|
201
|
+
for (const [g, _] of Object.entries(o.semantic))
|
|
202
|
+
typeof _ == "number" || _ === "bg" || _ === "fg" ? p[g] = _ : n.push(
|
|
203
|
+
`color.semantic.${g} has unsupported value ${JSON.stringify(_)}; kept baseline.`
|
|
204
204
|
);
|
|
205
205
|
const f = typeof o.shikiTheme == "string" && o.shikiTheme.length > 0 ? o.shikiTheme : t.shikiTheme;
|
|
206
206
|
return {
|
|
@@ -214,8 +214,8 @@ function Vo(e, t, n) {
|
|
|
214
214
|
shikiTheme: f
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
if (!e || typeof e != "object") return
|
|
217
|
+
function Nt(e, t, n, o, a) {
|
|
218
|
+
if (!e || typeof e != "object") return Nn();
|
|
219
219
|
const r = /* @__PURE__ */ new Map();
|
|
220
220
|
for (const l of t)
|
|
221
221
|
l.readonly || r.set(l.cssVar, l);
|
|
@@ -234,11 +234,11 @@ function yt(e, t, n, o, a) {
|
|
|
234
234
|
}
|
|
235
235
|
return i;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Ie(e, t) {
|
|
238
238
|
return typeof e == "number" && Number.isFinite(e) ? e : t;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
const e =
|
|
240
|
+
function Cn() {
|
|
241
|
+
const e = st(), t = e && e.paletteSize > 0 ? e.paletteSize : 16, n = t - 1, o = Array.from({ length: t }, (r, i) => i === 0 ? "#000000" : i === n ? "#ffffff" : "#808080"), a = (r) => Math.min(Math.max(r, 0), n);
|
|
242
242
|
return {
|
|
243
243
|
palette: o,
|
|
244
244
|
background: a(0),
|
|
@@ -250,14 +250,14 @@ function Nn() {
|
|
|
250
250
|
shikiTheme: "dracula"
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Bo(e, t) {
|
|
254
254
|
if (t) return t;
|
|
255
|
-
const n = Object.values(
|
|
256
|
-
return n ?
|
|
255
|
+
const n = Object.values(Lo)[0];
|
|
256
|
+
return n ? mn(n) : e;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const [o, a] = K("Copy"), [r, i] = K(!1), l = O(null), d = O(null), c = O(null), u = ne(), p =
|
|
260
|
-
const h =
|
|
258
|
+
function Fo({ onClose: e, state: t, colorDefaults: n }) {
|
|
259
|
+
const [o, a] = K("Copy"), [r, i] = K(!1), l = O(null), d = O(null), c = O(null), u = ne(), p = $o(u), f = Z(() => {
|
|
260
|
+
const h = Bo(t.color, n), y = _n(t, {
|
|
261
261
|
includeDefaults: r,
|
|
262
262
|
colorDefaults: h
|
|
263
263
|
});
|
|
@@ -281,7 +281,7 @@ function Bo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
281
281
|
}, [e]), X(() => () => {
|
|
282
282
|
c.current && clearTimeout(c.current);
|
|
283
283
|
}, []);
|
|
284
|
-
function
|
|
284
|
+
function g(h) {
|
|
285
285
|
const y = l.current;
|
|
286
286
|
if (!y) return;
|
|
287
287
|
const M = y.getBoundingClientRect();
|
|
@@ -304,24 +304,24 @@ function Bo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
304
304
|
}
|
|
305
305
|
a(h ? "Copied!" : "Failed"), c.current && clearTimeout(c.current), c.current = setTimeout(() => a("Copy"), 2e3);
|
|
306
306
|
}
|
|
307
|
-
const b =
|
|
308
|
-
return /* @__PURE__ */
|
|
307
|
+
const b = lt(), v = `${u.modalClassPrefix}-export-title-${b}`;
|
|
308
|
+
return /* @__PURE__ */ k(
|
|
309
309
|
"dialog",
|
|
310
310
|
{
|
|
311
311
|
ref: l,
|
|
312
|
-
onClick:
|
|
312
|
+
onClick: g,
|
|
313
313
|
"aria-labelledby": v,
|
|
314
314
|
className: `${P(u, "")} ${P(u, "--export")}`,
|
|
315
315
|
"data-design-token-panel-modal": "",
|
|
316
316
|
"data-design-token-panel-modal-variant": "export",
|
|
317
317
|
children: [
|
|
318
318
|
/* @__PURE__ */ s("div", { id: v, role: "heading", "aria-level": 2, className: P(u, "__title"), children: "Export Design Tokens" }),
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ k("div", { className: P(u, "__hint"), children: [
|
|
320
320
|
"Save as ",
|
|
321
321
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: p }),
|
|
322
322
|
" to feed this blob back into the panel (or hand to an AI assistant)."
|
|
323
323
|
] }),
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ k("label", { className: P(u, "__toggle"), children: [
|
|
325
325
|
/* @__PURE__ */ s(
|
|
326
326
|
"input",
|
|
327
327
|
{
|
|
@@ -333,7 +333,7 @@ function Bo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
333
333
|
"Show defaults too"
|
|
334
334
|
] }),
|
|
335
335
|
/* @__PURE__ */ s("div", { role: "none", className: P(u, "__json"), children: f }),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ k("div", { className: P(u, "__actions"), children: [
|
|
337
337
|
/* @__PURE__ */ s(
|
|
338
338
|
"div",
|
|
339
339
|
{
|
|
@@ -366,8 +366,8 @@ function Bo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
366
366
|
}
|
|
367
367
|
);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const [o, a] = K(""), [r, i] = K(null), l = O(null), d = O(null), c = ne(), u =
|
|
369
|
+
function Ko({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
370
|
+
const [o, a] = K(""), [r, i] = K(null), l = O(null), d = O(null), c = ne(), u = Io();
|
|
371
371
|
X(() => {
|
|
372
372
|
const b = l.current;
|
|
373
373
|
if (b)
|
|
@@ -406,7 +406,7 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
try {
|
|
409
|
-
const { state: h, unknownTokens: y, warnings: M } =
|
|
409
|
+
const { state: h, unknownTokens: y, warnings: M } = Ro(v, {
|
|
410
410
|
colorDefaults: n
|
|
411
411
|
});
|
|
412
412
|
if (y.length > 0) {
|
|
@@ -418,7 +418,7 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
418
418
|
console.groupEnd();
|
|
419
419
|
}
|
|
420
420
|
M.length > 0 && console.warn("[design-token-serde] warnings:", M), t(h);
|
|
421
|
-
const A = Object.keys(h.spacing).length + Object.keys(h.typography).length + Object.keys(h.size).length, C =
|
|
421
|
+
const A = Object.keys(h.spacing).length + Object.keys(h.typography).length + Object.keys(h.size).length, C = Eo(h.color, n);
|
|
422
422
|
A === 0 && C && y.length > 0 ? i({
|
|
423
423
|
kind: "error",
|
|
424
424
|
text: `Nothing applied — all ${y.length} token${y.length === 1 ? "" : "s"} in the payload were unknown. See console for the list.`
|
|
@@ -427,7 +427,7 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
427
427
|
text: `Loaded. ${y.length} unknown token${y.length === 1 ? "" : "s"} ignored — see console for the list.`
|
|
428
428
|
}) : i({ kind: "info", text: "Loaded." });
|
|
429
429
|
} catch (h) {
|
|
430
|
-
if (h instanceof
|
|
430
|
+
if (h instanceof Se) {
|
|
431
431
|
h.reason === "schema-mismatch" ? i({
|
|
432
432
|
kind: "error",
|
|
433
433
|
text: `Schema mismatch: this panel expects "${u}".`
|
|
@@ -441,8 +441,8 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
441
441
|
i({ kind: "error", text: `Load failed: ${y}` });
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */
|
|
444
|
+
const g = lt(), _ = `${c.modalClassPrefix}-import-title-${g}`;
|
|
445
|
+
return /* @__PURE__ */ k(
|
|
446
446
|
"dialog",
|
|
447
447
|
{
|
|
448
448
|
ref: l,
|
|
@@ -453,7 +453,7 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
453
453
|
"data-design-token-panel-modal-variant": "import",
|
|
454
454
|
children: [
|
|
455
455
|
/* @__PURE__ */ s("div", { id: _, role: "heading", "aria-level": 2, className: P(c, "__title"), children: "Load Design Tokens" }),
|
|
456
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ k("div", { className: P(c, "__hint"), children: [
|
|
457
457
|
"Paste a ",
|
|
458
458
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: u }),
|
|
459
459
|
" JSON blob. Unknown tokens are ignored; schema mismatch aborts the load."
|
|
@@ -477,7 +477,7 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
477
477
|
children: r.text
|
|
478
478
|
}
|
|
479
479
|
),
|
|
480
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ k("div", { className: P(c, "__actions"), children: [
|
|
481
481
|
/* @__PURE__ */ s(
|
|
482
482
|
"div",
|
|
483
483
|
{
|
|
@@ -509,25 +509,25 @@ function Fo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
509
509
|
}
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Jt(e, t, n = st(), o = ne().tabs) {
|
|
513
513
|
const a = {}, r = e.color, i = r.palette.length;
|
|
514
514
|
for (let d = 0; d < i; d++) {
|
|
515
515
|
const c = r.palette[d];
|
|
516
516
|
if (typeof c != "string" || c.length === 0) continue;
|
|
517
517
|
const u = t?.palette[d];
|
|
518
|
-
(t === void 0 || c !== u) && (a[
|
|
518
|
+
(t === void 0 || c !== u) && (a[fe(n, d)] = c);
|
|
519
519
|
}
|
|
520
520
|
for (const [d, c] of Object.entries(n.semanticCssNames)) {
|
|
521
521
|
const u = r.semanticMappings[d];
|
|
522
522
|
if (u === void 0) continue;
|
|
523
523
|
const p = t?.semanticMappings[d];
|
|
524
524
|
if (!(t === void 0 || u !== p)) continue;
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const _ =
|
|
528
|
-
_ !==
|
|
529
|
-
`[design-token-panel] paletteIndex ${
|
|
530
|
-
), a[c] = `var(${
|
|
525
|
+
const g = Wo(u, r);
|
|
526
|
+
if (g === null) continue;
|
|
527
|
+
const _ = ho(g, r.palette.length);
|
|
528
|
+
_ !== g && console.error(
|
|
529
|
+
`[design-token-panel] paletteIndex ${g} for ${c} is out of range (palette length ${r.palette.length}); clamping to ${_}.`
|
|
530
|
+
), a[c] = `var(${fe(n, _)})`;
|
|
531
531
|
}
|
|
532
532
|
const l = [
|
|
533
533
|
{ tabId: "spacing", overrides: e.spacing },
|
|
@@ -537,11 +537,11 @@ function qt(e, t, n = lt(), o = ne().tabs) {
|
|
|
537
537
|
for (const { tabId: d, overrides: c } of l) {
|
|
538
538
|
if (Object.keys(c).length === 0) continue;
|
|
539
539
|
const u = o.find((p) => p.id === d);
|
|
540
|
-
u &&
|
|
540
|
+
u && jo(u, c, a);
|
|
541
541
|
}
|
|
542
542
|
return a;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function jo(e, t, n) {
|
|
545
545
|
const o = {};
|
|
546
546
|
for (const a of e.tiers) {
|
|
547
547
|
const r = {};
|
|
@@ -557,20 +557,20 @@ function Ko(e, t, n) {
|
|
|
557
557
|
const i = t[r.id];
|
|
558
558
|
if (!(typeof i != "string" || i.length === 0))
|
|
559
559
|
try {
|
|
560
|
-
const l =
|
|
561
|
-
n[r.cssVar] =
|
|
560
|
+
const l = je(e, a.id, r.id, o);
|
|
561
|
+
n[r.cssVar] = go(l);
|
|
562
562
|
} catch {
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Wo(e, t) {
|
|
567
567
|
return e === "bg" ? t.background : e === "fg" ? t.foreground : typeof e == "number" && Number.isInteger(e) ? e : null;
|
|
568
568
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
571
|
-
return JSON.stringify(
|
|
569
|
+
const Xo = 2e3, _t = { kind: "preview" };
|
|
570
|
+
function Yo(e, t) {
|
|
571
|
+
return JSON.stringify(_n(e, { colorDefaults: t }), null, 2);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function qo(e) {
|
|
574
574
|
if (Array.isArray(e.updated)) return e.updated;
|
|
575
575
|
const t = e.results;
|
|
576
576
|
if (Array.isArray(t)) return t;
|
|
@@ -583,7 +583,7 @@ function Yo(e) {
|
|
|
583
583
|
}
|
|
584
584
|
return n;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Go(e) {
|
|
587
587
|
return {
|
|
588
588
|
dialog: `${P(e, "")} ${P(e, "--apply")}`,
|
|
589
589
|
header: P(e, "__header"),
|
|
@@ -605,8 +605,8 @@ function qo(e) {
|
|
|
605
605
|
jsonBlock: P(e, "__json")
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
const { state: t, open: n, onClose: o, colorDefaults: a, onApplied: r } = e, i = O(null), l = O(null), d = ne(), c = Z(() =>
|
|
608
|
+
function Jo(e) {
|
|
609
|
+
const { state: t, open: n, onClose: o, colorDefaults: a, onApplied: r } = e, i = O(null), l = O(null), d = ne(), c = Z(() => Go(d), [d]), u = lt(), p = `${d.modalClassPrefix}-apply-title-${u}`, [f, g] = K(_t), [_, b] = K("Copy pre-apply state to clipboard");
|
|
610
610
|
X(() => {
|
|
611
611
|
const T = i.current;
|
|
612
612
|
if (!T) return;
|
|
@@ -615,32 +615,32 @@ function Go(e) {
|
|
|
615
615
|
l.current?.focus();
|
|
616
616
|
})) : !n && D && (typeof T.close == "function" ? T.close() : T.removeAttribute("open"));
|
|
617
617
|
}, [n]), X(() => {
|
|
618
|
-
n && (
|
|
618
|
+
n && (g(_t), b("Copy pre-apply state to clipboard"));
|
|
619
619
|
}, [n]), X(() => {
|
|
620
620
|
if (_ !== "Copied!") return;
|
|
621
621
|
const T = window.setTimeout(
|
|
622
622
|
() => b("Copy pre-apply state to clipboard"),
|
|
623
|
-
|
|
623
|
+
Xo
|
|
624
624
|
);
|
|
625
625
|
return () => window.clearTimeout(T);
|
|
626
626
|
}, [_]);
|
|
627
627
|
const v = Z(() => {
|
|
628
|
-
const T =
|
|
628
|
+
const T = Jt(t, a), D = So(d), ee = D && t.secondary ? Jt({ ...t, color: t.secondary }, void 0, D) : {};
|
|
629
629
|
return { ...T, ...ee };
|
|
630
|
-
}, [t, a, d]), h = Z(() =>
|
|
631
|
-
() =>
|
|
630
|
+
}, [t, a, d]), h = Z(() => Mo(d), [d]), { groups: y, rejected: M, rejectedReasons: A } = Z(
|
|
631
|
+
() => Po(v, h),
|
|
632
632
|
[v, h]
|
|
633
633
|
), C = Z(() => Object.keys(v).length, [v]), x = C === 0, m = y.length > 0, N = d.applyEndpoint, S = !!N && Object.keys(h).length > 0;
|
|
634
634
|
async function B() {
|
|
635
635
|
if (!N) {
|
|
636
|
-
|
|
636
|
+
g({
|
|
637
637
|
kind: "error",
|
|
638
638
|
message: "Apply is not configured: PanelConfig.applyEndpoint is missing."
|
|
639
639
|
});
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
|
-
const T =
|
|
643
|
-
|
|
642
|
+
const T = Yo(t, a);
|
|
643
|
+
g({ kind: "applying" });
|
|
644
644
|
try {
|
|
645
645
|
const D = await fetch(N, {
|
|
646
646
|
method: "POST",
|
|
@@ -648,20 +648,20 @@ function Go(e) {
|
|
|
648
648
|
body: JSON.stringify({ tokens: v })
|
|
649
649
|
});
|
|
650
650
|
if (!D.ok) {
|
|
651
|
-
let
|
|
651
|
+
let ke = "";
|
|
652
652
|
try {
|
|
653
653
|
const w = await D.text();
|
|
654
654
|
if (w)
|
|
655
655
|
try {
|
|
656
656
|
const z = JSON.parse(w);
|
|
657
|
-
|
|
657
|
+
ke = z.error ?? z.message ?? w;
|
|
658
658
|
} catch {
|
|
659
|
-
|
|
659
|
+
ke = w;
|
|
660
660
|
}
|
|
661
661
|
} catch {
|
|
662
662
|
}
|
|
663
|
-
const
|
|
664
|
-
|
|
663
|
+
const Pe = ke ? `Apply failed (${D.status}): ${ke}` : `Apply failed (${D.status} ${D.statusText || "error"}).`;
|
|
664
|
+
g({ kind: "error", message: Pe });
|
|
665
665
|
return;
|
|
666
666
|
}
|
|
667
667
|
let ee = {};
|
|
@@ -670,10 +670,10 @@ function Go(e) {
|
|
|
670
670
|
} catch {
|
|
671
671
|
ee = {};
|
|
672
672
|
}
|
|
673
|
-
|
|
673
|
+
g({ kind: "success", response: ee, previewJson: T });
|
|
674
674
|
} catch (D) {
|
|
675
675
|
const ee = D instanceof Error ? D.message : String(D);
|
|
676
|
-
|
|
676
|
+
g({ kind: "error", message: `Network error: ${ee}` });
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
function j(T) {
|
|
@@ -688,9 +688,9 @@ function Go(e) {
|
|
|
688
688
|
r(), oe();
|
|
689
689
|
}
|
|
690
690
|
function Q() {
|
|
691
|
-
|
|
691
|
+
g(_t);
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function ce() {
|
|
694
694
|
o();
|
|
695
695
|
}
|
|
696
696
|
function oe() {
|
|
@@ -701,20 +701,20 @@ function Go(e) {
|
|
|
701
701
|
}
|
|
702
702
|
typeof T.close == "function" ? T.close() : (T.removeAttribute("open"), o());
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function ve(T) {
|
|
705
705
|
const D = i.current;
|
|
706
706
|
if (!D) return;
|
|
707
707
|
const ee = D.getBoundingClientRect();
|
|
708
708
|
(T.clientX < ee.left || T.clientX > ee.right || T.clientY < ee.top || T.clientY > ee.bottom) && oe();
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const pe = Z(
|
|
711
711
|
() => Object.values(h).map((T) => {
|
|
712
712
|
const D = T.lastIndexOf("/");
|
|
713
713
|
return D >= 0 ? T.slice(D + 1) : T;
|
|
714
714
|
}).join(" / "),
|
|
715
715
|
[h]
|
|
716
|
-
),
|
|
717
|
-
return /* @__PURE__ */
|
|
716
|
+
), $e = f.kind === "applying" ? "Applying…" : S ? `Apply to ${pe}` : "Apply (host not configured)";
|
|
717
|
+
return /* @__PURE__ */ k(
|
|
718
718
|
"dialog",
|
|
719
719
|
{
|
|
720
720
|
ref: i,
|
|
@@ -722,10 +722,10 @@ function Go(e) {
|
|
|
722
722
|
"data-design-token-panel-modal": "",
|
|
723
723
|
"data-design-token-panel-modal-variant": "apply",
|
|
724
724
|
"aria-labelledby": p,
|
|
725
|
-
onClose:
|
|
726
|
-
onClick:
|
|
725
|
+
onClose: ce,
|
|
726
|
+
onClick: ve,
|
|
727
727
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ k("div", { className: c.header, children: [
|
|
729
729
|
/* @__PURE__ */ s("div", { id: p, role: "heading", "aria-level": 2, className: c.title, children: "Apply design tokens to codebase" }),
|
|
730
730
|
/* @__PURE__ */ s(
|
|
731
731
|
"div",
|
|
@@ -742,9 +742,9 @@ function Go(e) {
|
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
] }),
|
|
745
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ k("div", { children: [
|
|
746
746
|
f.kind === "preview" && /* @__PURE__ */ s(
|
|
747
|
-
|
|
747
|
+
Uo,
|
|
748
748
|
{
|
|
749
749
|
cls: c,
|
|
750
750
|
groups: y,
|
|
@@ -755,22 +755,22 @@ function Go(e) {
|
|
|
755
755
|
applyConfigured: S
|
|
756
756
|
}
|
|
757
757
|
),
|
|
758
|
-
f.kind === "applying" && /* @__PURE__ */ s(
|
|
758
|
+
f.kind === "applying" && /* @__PURE__ */ s(Zo, { cls: c }),
|
|
759
759
|
f.kind === "success" && /* @__PURE__ */ s(
|
|
760
|
-
|
|
760
|
+
Qo,
|
|
761
761
|
{
|
|
762
762
|
cls: c,
|
|
763
|
-
results:
|
|
763
|
+
results: qo(f.response),
|
|
764
764
|
unknownCssVars: Array.isArray(f.response.unknownCssVars) ? f.response.unknownCssVars : [],
|
|
765
765
|
previewJson: f.previewJson,
|
|
766
766
|
copyLabel: _,
|
|
767
767
|
onCopy: () => j(f.previewJson)
|
|
768
768
|
}
|
|
769
769
|
),
|
|
770
|
-
f.kind === "error" && /* @__PURE__ */ s(
|
|
770
|
+
f.kind === "error" && /* @__PURE__ */ s(er, { cls: c, message: f.message })
|
|
771
771
|
] }),
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
f.kind === "preview" && /* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ k("div", { className: c.actions, children: [
|
|
773
|
+
f.kind === "preview" && /* @__PURE__ */ k(ue, { children: [
|
|
774
774
|
(() => {
|
|
775
775
|
const T = x || !m || !S;
|
|
776
776
|
return /* @__PURE__ */ s(
|
|
@@ -788,7 +788,7 @@ function Go(e) {
|
|
|
788
788
|
onKeyDown: (D) => {
|
|
789
789
|
(D.key === "Enter" || D.key === " ") && (D.preventDefault(), T || B());
|
|
790
790
|
},
|
|
791
|
-
children:
|
|
791
|
+
children: $e
|
|
792
792
|
}
|
|
793
793
|
);
|
|
794
794
|
})(),
|
|
@@ -806,7 +806,7 @@ function Go(e) {
|
|
|
806
806
|
}
|
|
807
807
|
)
|
|
808
808
|
] }),
|
|
809
|
-
f.kind === "applying" && /* @__PURE__ */ s("div", { role: "button", tabIndex: -1, className: c.primaryButton, "aria-disabled": !0, children:
|
|
809
|
+
f.kind === "applying" && /* @__PURE__ */ s("div", { role: "button", tabIndex: -1, className: c.primaryButton, "aria-disabled": !0, children: $e }),
|
|
810
810
|
f.kind === "success" && /* @__PURE__ */ s(
|
|
811
811
|
"div",
|
|
812
812
|
{
|
|
@@ -820,7 +820,7 @@ function Go(e) {
|
|
|
820
820
|
children: "Done"
|
|
821
821
|
}
|
|
822
822
|
),
|
|
823
|
-
f.kind === "error" && /* @__PURE__ */
|
|
823
|
+
f.kind === "error" && /* @__PURE__ */ k(ue, { children: [
|
|
824
824
|
/* @__PURE__ */ s(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
@@ -853,7 +853,7 @@ function Go(e) {
|
|
|
853
853
|
}
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Uo({
|
|
857
857
|
cls: e,
|
|
858
858
|
groups: t,
|
|
859
859
|
rejected: n,
|
|
@@ -865,14 +865,14 @@ function Jo({
|
|
|
865
865
|
if (r)
|
|
866
866
|
return /* @__PURE__ */ s("div", { className: e.statusWarning, children: "No overrides to apply — make a change first, then come back." });
|
|
867
867
|
const l = t.reduce((d, c) => d + Object.keys(c.tokens).length, 0);
|
|
868
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ k(ue, { children: [
|
|
869
869
|
!i && /* @__PURE__ */ s("div", { className: e.statusWarning, children: "The host has not configured an apply endpoint or routing map. The diff below is read-only — the Apply button will stay disabled." }),
|
|
870
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ k("div", { className: e.hint, children: [
|
|
871
871
|
l,
|
|
872
872
|
" override",
|
|
873
873
|
l === 1 ? "" : "s",
|
|
874
874
|
" will be written to disk.",
|
|
875
|
-
l !== a && /* @__PURE__ */
|
|
875
|
+
l !== a && /* @__PURE__ */ k(ue, { children: [
|
|
876
876
|
" ",
|
|
877
877
|
a - l,
|
|
878
878
|
" entr",
|
|
@@ -880,29 +880,29 @@ function Jo({
|
|
|
880
880
|
" were skipped (no route configured)."
|
|
881
881
|
] })
|
|
882
882
|
] }),
|
|
883
|
-
t.map((d) => /* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
|
|
883
|
+
t.map((d) => /* @__PURE__ */ k("div", { children: [
|
|
884
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: [
|
|
885
|
+
tr(d.relativePath),
|
|
886
886
|
" (",
|
|
887
887
|
Object.keys(d.tokens).length,
|
|
888
888
|
")"
|
|
889
889
|
] }),
|
|
890
|
-
/* @__PURE__ */ s("div", { className: e.list, children: Object.entries(d.tokens).map(([c, u]) => /* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ s("div", { className: e.list, children: Object.entries(d.tokens).map(([c, u]) => /* @__PURE__ */ k("div", { className: e.listItem, children: [
|
|
891
891
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: c }),
|
|
892
892
|
":",
|
|
893
893
|
" ",
|
|
894
894
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: u })
|
|
895
895
|
] }, c)) })
|
|
896
896
|
] }, d.prefix)),
|
|
897
|
-
n.length > 0 && /* @__PURE__ */
|
|
898
|
-
/* @__PURE__ */
|
|
897
|
+
n.length > 0 && /* @__PURE__ */ k("div", { children: [
|
|
898
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: [
|
|
899
899
|
"Skipped — no route configured (",
|
|
900
900
|
n.length,
|
|
901
901
|
")"
|
|
902
902
|
] }),
|
|
903
|
-
/* @__PURE__ */ s("div", { className: e.list, children: n.map((d, c) => /* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ s("div", { className: e.list, children: n.map((d, c) => /* @__PURE__ */ k("div", { className: e.listItem, children: [
|
|
904
904
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: d }),
|
|
905
|
-
o[c] ? /* @__PURE__ */
|
|
905
|
+
o[c] ? /* @__PURE__ */ k(ue, { children: [
|
|
906
906
|
" ",
|
|
907
907
|
"— ",
|
|
908
908
|
/* @__PURE__ */ s("span", { children: o[c] })
|
|
@@ -911,13 +911,13 @@ function Jo({
|
|
|
911
911
|
] })
|
|
912
912
|
] });
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
return /* @__PURE__ */
|
|
914
|
+
function Zo({ cls: e }) {
|
|
915
|
+
return /* @__PURE__ */ k("div", { className: e.applying, role: "status", "aria-live": "polite", children: [
|
|
916
916
|
/* @__PURE__ */ s("span", { className: e.spinner, "aria-hidden": "true" }),
|
|
917
917
|
/* @__PURE__ */ s("span", { children: "Applying changes…" })
|
|
918
918
|
] });
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Qo({
|
|
921
921
|
cls: e,
|
|
922
922
|
results: t,
|
|
923
923
|
unknownCssVars: n,
|
|
@@ -925,15 +925,15 @@ function Zo({
|
|
|
925
925
|
copyLabel: a,
|
|
926
926
|
onCopy: r
|
|
927
927
|
}) {
|
|
928
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
929
929
|
/* @__PURE__ */ s("div", { className: e.statusSuccess, role: "status", children: "Applied successfully." }),
|
|
930
|
-
t.length === 0 ? /* @__PURE__ */ s("div", { className: e.hint, children: "The server returned no per-file details." }) : t.map((i) => /* @__PURE__ */
|
|
930
|
+
t.length === 0 ? /* @__PURE__ */ s("div", { className: e.hint, children: "The server returned no per-file details." }) : t.map((i) => /* @__PURE__ */ k("div", { children: [
|
|
931
931
|
/* @__PURE__ */ s("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: i.file ?? "(unknown file)" }),
|
|
932
|
-
/* @__PURE__ */ s(
|
|
933
|
-
/* @__PURE__ */ s(
|
|
934
|
-
/* @__PURE__ */ s(
|
|
932
|
+
/* @__PURE__ */ s(Ct, { cls: e, label: "changed", values: i.changed }),
|
|
933
|
+
/* @__PURE__ */ s(Ct, { cls: e, label: "unknown", values: i.unknown }),
|
|
934
|
+
/* @__PURE__ */ s(Ct, { cls: e, label: "unchanged", values: i.unchanged })
|
|
935
935
|
] }, i.file ?? "unknown-file")),
|
|
936
|
-
n.length > 0 && /* @__PURE__ */
|
|
936
|
+
n.length > 0 && /* @__PURE__ */ k("div", { className: e.statusWarning, children: [
|
|
937
937
|
n.length,
|
|
938
938
|
" cssVar",
|
|
939
939
|
n.length === 1 ? "" : "s",
|
|
@@ -957,9 +957,9 @@ function Zo({
|
|
|
957
957
|
/* @__PURE__ */ s("div", { role: "none", className: e.jsonBlock, children: o })
|
|
958
958
|
] });
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
960
|
+
function Ct({ cls: e, label: t, values: n }) {
|
|
961
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ k("div", { children: [
|
|
962
|
+
/* @__PURE__ */ k("div", { className: e.hint, children: [
|
|
963
963
|
t,
|
|
964
964
|
" (",
|
|
965
965
|
n.length,
|
|
@@ -968,18 +968,18 @@ function _t({ cls: e, label: t, values: n }) {
|
|
|
968
968
|
/* @__PURE__ */ s("div", { className: e.list, children: n.map((o) => /* @__PURE__ */ s("div", { className: e.listItem, children: /* @__PURE__ */ s("span", { className: "tokenpanel-code", children: o }) }, o)) })
|
|
969
969
|
] });
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
return /* @__PURE__ */
|
|
971
|
+
function er({ cls: e, message: t }) {
|
|
972
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
973
973
|
/* @__PURE__ */ s("div", { className: e.statusError, role: "alert", children: t }),
|
|
974
974
|
/* @__PURE__ */ s("div", { className: e.hint, children: "Your edits are still intact — click Retry to send the same diff again, or Close to keep editing." })
|
|
975
975
|
] });
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function tr(e) {
|
|
978
978
|
if (!e) return "(unknown file)";
|
|
979
979
|
const t = e.lastIndexOf("/");
|
|
980
980
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function _e({
|
|
983
983
|
children: e,
|
|
984
984
|
onClick: t,
|
|
985
985
|
className: n,
|
|
@@ -1013,31 +1013,31 @@ function Ne({
|
|
|
1013
1013
|
}
|
|
1014
1014
|
);
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1017
|
-
function
|
|
1016
|
+
const nr = { h: 0, s: 0, l: 0, a: 100 };
|
|
1017
|
+
function or(e) {
|
|
1018
1018
|
const t = e.toLowerCase();
|
|
1019
1019
|
return /^#[0-9a-f]{6}$/.test(t) || /^#[0-9a-f]{8}$/.test(t) ? t : /^#[0-9a-f]{3}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}` : /^#[0-9a-f]{4}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}${t[4]}${t[4]}` : "";
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const t =
|
|
1023
|
-
if (!t) return { ...
|
|
1021
|
+
function rr(e) {
|
|
1022
|
+
const t = or(e);
|
|
1023
|
+
if (!t) return { ...nr };
|
|
1024
1024
|
const n = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, a = parseInt(t.slice(5, 7), 16) / 255, r = t.length === 9 ? Math.round(parseInt(t.slice(7, 9), 16) / 255 * 100) : 100, i = Math.max(n, o, a), l = Math.min(n, o, a), d = (i + l) / 2;
|
|
1025
1025
|
if (i === l) return { h: 0, s: 0, l: Math.round(d * 100), a: r };
|
|
1026
1026
|
const c = i - l, u = d > 0.5 ? c / (2 - i - l) : c / (i + l);
|
|
1027
1027
|
let p = 0;
|
|
1028
1028
|
return i === n ? p = ((o - a) / c + (o < a ? 6 : 0)) / 6 : i === o ? p = ((a - n) / c + 2) / 6 : p = ((n - o) / c + 4) / 6, { h: Math.round(p * 360), s: Math.round(u * 100), l: Math.round(d * 100), a: r };
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function ar(e, t, n, o) {
|
|
1031
1031
|
t = Math.max(0, Math.min(100, t)), n = Math.max(0, Math.min(100, n)), o = Math.max(0, Math.min(100, o)), e = (e % 360 + 360) % 360;
|
|
1032
1032
|
const a = t / 100, r = n / 100, i = (1 - Math.abs(2 * r - 1)) * a, l = i * (1 - Math.abs(e / 60 % 2 - 1)), d = r - i / 2;
|
|
1033
1033
|
let c = 0, u = 0, p = 0;
|
|
1034
1034
|
e < 60 ? (c = i, u = l) : e < 120 ? (c = l, u = i) : e < 180 ? (u = i, p = l) : e < 240 ? (u = l, p = i) : e < 300 ? (c = l, p = i) : (c = i, p = l);
|
|
1035
|
-
const f = (b) => Math.round((b + d) * 255).toString(16).padStart(2, "0"),
|
|
1036
|
-
if (o === 100) return
|
|
1035
|
+
const f = (b) => Math.round((b + d) * 255).toString(16).padStart(2, "0"), g = `#${f(c)}${f(u)}${f(p)}`;
|
|
1036
|
+
if (o === 100) return g;
|
|
1037
1037
|
const _ = Math.round(o / 100 * 255).toString(16).padStart(2, "0");
|
|
1038
|
-
return `${
|
|
1038
|
+
return `${g}${_}`;
|
|
1039
1039
|
}
|
|
1040
|
-
const
|
|
1040
|
+
const $n = (e, t) => {
|
|
1041
1041
|
if (typeof e == "number") {
|
|
1042
1042
|
if (t === 3)
|
|
1043
1043
|
return {
|
|
@@ -1070,7 +1070,7 @@ const _n = (e, t) => {
|
|
|
1070
1070
|
alpha: (e & 255) / 255
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
|
-
},
|
|
1073
|
+
}, ir = {
|
|
1074
1074
|
aliceblue: 15792383,
|
|
1075
1075
|
antiquewhite: 16444375,
|
|
1076
1076
|
aqua: 65535,
|
|
@@ -1221,23 +1221,23 @@ const _n = (e, t) => {
|
|
|
1221
1221
|
whitesmoke: 16119285,
|
|
1222
1222
|
yellow: 16776960,
|
|
1223
1223
|
yellowgreen: 10145074
|
|
1224
|
-
},
|
|
1224
|
+
}, lr = (e) => $n(ir[e.toLowerCase()], 6), sr = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, cr = (e) => {
|
|
1225
1225
|
let t;
|
|
1226
|
-
return (t = e.match(
|
|
1227
|
-
},
|
|
1228
|
-
`^rgba?\\(\\s*${
|
|
1229
|
-
),
|
|
1230
|
-
`^rgba?\\(\\s*${
|
|
1231
|
-
),
|
|
1226
|
+
return (t = e.match(sr)) ? $n(parseInt(t[1], 16), t[1].length) : void 0;
|
|
1227
|
+
}, ye = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", He = `${ye}%`, Rt = `(?:${ye}%|${ye})`, dr = `(?:${ye}(deg|grad|rad|turn)|${ye})`, Le = "\\s*,\\s*", ur = new RegExp(
|
|
1228
|
+
`^rgba?\\(\\s*${ye}${Le}${ye}${Le}${ye}\\s*(?:,\\s*${Rt}\\s*)?\\)$`
|
|
1229
|
+
), pr = new RegExp(
|
|
1230
|
+
`^rgba?\\(\\s*${He}${Le}${He}${Le}${He}\\s*(?:,\\s*${Rt}\\s*)?\\)$`
|
|
1231
|
+
), fr = (e) => {
|
|
1232
1232
|
let t = { mode: "rgb" }, n;
|
|
1233
|
-
if (n = e.match(
|
|
1233
|
+
if (n = e.match(ur))
|
|
1234
1234
|
n[1] !== void 0 && (t.r = n[1] / 255), n[2] !== void 0 && (t.g = n[2] / 255), n[3] !== void 0 && (t.b = n[3] / 255);
|
|
1235
|
-
else if (n = e.match(
|
|
1235
|
+
else if (n = e.match(pr))
|
|
1236
1236
|
n[1] !== void 0 && (t.r = n[1] / 100), n[2] !== void 0 && (t.g = n[2] / 100), n[3] !== void 0 && (t.b = n[3] / 100);
|
|
1237
1237
|
else
|
|
1238
1238
|
return;
|
|
1239
1239
|
return n[4] !== void 0 ? t.alpha = Math.max(0, Math.min(1, n[4] / 100)) : n[5] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +n[5]))), t;
|
|
1240
|
-
},
|
|
1240
|
+
}, nt = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Tn(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, ge = (e = "rgb") => (t) => (t = nt(t, e)) !== void 0 ? (
|
|
1241
1241
|
// if the color's mode corresponds to our target mode
|
|
1242
1242
|
t.mode === e ? (
|
|
1243
1243
|
// then just return the color
|
|
@@ -1245,41 +1245,41 @@ const _n = (e, t) => {
|
|
|
1245
1245
|
) : (
|
|
1246
1246
|
// otherwise check to see if we have a dedicated
|
|
1247
1247
|
// converter for the target mode
|
|
1248
|
-
|
|
1248
|
+
he[t.mode][e] ? (
|
|
1249
1249
|
// and return its result...
|
|
1250
|
-
|
|
1250
|
+
he[t.mode][e](t)
|
|
1251
1251
|
) : (
|
|
1252
1252
|
// ...otherwise pass through RGB as an intermediary step.
|
|
1253
1253
|
// if the target mode is RGB...
|
|
1254
1254
|
e === "rgb" ? (
|
|
1255
1255
|
// just return the RGB
|
|
1256
|
-
|
|
1256
|
+
he[t.mode].rgb(t)
|
|
1257
1257
|
) : (
|
|
1258
1258
|
// otherwise convert color.mode -> RGB -> target_mode
|
|
1259
|
-
|
|
1259
|
+
he.rgb[e](he[t.mode].rgb(t))
|
|
1260
1260
|
)
|
|
1261
1261
|
)
|
|
1262
1262
|
)
|
|
1263
|
-
) : void 0,
|
|
1264
|
-
...
|
|
1263
|
+
) : void 0, he = {}, En = {}, ot = [], Sn = {}, hr = (e) => e, Ot = (e) => (he[e.mode] = {
|
|
1264
|
+
...he[e.mode],
|
|
1265
1265
|
...e.toMode
|
|
1266
1266
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
1267
|
-
|
|
1267
|
+
he[t] || (he[t] = {}), he[t][e.mode] = e.fromMode[t];
|
|
1268
1268
|
}), e.ranges || (e.ranges = {}), e.difference || (e.difference = {}), e.channels.forEach((t) => {
|
|
1269
1269
|
if (e.ranges[t] === void 0 && (e.ranges[t] = [0, 1]), !e.interpolate[t])
|
|
1270
1270
|
throw new Error(`Missing interpolator for: ${t}`);
|
|
1271
1271
|
typeof e.interpolate[t] == "function" && (e.interpolate[t] = {
|
|
1272
1272
|
use: e.interpolate[t]
|
|
1273
|
-
}), e.interpolate[t].fixup || (e.interpolate[t].fixup =
|
|
1274
|
-
}),
|
|
1275
|
-
|
|
1276
|
-
}),
|
|
1273
|
+
}), e.interpolate[t].fixup || (e.interpolate[t].fixup = hr);
|
|
1274
|
+
}), En[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
1275
|
+
gr(t, e.mode);
|
|
1276
|
+
}), ge(e.mode)), ct = (e) => En[e], gr = (e, t) => {
|
|
1277
1277
|
if (typeof e == "string") {
|
|
1278
1278
|
if (!t)
|
|
1279
1279
|
throw new Error("'mode' required when 'parser' is a string");
|
|
1280
|
-
|
|
1281
|
-
} else typeof e == "function" &&
|
|
1282
|
-
},
|
|
1280
|
+
Sn[e] = t;
|
|
1281
|
+
} else typeof e == "function" && ot.indexOf(e) < 0 && ot.push(e);
|
|
1282
|
+
}, Lt = /[^\x00-\x7F]|[a-zA-Z_]/, kr = /[^\x00-\x7F]|[-\w]/, E = {
|
|
1283
1283
|
Function: "function",
|
|
1284
1284
|
Ident: "ident",
|
|
1285
1285
|
Number: "number",
|
|
@@ -1290,55 +1290,55 @@ const _n = (e, t) => {
|
|
|
1290
1290
|
Alpha: "alpha"
|
|
1291
1291
|
};
|
|
1292
1292
|
let L = 0;
|
|
1293
|
-
function
|
|
1293
|
+
function Xe(e) {
|
|
1294
1294
|
let t = e[L], n = e[L + 1];
|
|
1295
1295
|
return t === "-" || t === "+" ? /\d/.test(n) || n === "." && /\d/.test(e[L + 2]) : t === "." ? /\d/.test(n) : /\d/.test(t);
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Pt(e) {
|
|
1298
1298
|
if (L >= e.length)
|
|
1299
1299
|
return !1;
|
|
1300
1300
|
let t = e[L];
|
|
1301
|
-
if (
|
|
1301
|
+
if (Lt.test(t))
|
|
1302
1302
|
return !0;
|
|
1303
1303
|
if (t === "-") {
|
|
1304
1304
|
if (e.length - L < 2)
|
|
1305
1305
|
return !1;
|
|
1306
1306
|
let n = e[L + 1];
|
|
1307
|
-
return !!(n === "-" ||
|
|
1307
|
+
return !!(n === "-" || Lt.test(n));
|
|
1308
1308
|
}
|
|
1309
1309
|
return !1;
|
|
1310
1310
|
}
|
|
1311
|
-
const
|
|
1311
|
+
const mr = {
|
|
1312
1312
|
deg: 1,
|
|
1313
1313
|
rad: 180 / Math.PI,
|
|
1314
1314
|
grad: 9 / 10,
|
|
1315
1315
|
turn: 360
|
|
1316
1316
|
};
|
|
1317
|
-
function
|
|
1317
|
+
function ze(e) {
|
|
1318
1318
|
let t = "";
|
|
1319
|
-
if ((e[L] === "-" || e[L] === "+") && (t += e[L++]), t +=
|
|
1320
|
-
let n =
|
|
1321
|
-
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: E.Hue, value: t *
|
|
1319
|
+
if ((e[L] === "-" || e[L] === "+") && (t += e[L++]), t += Ye(e), e[L] === "." && /\d/.test(e[L + 1]) && (t += e[L++] + Ye(e)), (e[L] === "e" || e[L] === "E") && ((e[L + 1] === "-" || e[L + 1] === "+") && /\d/.test(e[L + 2]) ? t += e[L++] + e[L++] + Ye(e) : /\d/.test(e[L + 1]) && (t += e[L++] + Ye(e))), Pt(e)) {
|
|
1320
|
+
let n = rt(e);
|
|
1321
|
+
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: E.Hue, value: t * mr[n] } : void 0;
|
|
1322
1322
|
}
|
|
1323
1323
|
return e[L] === "%" ? (L++, { type: E.Percentage, value: +t }) : { type: E.Number, value: +t };
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Ye(e) {
|
|
1326
1326
|
let t = "";
|
|
1327
1327
|
for (; /\d/.test(e[L]); )
|
|
1328
1328
|
t += e[L++];
|
|
1329
1329
|
return t;
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function rt(e) {
|
|
1332
1332
|
let t = "";
|
|
1333
|
-
for (; L < e.length &&
|
|
1333
|
+
for (; L < e.length && kr.test(e[L]); )
|
|
1334
1334
|
t += e[L++];
|
|
1335
1335
|
return t;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1338
|
-
let t =
|
|
1337
|
+
function br(e) {
|
|
1338
|
+
let t = rt(e);
|
|
1339
1339
|
return e[L] === "(" ? (L++, { type: E.Function, value: t }) : t === "none" ? { type: E.None, value: void 0 } : { type: E.Ident, value: t };
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function vr(e = "") {
|
|
1342
1342
|
let t = e.trim(), n = [], o;
|
|
1343
1343
|
for (L = 0; L < t.length; ) {
|
|
1344
1344
|
if (o = t[L++], o === `
|
|
@@ -1355,26 +1355,26 @@ function br(e = "") {
|
|
|
1355
1355
|
continue;
|
|
1356
1356
|
}
|
|
1357
1357
|
if (o === "+") {
|
|
1358
|
-
if (L--,
|
|
1359
|
-
n.push(
|
|
1358
|
+
if (L--, Xe(t)) {
|
|
1359
|
+
n.push(ze(t));
|
|
1360
1360
|
continue;
|
|
1361
1361
|
}
|
|
1362
1362
|
return;
|
|
1363
1363
|
}
|
|
1364
1364
|
if (o === "-") {
|
|
1365
|
-
if (L--,
|
|
1366
|
-
n.push(
|
|
1365
|
+
if (L--, Xe(t)) {
|
|
1366
|
+
n.push(ze(t));
|
|
1367
1367
|
continue;
|
|
1368
1368
|
}
|
|
1369
|
-
if (
|
|
1370
|
-
n.push({ type: E.Ident, value:
|
|
1369
|
+
if (Pt(t)) {
|
|
1370
|
+
n.push({ type: E.Ident, value: rt(t) });
|
|
1371
1371
|
continue;
|
|
1372
1372
|
}
|
|
1373
1373
|
return;
|
|
1374
1374
|
}
|
|
1375
1375
|
if (o === ".") {
|
|
1376
|
-
if (L--,
|
|
1377
|
-
n.push(
|
|
1376
|
+
if (L--, Xe(t)) {
|
|
1377
|
+
n.push(ze(t));
|
|
1378
1378
|
continue;
|
|
1379
1379
|
}
|
|
1380
1380
|
return;
|
|
@@ -1384,11 +1384,11 @@ function br(e = "") {
|
|
|
1384
1384
|
` || t[L] === " " || t[L] === " "); )
|
|
1385
1385
|
L++;
|
|
1386
1386
|
let a;
|
|
1387
|
-
if (
|
|
1387
|
+
if (Xe(t) && (a = ze(t), a.type !== E.Hue)) {
|
|
1388
1388
|
n.push({ type: E.Alpha, value: a });
|
|
1389
1389
|
continue;
|
|
1390
1390
|
}
|
|
1391
|
-
if (
|
|
1391
|
+
if (Pt(t) && rt(t) === "none") {
|
|
1392
1392
|
n.push({
|
|
1393
1393
|
type: E.Alpha,
|
|
1394
1394
|
value: { type: E.None, value: void 0 }
|
|
@@ -1398,34 +1398,34 @@ function br(e = "") {
|
|
|
1398
1398
|
return;
|
|
1399
1399
|
}
|
|
1400
1400
|
if (/\d/.test(o)) {
|
|
1401
|
-
L--, n.push(
|
|
1401
|
+
L--, n.push(ze(t));
|
|
1402
1402
|
continue;
|
|
1403
1403
|
}
|
|
1404
|
-
if (
|
|
1405
|
-
L--, n.push(
|
|
1404
|
+
if (Lt.test(o)) {
|
|
1405
|
+
L--, n.push(br(t));
|
|
1406
1406
|
continue;
|
|
1407
1407
|
}
|
|
1408
1408
|
return;
|
|
1409
1409
|
}
|
|
1410
1410
|
return n;
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function wr(e) {
|
|
1413
1413
|
e._i = 0;
|
|
1414
1414
|
let t = e[e._i++];
|
|
1415
1415
|
if (!t || t.type !== E.Function || t.value !== "color" || (t = e[e._i++], t.type !== E.Ident))
|
|
1416
1416
|
return;
|
|
1417
|
-
const n =
|
|
1417
|
+
const n = Sn[t.value];
|
|
1418
1418
|
if (!n)
|
|
1419
1419
|
return;
|
|
1420
|
-
const o = { mode: n }, a =
|
|
1420
|
+
const o = { mode: n }, a = Mn(e, !1);
|
|
1421
1421
|
if (!a)
|
|
1422
1422
|
return;
|
|
1423
|
-
const r =
|
|
1423
|
+
const r = ct(n).channels;
|
|
1424
1424
|
for (let i = 0, l, d; i < r.length; i++)
|
|
1425
1425
|
l = a[i], d = r[i], l.type !== E.None && (o[d] = l.type === E.Number ? l.value : l.value / 100, d === "alpha" && (o[d] = Math.max(0, Math.min(1, o[d]))));
|
|
1426
1426
|
return o;
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function Mn(e, t) {
|
|
1429
1429
|
const n = [];
|
|
1430
1430
|
let o;
|
|
1431
1431
|
for (; e._i < e.length; ) {
|
|
@@ -1449,26 +1449,26 @@ function En(e, t) {
|
|
|
1449
1449
|
return n.length === 3 && n.push({ type: E.None, value: void 0 }), n.every((a) => a.type !== E.Alpha) ? n : void 0;
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function xr(e, t) {
|
|
1453
1453
|
e._i = 0;
|
|
1454
1454
|
let n = e[e._i++];
|
|
1455
1455
|
if (!n || n.type !== E.Function)
|
|
1456
1456
|
return;
|
|
1457
|
-
let o =
|
|
1457
|
+
let o = Mn(e, t);
|
|
1458
1458
|
if (o)
|
|
1459
1459
|
return o.unshift(n.value), o;
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1461
|
+
const Tn = (e) => {
|
|
1462
1462
|
if (typeof e != "string")
|
|
1463
1463
|
return;
|
|
1464
|
-
const t =
|
|
1465
|
-
let o, a = 0, r =
|
|
1464
|
+
const t = vr(e), n = t ? xr(t, !0) : void 0;
|
|
1465
|
+
let o, a = 0, r = ot.length;
|
|
1466
1466
|
for (; a < r; )
|
|
1467
|
-
if ((o =
|
|
1467
|
+
if ((o = ot[a++](e, n)) !== void 0)
|
|
1468
1468
|
return o;
|
|
1469
|
-
return t ?
|
|
1469
|
+
return t ? wr(t) : void 0;
|
|
1470
1470
|
};
|
|
1471
|
-
function
|
|
1471
|
+
function yr(e, t) {
|
|
1472
1472
|
if (!t || t[0] !== "rgb" && t[0] !== "rgba")
|
|
1473
1473
|
return;
|
|
1474
1474
|
const n = { mode: "rgb" }, [, o, a, r, i] = t;
|
|
@@ -1481,81 +1481,81 @@ function xr(e, t) {
|
|
|
1481
1481
|
)
|
|
1482
1482
|
)), n;
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const Nr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0, _r = (e, t, n) => e + n * (t - e), Cr = (e) => {
|
|
1485
1485
|
let t = [];
|
|
1486
1486
|
for (let n = 0; n < e.length - 1; n++) {
|
|
1487
1487
|
let o = e[n], a = e[n + 1];
|
|
1488
1488
|
o === void 0 && a === void 0 ? t.push(void 0) : o !== void 0 && a !== void 0 ? t.push([o, a]) : t.push(o !== void 0 ? [o, o] : [a, a]);
|
|
1489
1489
|
}
|
|
1490
1490
|
return t;
|
|
1491
|
-
},
|
|
1492
|
-
let n =
|
|
1491
|
+
}, $r = (e) => (t) => {
|
|
1492
|
+
let n = Cr(t);
|
|
1493
1493
|
return (o) => {
|
|
1494
1494
|
let a = o * n.length, r = o >= 1 ? n.length - 1 : Math.max(Math.floor(a), 0), i = n[r];
|
|
1495
1495
|
return i === void 0 ? void 0 : e(i[0], i[1], a - r);
|
|
1496
1496
|
};
|
|
1497
|
-
},
|
|
1497
|
+
}, se = $r(_r), Dt = (e) => {
|
|
1498
1498
|
let t = !1, n = e.map((o) => o !== void 0 ? (t = !0, o) : 1);
|
|
1499
1499
|
return t ? n : e;
|
|
1500
|
-
},
|
|
1500
|
+
}, Er = {
|
|
1501
1501
|
mode: "rgb",
|
|
1502
1502
|
channels: ["r", "g", "b", "alpha"],
|
|
1503
1503
|
parse: [
|
|
1504
|
-
xr,
|
|
1505
|
-
sr,
|
|
1506
|
-
pr,
|
|
1507
|
-
ir,
|
|
1508
1504
|
yr,
|
|
1505
|
+
cr,
|
|
1506
|
+
fr,
|
|
1507
|
+
lr,
|
|
1508
|
+
Nr,
|
|
1509
1509
|
"srgb"
|
|
1510
1510
|
],
|
|
1511
1511
|
serialize: "srgb",
|
|
1512
1512
|
interpolate: {
|
|
1513
|
-
r:
|
|
1514
|
-
g:
|
|
1515
|
-
b:
|
|
1516
|
-
alpha: { use:
|
|
1513
|
+
r: se,
|
|
1514
|
+
g: se,
|
|
1515
|
+
b: se,
|
|
1516
|
+
alpha: { use: se, fixup: Dt }
|
|
1517
1517
|
},
|
|
1518
1518
|
gamut: !0,
|
|
1519
1519
|
white: { r: 1, g: 1, b: 1 },
|
|
1520
1520
|
black: { r: 0, g: 0, b: 0 }
|
|
1521
|
-
},
|
|
1521
|
+
}, $t = (e = 0) => {
|
|
1522
1522
|
const t = Math.abs(e);
|
|
1523
1523
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
1524
|
-
},
|
|
1524
|
+
}, An = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1525
1525
|
let a = {
|
|
1526
1526
|
mode: "lrgb",
|
|
1527
|
-
r:
|
|
1528
|
-
g:
|
|
1529
|
-
b:
|
|
1527
|
+
r: $t(e),
|
|
1528
|
+
g: $t(t),
|
|
1529
|
+
b: $t(n)
|
|
1530
1530
|
};
|
|
1531
1531
|
return o !== void 0 && (a.alpha = o), a;
|
|
1532
|
-
},
|
|
1532
|
+
}, Et = (e = 0) => {
|
|
1533
1533
|
const t = Math.abs(e);
|
|
1534
1534
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
1535
|
-
},
|
|
1535
|
+
}, Ln = ({ r: e, g: t, b: n, alpha: o }, a = "rgb") => {
|
|
1536
1536
|
let r = {
|
|
1537
1537
|
mode: a,
|
|
1538
|
-
r:
|
|
1539
|
-
g:
|
|
1540
|
-
b:
|
|
1538
|
+
r: Et(e),
|
|
1539
|
+
g: Et(t),
|
|
1540
|
+
b: Et(n)
|
|
1541
1541
|
};
|
|
1542
1542
|
return o !== void 0 && (r.alpha = o), r;
|
|
1543
|
-
},
|
|
1543
|
+
}, Ne = (e) => (e = e % 360) < 0 ? e + 360 : e, Sr = (e, t) => e.map((n, o, a) => {
|
|
1544
1544
|
if (n === void 0)
|
|
1545
1545
|
return n;
|
|
1546
|
-
let r =
|
|
1547
|
-
return o === 0 || e[o - 1] === void 0 ? r : t(r -
|
|
1548
|
-
}).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []),
|
|
1546
|
+
let r = Ne(n);
|
|
1547
|
+
return o === 0 || e[o - 1] === void 0 ? r : t(r - Ne(a[o - 1]));
|
|
1548
|
+
}).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []), Pn = (e) => Sr(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), Mr = (e, t) => {
|
|
1549
1549
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
|
|
1550
1550
|
return 0;
|
|
1551
|
-
let n =
|
|
1551
|
+
let n = Ne(e.h), o = Ne(t.h), a = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
1552
1552
|
return 2 * Math.sqrt(e.s * t.s) * a;
|
|
1553
|
-
},
|
|
1553
|
+
}, Tr = (e, t) => {
|
|
1554
1554
|
if (e.h === void 0 || t.h === void 0 || !e.c || !t.c)
|
|
1555
1555
|
return 0;
|
|
1556
|
-
let n =
|
|
1556
|
+
let n = Ne(e.h), o = Ne(t.h), a = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
1557
1557
|
return 2 * Math.sqrt(e.c * t.c) * a;
|
|
1558
|
-
},
|
|
1558
|
+
}, In = (e) => {
|
|
1559
1559
|
let t = e.reduce(
|
|
1560
1560
|
(o, a) => {
|
|
1561
1561
|
if (a !== void 0) {
|
|
@@ -1567,11 +1567,11 @@ const yr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1567
1567
|
{ sin: 0, cos: 0 }
|
|
1568
1568
|
), n = Math.atan2(t.sin, t.cos) * 180 / Math.PI;
|
|
1569
1569
|
return n < 0 ? 360 + n : n;
|
|
1570
|
-
},
|
|
1570
|
+
}, at = ({ l: e, a: t, b: n, alpha: o }, a = "lch") => {
|
|
1571
1571
|
t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1572
1572
|
let r = Math.sqrt(t * t + n * n), i = { mode: a, l: e, c: r };
|
|
1573
|
-
return r && (i.h =
|
|
1574
|
-
},
|
|
1573
|
+
return r && (i.h = Ne(Math.atan2(n, t) * 180 / Math.PI)), o !== void 0 && (i.alpha = o), i;
|
|
1574
|
+
}, it = ({ l: e, c: t, h: n, alpha: o }, a = "lab") => {
|
|
1575
1575
|
n === void 0 && (n = 0);
|
|
1576
1576
|
let r = {
|
|
1577
1577
|
mode: a,
|
|
@@ -1580,13 +1580,13 @@ const yr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1580
1580
|
b: t ? t * Math.sin(n / 180 * Math.PI) : 0
|
|
1581
1581
|
};
|
|
1582
1582
|
return o !== void 0 && (r.alpha = o), r;
|
|
1583
|
-
},
|
|
1583
|
+
}, Me = {
|
|
1584
1584
|
X: 0.3457 / 0.3585,
|
|
1585
1585
|
Y: 1,
|
|
1586
1586
|
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
1587
1587
|
};
|
|
1588
|
-
function
|
|
1589
|
-
e =
|
|
1588
|
+
function Ar({ h: e, s: t, l: n, alpha: o }) {
|
|
1589
|
+
e = Ne(e !== void 0 ? e : 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1590
1590
|
let a = n + t * (n < 0.5 ? n : 1 - n), r = a - (a - n) * 2 * Math.abs(e / 60 % 2 - 1), i;
|
|
1591
1591
|
switch (Math.floor(e / 60)) {
|
|
1592
1592
|
case 0:
|
|
@@ -1612,7 +1612,7 @@ function Tr({ h: e, s: t, l: n, alpha: o }) {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
return i.mode = "rgb", o !== void 0 && (i.alpha = o), i;
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function Lr({ r: e, g: t, b: n, alpha: o }) {
|
|
1616
1616
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1617
1617
|
let a = Math.max(e, t, n), r = Math.min(e, t, n), i = {
|
|
1618
1618
|
mode: "hsl",
|
|
@@ -1621,7 +1621,7 @@ function Ar({ r: e, g: t, b: n, alpha: o }) {
|
|
|
1621
1621
|
};
|
|
1622
1622
|
return a - r !== 0 && (i.h = (a === e ? (t - n) / (a - r) + (t < n) * 6 : a === t ? (n - e) / (a - r) + 2 : (e - t) / (a - r) + 4) * 60), o !== void 0 && (i.alpha = o), i;
|
|
1623
1623
|
}
|
|
1624
|
-
const
|
|
1624
|
+
const Pr = (e, t) => {
|
|
1625
1625
|
switch (t) {
|
|
1626
1626
|
case "deg":
|
|
1627
1627
|
return +e;
|
|
@@ -1632,15 +1632,15 @@ const Lr = (e, t) => {
|
|
|
1632
1632
|
case "turn":
|
|
1633
1633
|
return e * 360;
|
|
1634
1634
|
}
|
|
1635
|
-
},
|
|
1636
|
-
`^hsla?\\(\\s*${
|
|
1637
|
-
),
|
|
1638
|
-
let t = e.match(
|
|
1635
|
+
}, Ir = new RegExp(
|
|
1636
|
+
`^hsla?\\(\\s*${dr}${Le}${He}${Le}${He}\\s*(?:,\\s*${Rt}\\s*)?\\)$`
|
|
1637
|
+
), zr = (e) => {
|
|
1638
|
+
let t = e.match(Ir);
|
|
1639
1639
|
if (!t) return;
|
|
1640
1640
|
let n = { mode: "hsl" };
|
|
1641
|
-
return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h =
|
|
1641
|
+
return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h = Pr(t[1], t[2])), t[4] !== void 0 && (n.s = Math.min(Math.max(0, t[4] / 100), 1)), t[5] !== void 0 && (n.l = Math.min(Math.max(0, t[5] / 100), 1)), t[6] !== void 0 ? n.alpha = Math.max(0, Math.min(1, t[6] / 100)) : t[7] !== void 0 && (n.alpha = Math.max(0, Math.min(1, +t[7]))), n;
|
|
1642
1642
|
};
|
|
1643
|
-
function
|
|
1643
|
+
function Rr(e, t) {
|
|
1644
1644
|
if (!t || t[0] !== "hsl" && t[0] !== "hsla")
|
|
1645
1645
|
return;
|
|
1646
1646
|
const n = { mode: "hsl" }, [, o, a, r, i] = t;
|
|
@@ -1667,74 +1667,74 @@ function zr(e, t) {
|
|
|
1667
1667
|
)
|
|
1668
1668
|
)), n;
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1670
|
+
const Or = {
|
|
1671
1671
|
mode: "hsl",
|
|
1672
1672
|
toMode: {
|
|
1673
|
-
rgb:
|
|
1673
|
+
rgb: Ar
|
|
1674
1674
|
},
|
|
1675
1675
|
fromMode: {
|
|
1676
|
-
rgb:
|
|
1676
|
+
rgb: Lr
|
|
1677
1677
|
},
|
|
1678
1678
|
channels: ["h", "s", "l", "alpha"],
|
|
1679
1679
|
ranges: {
|
|
1680
1680
|
h: [0, 360]
|
|
1681
1681
|
},
|
|
1682
1682
|
gamut: "rgb",
|
|
1683
|
-
parse: [
|
|
1683
|
+
parse: [Rr, zr],
|
|
1684
1684
|
serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1685
1685
|
interpolate: {
|
|
1686
|
-
h: { use:
|
|
1687
|
-
s:
|
|
1688
|
-
l:
|
|
1689
|
-
alpha: { use:
|
|
1686
|
+
h: { use: se, fixup: Pn },
|
|
1687
|
+
s: se,
|
|
1688
|
+
l: se,
|
|
1689
|
+
alpha: { use: se, fixup: Dt }
|
|
1690
1690
|
},
|
|
1691
1691
|
difference: {
|
|
1692
|
-
h:
|
|
1692
|
+
h: Mr
|
|
1693
1693
|
},
|
|
1694
1694
|
average: {
|
|
1695
|
-
h:
|
|
1695
|
+
h: In
|
|
1696
1696
|
}
|
|
1697
|
-
},
|
|
1698
|
-
let
|
|
1699
|
-
const
|
|
1697
|
+
}, zn = Math.pow(29, 3) / Math.pow(3, 3), Rn = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1698
|
+
let St = (e) => Math.pow(e, 3) > Rn ? Math.pow(e, 3) : (116 * e - 16) / zn;
|
|
1699
|
+
const Dr = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1700
1700
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1701
1701
|
let a = (e + 16) / 116, r = t / 500 + a, i = a - n / 200, l = {
|
|
1702
1702
|
mode: "xyz50",
|
|
1703
|
-
x:
|
|
1704
|
-
y:
|
|
1705
|
-
z:
|
|
1703
|
+
x: St(r) * Me.X,
|
|
1704
|
+
y: St(a) * Me.Y,
|
|
1705
|
+
z: St(i) * Me.Z
|
|
1706
1706
|
};
|
|
1707
1707
|
return o !== void 0 && (l.alpha = o), l;
|
|
1708
|
-
},
|
|
1708
|
+
}, Vr = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1709
1709
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1710
|
-
let a =
|
|
1710
|
+
let a = Ln({
|
|
1711
1711
|
r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * n,
|
|
1712
1712
|
g: e * -0.978795502912089 + t * 1.916254567259524 + 0.03344273116131949 * n,
|
|
1713
1713
|
b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * n
|
|
1714
1714
|
});
|
|
1715
1715
|
return o !== void 0 && (a.alpha = o), a;
|
|
1716
|
-
},
|
|
1717
|
-
let { r: t, g: n, b: o, alpha: a } =
|
|
1716
|
+
}, Hr = (e) => Vr(Dr(e)), Br = (e) => {
|
|
1717
|
+
let { r: t, g: n, b: o, alpha: a } = An(e), r = {
|
|
1718
1718
|
mode: "xyz50",
|
|
1719
1719
|
x: 0.436065742824811 * t + 0.3851514688337912 * n + 0.14307845442264197 * o,
|
|
1720
1720
|
y: 0.22249319175623702 * t + 0.7168870538238823 * n + 0.06061979053616537 * o,
|
|
1721
1721
|
z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * o
|
|
1722
1722
|
};
|
|
1723
1723
|
return a !== void 0 && (r.alpha = a), r;
|
|
1724
|
-
},
|
|
1724
|
+
}, Mt = (e) => e > Rn ? Math.cbrt(e) : (zn * e + 16) / 116, Fr = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1725
1725
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1726
|
-
let a =
|
|
1726
|
+
let a = Mt(e / Me.X), r = Mt(t / Me.Y), i = Mt(n / Me.Z), l = {
|
|
1727
1727
|
mode: "lab",
|
|
1728
1728
|
l: 116 * r - 16,
|
|
1729
1729
|
a: 500 * (a - r),
|
|
1730
1730
|
b: 200 * (r - i)
|
|
1731
1731
|
};
|
|
1732
1732
|
return o !== void 0 && (l.alpha = o), l;
|
|
1733
|
-
},
|
|
1734
|
-
let t = Br(
|
|
1733
|
+
}, Kr = (e) => {
|
|
1734
|
+
let t = Fr(Br(e));
|
|
1735
1735
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1736
1736
|
};
|
|
1737
|
-
function
|
|
1737
|
+
function jr(e, t) {
|
|
1738
1738
|
if (!t || t[0] !== "lch")
|
|
1739
1739
|
return;
|
|
1740
1740
|
const n = { mode: "lch" }, [, o, a, r, i] = t;
|
|
@@ -1759,15 +1759,15 @@ function Kr(e, t) {
|
|
|
1759
1759
|
)
|
|
1760
1760
|
)), n;
|
|
1761
1761
|
}
|
|
1762
|
-
const
|
|
1762
|
+
const Wr = {
|
|
1763
1763
|
mode: "lch",
|
|
1764
1764
|
toMode: {
|
|
1765
|
-
lab:
|
|
1766
|
-
rgb: (e) =>
|
|
1765
|
+
lab: it,
|
|
1766
|
+
rgb: (e) => Hr(it(e))
|
|
1767
1767
|
},
|
|
1768
1768
|
fromMode: {
|
|
1769
|
-
rgb: (e) =>
|
|
1770
|
-
lab:
|
|
1769
|
+
rgb: (e) => at(Kr(e)),
|
|
1770
|
+
lab: at
|
|
1771
1771
|
},
|
|
1772
1772
|
channels: ["l", "c", "h", "alpha"],
|
|
1773
1773
|
ranges: {
|
|
@@ -1775,21 +1775,21 @@ const jr = {
|
|
|
1775
1775
|
c: [0, 150],
|
|
1776
1776
|
h: [0, 360]
|
|
1777
1777
|
},
|
|
1778
|
-
parse: [
|
|
1778
|
+
parse: [jr],
|
|
1779
1779
|
serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1780
1780
|
interpolate: {
|
|
1781
|
-
h: { use:
|
|
1782
|
-
c:
|
|
1783
|
-
l:
|
|
1784
|
-
alpha: { use:
|
|
1781
|
+
h: { use: se, fixup: Pn },
|
|
1782
|
+
c: se,
|
|
1783
|
+
l: se,
|
|
1784
|
+
alpha: { use: se, fixup: Dt }
|
|
1785
1785
|
},
|
|
1786
1786
|
difference: {
|
|
1787
|
-
h:
|
|
1787
|
+
h: Tr
|
|
1788
1788
|
},
|
|
1789
1789
|
average: {
|
|
1790
|
-
h:
|
|
1790
|
+
h: In
|
|
1791
1791
|
}
|
|
1792
|
-
},
|
|
1792
|
+
}, Xr = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1793
1793
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1794
1794
|
let a = Math.cbrt(
|
|
1795
1795
|
0.412221469470763 * e + 0.5363325372617348 * t + 0.0514459932675022 * n
|
|
@@ -1804,10 +1804,10 @@ const jr = {
|
|
|
1804
1804
|
b: 0.0259040424655478 * a + 0.7827717124575296 * r - 0.8086757549230774 * i
|
|
1805
1805
|
};
|
|
1806
1806
|
return o !== void 0 && (l.alpha = o), l;
|
|
1807
|
-
},
|
|
1808
|
-
let t =
|
|
1807
|
+
}, Yr = (e) => {
|
|
1808
|
+
let t = Xr(An(e));
|
|
1809
1809
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1810
|
-
},
|
|
1810
|
+
}, qr = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1811
1811
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1812
1812
|
let a = Math.pow(e + 0.3963377773761749 * t + 0.2158037573099136 * n, 3), r = Math.pow(e - 0.1055613458156586 * t - 0.0638541728258133 * n, 3), i = Math.pow(e - 0.0894841775298119 * t - 1.2914855480194092 * n, 3), l = {
|
|
1813
1813
|
mode: "lrgb",
|
|
@@ -1816,8 +1816,8 @@ const jr = {
|
|
|
1816
1816
|
b: -0.0041960761386756 * a - 0.7034186179359362 * r + 1.7076146940746117 * i
|
|
1817
1817
|
};
|
|
1818
1818
|
return o !== void 0 && (l.alpha = o), l;
|
|
1819
|
-
},
|
|
1820
|
-
function
|
|
1819
|
+
}, Gr = (e) => Ln(qr(e));
|
|
1820
|
+
function Jr(e, t) {
|
|
1821
1821
|
if (!t || t[0] !== "oklch")
|
|
1822
1822
|
return;
|
|
1823
1823
|
const n = { mode: "oklch" }, [, o, a, r, i] = t;
|
|
@@ -1845,35 +1845,35 @@ function Gr(e, t) {
|
|
|
1845
1845
|
)
|
|
1846
1846
|
)), n;
|
|
1847
1847
|
}
|
|
1848
|
-
const
|
|
1849
|
-
...
|
|
1848
|
+
const Ur = {
|
|
1849
|
+
...Wr,
|
|
1850
1850
|
mode: "oklch",
|
|
1851
1851
|
toMode: {
|
|
1852
|
-
oklab: (e) =>
|
|
1853
|
-
rgb: (e) =>
|
|
1852
|
+
oklab: (e) => it(e, "oklab"),
|
|
1853
|
+
rgb: (e) => Gr(it(e, "oklab"))
|
|
1854
1854
|
},
|
|
1855
1855
|
fromMode: {
|
|
1856
|
-
rgb: (e) =>
|
|
1857
|
-
oklab: (e) =>
|
|
1856
|
+
rgb: (e) => at(Yr(e), "oklch"),
|
|
1857
|
+
oklab: (e) => at(e, "oklch")
|
|
1858
1858
|
},
|
|
1859
|
-
parse: [
|
|
1859
|
+
parse: [Jr],
|
|
1860
1860
|
serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1861
1861
|
ranges: {
|
|
1862
1862
|
l: [0, 1],
|
|
1863
1863
|
c: [0, 0.4],
|
|
1864
1864
|
h: [0, 360]
|
|
1865
1865
|
}
|
|
1866
|
-
},
|
|
1866
|
+
}, Zr = (e) => Math.max(0, Math.min(1, e || 0)), et = (e) => Math.round(Zr(e) * 255), On = ge("rgb"), Dn = (e) => {
|
|
1867
1867
|
if (e === void 0)
|
|
1868
1868
|
return;
|
|
1869
|
-
let t =
|
|
1869
|
+
let t = et(e.r), n = et(e.g), o = et(e.b);
|
|
1870
1870
|
return "#" + (1 << 24 | t << 16 | n << 8 | o).toString(16).slice(1);
|
|
1871
|
-
},
|
|
1871
|
+
}, Qr = (e) => {
|
|
1872
1872
|
if (e === void 0)
|
|
1873
1873
|
return;
|
|
1874
|
-
let t =
|
|
1875
|
-
return
|
|
1876
|
-
},
|
|
1874
|
+
let t = et(e.alpha !== void 0 ? e.alpha : 1);
|
|
1875
|
+
return Dn(e) + (256 | t).toString(16).slice(1);
|
|
1876
|
+
}, ea = (e) => Dn(On(e)), ta = (e) => Qr(On(e)), Vn = ge("rgb"), Hn = (e) => {
|
|
1877
1877
|
const t = {
|
|
1878
1878
|
mode: e.mode,
|
|
1879
1879
|
r: Math.max(0, Math.min(e.r !== void 0 ? e.r : 0, 1)),
|
|
@@ -1881,54 +1881,54 @@ const Jr = {
|
|
|
1881
1881
|
b: Math.max(0, Math.min(e.b !== void 0 ? e.b : 0, 1))
|
|
1882
1882
|
};
|
|
1883
1883
|
return e.alpha !== void 0 && (t.alpha = e.alpha), t;
|
|
1884
|
-
},
|
|
1885
|
-
function
|
|
1886
|
-
return Vn(
|
|
1884
|
+
}, na = (e) => Hn(Vn(e)), Bn = (e) => e !== void 0 && (e.r === void 0 || e.r >= 0 && e.r <= 1) && (e.g === void 0 || e.g >= 0 && e.g <= 1) && (e.b === void 0 || e.b >= 0 && e.b <= 1);
|
|
1885
|
+
function oa(e) {
|
|
1886
|
+
return Bn(Vn(e));
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const { gamut: t } =
|
|
1888
|
+
function Vt(e = "rgb") {
|
|
1889
|
+
const { gamut: t } = ct(e);
|
|
1890
1890
|
if (!t)
|
|
1891
1891
|
return (o) => !0;
|
|
1892
|
-
const n =
|
|
1893
|
-
return (o) =>
|
|
1892
|
+
const n = ge(typeof t == "string" ? t : e);
|
|
1893
|
+
return (o) => Bn(n(o));
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1896
|
-
const { gamut: t } =
|
|
1895
|
+
function ra(e = "rgb") {
|
|
1896
|
+
const { gamut: t } = ct(e);
|
|
1897
1897
|
if (!t)
|
|
1898
|
-
return (r) =>
|
|
1899
|
-
const n = typeof t == "string" ? t : e, o =
|
|
1898
|
+
return (r) => nt(r);
|
|
1899
|
+
const n = typeof t == "string" ? t : e, o = ge(n), a = Vt(n);
|
|
1900
1900
|
return (r) => {
|
|
1901
|
-
const i =
|
|
1901
|
+
const i = nt(r);
|
|
1902
1902
|
if (!i)
|
|
1903
1903
|
return;
|
|
1904
1904
|
const l = o(i);
|
|
1905
1905
|
if (a(l))
|
|
1906
1906
|
return i;
|
|
1907
|
-
const d =
|
|
1908
|
-
return i.mode === d.mode ? d :
|
|
1907
|
+
const d = Hn(l);
|
|
1908
|
+
return i.mode === d.mode ? d : ge(i.mode)(d);
|
|
1909
1909
|
};
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1912
|
-
e =
|
|
1913
|
-
let o = n === "rgb" ?
|
|
1911
|
+
function aa(e, t = "lch", n = "rgb") {
|
|
1912
|
+
e = nt(e);
|
|
1913
|
+
let o = n === "rgb" ? oa : Vt(n), a = n === "rgb" ? na : ra(n);
|
|
1914
1914
|
if (e === void 0 || o(e)) return e;
|
|
1915
|
-
let r =
|
|
1916
|
-
e =
|
|
1915
|
+
let r = ge(e.mode);
|
|
1916
|
+
e = ge(t)(e);
|
|
1917
1917
|
let i = { ...e, c: 0 };
|
|
1918
1918
|
if (!o(i))
|
|
1919
1919
|
return r(a(i));
|
|
1920
|
-
let l = 0, d = e.c !== void 0 ? e.c : 0, c =
|
|
1920
|
+
let l = 0, d = e.c !== void 0 ? e.c : 0, c = ct(t).ranges.c, u = (c[1] - c[0]) / Math.pow(2, 13), p = i.c;
|
|
1921
1921
|
for (; d - l > u; )
|
|
1922
1922
|
i.c = l + (d - l) * 0.5, o(i) ? (p = i.c, l = i.c) : d = i.c;
|
|
1923
1923
|
return r(
|
|
1924
1924
|
o(i) ? i : { ...i, c: p }
|
|
1925
1925
|
);
|
|
1926
1926
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
const
|
|
1931
|
-
function
|
|
1927
|
+
Ot(Ur);
|
|
1928
|
+
Ot(Er);
|
|
1929
|
+
Ot(Or);
|
|
1930
|
+
const Fn = 0.37, Kn = ge("oklch"), jn = ge("rgb"), ia = Vt("rgb");
|
|
1931
|
+
function Ht(e) {
|
|
1932
1932
|
return {
|
|
1933
1933
|
mode: "oklch",
|
|
1934
1934
|
l: e.l / 100,
|
|
@@ -1937,7 +1937,7 @@ function Vt(e) {
|
|
|
1937
1937
|
alpha: e.a / 100
|
|
1938
1938
|
};
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function la(e) {
|
|
1941
1941
|
return {
|
|
1942
1942
|
l: (e.l ?? 0) * 100,
|
|
1943
1943
|
c: e.c ?? 0,
|
|
@@ -1952,12 +1952,12 @@ function te(e) {
|
|
|
1952
1952
|
const a = (e.a / 100).toFixed(4);
|
|
1953
1953
|
return `oklch(${t} ${n} ${o} / ${a})`;
|
|
1954
1954
|
}
|
|
1955
|
-
function
|
|
1955
|
+
function sa(e) {
|
|
1956
1956
|
const t = { l: 0, c: 0, h: 0, a: 100 };
|
|
1957
1957
|
try {
|
|
1958
|
-
const n =
|
|
1958
|
+
const n = Tn(e);
|
|
1959
1959
|
if (!n) return t;
|
|
1960
|
-
const o =
|
|
1960
|
+
const o = Kn(n);
|
|
1961
1961
|
if (!o) return t;
|
|
1962
1962
|
const a = o.alpha === void 0 ? 1 : o.alpha;
|
|
1963
1963
|
return {
|
|
@@ -1970,22 +1970,22 @@ function la(e) {
|
|
|
1970
1970
|
return t;
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1974
|
-
const n =
|
|
1975
|
-
return o ? e.a < 100 ?
|
|
1973
|
+
function Ut(e, t) {
|
|
1974
|
+
const n = Ht(e), o = jn(n);
|
|
1975
|
+
return o ? e.a < 100 ? ta({ ...o, alpha: e.a / 100 }) ?? "#000000ff" : ea(o) ?? "#000000" : "#000000";
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function xe(e) {
|
|
1978
1978
|
const t = {
|
|
1979
1979
|
mode: "hsl",
|
|
1980
1980
|
h: e.h,
|
|
1981
1981
|
s: e.s / 100,
|
|
1982
1982
|
l: e.l / 100,
|
|
1983
1983
|
alpha: e.a / 100
|
|
1984
|
-
}, n =
|
|
1985
|
-
return n ?
|
|
1984
|
+
}, n = Kn(t);
|
|
1985
|
+
return n ? la(n) : { l: 0, c: 0, h: 0, a: e.a };
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1988
|
-
const t =
|
|
1987
|
+
function Zt(e) {
|
|
1988
|
+
const t = Ht(e), n = aa(t, "oklch", "rgb");
|
|
1989
1989
|
return n ? {
|
|
1990
1990
|
l: (n.l ?? e.l / 100) * 100,
|
|
1991
1991
|
c: n.c ?? 0,
|
|
@@ -1993,19 +1993,19 @@ function Jt(e) {
|
|
|
1993
1993
|
a: e.a
|
|
1994
1994
|
} : { l: e.l, c: 0, h: e.h, a: e.a };
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const t =
|
|
1998
|
-
return t ?
|
|
1996
|
+
function ca(e) {
|
|
1997
|
+
const t = jn(Ht(e));
|
|
1998
|
+
return t ? ia(t) : !1;
|
|
1999
1999
|
}
|
|
2000
|
-
function
|
|
2000
|
+
function qe(e, t, n) {
|
|
2001
2001
|
return Math.min(n, Math.max(t, e));
|
|
2002
2002
|
}
|
|
2003
|
-
function
|
|
2003
|
+
function da(e, t, n) {
|
|
2004
2004
|
if (n <= 0) return e;
|
|
2005
2005
|
const o = Math.round((e - t) / n);
|
|
2006
2006
|
return t + o * n;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function Qt({
|
|
2009
2009
|
config: e,
|
|
2010
2010
|
value: t,
|
|
2011
2011
|
gradient: n,
|
|
@@ -2015,7 +2015,7 @@ function Ut({
|
|
|
2015
2015
|
}) {
|
|
2016
2016
|
const { label: i, ariaLabel: l, min: d, max: c, step: u, format: p } = e, f = O(u);
|
|
2017
2017
|
f.current = u;
|
|
2018
|
-
const
|
|
2018
|
+
const g = O(!1), _ = O(null), b = qe((t - d) / (c - d), 0, 1), v = O(o);
|
|
2019
2019
|
v.current = o;
|
|
2020
2020
|
const h = O(a);
|
|
2021
2021
|
h.current = a;
|
|
@@ -2030,14 +2030,14 @@ function Ut({
|
|
|
2030
2030
|
if (!N) return null;
|
|
2031
2031
|
const S = N.getBoundingClientRect();
|
|
2032
2032
|
if (S.width === 0) return null;
|
|
2033
|
-
const B =
|
|
2034
|
-
return
|
|
2033
|
+
const B = qe((m - S.left) / S.width, 0, 1), j = M.current + B * (A.current - M.current), Y = da(j, M.current, f.current);
|
|
2034
|
+
return qe(Y, M.current, A.current);
|
|
2035
2035
|
}
|
|
2036
2036
|
X(() => {
|
|
2037
2037
|
const m = _.current;
|
|
2038
2038
|
if (!m) return;
|
|
2039
2039
|
function N(Y) {
|
|
2040
|
-
|
|
2040
|
+
g.current = !0, h.current();
|
|
2041
2041
|
try {
|
|
2042
2042
|
m.setPointerCapture(Y.pointerId);
|
|
2043
2043
|
} catch {
|
|
@@ -2046,13 +2046,13 @@ function Ut({
|
|
|
2046
2046
|
Q !== null && v.current(Q);
|
|
2047
2047
|
}
|
|
2048
2048
|
function S(Y) {
|
|
2049
|
-
if (!
|
|
2049
|
+
if (!g.current) return;
|
|
2050
2050
|
const Q = C(Y.clientX);
|
|
2051
2051
|
Q !== null && v.current(Q);
|
|
2052
2052
|
}
|
|
2053
2053
|
function B(Y) {
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2054
|
+
if (g.current) {
|
|
2055
|
+
g.current = !1;
|
|
2056
2056
|
try {
|
|
2057
2057
|
m.releasePointerCapture(Y.pointerId);
|
|
2058
2058
|
} catch {
|
|
@@ -2061,8 +2061,8 @@ function Ut({
|
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
2063
|
function j(Y) {
|
|
2064
|
-
if (
|
|
2065
|
-
|
|
2064
|
+
if (g.current) {
|
|
2065
|
+
g.current = !1;
|
|
2066
2066
|
try {
|
|
2067
2067
|
m.releasePointerCapture(Y.pointerId);
|
|
2068
2068
|
} catch {
|
|
@@ -2096,13 +2096,13 @@ function Ut({
|
|
|
2096
2096
|
default:
|
|
2097
2097
|
return;
|
|
2098
2098
|
}
|
|
2099
|
-
m.preventDefault(), o(
|
|
2099
|
+
m.preventDefault(), o(qe(t + S, d, c));
|
|
2100
2100
|
},
|
|
2101
2101
|
[t, d, c, u, o]
|
|
2102
2102
|
);
|
|
2103
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-slider-row", children: [
|
|
2104
2104
|
/* @__PURE__ */ s("span", { className: "tokenpanel-color-picker-slider-label", children: i }),
|
|
2105
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ k(
|
|
2106
2106
|
"div",
|
|
2107
2107
|
{
|
|
2108
2108
|
ref: _,
|
|
@@ -2136,8 +2136,8 @@ function Ut({
|
|
|
2136
2136
|
/* @__PURE__ */ s("span", { className: "tokenpanel-color-picker-slider-value", children: p(t) })
|
|
2137
2137
|
] });
|
|
2138
2138
|
}
|
|
2139
|
-
const
|
|
2140
|
-
function
|
|
2139
|
+
const Wn = "tokenpanel.colorPicker.mode", It = [95, 78, 61, 44, 27, 10], ua = [0, 60, 120, 180, 240, 300], pa = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], fa = 0.18, ha = 320, ga = 400, ka = 520, ma = 440;
|
|
2140
|
+
function ba() {
|
|
2141
2141
|
return [
|
|
2142
2142
|
{
|
|
2143
2143
|
key: "l",
|
|
@@ -2153,7 +2153,7 @@ function ma() {
|
|
|
2153
2153
|
label: "C",
|
|
2154
2154
|
ariaLabel: "Chroma",
|
|
2155
2155
|
min: 0,
|
|
2156
|
-
max:
|
|
2156
|
+
max: Fn,
|
|
2157
2157
|
step: 1e-3,
|
|
2158
2158
|
format: (e) => e.toFixed(3)
|
|
2159
2159
|
},
|
|
@@ -2177,7 +2177,7 @@ function ma() {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
];
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function va() {
|
|
2181
2181
|
return [
|
|
2182
2182
|
{
|
|
2183
2183
|
key: "h",
|
|
@@ -2217,47 +2217,47 @@ function ba() {
|
|
|
2217
2217
|
}
|
|
2218
2218
|
];
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function en(e, t, n, o) {
|
|
2221
2221
|
return {
|
|
2222
|
-
l:
|
|
2223
|
-
c:
|
|
2222
|
+
l: It[e] ?? 50,
|
|
2223
|
+
c: fa,
|
|
2224
2224
|
h: o[t] ?? 0,
|
|
2225
2225
|
a: n
|
|
2226
2226
|
};
|
|
2227
2227
|
}
|
|
2228
|
-
function
|
|
2228
|
+
function wa(e) {
|
|
2229
2229
|
if (typeof window > "u") return e;
|
|
2230
2230
|
try {
|
|
2231
|
-
const t = window.localStorage.getItem(
|
|
2231
|
+
const t = window.localStorage.getItem(Wn);
|
|
2232
2232
|
if (t === "oklch" || t === "hsl") return t;
|
|
2233
2233
|
} catch {
|
|
2234
2234
|
}
|
|
2235
2235
|
return e;
|
|
2236
2236
|
}
|
|
2237
|
-
function
|
|
2237
|
+
function xa(e) {
|
|
2238
2238
|
if (!(typeof window > "u"))
|
|
2239
2239
|
try {
|
|
2240
|
-
window.localStorage.setItem(
|
|
2240
|
+
window.localStorage.setItem(Wn, e);
|
|
2241
2241
|
} catch {
|
|
2242
2242
|
}
|
|
2243
2243
|
}
|
|
2244
|
-
function
|
|
2244
|
+
function ya(e, t) {
|
|
2245
2245
|
const [n, o] = K(e);
|
|
2246
2246
|
return X(() => {
|
|
2247
2247
|
t.current || o(e);
|
|
2248
2248
|
}, [e, t]), [n, o];
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function Xn(e, t, n) {
|
|
2251
2251
|
if (!e) return { position: "fixed" };
|
|
2252
2252
|
const o = e.getBoundingClientRect(), a = 4, r = 8, i = window.innerWidth, l = window.innerHeight, d = l - o.bottom - a - r, c = o.top - a - r, u = d < n && c > d;
|
|
2253
2253
|
let p = o.left;
|
|
2254
2254
|
p + t > i - r && (p = i - r - t), p < r && (p = r);
|
|
2255
2255
|
let f;
|
|
2256
2256
|
u ? f = o.top - a - n : f = o.bottom + a, f < r && (f = r), f + n > l - r && (f = l - r - n);
|
|
2257
|
-
const
|
|
2258
|
-
return n > l - 2 * r && (
|
|
2257
|
+
const g = { position: "fixed", left: p, top: f };
|
|
2258
|
+
return n > l - 2 * r && (g.top = r, g.maxHeight = l - 2 * r, g.overflowY = "auto"), g;
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2260
|
+
function Yn(e, t) {
|
|
2261
2261
|
const n = O(t);
|
|
2262
2262
|
n.current = t, X(() => {
|
|
2263
2263
|
function o(r) {
|
|
@@ -2271,7 +2271,7 @@ function Wn(e, t) {
|
|
|
2271
2271
|
};
|
|
2272
2272
|
}, []);
|
|
2273
2273
|
}
|
|
2274
|
-
function
|
|
2274
|
+
function qn({
|
|
2275
2275
|
color: e,
|
|
2276
2276
|
onChange: t,
|
|
2277
2277
|
label: n,
|
|
@@ -2279,15 +2279,15 @@ function Xn({
|
|
|
2279
2279
|
anchorRef: a,
|
|
2280
2280
|
onClose: r
|
|
2281
2281
|
}) {
|
|
2282
|
-
const i = O(null), l = O(null), d = O(!1), [c, u] =
|
|
2282
|
+
const i = O(null), l = O(null), d = O(!1), [c, u] = ya(e, d), [p, f] = K(
|
|
2283
2283
|
null
|
|
2284
|
-
),
|
|
2285
|
-
() =>
|
|
2284
|
+
), g = O(null), _ = O(!1), [b, v] = K(
|
|
2285
|
+
() => wa(o)
|
|
2286
2286
|
), [h, y] = K("mini"), [M, A] = K(c);
|
|
2287
2287
|
X(() => {
|
|
2288
2288
|
(/^#[0-9a-fA-F]{6}$/.test(M) || /^#[0-9a-fA-F]{8}$/.test(M)) && A(c);
|
|
2289
|
-
}, [c]),
|
|
2290
|
-
const C = Z(() =>
|
|
2289
|
+
}, [c]), Yn(i, r);
|
|
2290
|
+
const C = Z(() => sa(c), [c]), x = Z(() => rr(c), [c]), m = R(
|
|
2291
2291
|
(w) => {
|
|
2292
2292
|
const z = w.toLowerCase();
|
|
2293
2293
|
u(z), A(z), t(z);
|
|
@@ -2301,7 +2301,7 @@ function Xn({
|
|
|
2301
2301
|
h: w.h ?? C.h,
|
|
2302
2302
|
a: w.a ?? C.a
|
|
2303
2303
|
};
|
|
2304
|
-
m(
|
|
2304
|
+
m(Ut(z));
|
|
2305
2305
|
},
|
|
2306
2306
|
[C, m]
|
|
2307
2307
|
), S = R(
|
|
@@ -2312,15 +2312,15 @@ function Xn({
|
|
|
2312
2312
|
l: w.l ?? x.l,
|
|
2313
2313
|
a: w.a ?? x.a
|
|
2314
2314
|
};
|
|
2315
|
-
m(
|
|
2315
|
+
m(ar(z.h, z.s, z.l, z.a));
|
|
2316
2316
|
},
|
|
2317
2317
|
[x, m]
|
|
2318
2318
|
), B = (w) => {
|
|
2319
2319
|
A(w), (/^#[0-9a-fA-F]{6}$/.test(w) || /^#[0-9a-fA-F]{8}$/.test(w)) && m(w);
|
|
2320
|
-
}, j = h === "expanded" ?
|
|
2320
|
+
}, j = h === "expanded" ? pa : ua, Y = R(
|
|
2321
2321
|
(w, z) => {
|
|
2322
|
-
const U =
|
|
2323
|
-
m(
|
|
2322
|
+
const U = en(w, z, C.a, j), F = Zt(U);
|
|
2323
|
+
m(Ut(F));
|
|
2324
2324
|
},
|
|
2325
2325
|
[C.a, j, m]
|
|
2326
2326
|
), Q = R(
|
|
@@ -2330,7 +2330,7 @@ function Xn({
|
|
|
2330
2330
|
W = Math.min(j.length - 1, U + 1);
|
|
2331
2331
|
else if (w.key === "ArrowLeft") W = Math.max(0, U - 1);
|
|
2332
2332
|
else if (w.key === "ArrowDown")
|
|
2333
|
-
F = Math.min(
|
|
2333
|
+
F = Math.min(It.length - 1, z + 1);
|
|
2334
2334
|
else if (w.key === "ArrowUp") F = Math.max(0, z - 1);
|
|
2335
2335
|
else if (w.key === "Enter" || w.key === " ") {
|
|
2336
2336
|
w.preventDefault(), Y(z, U);
|
|
@@ -2341,33 +2341,33 @@ function Xn({
|
|
|
2341
2341
|
)?.focus();
|
|
2342
2342
|
},
|
|
2343
2343
|
[j, Y]
|
|
2344
|
-
),
|
|
2345
|
-
|
|
2346
|
-
}, oe = Z(() =>
|
|
2344
|
+
), ce = (w) => {
|
|
2345
|
+
xa(w), v(w);
|
|
2346
|
+
}, oe = Z(() => ba(), []), ve = Z(() => va(), []), pe = Z(() => b === "oklch" ? {
|
|
2347
2347
|
l: `linear-gradient(90deg in oklch, ${te({ l: 0, c: C.c, h: C.h, a: 100 })}, ${te({ l: 100, c: C.c, h: C.h, a: 100 })})`,
|
|
2348
|
-
c: `linear-gradient(90deg in oklch, ${te({ l: C.l, c: 0, h: C.h, a: 100 })}, ${te({ l: C.l, c:
|
|
2348
|
+
c: `linear-gradient(90deg in oklch, ${te({ l: C.l, c: 0, h: C.h, a: 100 })}, ${te({ l: C.l, c: Fn, h: C.h, a: 100 })})`,
|
|
2349
2349
|
h: `linear-gradient(90deg in oklch longer hue, ${te({ l: C.l, c: C.c, h: 0, a: 100 })}, ${te({ l: C.l, c: C.c, h: 360, a: 100 })})`,
|
|
2350
2350
|
a: `linear-gradient(90deg in oklch, ${te({ ...C, a: 0 })}, ${te({ ...C, a: 100 })})`
|
|
2351
2351
|
} : {
|
|
2352
|
-
h: `linear-gradient(90deg in oklch longer hue, ${te(
|
|
2353
|
-
s: `linear-gradient(90deg in oklch, ${te(
|
|
2354
|
-
l: `linear-gradient(90deg in oklch, ${te(
|
|
2355
|
-
a: `linear-gradient(90deg in oklch, ${te(
|
|
2356
|
-
}, [b, C, x]), [
|
|
2352
|
+
h: `linear-gradient(90deg in oklch longer hue, ${te(xe({ h: 0, s: x.s, l: x.l, a: 100 }))}, ${te(xe({ h: 360, s: x.s, l: x.l, a: 100 }))})`,
|
|
2353
|
+
s: `linear-gradient(90deg in oklch, ${te(xe({ h: x.h, s: 0, l: x.l, a: 100 }))}, ${te(xe({ h: x.h, s: 100, l: x.l, a: 100 }))})`,
|
|
2354
|
+
l: `linear-gradient(90deg in oklch, ${te(xe({ h: x.h, s: x.s, l: 0, a: 100 }))}, ${te(xe({ h: x.h, s: x.s, l: 100, a: 100 }))})`,
|
|
2355
|
+
a: `linear-gradient(90deg in oklch, ${te(xe({ ...x, a: 0 }))}, ${te(xe({ ...x, a: 100 }))})`
|
|
2356
|
+
}, [b, C, x]), [$e, T] = K(() => ({
|
|
2357
2357
|
position: "fixed",
|
|
2358
2358
|
visibility: "hidden"
|
|
2359
2359
|
}));
|
|
2360
|
-
|
|
2360
|
+
po(() => {
|
|
2361
2361
|
const w = a.current;
|
|
2362
2362
|
if (!w) {
|
|
2363
2363
|
T({ position: "fixed", visibility: "hidden" });
|
|
2364
2364
|
return;
|
|
2365
2365
|
}
|
|
2366
2366
|
T(
|
|
2367
|
-
|
|
2367
|
+
Xn(
|
|
2368
2368
|
w,
|
|
2369
|
-
h === "mini" ?
|
|
2370
|
-
h === "mini" ?
|
|
2369
|
+
h === "mini" ? ha : ka,
|
|
2370
|
+
h === "mini" ? ga : ma
|
|
2371
2371
|
)
|
|
2372
2372
|
);
|
|
2373
2373
|
}, [a, h]), X(() => {
|
|
@@ -2378,7 +2378,7 @@ function Xn({
|
|
|
2378
2378
|
const $ = i.current;
|
|
2379
2379
|
if (!$) return;
|
|
2380
2380
|
const H = $.getBoundingClientRect();
|
|
2381
|
-
|
|
2381
|
+
g.current = {
|
|
2382
2382
|
pointerId: W.pointerId,
|
|
2383
2383
|
startX: W.clientX,
|
|
2384
2384
|
startY: W.clientY,
|
|
@@ -2391,13 +2391,13 @@ function Xn({
|
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
2393
|
function U(W) {
|
|
2394
|
-
if (!_.current || !
|
|
2395
|
-
const { startX: $, startY: H, baseLeft: V, baseTop: G } =
|
|
2394
|
+
if (!_.current || !g.current || W.pointerId !== g.current.pointerId) return;
|
|
2395
|
+
const { startX: $, startY: H, baseLeft: V, baseTop: G } = g.current, I = V + (W.clientX - $), q = G + (W.clientY - H);
|
|
2396
2396
|
f({ left: I, top: q });
|
|
2397
2397
|
}
|
|
2398
2398
|
function F(W) {
|
|
2399
|
-
if (!_.current || !
|
|
2400
|
-
_.current = !1,
|
|
2399
|
+
if (!_.current || !g.current || W.pointerId !== g.current.pointerId) return;
|
|
2400
|
+
_.current = !1, g.current = null;
|
|
2401
2401
|
try {
|
|
2402
2402
|
w.releasePointerCapture(W.pointerId);
|
|
2403
2403
|
} catch {
|
|
@@ -2407,11 +2407,11 @@ function Xn({
|
|
|
2407
2407
|
const H = $.getBoundingClientRect(), V = 8, G = window.innerWidth, I = window.innerHeight, q = Math.max(
|
|
2408
2408
|
V,
|
|
2409
2409
|
Math.min(G - V - H.width, H.left)
|
|
2410
|
-
),
|
|
2410
|
+
), de = Math.max(
|
|
2411
2411
|
V,
|
|
2412
2412
|
Math.min(I - V - H.height, H.top)
|
|
2413
2413
|
);
|
|
2414
|
-
f({ left: q, top:
|
|
2414
|
+
f({ left: q, top: de });
|
|
2415
2415
|
}
|
|
2416
2416
|
return w.addEventListener("pointerdown", z), w.addEventListener("pointermove", U), w.addEventListener("pointerup", F), w.addEventListener("pointercancel", F), () => {
|
|
2417
2417
|
w.removeEventListener("pointerdown", z), w.removeEventListener("pointermove", U), w.removeEventListener("pointerup", F), w.removeEventListener("pointercancel", F);
|
|
@@ -2419,20 +2419,20 @@ function Xn({
|
|
|
2419
2419
|
}, []);
|
|
2420
2420
|
const D = /^#[0-9a-fA-F]{8}$/.test(c), ee = R(() => {
|
|
2421
2421
|
d.current = !0;
|
|
2422
|
-
}, []),
|
|
2422
|
+
}, []), ke = R(() => {
|
|
2423
2423
|
d.current = !1;
|
|
2424
|
-
}, []),
|
|
2425
|
-
return /* @__PURE__ */
|
|
2424
|
+
}, []), Pe = p ? { position: "fixed", left: p.left, top: p.top } : $e;
|
|
2425
|
+
return /* @__PURE__ */ k(
|
|
2426
2426
|
"div",
|
|
2427
2427
|
{
|
|
2428
2428
|
ref: i,
|
|
2429
2429
|
className: "tokenpanel-color-picker",
|
|
2430
2430
|
"data-mode-shell": h,
|
|
2431
|
-
style:
|
|
2431
|
+
style: Pe,
|
|
2432
2432
|
role: "dialog",
|
|
2433
2433
|
"aria-label": n ? `${n} color picker` : "Color picker",
|
|
2434
2434
|
children: [
|
|
2435
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-header", children: [
|
|
2436
2436
|
/* @__PURE__ */ s(
|
|
2437
2437
|
"span",
|
|
2438
2438
|
{
|
|
@@ -2444,7 +2444,7 @@ function Xn({
|
|
|
2444
2444
|
}
|
|
2445
2445
|
),
|
|
2446
2446
|
/* @__PURE__ */ s("span", { className: "tokenpanel-color-picker-label", children: n ?? "Color" }),
|
|
2447
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ k(
|
|
2448
2448
|
"div",
|
|
2449
2449
|
{
|
|
2450
2450
|
className: "tokenpanel-color-picker-mode-toggle",
|
|
@@ -2458,9 +2458,9 @@ function Xn({
|
|
|
2458
2458
|
tabIndex: 0,
|
|
2459
2459
|
className: "tokenpanel-color-picker-mode-btn",
|
|
2460
2460
|
"aria-pressed": b === "oklch",
|
|
2461
|
-
onClick: () =>
|
|
2461
|
+
onClick: () => ce("oklch"),
|
|
2462
2462
|
onKeyDown: (w) => {
|
|
2463
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
2463
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), ce("oklch"));
|
|
2464
2464
|
},
|
|
2465
2465
|
children: "OKLCH"
|
|
2466
2466
|
}
|
|
@@ -2472,9 +2472,9 @@ function Xn({
|
|
|
2472
2472
|
tabIndex: 0,
|
|
2473
2473
|
className: "tokenpanel-color-picker-mode-btn",
|
|
2474
2474
|
"aria-pressed": b === "hsl",
|
|
2475
|
-
onClick: () =>
|
|
2475
|
+
onClick: () => ce("hsl"),
|
|
2476
2476
|
onKeyDown: (w) => {
|
|
2477
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
2477
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), ce("hsl"));
|
|
2478
2478
|
},
|
|
2479
2479
|
children: "HSL"
|
|
2480
2480
|
}
|
|
@@ -2498,8 +2498,8 @@ function Xn({
|
|
|
2498
2498
|
}
|
|
2499
2499
|
)
|
|
2500
2500
|
] }),
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-top-row", children: [
|
|
2502
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-preview", children: [
|
|
2503
2503
|
D && /* @__PURE__ */ s("div", { className: "tokenpanel-color-picker-preview-checkerboard" }),
|
|
2504
2504
|
/* @__PURE__ */ s(
|
|
2505
2505
|
"div",
|
|
@@ -2527,8 +2527,8 @@ function Xn({
|
|
|
2527
2527
|
className: "tokenpanel-color-picker-grid",
|
|
2528
2528
|
role: "grid",
|
|
2529
2529
|
"aria-label": "Color presets",
|
|
2530
|
-
children:
|
|
2531
|
-
const W =
|
|
2530
|
+
children: It.map((w, z) => /* @__PURE__ */ s("div", { role: "row", children: j.map((U, F) => {
|
|
2531
|
+
const W = en(z, F, C.a, j), $ = ca(W), H = te(Zt(W)), V = Math.abs(C.h - W.h) % 360, G = Math.min(V, 360 - V), I = Math.abs(C.l - W.l) < 2 && G < 5 && Math.abs(C.c - W.c) < 0.05;
|
|
2532
2532
|
return /* @__PURE__ */ s(
|
|
2533
2533
|
"div",
|
|
2534
2534
|
{
|
|
@@ -2550,29 +2550,29 @@ function Xn({
|
|
|
2550
2550
|
}
|
|
2551
2551
|
),
|
|
2552
2552
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-picker-sliders", children: b === "oklch" ? oe.map((w) => /* @__PURE__ */ s(
|
|
2553
|
-
|
|
2553
|
+
Qt,
|
|
2554
2554
|
{
|
|
2555
2555
|
config: w,
|
|
2556
2556
|
value: C[w.key] ?? 0,
|
|
2557
|
-
gradient:
|
|
2557
|
+
gradient: pe[w.key] ?? "",
|
|
2558
2558
|
onChange: (z) => N({ [w.key]: z }),
|
|
2559
2559
|
onDragStart: ee,
|
|
2560
|
-
onDragEnd:
|
|
2560
|
+
onDragEnd: ke
|
|
2561
2561
|
},
|
|
2562
2562
|
w.key
|
|
2563
|
-
)) :
|
|
2564
|
-
|
|
2563
|
+
)) : ve.map((w) => /* @__PURE__ */ s(
|
|
2564
|
+
Qt,
|
|
2565
2565
|
{
|
|
2566
2566
|
config: w,
|
|
2567
2567
|
value: x[w.key] ?? 0,
|
|
2568
|
-
gradient:
|
|
2568
|
+
gradient: pe[w.key] ?? "",
|
|
2569
2569
|
onChange: (z) => S({ [w.key]: z }),
|
|
2570
2570
|
onDragStart: ee,
|
|
2571
|
-
onDragEnd:
|
|
2571
|
+
onDragEnd: ke
|
|
2572
2572
|
},
|
|
2573
2573
|
w.key
|
|
2574
2574
|
)) }),
|
|
2575
|
-
h === "expanded" && /* @__PURE__ */
|
|
2575
|
+
h === "expanded" && /* @__PURE__ */ k("div", { className: "tokenpanel-color-picker-readout", "aria-live": "polite", children: [
|
|
2576
2576
|
"L ",
|
|
2577
2577
|
Math.round(C.l),
|
|
2578
2578
|
"% · C ",
|
|
@@ -2586,9 +2586,9 @@ function Xn({
|
|
|
2586
2586
|
}
|
|
2587
2587
|
);
|
|
2588
2588
|
}
|
|
2589
|
-
const
|
|
2589
|
+
const Bt = hn(null);
|
|
2590
2590
|
function ae({ cssVar: e }) {
|
|
2591
|
-
const t =
|
|
2591
|
+
const t = yn(Bt);
|
|
2592
2592
|
if (t === null) return null;
|
|
2593
2593
|
const { state: n, toggle: o, matchCounts: a } = t, r = n.active[e], i = r !== void 0, l = i ? n.slots[r]?.color : void 0, d = a?.[e], c = J(() => {
|
|
2594
2594
|
o(e);
|
|
@@ -2619,13 +2619,13 @@ function ae({ cssVar: e }) {
|
|
|
2619
2619
|
"aria-hidden": "true",
|
|
2620
2620
|
children: i ? (
|
|
2621
2621
|
// eye-open: outer path + pupil circle
|
|
2622
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ k(ue, { children: [
|
|
2623
2623
|
/* @__PURE__ */ s("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
2624
2624
|
/* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" })
|
|
2625
2625
|
] })
|
|
2626
2626
|
) : (
|
|
2627
2627
|
// eye-off: slashed eye
|
|
2628
|
-
/* @__PURE__ */
|
|
2628
|
+
/* @__PURE__ */ k(ue, { children: [
|
|
2629
2629
|
/* @__PURE__ */ s("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
2630
2630
|
/* @__PURE__ */ s("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2631
2631
|
] })
|
|
@@ -2635,17 +2635,17 @@ function ae({ cssVar: e }) {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
);
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function Na({
|
|
2639
2639
|
anchorRef: e,
|
|
2640
2640
|
onClose: t
|
|
2641
2641
|
}) {
|
|
2642
|
-
const n =
|
|
2643
|
-
if (
|
|
2644
|
-
const { state: d, setSlot: c, setOutlineWidth: u, reset: p, disableAll: f } = n,
|
|
2642
|
+
const n = fo(Bt), [o, a] = K(null), r = O(Array.from({ length: 10 }, () => null)), i = O(null), l = O(null);
|
|
2643
|
+
if (Yn(i, t), !n) return null;
|
|
2644
|
+
const { state: d, setSlot: c, setOutlineWidth: u, reset: p, disableAll: f } = n, g = {};
|
|
2645
2645
|
for (const [b, v] of Object.entries(d.active))
|
|
2646
|
-
v in
|
|
2647
|
-
const _ =
|
|
2648
|
-
return o !== null && (l.current = r.current[o] ?? null), /* @__PURE__ */
|
|
2646
|
+
v in g || (g[v] = b);
|
|
2647
|
+
const _ = Xn(e.current ?? null, 370, 520);
|
|
2648
|
+
return o !== null && (l.current = r.current[o] ?? null), /* @__PURE__ */ k(
|
|
2649
2649
|
"div",
|
|
2650
2650
|
{
|
|
2651
2651
|
ref: i,
|
|
@@ -2654,9 +2654,9 @@ function ya({
|
|
|
2654
2654
|
className: "tokenpanel-highlight-settings-popover",
|
|
2655
2655
|
style: { ..._, zIndex: 65 },
|
|
2656
2656
|
children: [
|
|
2657
|
-
/* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-highlight-settings-header", children: [
|
|
2658
2658
|
/* @__PURE__ */ s("span", { className: "tokenpanel-highlight-settings-header-label", children: "Highlight outline settings" }),
|
|
2659
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-highlight-settings-outline-control", children: [
|
|
2660
2660
|
/* @__PURE__ */ s(
|
|
2661
2661
|
"input",
|
|
2662
2662
|
{
|
|
@@ -2679,8 +2679,8 @@ function ya({
|
|
|
2679
2679
|
] })
|
|
2680
2680
|
] }),
|
|
2681
2681
|
/* @__PURE__ */ s("div", { className: "tokenpanel-highlight-settings-list", children: d.slots.map((b, v) => {
|
|
2682
|
-
const h =
|
|
2683
|
-
return /* @__PURE__ */
|
|
2682
|
+
const h = g[v], y = h !== void 0, M = `${d.outlineWidth}px solid ${b.color}`;
|
|
2683
|
+
return /* @__PURE__ */ k(
|
|
2684
2684
|
"div",
|
|
2685
2685
|
{
|
|
2686
2686
|
className: "tokenpanel-highlight-settings-row",
|
|
@@ -2715,9 +2715,9 @@ function ya({
|
|
|
2715
2715
|
v
|
|
2716
2716
|
);
|
|
2717
2717
|
}) }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-highlight-settings-footer", children: [
|
|
2719
2719
|
/* @__PURE__ */ s(
|
|
2720
|
-
|
|
2720
|
+
_e,
|
|
2721
2721
|
{
|
|
2722
2722
|
onClick: () => f && f(),
|
|
2723
2723
|
className: "tokenpanel-highlight-settings-reset-btn",
|
|
@@ -2725,7 +2725,7 @@ function ya({
|
|
|
2725
2725
|
}
|
|
2726
2726
|
),
|
|
2727
2727
|
/* @__PURE__ */ s(
|
|
2728
|
-
|
|
2728
|
+
_e,
|
|
2729
2729
|
{
|
|
2730
2730
|
onClick: () => p && p(),
|
|
2731
2731
|
className: "tokenpanel-highlight-settings-reset-btn",
|
|
@@ -2734,7 +2734,7 @@ function ya({
|
|
|
2734
2734
|
)
|
|
2735
2735
|
] }),
|
|
2736
2736
|
o !== null && /* @__PURE__ */ s(
|
|
2737
|
-
|
|
2737
|
+
qn,
|
|
2738
2738
|
{
|
|
2739
2739
|
color: d.slots[o]?.color ?? "#ffffff",
|
|
2740
2740
|
onChange: (b) => {
|
|
@@ -2749,7 +2749,7 @@ function ya({
|
|
|
2749
2749
|
}
|
|
2750
2750
|
);
|
|
2751
2751
|
}
|
|
2752
|
-
const
|
|
2752
|
+
const Gn = [
|
|
2753
2753
|
{ color: "#ff2d2d" },
|
|
2754
2754
|
// red
|
|
2755
2755
|
{ color: "#ff2dcf" },
|
|
@@ -2770,28 +2770,28 @@ const Yn = [
|
|
|
2770
2770
|
// yellow
|
|
2771
2771
|
{ color: "#2d6eff" }
|
|
2772
2772
|
// blue
|
|
2773
|
-
],
|
|
2774
|
-
function
|
|
2773
|
+
], Jn = 2;
|
|
2774
|
+
function Un() {
|
|
2775
2775
|
return `${ne().storagePrefix}-highlight-slots`;
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2777
|
+
function Zn() {
|
|
2778
2778
|
return `${ne().storagePrefix}-highlight-active`;
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2780
|
+
function Qn() {
|
|
2781
2781
|
return `${ne().storagePrefix}-highlight-outline-width`;
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function _a(e) {
|
|
2784
2784
|
const t = new Set(Object.values(e));
|
|
2785
2785
|
for (let n = 0; n < 10; n++)
|
|
2786
2786
|
if (!t.has(n)) return n;
|
|
2787
2787
|
return -1;
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Ca(e, t) {
|
|
2790
2790
|
if (t in e.active) {
|
|
2791
2791
|
const { [t]: o, ...a } = e.active;
|
|
2792
2792
|
return { ...e, active: a };
|
|
2793
2793
|
}
|
|
2794
|
-
const n =
|
|
2794
|
+
const n = _a(e.active);
|
|
2795
2795
|
return n === -1 ? (console.warn(
|
|
2796
2796
|
"[zudo-design-token-panel] highlight: all 10 slots are in use; cannot highlight",
|
|
2797
2797
|
t
|
|
@@ -2800,29 +2800,29 @@ function _a(e, t) {
|
|
|
2800
2800
|
active: { ...e.active, [t]: n }
|
|
2801
2801
|
};
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2803
|
+
function $a(e) {
|
|
2804
2804
|
return {
|
|
2805
2805
|
...e,
|
|
2806
|
-
slots:
|
|
2807
|
-
outlineWidth:
|
|
2806
|
+
slots: Gn.map((t) => ({ ...t })),
|
|
2807
|
+
outlineWidth: Jn
|
|
2808
2808
|
};
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2810
|
+
function Ea(e) {
|
|
2811
2811
|
return { ...e, active: {} };
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2813
|
+
function Sa(e, t, n) {
|
|
2814
2814
|
if (t < 0 || t >= e.slots.length) return e;
|
|
2815
2815
|
const o = e.slots.map((a, r) => r === t ? { ...a, ...n } : a);
|
|
2816
2816
|
return { ...e, slots: o };
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function Ma(e, t) {
|
|
2819
2819
|
const n = Math.max(1, t);
|
|
2820
2820
|
return { ...e, outlineWidth: n };
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2823
|
-
let e =
|
|
2822
|
+
function Ta() {
|
|
2823
|
+
let e = Gn.map((o) => ({ ...o })), t = Jn, n = {};
|
|
2824
2824
|
try {
|
|
2825
|
-
const o = localStorage.getItem(
|
|
2825
|
+
const o = localStorage.getItem(Un());
|
|
2826
2826
|
if (o !== null) {
|
|
2827
2827
|
const a = JSON.parse(o);
|
|
2828
2828
|
Array.isArray(a) && a.length === 10 && (e = a.map((r) => ({ color: r.color })));
|
|
@@ -2830,7 +2830,7 @@ function Ma() {
|
|
|
2830
2830
|
} catch {
|
|
2831
2831
|
}
|
|
2832
2832
|
try {
|
|
2833
|
-
const o = localStorage.getItem(
|
|
2833
|
+
const o = localStorage.getItem(Qn());
|
|
2834
2834
|
if (o !== null) {
|
|
2835
2835
|
const a = JSON.parse(o);
|
|
2836
2836
|
typeof a == "number" && a >= 1 && (t = a);
|
|
@@ -2838,7 +2838,7 @@ function Ma() {
|
|
|
2838
2838
|
} catch {
|
|
2839
2839
|
}
|
|
2840
2840
|
try {
|
|
2841
|
-
const o = sessionStorage.getItem(
|
|
2841
|
+
const o = sessionStorage.getItem(Zn());
|
|
2842
2842
|
if (o !== null) {
|
|
2843
2843
|
const a = JSON.parse(o);
|
|
2844
2844
|
a !== null && typeof a == "object" && !Array.isArray(a) && (n = a);
|
|
@@ -2847,21 +2847,21 @@ function Ma() {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
return { slots: e, outlineWidth: t, active: n };
|
|
2849
2849
|
}
|
|
2850
|
-
function
|
|
2850
|
+
function Re(e) {
|
|
2851
2851
|
try {
|
|
2852
|
-
localStorage.setItem(
|
|
2852
|
+
localStorage.setItem(Un(), JSON.stringify(e.slots));
|
|
2853
2853
|
} catch {
|
|
2854
2854
|
}
|
|
2855
2855
|
try {
|
|
2856
|
-
localStorage.setItem(
|
|
2856
|
+
localStorage.setItem(Qn(), JSON.stringify(e.outlineWidth));
|
|
2857
2857
|
} catch {
|
|
2858
2858
|
}
|
|
2859
2859
|
try {
|
|
2860
|
-
sessionStorage.setItem(
|
|
2860
|
+
sessionStorage.setItem(Zn(), JSON.stringify(e.active));
|
|
2861
2861
|
} catch {
|
|
2862
2862
|
}
|
|
2863
2863
|
}
|
|
2864
|
-
const
|
|
2864
|
+
const tn = {
|
|
2865
2865
|
color: {
|
|
2866
2866
|
sentinelA: "rgb(123, 234, 17)",
|
|
2867
2867
|
sentinelB: "rgb(231, 17, 234)",
|
|
@@ -3065,16 +3065,16 @@ const Qt = {
|
|
|
3065
3065
|
longhands: ["mask-image"],
|
|
3066
3066
|
compounds: ["mask-image"]
|
|
3067
3067
|
}
|
|
3068
|
-
},
|
|
3069
|
-
function
|
|
3068
|
+
}, Ge = [null, "::before", "::after"], eo = ".tokenpanel-shell, [data-design-token-panel-modal], #tokenpanel-highlight-mount", Aa = /^(transparent|currentcolor|currentColor|inherit|initial|unset|red|blue|green|black|white|gray|grey|silver|yellow|orange|purple|pink|brown|cyan|magenta|lime|olive|navy|maroon|teal|aqua|fuchsia|coral|salmon|gold|khaki|violet|indigo|crimson|lavender|beige|ivory|chocolate|tomato|orchid|plum|turquoise|tan|sienna|peru|papayawhip|peachpuff|moccasin|mistyrose|linen|lemonchiffon|honeydew|gainsboro)$/i, La = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, Pa = /^#/, Ia = /^-?\d+(\.\d+)?(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr)%?$/, za = /^-?\d+(\.\d+)?$/, Ra = /^(cubic-bezier|steps|linear)\(/i, Oa = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, Da = /^".*"$/, Va = /^url\(/i;
|
|
3069
|
+
function Ha(e, t) {
|
|
3070
3070
|
const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
3071
|
-
return n ?
|
|
3071
|
+
return n ? La.test(n) || Pa.test(n) || Aa.test(n) ? "color" : Ia.test(n) ? "length" : za.test(n) ? "number" : Ra.test(n) ? "easing" : Oa.test(n) ? "time" : Da.test(n) ? "content" : (Va.test(n) && t.push(
|
|
3072
3072
|
`type auto-detection inconclusive for ${e}: resolved value starts with url(); defaulting to text — supply kind:'cursor' or kind:'mask-image' explicitly if this is a cursor or mask-image token`
|
|
3073
3073
|
), "text") : (t.push(
|
|
3074
3074
|
`type auto-detection inconclusive for ${e}; defaulting to color — supply kind explicitly if this is incorrect`
|
|
3075
3075
|
), "color");
|
|
3076
3076
|
}
|
|
3077
|
-
function
|
|
3077
|
+
function zt(e, t, n) {
|
|
3078
3078
|
for (const o of e)
|
|
3079
3079
|
if (o instanceof CSSStyleRule) {
|
|
3080
3080
|
const a = o.style;
|
|
@@ -3083,14 +3083,14 @@ function It(e, t, n) {
|
|
|
3083
3083
|
n.add(o.selectorText);
|
|
3084
3084
|
break;
|
|
3085
3085
|
}
|
|
3086
|
-
o.cssRules?.length &&
|
|
3086
|
+
o.cssRules?.length && zt(
|
|
3087
3087
|
o.cssRules,
|
|
3088
3088
|
t,
|
|
3089
3089
|
n
|
|
3090
3090
|
);
|
|
3091
|
-
} else "cssRules" in o && o.cssRules &&
|
|
3091
|
+
} else "cssRules" in o && o.cssRules && zt(o.cssRules, t, n);
|
|
3092
3092
|
}
|
|
3093
|
-
function
|
|
3093
|
+
function Ba(e, t) {
|
|
3094
3094
|
const n = /* @__PURE__ */ new Set();
|
|
3095
3095
|
for (const o of document.styleSheets) {
|
|
3096
3096
|
let a;
|
|
@@ -3101,17 +3101,17 @@ function Ha(e, t) {
|
|
|
3101
3101
|
t.push(`Cross-origin stylesheet skipped: ${r}`);
|
|
3102
3102
|
continue;
|
|
3103
3103
|
}
|
|
3104
|
-
|
|
3104
|
+
zt(a, e, n);
|
|
3105
3105
|
}
|
|
3106
3106
|
return n;
|
|
3107
3107
|
}
|
|
3108
|
-
function
|
|
3108
|
+
function Fa(e) {
|
|
3109
3109
|
const t = /* @__PURE__ */ new Set(), n = document.querySelectorAll("[style]");
|
|
3110
3110
|
for (const o of n)
|
|
3111
3111
|
o.style.getPropertyValue(e) !== "" && t.add(o);
|
|
3112
3112
|
return t;
|
|
3113
3113
|
}
|
|
3114
|
-
function
|
|
3114
|
+
function Tt(e, t, n, o, a) {
|
|
3115
3115
|
const r = [], i = document.documentElement, l = /* @__PURE__ */ new WeakSet();
|
|
3116
3116
|
r.push({
|
|
3117
3117
|
el: i,
|
|
@@ -3121,7 +3121,7 @@ function Mt(e, t, n, o, a) {
|
|
|
3121
3121
|
const d = (c) => {
|
|
3122
3122
|
if (!l.has(c)) {
|
|
3123
3123
|
try {
|
|
3124
|
-
if (c.closest(
|
|
3124
|
+
if (c.closest(eo) !== null) return;
|
|
3125
3125
|
} catch {
|
|
3126
3126
|
}
|
|
3127
3127
|
r.push({
|
|
@@ -3144,13 +3144,13 @@ function Mt(e, t, n, o, a) {
|
|
|
3144
3144
|
for (const c of o) d(c);
|
|
3145
3145
|
return r;
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function At(e, t) {
|
|
3148
3148
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
3149
3149
|
const { el: o, original: a, originalPriority: r } = t[n];
|
|
3150
3150
|
a ? o.style.setProperty(e, a, r) : o.style.removeProperty(e);
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function nn(e, t, n) {
|
|
3154
3154
|
let o;
|
|
3155
3155
|
try {
|
|
3156
3156
|
o = getComputedStyle(e, t);
|
|
@@ -3162,18 +3162,18 @@ function en(e, t, n) {
|
|
|
3162
3162
|
a[r] = o.getPropertyValue(r);
|
|
3163
3163
|
return a;
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function Ka(e, t) {
|
|
3166
3166
|
if (!e || !t) return null;
|
|
3167
3167
|
for (const n in e)
|
|
3168
3168
|
if (e[n] !== t[n]) return n;
|
|
3169
3169
|
return null;
|
|
3170
3170
|
}
|
|
3171
|
-
function
|
|
3171
|
+
function on(e, t) {
|
|
3172
3172
|
let n = e.trim();
|
|
3173
3173
|
n.startsWith("var(") && (n = n.replace(/^var\(\s*/, "").replace(/\s*\)$/, "").trim());
|
|
3174
|
-
const o = [], a = t?.mode ?? "equality", r = t?.kind ??
|
|
3174
|
+
const o = [], a = t?.mode ?? "equality", r = t?.kind ?? Ha(n, o), i = tn[r] ?? tn.color, l = Ba(n, o), d = Fa(n), c = [document.body, ...document.body.querySelectorAll("*")], u = /* @__PURE__ */ new Set();
|
|
3175
3175
|
if (a === "equality") {
|
|
3176
|
-
const { sentinelA: f, longhands:
|
|
3176
|
+
const { sentinelA: f, longhands: g, compounds: _ } = i, b = i.needleA ?? f, v = Tt(
|
|
3177
3177
|
n,
|
|
3178
3178
|
f,
|
|
3179
3179
|
l,
|
|
@@ -3182,7 +3182,7 @@ function tn(e, t) {
|
|
|
3182
3182
|
);
|
|
3183
3183
|
document.documentElement.offsetHeight;
|
|
3184
3184
|
for (const h of c)
|
|
3185
|
-
for (const y of
|
|
3185
|
+
for (const y of Ge) {
|
|
3186
3186
|
let M;
|
|
3187
3187
|
try {
|
|
3188
3188
|
M = getComputedStyle(h, y);
|
|
@@ -3190,7 +3190,7 @@ function tn(e, t) {
|
|
|
3190
3190
|
continue;
|
|
3191
3191
|
}
|
|
3192
3192
|
let A = !1;
|
|
3193
|
-
for (const C of
|
|
3193
|
+
for (const C of g)
|
|
3194
3194
|
if (M.getPropertyValue(C) === f) {
|
|
3195
3195
|
A = !0;
|
|
3196
3196
|
break;
|
|
@@ -3208,9 +3208,9 @@ function tn(e, t) {
|
|
|
3208
3208
|
break;
|
|
3209
3209
|
}
|
|
3210
3210
|
}
|
|
3211
|
-
|
|
3211
|
+
At(n, v);
|
|
3212
3212
|
} else {
|
|
3213
|
-
const { sentinelA: f, sentinelB:
|
|
3213
|
+
const { sentinelA: f, sentinelB: g, longhands: _, compounds: b } = i, v = [..._, ...b], h = Tt(
|
|
3214
3214
|
n,
|
|
3215
3215
|
f,
|
|
3216
3216
|
l,
|
|
@@ -3220,11 +3220,11 @@ function tn(e, t) {
|
|
|
3220
3220
|
document.documentElement.offsetHeight;
|
|
3221
3221
|
const y = /* @__PURE__ */ new Map();
|
|
3222
3222
|
for (const A of c)
|
|
3223
|
-
y.set(A,
|
|
3224
|
-
|
|
3225
|
-
const M =
|
|
3223
|
+
y.set(A, Ge.map((C) => nn(A, C, v)));
|
|
3224
|
+
At(n, h);
|
|
3225
|
+
const M = Tt(
|
|
3226
3226
|
n,
|
|
3227
|
-
|
|
3227
|
+
g,
|
|
3228
3228
|
l,
|
|
3229
3229
|
d,
|
|
3230
3230
|
o
|
|
@@ -3232,28 +3232,28 @@ function tn(e, t) {
|
|
|
3232
3232
|
document.documentElement.offsetHeight;
|
|
3233
3233
|
for (const A of c) {
|
|
3234
3234
|
const C = y.get(A);
|
|
3235
|
-
for (let x = 0; x <
|
|
3236
|
-
const m =
|
|
3237
|
-
if (
|
|
3235
|
+
for (let x = 0; x < Ge.length; x++) {
|
|
3236
|
+
const m = nn(A, Ge[x], v);
|
|
3237
|
+
if (Ka(C[x], m) !== null) {
|
|
3238
3238
|
u.add(A);
|
|
3239
3239
|
break;
|
|
3240
3240
|
}
|
|
3241
3241
|
}
|
|
3242
3242
|
}
|
|
3243
|
-
|
|
3243
|
+
At(n, M);
|
|
3244
3244
|
}
|
|
3245
3245
|
const p = [];
|
|
3246
3246
|
for (const f of u) {
|
|
3247
3247
|
try {
|
|
3248
|
-
if (f.closest(
|
|
3248
|
+
if (f.closest(eo) !== null) continue;
|
|
3249
3249
|
} catch {
|
|
3250
3250
|
}
|
|
3251
3251
|
p.push(f);
|
|
3252
3252
|
}
|
|
3253
3253
|
return { elements: p, warnings: o };
|
|
3254
3254
|
}
|
|
3255
|
-
const
|
|
3256
|
-
function
|
|
3255
|
+
const Ee = 200, ja = 49;
|
|
3256
|
+
function rn(e, t) {
|
|
3257
3257
|
return {
|
|
3258
3258
|
position: "fixed",
|
|
3259
3259
|
top: `${e.top}px`,
|
|
@@ -3266,21 +3266,21 @@ function nn(e, t) {
|
|
|
3266
3266
|
// box-shadow inset draws the same ring without relying on outline.
|
|
3267
3267
|
boxShadow: `inset 0 0 0 ${t.outlineWidth}px ${t.color}`,
|
|
3268
3268
|
pointerEvents: "none",
|
|
3269
|
-
zIndex: String(
|
|
3269
|
+
zIndex: String(ja),
|
|
3270
3270
|
boxSizing: "border-box"
|
|
3271
3271
|
};
|
|
3272
3272
|
}
|
|
3273
|
-
function
|
|
3273
|
+
function Wa(e, t) {
|
|
3274
3274
|
for (const n of Object.keys(t))
|
|
3275
3275
|
e.style[n] = t[n];
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const t = e.length >
|
|
3279
|
-
e.length >
|
|
3280
|
-
`HighlightOverlay: received ${e.length} items (max ${
|
|
3281
|
-
)), e.length <=
|
|
3282
|
-
const o =
|
|
3283
|
-
return
|
|
3277
|
+
function Xa({ items: e }) {
|
|
3278
|
+
const t = e.length > Ee ? e.slice(0, Ee) : e, n = Ae(!1);
|
|
3279
|
+
e.length > Ee && !n.current && (n.current = !0, console.warn(
|
|
3280
|
+
`HighlightOverlay: received ${e.length} items (max ${Ee}). Only the first ${Ee} overlays will be rendered.`
|
|
3281
|
+
)), e.length <= Ee && (n.current = !1);
|
|
3282
|
+
const o = Ae([]);
|
|
3283
|
+
return Ce(() => {
|
|
3284
3284
|
if (t.length === 0) return;
|
|
3285
3285
|
let a;
|
|
3286
3286
|
function r() {
|
|
@@ -3288,15 +3288,15 @@ function Wa({ items: e }) {
|
|
|
3288
3288
|
const l = o.current[i];
|
|
3289
3289
|
if (!l) continue;
|
|
3290
3290
|
const d = t[i].element.getBoundingClientRect();
|
|
3291
|
-
|
|
3291
|
+
Wa(l, rn(d, t[i].slot));
|
|
3292
3292
|
}
|
|
3293
3293
|
a = requestAnimationFrame(r);
|
|
3294
3294
|
}
|
|
3295
3295
|
return a = requestAnimationFrame(r), () => {
|
|
3296
3296
|
cancelAnimationFrame(a);
|
|
3297
3297
|
};
|
|
3298
|
-
}, [t]), t.length === 0 ? null : /* @__PURE__ */ s(
|
|
3299
|
-
const i = a.element.getBoundingClientRect(), l =
|
|
3298
|
+
}, [t]), t.length === 0 ? null : /* @__PURE__ */ s(ue, { children: t.map((a, r) => {
|
|
3299
|
+
const i = a.element.getBoundingClientRect(), l = rn(i, a.slot);
|
|
3300
3300
|
return /* @__PURE__ */ s(
|
|
3301
3301
|
"div",
|
|
3302
3302
|
{
|
|
@@ -3311,7 +3311,7 @@ function Wa({ items: e }) {
|
|
|
3311
3311
|
);
|
|
3312
3312
|
}) });
|
|
3313
3313
|
}
|
|
3314
|
-
function
|
|
3314
|
+
function Ya(e) {
|
|
3315
3315
|
if (e)
|
|
3316
3316
|
switch (e.kind) {
|
|
3317
3317
|
case "color":
|
|
@@ -3342,7 +3342,7 @@ function Xa(e) {
|
|
|
3342
3342
|
return "mask-image";
|
|
3343
3343
|
}
|
|
3344
3344
|
}
|
|
3345
|
-
function
|
|
3345
|
+
function qa() {
|
|
3346
3346
|
const e = /* @__PURE__ */ new Map();
|
|
3347
3347
|
for (const t of ne().tabs)
|
|
3348
3348
|
for (const n of t.tiers)
|
|
@@ -3350,69 +3350,69 @@ function Ya() {
|
|
|
3350
3350
|
e.set(o.cssVar, o.type);
|
|
3351
3351
|
return e;
|
|
3352
3352
|
}
|
|
3353
|
-
const
|
|
3354
|
-
function
|
|
3355
|
-
return e ? !
|
|
3353
|
+
const Ga = /* @__PURE__ */ new Set(["text", "cursor", "content", "mask-image"]);
|
|
3354
|
+
function Ja(e) {
|
|
3355
|
+
return e ? !Ga.has(e.kind) : !0;
|
|
3356
3356
|
}
|
|
3357
|
-
const
|
|
3358
|
-
function
|
|
3357
|
+
const an = "tokenpanel-highlight-mount";
|
|
3358
|
+
function ln() {
|
|
3359
3359
|
if (typeof document > "u") return null;
|
|
3360
|
-
const e = document.getElementById(
|
|
3360
|
+
const e = document.getElementById(an);
|
|
3361
3361
|
if (e) return e;
|
|
3362
3362
|
const t = document.createElement("div");
|
|
3363
|
-
return t.id =
|
|
3363
|
+
return t.id = an, document.body.appendChild(t), t;
|
|
3364
3364
|
}
|
|
3365
|
-
function
|
|
3366
|
-
const t =
|
|
3367
|
-
return
|
|
3368
|
-
(!t.current || !t.current.isConnected) && (t.current =
|
|
3365
|
+
function Ua({ items: e }) {
|
|
3366
|
+
const t = Ae(null), [n, o] = Ve(0);
|
|
3367
|
+
return Ce(() => {
|
|
3368
|
+
(!t.current || !t.current.isConnected) && (t.current = ln(), o((r) => r + 1));
|
|
3369
3369
|
function a() {
|
|
3370
|
-
(!t.current || !t.current.isConnected) && (t.current =
|
|
3370
|
+
(!t.current || !t.current.isConnected) && (t.current = ln(), o((r) => r + 1));
|
|
3371
3371
|
}
|
|
3372
3372
|
return typeof window < "u" && window.addEventListener("astro:after-swap", a), () => {
|
|
3373
3373
|
typeof window < "u" && window.removeEventListener("astro:after-swap", a);
|
|
3374
3374
|
};
|
|
3375
|
-
}, []), t.current ?
|
|
3375
|
+
}, []), t.current ? kn(/* @__PURE__ */ s(Xa, { items: e }), t.current) : null;
|
|
3376
3376
|
}
|
|
3377
|
-
function
|
|
3378
|
-
const [t, n] =
|
|
3377
|
+
function Za({ children: e }) {
|
|
3378
|
+
const [t, n] = Ve(Ta), [o, a] = Ve(0), [r, i] = Ve(0), l = Ae(/* @__PURE__ */ new Map()), d = J((v) => {
|
|
3379
3379
|
n((h) => {
|
|
3380
|
-
const y =
|
|
3381
|
-
return
|
|
3380
|
+
const y = Ca(h, v);
|
|
3381
|
+
return Re(y), y;
|
|
3382
3382
|
});
|
|
3383
3383
|
}, []), c = J((v, h) => {
|
|
3384
3384
|
n((y) => {
|
|
3385
|
-
const M =
|
|
3386
|
-
return
|
|
3385
|
+
const M = Sa(y, v, h);
|
|
3386
|
+
return Re(M), M;
|
|
3387
3387
|
});
|
|
3388
3388
|
}, []), u = J((v) => {
|
|
3389
3389
|
n((h) => {
|
|
3390
|
-
const y =
|
|
3391
|
-
return
|
|
3390
|
+
const y = Ma(h, v);
|
|
3391
|
+
return Re(y), y;
|
|
3392
3392
|
});
|
|
3393
3393
|
}, []), p = J(() => {
|
|
3394
3394
|
n((v) => {
|
|
3395
|
-
const h =
|
|
3396
|
-
return
|
|
3395
|
+
const h = $a(v);
|
|
3396
|
+
return Re(h), h;
|
|
3397
3397
|
});
|
|
3398
3398
|
}, []), f = J(() => {
|
|
3399
3399
|
n((v) => {
|
|
3400
|
-
const h =
|
|
3401
|
-
return
|
|
3400
|
+
const h = Ea(v);
|
|
3401
|
+
return Re(h), h;
|
|
3402
3402
|
});
|
|
3403
3403
|
}, []);
|
|
3404
|
-
|
|
3404
|
+
Ce(() => {
|
|
3405
3405
|
let v = null;
|
|
3406
3406
|
function h() {
|
|
3407
3407
|
v && v.disconnect(), v = new MutationObserver((M) => {
|
|
3408
3408
|
for (const A of M) {
|
|
3409
3409
|
for (const C of A.addedNodes)
|
|
3410
|
-
if (
|
|
3410
|
+
if (sn(C)) {
|
|
3411
3411
|
a((x) => x + 1);
|
|
3412
3412
|
return;
|
|
3413
3413
|
}
|
|
3414
3414
|
for (const C of A.removedNodes)
|
|
3415
|
-
if (
|
|
3415
|
+
if (sn(C)) {
|
|
3416
3416
|
a((x) => x + 1);
|
|
3417
3417
|
return;
|
|
3418
3418
|
}
|
|
@@ -3426,7 +3426,7 @@ function Ua({ children: e }) {
|
|
|
3426
3426
|
return typeof window < "u" && window.addEventListener("astro:after-swap", y), () => {
|
|
3427
3427
|
v?.disconnect(), typeof window < "u" && window.removeEventListener("astro:after-swap", y);
|
|
3428
3428
|
};
|
|
3429
|
-
}, []),
|
|
3429
|
+
}, []), Ce(() => {
|
|
3430
3430
|
if (typeof window > "u") return;
|
|
3431
3431
|
const v = new MutationObserver(() => {
|
|
3432
3432
|
i((h) => h + 1), l.current.clear();
|
|
@@ -3436,20 +3436,20 @@ function Ua({ children: e }) {
|
|
|
3436
3436
|
attributeFilter: ["data-theme", "class"]
|
|
3437
3437
|
}), () => v.disconnect();
|
|
3438
3438
|
}, []);
|
|
3439
|
-
const { items:
|
|
3440
|
-
const v =
|
|
3439
|
+
const { items: g, matchCounts: _ } = Gt(() => {
|
|
3440
|
+
const v = qa();
|
|
3441
3441
|
function h(A) {
|
|
3442
3442
|
const C = `${A}|${o}|${r}`, x = l.current.get(C);
|
|
3443
3443
|
if (x) return x;
|
|
3444
|
-
const m = v.get(A), N =
|
|
3444
|
+
const m = v.get(A), N = Ya(m), S = N ? { kind: N } : {}, B = on(A, S);
|
|
3445
3445
|
let j, Y;
|
|
3446
|
-
if (
|
|
3447
|
-
const
|
|
3448
|
-
for (const
|
|
3446
|
+
if (Ja(m)) {
|
|
3447
|
+
const ce = on(A, { ...S, mode: "differential" }), oe = new Set(B.elements);
|
|
3448
|
+
for (const pe of ce.elements) oe.add(pe);
|
|
3449
3449
|
j = Array.from(oe);
|
|
3450
|
-
const
|
|
3451
|
-
for (const
|
|
3452
|
-
Y = Array.from(
|
|
3450
|
+
const ve = new Set(B.warnings);
|
|
3451
|
+
for (const pe of ce.warnings) ve.add(pe);
|
|
3452
|
+
Y = Array.from(ve);
|
|
3453
3453
|
} else
|
|
3454
3454
|
j = B.elements, Y = B.warnings;
|
|
3455
3455
|
const Q = { elements: j, warnings: Y };
|
|
@@ -3469,24 +3469,24 @@ function Ua({ children: e }) {
|
|
|
3469
3469
|
y.push({ element: S, slot: { color: N.color, outlineWidth: t.outlineWidth } });
|
|
3470
3470
|
}
|
|
3471
3471
|
return { items: y, matchCounts: M };
|
|
3472
|
-
}, [t.active, t.slots, t.outlineWidth, o, r]), b =
|
|
3472
|
+
}, [t.active, t.slots, t.outlineWidth, o, r]), b = Gt(
|
|
3473
3473
|
() => ({ state: t, toggle: d, setSlot: c, setOutlineWidth: u, reset: p, disableAll: f, matchCounts: _ }),
|
|
3474
3474
|
[t, d, c, u, p, f, _]
|
|
3475
3475
|
);
|
|
3476
|
-
return /* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */ s(
|
|
3478
|
-
/* @__PURE__ */ s(
|
|
3476
|
+
return /* @__PURE__ */ k(ue, { children: [
|
|
3477
|
+
/* @__PURE__ */ s(Bt.Provider, { value: b, children: e }),
|
|
3478
|
+
/* @__PURE__ */ s(Ua, { items: g })
|
|
3479
3479
|
] });
|
|
3480
3480
|
}
|
|
3481
|
-
function
|
|
3481
|
+
function sn(e) {
|
|
3482
3482
|
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
3483
3483
|
const t = e;
|
|
3484
3484
|
return t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
3485
3485
|
}
|
|
3486
|
-
const
|
|
3487
|
-
function
|
|
3488
|
-
const t =
|
|
3489
|
-
return
|
|
3486
|
+
const to = hn(null);
|
|
3487
|
+
function Qa({ state: e }) {
|
|
3488
|
+
const t = Ae(null);
|
|
3489
|
+
return Ce(() => {
|
|
3490
3490
|
if (!e.visible || !e.triggerEl || !t.current) return;
|
|
3491
3491
|
const n = e.triggerEl, o = t.current, a = n.getBoundingClientRect(), r = o.offsetWidth, i = o.offsetHeight, l = 6, d = 6;
|
|
3492
3492
|
let c = a.left + a.width / 2 - r / 2;
|
|
@@ -3505,35 +3505,35 @@ function Za({ state: e }) {
|
|
|
3505
3505
|
}
|
|
3506
3506
|
);
|
|
3507
3507
|
}
|
|
3508
|
-
function
|
|
3509
|
-
const [t, n] =
|
|
3508
|
+
function ei({ children: e }) {
|
|
3509
|
+
const [t, n] = Ve({
|
|
3510
3510
|
visible: !1,
|
|
3511
3511
|
text: "",
|
|
3512
3512
|
triggerEl: null
|
|
3513
|
-
}), o =
|
|
3513
|
+
}), o = Ae(null), a = J((l, d) => {
|
|
3514
3514
|
o.current = l, n({ visible: !0, text: d, triggerEl: l });
|
|
3515
3515
|
}, []), r = J((l) => {
|
|
3516
3516
|
o.current === l && (o.current = null, n({ visible: !1, text: "", triggerEl: null }));
|
|
3517
3517
|
}, []), i = J(() => {
|
|
3518
3518
|
o.current = null, n({ visible: !1, text: "", triggerEl: null });
|
|
3519
3519
|
}, []);
|
|
3520
|
-
return
|
|
3520
|
+
return Ce(() => {
|
|
3521
3521
|
function l(d) {
|
|
3522
3522
|
d.key === "Escape" && i();
|
|
3523
3523
|
}
|
|
3524
3524
|
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
3525
|
-
}, [i]),
|
|
3525
|
+
}, [i]), Ce(() => {
|
|
3526
3526
|
function l() {
|
|
3527
3527
|
o.current && i();
|
|
3528
3528
|
}
|
|
3529
3529
|
return window.addEventListener("scroll", l, !0), () => window.removeEventListener("scroll", l, !0);
|
|
3530
|
-
}, [i]), /* @__PURE__ */
|
|
3530
|
+
}, [i]), /* @__PURE__ */ k(to.Provider, { value: { show: a, hide: r }, children: [
|
|
3531
3531
|
e,
|
|
3532
|
-
typeof document < "u" &&
|
|
3532
|
+
typeof document < "u" && kn(/* @__PURE__ */ s(Qa, { state: t }), document.body)
|
|
3533
3533
|
] });
|
|
3534
3534
|
}
|
|
3535
|
-
function
|
|
3536
|
-
const t =
|
|
3535
|
+
function Ft(e) {
|
|
3536
|
+
const t = yn(to), n = J(
|
|
3537
3537
|
(i) => {
|
|
3538
3538
|
t && t.show(i.currentTarget, e);
|
|
3539
3539
|
},
|
|
@@ -3556,7 +3556,7 @@ function eo(e) {
|
|
|
3556
3556
|
);
|
|
3557
3557
|
return { onMouseEnter: n, onMouseLeave: o, onFocusIn: a, onFocusOut: r };
|
|
3558
3558
|
}
|
|
3559
|
-
function
|
|
3559
|
+
function ti(e, t, n) {
|
|
3560
3560
|
X(() => {
|
|
3561
3561
|
if (!n) return;
|
|
3562
3562
|
function o(r) {
|
|
@@ -3576,7 +3576,7 @@ function ei(e, t, n) {
|
|
|
3576
3576
|
return window.addEventListener("scroll", o, !0), () => window.removeEventListener("scroll", o, !0);
|
|
3577
3577
|
}, [n, t]);
|
|
3578
3578
|
}
|
|
3579
|
-
function
|
|
3579
|
+
function ni(e, t, n, o) {
|
|
3580
3580
|
if (!e) return { position: "fixed", zIndex: 70, ...o };
|
|
3581
3581
|
const a = e.getBoundingClientRect(), r = 4, i = 8, l = window.innerHeight - a.bottom - i, d = a.top - i, c = l < n && d > l;
|
|
3582
3582
|
let u = a.left;
|
|
@@ -3589,7 +3589,7 @@ function ti(e, t, n, o) {
|
|
|
3589
3589
|
};
|
|
3590
3590
|
return c ? p.bottom = window.innerHeight - a.top + r : p.top = a.bottom + r, p;
|
|
3591
3591
|
}
|
|
3592
|
-
const
|
|
3592
|
+
const cn = Ke(function({
|
|
3593
3593
|
color: t,
|
|
3594
3594
|
onChange: n,
|
|
3595
3595
|
index: o,
|
|
@@ -3597,12 +3597,12 @@ const ln = it(function({
|
|
|
3597
3597
|
cssVar: r
|
|
3598
3598
|
}) {
|
|
3599
3599
|
const [i, l] = K(!1), d = O(null), c = R(() => l(!1), []), u = R(
|
|
3600
|
-
(
|
|
3601
|
-
n(o,
|
|
3600
|
+
(g) => {
|
|
3601
|
+
n(o, g);
|
|
3602
3602
|
},
|
|
3603
3603
|
[n, o]
|
|
3604
|
-
), p = R(() => l((
|
|
3605
|
-
return /* @__PURE__ */
|
|
3604
|
+
), p = R(() => l((g) => !g), []), f = Ft(`${a}: ${t}`);
|
|
3605
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-color-swatch-wrap", children: [
|
|
3606
3606
|
/* @__PURE__ */ s(
|
|
3607
3607
|
"div",
|
|
3608
3608
|
{
|
|
@@ -3612,8 +3612,8 @@ const ln = it(function({
|
|
|
3612
3612
|
className: "tokenpanel-color-swatch-button",
|
|
3613
3613
|
style: { backgroundColor: t },
|
|
3614
3614
|
onClick: p,
|
|
3615
|
-
onKeyDown: (
|
|
3616
|
-
(
|
|
3615
|
+
onKeyDown: (g) => {
|
|
3616
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), p());
|
|
3617
3617
|
},
|
|
3618
3618
|
"aria-label": `${a}: ${t}`,
|
|
3619
3619
|
"aria-expanded": i,
|
|
@@ -3621,7 +3621,7 @@ const ln = it(function({
|
|
|
3621
3621
|
}
|
|
3622
3622
|
),
|
|
3623
3623
|
i && /* @__PURE__ */ s(
|
|
3624
|
-
|
|
3624
|
+
qn,
|
|
3625
3625
|
{
|
|
3626
3626
|
color: t,
|
|
3627
3627
|
onChange: u,
|
|
@@ -3629,12 +3629,12 @@ const ln = it(function({
|
|
|
3629
3629
|
anchorRef: d
|
|
3630
3630
|
}
|
|
3631
3631
|
),
|
|
3632
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-color-swatch-label-row", children: [
|
|
3633
3633
|
/* @__PURE__ */ s("span", { className: "tokenpanel-color-swatch-label", children: a }),
|
|
3634
3634
|
r && /* @__PURE__ */ s(ae, { cssVar: r })
|
|
3635
3635
|
] })
|
|
3636
3636
|
] });
|
|
3637
|
-
}),
|
|
3637
|
+
}), Je = Ke(function({
|
|
3638
3638
|
label: t,
|
|
3639
3639
|
idKey: n,
|
|
3640
3640
|
value: o,
|
|
@@ -3646,14 +3646,14 @@ const ln = it(function({
|
|
|
3646
3646
|
foreground: c,
|
|
3647
3647
|
cssVar: u
|
|
3648
3648
|
}) {
|
|
3649
|
-
const p = r ?? ((x) => `--zd-p${x}`), [f,
|
|
3650
|
-
|
|
3651
|
-
const A =
|
|
3649
|
+
const p = r ?? ((x) => `--zd-p${x}`), [f, g] = K(!1), _ = O(null), b = O(null), v = R(() => g(!1), []), h = R(() => g((x) => !x), []), y = o === "bg" ? d ?? "#000000" : o === "fg" ? c ?? "#ffffff" : a[o] ?? "#000000", M = o === "bg" ? "bg" : o === "fg" ? "fg" : `p${o}`;
|
|
3650
|
+
ti(_, v, f);
|
|
3651
|
+
const A = Ft(`${t}: ${M}`);
|
|
3652
3652
|
function C(x) {
|
|
3653
|
-
i(n, x),
|
|
3653
|
+
i(n, x), g(!1);
|
|
3654
3654
|
}
|
|
3655
|
-
return /* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3655
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-palette-selector", ref: _, children: [
|
|
3656
|
+
/* @__PURE__ */ k(
|
|
3657
3657
|
"div",
|
|
3658
3658
|
{
|
|
3659
3659
|
ref: b,
|
|
@@ -3694,17 +3694,17 @@ const ln = it(function({
|
|
|
3694
3694
|
}
|
|
3695
3695
|
),
|
|
3696
3696
|
u && /* @__PURE__ */ s(ae, { cssVar: u }),
|
|
3697
|
-
f && /* @__PURE__ */
|
|
3697
|
+
f && /* @__PURE__ */ k(
|
|
3698
3698
|
"div",
|
|
3699
3699
|
{
|
|
3700
3700
|
role: "listbox",
|
|
3701
3701
|
"aria-label": `${t} color options`,
|
|
3702
3702
|
className: "tokenpanel-palette-options",
|
|
3703
|
-
style:
|
|
3703
|
+
style: ni(b.current, 440, l ? 160 : 120),
|
|
3704
3704
|
children: [
|
|
3705
3705
|
l && l.length > 0 && /* @__PURE__ */ s("div", { className: "tokenpanel-palette-options-extras", children: l.map((x) => {
|
|
3706
3706
|
const m = x === "bg" ? d ?? "#000000" : c ?? "#ffffff", N = o === x;
|
|
3707
|
-
return /* @__PURE__ */
|
|
3707
|
+
return /* @__PURE__ */ k(
|
|
3708
3708
|
"div",
|
|
3709
3709
|
{
|
|
3710
3710
|
role: "option",
|
|
@@ -3746,7 +3746,7 @@ const ln = it(function({
|
|
|
3746
3746
|
)
|
|
3747
3747
|
] });
|
|
3748
3748
|
});
|
|
3749
|
-
function
|
|
3749
|
+
function oi({
|
|
3750
3750
|
tab: e,
|
|
3751
3751
|
state: t,
|
|
3752
3752
|
persistColor: n,
|
|
@@ -3754,7 +3754,7 @@ function ni({
|
|
|
3754
3754
|
secondaryState: a,
|
|
3755
3755
|
persistSecondary: r
|
|
3756
3756
|
}) {
|
|
3757
|
-
const i = Z(() =>
|
|
3757
|
+
const i = Z(() => qt(e), [e]), l = Z(
|
|
3758
3758
|
() => i ?? {
|
|
3759
3759
|
id: "stub",
|
|
3760
3760
|
paletteSize: 0,
|
|
@@ -3769,16 +3769,16 @@ function ni({
|
|
|
3769
3769
|
},
|
|
3770
3770
|
[i]
|
|
3771
3771
|
), d = Z(
|
|
3772
|
-
() => o ?
|
|
3772
|
+
() => o ? qt(o) ?? null : null,
|
|
3773
3773
|
[o]
|
|
3774
3774
|
), c = ne().colorPresets ?? {}, u = Z(
|
|
3775
3775
|
() => ({ ...c, ...l.colorSchemes }),
|
|
3776
3776
|
[c, l.colorSchemes]
|
|
3777
|
-
), p = Z(() => Object.keys(l.colorSchemes), [l.colorSchemes]), f = Z(() => Object.keys(c).sort(), [c]),
|
|
3778
|
-
(m) =>
|
|
3777
|
+
), p = Z(() => Object.keys(l.colorSchemes), [l.colorSchemes]), f = Z(() => Object.keys(c).sort(), [c]), g = l.label ?? l.id.toUpperCase(), _ = d?.label ?? d?.id.toUpperCase() ?? "", b = R(
|
|
3778
|
+
(m) => fe(l, m),
|
|
3779
3779
|
[l]
|
|
3780
3780
|
), v = R(
|
|
3781
|
-
(m) => d ?
|
|
3781
|
+
(m) => d ? fe(d, m) : "",
|
|
3782
3782
|
[d]
|
|
3783
3783
|
), h = R(
|
|
3784
3784
|
(m, N) => {
|
|
@@ -3821,13 +3821,13 @@ function ni({
|
|
|
3821
3821
|
(m) => {
|
|
3822
3822
|
const N = u[m];
|
|
3823
3823
|
if (!N) return;
|
|
3824
|
-
const S =
|
|
3825
|
-
n(() => S),
|
|
3824
|
+
const S = mn(N);
|
|
3825
|
+
n(() => S), ko(S.shikiTheme);
|
|
3826
3826
|
},
|
|
3827
3827
|
[n]
|
|
3828
3828
|
);
|
|
3829
|
-
return /* @__PURE__ */
|
|
3830
|
-
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-actions", children: /* @__PURE__ */
|
|
3829
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-content", children: [
|
|
3830
|
+
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-actions", children: /* @__PURE__ */ k(
|
|
3831
3831
|
"select",
|
|
3832
3832
|
{
|
|
3833
3833
|
onChange: (m) => {
|
|
@@ -3844,9 +3844,9 @@ function ni({
|
|
|
3844
3844
|
]
|
|
3845
3845
|
}
|
|
3846
3846
|
) }),
|
|
3847
|
-
/* @__PURE__ */
|
|
3848
|
-
/* @__PURE__ */
|
|
3849
|
-
|
|
3847
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", children: [
|
|
3848
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
3849
|
+
g,
|
|
3850
3850
|
" — Palette"
|
|
3851
3851
|
] }),
|
|
3852
3852
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-palette-grid", children: t.palette.map((m, N) => (
|
|
@@ -3854,27 +3854,27 @@ function ni({
|
|
|
3854
3854
|
// hand `handlePaletteChange` directly — no inline arrow, memo
|
|
3855
3855
|
// stays effective.
|
|
3856
3856
|
/* @__PURE__ */ s(
|
|
3857
|
-
|
|
3857
|
+
cn,
|
|
3858
3858
|
{
|
|
3859
3859
|
color: m,
|
|
3860
3860
|
index: N,
|
|
3861
|
-
label:
|
|
3862
|
-
cssVar:
|
|
3861
|
+
label: fe(l, N),
|
|
3862
|
+
cssVar: fe(l, N),
|
|
3863
3863
|
onChange: h
|
|
3864
3864
|
},
|
|
3865
3865
|
N
|
|
3866
3866
|
)
|
|
3867
3867
|
)) })
|
|
3868
3868
|
] }),
|
|
3869
|
-
/* @__PURE__ */
|
|
3870
|
-
/* @__PURE__ */
|
|
3871
|
-
/* @__PURE__ */
|
|
3872
|
-
|
|
3869
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-tab-content", children: [
|
|
3870
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", children: [
|
|
3871
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
3872
|
+
g,
|
|
3873
3873
|
" — Base"
|
|
3874
3874
|
] }),
|
|
3875
|
-
/* @__PURE__ */
|
|
3875
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-color-base-grid", children: [
|
|
3876
3876
|
/* @__PURE__ */ s(
|
|
3877
|
-
|
|
3877
|
+
Je,
|
|
3878
3878
|
{
|
|
3879
3879
|
label: "background (bg)",
|
|
3880
3880
|
idKey: "background",
|
|
@@ -3886,7 +3886,7 @@ function ni({
|
|
|
3886
3886
|
}
|
|
3887
3887
|
),
|
|
3888
3888
|
/* @__PURE__ */ s(
|
|
3889
|
-
|
|
3889
|
+
Je,
|
|
3890
3890
|
{
|
|
3891
3891
|
label: "foreground (fg)",
|
|
3892
3892
|
idKey: "foreground",
|
|
@@ -3899,15 +3899,15 @@ function ni({
|
|
|
3899
3899
|
)
|
|
3900
3900
|
] })
|
|
3901
3901
|
] }),
|
|
3902
|
-
/* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
|
|
3902
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", children: [
|
|
3903
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
3904
|
+
g,
|
|
3905
3905
|
" — Semantic Tokens"
|
|
3906
3906
|
] }),
|
|
3907
3907
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-base-grid", children: Object.entries(l.semanticDefaults).map(([m, N]) => {
|
|
3908
3908
|
const S = l.semanticCssNames[m];
|
|
3909
3909
|
return /* @__PURE__ */ s(
|
|
3910
|
-
|
|
3910
|
+
Je,
|
|
3911
3911
|
{
|
|
3912
3912
|
label: S ?? m,
|
|
3913
3913
|
idKey: m,
|
|
@@ -3923,24 +3923,24 @@ function ni({
|
|
|
3923
3923
|
);
|
|
3924
3924
|
}) })
|
|
3925
3925
|
] }),
|
|
3926
|
-
d && a && /* @__PURE__ */
|
|
3927
|
-
/* @__PURE__ */
|
|
3926
|
+
d && a && /* @__PURE__ */ k(ue, { children: [
|
|
3927
|
+
/* @__PURE__ */ k(
|
|
3928
3928
|
"div",
|
|
3929
3929
|
{
|
|
3930
3930
|
className: "tokenpanel-tab-section",
|
|
3931
3931
|
"data-testid": "tokenpanel-secondary-palette-section",
|
|
3932
3932
|
children: [
|
|
3933
|
-
/* @__PURE__ */
|
|
3933
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
3934
3934
|
_,
|
|
3935
3935
|
" — Palette"
|
|
3936
3936
|
] }),
|
|
3937
3937
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-palette-grid--secondary", children: a.palette.map((m, N) => /* @__PURE__ */ s(
|
|
3938
|
-
|
|
3938
|
+
cn,
|
|
3939
3939
|
{
|
|
3940
3940
|
color: m,
|
|
3941
3941
|
index: N,
|
|
3942
|
-
label:
|
|
3943
|
-
cssVar:
|
|
3942
|
+
label: fe(d, N),
|
|
3943
|
+
cssVar: fe(d, N),
|
|
3944
3944
|
onChange: y
|
|
3945
3945
|
},
|
|
3946
3946
|
N
|
|
@@ -3948,20 +3948,20 @@ function ni({
|
|
|
3948
3948
|
]
|
|
3949
3949
|
}
|
|
3950
3950
|
),
|
|
3951
|
-
/* @__PURE__ */
|
|
3951
|
+
/* @__PURE__ */ k(
|
|
3952
3952
|
"div",
|
|
3953
3953
|
{
|
|
3954
3954
|
className: "tokenpanel-tab-section",
|
|
3955
3955
|
"data-testid": "tokenpanel-secondary-semantic-section",
|
|
3956
3956
|
children: [
|
|
3957
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
3958
3958
|
_,
|
|
3959
3959
|
" — Semantic Tokens"
|
|
3960
3960
|
] }),
|
|
3961
3961
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-base-grid", children: Object.entries(d.semanticDefaults).map(([m, N]) => {
|
|
3962
3962
|
const S = d.semanticCssNames[m];
|
|
3963
3963
|
return /* @__PURE__ */ s(
|
|
3964
|
-
|
|
3964
|
+
Je,
|
|
3965
3965
|
{
|
|
3966
3966
|
label: S ?? m,
|
|
3967
3967
|
idKey: m,
|
|
@@ -3979,46 +3979,54 @@ function ni({
|
|
|
3979
3979
|
)
|
|
3980
3980
|
] })
|
|
3981
3981
|
] })
|
|
3982
|
-
] })
|
|
3982
|
+
] });
|
|
3983
3983
|
}
|
|
3984
|
-
const
|
|
3985
|
-
function
|
|
3986
|
-
return e.length <=
|
|
3984
|
+
const Fe = "__literal__", dn = 28;
|
|
3985
|
+
function ri(e) {
|
|
3986
|
+
return e.length <= dn ? e : e.slice(0, dn - 1) + "…";
|
|
3987
3987
|
}
|
|
3988
|
-
function
|
|
3988
|
+
function un(e, t) {
|
|
3989
3989
|
return e.tiers.find((n) => n.id === t);
|
|
3990
3990
|
}
|
|
3991
|
-
function
|
|
3991
|
+
function ai(e, t) {
|
|
3992
3992
|
return e.items.find((n) => n.id === t);
|
|
3993
3993
|
}
|
|
3994
|
-
function
|
|
3995
|
-
const l =
|
|
3996
|
-
return /* @__PURE__ */ s("div", { className: "tokenpanel-tier-ref-selector", children: /* @__PURE__ */
|
|
3994
|
+
function ii({ tab: e, tierId: t, itemId: n, value: o, onChange: a, previewValueFor: r }) {
|
|
3995
|
+
const l = un(e, t)?.referencesTier ?? "", d = l ? un(e, l) : void 0, c = d?.items ?? [], u = d && ai(d, o) ? o : c[0]?.id ?? "";
|
|
3996
|
+
return /* @__PURE__ */ s("div", { className: "tokenpanel-tier-ref-selector", children: /* @__PURE__ */ k(
|
|
3997
3997
|
"select",
|
|
3998
3998
|
{
|
|
3999
3999
|
className: "tokenpanel-tier-ref-select",
|
|
4000
|
-
value: u === "" ?
|
|
4000
|
+
value: u === "" ? Fe : u,
|
|
4001
4001
|
onChange: (f) => {
|
|
4002
4002
|
a(n, f.currentTarget.value);
|
|
4003
4003
|
},
|
|
4004
4004
|
"aria-label": `${n} tier reference`,
|
|
4005
4005
|
children: [
|
|
4006
4006
|
c.map((f) => {
|
|
4007
|
-
const
|
|
4008
|
-
return /* @__PURE__ */
|
|
4007
|
+
const g = ri(r(f.id));
|
|
4008
|
+
return /* @__PURE__ */ k("option", { value: f.id, children: [
|
|
4009
4009
|
f.cssVar,
|
|
4010
4010
|
" (",
|
|
4011
|
-
|
|
4011
|
+
g,
|
|
4012
4012
|
")"
|
|
4013
4013
|
] }, f.id);
|
|
4014
4014
|
}),
|
|
4015
|
-
/* @__PURE__ */ s("option", { value:
|
|
4015
|
+
/* @__PURE__ */ s("option", { value: Fe, children: "Literal…" })
|
|
4016
4016
|
]
|
|
4017
4017
|
}
|
|
4018
4018
|
) });
|
|
4019
4019
|
}
|
|
4020
|
-
const
|
|
4021
|
-
function
|
|
4020
|
+
const dt = Ke(ii);
|
|
4021
|
+
function li({ cssVar: e, label: t, className: n }) {
|
|
4022
|
+
const o = Ft(e);
|
|
4023
|
+
return /* @__PURE__ */ k("span", { className: n ?? "tokenpanel-row-label", ...o, children: [
|
|
4024
|
+
e,
|
|
4025
|
+
t && t !== e && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: t })
|
|
4026
|
+
] });
|
|
4027
|
+
}
|
|
4028
|
+
const le = Ke(li);
|
|
4029
|
+
function si({ item: e, value: t, onChange: n }) {
|
|
4022
4030
|
const o = e.type, a = e.readonly === !0, r = e.pill, i = r?.value ?? "", l = r?.customDefault ?? "", d = r ? t === i : !1, c = O(d ? l : t);
|
|
4023
4031
|
X(() => {
|
|
4024
4032
|
d || (c.current = t);
|
|
@@ -4032,7 +4040,7 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4032
4040
|
switch (o.kind) {
|
|
4033
4041
|
case "length":
|
|
4034
4042
|
case "number": {
|
|
4035
|
-
const p = o.kind === "length" ? o.unit : "", f = parseFloat(t),
|
|
4043
|
+
const p = o.kind === "length" ? o.unit : "", f = parseFloat(t), g = Number.isFinite(f) ? f : 0, [_, b] = K(String(g));
|
|
4036
4044
|
X(() => {
|
|
4037
4045
|
b(String(Number.isFinite(parseFloat(t)) ? parseFloat(t) : 0));
|
|
4038
4046
|
}, [t]);
|
|
@@ -4043,13 +4051,10 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4043
4051
|
Number.isFinite(x) && n(e.id, p ? `${x}${p}` : String(x));
|
|
4044
4052
|
}, h = () => {
|
|
4045
4053
|
const A = parseFloat(_);
|
|
4046
|
-
Number.isFinite(A) || b(String(
|
|
4047
|
-
}, y = a || r !== void 0 && d, M = /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${e.id}`, children: /* @__PURE__ */
|
|
4048
|
-
/* @__PURE__ */
|
|
4049
|
-
|
|
4050
|
-
e.label !== e.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: e.label })
|
|
4051
|
-
] }),
|
|
4052
|
-
/* @__PURE__ */ g("div", { className: "tokenpanel-row-input-group", children: [
|
|
4054
|
+
Number.isFinite(A) || b(String(g));
|
|
4055
|
+
}, y = a || r !== void 0 && d, M = /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${e.id}`, children: /* @__PURE__ */ k("div", { className: "tokenpanel-row-head", children: [
|
|
4056
|
+
/* @__PURE__ */ s(le, { cssVar: e.cssVar, label: e.label }),
|
|
4057
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-row-input-group", children: [
|
|
4053
4058
|
/* @__PURE__ */ s(
|
|
4054
4059
|
"input",
|
|
4055
4060
|
{
|
|
@@ -4067,8 +4072,8 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4067
4072
|
] }),
|
|
4068
4073
|
/* @__PURE__ */ s(ae, { cssVar: e.cssVar })
|
|
4069
4074
|
] }) });
|
|
4070
|
-
return r ? /* @__PURE__ */
|
|
4071
|
-
/* @__PURE__ */
|
|
4075
|
+
return r ? /* @__PURE__ */ k("div", { className: "tokenpanel-row--column", children: [
|
|
4076
|
+
/* @__PURE__ */ k("label", { className: "tokenpanel-pill-toggle", children: [
|
|
4072
4077
|
/* @__PURE__ */ s(
|
|
4073
4078
|
"input",
|
|
4074
4079
|
{
|
|
@@ -4079,7 +4084,7 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4079
4084
|
"aria-label": `${e.cssVar} pill toggle`
|
|
4080
4085
|
}
|
|
4081
4086
|
),
|
|
4082
|
-
/* @__PURE__ */
|
|
4087
|
+
/* @__PURE__ */ k("span", { className: "tokenpanel-pill-toggle-text", children: [
|
|
4083
4088
|
"Pill (",
|
|
4084
4089
|
i,
|
|
4085
4090
|
")"
|
|
@@ -4089,18 +4094,15 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4089
4094
|
] }) : M;
|
|
4090
4095
|
}
|
|
4091
4096
|
case "select": {
|
|
4092
|
-
const p = o.options, [f,
|
|
4097
|
+
const p = o.options, [f, g] = K(t);
|
|
4093
4098
|
X(() => {
|
|
4094
|
-
|
|
4099
|
+
g(t);
|
|
4095
4100
|
}, [t]);
|
|
4096
4101
|
const _ = (b) => {
|
|
4097
|
-
n(e.id, b.currentTarget.value),
|
|
4102
|
+
n(e.id, b.currentTarget.value), g(b.currentTarget.value);
|
|
4098
4103
|
};
|
|
4099
|
-
return /* @__PURE__ */
|
|
4100
|
-
/* @__PURE__ */
|
|
4101
|
-
e.cssVar,
|
|
4102
|
-
e.label !== e.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: e.label })
|
|
4103
|
-
] }),
|
|
4104
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${e.id}`, children: [
|
|
4105
|
+
/* @__PURE__ */ s(le, { cssVar: e.cssVar, label: e.label }),
|
|
4104
4106
|
/* @__PURE__ */ s(
|
|
4105
4107
|
"select",
|
|
4106
4108
|
{
|
|
@@ -4122,11 +4124,8 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4122
4124
|
const p = (f) => {
|
|
4123
4125
|
n(e.id, f.currentTarget.value);
|
|
4124
4126
|
};
|
|
4125
|
-
return /* @__PURE__ */
|
|
4126
|
-
/* @__PURE__ */
|
|
4127
|
-
e.cssVar,
|
|
4128
|
-
e.label !== e.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: e.label })
|
|
4129
|
-
] }),
|
|
4127
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${e.id}`, children: [
|
|
4128
|
+
/* @__PURE__ */ s(le, { cssVar: e.cssVar, label: e.label }),
|
|
4130
4129
|
/* @__PURE__ */ s(
|
|
4131
4130
|
"input",
|
|
4132
4131
|
{
|
|
@@ -4149,11 +4148,8 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4149
4148
|
const p = (f) => {
|
|
4150
4149
|
n(e.id, f.currentTarget.value);
|
|
4151
4150
|
};
|
|
4152
|
-
return /* @__PURE__ */
|
|
4153
|
-
/* @__PURE__ */
|
|
4154
|
-
e.cssVar,
|
|
4155
|
-
e.label !== e.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: e.label })
|
|
4156
|
-
] }),
|
|
4151
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${e.id}`, children: [
|
|
4152
|
+
/* @__PURE__ */ s(le, { cssVar: e.cssVar, label: e.label }),
|
|
4157
4153
|
/* @__PURE__ */ s(
|
|
4158
4154
|
"input",
|
|
4159
4155
|
{
|
|
@@ -4172,11 +4168,11 @@ function ii({ item: e, value: t, onChange: n }) {
|
|
|
4172
4168
|
return null;
|
|
4173
4169
|
}
|
|
4174
4170
|
}
|
|
4175
|
-
const
|
|
4176
|
-
function
|
|
4171
|
+
const Kt = Ke(si);
|
|
4172
|
+
function ci({ tab: e, state: t, persistFont: n }) {
|
|
4177
4173
|
const o = R(
|
|
4178
4174
|
(r, i) => {
|
|
4179
|
-
if (i ===
|
|
4175
|
+
if (i === Fe) {
|
|
4180
4176
|
n((l) => {
|
|
4181
4177
|
const d = { ...l };
|
|
4182
4178
|
return delete d[r], d;
|
|
@@ -4189,7 +4185,7 @@ function li({ tab: e, state: t, persistFont: n }) {
|
|
|
4189
4185
|
), a = R(() => {
|
|
4190
4186
|
n(() => ({}));
|
|
4191
4187
|
}, [n]);
|
|
4192
|
-
return /* @__PURE__ */
|
|
4188
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-content", children: [
|
|
4193
4189
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-actions", children: /* @__PURE__ */ s(
|
|
4194
4190
|
"div",
|
|
4195
4191
|
{
|
|
@@ -4204,7 +4200,7 @@ function li({ tab: e, state: t, persistFont: n }) {
|
|
|
4204
4200
|
}
|
|
4205
4201
|
) }),
|
|
4206
4202
|
e.tiers.map((r) => /* @__PURE__ */ s(
|
|
4207
|
-
|
|
4203
|
+
di,
|
|
4208
4204
|
{
|
|
4209
4205
|
tab: e,
|
|
4210
4206
|
tier: r,
|
|
@@ -4215,9 +4211,9 @@ function li({ tab: e, state: t, persistFont: n }) {
|
|
|
4215
4211
|
))
|
|
4216
4212
|
] });
|
|
4217
4213
|
}
|
|
4218
|
-
function
|
|
4214
|
+
function di({ tab: e, tier: t, state: n, onChange: o }) {
|
|
4219
4215
|
const a = t.referencesTier !== void 0;
|
|
4220
|
-
return /* @__PURE__ */
|
|
4216
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `font-tier-${t.id}`, children: [
|
|
4221
4217
|
/* @__PURE__ */ s(
|
|
4222
4218
|
"div",
|
|
4223
4219
|
{
|
|
@@ -4229,18 +4225,15 @@ function si({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4229
4225
|
),
|
|
4230
4226
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-grid", children: t.items.map((r) => {
|
|
4231
4227
|
const i = n[r.id] ?? r.default;
|
|
4232
|
-
return a ? /* @__PURE__ */
|
|
4228
|
+
return a ? /* @__PURE__ */ k(
|
|
4233
4229
|
"div",
|
|
4234
4230
|
{
|
|
4235
4231
|
className: "tokenpanel-row",
|
|
4236
4232
|
"data-testid": `tier-ref-row-${r.id}`,
|
|
4237
4233
|
children: [
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
r.cssVar,
|
|
4240
|
-
r.label !== r.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: r.label })
|
|
4241
|
-
] }),
|
|
4234
|
+
/* @__PURE__ */ s(le, { cssVar: r.cssVar, label: r.label }),
|
|
4242
4235
|
/* @__PURE__ */ s(
|
|
4243
|
-
|
|
4236
|
+
dt,
|
|
4244
4237
|
{
|
|
4245
4238
|
tab: e,
|
|
4246
4239
|
tierId: t.id,
|
|
@@ -4248,7 +4241,7 @@ function si({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4248
4241
|
value: i,
|
|
4249
4242
|
onChange: o,
|
|
4250
4243
|
previewValueFor: (l) => {
|
|
4251
|
-
const d = t.referencesTier, c =
|
|
4244
|
+
const d = t.referencesTier, c = je(e, d, l, {
|
|
4252
4245
|
[d]: n
|
|
4253
4246
|
});
|
|
4254
4247
|
return c.kind === "literal" ? c.value : c.targetCssVar;
|
|
@@ -4260,7 +4253,7 @@ function si({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4260
4253
|
},
|
|
4261
4254
|
r.id
|
|
4262
4255
|
) : /* @__PURE__ */ s(
|
|
4263
|
-
|
|
4256
|
+
Kt,
|
|
4264
4257
|
{
|
|
4265
4258
|
item: r,
|
|
4266
4259
|
value: i,
|
|
@@ -4271,10 +4264,10 @@ function si({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4271
4264
|
}) })
|
|
4272
4265
|
] });
|
|
4273
4266
|
}
|
|
4274
|
-
function
|
|
4267
|
+
function ui({ tab: e, state: t, persistSize: n }) {
|
|
4275
4268
|
const o = R(
|
|
4276
4269
|
(r, i) => {
|
|
4277
|
-
if (i ===
|
|
4270
|
+
if (i === Fe) {
|
|
4278
4271
|
n((l) => {
|
|
4279
4272
|
const d = { ...l };
|
|
4280
4273
|
return delete d[r], d;
|
|
@@ -4287,7 +4280,7 @@ function ci({ tab: e, state: t, persistSize: n }) {
|
|
|
4287
4280
|
), a = R(() => {
|
|
4288
4281
|
n(() => ({}));
|
|
4289
4282
|
}, [n]);
|
|
4290
|
-
return /* @__PURE__ */
|
|
4283
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-content", children: [
|
|
4291
4284
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-actions", children: /* @__PURE__ */ s(
|
|
4292
4285
|
"div",
|
|
4293
4286
|
{
|
|
@@ -4302,7 +4295,7 @@ function ci({ tab: e, state: t, persistSize: n }) {
|
|
|
4302
4295
|
}
|
|
4303
4296
|
) }),
|
|
4304
4297
|
e.tiers.map((r) => /* @__PURE__ */ s(
|
|
4305
|
-
|
|
4298
|
+
pi,
|
|
4306
4299
|
{
|
|
4307
4300
|
tab: e,
|
|
4308
4301
|
tier: r,
|
|
@@ -4313,9 +4306,9 @@ function ci({ tab: e, state: t, persistSize: n }) {
|
|
|
4313
4306
|
))
|
|
4314
4307
|
] });
|
|
4315
4308
|
}
|
|
4316
|
-
function
|
|
4309
|
+
function pi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
4317
4310
|
const a = t.referencesTier !== void 0;
|
|
4318
|
-
return /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `size-tier-${t.id}`, children: [
|
|
4319
4312
|
/* @__PURE__ */ s(
|
|
4320
4313
|
"div",
|
|
4321
4314
|
{
|
|
@@ -4327,18 +4320,15 @@ function di({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4327
4320
|
),
|
|
4328
4321
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-grid", children: t.items.map((r) => {
|
|
4329
4322
|
const i = n[r.id] ?? r.default;
|
|
4330
|
-
return a ? /* @__PURE__ */
|
|
4323
|
+
return a ? /* @__PURE__ */ k(
|
|
4331
4324
|
"div",
|
|
4332
4325
|
{
|
|
4333
4326
|
className: "tokenpanel-row",
|
|
4334
4327
|
"data-testid": `tier-ref-row-${r.id}`,
|
|
4335
4328
|
children: [
|
|
4336
|
-
/* @__PURE__ */
|
|
4337
|
-
r.cssVar,
|
|
4338
|
-
r.label !== r.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: r.label })
|
|
4339
|
-
] }),
|
|
4329
|
+
/* @__PURE__ */ s(le, { cssVar: r.cssVar, label: r.label }),
|
|
4340
4330
|
/* @__PURE__ */ s(
|
|
4341
|
-
|
|
4331
|
+
dt,
|
|
4342
4332
|
{
|
|
4343
4333
|
tab: e,
|
|
4344
4334
|
tierId: t.id,
|
|
@@ -4346,7 +4336,7 @@ function di({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4346
4336
|
value: i,
|
|
4347
4337
|
onChange: o,
|
|
4348
4338
|
previewValueFor: (l) => {
|
|
4349
|
-
const d = t.referencesTier, c =
|
|
4339
|
+
const d = t.referencesTier, c = je(e, d, l, {
|
|
4350
4340
|
[d]: n
|
|
4351
4341
|
});
|
|
4352
4342
|
return c.kind === "literal" ? c.value : c.targetCssVar;
|
|
@@ -4358,7 +4348,7 @@ function di({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4358
4348
|
},
|
|
4359
4349
|
r.id
|
|
4360
4350
|
) : /* @__PURE__ */ s(
|
|
4361
|
-
|
|
4351
|
+
Kt,
|
|
4362
4352
|
{
|
|
4363
4353
|
item: r,
|
|
4364
4354
|
value: i,
|
|
@@ -4369,10 +4359,10 @@ function di({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4369
4359
|
}) })
|
|
4370
4360
|
] });
|
|
4371
4361
|
}
|
|
4372
|
-
function
|
|
4362
|
+
function fi({ tab: e, state: t, persistSpacing: n }) {
|
|
4373
4363
|
const o = R(
|
|
4374
4364
|
(r, i) => {
|
|
4375
|
-
if (i ===
|
|
4365
|
+
if (i === Fe) {
|
|
4376
4366
|
n((l) => {
|
|
4377
4367
|
const d = { ...l };
|
|
4378
4368
|
return delete d[r], d;
|
|
@@ -4385,7 +4375,7 @@ function ui({ tab: e, state: t, persistSpacing: n }) {
|
|
|
4385
4375
|
), a = R(() => {
|
|
4386
4376
|
n(() => ({}));
|
|
4387
4377
|
}, [n]);
|
|
4388
|
-
return /* @__PURE__ */
|
|
4378
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-content", children: [
|
|
4389
4379
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-actions", children: /* @__PURE__ */ s(
|
|
4390
4380
|
"div",
|
|
4391
4381
|
{
|
|
@@ -4400,7 +4390,7 @@ function ui({ tab: e, state: t, persistSpacing: n }) {
|
|
|
4400
4390
|
}
|
|
4401
4391
|
) }),
|
|
4402
4392
|
e.tiers.map((r) => /* @__PURE__ */ s(
|
|
4403
|
-
|
|
4393
|
+
hi,
|
|
4404
4394
|
{
|
|
4405
4395
|
tab: e,
|
|
4406
4396
|
tier: r,
|
|
@@ -4411,9 +4401,9 @@ function ui({ tab: e, state: t, persistSpacing: n }) {
|
|
|
4411
4401
|
))
|
|
4412
4402
|
] });
|
|
4413
4403
|
}
|
|
4414
|
-
function
|
|
4404
|
+
function hi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
4415
4405
|
const a = t.referencesTier !== void 0;
|
|
4416
|
-
return /* @__PURE__ */
|
|
4406
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `spacing-tier-${t.id}`, children: [
|
|
4417
4407
|
/* @__PURE__ */ s(
|
|
4418
4408
|
"div",
|
|
4419
4409
|
{
|
|
@@ -4425,18 +4415,15 @@ function pi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4425
4415
|
),
|
|
4426
4416
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-grid", children: t.items.map((r) => {
|
|
4427
4417
|
const i = n[r.id] ?? r.default;
|
|
4428
|
-
return a ? /* @__PURE__ */
|
|
4418
|
+
return a ? /* @__PURE__ */ k(
|
|
4429
4419
|
"div",
|
|
4430
4420
|
{
|
|
4431
4421
|
className: "tokenpanel-row",
|
|
4432
4422
|
"data-testid": `tier-ref-row-${r.id}`,
|
|
4433
4423
|
children: [
|
|
4434
|
-
/* @__PURE__ */
|
|
4435
|
-
r.cssVar,
|
|
4436
|
-
r.label !== r.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: r.label })
|
|
4437
|
-
] }),
|
|
4424
|
+
/* @__PURE__ */ s(le, { cssVar: r.cssVar, label: r.label }),
|
|
4438
4425
|
/* @__PURE__ */ s(
|
|
4439
|
-
|
|
4426
|
+
dt,
|
|
4440
4427
|
{
|
|
4441
4428
|
tab: e,
|
|
4442
4429
|
tierId: t.id,
|
|
@@ -4444,7 +4431,7 @@ function pi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4444
4431
|
value: i,
|
|
4445
4432
|
onChange: o,
|
|
4446
4433
|
previewValueFor: (l) => {
|
|
4447
|
-
const d = t.referencesTier, c =
|
|
4434
|
+
const d = t.referencesTier, c = je(e, d, l, {
|
|
4448
4435
|
[d]: n
|
|
4449
4436
|
});
|
|
4450
4437
|
return c.kind === "literal" ? c.value : c.targetCssVar;
|
|
@@ -4456,7 +4443,7 @@ function pi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4456
4443
|
},
|
|
4457
4444
|
r.id
|
|
4458
4445
|
) : /* @__PURE__ */ s(
|
|
4459
|
-
|
|
4446
|
+
Kt,
|
|
4460
4447
|
{
|
|
4461
4448
|
item: r,
|
|
4462
4449
|
value: i,
|
|
@@ -4467,16 +4454,13 @@ function pi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4467
4454
|
}) })
|
|
4468
4455
|
] });
|
|
4469
4456
|
}
|
|
4470
|
-
function
|
|
4457
|
+
function gi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
4471
4458
|
if (t.referencesTier !== void 0) {
|
|
4472
4459
|
const d = t.referencesTier;
|
|
4473
|
-
return /* @__PURE__ */
|
|
4474
|
-
/* @__PURE__ */
|
|
4475
|
-
n.cssVar,
|
|
4476
|
-
n.label !== n.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: n.label })
|
|
4477
|
-
] }),
|
|
4460
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-ref-row-${n.id}`, children: [
|
|
4461
|
+
/* @__PURE__ */ s(le, { cssVar: n.cssVar, label: n.label }),
|
|
4478
4462
|
/* @__PURE__ */ s(
|
|
4479
|
-
|
|
4463
|
+
dt,
|
|
4480
4464
|
{
|
|
4481
4465
|
tab: e,
|
|
4482
4466
|
tierId: t.id,
|
|
@@ -4484,7 +4468,7 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4484
4468
|
value: o,
|
|
4485
4469
|
onChange: r,
|
|
4486
4470
|
previewValueFor: (c) => {
|
|
4487
|
-
const u =
|
|
4471
|
+
const u = je(e, d, c, a);
|
|
4488
4472
|
return u.kind === "literal" ? u.value : u.targetCssVar;
|
|
4489
4473
|
}
|
|
4490
4474
|
}
|
|
@@ -4500,7 +4484,7 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4500
4484
|
X(() => {
|
|
4501
4485
|
f(String(Number.isFinite(parseFloat(o)) ? parseFloat(o) : 0));
|
|
4502
4486
|
}, [o]);
|
|
4503
|
-
const
|
|
4487
|
+
const g = (b) => {
|
|
4504
4488
|
const v = b.currentTarget.value;
|
|
4505
4489
|
f(v);
|
|
4506
4490
|
const h = parseFloat(v);
|
|
@@ -4509,19 +4493,16 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4509
4493
|
const b = parseFloat(p);
|
|
4510
4494
|
Number.isFinite(b) || f(String(u));
|
|
4511
4495
|
};
|
|
4512
|
-
return /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${n.id}`, children: /* @__PURE__ */
|
|
4513
|
-
/* @__PURE__ */
|
|
4514
|
-
|
|
4515
|
-
n.label !== n.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: n.label })
|
|
4516
|
-
] }),
|
|
4517
|
-
/* @__PURE__ */ g("div", { className: "tokenpanel-row-input-group", children: [
|
|
4496
|
+
return /* @__PURE__ */ s("div", { className: "tokenpanel-row--stacked", "data-testid": `tier-item-${n.id}`, children: /* @__PURE__ */ k("div", { className: "tokenpanel-row-head", children: [
|
|
4497
|
+
/* @__PURE__ */ s(le, { cssVar: n.cssVar, label: n.label }),
|
|
4498
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-row-input-group", children: [
|
|
4518
4499
|
/* @__PURE__ */ s(
|
|
4519
4500
|
"input",
|
|
4520
4501
|
{
|
|
4521
4502
|
type: "text",
|
|
4522
4503
|
inputMode: "decimal",
|
|
4523
4504
|
value: p,
|
|
4524
|
-
onChange:
|
|
4505
|
+
onChange: g,
|
|
4525
4506
|
onBlur: _,
|
|
4526
4507
|
disabled: l,
|
|
4527
4508
|
className: "tokenpanel-row-number-input",
|
|
@@ -4537,11 +4518,8 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4537
4518
|
const d = i.options, c = (u) => {
|
|
4538
4519
|
r(n.id, u.currentTarget.value);
|
|
4539
4520
|
};
|
|
4540
|
-
return /* @__PURE__ */
|
|
4541
|
-
/* @__PURE__ */
|
|
4542
|
-
n.cssVar,
|
|
4543
|
-
n.label !== n.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: n.label })
|
|
4544
|
-
] }),
|
|
4521
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${n.id}`, children: [
|
|
4522
|
+
/* @__PURE__ */ s(le, { cssVar: n.cssVar, label: n.label }),
|
|
4545
4523
|
/* @__PURE__ */ s(
|
|
4546
4524
|
"select",
|
|
4547
4525
|
{
|
|
@@ -4563,11 +4541,8 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4563
4541
|
const d = (c) => {
|
|
4564
4542
|
r(n.id, c.currentTarget.value);
|
|
4565
4543
|
};
|
|
4566
|
-
return /* @__PURE__ */
|
|
4567
|
-
/* @__PURE__ */
|
|
4568
|
-
n.cssVar,
|
|
4569
|
-
n.label !== n.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: n.label })
|
|
4570
|
-
] }),
|
|
4544
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${n.id}`, children: [
|
|
4545
|
+
/* @__PURE__ */ s(le, { cssVar: n.cssVar, label: n.label }),
|
|
4571
4546
|
/* @__PURE__ */ s(
|
|
4572
4547
|
"input",
|
|
4573
4548
|
{
|
|
@@ -4590,11 +4565,8 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4590
4565
|
const d = (c) => {
|
|
4591
4566
|
r(n.id, c.currentTarget.value);
|
|
4592
4567
|
};
|
|
4593
|
-
return /* @__PURE__ */
|
|
4594
|
-
/* @__PURE__ */
|
|
4595
|
-
n.cssVar,
|
|
4596
|
-
n.label !== n.cssVar && /* @__PURE__ */ s("span", { className: "tokenpanel-row-label-sub", children: n.label })
|
|
4597
|
-
] }),
|
|
4568
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-item-${n.id}`, children: [
|
|
4569
|
+
/* @__PURE__ */ s(le, { cssVar: n.cssVar, label: n.label }),
|
|
4598
4570
|
/* @__PURE__ */ s(
|
|
4599
4571
|
"input",
|
|
4600
4572
|
{
|
|
@@ -4613,14 +4585,14 @@ function fi({ tab: e, tier: t, item: n, value: o, overrides: a, onChange: r }) {
|
|
|
4613
4585
|
return null;
|
|
4614
4586
|
}
|
|
4615
4587
|
}
|
|
4616
|
-
function
|
|
4588
|
+
function ki({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: a }) {
|
|
4617
4589
|
const r = R(
|
|
4618
4590
|
(i, l) => {
|
|
4619
4591
|
a(t.id, i, l);
|
|
4620
4592
|
},
|
|
4621
4593
|
[a, t.id]
|
|
4622
4594
|
);
|
|
4623
|
-
return /* @__PURE__ */
|
|
4595
|
+
return /* @__PURE__ */ k("div", { className: "tokenpanel-tab-section", "data-testid": `tier-section-${t.id}`, children: [
|
|
4624
4596
|
/* @__PURE__ */ s(
|
|
4625
4597
|
"div",
|
|
4626
4598
|
{
|
|
@@ -4633,7 +4605,7 @@ function hi({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: a }
|
|
|
4633
4605
|
/* @__PURE__ */ s("div", { className: "tokenpanel-tab-grid", children: t.items.map((i) => {
|
|
4634
4606
|
const l = n[i.id] ?? i.default;
|
|
4635
4607
|
return /* @__PURE__ */ s(
|
|
4636
|
-
|
|
4608
|
+
gi,
|
|
4637
4609
|
{
|
|
4638
4610
|
tab: e,
|
|
4639
4611
|
tier: t,
|
|
@@ -4647,7 +4619,7 @@ function hi({ tab: e, tier: t, overrides: n, fullOverrides: o, onItemChange: a }
|
|
|
4647
4619
|
}) })
|
|
4648
4620
|
] });
|
|
4649
4621
|
}
|
|
4650
|
-
function
|
|
4622
|
+
function mi({ tab: e, overrides: t, onChange: n }) {
|
|
4651
4623
|
const o = R(
|
|
4652
4624
|
(a, r, i) => {
|
|
4653
4625
|
n(a, r, i);
|
|
@@ -4657,7 +4629,7 @@ function gi({ tab: e, overrides: t, onChange: n }) {
|
|
|
4657
4629
|
return /* @__PURE__ */ s("div", { className: "tokenpanel-tab-content", "data-testid": `generic-tab-${e.id}`, children: e.tiers.map((a) => {
|
|
4658
4630
|
const r = t[a.id] ?? {};
|
|
4659
4631
|
return /* @__PURE__ */ s(
|
|
4660
|
-
|
|
4632
|
+
ki,
|
|
4661
4633
|
{
|
|
4662
4634
|
tab: e,
|
|
4663
4635
|
tier: a,
|
|
@@ -4669,25 +4641,25 @@ function gi({ tab: e, overrides: t, onChange: n }) {
|
|
|
4669
4641
|
);
|
|
4670
4642
|
}) });
|
|
4671
4643
|
}
|
|
4672
|
-
function
|
|
4644
|
+
function bi(e) {
|
|
4673
4645
|
const t = J(
|
|
4674
4646
|
(c) => {
|
|
4675
4647
|
e((u) => {
|
|
4676
4648
|
if (!u) return u;
|
|
4677
4649
|
const p = c(u);
|
|
4678
|
-
return
|
|
4650
|
+
return tt(p), bn(p), p;
|
|
4679
4651
|
});
|
|
4680
4652
|
},
|
|
4681
4653
|
[e]
|
|
4682
4654
|
), n = J(
|
|
4683
4655
|
(c, u) => {
|
|
4684
4656
|
t((p) => {
|
|
4685
|
-
const f = p.tabs?.[c] ?? {},
|
|
4657
|
+
const f = p.tabs?.[c] ?? {}, g = u(f);
|
|
4686
4658
|
return {
|
|
4687
4659
|
...p,
|
|
4688
4660
|
tabs: {
|
|
4689
4661
|
...p.tabs,
|
|
4690
|
-
[c]:
|
|
4662
|
+
[c]: g
|
|
4691
4663
|
}
|
|
4692
4664
|
};
|
|
4693
4665
|
});
|
|
@@ -4723,8 +4695,8 @@ function ki(e) {
|
|
|
4723
4695
|
t((u) => {
|
|
4724
4696
|
const p = c(u.secondary);
|
|
4725
4697
|
if (p === void 0) {
|
|
4726
|
-
const { secondary: f, ...
|
|
4727
|
-
return
|
|
4698
|
+
const { secondary: f, ...g } = u;
|
|
4699
|
+
return g;
|
|
4728
4700
|
}
|
|
4729
4701
|
return { ...u, secondary: p };
|
|
4730
4702
|
});
|
|
@@ -4748,9 +4720,9 @@ function ki(e) {
|
|
|
4748
4720
|
persistSecondary: d
|
|
4749
4721
|
};
|
|
4750
4722
|
}
|
|
4751
|
-
const
|
|
4752
|
-
function
|
|
4753
|
-
const o = e <
|
|
4723
|
+
const vi = ["color", "font", "spacing", "size"], wi = "color", Oe = 900;
|
|
4724
|
+
function xi(e, t, n) {
|
|
4725
|
+
const o = e < Oe;
|
|
4754
4726
|
return o ? {
|
|
4755
4727
|
width: "min(calc(100vw - 16px), 500px)",
|
|
4756
4728
|
height: "min(800px, calc(100vh - 32px))",
|
|
@@ -4761,47 +4733,47 @@ function vi(e, t, n) {
|
|
|
4761
4733
|
narrow: o
|
|
4762
4734
|
};
|
|
4763
4735
|
}
|
|
4764
|
-
function
|
|
4736
|
+
function Ue() {
|
|
4765
4737
|
return {
|
|
4766
|
-
color:
|
|
4767
|
-
spacing:
|
|
4768
|
-
typography:
|
|
4769
|
-
size:
|
|
4770
|
-
secondary:
|
|
4738
|
+
color: Ze(),
|
|
4739
|
+
spacing: vt(),
|
|
4740
|
+
typography: vt(),
|
|
4741
|
+
size: vt(),
|
|
4742
|
+
secondary: wn()
|
|
4771
4743
|
};
|
|
4772
4744
|
}
|
|
4773
|
-
function
|
|
4774
|
-
const e =
|
|
4745
|
+
function yi() {
|
|
4746
|
+
const e = lt(), [t, n] = K(!1), [o, a] = K(!1), [r, i] = K(!1), [l, d] = K(!1), [c, u] = K(!1), p = O(null), [f, g] = K(null), [_, b] = K(wi), [v, h] = K(jt), [y, M] = K(mo), [A, C] = K(bo), [x, m] = K(!1), N = O(null), S = O({
|
|
4775
4747
|
spacing: null,
|
|
4776
4748
|
font: null,
|
|
4777
4749
|
size: null,
|
|
4778
4750
|
color: null
|
|
4779
|
-
}), B = O(
|
|
4751
|
+
}), B = O(jt);
|
|
4780
4752
|
B.current = v;
|
|
4781
4753
|
const j = O(y);
|
|
4782
4754
|
j.current = y;
|
|
4783
|
-
const Y = O(null), Q = O(null), { persistColor:
|
|
4755
|
+
const Y = O(null), Q = O(null), { persistColor: ce, persistSpacing: oe, persistFont: ve, persistSize: pe, persistSecondary: $e, persistTab: T } = bi(g);
|
|
4784
4756
|
X(() => {
|
|
4785
4757
|
try {
|
|
4786
|
-
localStorage.getItem(
|
|
4758
|
+
localStorage.getItem(De()) === "1" && n(!0);
|
|
4787
4759
|
} catch {
|
|
4788
4760
|
}
|
|
4789
|
-
const $ =
|
|
4761
|
+
const $ = vo();
|
|
4790
4762
|
h($), B.current = $;
|
|
4791
|
-
const H =
|
|
4792
|
-
M(H), j.current = H, C(
|
|
4763
|
+
const H = wo();
|
|
4764
|
+
M(H), j.current = H, C(xo()), m(window.innerWidth < Oe);
|
|
4793
4765
|
}, []);
|
|
4794
4766
|
const D = R(($) => {
|
|
4795
|
-
C($),
|
|
4767
|
+
C($), yo($);
|
|
4796
4768
|
}, []);
|
|
4797
4769
|
X(() => {
|
|
4798
4770
|
try {
|
|
4799
|
-
const $ =
|
|
4771
|
+
const $ = De();
|
|
4800
4772
|
t ? localStorage.setItem($, "1") : localStorage.removeItem($);
|
|
4801
4773
|
} catch {
|
|
4802
4774
|
}
|
|
4803
4775
|
try {
|
|
4804
|
-
const $ =
|
|
4776
|
+
const $ = xn(ne());
|
|
4805
4777
|
localStorage.setItem($, t ? "1" : "0");
|
|
4806
4778
|
} catch {
|
|
4807
4779
|
}
|
|
@@ -4816,7 +4788,7 @@ function wi() {
|
|
|
4816
4788
|
}, [t, o, r, l]), X(() => {
|
|
4817
4789
|
function $() {
|
|
4818
4790
|
try {
|
|
4819
|
-
n(localStorage.getItem(
|
|
4791
|
+
n(localStorage.getItem(De()) === "1");
|
|
4820
4792
|
} catch {
|
|
4821
4793
|
}
|
|
4822
4794
|
}
|
|
@@ -4825,85 +4797,85 @@ function wi() {
|
|
|
4825
4797
|
};
|
|
4826
4798
|
}, []), X(() => {
|
|
4827
4799
|
function $() {
|
|
4828
|
-
|
|
4800
|
+
kt(), g(Ue());
|
|
4829
4801
|
}
|
|
4830
4802
|
return window.addEventListener("color-scheme-changed", $), () => window.removeEventListener("color-scheme-changed", $);
|
|
4831
4803
|
}, []), X(() => {
|
|
4832
4804
|
if (!t || f) return;
|
|
4833
|
-
const $ =
|
|
4805
|
+
const $ = vn();
|
|
4834
4806
|
if ($) {
|
|
4835
|
-
|
|
4807
|
+
tt($), g($);
|
|
4836
4808
|
return;
|
|
4837
4809
|
}
|
|
4838
|
-
|
|
4810
|
+
g(Ue());
|
|
4839
4811
|
}, [t, f]);
|
|
4840
4812
|
const ee = R(($) => {
|
|
4841
|
-
if (window.innerWidth <
|
|
4813
|
+
if (window.innerWidth < Oe || $.target.closest("button, select, option, [role='tab'], [role='button']")) return;
|
|
4842
4814
|
$.preventDefault();
|
|
4843
|
-
const V = $.clientX, G = $.clientY, I = B.current.left, q = B.current.top,
|
|
4815
|
+
const V = $.clientX, G = $.clientY, I = B.current.left, q = B.current.top, de = N.current?.offsetWidth ?? 600;
|
|
4844
4816
|
N.current?.offsetHeight;
|
|
4845
|
-
function re(
|
|
4846
|
-
const
|
|
4847
|
-
q +
|
|
4848
|
-
I +
|
|
4849
|
-
|
|
4817
|
+
function re(me) {
|
|
4818
|
+
const we = me.clientX - V, uo = me.clientY - G, gt = bt(
|
|
4819
|
+
q + uo,
|
|
4820
|
+
I + we,
|
|
4821
|
+
de
|
|
4850
4822
|
);
|
|
4851
|
-
N.current && (N.current.style.top = `${
|
|
4823
|
+
N.current && (N.current.style.top = `${gt.top}px`, N.current.style.left = `${gt.left}px`), B.current = gt;
|
|
4852
4824
|
}
|
|
4853
4825
|
function ie() {
|
|
4854
4826
|
document.removeEventListener("mousemove", re), document.removeEventListener("mouseup", ie), Y.current = null;
|
|
4855
|
-
const
|
|
4856
|
-
h(
|
|
4827
|
+
const me = B.current;
|
|
4828
|
+
h(me), mt(me);
|
|
4857
4829
|
}
|
|
4858
4830
|
document.addEventListener("mousemove", re), document.addEventListener("mouseup", ie), Y.current = () => {
|
|
4859
4831
|
document.removeEventListener("mousemove", re), document.removeEventListener("mouseup", ie);
|
|
4860
4832
|
};
|
|
4861
|
-
}, []),
|
|
4862
|
-
if (window.innerWidth <
|
|
4833
|
+
}, []), ke = R(($) => {
|
|
4834
|
+
if (window.innerWidth < Oe) return;
|
|
4863
4835
|
$.preventDefault(), $.stopPropagation();
|
|
4864
4836
|
const H = $.clientX, V = $.clientY, G = j.current.width, I = j.current.height;
|
|
4865
4837
|
function q(re) {
|
|
4866
|
-
const ie = re.clientX - H,
|
|
4867
|
-
N.current && (N.current.style.width = `${
|
|
4838
|
+
const ie = re.clientX - H, me = re.clientY - V, we = Yt(G + ie, I + me);
|
|
4839
|
+
N.current && (N.current.style.width = `${we.width}px`, N.current.style.height = `${we.height}px`), j.current = we;
|
|
4868
4840
|
}
|
|
4869
|
-
function
|
|
4870
|
-
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup",
|
|
4841
|
+
function de() {
|
|
4842
|
+
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", de), Q.current = null;
|
|
4871
4843
|
const re = j.current;
|
|
4872
|
-
M(re),
|
|
4873
|
-
const ie =
|
|
4844
|
+
M(re), Xt(re);
|
|
4845
|
+
const ie = bt(
|
|
4874
4846
|
B.current.top,
|
|
4875
4847
|
B.current.left,
|
|
4876
4848
|
re.width,
|
|
4877
4849
|
re.height
|
|
4878
4850
|
);
|
|
4879
|
-
(ie.top !== B.current.top || ie.left !== B.current.left) && (h(ie),
|
|
4851
|
+
(ie.top !== B.current.top || ie.left !== B.current.left) && (h(ie), mt(ie));
|
|
4880
4852
|
}
|
|
4881
|
-
document.addEventListener("mousemove", q), document.addEventListener("mouseup",
|
|
4882
|
-
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup",
|
|
4853
|
+
document.addEventListener("mousemove", q), document.addEventListener("mouseup", de), Q.current = () => {
|
|
4854
|
+
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", de);
|
|
4883
4855
|
};
|
|
4884
4856
|
}, []);
|
|
4885
4857
|
X(() => () => {
|
|
4886
4858
|
Y.current?.(), Q.current?.();
|
|
4887
4859
|
}, []), X(() => {
|
|
4888
4860
|
function $() {
|
|
4889
|
-
m(window.innerWidth <
|
|
4890
|
-
const G =
|
|
4891
|
-
return (G.width !== V.width || G.height !== V.height) &&
|
|
4861
|
+
m(window.innerWidth < Oe), M((V) => {
|
|
4862
|
+
const G = Yt(V.width, V.height);
|
|
4863
|
+
return (G.width !== V.width || G.height !== V.height) && Xt(G), G;
|
|
4892
4864
|
});
|
|
4893
4865
|
const H = N.current?.offsetWidth ?? 600;
|
|
4894
4866
|
N.current?.offsetHeight, h((V) => {
|
|
4895
|
-
const G =
|
|
4896
|
-
return
|
|
4867
|
+
const G = bt(V.top, V.left, H);
|
|
4868
|
+
return mt(G), G;
|
|
4897
4869
|
});
|
|
4898
4870
|
}
|
|
4899
4871
|
return window.addEventListener("resize", $), () => window.removeEventListener("resize", $);
|
|
4900
4872
|
}, []);
|
|
4901
|
-
const
|
|
4902
|
-
|
|
4873
|
+
const Pe = R(($) => {
|
|
4874
|
+
tt($), bn($), g($);
|
|
4903
4875
|
}, []), w = R(() => {
|
|
4904
|
-
|
|
4876
|
+
Wt(), kt(), g(Ue());
|
|
4905
4877
|
}, []), z = R(() => {
|
|
4906
|
-
|
|
4878
|
+
Wt(), kt(), g(Ue());
|
|
4907
4879
|
}, []), U = Z(() => ne().tabs.map(($) => ({ id: $.id, label: $.label })), []), F = Z(() => {
|
|
4908
4880
|
const $ = {};
|
|
4909
4881
|
for (const H of ne().tabs)
|
|
@@ -4923,12 +4895,12 @@ function wi() {
|
|
|
4923
4895
|
},
|
|
4924
4896
|
[_, U]
|
|
4925
4897
|
);
|
|
4926
|
-
return /* @__PURE__ */ s(
|
|
4898
|
+
return /* @__PURE__ */ s(Za, { children: /* @__PURE__ */ s(ei, { children: t && (() => {
|
|
4927
4899
|
const {
|
|
4928
4900
|
width: $,
|
|
4929
4901
|
height: H,
|
|
4930
4902
|
narrow: V
|
|
4931
|
-
} =
|
|
4903
|
+
} = xi(
|
|
4932
4904
|
typeof window < "u" ? window.innerWidth : 1024,
|
|
4933
4905
|
typeof window < "u" ? window.innerHeight : 768,
|
|
4934
4906
|
y
|
|
@@ -4939,8 +4911,8 @@ function wi() {
|
|
|
4939
4911
|
transform: "translateX(-50%)",
|
|
4940
4912
|
right: "auto"
|
|
4941
4913
|
} : { position: "fixed", top: v.top, left: v.left };
|
|
4942
|
-
return /* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ k(ue, { children: [
|
|
4915
|
+
/* @__PURE__ */ k(
|
|
4944
4916
|
"div",
|
|
4945
4917
|
{
|
|
4946
4918
|
ref: N,
|
|
@@ -4953,10 +4925,10 @@ function wi() {
|
|
|
4953
4925
|
// `--tokenpanel-grid-min` is read by .tokenpanel-tab-grid /
|
|
4954
4926
|
// .tokenpanel-tab-advanced-grid; switching the variable rewires the
|
|
4955
4927
|
// min-card-width without re-rendering the grids.
|
|
4956
|
-
"--tokenpanel-grid-min":
|
|
4928
|
+
"--tokenpanel-grid-min": No(A)
|
|
4957
4929
|
},
|
|
4958
4930
|
children: [
|
|
4959
|
-
/* @__PURE__ */
|
|
4931
|
+
/* @__PURE__ */ k(
|
|
4960
4932
|
"div",
|
|
4961
4933
|
{
|
|
4962
4934
|
className: "tokenpanel-header",
|
|
@@ -4965,7 +4937,7 @@ function wi() {
|
|
|
4965
4937
|
children: [
|
|
4966
4938
|
/* @__PURE__ */ s("span", { className: "tokenpanel-title", children: "Design Tokens" }),
|
|
4967
4939
|
/* @__PURE__ */ s(
|
|
4968
|
-
|
|
4940
|
+
_e,
|
|
4969
4941
|
{
|
|
4970
4942
|
onClick: () => a(!0),
|
|
4971
4943
|
className: "tokenpanel-action-link",
|
|
@@ -4973,7 +4945,7 @@ function wi() {
|
|
|
4973
4945
|
}
|
|
4974
4946
|
),
|
|
4975
4947
|
/* @__PURE__ */ s(
|
|
4976
|
-
|
|
4948
|
+
_e,
|
|
4977
4949
|
{
|
|
4978
4950
|
onClick: () => i(!0),
|
|
4979
4951
|
className: "tokenpanel-action-link",
|
|
@@ -4981,14 +4953,14 @@ function wi() {
|
|
|
4981
4953
|
}
|
|
4982
4954
|
),
|
|
4983
4955
|
/* @__PURE__ */ s(
|
|
4984
|
-
|
|
4956
|
+
_e,
|
|
4985
4957
|
{
|
|
4986
4958
|
onClick: () => d(!0),
|
|
4987
4959
|
className: "tokenpanel-action-link",
|
|
4988
4960
|
children: "Apply"
|
|
4989
4961
|
}
|
|
4990
4962
|
),
|
|
4991
|
-
/* @__PURE__ */ s(
|
|
4963
|
+
/* @__PURE__ */ s(_e, { onClick: w, className: "tokenpanel-action-link", children: "Reset" }),
|
|
4992
4964
|
/* @__PURE__ */ s("div", { className: "tokenpanel-spacer" }),
|
|
4993
4965
|
/* @__PURE__ */ s(
|
|
4994
4966
|
"div",
|
|
@@ -5004,7 +4976,7 @@ function wi() {
|
|
|
5004
4976
|
onKeyDown: (I) => {
|
|
5005
4977
|
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), u((q) => !q));
|
|
5006
4978
|
},
|
|
5007
|
-
children: /* @__PURE__ */
|
|
4979
|
+
children: /* @__PURE__ */ k(
|
|
5008
4980
|
"svg",
|
|
5009
4981
|
{
|
|
5010
4982
|
width: "14",
|
|
@@ -5025,12 +4997,12 @@ function wi() {
|
|
|
5025
4997
|
}
|
|
5026
4998
|
),
|
|
5027
4999
|
/* @__PURE__ */ s(
|
|
5028
|
-
|
|
5000
|
+
_e,
|
|
5029
5001
|
{
|
|
5030
5002
|
onClick: () => n(!1),
|
|
5031
5003
|
className: "tokenpanel-close-btn",
|
|
5032
5004
|
"aria-label": "Close panel",
|
|
5033
|
-
children: /* @__PURE__ */
|
|
5005
|
+
children: /* @__PURE__ */ k(
|
|
5034
5006
|
"svg",
|
|
5035
5007
|
{
|
|
5036
5008
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5053,7 +5025,7 @@ function wi() {
|
|
|
5053
5025
|
]
|
|
5054
5026
|
}
|
|
5055
5027
|
),
|
|
5056
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-tabbar", children: [
|
|
5057
5029
|
/* @__PURE__ */ s(
|
|
5058
5030
|
"div",
|
|
5059
5031
|
{
|
|
@@ -5065,8 +5037,8 @@ function wi() {
|
|
|
5065
5037
|
return /* @__PURE__ */ s(
|
|
5066
5038
|
"div",
|
|
5067
5039
|
{
|
|
5068
|
-
ref: (
|
|
5069
|
-
S.current[I.id] =
|
|
5040
|
+
ref: (de) => {
|
|
5041
|
+
S.current[I.id] = de;
|
|
5070
5042
|
},
|
|
5071
5043
|
role: "tab",
|
|
5072
5044
|
id: `dtp-tab-${e}-${I.id}`,
|
|
@@ -5083,7 +5055,7 @@ function wi() {
|
|
|
5083
5055
|
})
|
|
5084
5056
|
}
|
|
5085
5057
|
),
|
|
5086
|
-
/* @__PURE__ */
|
|
5058
|
+
/* @__PURE__ */ k("div", { className: "tokenpanel-density", children: [
|
|
5087
5059
|
/* @__PURE__ */ s(
|
|
5088
5060
|
"label",
|
|
5089
5061
|
{
|
|
@@ -5113,8 +5085,8 @@ function wi() {
|
|
|
5113
5085
|
] })
|
|
5114
5086
|
] }),
|
|
5115
5087
|
/* @__PURE__ */ s("div", { className: "tokenpanel-body", children: U.map((I) => {
|
|
5116
|
-
const q = _ === I.id,
|
|
5117
|
-
return /* @__PURE__ */
|
|
5088
|
+
const q = _ === I.id, de = vi.includes(I.id);
|
|
5089
|
+
return /* @__PURE__ */ k(
|
|
5118
5090
|
"div",
|
|
5119
5091
|
{
|
|
5120
5092
|
role: "tabpanel",
|
|
@@ -5124,18 +5096,18 @@ function wi() {
|
|
|
5124
5096
|
hidden: !q,
|
|
5125
5097
|
children: [
|
|
5126
5098
|
I.id === "color" && f && F.color && /* @__PURE__ */ s(
|
|
5127
|
-
|
|
5099
|
+
oi,
|
|
5128
5100
|
{
|
|
5129
5101
|
tab: F.color,
|
|
5130
5102
|
state: f.color,
|
|
5131
|
-
persistColor:
|
|
5103
|
+
persistColor: ce,
|
|
5132
5104
|
secondaryTab: F["color-secondary"] ?? null,
|
|
5133
|
-
secondaryState: f.secondary ??
|
|
5134
|
-
persistSecondary:
|
|
5105
|
+
secondaryState: f.secondary ?? wn() ?? null,
|
|
5106
|
+
persistSecondary: $e
|
|
5135
5107
|
}
|
|
5136
5108
|
),
|
|
5137
5109
|
I.id === "spacing" && f && F.spacing && /* @__PURE__ */ s(
|
|
5138
|
-
|
|
5110
|
+
fi,
|
|
5139
5111
|
{
|
|
5140
5112
|
tab: F.spacing,
|
|
5141
5113
|
state: f.spacing,
|
|
@@ -5143,32 +5115,32 @@ function wi() {
|
|
|
5143
5115
|
}
|
|
5144
5116
|
),
|
|
5145
5117
|
I.id === "font" && f && F.font && /* @__PURE__ */ s(
|
|
5146
|
-
|
|
5118
|
+
ci,
|
|
5147
5119
|
{
|
|
5148
5120
|
tab: F.font,
|
|
5149
5121
|
state: f.typography,
|
|
5150
|
-
persistFont:
|
|
5122
|
+
persistFont: ve
|
|
5151
5123
|
}
|
|
5152
5124
|
),
|
|
5153
5125
|
I.id === "size" && f && F.size && /* @__PURE__ */ s(
|
|
5154
|
-
|
|
5126
|
+
ui,
|
|
5155
5127
|
{
|
|
5156
5128
|
tab: F.size,
|
|
5157
5129
|
state: f.size,
|
|
5158
|
-
persistSize:
|
|
5130
|
+
persistSize: pe
|
|
5159
5131
|
}
|
|
5160
5132
|
),
|
|
5161
|
-
!
|
|
5162
|
-
|
|
5133
|
+
!de && F[I.id] && f && /* @__PURE__ */ s(
|
|
5134
|
+
mi,
|
|
5163
5135
|
{
|
|
5164
5136
|
tab: F[I.id],
|
|
5165
5137
|
overrides: f.tabs?.[I.id] ?? {},
|
|
5166
|
-
onChange: (re, ie,
|
|
5167
|
-
T(I.id, (
|
|
5168
|
-
...
|
|
5138
|
+
onChange: (re, ie, me) => {
|
|
5139
|
+
T(I.id, (we) => ({
|
|
5140
|
+
...we,
|
|
5169
5141
|
[re]: {
|
|
5170
|
-
...
|
|
5171
|
-
[ie]:
|
|
5142
|
+
...we[re] ?? {},
|
|
5143
|
+
[ie]: me
|
|
5172
5144
|
}
|
|
5173
5145
|
}));
|
|
5174
5146
|
}
|
|
@@ -5183,7 +5155,7 @@ function wi() {
|
|
|
5183
5155
|
"div",
|
|
5184
5156
|
{
|
|
5185
5157
|
className: "tokenpanel-resize-handle",
|
|
5186
|
-
onMouseDown:
|
|
5158
|
+
onMouseDown: ke,
|
|
5187
5159
|
"aria-label": "Resize panel",
|
|
5188
5160
|
title: "Drag to resize"
|
|
5189
5161
|
}
|
|
@@ -5192,180 +5164,180 @@ function wi() {
|
|
|
5192
5164
|
}
|
|
5193
5165
|
),
|
|
5194
5166
|
o && f && /* @__PURE__ */ s(
|
|
5195
|
-
|
|
5167
|
+
Fo,
|
|
5196
5168
|
{
|
|
5197
5169
|
onClose: () => a(!1),
|
|
5198
5170
|
state: f,
|
|
5199
|
-
colorDefaults:
|
|
5171
|
+
colorDefaults: Ze()
|
|
5200
5172
|
}
|
|
5201
5173
|
),
|
|
5202
5174
|
r && f && /* @__PURE__ */ s(
|
|
5203
|
-
|
|
5175
|
+
Ko,
|
|
5204
5176
|
{
|
|
5205
5177
|
onClose: () => i(!1),
|
|
5206
|
-
onLoad:
|
|
5207
|
-
colorDefaults:
|
|
5178
|
+
onLoad: Pe,
|
|
5179
|
+
colorDefaults: Ze()
|
|
5208
5180
|
}
|
|
5209
5181
|
),
|
|
5210
5182
|
l && f && /* @__PURE__ */ s(
|
|
5211
|
-
|
|
5183
|
+
Jo,
|
|
5212
5184
|
{
|
|
5213
5185
|
state: f,
|
|
5214
5186
|
open: l,
|
|
5215
5187
|
onClose: () => d(!1),
|
|
5216
|
-
colorDefaults:
|
|
5188
|
+
colorDefaults: Ze(),
|
|
5217
5189
|
onApplied: z
|
|
5218
5190
|
}
|
|
5219
5191
|
),
|
|
5220
5192
|
c && /* @__PURE__ */ s(
|
|
5221
|
-
|
|
5193
|
+
Na,
|
|
5222
5194
|
{
|
|
5223
5195
|
anchorRef: p,
|
|
5224
5196
|
onClose: () => u(!1)
|
|
5225
5197
|
}
|
|
5226
5198
|
)
|
|
5227
5199
|
] });
|
|
5228
|
-
})() });
|
|
5200
|
+
})() }) });
|
|
5229
5201
|
}
|
|
5230
|
-
const xi = ':where(.tokenpanel-shell,[data-design-token-panel-modal],.tokenpanel-highlight-settings-popover,.tokenpanel-color-picker,.tokenpanel-tooltip){--tokentweak-color-fg: #b8b8b8;--tokentweak-color-bg: #181818;--tokentweak-color-muted: #888888;--tokentweak-color-surface: #1c1c1c;--tokentweak-color-accent: #d69a66;--tokentweak-color-accent-hover: #a7c0e3;--tokentweak-color-code-bg: #383838;--tokentweak-color-code-fg: #e0e0e0;--tokentweak-color-success: #93bb77;--tokentweak-color-danger: #da6871;--tokentweak-color-warning: #dfbb77;--tokentweak-font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--tokentweak-pad-2xs: .125rem;--tokentweak-pad-xs: .375rem;--tokentweak-pad-sm: .5rem;--tokentweak-pad-md: .75rem;--tokentweak-pad-lg: 1rem;--tokentweak-pad-xl: 1.5rem;--tokentweak-pad-2xl: 2rem;--tokentweak-gap-2xs: .4375rem;--tokentweak-gap-xs: .875rem;--tokentweak-gap-sm: 1.25rem;--tokentweak-gap-md: 1.5rem;--tokentweak-gap-lg: 1.75rem;--tokentweak-gap-xl: 2.5rem;--tokentweak-gap-2xl: 3.5rem;--tokentweak-text-micro: .75rem;--tokentweak-text-caption: .875rem;--tokentweak-text-small: 1rem;--tokentweak-text-body: 1.2rem;--tokentweak-text-subheading: 1.4rem;--tokentweak-text-heading: 3rem;--tokentweak-text-display: 3.75rem;--radius-tokentweak: .25rem}.tokenpanel-color-picker{position:fixed;width:320px;padding:var(--tokentweak-pad-md);background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);box-shadow:0 8px 24px #0006;display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs);z-index:70;color:var(--tokentweak-color-fg);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker[data-mode-shell=expanded]{width:520px;padding:var(--tokentweak-pad-lg);gap:var(--tokentweak-gap-xs)}.tokenpanel-color-picker-header{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-drag-handle{flex-shrink:0;cursor:grab;color:var(--tokentweak-color-muted);font-size:var(--tokentweak-text-caption);line-height:1;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-drag-handle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-drag-handle:active{cursor:grabbing}.tokenpanel-color-picker-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker-mode-toggle{display:flex;align-items:center;gap:2px;background:var(--tokentweak-color-bg);border:1px solid var(--tokentweak-color-muted);border-radius:999px;padding:2px;flex-shrink:0}.tokenpanel-color-picker-mode-btn{border-radius:999px;padding-inline:var(--tokentweak-pad-xs);padding-block:var(--tokentweak-pad-2xs);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .12s ease,color .12s ease;white-space:nowrap}.tokenpanel-color-picker-mode-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn[aria-pressed=true]{background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-expand-btn{flex-shrink:0;color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);transition:color .12s ease}.tokenpanel-color-picker-expand-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-expand-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-top-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-preview{position:relative;flex-shrink:0;width:3rem;height:3rem;border-radius:var(--radius-tokentweak);border:1px solid var(--tokentweak-color-muted);overflow:hidden}.tokenpanel-color-picker-preview-checkerboard{position:absolute;inset:0;background-image:repeating-conic-gradient(gray 0% 25%,silver 0% 50%);background-size:10px 10px}.tokenpanel-color-picker-preview-color{position:absolute;inset:0}.tokenpanel-color-picker-hex-input{flex:1;min-width:0;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption);background:var(--tokentweak-color-bg);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding:var(--tokentweak-pad-2xs) var(--tokentweak-pad-xs);transition:border-color .12s ease}.tokenpanel-color-picker-hex-input:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-hex-input:focus{border-color:var(--tokentweak-color-accent);outline:none}.tokenpanel-color-picker-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:2px}.tokenpanel-color-picker-grid>[role=row]{display:contents}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-grid{grid-template-columns:repeat(12,1fr)}.tokenpanel-color-picker-grid-cell{position:relative;aspect-ratio:1;border-radius:var(--radius-tokentweak);cursor:pointer;transition:box-shadow .12s ease}.tokenpanel-color-picker-grid-cell:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-color-picker-grid-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-color-picker-grid-cell:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-grid-cell[data-oog=true]:after{content:"";position:absolute;inset:1px;border:1px dashed oklch(98% 0 0 / .4);border-radius:var(--radius-tokentweak);pointer-events:none}.tokenpanel-color-picker-sliders{display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-label{flex-shrink:0;width:1.25rem;font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);-webkit-user-select:none;user-select:none}.tokenpanel-color-picker-slider{flex:1;position:relative;height:18px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-slider:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:var(--radius-tokentweak)}.tokenpanel-color-picker-slider-track{width:100%;height:18px;border-radius:9px;overflow:hidden;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-color-picker-slider-thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--tokentweak-color-fg);border:2px solid var(--tokentweak-color-bg);box-shadow:0 0 0 1px var(--tokentweak-color-muted);pointer-events:none}.tokenpanel-color-picker-slider-value{flex-shrink:0;width:3rem;text-align:right;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-readout{display:none;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);padding-top:var(--tokentweak-pad-2xs);border-top:1px solid var(--tokentweak-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-readout{display:block}.tokenpanel-shell{z-index:50;display:flex;flex-direction:column;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);border-radius:var(--radius-tokentweak);box-shadow:0 4px 24px #00000040}.tokenpanel-resize-handle{position:absolute;right:2px;bottom:2px;width:16px;height:16px;cursor:nwse-resize;-webkit-user-select:none;user-select:none;background-image:repeating-linear-gradient(-45deg,transparent 0,transparent 2px,var(--tokentweak-color-muted) 2px,var(--tokentweak-color-muted) 3px);-webkit-mask-image:linear-gradient(135deg,transparent 50%,#000 50%);mask-image:linear-gradient(135deg,transparent 50%,#000 50%);border-bottom-right-radius:var(--radius-tokentweak);transition:opacity .15s ease;opacity:.7}.tokenpanel-resize-handle:hover,.tokenpanel-resize-handle:focus-visible{opacity:1}.tokenpanel-header{display:flex;align-items:center;gap:var(--tokentweak-pad-md);padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-xs);border-bottom:1px solid var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-title{color:var(--tokentweak-color-fg);font-weight:600;font-size:.875rem;flex-shrink:0}.tokenpanel-action-link{color:var(--tokentweak-color-accent);font-size:.75rem;background:none;border:none;padding:0;cursor:pointer;transition:color .15s ease}.tokenpanel-action-link:hover{color:var(--tokentweak-color-accent-hover)}.tokenpanel-spacer{flex:1}.tokenpanel-close-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-close-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-tabbar{display:flex;align-items:center;border-bottom:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-xl);flex-shrink:0;gap:var(--tokentweak-pad-md)}.tokenpanel-tabbar-tabs{display:flex;align-items:center;gap:2px;flex:1;min-width:0}.tokenpanel-tab-button{border:none;background:none;padding-inline:var(--tokentweak-pad-md);padding-block:var(--tokentweak-gap-xs);font-size:.875rem;cursor:pointer;border-bottom:2px solid transparent;color:var(--tokentweak-color-muted);transition:color .15s ease,border-color .15s ease}.tokenpanel-tab-button:hover,.tokenpanel-tab-button:focus-visible{color:var(--tokentweak-color-fg);text-decoration:underline}.tokenpanel-tab-button.is-active{color:var(--tokentweak-color-fg);border-bottom-color:var(--tokentweak-color-accent);text-decoration:none}.tokenpanel-density{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);flex-shrink:0}.tokenpanel-density-label{color:var(--tokentweak-color-muted);font-size:.6875rem;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;cursor:pointer}.tokenpanel-density-slider{width:5rem;accent-color:var(--tokentweak-color-accent);cursor:pointer}.tokenpanel-body{flex:1;min-height:0;overflow-y:auto;padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-sm)}.tokenpanel-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:12rem;padding-block:var(--tokentweak-gap-md);padding-inline:var(--tokentweak-pad-xl)}.tokenpanel-empty-state-text{color:var(--tokentweak-color-muted, #a8a8a8);font-size:.8125rem;line-height:1.5;max-width:32rem;margin:0}.tokenpanel-empty-state-text code{font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:.8125rem;color:var(--tokentweak-color-fg)}.tokenpanel-empty-state-link{color:var(--tokentweak-color-accent);text-decoration:underline;transition:color .15s ease}.tokenpanel-empty-state-link:hover,.tokenpanel-empty-state-link:focus-visible{color:var(--tokentweak-color-accent-hover)}.tokenpanel-tab-content{display:flex;flex-direction:column;gap:var(--tokentweak-gap-sm)}.tokenpanel-tab-actions{display:flex;align-items:center;gap:var(--tokentweak-pad-md)}.tokenpanel-tab-section{position:relative;flex-shrink:0;border:1px solid var(--tokentweak-color-muted);border-radius:.5rem;padding:18px 14px 14px}.tokenpanel-tab-section-heading{position:absolute;top:-.625rem;left:12px;background:var(--tokentweak-color-surface);padding:0 8px;margin:0;color:var(--tokentweak-color-fg);font-family:inherit;font-weight:600;font-size:.8125rem;line-height:1.25rem;text-transform:none;letter-spacing:normal}.tokenpanel-tab-section-heading--color{font-size:.875rem}.tokenpanel-tab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 18rem),1fr));gap:var(--tokentweak-gap-xs)}.tokenpanel-color-preset-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:2px;font-size:.75rem;border-radius:var(--radius-tokentweak);max-width:14rem;cursor:pointer;transition:border-color .15s ease}.tokenpanel-color-preset-select:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-palette-grid,.tokenpanel-color-palette-grid--secondary{display:grid;grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr));gap:var(--tokentweak-pad-sm)}.tokenpanel-color-base-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 11rem),1fr));gap:6px}.tokenpanel-color-swatch-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:100%}.tokenpanel-color-swatch-button{display:block;border:1px solid var(--tokentweak-color-muted);cursor:pointer;width:3.5rem;height:3.5rem;border-radius:var(--radius-tokentweak);background:none;padding:0;transition:border-color .15s ease}.tokenpanel-color-swatch-button:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-swatch-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-swatch-label-row{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}.tokenpanel-color-swatch-label{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.6875rem;line-height:1.1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-tooltip{position:fixed;z-index:9999;pointer-events:none;background:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:4px;padding:4px 8px;font-family:var(--tokentweak-font-mono);font-size:11px;line-height:1.3;white-space:nowrap;box-shadow:0 4px 12px #00000080;opacity:0;transform:translateY(2px);transition:opacity 90ms ease,transform 90ms ease}.tokenpanel-tooltip[data-show=true]{opacity:1;transform:translateY(0)}.tokenpanel-popover{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:12px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-selector{position:relative;width:100%;display:flex;align-items:center;gap:6px}.tokenpanel-palette-trigger{display:flex;align-items:center;gap:4px;flex:1;min-width:0;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding-inline:6px;padding-block:4px;font-size:.75rem;border-radius:var(--radius-tokentweak);cursor:pointer;transition:border-color .15s ease}.tokenpanel-palette-trigger:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-palette-trigger:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-palette-trigger-label{flex:1;min-width:0;text-align:left;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-palette-trigger-color{flex-shrink:0;border:1px solid var(--tokentweak-color-muted);width:14px;height:14px;border-radius:2px}.tokenpanel-palette-trigger-value{flex-shrink:0;color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);width:2.5em}.tokenpanel-palette-trigger-icon{color:var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-palette-options{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:10px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-options-extras{display:flex;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-option{display:flex;align-items:center;gap:6px;padding-inline:8px;padding-block:4px;border-radius:4px;font-size:1rem;background:none;border:none;cursor:pointer;transition:background-color .15s ease}.tokenpanel-palette-extra-option:hover{background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-palette-extra-option.is-selected{background-color:rgb(from var(--tokentweak-color-accent) r g b / .2)}.tokenpanel-palette-extra-color{width:1.75rem;height:1.75rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-label{color:var(--tokentweak-color-fg)}.tokenpanel-palette-options-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.tokenpanel-palette-option-button{width:3rem;height:3rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted);cursor:pointer;padding:0;transition:box-shadow .15s ease}.tokenpanel-palette-option-button:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-palette-option-button.is-selected{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-row{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row--stacked{display:flex;flex-direction:column;gap:2px}.tokenpanel-row--column{display:flex;flex-direction:column;gap:4px}.tokenpanel-row-head{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row-label{color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);flex:1;min-width:0;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-row-input-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-row-number-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);text-align:right;font-size:.75rem;width:5rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-number-input:disabled{opacity:.6}.tokenpanel-row-number-input--invalid{border-color:#e05252;color:#e05252}.tokenpanel-row-unit{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.75rem;width:2rem}.tokenpanel-row-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;width:7rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-select:disabled{opacity:.6}.tokenpanel-row-text-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;flex:1;min-width:0;border-radius:var(--radius-tokentweak)}.tokenpanel-row-text-input:disabled{opacity:.6}.tokenpanel-pill-toggle{display:flex;align-items:center;gap:var(--tokentweak-pad-xs);flex-shrink:0;cursor:pointer}.tokenpanel-pill-toggle-checkbox{accent-color:var(--tokentweak-color-accent)}.tokenpanel-pill-toggle-text{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);font-size:.75rem}[data-design-token-panel-modal]{margin-inline:auto;width:100%;max-width:46rem;max-height:80vh;overflow-y:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);padding:var(--tokentweak-pad-xl);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-user-select:text;user-select:text}[data-design-token-panel-modal]::backdrop{background-color:rgb(from var(--tokentweak-color-bg) r g b / .8)}[data-design-token-panel-modal] [class*=__header]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--tokentweak-pad-md);margin-bottom:var(--tokentweak-gap-sm)}[data-design-token-panel-modal] [class*=__title]{font-size:var(--tokentweak-text-subheading);font-weight:700;color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__hint]{font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-muted);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__section-heading]{font-size:var(--tokentweak-text-small);font-weight:700;color:var(--tokentweak-color-fg);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__list]:not([class*=__list-item]){overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__list-item]{font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__actions]{display:flex;align-items:center;gap:var(--tokentweak-pad-md);margin-top:var(--tokentweak-gap-md)}[data-design-token-panel-modal] [class*=__toggle]{display:inline-flex;align-items:center;gap:var(--tokentweak-pad-xs);font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-fg);cursor:pointer;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__textarea]{width:100%;min-height:12rem;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-small);resize:vertical;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__json]{overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);white-space:pre;font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__status]{font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__status--info]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__status--error]{color:var(--tokentweak-color-danger)}[data-design-token-panel-modal] [class*=__status--warning]{color:var(--tokentweak-color-warning)}[data-design-token-panel-modal] [class*=__status--success]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__applying]{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-muted);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small)}[data-design-token-panel-modal] [class*=__spinner]{display:inline-block;width:1rem;height:1rem;border:2px solid var(--tokentweak-color-muted);border-top-color:var(--tokentweak-color-fg);border-radius:50%;animation:design-token-panel-modal-spin .75s linear infinite}@keyframes design-token-panel-modal-spin{to{transform:rotate(360deg)}}[data-design-token-panel-modal] [class*=__revert-hint]{font-size:var(--tokentweak-text-small);font-style:italic;color:var(--tokentweak-color-muted);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-lg);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}[data-design-token-panel-modal] [class*=__button]:hover,[data-design-token-panel-modal] [class*=__button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__button]:disabled{cursor:not-allowed;opacity:.5}[data-design-token-panel-modal] [class*=__button--primary]{border-color:var(--tokentweak-color-accent);background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__button--primary]:hover,[data-design-token-panel-modal] [class*=__button--primary]:focus-visible{border-color:var(--tokentweak-color-accent-hover);background-color:var(--tokentweak-color-accent-hover);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__close-button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease}[data-design-token-panel-modal] [class*=__close-button]:hover,[data-design-token-panel-modal] [class*=__close-button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}.tokenpanel-tier-ref-selector{flex:1;min-width:0}select.tokenpanel-tier-ref-select{width:100%;background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding-inline:var(--tokentweak-pad-sm);padding-block:4px;font-family:var(--tokentweak-font-mono);font-size:.75rem;cursor:pointer}select.tokenpanel-tier-ref-select:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-row-label-sub{display:block;font-size:var(--tokentweak-text-micro, .6875rem);color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);line-height:1.2}.tokenpanel-tab-section [role=heading]{display:block}.tokenpanel-code{font-family:var(--tokentweak-font-mono);font-size:inherit;background:none;color:inherit;padding:0;border:none;border-radius:0;white-space:pre-wrap}[data-design-token-panel-modal] [class*=__button][aria-disabled=true]{cursor:not-allowed;opacity:.5;pointer-events:none}[data-design-token-panel-modal] [role=button]:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-action-link:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-close-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-tab-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-overlay{margin:0;padding:0;border:0;background:transparent;display:block}.tokenpanel-highlight-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;color:var(--tokentweak-color-muted);cursor:pointer;vertical-align:middle;border-radius:2px;transition:background-color .15s ease,color .15s ease}.tokenpanel-highlight-toggle:hover{color:var(--tokentweak-color-fg);background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-highlight-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-toggle.is-active{opacity:1}:where(.tokenpanel-shell) svg{fill:currentColor;pointer-events:none;display:inline-block;overflow:visible}:where(.tokenpanel-shell) .tokenpanel-highlight-toggle svg{fill:none;stroke:currentColor}.tokenpanel-highlight-settings-popover{width:370px;background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:6px;box-shadow:0 8px 32px #00000080}.tokenpanel-highlight-settings-header{padding:10px 16px;border-bottom:1px solid var(--tokentweak-color-muted);font-weight:600;font-size:.8125rem;color:var(--tokentweak-color-fg);display:flex;align-items:center;justify-content:space-between;gap:12px}.tokenpanel-highlight-settings-header-label{flex:1;min-width:0}.tokenpanel-highlight-settings-outline-control{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-highlight-settings-outline-input{width:44px;background:#222;border:1px solid var(--tokentweak-color-muted);border-radius:3px;color:var(--tokentweak-color-fg);font-size:12px;font-variant-numeric:tabular-nums;padding:3px 6px;text-align:right}.tokenpanel-highlight-settings-outline-px{color:var(--tokentweak-color-muted);font-size:12px;font-weight:400}.tokenpanel-highlight-settings-list{padding:4px 0;display:grid;grid-template-columns:1fr 1fr}.tokenpanel-highlight-settings-row{display:grid;grid-template-columns:22px 32px 1fr;gap:8px;align-items:center;padding:8px 12px}.tokenpanel-highlight-settings-row:hover{background:#ffffff08}.tokenpanel-highlight-settings-num{color:var(--tokentweak-color-muted);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.tokenpanel-highlight-settings-ring{width:28px;height:28px;border-radius:3px;background:transparent;box-sizing:border-box;cursor:pointer;flex-shrink:0}.tokenpanel-highlight-settings-ring:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-highlight-settings-name{font-family:var(--tokentweak-font-mono);font-size:12px;color:var(--tokentweak-color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-highlight-settings-name.is-active{color:var(--tokentweak-color-fg)}.tokenpanel-highlight-settings-footer{padding:12px 16px;border-top:1px solid var(--tokentweak-color-muted);display:flex;justify-content:flex-end;gap:var(--tokentweak-pad-sm)}.tokenpanel-highlight-settings-reset-btn{padding:6px 12px;background:#333;border:1px solid var(--tokentweak-color-muted);border-radius:3px;cursor:pointer;font-size:12px;color:var(--tokentweak-color-fg);transition:background .15s ease}.tokenpanel-highlight-settings-reset-btn:hover{background:#404040}.tokenpanel-highlight-settings-reset-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:3px}.tokenpanel-gear-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-gear-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-gear-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}';
|
|
5231
|
-
function
|
|
5202
|
+
const Ni = ':where(.tokenpanel-shell,[data-design-token-panel-modal],.tokenpanel-highlight-settings-popover,.tokenpanel-color-picker,.tokenpanel-tooltip){--tokentweak-color-fg: #b8b8b8;--tokentweak-color-bg: #181818;--tokentweak-color-muted: #888888;--tokentweak-color-surface: #1c1c1c;--tokentweak-color-accent: #d69a66;--tokentweak-color-accent-hover: #a7c0e3;--tokentweak-color-code-bg: #383838;--tokentweak-color-code-fg: #e0e0e0;--tokentweak-color-success: #93bb77;--tokentweak-color-danger: #da6871;--tokentweak-color-warning: #dfbb77;--tokentweak-font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--tokentweak-pad-2xs: .125rem;--tokentweak-pad-xs: .375rem;--tokentweak-pad-sm: .5rem;--tokentweak-pad-md: .75rem;--tokentweak-pad-lg: 1rem;--tokentweak-pad-xl: 1.5rem;--tokentweak-pad-2xl: 2rem;--tokentweak-gap-2xs: .4375rem;--tokentweak-gap-xs: .875rem;--tokentweak-gap-sm: 1.25rem;--tokentweak-gap-md: 1.5rem;--tokentweak-gap-lg: 1.75rem;--tokentweak-gap-xl: 2.5rem;--tokentweak-gap-2xl: 3.5rem;--tokentweak-text-micro: .75rem;--tokentweak-text-caption: .875rem;--tokentweak-text-small: 1rem;--tokentweak-text-body: 1.2rem;--tokentweak-text-subheading: 1.4rem;--tokentweak-text-heading: 3rem;--tokentweak-text-display: 3.75rem;--radius-tokentweak: .25rem}.tokenpanel-color-picker{position:fixed;width:320px;padding:var(--tokentweak-pad-md);background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);box-shadow:0 8px 24px #0006;display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs);z-index:70;color:var(--tokentweak-color-fg);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker[data-mode-shell=expanded]{width:520px;padding:var(--tokentweak-pad-lg);gap:var(--tokentweak-gap-xs)}.tokenpanel-color-picker-header{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-drag-handle{flex-shrink:0;cursor:grab;color:var(--tokentweak-color-muted);font-size:var(--tokentweak-text-caption);line-height:1;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-drag-handle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-drag-handle:active{cursor:grabbing}.tokenpanel-color-picker-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker-mode-toggle{display:flex;align-items:center;gap:2px;background:var(--tokentweak-color-bg);border:1px solid var(--tokentweak-color-muted);border-radius:999px;padding:2px;flex-shrink:0}.tokenpanel-color-picker-mode-btn{border-radius:999px;padding-inline:var(--tokentweak-pad-xs);padding-block:var(--tokentweak-pad-2xs);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .12s ease,color .12s ease;white-space:nowrap}.tokenpanel-color-picker-mode-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn[aria-pressed=true]{background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-expand-btn{flex-shrink:0;color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);transition:color .12s ease}.tokenpanel-color-picker-expand-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-expand-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-top-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-preview{position:relative;flex-shrink:0;width:3rem;height:3rem;border-radius:var(--radius-tokentweak);border:1px solid var(--tokentweak-color-muted);overflow:hidden}.tokenpanel-color-picker-preview-checkerboard{position:absolute;inset:0;background-image:repeating-conic-gradient(gray 0% 25%,silver 0% 50%);background-size:10px 10px}.tokenpanel-color-picker-preview-color{position:absolute;inset:0}.tokenpanel-color-picker-hex-input{flex:1;min-width:0;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption);background:var(--tokentweak-color-bg);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding:var(--tokentweak-pad-2xs) var(--tokentweak-pad-xs);transition:border-color .12s ease}.tokenpanel-color-picker-hex-input:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-hex-input:focus{border-color:var(--tokentweak-color-accent);outline:none}.tokenpanel-color-picker-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:2px}.tokenpanel-color-picker-grid>[role=row]{display:contents}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-grid{grid-template-columns:repeat(12,1fr)}.tokenpanel-color-picker-grid-cell{position:relative;aspect-ratio:1;border-radius:var(--radius-tokentweak);cursor:pointer;transition:box-shadow .12s ease}.tokenpanel-color-picker-grid-cell:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-color-picker-grid-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-color-picker-grid-cell:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-grid-cell[data-oog=true]:after{content:"";position:absolute;inset:1px;border:1px dashed oklch(98% 0 0 / .4);border-radius:var(--radius-tokentweak);pointer-events:none}.tokenpanel-color-picker-sliders{display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-label{flex-shrink:0;width:1.25rem;font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);-webkit-user-select:none;user-select:none}.tokenpanel-color-picker-slider{flex:1;position:relative;height:18px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-slider:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:var(--radius-tokentweak)}.tokenpanel-color-picker-slider-track{width:100%;height:18px;border-radius:9px;overflow:hidden;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-color-picker-slider-thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--tokentweak-color-fg);border:2px solid var(--tokentweak-color-bg);box-shadow:0 0 0 1px var(--tokentweak-color-muted);pointer-events:none}.tokenpanel-color-picker-slider-value{flex-shrink:0;width:3rem;text-align:right;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-readout{display:none;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);padding-top:var(--tokentweak-pad-2xs);border-top:1px solid var(--tokentweak-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-readout{display:block}.tokenpanel-shell{z-index:50;display:flex;flex-direction:column;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);border-radius:var(--radius-tokentweak);box-shadow:0 4px 24px #00000040}.tokenpanel-resize-handle{position:absolute;right:2px;bottom:2px;width:16px;height:16px;cursor:nwse-resize;-webkit-user-select:none;user-select:none;background-image:repeating-linear-gradient(-45deg,transparent 0,transparent 2px,var(--tokentweak-color-muted) 2px,var(--tokentweak-color-muted) 3px);-webkit-mask-image:linear-gradient(135deg,transparent 50%,#000 50%);mask-image:linear-gradient(135deg,transparent 50%,#000 50%);border-bottom-right-radius:var(--radius-tokentweak);transition:opacity .15s ease;opacity:.7}.tokenpanel-resize-handle:hover,.tokenpanel-resize-handle:focus-visible{opacity:1}.tokenpanel-header{display:flex;align-items:center;gap:var(--tokentweak-pad-md);padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-xs);border-bottom:1px solid var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-title{color:var(--tokentweak-color-fg);font-weight:600;font-size:.875rem;flex-shrink:0}.tokenpanel-action-link{color:var(--tokentweak-color-accent);font-size:.75rem;background:none;border:none;padding:0;cursor:pointer;transition:color .15s ease}.tokenpanel-action-link:hover{color:var(--tokentweak-color-accent-hover)}.tokenpanel-spacer{flex:1}.tokenpanel-close-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-close-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-tabbar{display:flex;align-items:center;border-bottom:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-xl);flex-shrink:0;gap:var(--tokentweak-pad-md)}.tokenpanel-tabbar-tabs{display:flex;align-items:center;gap:2px;flex:1;min-width:0}.tokenpanel-tab-button{border:none;background:none;padding-inline:var(--tokentweak-pad-md);padding-block:var(--tokentweak-gap-xs);font-size:.875rem;cursor:pointer;border-bottom:2px solid transparent;color:var(--tokentweak-color-muted);transition:color .15s ease,border-color .15s ease}.tokenpanel-tab-button:hover,.tokenpanel-tab-button:focus-visible{color:var(--tokentweak-color-fg);text-decoration:underline}.tokenpanel-tab-button.is-active{color:var(--tokentweak-color-fg);border-bottom-color:var(--tokentweak-color-accent);text-decoration:none}.tokenpanel-density{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);flex-shrink:0}.tokenpanel-density-label{color:var(--tokentweak-color-muted);font-size:.6875rem;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;cursor:pointer}.tokenpanel-density-slider{width:5rem;accent-color:var(--tokentweak-color-accent);cursor:pointer}.tokenpanel-body{flex:1;min-height:0;overflow-y:auto;padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-sm)}.tokenpanel-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:12rem;padding-block:var(--tokentweak-gap-md);padding-inline:var(--tokentweak-pad-xl)}.tokenpanel-empty-state-text{color:var(--tokentweak-color-muted, #a8a8a8);font-size:.8125rem;line-height:1.5;max-width:32rem;margin:0}.tokenpanel-empty-state-text code{font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:.8125rem;color:var(--tokentweak-color-fg)}.tokenpanel-empty-state-link{color:var(--tokentweak-color-accent);text-decoration:underline;transition:color .15s ease}.tokenpanel-empty-state-link:hover,.tokenpanel-empty-state-link:focus-visible{color:var(--tokentweak-color-accent-hover)}.tokenpanel-tab-content{display:flex;flex-direction:column;gap:var(--tokentweak-gap-sm)}.tokenpanel-tab-actions{display:flex;align-items:center;gap:var(--tokentweak-pad-md)}.tokenpanel-tab-section{position:relative;flex-shrink:0;border:1px solid var(--tokentweak-color-muted);border-radius:.5rem;padding:18px 14px 14px}.tokenpanel-tab-section-heading{position:absolute;top:-.625rem;left:12px;background:var(--tokentweak-color-surface);padding:0 8px;margin:0;color:var(--tokentweak-color-fg);font-family:inherit;font-weight:600;font-size:.8125rem;line-height:1.25rem;text-transform:none;letter-spacing:normal}.tokenpanel-tab-section-heading--color{font-size:.875rem}.tokenpanel-tab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 18rem),1fr));gap:var(--tokentweak-gap-xs)}.tokenpanel-color-preset-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:2px;font-size:.75rem;border-radius:var(--radius-tokentweak);max-width:14rem;cursor:pointer;transition:border-color .15s ease}.tokenpanel-color-preset-select:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-palette-grid,.tokenpanel-color-palette-grid--secondary{display:grid;grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr));gap:var(--tokentweak-pad-sm)}.tokenpanel-color-base-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 11rem),1fr));gap:6px}.tokenpanel-color-swatch-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:100%}.tokenpanel-color-swatch-button{display:block;border:1px solid var(--tokentweak-color-muted);cursor:pointer;width:3.5rem;height:3.5rem;border-radius:var(--radius-tokentweak);background:none;padding:0;transition:border-color .15s ease}.tokenpanel-color-swatch-button:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-swatch-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-swatch-label-row{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}.tokenpanel-color-swatch-label{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.6875rem;line-height:1.1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-tooltip{position:fixed;z-index:9999;pointer-events:none;background:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:4px;padding:4px 8px;font-family:var(--tokentweak-font-mono);font-size:11px;line-height:1.3;white-space:nowrap;box-shadow:0 4px 12px #00000080;opacity:0;transform:translateY(2px);transition:opacity 90ms ease,transform 90ms ease}.tokenpanel-tooltip[data-show=true]{opacity:1;transform:translateY(0)}.tokenpanel-popover{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:12px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-selector{position:relative;width:100%;display:flex;align-items:center;gap:6px}.tokenpanel-palette-trigger{display:flex;align-items:center;gap:4px;flex:1;min-width:0;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding-inline:6px;padding-block:4px;font-size:.75rem;border-radius:var(--radius-tokentweak);cursor:pointer;transition:border-color .15s ease}.tokenpanel-palette-trigger:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-palette-trigger:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-palette-trigger-label{flex:1;min-width:0;text-align:left;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-palette-trigger-color{flex-shrink:0;border:1px solid var(--tokentweak-color-muted);width:14px;height:14px;border-radius:2px}.tokenpanel-palette-trigger-value{flex-shrink:0;color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);width:2.5em}.tokenpanel-palette-trigger-icon{color:var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-palette-options{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:10px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-options-extras{display:flex;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-option{display:flex;align-items:center;gap:6px;padding-inline:8px;padding-block:4px;border-radius:4px;font-size:1rem;background:none;border:none;cursor:pointer;transition:background-color .15s ease}.tokenpanel-palette-extra-option:hover{background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-palette-extra-option.is-selected{background-color:rgb(from var(--tokentweak-color-accent) r g b / .2)}.tokenpanel-palette-extra-color{width:1.75rem;height:1.75rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-label{color:var(--tokentweak-color-fg)}.tokenpanel-palette-options-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.tokenpanel-palette-option-button{width:3rem;height:3rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted);cursor:pointer;padding:0;transition:box-shadow .15s ease}.tokenpanel-palette-option-button:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-palette-option-button.is-selected{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-row{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row--stacked{display:flex;flex-direction:column;gap:2px}.tokenpanel-row--column{display:flex;flex-direction:column;gap:4px}.tokenpanel-row-head{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row-label{color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);flex:1;min-width:0;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-row-input-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-row-number-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);text-align:right;font-size:.75rem;width:5rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-number-input:disabled{opacity:.6}.tokenpanel-row-number-input--invalid{border-color:#e05252;color:#e05252}.tokenpanel-row-unit{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.75rem;width:2rem}.tokenpanel-row-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;width:7rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-select:disabled{opacity:.6}.tokenpanel-row-text-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;flex:1;min-width:0;border-radius:var(--radius-tokentweak)}.tokenpanel-row-text-input:disabled{opacity:.6}.tokenpanel-pill-toggle{display:flex;align-items:center;gap:var(--tokentweak-pad-xs);flex-shrink:0;cursor:pointer}.tokenpanel-pill-toggle-checkbox{accent-color:var(--tokentweak-color-accent)}.tokenpanel-pill-toggle-text{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);font-size:.75rem}[data-design-token-panel-modal]{margin-inline:auto;width:100%;max-width:46rem;max-height:80vh;overflow-y:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);padding:var(--tokentweak-pad-xl);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-user-select:text;user-select:text}[data-design-token-panel-modal]::backdrop{background-color:rgb(from var(--tokentweak-color-bg) r g b / .8)}[data-design-token-panel-modal] [class*=__header]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--tokentweak-pad-md);margin-bottom:var(--tokentweak-gap-sm)}[data-design-token-panel-modal] [class*=__title]{font-size:var(--tokentweak-text-subheading);font-weight:700;color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__hint]{font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-muted);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__section-heading]{font-size:var(--tokentweak-text-small);font-weight:700;color:var(--tokentweak-color-fg);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__list]:not([class*=__list-item]){overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__list-item]{font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__actions]{display:flex;align-items:center;gap:var(--tokentweak-pad-md);margin-top:var(--tokentweak-gap-md)}[data-design-token-panel-modal] [class*=__toggle]{display:inline-flex;align-items:center;gap:var(--tokentweak-pad-xs);font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-fg);cursor:pointer;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__textarea]{width:100%;min-height:12rem;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-small);resize:vertical;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__json]{overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);white-space:pre;font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__status]{font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__status--info]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__status--error]{color:var(--tokentweak-color-danger)}[data-design-token-panel-modal] [class*=__status--warning]{color:var(--tokentweak-color-warning)}[data-design-token-panel-modal] [class*=__status--success]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__applying]{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-muted);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small)}[data-design-token-panel-modal] [class*=__spinner]{display:inline-block;width:1rem;height:1rem;border:2px solid var(--tokentweak-color-muted);border-top-color:var(--tokentweak-color-fg);border-radius:50%;animation:design-token-panel-modal-spin .75s linear infinite}@keyframes design-token-panel-modal-spin{to{transform:rotate(360deg)}}[data-design-token-panel-modal] [class*=__revert-hint]{font-size:var(--tokentweak-text-small);font-style:italic;color:var(--tokentweak-color-muted);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-lg);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}[data-design-token-panel-modal] [class*=__button]:hover,[data-design-token-panel-modal] [class*=__button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__button]:disabled{cursor:not-allowed;opacity:.5}[data-design-token-panel-modal] [class*=__button--primary]{border-color:var(--tokentweak-color-accent);background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__button--primary]:hover,[data-design-token-panel-modal] [class*=__button--primary]:focus-visible{border-color:var(--tokentweak-color-accent-hover);background-color:var(--tokentweak-color-accent-hover);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__close-button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease}[data-design-token-panel-modal] [class*=__close-button]:hover,[data-design-token-panel-modal] [class*=__close-button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}.tokenpanel-tier-ref-selector{flex:1;min-width:0}select.tokenpanel-tier-ref-select{width:100%;background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding-inline:var(--tokentweak-pad-sm);padding-block:4px;font-family:var(--tokentweak-font-mono);font-size:.75rem;cursor:pointer}select.tokenpanel-tier-ref-select:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-row-label-sub{display:block;font-size:var(--tokentweak-text-micro, .6875rem);color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);line-height:1.2}.tokenpanel-tab-section [role=heading]{display:block}.tokenpanel-code{font-family:var(--tokentweak-font-mono);font-size:inherit;background:none;color:inherit;padding:0;border:none;border-radius:0;white-space:pre-wrap}[data-design-token-panel-modal] [class*=__button][aria-disabled=true]{cursor:not-allowed;opacity:.5;pointer-events:none}[data-design-token-panel-modal] [role=button]:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-action-link:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-close-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-tab-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-overlay{margin:0;padding:0;border:0;background:transparent;display:block}.tokenpanel-highlight-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;color:var(--tokentweak-color-muted);cursor:pointer;vertical-align:middle;border-radius:2px;transition:background-color .15s ease,color .15s ease}.tokenpanel-highlight-toggle:hover{color:var(--tokentweak-color-fg);background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-highlight-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-toggle.is-active{opacity:1}:where(.tokenpanel-shell) svg{fill:currentColor;pointer-events:none;display:inline-block;overflow:visible}:where(.tokenpanel-shell) .tokenpanel-highlight-toggle svg{fill:none;stroke:currentColor}.tokenpanel-highlight-settings-popover{width:370px;background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:6px;box-shadow:0 8px 32px #00000080}.tokenpanel-highlight-settings-header{padding:10px 16px;border-bottom:1px solid var(--tokentweak-color-muted);font-weight:600;font-size:.8125rem;color:var(--tokentweak-color-fg);display:flex;align-items:center;justify-content:space-between;gap:12px}.tokenpanel-highlight-settings-header-label{flex:1;min-width:0}.tokenpanel-highlight-settings-outline-control{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-highlight-settings-outline-input{width:44px;background:#222;border:1px solid var(--tokentweak-color-muted);border-radius:3px;color:var(--tokentweak-color-fg);font-size:12px;font-variant-numeric:tabular-nums;padding:3px 6px;text-align:right}.tokenpanel-highlight-settings-outline-px{color:var(--tokentweak-color-muted);font-size:12px;font-weight:400}.tokenpanel-highlight-settings-list{padding:4px 0;display:grid;grid-template-columns:1fr 1fr}.tokenpanel-highlight-settings-row{display:grid;grid-template-columns:22px 32px 1fr;gap:8px;align-items:center;padding:8px 12px}.tokenpanel-highlight-settings-row:hover{background:#ffffff08}.tokenpanel-highlight-settings-num{color:var(--tokentweak-color-muted);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.tokenpanel-highlight-settings-ring{width:28px;height:28px;border-radius:3px;background:transparent;box-sizing:border-box;cursor:pointer;flex-shrink:0}.tokenpanel-highlight-settings-ring:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-highlight-settings-name{font-family:var(--tokentweak-font-mono);font-size:12px;color:var(--tokentweak-color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-highlight-settings-name.is-active{color:var(--tokentweak-color-fg)}.tokenpanel-highlight-settings-footer{padding:12px 16px;border-top:1px solid var(--tokentweak-color-muted);display:flex;justify-content:flex-end;gap:var(--tokentweak-pad-sm)}.tokenpanel-highlight-settings-reset-btn{padding:6px 12px;background:#333;border:1px solid var(--tokentweak-color-muted);border-radius:3px;cursor:pointer;font-size:12px;color:var(--tokentweak-color-fg);transition:background .15s ease}.tokenpanel-highlight-settings-reset-btn:hover{background:#404040}.tokenpanel-highlight-settings-reset-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:3px}.tokenpanel-gear-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-gear-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-gear-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}';
|
|
5203
|
+
function Bi(e) {
|
|
5232
5204
|
return e.kind === "length";
|
|
5233
5205
|
}
|
|
5234
|
-
function
|
|
5206
|
+
function Fi(e) {
|
|
5235
5207
|
return e.kind === "number";
|
|
5236
5208
|
}
|
|
5237
|
-
function
|
|
5209
|
+
function Ki(e) {
|
|
5238
5210
|
return e.kind === "select";
|
|
5239
5211
|
}
|
|
5240
|
-
function
|
|
5212
|
+
function ji(e) {
|
|
5241
5213
|
return e.kind === "text";
|
|
5242
5214
|
}
|
|
5243
|
-
function
|
|
5215
|
+
function Wi(e) {
|
|
5244
5216
|
return e.kind === "cursor";
|
|
5245
5217
|
}
|
|
5246
|
-
function
|
|
5218
|
+
function Xi(e) {
|
|
5247
5219
|
return e.kind === "content";
|
|
5248
5220
|
}
|
|
5249
|
-
function
|
|
5221
|
+
function Yi(e) {
|
|
5250
5222
|
return e.kind === "mask-image";
|
|
5251
5223
|
}
|
|
5252
|
-
function
|
|
5224
|
+
function qi(e) {
|
|
5253
5225
|
return e.kind === "color";
|
|
5254
5226
|
}
|
|
5255
|
-
function to() {
|
|
5256
|
-
return To(ne());
|
|
5257
|
-
}
|
|
5258
5227
|
function no() {
|
|
5259
|
-
return
|
|
5228
|
+
return Ao(ne());
|
|
5229
|
+
}
|
|
5230
|
+
function oo() {
|
|
5231
|
+
return xn(ne());
|
|
5260
5232
|
}
|
|
5261
|
-
const
|
|
5262
|
-
function
|
|
5263
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
5233
|
+
const _i = "toggle-design-token-panel", Ci = "toggle-color-tweak-panel", ro = "__zdtp:open-state-changed";
|
|
5234
|
+
function ut() {
|
|
5235
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(ro));
|
|
5264
5236
|
}
|
|
5265
|
-
const
|
|
5266
|
-
function
|
|
5237
|
+
const Gi = ro;
|
|
5238
|
+
function pt(e) {
|
|
5267
5239
|
if (!(typeof window > "u"))
|
|
5268
5240
|
try {
|
|
5269
|
-
window.localStorage.setItem(
|
|
5241
|
+
window.localStorage.setItem(oo(), e ? "1" : "0");
|
|
5270
5242
|
} catch {
|
|
5271
5243
|
}
|
|
5272
5244
|
}
|
|
5273
|
-
function
|
|
5245
|
+
function ao() {
|
|
5274
5246
|
if (typeof window > "u") return !1;
|
|
5275
5247
|
try {
|
|
5276
|
-
return window.localStorage.getItem(
|
|
5248
|
+
return window.localStorage.getItem(oo()) === "1";
|
|
5277
5249
|
} catch {
|
|
5278
5250
|
return !1;
|
|
5279
5251
|
}
|
|
5280
5252
|
}
|
|
5281
|
-
function
|
|
5253
|
+
function $i() {
|
|
5282
5254
|
if (typeof window > "u") return !1;
|
|
5283
5255
|
try {
|
|
5284
5256
|
const e = window.localStorage;
|
|
5285
|
-
return e.getItem(
|
|
5257
|
+
return e.getItem(_o()) !== null || e.getItem(Co()) !== null;
|
|
5286
5258
|
} catch {
|
|
5287
5259
|
return !1;
|
|
5288
5260
|
}
|
|
5289
5261
|
}
|
|
5290
|
-
function
|
|
5262
|
+
function io() {
|
|
5291
5263
|
if (typeof window > "u") return !1;
|
|
5292
5264
|
try {
|
|
5293
|
-
return window.localStorage.getItem(
|
|
5265
|
+
return window.localStorage.getItem(De()) === "1";
|
|
5294
5266
|
} catch {
|
|
5295
5267
|
return !1;
|
|
5296
5268
|
}
|
|
5297
5269
|
}
|
|
5298
|
-
function
|
|
5270
|
+
function ft(e) {
|
|
5299
5271
|
if (!(typeof window > "u"))
|
|
5300
5272
|
try {
|
|
5301
|
-
const t =
|
|
5273
|
+
const t = De();
|
|
5302
5274
|
e ? window.localStorage.setItem(t, "1") : window.localStorage.removeItem(t);
|
|
5303
5275
|
} catch {
|
|
5304
5276
|
}
|
|
5305
5277
|
}
|
|
5306
|
-
function
|
|
5307
|
-
return typeof document > "u" ? null : document.getElementById(
|
|
5278
|
+
function We() {
|
|
5279
|
+
return typeof document > "u" ? null : document.getElementById(no());
|
|
5308
5280
|
}
|
|
5309
|
-
const
|
|
5310
|
-
function
|
|
5311
|
-
if (typeof document > "u" || document.getElementById(
|
|
5281
|
+
const pn = "zudo-design-token-panel-styles";
|
|
5282
|
+
function Ei() {
|
|
5283
|
+
if (typeof document > "u" || document.getElementById(pn)) return;
|
|
5312
5284
|
const e = document.createElement("style");
|
|
5313
|
-
e.id =
|
|
5285
|
+
e.id = pn, e.textContent = Ni, document.head.appendChild(e);
|
|
5314
5286
|
}
|
|
5315
|
-
function
|
|
5287
|
+
function ht() {
|
|
5316
5288
|
if (typeof document > "u") return !1;
|
|
5317
|
-
const e =
|
|
5289
|
+
const e = no();
|
|
5318
5290
|
if (document.getElementById(e)) return !1;
|
|
5319
|
-
|
|
5291
|
+
Ei();
|
|
5320
5292
|
const t = document.createElement("div");
|
|
5321
|
-
return t.id = e, document.body.appendChild(t),
|
|
5293
|
+
return t.id = e, document.body.appendChild(t), gn(/* @__PURE__ */ s(yi, {}), t), !0;
|
|
5322
5294
|
}
|
|
5323
|
-
function
|
|
5295
|
+
function Ji() {
|
|
5324
5296
|
return ne();
|
|
5325
5297
|
}
|
|
5326
|
-
function
|
|
5298
|
+
function Si() {
|
|
5327
5299
|
if (typeof window > "u") return;
|
|
5328
|
-
const e = !
|
|
5329
|
-
|
|
5300
|
+
const e = !We();
|
|
5301
|
+
ft(!0), ht(), pt(!0), !e && ut();
|
|
5330
5302
|
}
|
|
5331
|
-
function
|
|
5303
|
+
function Mi() {
|
|
5332
5304
|
if (typeof window > "u") return;
|
|
5333
|
-
const e = !
|
|
5334
|
-
|
|
5305
|
+
const e = !We();
|
|
5306
|
+
ft(!1), ht(), pt(!1), !e && ut();
|
|
5335
5307
|
}
|
|
5336
|
-
function
|
|
5308
|
+
function Ui() {
|
|
5337
5309
|
if (typeof window > "u") return;
|
|
5338
|
-
const e = !
|
|
5339
|
-
|
|
5310
|
+
const e = !io(), t = !We();
|
|
5311
|
+
ft(e), ht(), pt(e), !t && ut();
|
|
5340
5312
|
}
|
|
5341
|
-
function
|
|
5313
|
+
function lo() {
|
|
5342
5314
|
if (!(typeof window > "u"))
|
|
5343
5315
|
try {
|
|
5344
|
-
const e =
|
|
5345
|
-
e &&
|
|
5316
|
+
const e = vn();
|
|
5317
|
+
e && tt(e);
|
|
5346
5318
|
} catch {
|
|
5347
5319
|
}
|
|
5348
5320
|
}
|
|
5349
|
-
function
|
|
5350
|
-
const e =
|
|
5321
|
+
function Be() {
|
|
5322
|
+
const e = We();
|
|
5351
5323
|
if (!e) return;
|
|
5352
|
-
const t =
|
|
5353
|
-
|
|
5324
|
+
const t = ao();
|
|
5325
|
+
gn(null, e), e.remove(), t && pt(!0);
|
|
5354
5326
|
}
|
|
5355
|
-
function
|
|
5356
|
-
|
|
5327
|
+
function Te() {
|
|
5328
|
+
lo(), ao() ? Si() : $i() && Mi();
|
|
5357
5329
|
}
|
|
5358
|
-
function
|
|
5359
|
-
const e = !
|
|
5360
|
-
|
|
5330
|
+
function fn() {
|
|
5331
|
+
const e = !We(), t = e ? !0 : !io();
|
|
5332
|
+
ft(t), ht(), !e && ut();
|
|
5361
5333
|
}
|
|
5362
|
-
function
|
|
5334
|
+
function so() {
|
|
5363
5335
|
const e = window;
|
|
5364
5336
|
if (e.__zudoDesignTokenPanelLifecycle) return e.__zudoDesignTokenPanelLifecycle;
|
|
5365
5337
|
const t = { bound: !1, cleanups: [], adapter: null };
|
|
5366
5338
|
return e.__zudoDesignTokenPanelLifecycle = t, t;
|
|
5367
5339
|
}
|
|
5368
|
-
function
|
|
5340
|
+
function Ti(e) {
|
|
5369
5341
|
const t = e.cleanups;
|
|
5370
5342
|
e.cleanups = [];
|
|
5371
5343
|
for (const n of t)
|
|
@@ -5374,17 +5346,17 @@ function Si(e) {
|
|
|
5374
5346
|
} catch {
|
|
5375
5347
|
}
|
|
5376
5348
|
}
|
|
5377
|
-
function
|
|
5378
|
-
typeof document > "u" || (document.addEventListener("astro:before-swap",
|
|
5379
|
-
() => document.removeEventListener("astro:before-swap",
|
|
5380
|
-
() => document.removeEventListener("astro:page-load",
|
|
5349
|
+
function co(e) {
|
|
5350
|
+
typeof document > "u" || (document.addEventListener("astro:before-swap", Be), document.addEventListener("astro:page-load", Te), e.cleanups.push(
|
|
5351
|
+
() => document.removeEventListener("astro:before-swap", Be),
|
|
5352
|
+
() => document.removeEventListener("astro:page-load", Te)
|
|
5381
5353
|
));
|
|
5382
5354
|
}
|
|
5383
|
-
function
|
|
5384
|
-
if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(
|
|
5385
|
-
() => document.removeEventListener("astro:before-swap",
|
|
5386
|
-
)), t.onPageLoad ? e.cleanups.push(t.onPageLoad(
|
|
5387
|
-
() => document.removeEventListener("astro:page-load",
|
|
5355
|
+
function Ai(e, t) {
|
|
5356
|
+
if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(Be)) : (document.addEventListener("astro:before-swap", Be), e.cleanups.push(
|
|
5357
|
+
() => document.removeEventListener("astro:before-swap", Be)
|
|
5358
|
+
)), t.onPageLoad ? e.cleanups.push(t.onPageLoad(Te)) : (document.addEventListener("astro:page-load", Te), e.cleanups.push(
|
|
5359
|
+
() => document.removeEventListener("astro:page-load", Te)
|
|
5388
5360
|
)), !t.onBeforeSwap || !t.onPageLoad)) {
|
|
5389
5361
|
const n = [
|
|
5390
5362
|
t.onBeforeSwap ? null : "onBeforeSwap",
|
|
@@ -5395,36 +5367,36 @@ function Mi(e, t) {
|
|
|
5395
5367
|
);
|
|
5396
5368
|
}
|
|
5397
5369
|
}
|
|
5398
|
-
function
|
|
5370
|
+
function Zi(e) {
|
|
5399
5371
|
if (typeof window > "u") return;
|
|
5400
|
-
const t =
|
|
5401
|
-
|
|
5372
|
+
const t = so();
|
|
5373
|
+
Ti(t), t.adapter = e, e ? Ai(t, e) : co(t);
|
|
5402
5374
|
}
|
|
5403
|
-
const
|
|
5404
|
-
|
|
5375
|
+
const Li = () => {
|
|
5376
|
+
lo(), Te();
|
|
5405
5377
|
};
|
|
5406
5378
|
if (typeof window < "u") {
|
|
5407
|
-
const e =
|
|
5408
|
-
e.bound || (e.bound = !0, window.addEventListener(
|
|
5379
|
+
const e = so();
|
|
5380
|
+
e.bound || (e.bound = !0, window.addEventListener(_i, fn), window.addEventListener(Ci, fn), co(e), To(Li));
|
|
5409
5381
|
}
|
|
5410
5382
|
export {
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5383
|
+
tl as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
|
|
5384
|
+
Gi as __OPEN_STATE_CHANGED_EVENT_FOR_TEST,
|
|
5385
|
+
Ji as __panelConfigForTest,
|
|
5386
|
+
ol as configurePanel,
|
|
5387
|
+
vt as emptyOverrides,
|
|
5388
|
+
Mi as hideDesignTokenPanel,
|
|
5389
|
+
qi as isColorKind,
|
|
5390
|
+
Xi as isContentKind,
|
|
5391
|
+
Wi as isCursorKind,
|
|
5392
|
+
Bi as isLengthKind,
|
|
5393
|
+
Yi as isMaskImageKind,
|
|
5394
|
+
Fi as isNumberKind,
|
|
5395
|
+
Ki as isSelectKind,
|
|
5396
|
+
ji as isTextKind,
|
|
5397
|
+
lo as reapplyPersistedOverrides,
|
|
5398
|
+
Zi as setLifecycleAdapter,
|
|
5399
|
+
rl as setPanelColorPresets,
|
|
5400
|
+
Si as showDesignTokenPanel,
|
|
5401
|
+
Ui as toggleDesignPanel
|
|
5430
5402
|
};
|