lucent-ui 0.27.2 → 0.28.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/dist/LucentProvider-Du0kOaZK.js +2949 -0
- package/dist/LucentProvider-mTd2rJ1f.cjs +109 -0
- package/dist/devtools.cjs +8 -0
- package/dist/devtools.d.ts +36 -0
- package/dist/devtools.js +1192 -0
- package/dist/index.cjs +39 -147
- package/dist/index.d.ts +118 -3
- package/dist/index.js +2735 -5472
- package/package.json +7 -2
package/dist/devtools.js
ADDED
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as de, useCallback as D, useEffect as K, useMemo as fe, createContext as ye } from "react";
|
|
3
|
+
import { createPortal as ue } from "react-dom";
|
|
4
|
+
import { _ as le, $ as S, T as h, C as P, B, e as $, I as re, a0 as he, a1 as pe, z as me, K as ge, M as be, m as ve, F as xe, u as Se, Y as ke, x as we, g as Ce, a2 as ze, a as z, a3 as Be, a4 as X, S as Te, d as q, p as Me, h as Fe, f as Re, b as De } from "./LucentProvider-Du0kOaZK.js";
|
|
5
|
+
function Oe() {
|
|
6
|
+
const { tokens: e } = le(), [n, o] = C({}), s = de(n);
|
|
7
|
+
s.current = n;
|
|
8
|
+
const i = D((f, d) => {
|
|
9
|
+
document.documentElement.style.setProperty(S(f), d), o((b) => ({ ...b, [f]: d }));
|
|
10
|
+
}, []), r = D((f) => {
|
|
11
|
+
document.documentElement.style.removeProperty(S(f)), o((d) => {
|
|
12
|
+
const b = { ...d };
|
|
13
|
+
return delete b[f], b;
|
|
14
|
+
});
|
|
15
|
+
}, []), u = D(() => {
|
|
16
|
+
for (const f of Object.keys(s.current))
|
|
17
|
+
document.documentElement.style.removeProperty(S(f));
|
|
18
|
+
o({});
|
|
19
|
+
}, []);
|
|
20
|
+
return {
|
|
21
|
+
tokens: e,
|
|
22
|
+
overrides: n,
|
|
23
|
+
overrideCount: Object.keys(n).length,
|
|
24
|
+
setOverride: i,
|
|
25
|
+
removeOverride: r,
|
|
26
|
+
resetAll: u
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function y(e) {
|
|
30
|
+
return { key: e, controlType: "color" };
|
|
31
|
+
}
|
|
32
|
+
function g(e, n, o, s, i) {
|
|
33
|
+
return { key: e, controlType: "slider", sliderConfig: { min: n, max: o, step: s, unit: i } };
|
|
34
|
+
}
|
|
35
|
+
function m(e) {
|
|
36
|
+
return { key: e, controlType: "text" };
|
|
37
|
+
}
|
|
38
|
+
const V = [
|
|
39
|
+
{
|
|
40
|
+
label: "Colors",
|
|
41
|
+
defaultExpanded: !0,
|
|
42
|
+
subgroups: [
|
|
43
|
+
{
|
|
44
|
+
label: "Background",
|
|
45
|
+
tokens: [y("bgBase"), y("bgSubtle"), y("bgOverlay")]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "Surface",
|
|
49
|
+
tokens: [
|
|
50
|
+
y("surface"),
|
|
51
|
+
y("surfaceSecondary"),
|
|
52
|
+
y("surfaceRaised"),
|
|
53
|
+
y("surfaceOverlay"),
|
|
54
|
+
y("surfaceTint")
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Border",
|
|
59
|
+
tokens: [y("borderDefault"), y("borderSubtle"), y("borderStrong"), y("controlTrack")]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "Text",
|
|
63
|
+
tokens: [y("textPrimary"), y("textSecondary"), y("textDisabled"), y("textInverse")]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "Accent",
|
|
67
|
+
tokens: [y("accentDefault"), y("accentHover"), y("accentSubtle"), y("accentBorder"), y("accentFg")]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "Success",
|
|
71
|
+
tokens: [y("successDefault"), y("successSubtle"), y("successText")]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "Warning",
|
|
75
|
+
tokens: [y("warningDefault"), y("warningSubtle"), y("warningText")]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "Danger",
|
|
79
|
+
tokens: [y("dangerDefault"), y("dangerHover"), y("dangerSubtle"), y("dangerText")]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "Info",
|
|
83
|
+
tokens: [y("infoDefault"), y("infoSubtle"), y("infoText")]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: "Typography",
|
|
89
|
+
tokens: [
|
|
90
|
+
m("fontFamilyBase"),
|
|
91
|
+
m("fontFamilyMono"),
|
|
92
|
+
m("fontFamilyDisplay"),
|
|
93
|
+
g("fontSizeXs", 0.5, 2, 0.0625, "rem"),
|
|
94
|
+
g("fontSizeSm", 0.5, 2, 0.0625, "rem"),
|
|
95
|
+
g("fontSizeMd", 0.5, 2, 0.0625, "rem"),
|
|
96
|
+
g("fontSizeLg", 0.5, 3, 0.0625, "rem"),
|
|
97
|
+
g("fontSizeXl", 0.5, 3, 0.0625, "rem"),
|
|
98
|
+
g("fontSize2xl", 0.5, 4, 0.0625, "rem"),
|
|
99
|
+
g("fontSize3xl", 0.5, 4, 0.0625, "rem"),
|
|
100
|
+
m("fontWeightRegular"),
|
|
101
|
+
m("fontWeightMedium"),
|
|
102
|
+
m("fontWeightSemibold"),
|
|
103
|
+
m("fontWeightBold"),
|
|
104
|
+
m("lineHeightTight"),
|
|
105
|
+
m("lineHeightBase"),
|
|
106
|
+
m("lineHeightRelaxed"),
|
|
107
|
+
m("letterSpacingTight"),
|
|
108
|
+
m("letterSpacingBase"),
|
|
109
|
+
m("letterSpacingWide")
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: "Spacing",
|
|
114
|
+
tokens: [
|
|
115
|
+
g("space0", 0, 6, 0.125, "rem"),
|
|
116
|
+
g("space1", 0, 6, 0.125, "rem"),
|
|
117
|
+
g("space2", 0, 6, 0.125, "rem"),
|
|
118
|
+
g("space3", 0, 6, 0.125, "rem"),
|
|
119
|
+
g("space4", 0, 6, 0.125, "rem"),
|
|
120
|
+
g("space5", 0, 6, 0.125, "rem"),
|
|
121
|
+
g("space6", 0, 6, 0.125, "rem"),
|
|
122
|
+
g("space8", 0, 6, 0.125, "rem"),
|
|
123
|
+
g("space10", 0, 6, 0.125, "rem"),
|
|
124
|
+
g("space12", 0, 8, 0.125, "rem"),
|
|
125
|
+
g("space16", 0, 10, 0.125, "rem"),
|
|
126
|
+
g("space20", 0, 12, 0.125, "rem"),
|
|
127
|
+
g("space24", 0, 12, 0.125, "rem")
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: "Radius",
|
|
132
|
+
tokens: [
|
|
133
|
+
m("radiusNone"),
|
|
134
|
+
g("radiusSm", 0, 2, 0.0625, "rem"),
|
|
135
|
+
g("radiusMd", 0, 2, 0.0625, "rem"),
|
|
136
|
+
g("radiusLg", 0, 2, 0.0625, "rem"),
|
|
137
|
+
g("radiusXl", 0, 3, 0.0625, "rem"),
|
|
138
|
+
m("radiusFull")
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: "Shadows",
|
|
143
|
+
tokens: [
|
|
144
|
+
m("shadowNone"),
|
|
145
|
+
m("shadowSm"),
|
|
146
|
+
m("shadowMd"),
|
|
147
|
+
m("shadowLg"),
|
|
148
|
+
m("shadowXl")
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: "Motion",
|
|
153
|
+
tokens: [
|
|
154
|
+
m("durationFast"),
|
|
155
|
+
m("durationBase"),
|
|
156
|
+
m("durationSlow"),
|
|
157
|
+
m("easingDefault"),
|
|
158
|
+
m("easingEmphasized"),
|
|
159
|
+
m("easingDecelerate")
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
function Le(e) {
|
|
164
|
+
return Object.keys(e).length === 0 ? `<LucentProvider>
|
|
165
|
+
{children}
|
|
166
|
+
</LucentProvider>` : `<LucentProvider tokens={{
|
|
167
|
+
${Object.entries(e).map(([o, s]) => ` ${o}: '${s}'`).join(`,
|
|
168
|
+
`)}
|
|
169
|
+
}}>
|
|
170
|
+
{children}
|
|
171
|
+
</LucentProvider>`;
|
|
172
|
+
}
|
|
173
|
+
async function Pe(e) {
|
|
174
|
+
try {
|
|
175
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
176
|
+
} catch {
|
|
177
|
+
return !1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function Ee({ label: e, value: n, isOverridden: o, onChange: s, onReset: i }) {
|
|
181
|
+
return /* @__PURE__ */ c("div", { style: Ie, children: [
|
|
182
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", color: "secondary", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", marginRight: 8 }, children: e }),
|
|
183
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
184
|
+
/* @__PURE__ */ t(
|
|
185
|
+
P,
|
|
186
|
+
{
|
|
187
|
+
value: n,
|
|
188
|
+
onChange: s,
|
|
189
|
+
size: "sm"
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
o && /* @__PURE__ */ t(B, { variant: "ghost", size: "2xs", onClick: i, "aria-label": "Reset to default", children: /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ t("path", { d: "M1 1l8 8M9 1l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
|
|
193
|
+
] })
|
|
194
|
+
] });
|
|
195
|
+
}
|
|
196
|
+
const Ie = {
|
|
197
|
+
display: "flex",
|
|
198
|
+
alignItems: "center",
|
|
199
|
+
justifyContent: "space-between",
|
|
200
|
+
padding: "4px 0",
|
|
201
|
+
minHeight: 28
|
|
202
|
+
};
|
|
203
|
+
function Ae({
|
|
204
|
+
label: e,
|
|
205
|
+
value: n,
|
|
206
|
+
isOverridden: o,
|
|
207
|
+
min: s,
|
|
208
|
+
max: i,
|
|
209
|
+
step: r,
|
|
210
|
+
unit: u,
|
|
211
|
+
onChange: f,
|
|
212
|
+
onReset: d
|
|
213
|
+
}) {
|
|
214
|
+
const b = parseFloat(n) || 0;
|
|
215
|
+
return /* @__PURE__ */ c("div", { style: Ge, children: [
|
|
216
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", color: "secondary", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", marginRight: 8 }, children: e }),
|
|
217
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
218
|
+
/* @__PURE__ */ t(
|
|
219
|
+
$,
|
|
220
|
+
{
|
|
221
|
+
min: s,
|
|
222
|
+
max: i,
|
|
223
|
+
step: r,
|
|
224
|
+
value: b,
|
|
225
|
+
onChange: (v) => f(`${v}${u}`),
|
|
226
|
+
size: "sm",
|
|
227
|
+
style: { width: 80 }
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", color: "onAccent", style: { width: 52, textAlign: "right", flexShrink: 0, color: "var(--lucent-accent-default)" }, children: n }),
|
|
231
|
+
o && /* @__PURE__ */ t(B, { variant: "ghost", size: "2xs", onClick: d, "aria-label": "Reset to default", children: /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ t("path", { d: "M1 1l8 8M9 1l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
|
|
232
|
+
] })
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
const Ge = {
|
|
236
|
+
display: "flex",
|
|
237
|
+
alignItems: "center",
|
|
238
|
+
justifyContent: "space-between",
|
|
239
|
+
padding: "4px 0",
|
|
240
|
+
minHeight: 28
|
|
241
|
+
};
|
|
242
|
+
function $e({ label: e, value: n, isOverridden: o, onChange: s, onReset: i }) {
|
|
243
|
+
return /* @__PURE__ */ c("div", { style: _e, children: [
|
|
244
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", color: "secondary", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", marginRight: 8 }, children: e }),
|
|
245
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
246
|
+
/* @__PURE__ */ t(
|
|
247
|
+
re,
|
|
248
|
+
{
|
|
249
|
+
size: "sm",
|
|
250
|
+
value: n,
|
|
251
|
+
onChange: (r) => s(r.target.value),
|
|
252
|
+
style: { width: 140, fontFamily: "var(--lucent-font-family-mono)" },
|
|
253
|
+
spellCheck: !1
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
o && /* @__PURE__ */ t(B, { variant: "ghost", size: "2xs", onClick: i, "aria-label": "Reset to default", children: /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ t("path", { d: "M1 1l8 8M9 1l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
|
|
257
|
+
] })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
const _e = {
|
|
261
|
+
display: "flex",
|
|
262
|
+
alignItems: "center",
|
|
263
|
+
justifyContent: "space-between",
|
|
264
|
+
padding: "4px 0",
|
|
265
|
+
minHeight: 28
|
|
266
|
+
};
|
|
267
|
+
function Y(e, n) {
|
|
268
|
+
const o = Ce(e), s = ze(e, o), i = n === "light", r = z(s, i ? 0.05 : -0.07), u = z(s, i ? 0.85 : -0.6), f = z(s, i ? -0.15 : 0.15);
|
|
269
|
+
return {
|
|
270
|
+
accentDefault: s,
|
|
271
|
+
accentFg: o,
|
|
272
|
+
accentHover: r,
|
|
273
|
+
accentSubtle: u,
|
|
274
|
+
accentBorder: f
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function je(e, n) {
|
|
278
|
+
const o = n === "light", s = z(e, o ? -0.02 : 0.02), i = z(e, o ? -0.04 : 0.03), [r, u, f] = Be(e), d = o ? X(r, u * 0.3, Math.min(1, f + (1 - f) * 0.85)) : X(r, u, Math.min(0.25, f + 0.04)), b = z(d, o ? -0.04 : 0.03), v = z(d, o ? 0 : 0.06), x = z(d, o ? 0 : 0.06);
|
|
279
|
+
return {
|
|
280
|
+
bgBase: e,
|
|
281
|
+
bgSubtle: s,
|
|
282
|
+
surfaceTint: i,
|
|
283
|
+
surface: d,
|
|
284
|
+
surfaceSecondary: b,
|
|
285
|
+
surfaceRaised: v,
|
|
286
|
+
surfaceOverlay: x
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function We(e, n) {
|
|
290
|
+
const o = n === "light";
|
|
291
|
+
return {
|
|
292
|
+
borderDefault: e,
|
|
293
|
+
borderSubtle: z(e, o ? 0.05 : -0.02),
|
|
294
|
+
borderStrong: z(e, o ? -0.27 : 0.19)
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function Ne(e, n) {
|
|
298
|
+
const o = n === "light";
|
|
299
|
+
return {
|
|
300
|
+
surface: e,
|
|
301
|
+
surfaceSecondary: z(e, o ? -0.04 : 0.03),
|
|
302
|
+
surfaceRaised: z(e, o ? 0 : 0.06),
|
|
303
|
+
surfaceOverlay: z(e, o ? 0 : 0.06)
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
const Ke = [
|
|
307
|
+
{ key: "fontSizeXs", step: -2 },
|
|
308
|
+
{ key: "fontSizeSm", step: -1 },
|
|
309
|
+
{ key: "fontSizeMd", step: 0 },
|
|
310
|
+
{ key: "fontSizeLg", step: 1 },
|
|
311
|
+
{ key: "fontSizeXl", step: 2 },
|
|
312
|
+
{ key: "fontSize2xl", step: 3 },
|
|
313
|
+
{ key: "fontSize3xl", step: 4 }
|
|
314
|
+
];
|
|
315
|
+
function U(e, n) {
|
|
316
|
+
const o = {};
|
|
317
|
+
for (const { key: s, step: i } of Ke) {
|
|
318
|
+
const r = e * Math.pow(n, i), u = Math.round(r * 1e3) / 1e3;
|
|
319
|
+
o[s] = `${u}rem`;
|
|
320
|
+
}
|
|
321
|
+
return o;
|
|
322
|
+
}
|
|
323
|
+
const Ue = [
|
|
324
|
+
{ label: "Minor Second", ratio: 1.067 },
|
|
325
|
+
{ label: "Major Second", ratio: 1.125 },
|
|
326
|
+
{ label: "Minor Third", ratio: 1.2 },
|
|
327
|
+
{ label: "Major Third", ratio: 1.25 },
|
|
328
|
+
{ label: "Perfect Fourth", ratio: 1.333 },
|
|
329
|
+
{ label: "Golden Ratio", ratio: 1.618 }
|
|
330
|
+
], He = [
|
|
331
|
+
{ key: "space0", rem: 0 },
|
|
332
|
+
{ key: "space1", rem: 0.25 },
|
|
333
|
+
{ key: "space2", rem: 0.5 },
|
|
334
|
+
{ key: "space3", rem: 0.75 },
|
|
335
|
+
{ key: "space4", rem: 1 },
|
|
336
|
+
{ key: "space5", rem: 1.25 },
|
|
337
|
+
{ key: "space6", rem: 1.5 },
|
|
338
|
+
{ key: "space8", rem: 2 },
|
|
339
|
+
{ key: "space10", rem: 2.5 },
|
|
340
|
+
{ key: "space12", rem: 3 },
|
|
341
|
+
{ key: "space16", rem: 4 },
|
|
342
|
+
{ key: "space20", rem: 5 },
|
|
343
|
+
{ key: "space24", rem: 6 }
|
|
344
|
+
];
|
|
345
|
+
function Z(e) {
|
|
346
|
+
const n = {};
|
|
347
|
+
for (const { key: o, rem: s } of He) {
|
|
348
|
+
if (s === 0) {
|
|
349
|
+
n[o] = "0px";
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
const i = Math.round(s * e * 1e3) / 1e3;
|
|
353
|
+
n[o] = `${i}rem`;
|
|
354
|
+
}
|
|
355
|
+
return n;
|
|
356
|
+
}
|
|
357
|
+
const Je = [
|
|
358
|
+
{ key: "radiusSm", sharp: 0, rounded: 0.25, pill: 0.5 },
|
|
359
|
+
{ key: "radiusMd", sharp: 0, rounded: 0.375, pill: 0.75 },
|
|
360
|
+
{ key: "radiusLg", sharp: 0, rounded: 0.5, pill: 1 },
|
|
361
|
+
{ key: "radiusXl", sharp: 0, rounded: 0.75, pill: 1.5 }
|
|
362
|
+
];
|
|
363
|
+
function Q(e) {
|
|
364
|
+
const n = {};
|
|
365
|
+
for (const { key: o, sharp: s, rounded: i, pill: r } of Je) {
|
|
366
|
+
let u;
|
|
367
|
+
if (e <= 0.5) {
|
|
368
|
+
const d = e / 0.5;
|
|
369
|
+
u = s + (i - s) * d;
|
|
370
|
+
} else {
|
|
371
|
+
const d = (e - 0.5) / 0.5;
|
|
372
|
+
u = i + (r - i) * d;
|
|
373
|
+
}
|
|
374
|
+
const f = Math.round(u * 1e3) / 1e3;
|
|
375
|
+
n[o] = `${f}rem`;
|
|
376
|
+
}
|
|
377
|
+
return n;
|
|
378
|
+
}
|
|
379
|
+
const Xe = {
|
|
380
|
+
flat: we,
|
|
381
|
+
subtle: ke,
|
|
382
|
+
elevated: Se,
|
|
383
|
+
liquidGlass: xe,
|
|
384
|
+
brutalist: ve,
|
|
385
|
+
neumorphic: be,
|
|
386
|
+
natural: ge,
|
|
387
|
+
glow: me
|
|
388
|
+
}, qe = [
|
|
389
|
+
{ value: "flat", label: "Flat" },
|
|
390
|
+
{ value: "default", label: "Default" },
|
|
391
|
+
{ value: "subtle", label: "Subtle" },
|
|
392
|
+
{ value: "elevated", label: "Elevated" },
|
|
393
|
+
{ value: "natural", label: "Natural" },
|
|
394
|
+
{ value: "liquidGlass", label: "Liquid Glass" },
|
|
395
|
+
{ value: "neumorphic", label: "Neumorphic" },
|
|
396
|
+
{ value: "brutalist", label: "Brutalist" },
|
|
397
|
+
{ value: "glow", label: "Glow" }
|
|
398
|
+
];
|
|
399
|
+
function ee(e, n) {
|
|
400
|
+
if (e === "default")
|
|
401
|
+
return n === "dark" ? he : pe;
|
|
402
|
+
const o = Xe[e];
|
|
403
|
+
return n === "dark" ? o.dark : o.light;
|
|
404
|
+
}
|
|
405
|
+
const te = /* @__PURE__ */ new Set(), Ve = {
|
|
406
|
+
Inter: "Inter:wght@300;400;500;600;700",
|
|
407
|
+
Geist: "Geist:wght@300;400;500;600;700",
|
|
408
|
+
"Plus Jakarta Sans": "Plus+Jakarta+Sans:wght@300;400;500;600;700",
|
|
409
|
+
Outfit: "Outfit:wght@300;400;500;600;700",
|
|
410
|
+
Sora: "Sora:wght@300;400;500;600;700",
|
|
411
|
+
"Space Grotesk": "Space+Grotesk:wght@400;500;600;700",
|
|
412
|
+
Lora: "Lora:wght@400;500;600;700",
|
|
413
|
+
Merriweather: "Merriweather:wght@300;400;700",
|
|
414
|
+
"Playfair Display": "Playfair+Display:wght@400;500;600;700",
|
|
415
|
+
"JetBrains Mono": "JetBrains+Mono:wght@400;500;600;700",
|
|
416
|
+
"Fira Code": "Fira+Code:wght@400;500;600;700",
|
|
417
|
+
"DM Sans": "DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700",
|
|
418
|
+
"DM Mono": "DM+Mono:wght@400;500",
|
|
419
|
+
Georama: "Georama:wght@400;500;600;700"
|
|
420
|
+
};
|
|
421
|
+
function j(e) {
|
|
422
|
+
var r;
|
|
423
|
+
const n = e.match(/"([^"]+)"/), o = n ? n[1] : (r = e.split(",")[0]) == null ? void 0 : r.trim();
|
|
424
|
+
if (!o || te.has(o)) return;
|
|
425
|
+
const s = Ve[o];
|
|
426
|
+
if (!s) return;
|
|
427
|
+
te.add(o);
|
|
428
|
+
const i = document.createElement("link");
|
|
429
|
+
i.rel = "stylesheet", i.href = `https://fonts.googleapis.com/css2?family=${s}&display=swap`, document.head.appendChild(i);
|
|
430
|
+
}
|
|
431
|
+
const Ye = '"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', Ze = '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', Qe = '"Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', et = '"JetBrains Mono", "Fira Code", "Cascadia Code", monospace', tt = '"Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif', ne = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', nt = '"Outfit", -apple-system, BlinkMacSystemFont, sans-serif', ot = '"Sora", -apple-system, BlinkMacSystemFont, sans-serif', at = '"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif', lt = [
|
|
432
|
+
// ── Foundations ──
|
|
433
|
+
{ name: "Default", accent: "#111827", roundness: 0.5, density: 1, shadow: "default", typeBase: 1, typeRatio: 1.125, fontFamily: Ye },
|
|
434
|
+
{ name: "Modern", accent: "#6366f1", roundness: 0.5, density: 1, shadow: "subtle", typeBase: 1, typeRatio: 1.2, fontFamily: Ze },
|
|
435
|
+
// ── Design Personalities ──
|
|
436
|
+
{ name: "Liquid Glass", accent: "#0ea5e9", roundness: 1, density: 0.9, shadow: "liquidGlass", typeBase: 1.0625, typeRatio: 1.2, fontFamily: ne },
|
|
437
|
+
{ name: "Bento", accent: "#0d9488", roundness: 0.75, density: 1, shadow: "natural", typeBase: 0.9375, typeRatio: 1.2, fontFamily: Qe },
|
|
438
|
+
{ name: "Brutalist", accent: "#ef4444", roundness: 0, density: 0.8, shadow: "brutalist", typeBase: 1.125, typeRatio: 1.25, fontFamily: tt },
|
|
439
|
+
{ name: "Terminal", accent: "#10b981", roundness: 0, density: 0.8, shadow: "glow", typeBase: 0.9375, typeRatio: 1.125, fontFamily: et },
|
|
440
|
+
{ name: "Soft UI", accent: "#8b5cf6", roundness: 1, density: 1.25, shadow: "neumorphic", typeBase: 1, typeRatio: 1.2, fontFamily: nt },
|
|
441
|
+
{ name: "Bloom", accent: "#e879f9", roundness: 0.875, density: 1.25, shadow: "glow", typeBase: 1.0625, typeRatio: 1.25, fontFamily: ot },
|
|
442
|
+
{ name: "Minimal", accent: "#475569", roundness: 0.25, density: 1, shadow: "flat", typeBase: 1, typeRatio: 1.125, fontFamily: at },
|
|
443
|
+
{ name: "Enterprise", accent: "#475569", roundness: 0, density: 0.75, shadow: "flat", typeBase: 0.9375, typeRatio: 1.125, fontFamily: ne }
|
|
444
|
+
], rt = [
|
|
445
|
+
{
|
|
446
|
+
label: "Brand",
|
|
447
|
+
colors: ["#111827", "#e9c96b", "#6366f1", "#8b5cf6", "#10b981", "#0d9488", "#f43f5e", "#e8624a", "#d97706", "#0ea5e9", "#475569", "#5f8c6e"]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
label: "Vibrant",
|
|
451
|
+
colors: ["#ef4444", "#f97316", "#eab308", "#22c55e", "#06b6d4", "#3b82f6", "#a855f7", "#ec4899", "#14b8a6", "#f59e0b"]
|
|
452
|
+
}
|
|
453
|
+
], st = [
|
|
454
|
+
{
|
|
455
|
+
label: "Light",
|
|
456
|
+
colors: ["#ffffff", "#fafafa", "#f9fafb", "#f5f5f4", "#fef7ee", "#faf5ff", "#f0f9ff", "#f0fdf4", "#fefce8", "#fff1f2"]
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
label: "Dark",
|
|
460
|
+
colors: ["#09090b", "#0a0a0a", "#0c0c0e", "#111827", "#18181b", "#1c1917", "#1a1a2e", "#0f172a", "#171717", "#0d1117"]
|
|
461
|
+
}
|
|
462
|
+
], it = [
|
|
463
|
+
{
|
|
464
|
+
label: "Light",
|
|
465
|
+
colors: ["#ffffff", "#fafafa", "#f9fafb", "#f5f5f5", "#f3f4f6", "#f1f5f9", "#fef3c7", "#fce7f3", "#dbeafe", "#dcfce7"]
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
label: "Dark",
|
|
469
|
+
colors: ["#111111", "#141414", "#1a1a1a", "#1e1e2e", "#1f2937", "#1e293b", "#18181b", "#16213e", "#1c1c1c", "#0f172a"]
|
|
470
|
+
}
|
|
471
|
+
], ct = [
|
|
472
|
+
{
|
|
473
|
+
label: "Light",
|
|
474
|
+
colors: ["#e5e7eb", "#d1d5db", "#e2e8f0", "#f3f4f6", "#d4d4d8", "#cbd5e1", "#e7e5e4", "#fde68a", "#c7d2fe", "#bbf7d0"]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
label: "Dark",
|
|
478
|
+
colors: ["#27272a", "#374151", "#334155", "#3f3f46", "#1e293b", "#404040", "#44403c", "#1c1f2a", "#2d2d3f", "#1f2937"]
|
|
479
|
+
}
|
|
480
|
+
];
|
|
481
|
+
function dt({ state: e, theme: n }) {
|
|
482
|
+
const [o, s] = C(1), [i, r] = C(0.5), [u, f] = C("default"), [d, b] = C(null), v = e.overrides.accentDefault ?? e.tokens.accentDefault, x = D((l) => {
|
|
483
|
+
for (const [I, W] of Object.entries(l))
|
|
484
|
+
e.setOverride(I, W);
|
|
485
|
+
}, [e]), R = D((l) => {
|
|
486
|
+
e.resetAll(), b(l.name), s(l.density), r(l.roundness), f(l.shadow);
|
|
487
|
+
const I = {
|
|
488
|
+
...Y(l.accent, n),
|
|
489
|
+
...U(l.typeBase, l.typeRatio),
|
|
490
|
+
...Z(l.density),
|
|
491
|
+
...Q(l.roundness),
|
|
492
|
+
...ee(l.shadow, n),
|
|
493
|
+
fontFamilyBase: l.fontFamily
|
|
494
|
+
};
|
|
495
|
+
j(l.fontFamily), requestAnimationFrame(() => {
|
|
496
|
+
for (const [W, ce] of Object.entries(I))
|
|
497
|
+
e.setOverride(W, ce);
|
|
498
|
+
});
|
|
499
|
+
}, [e, n]), T = (l) => {
|
|
500
|
+
O(), s(l), x(Z(l));
|
|
501
|
+
}, M = (l) => {
|
|
502
|
+
O(), r(l), x(Q(l));
|
|
503
|
+
}, F = (l) => {
|
|
504
|
+
O(), f(l), x(ee(l, n));
|
|
505
|
+
}, E = (l) => {
|
|
506
|
+
O(), /^#[0-9a-f]{6}$/i.test(l) ? x(Y(l, n)) : e.setOverride("accentDefault", l);
|
|
507
|
+
}, a = (l) => {
|
|
508
|
+
O(), /^#[0-9a-f]{6}$/i.test(l) ? x(je(l, n)) : e.setOverride("bgBase", l);
|
|
509
|
+
}, p = (l) => {
|
|
510
|
+
O(), /^#[0-9a-f]{6}$/i.test(l) ? x(Ne(l, n)) : e.setOverride("surface", l);
|
|
511
|
+
}, k = (l) => {
|
|
512
|
+
O(), /^#[0-9a-f]{6}$/i.test(l) ? x(We(l, n)) : e.setOverride("borderDefault", l);
|
|
513
|
+
}, _ = e.overrides.bgBase ?? e.tokens.bgBase, H = e.overrides.surface ?? e.tokens.surface, J = e.overrides.borderDefault ?? e.tokens.borderDefault, se = i < 0.2 ? "Sharp" : i < 0.4 ? "Subtle" : i < 0.6 ? "Rounded" : i < 0.8 ? "Soft" : "Pill", ie = o < 0.85 ? "Compact" : o < 0.95 ? "Snug" : o < 1.05 ? "Default" : o < 1.15 ? "Relaxed" : "Spacious", O = () => b(null);
|
|
514
|
+
return /* @__PURE__ */ c("div", { style: { padding: "4px 12px 12px", display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
515
|
+
/* @__PURE__ */ t(A, { label: "Presets", children: /* @__PURE__ */ t("div", { style: {
|
|
516
|
+
display: "grid",
|
|
517
|
+
gridTemplateColumns: "repeat(5, 1fr)",
|
|
518
|
+
gap: 6
|
|
519
|
+
}, children: lt.map((l) => /* @__PURE__ */ c(
|
|
520
|
+
B,
|
|
521
|
+
{
|
|
522
|
+
variant: d === l.name ? "secondary" : "ghost",
|
|
523
|
+
onClick: () => R(l),
|
|
524
|
+
style: {
|
|
525
|
+
padding: "8px 4px 6px",
|
|
526
|
+
display: "flex",
|
|
527
|
+
flexDirection: "column",
|
|
528
|
+
alignItems: "center",
|
|
529
|
+
gap: 5,
|
|
530
|
+
height: "auto"
|
|
531
|
+
},
|
|
532
|
+
children: [
|
|
533
|
+
/* @__PURE__ */ t("div", { style: {
|
|
534
|
+
width: 24,
|
|
535
|
+
height: 24,
|
|
536
|
+
borderRadius: l.roundness < 0.3 ? 3 : l.roundness < 0.7 ? 6 : 12,
|
|
537
|
+
background: l.accent,
|
|
538
|
+
border: "1px solid rgba(255,255,255,0.1)"
|
|
539
|
+
} }),
|
|
540
|
+
/* @__PURE__ */ t(h, { size: "xs", ...d !== l.name && { color: "secondary" }, weight: d === l.name ? "semibold" : "regular", style: { fontSize: 9, whiteSpace: "nowrap" }, children: l.name })
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
l.name
|
|
544
|
+
)) }) }),
|
|
545
|
+
/* @__PURE__ */ t(A, { label: "Colors", children: /* @__PURE__ */ c("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
546
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
547
|
+
/* @__PURE__ */ t(P, { value: v, onChange: E, size: "sm", presetGroups: rt }),
|
|
548
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { flex: 1 }, children: "Accent" }),
|
|
549
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", style: { color: "var(--lucent-accent-default)" }, children: v })
|
|
550
|
+
] }),
|
|
551
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
552
|
+
/* @__PURE__ */ t(P, { value: _, onChange: a, size: "sm", presetGroups: st }),
|
|
553
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { flex: 1 }, children: "Background" }),
|
|
554
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", style: { color: "var(--lucent-accent-default)" }, children: _ })
|
|
555
|
+
] }),
|
|
556
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
557
|
+
/* @__PURE__ */ t(P, { value: H, onChange: p, size: "sm", presetGroups: it }),
|
|
558
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { flex: 1 }, children: "Surface" }),
|
|
559
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", style: { color: "var(--lucent-accent-default)" }, children: H })
|
|
560
|
+
] }),
|
|
561
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
562
|
+
/* @__PURE__ */ t(P, { value: J, onChange: k, size: "sm", presetGroups: ct }),
|
|
563
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { flex: 1 }, children: "Border" }),
|
|
564
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", style: { color: "var(--lucent-accent-default)" }, children: J })
|
|
565
|
+
] })
|
|
566
|
+
] }) }),
|
|
567
|
+
/* @__PURE__ */ c(A, { label: "Density", children: [
|
|
568
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
569
|
+
/* @__PURE__ */ t(h, { size: "xs", family: "mono", color: "secondary", style: { width: 54, flexShrink: 0 }, children: "Compact" }),
|
|
570
|
+
/* @__PURE__ */ t($, { min: 0.7, max: 1.35, step: 0.01, value: o, onChange: (l) => T(parseFloat(l.target.value)), size: "sm", style: { flex: 1 } }),
|
|
571
|
+
/* @__PURE__ */ t(h, { size: "xs", family: "mono", color: "secondary", style: { width: 54, textAlign: "right", flexShrink: 0 }, children: "Spacious" })
|
|
572
|
+
] }),
|
|
573
|
+
/* @__PURE__ */ t("div", { style: { textAlign: "center", marginTop: 4 }, children: /* @__PURE__ */ c(h, { size: "xs", style: { color: "var(--lucent-accent-default)" }, children: [
|
|
574
|
+
ie,
|
|
575
|
+
" (",
|
|
576
|
+
o.toFixed(2),
|
|
577
|
+
"x)"
|
|
578
|
+
] }) })
|
|
579
|
+
] }),
|
|
580
|
+
/* @__PURE__ */ c(A, { label: "Roundness", children: [
|
|
581
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
582
|
+
/* @__PURE__ */ t(h, { size: "xs", family: "mono", color: "secondary", style: { width: 36, flexShrink: 0 }, children: "Sharp" }),
|
|
583
|
+
/* @__PURE__ */ t($, { min: 0, max: 1, step: 0.01, value: i, onChange: (l) => M(parseFloat(l.target.value)), size: "sm", style: { flex: 1 } }),
|
|
584
|
+
/* @__PURE__ */ t(h, { size: "xs", family: "mono", color: "secondary", style: { width: 24, textAlign: "right", flexShrink: 0 }, children: "Pill" })
|
|
585
|
+
] }),
|
|
586
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 8, marginTop: 8, justifyContent: "center" }, children: [0, 0.25, 0.5, 0.75, 1].map((l) => /* @__PURE__ */ t("div", { style: {
|
|
587
|
+
width: 32,
|
|
588
|
+
height: 32,
|
|
589
|
+
background: "var(--lucent-surface-secondary)",
|
|
590
|
+
border: `1.5px solid ${Math.abs(i - l) < 0.05 ? "var(--lucent-accent-default)" : "var(--lucent-border-default)"}`,
|
|
591
|
+
borderRadius: l === 0 ? 2 : l < 0.5 ? 4 : l < 0.8 ? 8 : 16,
|
|
592
|
+
cursor: "pointer",
|
|
593
|
+
transition: "border-color 150ms"
|
|
594
|
+
}, onClick: () => M(l) }, l)) }),
|
|
595
|
+
/* @__PURE__ */ t("div", { style: { textAlign: "center", marginTop: 4 }, children: /* @__PURE__ */ t(h, { size: "xs", style: { color: "var(--lucent-accent-default)" }, children: se }) })
|
|
596
|
+
] }),
|
|
597
|
+
/* @__PURE__ */ t(A, { label: "Shadow Style", children: /* @__PURE__ */ t("div", { style: {
|
|
598
|
+
display: "grid",
|
|
599
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
600
|
+
gap: 4
|
|
601
|
+
}, children: qe.map(({ value: l, label: I }) => /* @__PURE__ */ t(
|
|
602
|
+
B,
|
|
603
|
+
{
|
|
604
|
+
variant: u === l ? "secondary" : "ghost",
|
|
605
|
+
size: "2xs",
|
|
606
|
+
onClick: () => F(l),
|
|
607
|
+
style: { justifyContent: "center" },
|
|
608
|
+
children: I
|
|
609
|
+
},
|
|
610
|
+
l
|
|
611
|
+
)) }) })
|
|
612
|
+
] });
|
|
613
|
+
}
|
|
614
|
+
function A({ label: e, children: n }) {
|
|
615
|
+
return /* @__PURE__ */ c("div", { style: {
|
|
616
|
+
background: "var(--lucent-surface)",
|
|
617
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
618
|
+
padding: "10px 12px",
|
|
619
|
+
border: "1px solid var(--lucent-border-default)"
|
|
620
|
+
}, children: [
|
|
621
|
+
/* @__PURE__ */ t(h, { size: "xs", weight: "semibold", style: { marginBottom: 10, display: "block" }, children: e }),
|
|
622
|
+
n
|
|
623
|
+
] });
|
|
624
|
+
}
|
|
625
|
+
const L = [
|
|
626
|
+
{ label: "DM Sans", family: '"DM Sans", sans-serif', category: "sans" },
|
|
627
|
+
{ label: "Inter", family: '"Inter", sans-serif', category: "sans" },
|
|
628
|
+
{ label: "System UI", family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', category: "sans" },
|
|
629
|
+
{ label: "Geist", family: '"Geist", sans-serif', category: "sans" },
|
|
630
|
+
{ label: "Plus Jakarta", family: '"Plus Jakarta Sans", sans-serif', category: "sans" },
|
|
631
|
+
{ label: "Outfit", family: '"Outfit", sans-serif', category: "sans" },
|
|
632
|
+
{ label: "Lora", family: '"Lora", serif', category: "serif" },
|
|
633
|
+
{ label: "Merriweather", family: '"Merriweather", serif', category: "serif" },
|
|
634
|
+
{ label: "Playfair", family: '"Playfair Display", serif', category: "serif" },
|
|
635
|
+
{ label: "JetBrains Mono", family: '"JetBrains Mono", monospace', category: "mono" },
|
|
636
|
+
{ label: "Fira Code", family: '"Fira Code", monospace', category: "mono" },
|
|
637
|
+
{ label: "Space Grotesk", family: '"Space Grotesk", sans-serif', category: "display" },
|
|
638
|
+
{ label: "Sora", family: '"Sora", sans-serif', category: "display" },
|
|
639
|
+
{ label: "Georama", family: '"Georama", sans-serif', category: "display" }
|
|
640
|
+
];
|
|
641
|
+
function ft({ state: e, theme: n }) {
|
|
642
|
+
const o = e.overrides.fontSizeMd ?? e.tokens.fontSizeMd, s = parseFloat(o) || 1, [i, r] = C(s), [u, f] = C(() => {
|
|
643
|
+
const a = e.overrides.fontSizeLg ?? e.tokens.fontSizeLg, p = parseFloat(a) || 1.125, k = parseFloat(o) || 1;
|
|
644
|
+
return k > 0 ? Math.round(p / k * 1e3) / 1e3 : 1.125;
|
|
645
|
+
});
|
|
646
|
+
K(() => {
|
|
647
|
+
const a = parseFloat(e.overrides.fontSizeMd ?? e.tokens.fontSizeMd) || 1, p = parseFloat(e.overrides.fontSizeLg ?? e.tokens.fontSizeLg) || 1.125;
|
|
648
|
+
r(a), a > 0 && f(Math.round(p / a * 1e3) / 1e3);
|
|
649
|
+
}, [e.overrides.fontSizeMd, e.overrides.fontSizeLg, e.tokens.fontSizeMd, e.tokens.fontSizeLg]);
|
|
650
|
+
const [d, b] = C("all"), v = e.overrides.fontFamilyBase ?? e.tokens.fontFamilyBase, x = e.overrides.fontFamilyMono ?? e.tokens.fontFamilyMono, R = e.overrides.fontFamilyDisplay ?? e.tokens.fontFamilyDisplay, T = D((a) => {
|
|
651
|
+
for (const [p, k] of Object.entries(a))
|
|
652
|
+
e.setOverride(p, k);
|
|
653
|
+
}, [e]), M = (a) => {
|
|
654
|
+
r(a), T(U(a, u));
|
|
655
|
+
}, F = (a) => {
|
|
656
|
+
f(a), T(U(i, a));
|
|
657
|
+
}, E = d === "all" ? L : L.filter((a) => a.category === d);
|
|
658
|
+
return /* @__PURE__ */ c("div", { style: { padding: "4px 12px 12px", display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
659
|
+
/* @__PURE__ */ c(G, { label: "Font Family", children: [
|
|
660
|
+
/* @__PURE__ */ t("div", { style: { marginBottom: 8 }, children: /* @__PURE__ */ t(
|
|
661
|
+
Te,
|
|
662
|
+
{
|
|
663
|
+
value: d,
|
|
664
|
+
onChange: (a) => b(a),
|
|
665
|
+
options: [
|
|
666
|
+
{ value: "all", label: "All" },
|
|
667
|
+
{ value: "sans", label: "Sans" },
|
|
668
|
+
{ value: "serif", label: "Serif" },
|
|
669
|
+
{ value: "mono", label: "Mono" },
|
|
670
|
+
{ value: "display", label: "Display" }
|
|
671
|
+
],
|
|
672
|
+
size: "sm",
|
|
673
|
+
fullWidth: !0
|
|
674
|
+
}
|
|
675
|
+
) }),
|
|
676
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: E.map((a) => {
|
|
677
|
+
const p = v.includes(a.label) || a.family === v;
|
|
678
|
+
return /* @__PURE__ */ c(
|
|
679
|
+
B,
|
|
680
|
+
{
|
|
681
|
+
variant: p ? "secondary" : "ghost",
|
|
682
|
+
onClick: () => {
|
|
683
|
+
j(a.family), e.setOverride("fontFamilyBase", a.family);
|
|
684
|
+
},
|
|
685
|
+
style: {
|
|
686
|
+
width: "100%",
|
|
687
|
+
justifyContent: "space-between",
|
|
688
|
+
height: "auto",
|
|
689
|
+
padding: "8px 10px"
|
|
690
|
+
},
|
|
691
|
+
children: [
|
|
692
|
+
/* @__PURE__ */ t("span", { style: { fontFamily: a.family, fontSize: 14 }, children: a.label }),
|
|
693
|
+
/* @__PURE__ */ t(h, { as: "span", size: "xs", color: "secondary", style: { textTransform: "capitalize" }, children: a.category })
|
|
694
|
+
]
|
|
695
|
+
},
|
|
696
|
+
a.label
|
|
697
|
+
);
|
|
698
|
+
}) }),
|
|
699
|
+
/* @__PURE__ */ c("div", { style: { marginTop: 8 }, children: [
|
|
700
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginBottom: 4, display: "block" }, children: "Custom" }),
|
|
701
|
+
/* @__PURE__ */ t(
|
|
702
|
+
re,
|
|
703
|
+
{
|
|
704
|
+
size: "sm",
|
|
705
|
+
value: v,
|
|
706
|
+
onChange: (a) => e.setOverride("fontFamilyBase", a.target.value),
|
|
707
|
+
style: { width: "100%", fontFamily: "var(--lucent-font-family-mono)" },
|
|
708
|
+
spellCheck: !1
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
] })
|
|
712
|
+
] }),
|
|
713
|
+
/* @__PURE__ */ t(G, { label: "Code & Display Fonts", children: /* @__PURE__ */ c("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
714
|
+
/* @__PURE__ */ c("div", { children: [
|
|
715
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginBottom: 4, display: "block" }, children: "Monospace" }),
|
|
716
|
+
/* @__PURE__ */ t(
|
|
717
|
+
q,
|
|
718
|
+
{
|
|
719
|
+
size: "sm",
|
|
720
|
+
value: x,
|
|
721
|
+
onChange: (a) => {
|
|
722
|
+
j(a.target.value), e.setOverride("fontFamilyMono", a.target.value);
|
|
723
|
+
},
|
|
724
|
+
options: [
|
|
725
|
+
...L.filter((a) => a.category === "mono").map((a) => ({ value: a.family, label: a.label })),
|
|
726
|
+
...L.some((a) => a.family === x) ? [] : [{ value: x, label: "Custom" }]
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
] }),
|
|
731
|
+
/* @__PURE__ */ c("div", { children: [
|
|
732
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginBottom: 4, display: "block" }, children: "Display" }),
|
|
733
|
+
/* @__PURE__ */ t(
|
|
734
|
+
q,
|
|
735
|
+
{
|
|
736
|
+
size: "sm",
|
|
737
|
+
value: R,
|
|
738
|
+
onChange: (a) => {
|
|
739
|
+
j(a.target.value), e.setOverride("fontFamilyDisplay", a.target.value);
|
|
740
|
+
},
|
|
741
|
+
options: [
|
|
742
|
+
...L.filter((a) => a.category === "display" || a.category === "sans").map((a) => ({ value: a.family, label: a.label })),
|
|
743
|
+
...L.some((a) => a.family === R) ? [] : [{ value: R, label: "Custom" }]
|
|
744
|
+
]
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] })
|
|
748
|
+
] }) }),
|
|
749
|
+
/* @__PURE__ */ t(G, { label: "Type Scale", children: /* @__PURE__ */ c("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
750
|
+
/* @__PURE__ */ c("div", { children: [
|
|
751
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginBottom: 4, display: "block" }, children: "Base Size" }),
|
|
752
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
753
|
+
/* @__PURE__ */ t($, { min: 0.75, max: 1.5, step: 0.0625, value: i, onChange: (a) => M(parseFloat(a.target.value)), size: "sm", style: { flex: 1 } }),
|
|
754
|
+
/* @__PURE__ */ c(h, { as: "code", size: "xs", family: "mono", style: { width: 56, textAlign: "right", flexShrink: 0, color: "var(--lucent-accent-default)" }, children: [
|
|
755
|
+
i,
|
|
756
|
+
"rem"
|
|
757
|
+
] })
|
|
758
|
+
] })
|
|
759
|
+
] }),
|
|
760
|
+
/* @__PURE__ */ c("div", { children: [
|
|
761
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginBottom: 4, display: "block" }, children: "Scale Ratio" }),
|
|
762
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
763
|
+
/* @__PURE__ */ t($, { min: 1, max: 1.618, step: 1e-3, value: u, onChange: (a) => F(parseFloat(a.target.value)), size: "sm", style: { flex: 1 } }),
|
|
764
|
+
/* @__PURE__ */ t(h, { as: "code", size: "xs", family: "mono", style: { width: 56, textAlign: "right", flexShrink: 0, color: "var(--lucent-accent-default)" }, children: u.toFixed(3) })
|
|
765
|
+
] }),
|
|
766
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 6 }, children: Ue.map((a) => /* @__PURE__ */ t(
|
|
767
|
+
B,
|
|
768
|
+
{
|
|
769
|
+
variant: Math.abs(u - a.ratio) < 5e-3 ? "secondary" : "ghost",
|
|
770
|
+
size: "2xs",
|
|
771
|
+
onClick: () => F(a.ratio),
|
|
772
|
+
children: a.label
|
|
773
|
+
},
|
|
774
|
+
a.label
|
|
775
|
+
)) })
|
|
776
|
+
] })
|
|
777
|
+
] }) }),
|
|
778
|
+
/* @__PURE__ */ t(G, { label: "Text Colors", children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: yt.map(({ key: a, label: p }) => {
|
|
779
|
+
const k = e.overrides[a] ?? e.tokens[a];
|
|
780
|
+
return /* @__PURE__ */ t(
|
|
781
|
+
P,
|
|
782
|
+
{
|
|
783
|
+
label: p,
|
|
784
|
+
value: k,
|
|
785
|
+
onChange: (_) => e.setOverride(a, _),
|
|
786
|
+
size: "sm",
|
|
787
|
+
inline: !0
|
|
788
|
+
},
|
|
789
|
+
a
|
|
790
|
+
);
|
|
791
|
+
}) }) }),
|
|
792
|
+
/* @__PURE__ */ t(G, { label: "Preview", children: /* @__PURE__ */ t(
|
|
793
|
+
ut,
|
|
794
|
+
{
|
|
795
|
+
family: v,
|
|
796
|
+
baseSize: i,
|
|
797
|
+
ratio: u,
|
|
798
|
+
textPrimary: e.overrides.textPrimary ?? e.tokens.textPrimary,
|
|
799
|
+
textSecondary: e.overrides.textSecondary ?? e.tokens.textSecondary,
|
|
800
|
+
bgBase: e.overrides.bgBase ?? e.tokens.bgBase
|
|
801
|
+
}
|
|
802
|
+
) })
|
|
803
|
+
] });
|
|
804
|
+
}
|
|
805
|
+
const yt = [
|
|
806
|
+
{ key: "textPrimary", label: "Primary" },
|
|
807
|
+
{ key: "textSecondary", label: "Secondary" },
|
|
808
|
+
{ key: "textDisabled", label: "Disabled" },
|
|
809
|
+
{ key: "textInverse", label: "Inverse" }
|
|
810
|
+
];
|
|
811
|
+
function G({ label: e, children: n }) {
|
|
812
|
+
return /* @__PURE__ */ c("div", { style: {
|
|
813
|
+
background: "var(--lucent-surface)",
|
|
814
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
815
|
+
padding: "10px 12px",
|
|
816
|
+
border: "1px solid var(--lucent-border-default)"
|
|
817
|
+
}, children: [
|
|
818
|
+
/* @__PURE__ */ t(h, { size: "xs", weight: "semibold", style: { marginBottom: 10, display: "block" }, children: e }),
|
|
819
|
+
n
|
|
820
|
+
] });
|
|
821
|
+
}
|
|
822
|
+
function ut({ family: e, baseSize: n, ratio: o, textPrimary: s, textSecondary: i, bgBase: r }) {
|
|
823
|
+
const u = n * Math.pow(o, 4), f = n * Math.pow(o, 2), d = n, b = n * Math.pow(o, -1);
|
|
824
|
+
return /* @__PURE__ */ c("div", { style: {
|
|
825
|
+
background: r,
|
|
826
|
+
borderRadius: 6,
|
|
827
|
+
padding: "14px 12px",
|
|
828
|
+
fontFamily: e,
|
|
829
|
+
border: "1px solid var(--lucent-border-default)"
|
|
830
|
+
}, children: [
|
|
831
|
+
/* @__PURE__ */ t("div", { style: {
|
|
832
|
+
fontSize: `${u}rem`,
|
|
833
|
+
fontWeight: 700,
|
|
834
|
+
color: s,
|
|
835
|
+
lineHeight: 1.2,
|
|
836
|
+
marginBottom: 6
|
|
837
|
+
}, children: "Heading" }),
|
|
838
|
+
/* @__PURE__ */ t("div", { style: {
|
|
839
|
+
fontSize: `${f}rem`,
|
|
840
|
+
fontWeight: 600,
|
|
841
|
+
color: s,
|
|
842
|
+
lineHeight: 1.3,
|
|
843
|
+
marginBottom: 8
|
|
844
|
+
}, children: "Subheading text" }),
|
|
845
|
+
/* @__PURE__ */ t("div", { style: {
|
|
846
|
+
fontSize: `${d}rem`,
|
|
847
|
+
color: s,
|
|
848
|
+
lineHeight: 1.5,
|
|
849
|
+
marginBottom: 6
|
|
850
|
+
}, children: "Body text looks like this. It should be comfortable to read at any size with good line height and spacing." }),
|
|
851
|
+
/* @__PURE__ */ t("div", { style: {
|
|
852
|
+
fontSize: `${b}rem`,
|
|
853
|
+
color: i,
|
|
854
|
+
lineHeight: 1.5
|
|
855
|
+
}, children: "Secondary caption — smaller, muted for supplemental information." })
|
|
856
|
+
] });
|
|
857
|
+
}
|
|
858
|
+
const w = {
|
|
859
|
+
bg: "#0a0a0a",
|
|
860
|
+
surface: "#141414",
|
|
861
|
+
text: "#f0ead6",
|
|
862
|
+
textMuted: "#8a8473",
|
|
863
|
+
accent: "#e9c96b",
|
|
864
|
+
border: "rgba(233, 201, 107, 0.1)",
|
|
865
|
+
inputBg: "rgba(255, 255, 255, 0.05)"
|
|
866
|
+
}, ht = ye(null);
|
|
867
|
+
function pt({ children: e }) {
|
|
868
|
+
const [n, o] = C(null), s = D((r) => {
|
|
869
|
+
r && o(r);
|
|
870
|
+
}, []), i = fe(() => {
|
|
871
|
+
const r = {};
|
|
872
|
+
for (const [u, f] of Object.entries(Me))
|
|
873
|
+
r[S(u)] = f;
|
|
874
|
+
return r[S("bgBase")] = w.bg, r[S("surface")] = w.surface, r[S("surfaceSecondary")] = w.inputBg, r[S("borderDefault")] = w.border, r[S("borderSubtle")] = w.border, r[S("textPrimary")] = w.text, r[S("textSecondary")] = w.textMuted, r[S("accentDefault")] = w.accent, r[S("accentFg")] = "#0a0a0a", r[S("accentSubtle")] = "rgba(233, 201, 107, 0.12)", r[S("accentHover")] = "#d4b55a", r[S("accentBorder")] = w.accent, r;
|
|
875
|
+
}, []);
|
|
876
|
+
return /* @__PURE__ */ t("div", { ref: s, style: i, children: /* @__PURE__ */ t(ht.Provider, { value: n, children: e }) });
|
|
877
|
+
}
|
|
878
|
+
function mt({ state: e, theme: n, position: o, mode: s, onModeChange: i, onThemeChange: r, onClose: u }) {
|
|
879
|
+
const [f, d] = C("design"), [b, v] = C(""), [x, R] = C(() => {
|
|
880
|
+
const p = {};
|
|
881
|
+
for (const k of V)
|
|
882
|
+
p[k.label] = k.defaultExpanded ?? !1;
|
|
883
|
+
return p;
|
|
884
|
+
}), [T, M] = C(!1), F = (p) => {
|
|
885
|
+
R((k) => ({ ...k, [p]: !k[p] }));
|
|
886
|
+
}, E = async () => {
|
|
887
|
+
const p = Le(e.overrides);
|
|
888
|
+
await Pe(p) && (M(!0), setTimeout(() => M(!1), 2e3));
|
|
889
|
+
}, a = b.toLowerCase();
|
|
890
|
+
return /* @__PURE__ */ t(pt, { children: /* @__PURE__ */ c("div", { style: {
|
|
891
|
+
...bt,
|
|
892
|
+
[o]: 0,
|
|
893
|
+
borderLeft: o === "right" ? `1px solid ${w.border}` : void 0,
|
|
894
|
+
borderRight: o === "left" ? `1px solid ${w.border}` : void 0
|
|
895
|
+
}, children: [
|
|
896
|
+
/* @__PURE__ */ c("div", { style: vt, children: [
|
|
897
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
898
|
+
/* @__PURE__ */ c("svg", { width: "16", height: "16", viewBox: "0 0 60 60", fill: "none", children: [
|
|
899
|
+
/* @__PURE__ */ t("rect", { x: "8", y: "8", width: "18", height: "22", rx: "2", fill: "#e9c96b", opacity: "0.92" }),
|
|
900
|
+
/* @__PURE__ */ t("rect", { x: "8", y: "40", width: "44", height: "12", rx: "2", fill: "#e9c96b", opacity: "0.92" }),
|
|
901
|
+
/* @__PURE__ */ t("rect", { x: "36", y: "8", width: "16", height: "28", rx: "2", fill: "#e9c96b", opacity: "0.08" })
|
|
902
|
+
] }),
|
|
903
|
+
/* @__PURE__ */ t(h, { size: "sm", weight: "semibold", children: "Lucent DevTools" })
|
|
904
|
+
] }),
|
|
905
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
906
|
+
r && /* @__PURE__ */ t(
|
|
907
|
+
Fe,
|
|
908
|
+
{
|
|
909
|
+
checked: n === "dark",
|
|
910
|
+
onChange: () => r(n === "light" ? "dark" : "light"),
|
|
911
|
+
size: "sm"
|
|
912
|
+
}
|
|
913
|
+
),
|
|
914
|
+
/* @__PURE__ */ t(
|
|
915
|
+
B,
|
|
916
|
+
{
|
|
917
|
+
variant: "ghost",
|
|
918
|
+
size: "2xs",
|
|
919
|
+
onClick: () => i(s === "overlay" ? "push" : "overlay"),
|
|
920
|
+
"aria-label": s === "overlay" ? "Push content" : "Overlay",
|
|
921
|
+
title: s === "overlay" ? "Push content" : "Overlay",
|
|
922
|
+
children: s === "overlay" ? /* @__PURE__ */ c("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: [
|
|
923
|
+
/* @__PURE__ */ t("rect", { x: "1", y: "1", width: "8", height: "12", rx: "1", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
924
|
+
/* @__PURE__ */ t("rect", { x: "10", y: "1", width: "3", height: "12", rx: "0.5", fill: "currentColor", opacity: "0.5" })
|
|
925
|
+
] }) : /* @__PURE__ */ c("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: [
|
|
926
|
+
/* @__PURE__ */ t("rect", { x: "1", y: "1", width: "8", height: "12", rx: "1", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
927
|
+
/* @__PURE__ */ t("rect", { x: "10", y: "1", width: "3", height: "12", rx: "0.5", fill: "currentColor" })
|
|
928
|
+
] })
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
/* @__PURE__ */ t(B, { variant: "ghost", size: "2xs", onClick: u, "aria-label": "Close", children: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ t("path", { d: "M2 2l10 10M12 2L2 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
|
|
932
|
+
] })
|
|
933
|
+
] }),
|
|
934
|
+
/* @__PURE__ */ t("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ t(
|
|
935
|
+
Re,
|
|
936
|
+
{
|
|
937
|
+
value: f,
|
|
938
|
+
onChange: (p) => d(p),
|
|
939
|
+
tabs: [
|
|
940
|
+
{ value: "design", label: "Design" },
|
|
941
|
+
{ value: "type", label: "Typography" },
|
|
942
|
+
{ value: "tokens", label: "Tokens" }
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
) }),
|
|
946
|
+
f === "tokens" && /* @__PURE__ */ c(ae, { children: [
|
|
947
|
+
/* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, children: /* @__PURE__ */ t(
|
|
948
|
+
"input",
|
|
949
|
+
{
|
|
950
|
+
type: "text",
|
|
951
|
+
placeholder: "Filter tokens...",
|
|
952
|
+
value: b,
|
|
953
|
+
onChange: (p) => v(p.target.value),
|
|
954
|
+
style: xt,
|
|
955
|
+
spellCheck: !1
|
|
956
|
+
}
|
|
957
|
+
) }),
|
|
958
|
+
/* @__PURE__ */ t("div", { style: N, children: V.map((p) => /* @__PURE__ */ t(
|
|
959
|
+
gt,
|
|
960
|
+
{
|
|
961
|
+
group: p,
|
|
962
|
+
state: e,
|
|
963
|
+
filter: a,
|
|
964
|
+
expanded: x[p.label] ?? !1,
|
|
965
|
+
onToggle: () => F(p.label)
|
|
966
|
+
},
|
|
967
|
+
p.label
|
|
968
|
+
)) })
|
|
969
|
+
] }),
|
|
970
|
+
f === "design" && /* @__PURE__ */ t("div", { style: N, children: /* @__PURE__ */ t(dt, { state: e, theme: n }) }),
|
|
971
|
+
f === "type" && /* @__PURE__ */ t("div", { style: N, children: /* @__PURE__ */ t(ft, { state: e, theme: n }) }),
|
|
972
|
+
/* @__PURE__ */ c("div", { style: wt, children: [
|
|
973
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", gap: 6, flex: 1 }, children: [
|
|
974
|
+
/* @__PURE__ */ t(B, { size: "xs", onClick: E, children: T ? "Copied!" : "Copy Config" }),
|
|
975
|
+
e.overrideCount > 0 && /* @__PURE__ */ t(B, { variant: "outline", size: "xs", onClick: e.resetAll, children: "Reset All" })
|
|
976
|
+
] }),
|
|
977
|
+
e.overrideCount > 0 && /* @__PURE__ */ c(De, { variant: "accent", size: "sm", children: [
|
|
978
|
+
e.overrideCount,
|
|
979
|
+
" override",
|
|
980
|
+
e.overrideCount !== 1 ? "s" : ""
|
|
981
|
+
] })
|
|
982
|
+
] })
|
|
983
|
+
] }) });
|
|
984
|
+
}
|
|
985
|
+
function gt({ group: e, state: n, filter: o, expanded: s, onToggle: i }) {
|
|
986
|
+
const r = e.subgroups ? e.subgroups.flatMap((d) => d.tokens) : e.tokens ?? [];
|
|
987
|
+
if (!(o === "" || r.some((d) => d.key.toLowerCase().includes(o)))) return null;
|
|
988
|
+
const f = s || o !== "";
|
|
989
|
+
return /* @__PURE__ */ c("div", { style: { borderBottom: `1px solid ${w.border}` }, children: [
|
|
990
|
+
/* @__PURE__ */ c("button", { onClick: i, style: St, children: [
|
|
991
|
+
/* @__PURE__ */ t(
|
|
992
|
+
"svg",
|
|
993
|
+
{
|
|
994
|
+
width: "10",
|
|
995
|
+
height: "10",
|
|
996
|
+
viewBox: "0 0 10 10",
|
|
997
|
+
style: { transform: f ? "rotate(90deg)" : "none", transition: "transform 150ms" },
|
|
998
|
+
children: /* @__PURE__ */ t("path", { d: "M3 1l4 4-4 4", stroke: w.textMuted, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" })
|
|
999
|
+
}
|
|
1000
|
+
),
|
|
1001
|
+
/* @__PURE__ */ t(h, { size: "xs", weight: "semibold", children: e.label }),
|
|
1002
|
+
/* @__PURE__ */ t(h, { size: "xs", color: "secondary", style: { marginLeft: "auto" }, children: r.length })
|
|
1003
|
+
] }),
|
|
1004
|
+
f && /* @__PURE__ */ t("div", { style: { padding: "0 12px 8px" }, children: e.subgroups ? e.subgroups.map((d) => {
|
|
1005
|
+
const b = o ? d.tokens.filter((v) => v.key.toLowerCase().includes(o)) : d.tokens;
|
|
1006
|
+
return b.length === 0 ? null : /* @__PURE__ */ c("div", { style: { marginBottom: 8 }, children: [
|
|
1007
|
+
/* @__PURE__ */ t("div", { style: kt, children: d.label }),
|
|
1008
|
+
b.map((v) => /* @__PURE__ */ t(oe, { meta: v, state: n }, v.key))
|
|
1009
|
+
] }, d.label);
|
|
1010
|
+
}) : (e.tokens ?? []).filter((d) => !o || d.key.toLowerCase().includes(o)).map((d) => /* @__PURE__ */ t(oe, { meta: d, state: n }, d.key)) })
|
|
1011
|
+
] });
|
|
1012
|
+
}
|
|
1013
|
+
function oe({ meta: e, state: n }) {
|
|
1014
|
+
const o = n.overrides[e.key] ?? n.tokens[e.key], s = e.key in n.overrides, i = (u) => n.setOverride(e.key, u), r = () => n.removeOverride(e.key);
|
|
1015
|
+
switch (e.controlType) {
|
|
1016
|
+
case "color":
|
|
1017
|
+
return /* @__PURE__ */ t(
|
|
1018
|
+
Ee,
|
|
1019
|
+
{
|
|
1020
|
+
label: e.key,
|
|
1021
|
+
value: o,
|
|
1022
|
+
isOverridden: s,
|
|
1023
|
+
onChange: i,
|
|
1024
|
+
onReset: r
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
case "slider":
|
|
1028
|
+
return /* @__PURE__ */ t(
|
|
1029
|
+
Ae,
|
|
1030
|
+
{
|
|
1031
|
+
label: e.key,
|
|
1032
|
+
value: o,
|
|
1033
|
+
isOverridden: s,
|
|
1034
|
+
min: e.sliderConfig.min,
|
|
1035
|
+
max: e.sliderConfig.max,
|
|
1036
|
+
step: e.sliderConfig.step,
|
|
1037
|
+
unit: e.sliderConfig.unit,
|
|
1038
|
+
onChange: i,
|
|
1039
|
+
onReset: r
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
case "text":
|
|
1043
|
+
return /* @__PURE__ */ t(
|
|
1044
|
+
$e,
|
|
1045
|
+
{
|
|
1046
|
+
label: e.key,
|
|
1047
|
+
value: o,
|
|
1048
|
+
isOverridden: s,
|
|
1049
|
+
onChange: i,
|
|
1050
|
+
onReset: r
|
|
1051
|
+
}
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
const bt = {
|
|
1056
|
+
position: "fixed",
|
|
1057
|
+
top: 0,
|
|
1058
|
+
bottom: 0,
|
|
1059
|
+
width: 320,
|
|
1060
|
+
background: "var(--lucent-bg-base)",
|
|
1061
|
+
color: "var(--lucent-text-primary)",
|
|
1062
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1063
|
+
fontSize: "var(--lucent-font-size-sm)",
|
|
1064
|
+
display: "flex",
|
|
1065
|
+
flexDirection: "column",
|
|
1066
|
+
zIndex: 99999,
|
|
1067
|
+
boxShadow: "-4px 0 24px rgba(0, 0, 0, 0.3)"
|
|
1068
|
+
}, vt = {
|
|
1069
|
+
display: "flex",
|
|
1070
|
+
alignItems: "center",
|
|
1071
|
+
justifyContent: "space-between",
|
|
1072
|
+
padding: "10px 12px",
|
|
1073
|
+
flexShrink: 0
|
|
1074
|
+
}, xt = {
|
|
1075
|
+
width: "100%",
|
|
1076
|
+
background: "var(--lucent-surface-secondary)",
|
|
1077
|
+
color: "var(--lucent-text-primary)",
|
|
1078
|
+
border: "1px solid var(--lucent-border-default)",
|
|
1079
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1080
|
+
padding: "6px 10px",
|
|
1081
|
+
fontSize: "var(--lucent-font-size-xs)",
|
|
1082
|
+
outline: "none",
|
|
1083
|
+
fontFamily: "inherit",
|
|
1084
|
+
boxSizing: "border-box"
|
|
1085
|
+
}, N = {
|
|
1086
|
+
flex: 1,
|
|
1087
|
+
overflowY: "auto",
|
|
1088
|
+
minHeight: 0
|
|
1089
|
+
}, St = {
|
|
1090
|
+
display: "flex",
|
|
1091
|
+
alignItems: "center",
|
|
1092
|
+
gap: 8,
|
|
1093
|
+
width: "100%",
|
|
1094
|
+
padding: "10px 12px",
|
|
1095
|
+
background: "none",
|
|
1096
|
+
border: "none",
|
|
1097
|
+
cursor: "pointer",
|
|
1098
|
+
color: "inherit",
|
|
1099
|
+
fontFamily: "inherit",
|
|
1100
|
+
textAlign: "left"
|
|
1101
|
+
}, kt = {
|
|
1102
|
+
fontSize: 10,
|
|
1103
|
+
fontWeight: 600,
|
|
1104
|
+
textTransform: "uppercase",
|
|
1105
|
+
letterSpacing: "0.05em",
|
|
1106
|
+
color: "var(--lucent-text-secondary)",
|
|
1107
|
+
marginBottom: 4,
|
|
1108
|
+
marginTop: 4
|
|
1109
|
+
}, wt = {
|
|
1110
|
+
display: "flex",
|
|
1111
|
+
alignItems: "center",
|
|
1112
|
+
gap: 8,
|
|
1113
|
+
padding: "10px 12px",
|
|
1114
|
+
borderTop: "1px solid var(--lucent-border-default)",
|
|
1115
|
+
flexShrink: 0
|
|
1116
|
+
};
|
|
1117
|
+
function Ct(e) {
|
|
1118
|
+
const n = e.toLowerCase().split("+");
|
|
1119
|
+
return {
|
|
1120
|
+
ctrl: n.includes("ctrl"),
|
|
1121
|
+
meta: n.includes("meta") || n.includes("cmd"),
|
|
1122
|
+
shift: n.includes("shift"),
|
|
1123
|
+
alt: n.includes("alt"),
|
|
1124
|
+
key: n[n.length - 1] ?? ""
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
function zt(e, n) {
|
|
1128
|
+
const o = navigator.platform.toUpperCase().includes("MAC");
|
|
1129
|
+
return (n.meta || n.ctrl ? o ? e.metaKey : e.ctrlKey : !e.ctrlKey && !e.metaKey) && n.shift === e.shiftKey && n.alt === e.altKey && e.key.toLowerCase() === n.key;
|
|
1130
|
+
}
|
|
1131
|
+
function Dt({
|
|
1132
|
+
shortcut: e = "meta+shift+d",
|
|
1133
|
+
position: n = "right",
|
|
1134
|
+
defaultOpen: o = !1,
|
|
1135
|
+
onThemeChange: s,
|
|
1136
|
+
zIndex: i = 99999
|
|
1137
|
+
}) {
|
|
1138
|
+
const [r, u] = C(o), [f, d] = C("overlay"), { theme: b } = le(), v = Oe(), x = D(() => u((T) => !T), []);
|
|
1139
|
+
return K(() => {
|
|
1140
|
+
if (!r || f !== "push") {
|
|
1141
|
+
document.body.style.removeProperty(`margin-${n}`), document.body.style.removeProperty("transition");
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
return document.body.style.transition = "margin 200ms ease", document.body.style[n === "right" ? "marginRight" : "marginLeft"] = "320px", () => {
|
|
1145
|
+
document.body.style.removeProperty(`margin-${n}`), document.body.style.removeProperty("transition");
|
|
1146
|
+
};
|
|
1147
|
+
}, [r, f, n]), K(() => {
|
|
1148
|
+
const T = Ct(e), M = (F) => {
|
|
1149
|
+
zt(F, T) && (F.preventDefault(), x());
|
|
1150
|
+
};
|
|
1151
|
+
return document.addEventListener("keydown", M), () => document.removeEventListener("keydown", M);
|
|
1152
|
+
}, [e, x]), ue(
|
|
1153
|
+
/* @__PURE__ */ c(ae, { children: [
|
|
1154
|
+
!r && /* @__PURE__ */ t("button", { onClick: x, style: { ...Bt, [n]: 16, zIndex: i }, title: "Open Lucent DevTools", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 60 60", fill: "none", children: [
|
|
1155
|
+
/* @__PURE__ */ t("rect", { x: "8", y: "8", width: "18", height: "22", rx: "2", fill: "#e9c96b", opacity: "0.92" }),
|
|
1156
|
+
/* @__PURE__ */ t("rect", { x: "8", y: "40", width: "44", height: "12", rx: "2", fill: "#e9c96b", opacity: "0.92" }),
|
|
1157
|
+
/* @__PURE__ */ t("rect", { x: "36", y: "8", width: "16", height: "28", rx: "2", fill: "#e9c96b", opacity: "0.08" })
|
|
1158
|
+
] }) }),
|
|
1159
|
+
r && /* @__PURE__ */ t("div", { style: { zIndex: i }, children: /* @__PURE__ */ t(
|
|
1160
|
+
mt,
|
|
1161
|
+
{
|
|
1162
|
+
state: v,
|
|
1163
|
+
theme: b,
|
|
1164
|
+
position: n,
|
|
1165
|
+
mode: f,
|
|
1166
|
+
onModeChange: d,
|
|
1167
|
+
...s !== void 0 && { onThemeChange: s },
|
|
1168
|
+
onClose: x
|
|
1169
|
+
}
|
|
1170
|
+
) })
|
|
1171
|
+
] }),
|
|
1172
|
+
document.body
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
const Bt = {
|
|
1176
|
+
position: "fixed",
|
|
1177
|
+
bottom: 16,
|
|
1178
|
+
width: 40,
|
|
1179
|
+
height: 40,
|
|
1180
|
+
borderRadius: "50%",
|
|
1181
|
+
background: w.bg,
|
|
1182
|
+
border: `1px solid ${w.border}`,
|
|
1183
|
+
cursor: "pointer",
|
|
1184
|
+
display: "flex",
|
|
1185
|
+
alignItems: "center",
|
|
1186
|
+
justifyContent: "center",
|
|
1187
|
+
boxShadow: "0 2px 12px rgba(0, 0, 0, 0.4)",
|
|
1188
|
+
transition: "transform 150ms ease, box-shadow 150ms ease"
|
|
1189
|
+
};
|
|
1190
|
+
export {
|
|
1191
|
+
Dt as LucentDevTools
|
|
1192
|
+
};
|