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