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
|
@@ -0,0 +1,2949 @@
|
|
|
1
|
+
import { jsxs as I, jsx as p, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as xe, useState as C, useRef as U, useEffect as ne, useLayoutEffect as me, useId as Ve, useCallback as ue, useContext as vt, createContext as yt } from "react";
|
|
3
|
+
import { createPortal as wt } from "react-dom";
|
|
4
|
+
const kt = {
|
|
5
|
+
primary: {
|
|
6
|
+
background: "var(--lucent-accent-default)",
|
|
7
|
+
color: "var(--lucent-accent-fg)",
|
|
8
|
+
border: "1px solid transparent"
|
|
9
|
+
},
|
|
10
|
+
secondary: {
|
|
11
|
+
background: "color-mix(in srgb, var(--lucent-accent-default) 16%, transparent)",
|
|
12
|
+
color: "var(--lucent-text-primary)",
|
|
13
|
+
border: "1px solid transparent"
|
|
14
|
+
},
|
|
15
|
+
outline: {
|
|
16
|
+
background: "transparent",
|
|
17
|
+
color: "var(--lucent-text-primary)",
|
|
18
|
+
border: "1px solid color-mix(in srgb, var(--lucent-accent-default) 35%, var(--lucent-border-default))"
|
|
19
|
+
},
|
|
20
|
+
ghost: {
|
|
21
|
+
background: "transparent",
|
|
22
|
+
color: "var(--lucent-text-primary)",
|
|
23
|
+
border: "1px solid transparent"
|
|
24
|
+
},
|
|
25
|
+
danger: {
|
|
26
|
+
background: "var(--lucent-danger-default)",
|
|
27
|
+
color: "#ffffff",
|
|
28
|
+
border: "1px solid var(--lucent-danger-default)"
|
|
29
|
+
},
|
|
30
|
+
"danger-outline": {
|
|
31
|
+
background: "transparent",
|
|
32
|
+
color: "var(--lucent-danger-text)",
|
|
33
|
+
border: "1px solid var(--lucent-danger-default)"
|
|
34
|
+
},
|
|
35
|
+
"danger-ghost": {
|
|
36
|
+
background: "transparent",
|
|
37
|
+
color: "var(--lucent-danger-text)",
|
|
38
|
+
border: "1px solid transparent"
|
|
39
|
+
}
|
|
40
|
+
}, Dt = {
|
|
41
|
+
"2xs": { height: "22px", padding: "0 var(--lucent-space-2)", fontSize: "var(--lucent-font-size-xs)", borderRadius: "var(--lucent-radius-md)" },
|
|
42
|
+
xs: { height: "26px", padding: "0 var(--lucent-space-3)", fontSize: "var(--lucent-font-size-xs)" },
|
|
43
|
+
sm: { height: "calc(var(--lucent-space-8) * 0.5 + 18px)", padding: "0 var(--lucent-space-4)", fontSize: "var(--lucent-font-size-sm)" },
|
|
44
|
+
md: { height: "calc(var(--lucent-space-10) * 0.5 + 22px)", padding: "0 var(--lucent-space-5)", fontSize: "var(--lucent-font-size-md)" },
|
|
45
|
+
lg: { height: "calc(var(--lucent-space-12) * 0.5 + 26px)", padding: "0 var(--lucent-space-6)", fontSize: "var(--lucent-font-size-lg)" }
|
|
46
|
+
}, Ke = xe(
|
|
47
|
+
({ variant: e = "primary", size: t = "md", loading: s = !1, fullWidth: a = !1, spread: n = !1, leftIcon: r, rightIcon: o, chevron: c = !1, disableHoverStyles: u = !1, bordered: i = !0, children: d, disabled: g, style: h, ...f }, w) => {
|
|
48
|
+
const S = g ?? s, k = !d && !s && (!!r || !!o);
|
|
49
|
+
return /* @__PURE__ */ I(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
ref: w,
|
|
53
|
+
disabled: S,
|
|
54
|
+
"aria-busy": s,
|
|
55
|
+
style: {
|
|
56
|
+
display: "inline-flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: n ? "space-between" : "center",
|
|
59
|
+
gap: "var(--lucent-space-2)",
|
|
60
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
61
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
62
|
+
lineHeight: 1,
|
|
63
|
+
letterSpacing: "0.01em",
|
|
64
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
65
|
+
cursor: S ? "not-allowed" : "pointer",
|
|
66
|
+
width: a ? "100%" : void 0,
|
|
67
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default), border-color var(--lucent-duration-fast) var(--lucent-easing-default), box-shadow var(--lucent-duration-fast) var(--lucent-easing-default), transform 80ms var(--lucent-easing-default)",
|
|
68
|
+
whiteSpace: "nowrap",
|
|
69
|
+
boxSizing: "border-box",
|
|
70
|
+
outline: "none",
|
|
71
|
+
margin: 0,
|
|
72
|
+
...Dt[t],
|
|
73
|
+
...k && { padding: 0, aspectRatio: "1" },
|
|
74
|
+
...kt[e],
|
|
75
|
+
...h,
|
|
76
|
+
...S && {
|
|
77
|
+
background: "color-mix(in srgb, var(--lucent-text-primary) 6%, transparent)",
|
|
78
|
+
color: "var(--lucent-text-disabled)",
|
|
79
|
+
borderColor: "transparent"
|
|
80
|
+
},
|
|
81
|
+
// hide border entirely when bordered prop is false
|
|
82
|
+
...i === !1 && { border: "none" }
|
|
83
|
+
},
|
|
84
|
+
onMouseEnter: (v) => {
|
|
85
|
+
var b;
|
|
86
|
+
!S && !u && Mt(v.currentTarget, e, i), (b = f.onMouseEnter) == null || b.call(f, v);
|
|
87
|
+
},
|
|
88
|
+
onMouseLeave: (v) => {
|
|
89
|
+
var b;
|
|
90
|
+
!S && !u && zt(v.currentTarget, e, i), (b = f.onMouseLeave) == null || b.call(f, v);
|
|
91
|
+
},
|
|
92
|
+
onMouseDown: (v) => {
|
|
93
|
+
var b;
|
|
94
|
+
if (!S) {
|
|
95
|
+
const D = e === "danger" || e === "danger-outline" || e === "danger-ghost" ? "color-mix(in srgb, var(--lucent-danger-default) 40%, transparent)" : "color-mix(in srgb, var(--lucent-accent-default) 40%, transparent)";
|
|
96
|
+
v.currentTarget.style.transform = "translateY(1px)", v.currentTarget.style.boxShadow = `0 0 0 4px ${D}`, v.currentTarget.dataset.pressed = "1";
|
|
97
|
+
}
|
|
98
|
+
(b = f.onMouseDown) == null || b.call(f, v);
|
|
99
|
+
},
|
|
100
|
+
onMouseUp: (v) => {
|
|
101
|
+
var b;
|
|
102
|
+
v.currentTarget.style.transform = "", v.currentTarget.style.boxShadow = "", delete v.currentTarget.dataset.pressed, (b = f.onMouseUp) == null || b.call(f, v);
|
|
103
|
+
},
|
|
104
|
+
onFocus: (v) => {
|
|
105
|
+
var b;
|
|
106
|
+
v.currentTarget.dataset.pressed || (v.currentTarget.style.boxShadow = "0 0 0 3px var(--lucent-accent-subtle)"), (b = f.onFocus) == null || b.call(f, v);
|
|
107
|
+
},
|
|
108
|
+
onBlur: (v) => {
|
|
109
|
+
var b;
|
|
110
|
+
v.currentTarget.style.boxShadow = "", (b = f.onBlur) == null || b.call(f, v);
|
|
111
|
+
},
|
|
112
|
+
...f,
|
|
113
|
+
children: [
|
|
114
|
+
r,
|
|
115
|
+
s ? /* @__PURE__ */ p(Bt, {}) : d,
|
|
116
|
+
!s && o,
|
|
117
|
+
!s && c && /* @__PURE__ */ p(It, { size: t })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
Ke.displayName = "Button";
|
|
124
|
+
const St = {
|
|
125
|
+
primary: "0 4px 14px -2px color-mix(in srgb, var(--lucent-accent-default) 25%, transparent)",
|
|
126
|
+
secondary: "0 4px 14px -2px color-mix(in srgb, var(--lucent-accent-default) 20%, transparent)",
|
|
127
|
+
outline: "0 4px 14px -2px color-mix(in srgb, var(--lucent-accent-default) 20%, transparent)",
|
|
128
|
+
ghost: "0 4px 14px -2px color-mix(in srgb, var(--lucent-accent-default) 15%, transparent)",
|
|
129
|
+
danger: "0 4px 14px -2px color-mix(in srgb, var(--lucent-danger-default) 25%, transparent)",
|
|
130
|
+
"danger-outline": "0 4px 14px -2px color-mix(in srgb, var(--lucent-danger-default) 20%, transparent)",
|
|
131
|
+
"danger-ghost": "0 4px 14px -2px color-mix(in srgb, var(--lucent-danger-default) 15%, transparent)"
|
|
132
|
+
};
|
|
133
|
+
function Mt(e, t, s) {
|
|
134
|
+
e.style.transform = "translateY(-1px)", e.style.boxShadow = St[t], t === "primary" ? e.style.background = "var(--lucent-accent-hover)" : t === "secondary" ? e.style.background = "color-mix(in srgb, var(--lucent-accent-default) 22%, transparent)" : t === "outline" ? e.style.background = "color-mix(in srgb, var(--lucent-accent-default) 10%, transparent)" : t === "ghost" ? e.style.background = "color-mix(in srgb, var(--lucent-accent-default) 8%, transparent)" : t === "danger" ? (e.style.background = "var(--lucent-danger-hover)", s !== !1 && (e.style.borderColor = "var(--lucent-danger-hover)")) : t === "danger-outline" ? (e.style.background = "color-mix(in srgb, var(--lucent-danger-default) 10%, var(--lucent-surface))", s !== !1 && (e.style.borderColor = "var(--lucent-danger-hover)")) : t === "danger-ghost" && (e.style.background = "color-mix(in srgb, var(--lucent-danger-default) 8%, var(--lucent-surface))");
|
|
135
|
+
}
|
|
136
|
+
function zt(e, t, s) {
|
|
137
|
+
e.style.transform = "", e.style.boxShadow = "", t === "primary" ? e.style.background = "var(--lucent-accent-default)" : t === "secondary" ? e.style.background = "color-mix(in srgb, var(--lucent-accent-default) 16%, transparent)" : t === "outline" || t === "ghost" ? e.style.background = "transparent" : t === "danger" ? (e.style.background = "var(--lucent-danger-default)", s !== !1 && (e.style.borderColor = "var(--lucent-danger-default)")) : t === "danger-outline" ? (e.style.background = "transparent", s !== !1 && (e.style.borderColor = "var(--lucent-danger-default)")) : t === "danger-ghost" && (e.style.background = "transparent");
|
|
138
|
+
}
|
|
139
|
+
const Tt = { "2xs": 8, xs: 10, sm: 12, md: 14, lg: 16 };
|
|
140
|
+
function It({ size: e }) {
|
|
141
|
+
const t = Tt[e];
|
|
142
|
+
return /* @__PURE__ */ p("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, style: { flexShrink: 0, marginLeft: -2 }, children: /* @__PURE__ */ p("polyline", { points: "6 9 12 15 18 9" }) });
|
|
143
|
+
}
|
|
144
|
+
function Bt() {
|
|
145
|
+
return /* @__PURE__ */ I("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", "aria-hidden": !0, style: { animation: "lucent-spin 0.7s linear infinite", flexShrink: 0 }, children: [
|
|
146
|
+
/* @__PURE__ */ p("style", { children: "@keyframes lucent-spin { to { transform: rotate(360deg); } }" }),
|
|
147
|
+
/* @__PURE__ */ p("path", { d: "M12 2a10 10 0 0 1 10 10" })
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
const $t = {
|
|
151
|
+
sm: "calc(var(--lucent-space-8) * 0.5 + 16px)",
|
|
152
|
+
md: "calc(var(--lucent-space-10) * 0.5 + 20px)",
|
|
153
|
+
lg: "calc(var(--lucent-space-12) * 0.5 + 24px)"
|
|
154
|
+
}, Pe = {
|
|
155
|
+
sm: "var(--lucent-font-size-sm)",
|
|
156
|
+
md: "var(--lucent-font-size-md)",
|
|
157
|
+
lg: "var(--lucent-font-size-md)"
|
|
158
|
+
}, Me = {
|
|
159
|
+
sm: "var(--lucent-font-size-sm)",
|
|
160
|
+
md: "var(--lucent-font-size-sm)",
|
|
161
|
+
lg: "var(--lucent-font-size-md)"
|
|
162
|
+
}, ee = {
|
|
163
|
+
sm: "var(--lucent-space-3)",
|
|
164
|
+
md: "var(--lucent-space-4)",
|
|
165
|
+
lg: "var(--lucent-space-4)"
|
|
166
|
+
}, We = {
|
|
167
|
+
sm: "calc(var(--lucent-space-3) + 14px + var(--lucent-space-2))",
|
|
168
|
+
md: "calc(var(--lucent-space-4) + 18px + var(--lucent-space-2))",
|
|
169
|
+
lg: "calc(var(--lucent-space-4) + 20px + var(--lucent-space-3))"
|
|
170
|
+
}, te = xe(
|
|
171
|
+
({
|
|
172
|
+
size: e = "md",
|
|
173
|
+
label: t,
|
|
174
|
+
helperText: s,
|
|
175
|
+
errorText: a,
|
|
176
|
+
leftElement: n,
|
|
177
|
+
rightElement: r,
|
|
178
|
+
prefix: o,
|
|
179
|
+
suffix: c,
|
|
180
|
+
id: u,
|
|
181
|
+
style: i,
|
|
182
|
+
...d
|
|
183
|
+
}, g) => {
|
|
184
|
+
const h = u ?? `lucent-input-${Math.random().toString(36).slice(2, 7)}`, f = !!a, w = !!d.disabled, [S, k] = C(!1), [v, b] = C(!1), m = w ? "transparent" : f ? "var(--lucent-danger-default)" : S ? "var(--lucent-accent-border)" : v ? "var(--lucent-border-strong)" : "var(--lucent-border-default)", D = S ? `0 0 0 3px ${f ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}` : "none", L = {
|
|
185
|
+
display: "flex",
|
|
186
|
+
alignItems: "center",
|
|
187
|
+
color: w ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
188
|
+
fontSize: Pe[e],
|
|
189
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
190
|
+
whiteSpace: "nowrap",
|
|
191
|
+
userSelect: "none",
|
|
192
|
+
flexShrink: 0
|
|
193
|
+
}, X = { ...L, paddingLeft: ee[e], paddingRight: "2px" }, O = { ...L, paddingLeft: "2px", paddingRight: ee[e] };
|
|
194
|
+
return /* @__PURE__ */ I("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-1)", width: "100%", ...i }, children: [
|
|
195
|
+
t && /* @__PURE__ */ p(
|
|
196
|
+
"label",
|
|
197
|
+
{
|
|
198
|
+
htmlFor: h,
|
|
199
|
+
style: {
|
|
200
|
+
fontSize: Me[e],
|
|
201
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
202
|
+
color: w ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
203
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
204
|
+
},
|
|
205
|
+
children: t
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ I(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
style: {
|
|
212
|
+
display: "flex",
|
|
213
|
+
alignItems: "stretch",
|
|
214
|
+
height: $t[e],
|
|
215
|
+
border: `1px solid ${m}`,
|
|
216
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
217
|
+
boxShadow: D,
|
|
218
|
+
background: w ? "color-mix(in srgb, var(--lucent-text-primary) 6%, transparent)" : "var(--lucent-surface)",
|
|
219
|
+
overflow: "hidden",
|
|
220
|
+
cursor: w ? "not-allowed" : void 0,
|
|
221
|
+
transition: [
|
|
222
|
+
"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
223
|
+
"box-shadow var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
224
|
+
].join(", ")
|
|
225
|
+
},
|
|
226
|
+
onMouseEnter: () => {
|
|
227
|
+
w || b(!0);
|
|
228
|
+
},
|
|
229
|
+
onMouseLeave: () => b(!1),
|
|
230
|
+
children: [
|
|
231
|
+
o && /* @__PURE__ */ p("span", { style: X, children: o }),
|
|
232
|
+
/* @__PURE__ */ I("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center", minWidth: 0 }, children: [
|
|
233
|
+
n && /* @__PURE__ */ p("span", { style: {
|
|
234
|
+
position: "absolute",
|
|
235
|
+
left: ee[e],
|
|
236
|
+
color: w ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
237
|
+
display: "flex",
|
|
238
|
+
alignItems: "center",
|
|
239
|
+
pointerEvents: "none"
|
|
240
|
+
}, children: n }),
|
|
241
|
+
/* @__PURE__ */ p(
|
|
242
|
+
"input",
|
|
243
|
+
{
|
|
244
|
+
ref: g,
|
|
245
|
+
id: h,
|
|
246
|
+
"aria-invalid": f,
|
|
247
|
+
"aria-describedby": f ? `${h}-error` : s ? `${h}-helper` : void 0,
|
|
248
|
+
style: {
|
|
249
|
+
width: "100%",
|
|
250
|
+
height: "100%",
|
|
251
|
+
paddingLeft: n ? We[e] : ee[e],
|
|
252
|
+
paddingRight: r ? We[e] : ee[e],
|
|
253
|
+
fontSize: Pe[e],
|
|
254
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
255
|
+
color: w ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
256
|
+
background: "transparent",
|
|
257
|
+
border: "none",
|
|
258
|
+
outline: "none",
|
|
259
|
+
cursor: w ? "not-allowed" : void 0,
|
|
260
|
+
boxSizing: "border-box"
|
|
261
|
+
},
|
|
262
|
+
...d,
|
|
263
|
+
onFocus: (A) => {
|
|
264
|
+
var N;
|
|
265
|
+
k(!0), (N = d.onFocus) == null || N.call(d, A);
|
|
266
|
+
},
|
|
267
|
+
onBlur: (A) => {
|
|
268
|
+
var N;
|
|
269
|
+
k(!1), (N = d.onBlur) == null || N.call(d, A);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
r && /* @__PURE__ */ p("span", { style: {
|
|
274
|
+
position: "absolute",
|
|
275
|
+
right: ee[e],
|
|
276
|
+
color: w ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
277
|
+
display: "flex",
|
|
278
|
+
alignItems: "center"
|
|
279
|
+
}, children: r })
|
|
280
|
+
] }),
|
|
281
|
+
c && /* @__PURE__ */ p("span", { style: O, children: c })
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
f && /* @__PURE__ */ p(
|
|
286
|
+
"span",
|
|
287
|
+
{
|
|
288
|
+
id: `${h}-error`,
|
|
289
|
+
role: "alert",
|
|
290
|
+
style: {
|
|
291
|
+
fontSize: Me[e],
|
|
292
|
+
color: "var(--lucent-danger-text)",
|
|
293
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
294
|
+
},
|
|
295
|
+
children: a
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
!f && s && /* @__PURE__ */ p(
|
|
299
|
+
"span",
|
|
300
|
+
{
|
|
301
|
+
id: `${h}-helper`,
|
|
302
|
+
style: {
|
|
303
|
+
fontSize: Me[e],
|
|
304
|
+
color: "var(--lucent-text-secondary)",
|
|
305
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
306
|
+
},
|
|
307
|
+
children: s
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] });
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
te.displayName = "Input";
|
|
314
|
+
const Rt = {
|
|
315
|
+
neutral: { bg: "var(--lucent-surface-secondary)", color: "var(--lucent-text-secondary)", border: "var(--lucent-border-default)" },
|
|
316
|
+
accent: { bg: "var(--lucent-accent-default)", color: "var(--lucent-accent-fg)", border: "var(--lucent-accent-default)" },
|
|
317
|
+
success: { bg: "var(--lucent-success-subtle)", color: "var(--lucent-success-text)", border: "var(--lucent-success-subtle)" },
|
|
318
|
+
warning: { bg: "var(--lucent-warning-subtle)", color: "var(--lucent-warning-text)", border: "var(--lucent-warning-subtle)" },
|
|
319
|
+
danger: { bg: "var(--lucent-danger-subtle)", color: "var(--lucent-danger-text)", border: "var(--lucent-danger-subtle)" },
|
|
320
|
+
info: { bg: "var(--lucent-info-subtle)", color: "var(--lucent-info-text)", border: "var(--lucent-info-subtle)" }
|
|
321
|
+
}, Lt = {
|
|
322
|
+
sm: { fontSize: "var(--lucent-font-size-xs)", padding: "0 var(--lucent-space-2)", height: "18px" },
|
|
323
|
+
md: { fontSize: "var(--lucent-font-size-sm)", padding: "0 var(--lucent-space-2)", height: "22px" }
|
|
324
|
+
};
|
|
325
|
+
function on({ variant: e = "neutral", size: t = "md", dot: s = !1, children: a, style: n }) {
|
|
326
|
+
const r = Rt[e], o = Lt[t];
|
|
327
|
+
return /* @__PURE__ */ I("span", { style: {
|
|
328
|
+
display: "inline-flex",
|
|
329
|
+
alignItems: "center",
|
|
330
|
+
gap: "var(--lucent-space-1)",
|
|
331
|
+
height: o.height,
|
|
332
|
+
padding: o.padding,
|
|
333
|
+
fontSize: o.fontSize,
|
|
334
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
335
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
336
|
+
lineHeight: 1,
|
|
337
|
+
borderRadius: "var(--lucent-radius-full)",
|
|
338
|
+
background: r.bg,
|
|
339
|
+
color: r.color,
|
|
340
|
+
border: `1px solid ${r.border}`,
|
|
341
|
+
whiteSpace: "nowrap",
|
|
342
|
+
boxSizing: "border-box",
|
|
343
|
+
...n
|
|
344
|
+
}, children: [
|
|
345
|
+
s && /* @__PURE__ */ p("span", { style: {
|
|
346
|
+
width: 6,
|
|
347
|
+
height: 6,
|
|
348
|
+
borderRadius: "var(--lucent-radius-full)",
|
|
349
|
+
background: "currentColor",
|
|
350
|
+
flexShrink: 0
|
|
351
|
+
} }),
|
|
352
|
+
a
|
|
353
|
+
] });
|
|
354
|
+
}
|
|
355
|
+
const Ct = { sm: "calc(var(--lucent-space-8) * 0.5 + 16px)", md: "calc(var(--lucent-space-10) * 0.5 + 20px)", lg: "calc(var(--lucent-space-12) * 0.5 + 24px)" }, Ft = {
|
|
356
|
+
sm: { track: [28, 16], thumb: 12 },
|
|
357
|
+
md: { track: [36, 20], thumb: 16 },
|
|
358
|
+
lg: { track: [44, 24], thumb: 20 }
|
|
359
|
+
}, He = "cubic-bezier(0.34, 1.56, 0.64, 1)", Pt = `
|
|
360
|
+
@keyframes lucent-toggle-pop {
|
|
361
|
+
0% { transform: scale(1); }
|
|
362
|
+
35% { transform: scale(0.94); }
|
|
363
|
+
70% { transform: scale(1.06); }
|
|
364
|
+
100% { transform: scale(1); }
|
|
365
|
+
}
|
|
366
|
+
`;
|
|
367
|
+
function ln({
|
|
368
|
+
label: e,
|
|
369
|
+
size: t = "md",
|
|
370
|
+
checked: s,
|
|
371
|
+
defaultChecked: a,
|
|
372
|
+
contained: n = !1,
|
|
373
|
+
helperText: r,
|
|
374
|
+
align: o = "left",
|
|
375
|
+
disabled: c,
|
|
376
|
+
id: u,
|
|
377
|
+
onChange: i,
|
|
378
|
+
style: d,
|
|
379
|
+
...g
|
|
380
|
+
}) {
|
|
381
|
+
const h = u ?? `lucent-toggle-${Math.random().toString(36).slice(2, 7)}`, f = s !== void 0, [w, S] = C(a ?? !1), k = f ? !!s : w, v = U(k), [b, m] = C(0), [D, L] = C(!1);
|
|
382
|
+
ne(() => {
|
|
383
|
+
if (!c && v.current !== k) {
|
|
384
|
+
v.current = k, m((G) => G + 1), L(!0);
|
|
385
|
+
const E = setTimeout(() => L(!1), 150);
|
|
386
|
+
return () => clearTimeout(E);
|
|
387
|
+
}
|
|
388
|
+
}, [k, c]);
|
|
389
|
+
const { track: [X, O], thumb: A } = Ft[t], N = k ? X - A - 2 : 2, Z = (E) => {
|
|
390
|
+
f || S(E.target.checked), i == null || i(E);
|
|
391
|
+
}, K = /* @__PURE__ */ I(
|
|
392
|
+
"span",
|
|
393
|
+
{
|
|
394
|
+
"aria-hidden": !0,
|
|
395
|
+
style: {
|
|
396
|
+
position: "relative",
|
|
397
|
+
width: X,
|
|
398
|
+
height: O,
|
|
399
|
+
borderRadius: O / 2,
|
|
400
|
+
flexShrink: 0
|
|
401
|
+
},
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ p(
|
|
404
|
+
"span",
|
|
405
|
+
{
|
|
406
|
+
style: {
|
|
407
|
+
position: "absolute",
|
|
408
|
+
inset: 0,
|
|
409
|
+
borderRadius: "inherit",
|
|
410
|
+
background: c ? "var(--lucent-surface-secondary)" : k ? "var(--lucent-accent-default)" : "color-mix(in srgb, var(--lucent-text-primary) 12%, transparent)",
|
|
411
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
412
|
+
animation: b > 0 ? `lucent-toggle-pop 240ms ${He} forwards` : void 0
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
b
|
|
416
|
+
),
|
|
417
|
+
/* @__PURE__ */ p(
|
|
418
|
+
"span",
|
|
419
|
+
{
|
|
420
|
+
style: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
top: 2,
|
|
423
|
+
left: N,
|
|
424
|
+
width: D ? A * 1.3 : A,
|
|
425
|
+
height: A,
|
|
426
|
+
borderRadius: A,
|
|
427
|
+
background: "#ffffff",
|
|
428
|
+
boxShadow: "0 1px 3px rgb(0 0 0 / 0.2)",
|
|
429
|
+
transition: `left 260ms ${He}, width 200ms cubic-bezier(0.22, 1, 0.36, 1)`
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
), $ = /* @__PURE__ */ I(
|
|
436
|
+
"label",
|
|
437
|
+
{
|
|
438
|
+
style: {
|
|
439
|
+
display: o === "right" ? "flex" : "inline-flex",
|
|
440
|
+
alignItems: r ? "flex-start" : "center",
|
|
441
|
+
gap: "var(--lucent-space-2)",
|
|
442
|
+
...o === "right" ? { width: "100%" } : {},
|
|
443
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
444
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
445
|
+
fontSize: t === "sm" ? "var(--lucent-font-size-sm)" : "var(--lucent-font-size-md)",
|
|
446
|
+
color: c ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
447
|
+
userSelect: "none",
|
|
448
|
+
...n ? {} : d
|
|
449
|
+
},
|
|
450
|
+
children: [
|
|
451
|
+
/* @__PURE__ */ p(
|
|
452
|
+
"input",
|
|
453
|
+
{
|
|
454
|
+
type: "checkbox",
|
|
455
|
+
role: "switch",
|
|
456
|
+
id: h,
|
|
457
|
+
checked: f ? s : w,
|
|
458
|
+
disabled: c,
|
|
459
|
+
onChange: Z,
|
|
460
|
+
"aria-checked": k,
|
|
461
|
+
style: { position: "absolute", opacity: 0, width: 0, height: 0, margin: 0, pointerEvents: "none" },
|
|
462
|
+
...g
|
|
463
|
+
}
|
|
464
|
+
),
|
|
465
|
+
o === "left" && K,
|
|
466
|
+
e || r ? /* @__PURE__ */ I("span", { style: { display: "flex", flexDirection: "column", flex: o === "right" ? 1 : void 0 }, children: [
|
|
467
|
+
e && /* @__PURE__ */ p("span", { style: {
|
|
468
|
+
fontWeight: r ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
469
|
+
lineHeight: r ? 1.3 : 1
|
|
470
|
+
}, children: e }),
|
|
471
|
+
r && /* @__PURE__ */ p("span", { style: {
|
|
472
|
+
fontSize: "var(--lucent-font-size-xs)",
|
|
473
|
+
color: c ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
474
|
+
marginTop: "2px"
|
|
475
|
+
}, children: r })
|
|
476
|
+
] }) : null,
|
|
477
|
+
o === "right" && K
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
return /* @__PURE__ */ I(_e, { children: [
|
|
482
|
+
/* @__PURE__ */ p("style", { children: Pt }),
|
|
483
|
+
n ? /* @__PURE__ */ p(
|
|
484
|
+
"div",
|
|
485
|
+
{
|
|
486
|
+
style: {
|
|
487
|
+
border: "1px solid var(--lucent-border-strong)",
|
|
488
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
489
|
+
...r ? { padding: "var(--lucent-space-3)" } : { minHeight: Ct[t], padding: "0 var(--lucent-space-3)", display: "flex", alignItems: "center" },
|
|
490
|
+
background: k && !c ? "color-mix(in srgb, var(--lucent-text-primary) 6%, transparent)" : "transparent",
|
|
491
|
+
transition: "border-color var(--lucent-duration-fast) var(--lucent-easing-default), background var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
492
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
493
|
+
...d
|
|
494
|
+
},
|
|
495
|
+
onClick: (E) => {
|
|
496
|
+
if (!c && E.target === E.currentTarget) {
|
|
497
|
+
const G = E.currentTarget.querySelector("input");
|
|
498
|
+
G == null || G.click();
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
children: $
|
|
502
|
+
}
|
|
503
|
+
) : $
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
const Wt = {
|
|
507
|
+
sm: "calc(var(--lucent-space-8) * 0.5 + 16px)",
|
|
508
|
+
md: "calc(var(--lucent-space-10) * 0.5 + 20px)",
|
|
509
|
+
lg: "calc(var(--lucent-space-12) * 0.5 + 24px)"
|
|
510
|
+
}, Ht = {
|
|
511
|
+
sm: "var(--lucent-font-size-sm)",
|
|
512
|
+
md: "var(--lucent-font-size-md)",
|
|
513
|
+
lg: "var(--lucent-font-size-md)"
|
|
514
|
+
}, ze = {
|
|
515
|
+
sm: "var(--lucent-font-size-sm)",
|
|
516
|
+
md: "var(--lucent-font-size-sm)",
|
|
517
|
+
lg: "var(--lucent-font-size-md)"
|
|
518
|
+
}, Ne = {
|
|
519
|
+
sm: "var(--lucent-space-2)",
|
|
520
|
+
md: "var(--lucent-space-3)",
|
|
521
|
+
lg: "var(--lucent-space-3)"
|
|
522
|
+
}, Ye = xe(
|
|
523
|
+
({ options: e, size: t = "md", label: s, helperText: a, errorText: n, placeholder: r, disabled: o, id: c, style: u, ...i }, d) => {
|
|
524
|
+
const g = c ?? `lucent-select-${Math.random().toString(36).slice(2, 7)}`, h = !!n, f = !!o, [w, S] = C(!1), [k, v] = C(!1), b = f ? "transparent" : h ? "var(--lucent-danger-default)" : w ? "var(--lucent-accent-border)" : k ? "var(--lucent-border-strong)" : "var(--lucent-border-default)", m = w ? `0 0 0 3px ${h ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}` : "none";
|
|
525
|
+
return /* @__PURE__ */ I("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-1)", width: "100%", ...u }, children: [
|
|
526
|
+
s && /* @__PURE__ */ p(
|
|
527
|
+
"label",
|
|
528
|
+
{
|
|
529
|
+
htmlFor: g,
|
|
530
|
+
style: {
|
|
531
|
+
fontSize: ze[t],
|
|
532
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
533
|
+
color: f ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
534
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
535
|
+
},
|
|
536
|
+
children: s
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ I(
|
|
540
|
+
"div",
|
|
541
|
+
{
|
|
542
|
+
style: {
|
|
543
|
+
position: "relative",
|
|
544
|
+
display: "flex",
|
|
545
|
+
alignItems: "center",
|
|
546
|
+
height: Wt[t],
|
|
547
|
+
border: `1px solid ${b}`,
|
|
548
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
549
|
+
boxShadow: m,
|
|
550
|
+
background: f ? "color-mix(in srgb, var(--lucent-text-primary) 6%, transparent)" : "var(--lucent-surface)",
|
|
551
|
+
cursor: f ? "not-allowed" : "pointer",
|
|
552
|
+
transition: [
|
|
553
|
+
"border-color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
554
|
+
"box-shadow var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
555
|
+
].join(", ")
|
|
556
|
+
},
|
|
557
|
+
onMouseEnter: () => {
|
|
558
|
+
f || v(!0);
|
|
559
|
+
},
|
|
560
|
+
onMouseLeave: () => v(!1),
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ I(
|
|
563
|
+
"select",
|
|
564
|
+
{
|
|
565
|
+
ref: d,
|
|
566
|
+
id: g,
|
|
567
|
+
disabled: o,
|
|
568
|
+
"aria-invalid": h,
|
|
569
|
+
"aria-describedby": h ? `${g}-error` : a ? `${g}-helper` : void 0,
|
|
570
|
+
style: {
|
|
571
|
+
width: "100%",
|
|
572
|
+
height: "100%",
|
|
573
|
+
padding: `0 var(--lucent-space-8) 0 ${Ne[t]}`,
|
|
574
|
+
fontSize: Ht[t],
|
|
575
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
576
|
+
color: f ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
577
|
+
background: "transparent",
|
|
578
|
+
border: "none",
|
|
579
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
580
|
+
outline: "none",
|
|
581
|
+
appearance: "none",
|
|
582
|
+
cursor: f ? "not-allowed" : "pointer",
|
|
583
|
+
boxSizing: "border-box"
|
|
584
|
+
},
|
|
585
|
+
onFocus: (D) => {
|
|
586
|
+
var L;
|
|
587
|
+
f || S(!0), (L = i.onFocus) == null || L.call(i, D);
|
|
588
|
+
},
|
|
589
|
+
onBlur: (D) => {
|
|
590
|
+
var L;
|
|
591
|
+
S(!1), (L = i.onBlur) == null || L.call(i, D);
|
|
592
|
+
},
|
|
593
|
+
onMouseDown: () => {
|
|
594
|
+
f || S(!0);
|
|
595
|
+
},
|
|
596
|
+
...i,
|
|
597
|
+
children: [
|
|
598
|
+
r && /* @__PURE__ */ p("option", { value: "", disabled: !0, children: r }),
|
|
599
|
+
e.map((D) => /* @__PURE__ */ p("option", { value: D.value, disabled: D.disabled, children: D.label }, D.value))
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
),
|
|
603
|
+
/* @__PURE__ */ p(
|
|
604
|
+
"span",
|
|
605
|
+
{
|
|
606
|
+
"aria-hidden": !0,
|
|
607
|
+
style: {
|
|
608
|
+
position: "absolute",
|
|
609
|
+
right: Ne[t],
|
|
610
|
+
pointerEvents: "none",
|
|
611
|
+
color: f ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
612
|
+
display: "flex",
|
|
613
|
+
alignItems: "center"
|
|
614
|
+
},
|
|
615
|
+
children: /* @__PURE__ */ p("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ p("polyline", { points: "6 9 12 15 18 9" }) })
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
h && /* @__PURE__ */ p(
|
|
622
|
+
"span",
|
|
623
|
+
{
|
|
624
|
+
id: `${g}-error`,
|
|
625
|
+
role: "alert",
|
|
626
|
+
style: {
|
|
627
|
+
fontSize: ze[t],
|
|
628
|
+
color: "var(--lucent-danger-text)",
|
|
629
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
630
|
+
},
|
|
631
|
+
children: n
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
!h && a && /* @__PURE__ */ p(
|
|
635
|
+
"span",
|
|
636
|
+
{
|
|
637
|
+
id: `${g}-helper`,
|
|
638
|
+
style: {
|
|
639
|
+
fontSize: ze[t],
|
|
640
|
+
color: "var(--lucent-text-secondary)",
|
|
641
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
642
|
+
},
|
|
643
|
+
children: a
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
] });
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
Ye.displayName = "Select";
|
|
650
|
+
const Nt = {
|
|
651
|
+
primary: "var(--lucent-text-primary)",
|
|
652
|
+
secondary: "var(--lucent-text-secondary)",
|
|
653
|
+
disabled: "var(--lucent-text-disabled)",
|
|
654
|
+
inverse: "var(--lucent-text-inverse)",
|
|
655
|
+
onAccent: "var(--lucent-accent-fg)",
|
|
656
|
+
success: "var(--lucent-success-text)",
|
|
657
|
+
warning: "var(--lucent-warning-text)",
|
|
658
|
+
danger: "var(--lucent-danger-text)",
|
|
659
|
+
info: "var(--lucent-info-text)"
|
|
660
|
+
}, Et = {
|
|
661
|
+
xs: "var(--lucent-font-size-xs)",
|
|
662
|
+
sm: "var(--lucent-font-size-sm)",
|
|
663
|
+
md: "var(--lucent-font-size-md)",
|
|
664
|
+
lg: "var(--lucent-font-size-lg)",
|
|
665
|
+
xl: "var(--lucent-font-size-xl)",
|
|
666
|
+
"2xl": "var(--lucent-font-size-2xl)",
|
|
667
|
+
"3xl": "var(--lucent-font-size-3xl)"
|
|
668
|
+
}, At = {
|
|
669
|
+
regular: "var(--lucent-font-weight-regular)",
|
|
670
|
+
medium: "var(--lucent-font-weight-medium)",
|
|
671
|
+
semibold: "var(--lucent-font-weight-semibold)",
|
|
672
|
+
bold: "var(--lucent-font-weight-bold)"
|
|
673
|
+
}, Ot = {
|
|
674
|
+
tight: "var(--lucent-line-height-tight)",
|
|
675
|
+
base: "var(--lucent-line-height-base)",
|
|
676
|
+
relaxed: "var(--lucent-line-height-relaxed)"
|
|
677
|
+
}, Xt = {
|
|
678
|
+
base: "var(--lucent-font-family-base)",
|
|
679
|
+
mono: "var(--lucent-font-family-mono)",
|
|
680
|
+
display: "var(--lucent-font-family-display)"
|
|
681
|
+
};
|
|
682
|
+
function cn({
|
|
683
|
+
as: e = "p",
|
|
684
|
+
size: t = "md",
|
|
685
|
+
weight: s = "regular",
|
|
686
|
+
color: a = "primary",
|
|
687
|
+
align: n = "left",
|
|
688
|
+
lineHeight: r = "base",
|
|
689
|
+
family: o = "base",
|
|
690
|
+
truncate: c = !1,
|
|
691
|
+
children: u,
|
|
692
|
+
style: i,
|
|
693
|
+
...d
|
|
694
|
+
}) {
|
|
695
|
+
const g = {
|
|
696
|
+
fontSize: Et[t],
|
|
697
|
+
fontWeight: At[s],
|
|
698
|
+
color: Nt[a],
|
|
699
|
+
textAlign: n,
|
|
700
|
+
lineHeight: Ot[r],
|
|
701
|
+
fontFamily: Xt[o],
|
|
702
|
+
margin: 0,
|
|
703
|
+
...c && {
|
|
704
|
+
overflow: "hidden",
|
|
705
|
+
textOverflow: "ellipsis",
|
|
706
|
+
whiteSpace: "nowrap"
|
|
707
|
+
},
|
|
708
|
+
...i
|
|
709
|
+
};
|
|
710
|
+
return /* @__PURE__ */ p(e, { style: g, ...d, children: u });
|
|
711
|
+
}
|
|
712
|
+
const jt = { sm: "3px", md: "4px", lg: "5px" }, Ut = { sm: "14px", md: "18px", lg: "22px" }, qt = `
|
|
713
|
+
.lucent-slider {
|
|
714
|
+
-webkit-appearance: none;
|
|
715
|
+
appearance: none;
|
|
716
|
+
width: 100%;
|
|
717
|
+
background: transparent;
|
|
718
|
+
cursor: pointer;
|
|
719
|
+
outline: none;
|
|
720
|
+
margin: 0;
|
|
721
|
+
padding: 6px 0;
|
|
722
|
+
box-sizing: border-box;
|
|
723
|
+
}
|
|
724
|
+
.lucent-slider:disabled { cursor: not-allowed; }
|
|
725
|
+
|
|
726
|
+
/* WebKit track */
|
|
727
|
+
.lucent-slider::-webkit-slider-runnable-track {
|
|
728
|
+
height: var(--ls-track-h);
|
|
729
|
+
border-radius: 999px;
|
|
730
|
+
background: linear-gradient(
|
|
731
|
+
to right,
|
|
732
|
+
var(--lucent-accent-default) 0%,
|
|
733
|
+
var(--lucent-accent-default) var(--ls-fill),
|
|
734
|
+
color-mix(in srgb, var(--lucent-text-primary) 10%, transparent) var(--ls-fill),
|
|
735
|
+
color-mix(in srgb, var(--lucent-text-primary) 10%, transparent) 100%
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
.lucent-slider:disabled::-webkit-slider-runnable-track {
|
|
739
|
+
background: color-mix(in srgb, var(--lucent-text-primary) 10%, transparent);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/* WebKit thumb */
|
|
743
|
+
.lucent-slider::-webkit-slider-thumb {
|
|
744
|
+
-webkit-appearance: none;
|
|
745
|
+
appearance: none;
|
|
746
|
+
width: var(--ls-thumb);
|
|
747
|
+
height: var(--ls-thumb);
|
|
748
|
+
border-radius: 50%;
|
|
749
|
+
background: var(--lucent-accent-default);
|
|
750
|
+
border: 2px solid var(--lucent-surface);
|
|
751
|
+
box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
|
|
752
|
+
margin-top: calc((var(--ls-thumb) - var(--ls-track-h)) / -2);
|
|
753
|
+
transition: transform 120ms ease, box-shadow 120ms ease;
|
|
754
|
+
cursor: pointer;
|
|
755
|
+
}
|
|
756
|
+
.lucent-slider:not(:disabled):hover::-webkit-slider-thumb {
|
|
757
|
+
transform: scale(1.15);
|
|
758
|
+
}
|
|
759
|
+
.lucent-slider:focus-visible::-webkit-slider-thumb {
|
|
760
|
+
box-shadow: 0 0 0 3px var(--lucent-accent-subtle);
|
|
761
|
+
}
|
|
762
|
+
.lucent-slider:disabled::-webkit-slider-thumb {
|
|
763
|
+
background: color-mix(in srgb, var(--lucent-text-primary) 12%, transparent);
|
|
764
|
+
border-color: color-mix(in srgb, var(--lucent-text-primary) 10%, transparent);
|
|
765
|
+
cursor: not-allowed;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/* Firefox track */
|
|
769
|
+
.lucent-slider::-moz-range-track {
|
|
770
|
+
height: var(--ls-track-h);
|
|
771
|
+
border-radius: 999px;
|
|
772
|
+
background: color-mix(in srgb, var(--lucent-text-primary) 10%, transparent);
|
|
773
|
+
}
|
|
774
|
+
.lucent-slider::-moz-range-progress {
|
|
775
|
+
height: var(--ls-track-h);
|
|
776
|
+
border-radius: 999px;
|
|
777
|
+
background: var(--lucent-accent-default);
|
|
778
|
+
}
|
|
779
|
+
.lucent-slider:disabled::-moz-range-progress {
|
|
780
|
+
background: transparent;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/* Firefox thumb */
|
|
784
|
+
.lucent-slider::-moz-range-thumb {
|
|
785
|
+
width: var(--ls-thumb);
|
|
786
|
+
height: var(--ls-thumb);
|
|
787
|
+
border-radius: 50%;
|
|
788
|
+
background: var(--lucent-accent-default);
|
|
789
|
+
border: 2px solid var(--lucent-surface);
|
|
790
|
+
box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
|
|
791
|
+
cursor: pointer;
|
|
792
|
+
transition: transform 120ms ease, box-shadow 120ms ease;
|
|
793
|
+
}
|
|
794
|
+
.lucent-slider:not(:disabled):hover::-moz-range-thumb {
|
|
795
|
+
transform: scale(1.15);
|
|
796
|
+
}
|
|
797
|
+
.lucent-slider:focus-visible::-moz-range-thumb {
|
|
798
|
+
box-shadow: 0 0 0 3px var(--lucent-accent-subtle);
|
|
799
|
+
}
|
|
800
|
+
.lucent-slider:disabled::-moz-range-thumb {
|
|
801
|
+
background: color-mix(in srgb, var(--lucent-text-primary) 12%, transparent);
|
|
802
|
+
border-color: color-mix(in srgb, var(--lucent-text-primary) 10%, transparent);
|
|
803
|
+
cursor: not-allowed;
|
|
804
|
+
}
|
|
805
|
+
`;
|
|
806
|
+
function un({
|
|
807
|
+
label: e,
|
|
808
|
+
showValue: t = !1,
|
|
809
|
+
size: s = "md",
|
|
810
|
+
min: a = 0,
|
|
811
|
+
max: n = 100,
|
|
812
|
+
step: r = 1,
|
|
813
|
+
value: o,
|
|
814
|
+
defaultValue: c,
|
|
815
|
+
disabled: u,
|
|
816
|
+
id: i,
|
|
817
|
+
onChange: d,
|
|
818
|
+
style: g,
|
|
819
|
+
...h
|
|
820
|
+
}) {
|
|
821
|
+
const f = i ?? `lucent-slider-${Math.random().toString(36).slice(2, 7)}`, w = o !== void 0, [S, k] = C(
|
|
822
|
+
c ?? Math.round((a + n) / 2)
|
|
823
|
+
), v = w ? o : S, b = `${(v - a) / (n - a) * 100}%`, m = (D) => {
|
|
824
|
+
w || k(Number(D.target.value)), d == null || d(D);
|
|
825
|
+
};
|
|
826
|
+
return /* @__PURE__ */ I(_e, { children: [
|
|
827
|
+
/* @__PURE__ */ p("style", { children: qt }),
|
|
828
|
+
/* @__PURE__ */ I(
|
|
829
|
+
"div",
|
|
830
|
+
{
|
|
831
|
+
style: {
|
|
832
|
+
display: "flex",
|
|
833
|
+
flexDirection: "column",
|
|
834
|
+
gap: "var(--lucent-space-1)",
|
|
835
|
+
width: "100%",
|
|
836
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
837
|
+
...g
|
|
838
|
+
},
|
|
839
|
+
children: [
|
|
840
|
+
(e || t) && /* @__PURE__ */ I(
|
|
841
|
+
"div",
|
|
842
|
+
{
|
|
843
|
+
style: {
|
|
844
|
+
display: "flex",
|
|
845
|
+
justifyContent: "space-between",
|
|
846
|
+
alignItems: "baseline"
|
|
847
|
+
},
|
|
848
|
+
children: [
|
|
849
|
+
e && /* @__PURE__ */ p(
|
|
850
|
+
"label",
|
|
851
|
+
{
|
|
852
|
+
htmlFor: f,
|
|
853
|
+
style: {
|
|
854
|
+
fontSize: "var(--lucent-font-size-sm)",
|
|
855
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
856
|
+
color: u ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
857
|
+
cursor: u ? "not-allowed" : "default"
|
|
858
|
+
},
|
|
859
|
+
children: e
|
|
860
|
+
}
|
|
861
|
+
),
|
|
862
|
+
t && /* @__PURE__ */ p(
|
|
863
|
+
"span",
|
|
864
|
+
{
|
|
865
|
+
style: {
|
|
866
|
+
fontSize: "var(--lucent-font-size-sm)",
|
|
867
|
+
color: u ? "var(--lucent-text-disabled)" : "var(--lucent-text-secondary)",
|
|
868
|
+
fontVariantNumeric: "tabular-nums"
|
|
869
|
+
},
|
|
870
|
+
children: v
|
|
871
|
+
}
|
|
872
|
+
)
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
),
|
|
876
|
+
/* @__PURE__ */ p(
|
|
877
|
+
"input",
|
|
878
|
+
{
|
|
879
|
+
type: "range",
|
|
880
|
+
id: f,
|
|
881
|
+
className: "lucent-slider",
|
|
882
|
+
min: a,
|
|
883
|
+
max: n,
|
|
884
|
+
step: r,
|
|
885
|
+
disabled: u,
|
|
886
|
+
value: w ? o : S,
|
|
887
|
+
onChange: m,
|
|
888
|
+
style: {
|
|
889
|
+
"--ls-track-h": jt[s],
|
|
890
|
+
"--ls-thumb": Ut[s],
|
|
891
|
+
"--ls-fill": b
|
|
892
|
+
},
|
|
893
|
+
...h
|
|
894
|
+
}
|
|
895
|
+
)
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
)
|
|
899
|
+
] });
|
|
900
|
+
}
|
|
901
|
+
const Ee = {
|
|
902
|
+
sm: "calc(var(--lucent-space-8) * 0.5 + 18px)",
|
|
903
|
+
md: "calc(var(--lucent-space-10) * 0.5 + 22px)",
|
|
904
|
+
lg: "calc(var(--lucent-space-12) * 0.5 + 26px)"
|
|
905
|
+
}, Gt = {
|
|
906
|
+
sm: "var(--lucent-font-size-sm)",
|
|
907
|
+
md: "var(--lucent-font-size-md)",
|
|
908
|
+
lg: "var(--lucent-font-size-lg)"
|
|
909
|
+
}, _t = {
|
|
910
|
+
sm: "var(--lucent-space-3)",
|
|
911
|
+
md: "var(--lucent-space-4)",
|
|
912
|
+
lg: "var(--lucent-space-5)"
|
|
913
|
+
};
|
|
914
|
+
function Ze({
|
|
915
|
+
options: e,
|
|
916
|
+
value: t,
|
|
917
|
+
defaultValue: s,
|
|
918
|
+
onChange: a,
|
|
919
|
+
size: n = "md",
|
|
920
|
+
disabled: r = !1,
|
|
921
|
+
fullWidth: o = !0,
|
|
922
|
+
id: c,
|
|
923
|
+
style: u
|
|
924
|
+
}) {
|
|
925
|
+
var v;
|
|
926
|
+
const [i, d] = C(
|
|
927
|
+
s ?? ((v = e[0]) == null ? void 0 : v.value) ?? ""
|
|
928
|
+
), g = t !== void 0 ? t : i, h = U(null), [f, w] = C(null), S = U(!1);
|
|
929
|
+
me(() => {
|
|
930
|
+
const b = h.current;
|
|
931
|
+
if (!b) return;
|
|
932
|
+
const m = () => {
|
|
933
|
+
const L = b.querySelector(`[data-sc-value="${g}"]`);
|
|
934
|
+
L && (w({
|
|
935
|
+
left: L.offsetLeft,
|
|
936
|
+
width: L.offsetWidth,
|
|
937
|
+
animate: S.current
|
|
938
|
+
}), S.current = !0);
|
|
939
|
+
};
|
|
940
|
+
m();
|
|
941
|
+
const D = new ResizeObserver(m);
|
|
942
|
+
return D.observe(b), () => D.disconnect();
|
|
943
|
+
}, [g, e]);
|
|
944
|
+
const k = (b) => {
|
|
945
|
+
r || b.disabled || (t === void 0 && d(b.value), a == null || a(b.value));
|
|
946
|
+
};
|
|
947
|
+
return /* @__PURE__ */ I(
|
|
948
|
+
"div",
|
|
949
|
+
{
|
|
950
|
+
id: c,
|
|
951
|
+
ref: h,
|
|
952
|
+
role: "group",
|
|
953
|
+
style: {
|
|
954
|
+
position: "relative",
|
|
955
|
+
display: "flex",
|
|
956
|
+
alignItems: "center",
|
|
957
|
+
width: o ? "100%" : "fit-content",
|
|
958
|
+
height: Ee[n],
|
|
959
|
+
// color-mix with transparent produces a relative tint that adapts to any
|
|
960
|
+
// parent background (white, tinted chrome, dark mode). Baseline 2023.
|
|
961
|
+
background: "color-mix(in srgb, var(--lucent-text-primary) 6%, transparent)",
|
|
962
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
963
|
+
padding: 0,
|
|
964
|
+
gap: 0,
|
|
965
|
+
opacity: r ? 0.5 : 1,
|
|
966
|
+
...u
|
|
967
|
+
},
|
|
968
|
+
children: [
|
|
969
|
+
f && /* @__PURE__ */ p(
|
|
970
|
+
"span",
|
|
971
|
+
{
|
|
972
|
+
"aria-hidden": !0,
|
|
973
|
+
style: {
|
|
974
|
+
position: "absolute",
|
|
975
|
+
top: 3,
|
|
976
|
+
left: f.left + 3,
|
|
977
|
+
width: f.width - 6,
|
|
978
|
+
height: "calc(100% - 6px)",
|
|
979
|
+
background: "var(--lucent-surface)",
|
|
980
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
981
|
+
boxShadow: "var(--lucent-shadow-sm)",
|
|
982
|
+
transition: f.animate ? "left var(--lucent-duration-base) cubic-bezier(0.34, 1.56, 0.64, 1), width var(--lucent-duration-base) cubic-bezier(0.22, 1, 0.36, 1)" : "none",
|
|
983
|
+
zIndex: 0,
|
|
984
|
+
pointerEvents: "none"
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
e.map((b) => {
|
|
989
|
+
const m = b.value === g, D = r || !!b.disabled;
|
|
990
|
+
return /* @__PURE__ */ p(
|
|
991
|
+
"button",
|
|
992
|
+
{
|
|
993
|
+
"data-sc-value": b.value,
|
|
994
|
+
type: "button",
|
|
995
|
+
role: "radio",
|
|
996
|
+
"aria-checked": m,
|
|
997
|
+
disabled: D,
|
|
998
|
+
onClick: () => k(b),
|
|
999
|
+
style: {
|
|
1000
|
+
position: "relative",
|
|
1001
|
+
zIndex: 1,
|
|
1002
|
+
display: "flex",
|
|
1003
|
+
alignItems: "center",
|
|
1004
|
+
justifyContent: "center",
|
|
1005
|
+
gap: "var(--lucent-space-1)",
|
|
1006
|
+
flex: 1,
|
|
1007
|
+
height: Ee[n],
|
|
1008
|
+
padding: `0 ${_t[n]}`,
|
|
1009
|
+
fontSize: Gt[n],
|
|
1010
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1011
|
+
fontWeight: m ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
1012
|
+
color: D ? "var(--lucent-text-disabled)" : m ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
|
|
1013
|
+
background: "transparent",
|
|
1014
|
+
border: "none",
|
|
1015
|
+
borderRadius: "var(--lucent-radius-lg)",
|
|
1016
|
+
cursor: D ? "not-allowed" : "pointer",
|
|
1017
|
+
outline: "none",
|
|
1018
|
+
whiteSpace: "nowrap",
|
|
1019
|
+
transition: [
|
|
1020
|
+
"color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
1021
|
+
"font-weight var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
1022
|
+
].join(", ")
|
|
1023
|
+
},
|
|
1024
|
+
onFocus: (L) => {
|
|
1025
|
+
L.currentTarget.matches(":focus-visible") && (L.currentTarget.style.boxShadow = "0 0 0 2px var(--lucent-accent-subtle)");
|
|
1026
|
+
},
|
|
1027
|
+
onBlur: (L) => {
|
|
1028
|
+
L.currentTarget.style.boxShadow = "";
|
|
1029
|
+
},
|
|
1030
|
+
children: b.label
|
|
1031
|
+
},
|
|
1032
|
+
b.value
|
|
1033
|
+
);
|
|
1034
|
+
})
|
|
1035
|
+
]
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
Ze.displayName = "SegmentedControl";
|
|
1040
|
+
const Vt = {
|
|
1041
|
+
xs: 12,
|
|
1042
|
+
sm: 16,
|
|
1043
|
+
md: 22,
|
|
1044
|
+
lg: 28,
|
|
1045
|
+
xl: 36,
|
|
1046
|
+
"2xl": 48
|
|
1047
|
+
}, Kt = {
|
|
1048
|
+
xs: "var(--lucent-radius-sm)",
|
|
1049
|
+
sm: "var(--lucent-radius-sm)",
|
|
1050
|
+
md: "var(--lucent-radius-md)",
|
|
1051
|
+
lg: "var(--lucent-radius-md)",
|
|
1052
|
+
xl: "var(--lucent-radius-lg)",
|
|
1053
|
+
"2xl": "var(--lucent-radius-lg)"
|
|
1054
|
+
}, Ae = "inset 0 0 0 1px rgba(0,0,0,0.2)", Oe = "inset 0 0 0 2px rgba(0,0,0,0.5)", Yt = "inset 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 3px var(--lucent-accent-subtle)";
|
|
1055
|
+
function Zt(e) {
|
|
1056
|
+
return {
|
|
1057
|
+
backgroundImage: [
|
|
1058
|
+
`linear-gradient(${e}, ${e})`,
|
|
1059
|
+
"linear-gradient(45deg, #e5e5e5 25%, transparent 25%)",
|
|
1060
|
+
"linear-gradient(-45deg, #e5e5e5 25%, transparent 25%)",
|
|
1061
|
+
"linear-gradient(45deg, transparent 75%, #e5e5e5 75%)",
|
|
1062
|
+
"linear-gradient(-45deg, transparent 75%, #e5e5e5 75%)"
|
|
1063
|
+
].join(", "),
|
|
1064
|
+
backgroundSize: "auto, 8px 8px, 8px 8px, 8px 8px, 8px 8px",
|
|
1065
|
+
backgroundPosition: "0 0, 0 0, 0 4px, 4px -4px, -4px 0",
|
|
1066
|
+
backgroundColor: "#fff"
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
const de = xe(({
|
|
1070
|
+
color: e,
|
|
1071
|
+
size: t = "md",
|
|
1072
|
+
shape: s = "circle",
|
|
1073
|
+
showCheckerboard: a = !1,
|
|
1074
|
+
selected: n = !1,
|
|
1075
|
+
disabled: r = !1,
|
|
1076
|
+
style: o,
|
|
1077
|
+
onFocus: c,
|
|
1078
|
+
onBlur: u,
|
|
1079
|
+
onClick: i,
|
|
1080
|
+
...d
|
|
1081
|
+
}, g) => {
|
|
1082
|
+
const h = Vt[t], f = s === "circle" ? "50%" : Kt[t];
|
|
1083
|
+
return /* @__PURE__ */ p(
|
|
1084
|
+
"button",
|
|
1085
|
+
{
|
|
1086
|
+
ref: g,
|
|
1087
|
+
type: "button",
|
|
1088
|
+
disabled: r,
|
|
1089
|
+
onClick: i,
|
|
1090
|
+
style: {
|
|
1091
|
+
width: h,
|
|
1092
|
+
height: h,
|
|
1093
|
+
flexShrink: 0,
|
|
1094
|
+
...a ? Zt(e) : { background: e },
|
|
1095
|
+
border: "none",
|
|
1096
|
+
borderRadius: f,
|
|
1097
|
+
cursor: r ? "not-allowed" : i ? "pointer" : "default",
|
|
1098
|
+
padding: 0,
|
|
1099
|
+
outline: "none",
|
|
1100
|
+
opacity: r ? 0.4 : 1,
|
|
1101
|
+
boxShadow: n ? Oe : Ae,
|
|
1102
|
+
transition: "box-shadow var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
1103
|
+
...o
|
|
1104
|
+
},
|
|
1105
|
+
onFocus: (w) => {
|
|
1106
|
+
r || (w.currentTarget.style.boxShadow = Yt), c == null || c(w);
|
|
1107
|
+
},
|
|
1108
|
+
onBlur: (w) => {
|
|
1109
|
+
w.currentTarget.style.boxShadow = n ? Oe : Ae, u == null || u(w);
|
|
1110
|
+
},
|
|
1111
|
+
...d
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1114
|
+
});
|
|
1115
|
+
de.displayName = "ColorSwatch";
|
|
1116
|
+
function pe(e, t, s) {
|
|
1117
|
+
return Math.max(t, Math.min(s, e));
|
|
1118
|
+
}
|
|
1119
|
+
function Jt(e, t, s) {
|
|
1120
|
+
const a = t / 100, n = s / 100, r = n * a, o = r * (1 - Math.abs(e / 60 % 2 - 1)), c = n - r;
|
|
1121
|
+
let u = 0, i = 0, d = 0;
|
|
1122
|
+
return e < 60 ? (u = r, i = o) : e < 120 ? (u = o, i = r) : e < 180 ? (i = r, d = o) : e < 240 ? (i = o, d = r) : e < 300 ? (u = o, d = r) : (u = r, d = o), { r: Math.round((u + c) * 255), g: Math.round((i + c) * 255), b: Math.round((d + c) * 255) };
|
|
1123
|
+
}
|
|
1124
|
+
function Qt(e, t, s) {
|
|
1125
|
+
const a = e / 255, n = t / 255, r = s / 255, o = Math.max(a, n, r), c = Math.min(a, n, r), u = o - c, i = o, d = o === 0 ? 0 : u / o;
|
|
1126
|
+
let g = 0;
|
|
1127
|
+
return u !== 0 && (o === a ? g = ((n - r) / u + (n < r ? 6 : 0)) / 6 : o === n ? g = ((r - a) / u + 2) / 6 : g = ((a - n) / u + 4) / 6), { h: Math.round(g * 360), s: Math.round(d * 100), v: Math.round(i * 100) };
|
|
1128
|
+
}
|
|
1129
|
+
function ea(e, t, s) {
|
|
1130
|
+
const a = e / 255, n = t / 255, r = s / 255, o = Math.max(a, n, r), c = Math.min(a, n, r), u = (o + c) / 2;
|
|
1131
|
+
if (o === c) return { h: 0, s: 0, l: Math.round(u * 100) };
|
|
1132
|
+
const i = o - c, d = u > 0.5 ? i / (2 - o - c) : i / (o + c);
|
|
1133
|
+
let g = 0;
|
|
1134
|
+
return o === a ? g = ((n - r) / i + (n < r ? 6 : 0)) / 6 : o === n ? g = ((r - a) / i + 2) / 6 : g = ((a - n) / i + 4) / 6, { h: Math.round(g * 360), s: Math.round(d * 100), l: Math.round(u * 100) };
|
|
1135
|
+
}
|
|
1136
|
+
function fe(e, t, s) {
|
|
1137
|
+
const a = t / 100, n = s / 100, r = (1 - Math.abs(2 * n - 1)) * a, o = r * (1 - Math.abs(e / 60 % 2 - 1)), c = n - r / 2;
|
|
1138
|
+
let u = 0, i = 0, d = 0;
|
|
1139
|
+
return e < 60 ? (u = r, i = o) : e < 120 ? (u = o, i = r) : e < 180 ? (i = r, d = o) : e < 240 ? (i = o, d = r) : e < 300 ? (u = o, d = r) : (u = r, d = o), { r: Math.round((u + c) * 255), g: Math.round((i + c) * 255), b: Math.round((d + c) * 255) };
|
|
1140
|
+
}
|
|
1141
|
+
function Le(e) {
|
|
1142
|
+
const t = e.replace("#", "");
|
|
1143
|
+
return t.length === 3 ? `#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : t.length === 6 || t.length === 8 ? `#${t}` : "#000000";
|
|
1144
|
+
}
|
|
1145
|
+
function Je(e) {
|
|
1146
|
+
const t = Le(e);
|
|
1147
|
+
return {
|
|
1148
|
+
r: parseInt(t.slice(1, 3), 16),
|
|
1149
|
+
g: parseInt(t.slice(3, 5), 16),
|
|
1150
|
+
b: parseInt(t.slice(5, 7), 16),
|
|
1151
|
+
a: t.length === 9 ? +(parseInt(t.slice(7, 9), 16) / 255).toFixed(2) : 1
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
function $e({ r: e, g: t, b: s, a }) {
|
|
1155
|
+
const n = (o) => pe(Math.round(o), 0, 255).toString(16).padStart(2, "0"), r = `#${n(e)}${n(t)}${n(s)}`;
|
|
1156
|
+
return a < 1 ? `${r}${n(Math.round(a * 255))}` : r;
|
|
1157
|
+
}
|
|
1158
|
+
function Qe({ h: e, s: t, v: s, a }) {
|
|
1159
|
+
return { ...Jt(e, t, s), a };
|
|
1160
|
+
}
|
|
1161
|
+
function q({ r: e, g: t, b: s, a }) {
|
|
1162
|
+
return { ...Qt(e, t, s), a };
|
|
1163
|
+
}
|
|
1164
|
+
function oe(e) {
|
|
1165
|
+
return $e(Qe(e));
|
|
1166
|
+
}
|
|
1167
|
+
function le(e) {
|
|
1168
|
+
const t = e.trim();
|
|
1169
|
+
if (t.startsWith("#")) {
|
|
1170
|
+
const n = Le(t);
|
|
1171
|
+
return /^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(n) ? Je(n) : null;
|
|
1172
|
+
}
|
|
1173
|
+
const s = t.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*([\d.]+))?\s*\)$/);
|
|
1174
|
+
if (s) {
|
|
1175
|
+
const n = +(s[1] ?? "0"), r = +(s[2] ?? "0"), o = +(s[3] ?? "0"), c = s[4] !== void 0 ? +s[4] : 1;
|
|
1176
|
+
return [n, r, o].every((u) => u <= 255) && c >= 0 && c <= 1 ? { r: n, g: r, b: o, a: c } : null;
|
|
1177
|
+
}
|
|
1178
|
+
const a = t.match(/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%?\s*,\s*(\d{1,3})%?\s*\)$/);
|
|
1179
|
+
if (a) {
|
|
1180
|
+
const n = +(a[1] ?? "0"), r = +(a[2] ?? "0"), o = +(a[3] ?? "0");
|
|
1181
|
+
return n <= 360 && r <= 100 && o <= 100 ? { ...fe(n, r, o), a: 1 } : null;
|
|
1182
|
+
}
|
|
1183
|
+
return null;
|
|
1184
|
+
}
|
|
1185
|
+
const ta = [
|
|
1186
|
+
{
|
|
1187
|
+
label: "Presets",
|
|
1188
|
+
colors: [
|
|
1189
|
+
"#000000",
|
|
1190
|
+
"#2563eb",
|
|
1191
|
+
"#16a34a",
|
|
1192
|
+
"#ca8a04",
|
|
1193
|
+
"#dc2626",
|
|
1194
|
+
"#0ea5e9",
|
|
1195
|
+
"#9333ea",
|
|
1196
|
+
"#4f46e5",
|
|
1197
|
+
"#e11d48"
|
|
1198
|
+
]
|
|
1199
|
+
}
|
|
1200
|
+
], aa = [
|
|
1201
|
+
"linear-gradient(45deg, #c0c0c0 25%, transparent 25%)",
|
|
1202
|
+
"linear-gradient(-45deg, #c0c0c0 25%, transparent 25%)",
|
|
1203
|
+
"linear-gradient(45deg, transparent 75%, #c0c0c0 75%)",
|
|
1204
|
+
"linear-gradient(-45deg, transparent 75%, #c0c0c0 75%)"
|
|
1205
|
+
].join(", ");
|
|
1206
|
+
function Xe({ value: e, min: t, max: s, onChange: a, trackStyle: n, formatTooltip: r }) {
|
|
1207
|
+
const o = U(null), [c, u] = C(!1), i = ue((g) => {
|
|
1208
|
+
const h = o.current.getBoundingClientRect(), f = pe((g.clientX - h.left) / h.width, 0, 1);
|
|
1209
|
+
a(t + f * (s - t));
|
|
1210
|
+
}, [t, s, a]), d = (e - t) / (s - t) * 100;
|
|
1211
|
+
return /* @__PURE__ */ p(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
ref: o,
|
|
1215
|
+
style: { position: "relative", height: 12, borderRadius: 6, cursor: "crosshair", userSelect: "none", ...n },
|
|
1216
|
+
onPointerDown: (g) => {
|
|
1217
|
+
g.currentTarget.setPointerCapture(g.pointerId), u(!0), i(g);
|
|
1218
|
+
},
|
|
1219
|
+
onPointerMove: (g) => {
|
|
1220
|
+
g.buttons > 0 && i(g);
|
|
1221
|
+
},
|
|
1222
|
+
onPointerUp: () => u(!1),
|
|
1223
|
+
onPointerCancel: () => u(!1),
|
|
1224
|
+
children: /* @__PURE__ */ p(
|
|
1225
|
+
"div",
|
|
1226
|
+
{
|
|
1227
|
+
style: {
|
|
1228
|
+
position: "absolute",
|
|
1229
|
+
left: `${d}%`,
|
|
1230
|
+
top: "50%",
|
|
1231
|
+
transform: "translate(-50%, -50%)",
|
|
1232
|
+
width: 14,
|
|
1233
|
+
height: 14,
|
|
1234
|
+
borderRadius: "50%",
|
|
1235
|
+
background: "white",
|
|
1236
|
+
border: "2px solid rgba(0,0,0,0.22)",
|
|
1237
|
+
boxShadow: "0 1px 4px rgba(0,0,0,0.3)",
|
|
1238
|
+
zIndex: 1,
|
|
1239
|
+
pointerEvents: "none"
|
|
1240
|
+
},
|
|
1241
|
+
children: c && r && /* @__PURE__ */ p("div", { style: {
|
|
1242
|
+
position: "absolute",
|
|
1243
|
+
bottom: "100%",
|
|
1244
|
+
left: "50%",
|
|
1245
|
+
transform: "translateX(-50%)",
|
|
1246
|
+
marginBottom: 6,
|
|
1247
|
+
background: "rgba(0,0,0,0.75)",
|
|
1248
|
+
color: "#fff",
|
|
1249
|
+
fontSize: 11,
|
|
1250
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1251
|
+
fontWeight: 500,
|
|
1252
|
+
borderRadius: 4,
|
|
1253
|
+
padding: "2px 6px",
|
|
1254
|
+
whiteSpace: "nowrap",
|
|
1255
|
+
pointerEvents: "none"
|
|
1256
|
+
}, children: r(e) })
|
|
1257
|
+
}
|
|
1258
|
+
)
|
|
1259
|
+
}
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
function na() {
|
|
1263
|
+
return /* @__PURE__ */ I("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1264
|
+
/* @__PURE__ */ p("path", { d: "M2 22l1-1h3l9-9" }),
|
|
1265
|
+
/* @__PURE__ */ p("path", { d: "M3 21v-3l9-9" }),
|
|
1266
|
+
/* @__PURE__ */ p("path", { d: "M15 6l3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
|
|
1267
|
+
] });
|
|
1268
|
+
}
|
|
1269
|
+
function ra({
|
|
1270
|
+
value: e,
|
|
1271
|
+
onChange: t,
|
|
1272
|
+
label: s,
|
|
1273
|
+
size: a = "md",
|
|
1274
|
+
inline: n = !1,
|
|
1275
|
+
disabled: r = !1,
|
|
1276
|
+
presetGroups: o = ta,
|
|
1277
|
+
portalContainer: c,
|
|
1278
|
+
id: u,
|
|
1279
|
+
style: i
|
|
1280
|
+
}) {
|
|
1281
|
+
var M, F;
|
|
1282
|
+
const d = a === "sm" ? 24 : 40, g = Ve(), h = u ?? g, [f, w] = C(!1), [S, k] = C("hex"), [v, b] = C(0), [m, D] = C(() => {
|
|
1283
|
+
const l = e ? le(e) ?? { r: 0, g: 0, b: 0, a: 1 } : { r: 0, g: 0, b: 0, a: 1 };
|
|
1284
|
+
return q(l);
|
|
1285
|
+
}), [L, X] = C(() => oe(m).slice(1).toUpperCase()), O = U(null), A = U(null), N = U(null), [Z, K] = C({ top: 0, left: 0 });
|
|
1286
|
+
me(() => {
|
|
1287
|
+
if (!f || !O.current) return;
|
|
1288
|
+
const l = O.current.getBoundingClientRect();
|
|
1289
|
+
let x = l.left;
|
|
1290
|
+
const T = l.bottom + 8;
|
|
1291
|
+
if (N.current) {
|
|
1292
|
+
const B = N.current.offsetWidth;
|
|
1293
|
+
x + B > window.innerWidth && (x = l.right - B);
|
|
1294
|
+
}
|
|
1295
|
+
K({ top: T, left: x });
|
|
1296
|
+
}, [f]), ne(() => {
|
|
1297
|
+
if (!e) return;
|
|
1298
|
+
const l = le(e);
|
|
1299
|
+
l && (D(q(l)), X($e(l).slice(1).toUpperCase()));
|
|
1300
|
+
}, [e]), ne(() => {
|
|
1301
|
+
if (!f) return;
|
|
1302
|
+
const l = (x) => {
|
|
1303
|
+
var B, H;
|
|
1304
|
+
const T = x.target;
|
|
1305
|
+
(B = O.current) != null && B.contains(T) || (H = N.current) != null && H.contains(T) || w(!1);
|
|
1306
|
+
};
|
|
1307
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
1308
|
+
}, [f]);
|
|
1309
|
+
const $ = ue((l) => {
|
|
1310
|
+
D(l);
|
|
1311
|
+
const x = oe(l);
|
|
1312
|
+
X(x.slice(1).toUpperCase()), t == null || t(x);
|
|
1313
|
+
}, [t]), E = ue((l) => {
|
|
1314
|
+
const x = A.current.getBoundingClientRect(), T = Math.round(pe((l.clientX - x.left) / x.width, 0, 1) * 100), B = Math.round((1 - pe((l.clientY - x.top) / x.height, 0, 1)) * 100);
|
|
1315
|
+
$({ ...m, s: T, v: B });
|
|
1316
|
+
}, [m, $]), G = ue(async () => {
|
|
1317
|
+
if ("EyeDropper" in window)
|
|
1318
|
+
try {
|
|
1319
|
+
const l = await new window.EyeDropper().open(), x = le(l.sRGBHex);
|
|
1320
|
+
x && $(q(x));
|
|
1321
|
+
} catch {
|
|
1322
|
+
}
|
|
1323
|
+
}, [$]), W = Qe(m), j = ea(W.r, W.g, W.b), ae = oe(m), Se = oe({ ...m, a: 1 }), Y = Math.round(m.a * 100), y = [
|
|
1324
|
+
{ id: "hex", label: "Hex" },
|
|
1325
|
+
{ id: "rgb", label: "RGB" },
|
|
1326
|
+
{ id: "hsl", label: "HSL" },
|
|
1327
|
+
{ id: "hsb", label: "HSB" }
|
|
1328
|
+
], R = typeof window < "u" && "EyeDropper" in window;
|
|
1329
|
+
return /* @__PURE__ */ I(
|
|
1330
|
+
"div",
|
|
1331
|
+
{
|
|
1332
|
+
ref: O,
|
|
1333
|
+
style: { display: "inline-flex", flexDirection: n ? "row" : "column", alignItems: n ? "center" : void 0, gap: "var(--lucent-space-1)", position: "relative", ...i },
|
|
1334
|
+
children: [
|
|
1335
|
+
/* @__PURE__ */ p("style", { children: `
|
|
1336
|
+
.lucent-cp-field::-webkit-outer-spin-button,
|
|
1337
|
+
.lucent-cp-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
|
|
1338
|
+
.lucent-cp-field { -moz-appearance: textfield; }
|
|
1339
|
+
` }),
|
|
1340
|
+
s && !n && /* @__PURE__ */ p(
|
|
1341
|
+
"label",
|
|
1342
|
+
{
|
|
1343
|
+
htmlFor: `${h}-swatch`,
|
|
1344
|
+
style: {
|
|
1345
|
+
fontSize: a === "sm" ? "var(--lucent-font-size-xs)" : "var(--lucent-font-size-sm)",
|
|
1346
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
1347
|
+
color: r ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
1348
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
1349
|
+
},
|
|
1350
|
+
children: s
|
|
1351
|
+
}
|
|
1352
|
+
),
|
|
1353
|
+
/* @__PURE__ */ p(
|
|
1354
|
+
de,
|
|
1355
|
+
{
|
|
1356
|
+
id: `${h}-swatch`,
|
|
1357
|
+
color: `rgba(${W.r},${W.g},${W.b},${m.a})`,
|
|
1358
|
+
shape: "square",
|
|
1359
|
+
showCheckerboard: !0,
|
|
1360
|
+
disabled: r,
|
|
1361
|
+
onClick: () => w((l) => !l),
|
|
1362
|
+
"aria-expanded": f,
|
|
1363
|
+
"aria-haspopup": "dialog",
|
|
1364
|
+
style: {
|
|
1365
|
+
width: d,
|
|
1366
|
+
height: d,
|
|
1367
|
+
borderRadius: a === "sm" ? "var(--lucent-radius-md)" : "var(--lucent-radius-lg)",
|
|
1368
|
+
boxShadow: f ? "inset 0 0 0 2px var(--lucent-accent-border), 0 0 0 3px var(--lucent-accent-subtle)" : "inset 0 0 0 1px rgba(0,0,0,0.2)"
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
),
|
|
1372
|
+
s && n && /* @__PURE__ */ p(
|
|
1373
|
+
"label",
|
|
1374
|
+
{
|
|
1375
|
+
htmlFor: `${h}-swatch`,
|
|
1376
|
+
style: {
|
|
1377
|
+
fontSize: a === "sm" ? "var(--lucent-font-size-xs)" : "var(--lucent-font-size-sm)",
|
|
1378
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
1379
|
+
color: r ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
1380
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1381
|
+
cursor: "pointer"
|
|
1382
|
+
},
|
|
1383
|
+
children: s
|
|
1384
|
+
}
|
|
1385
|
+
),
|
|
1386
|
+
f && wt(
|
|
1387
|
+
/* @__PURE__ */ I(
|
|
1388
|
+
"div",
|
|
1389
|
+
{
|
|
1390
|
+
ref: N,
|
|
1391
|
+
role: "dialog",
|
|
1392
|
+
"aria-label": "Color picker",
|
|
1393
|
+
style: {
|
|
1394
|
+
position: "fixed",
|
|
1395
|
+
top: Z.top,
|
|
1396
|
+
left: Z.left,
|
|
1397
|
+
zIndex: 999999,
|
|
1398
|
+
background: "color-mix(in srgb, var(--lucent-surface-overlay) 85%, transparent)",
|
|
1399
|
+
backdropFilter: "blur(6px)",
|
|
1400
|
+
WebkitBackdropFilter: "blur(6px)",
|
|
1401
|
+
border: "1px solid color-mix(in srgb, var(--lucent-accent-default) 15%, var(--lucent-border-default))",
|
|
1402
|
+
borderRadius: "var(--lucent-radius-xl)",
|
|
1403
|
+
boxShadow: "0 0 24px -4px color-mix(in srgb, var(--lucent-accent-default) 12%, transparent), var(--lucent-shadow-md)",
|
|
1404
|
+
width: 280,
|
|
1405
|
+
overflow: "hidden",
|
|
1406
|
+
display: "flex",
|
|
1407
|
+
flexDirection: "column"
|
|
1408
|
+
},
|
|
1409
|
+
children: [
|
|
1410
|
+
/* @__PURE__ */ I(
|
|
1411
|
+
"div",
|
|
1412
|
+
{
|
|
1413
|
+
ref: A,
|
|
1414
|
+
style: {
|
|
1415
|
+
position: "relative",
|
|
1416
|
+
height: 160,
|
|
1417
|
+
background: `hsl(${m.h}, 100%, 50%)`,
|
|
1418
|
+
cursor: "crosshair",
|
|
1419
|
+
userSelect: "none",
|
|
1420
|
+
flexShrink: 0
|
|
1421
|
+
},
|
|
1422
|
+
onPointerDown: (l) => {
|
|
1423
|
+
l.currentTarget.setPointerCapture(l.pointerId), E(l);
|
|
1424
|
+
},
|
|
1425
|
+
onPointerMove: (l) => {
|
|
1426
|
+
l.buttons > 0 && E(l);
|
|
1427
|
+
},
|
|
1428
|
+
children: [
|
|
1429
|
+
/* @__PURE__ */ p("div", { style: { position: "absolute", inset: 0, background: "linear-gradient(to right, #fff, transparent)" } }),
|
|
1430
|
+
/* @__PURE__ */ p("div", { style: { position: "absolute", inset: 0, background: "linear-gradient(to bottom, transparent, #000)" } }),
|
|
1431
|
+
/* @__PURE__ */ p("div", { style: {
|
|
1432
|
+
position: "absolute",
|
|
1433
|
+
left: `${m.s}%`,
|
|
1434
|
+
top: `${100 - m.v}%`,
|
|
1435
|
+
transform: "translate(-50%, -50%)",
|
|
1436
|
+
width: 14,
|
|
1437
|
+
height: 14,
|
|
1438
|
+
borderRadius: "50%",
|
|
1439
|
+
border: "2px solid #fff",
|
|
1440
|
+
boxShadow: "0 0 0 1px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.35)",
|
|
1441
|
+
pointerEvents: "none"
|
|
1442
|
+
} })
|
|
1443
|
+
]
|
|
1444
|
+
}
|
|
1445
|
+
),
|
|
1446
|
+
/* @__PURE__ */ I("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1447
|
+
/* @__PURE__ */ I("div", { style: { display: "flex", gap: 10, alignItems: "center" }, children: [
|
|
1448
|
+
/* @__PURE__ */ p(
|
|
1449
|
+
de,
|
|
1450
|
+
{
|
|
1451
|
+
color: `rgba(${W.r},${W.g},${W.b},${m.a})`,
|
|
1452
|
+
shape: "square",
|
|
1453
|
+
showCheckerboard: !0,
|
|
1454
|
+
style: { width: 44, height: 44, borderRadius: 8 }
|
|
1455
|
+
}
|
|
1456
|
+
),
|
|
1457
|
+
/* @__PURE__ */ I("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1458
|
+
/* @__PURE__ */ p(
|
|
1459
|
+
Xe,
|
|
1460
|
+
{
|
|
1461
|
+
value: m.h,
|
|
1462
|
+
min: 0,
|
|
1463
|
+
max: 360,
|
|
1464
|
+
onChange: (l) => $({ ...m, h: Math.round(l) }),
|
|
1465
|
+
trackStyle: { background: "linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)" },
|
|
1466
|
+
formatTooltip: (l) => `${Math.round(l)}°`
|
|
1467
|
+
}
|
|
1468
|
+
),
|
|
1469
|
+
/* @__PURE__ */ I("div", { style: { position: "relative", borderRadius: 6, overflow: "hidden" }, children: [
|
|
1470
|
+
/* @__PURE__ */ p("div", { style: {
|
|
1471
|
+
position: "absolute",
|
|
1472
|
+
inset: 0,
|
|
1473
|
+
backgroundImage: aa,
|
|
1474
|
+
backgroundSize: "8px 8px",
|
|
1475
|
+
backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0",
|
|
1476
|
+
backgroundColor: "#fff"
|
|
1477
|
+
} }),
|
|
1478
|
+
/* @__PURE__ */ p("div", { style: { position: "absolute", inset: 0, background: `linear-gradient(to right, transparent, ${Se})` } }),
|
|
1479
|
+
/* @__PURE__ */ p(
|
|
1480
|
+
Xe,
|
|
1481
|
+
{
|
|
1482
|
+
value: m.a,
|
|
1483
|
+
min: 0,
|
|
1484
|
+
max: 1,
|
|
1485
|
+
onChange: (l) => $({ ...m, a: Math.round(l * 100) / 100 }),
|
|
1486
|
+
trackStyle: { background: "transparent", position: "relative", zIndex: 1 },
|
|
1487
|
+
formatTooltip: (l) => `${Math.round(l * 100)}%`
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
] })
|
|
1491
|
+
] })
|
|
1492
|
+
] }),
|
|
1493
|
+
/* @__PURE__ */ p(
|
|
1494
|
+
Ze,
|
|
1495
|
+
{
|
|
1496
|
+
size: "sm",
|
|
1497
|
+
value: S,
|
|
1498
|
+
onChange: (l) => k(l),
|
|
1499
|
+
options: y.map(({ id: l, label: x }) => ({ value: l, label: x }))
|
|
1500
|
+
}
|
|
1501
|
+
),
|
|
1502
|
+
S === "hex" && /* @__PURE__ */ I("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
1503
|
+
/* @__PURE__ */ p(
|
|
1504
|
+
Ke,
|
|
1505
|
+
{
|
|
1506
|
+
variant: "secondary",
|
|
1507
|
+
size: "sm",
|
|
1508
|
+
onClick: G,
|
|
1509
|
+
disabled: !R,
|
|
1510
|
+
title: R ? "Pick color from screen" : "Not supported in this browser",
|
|
1511
|
+
leftIcon: /* @__PURE__ */ p(na, {}),
|
|
1512
|
+
style: { flexShrink: 0, paddingLeft: 8, paddingRight: 8 }
|
|
1513
|
+
}
|
|
1514
|
+
),
|
|
1515
|
+
/* @__PURE__ */ p(
|
|
1516
|
+
te,
|
|
1517
|
+
{
|
|
1518
|
+
size: "sm",
|
|
1519
|
+
prefix: "#",
|
|
1520
|
+
value: L,
|
|
1521
|
+
onChange: (l) => {
|
|
1522
|
+
const x = l.target.value.replace("#", "");
|
|
1523
|
+
X(x.toUpperCase());
|
|
1524
|
+
const T = le(`#${x}`);
|
|
1525
|
+
if (T) {
|
|
1526
|
+
const B = q(T);
|
|
1527
|
+
D(B), t == null || t($e(T));
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
spellCheck: !1,
|
|
1531
|
+
placeholder: "000000",
|
|
1532
|
+
maxLength: 8,
|
|
1533
|
+
style: { flex: 1 }
|
|
1534
|
+
}
|
|
1535
|
+
),
|
|
1536
|
+
/* @__PURE__ */ p(
|
|
1537
|
+
te,
|
|
1538
|
+
{
|
|
1539
|
+
size: "sm",
|
|
1540
|
+
type: "number",
|
|
1541
|
+
suffix: "%",
|
|
1542
|
+
value: Y,
|
|
1543
|
+
min: 0,
|
|
1544
|
+
max: 100,
|
|
1545
|
+
onChange: (l) => {
|
|
1546
|
+
const x = +l.target.value;
|
|
1547
|
+
!isNaN(x) && x >= 0 && x <= 100 && $({ ...m, a: x / 100 });
|
|
1548
|
+
},
|
|
1549
|
+
className: "lucent-cp-field",
|
|
1550
|
+
style: { width: 68, flexShrink: 0 }
|
|
1551
|
+
}
|
|
1552
|
+
)
|
|
1553
|
+
] }),
|
|
1554
|
+
S === "rgb" && /* @__PURE__ */ p("div", { style: { display: "flex", gap: 6 }, children: [
|
|
1555
|
+
{ label: "R", val: W.r, max: 255, fn: (l) => $(q({ ...W, r: l })) },
|
|
1556
|
+
{ label: "G", val: W.g, max: 255, fn: (l) => $(q({ ...W, g: l })) },
|
|
1557
|
+
{ label: "B", val: W.b, max: 255, fn: (l) => $(q({ ...W, b: l })) },
|
|
1558
|
+
{ label: "A", val: Y, max: 100, fn: (l) => $({ ...m, a: l / 100 }) }
|
|
1559
|
+
].map(({ label: l, val: x, max: T, fn: B }) => /* @__PURE__ */ p(te, { size: "sm", type: "number", prefix: l, value: x, min: 0, max: T, onChange: (H) => {
|
|
1560
|
+
const P = +H.target.value;
|
|
1561
|
+
!isNaN(P) && P >= 0 && P <= T && B(P);
|
|
1562
|
+
}, className: "lucent-cp-field", style: { flex: 1 } }, l)) }),
|
|
1563
|
+
S === "hsl" && /* @__PURE__ */ p("div", { style: { display: "flex", gap: 6 }, children: [
|
|
1564
|
+
{ label: "H", val: j.h, max: 360, fn: (l) => {
|
|
1565
|
+
const { r: x, g: T, b: B } = fe(l, j.s, j.l);
|
|
1566
|
+
$(q({ r: x, g: T, b: B, a: m.a }));
|
|
1567
|
+
} },
|
|
1568
|
+
{ label: "S", val: j.s, max: 100, fn: (l) => {
|
|
1569
|
+
const { r: x, g: T, b: B } = fe(j.h, l, j.l);
|
|
1570
|
+
$(q({ r: x, g: T, b: B, a: m.a }));
|
|
1571
|
+
} },
|
|
1572
|
+
{ label: "L", val: j.l, max: 100, fn: (l) => {
|
|
1573
|
+
const { r: x, g: T, b: B } = fe(j.h, j.s, l);
|
|
1574
|
+
$(q({ r: x, g: T, b: B, a: m.a }));
|
|
1575
|
+
} },
|
|
1576
|
+
{ label: "A", val: Y, max: 100, fn: (l) => $({ ...m, a: l / 100 }) }
|
|
1577
|
+
].map(({ label: l, val: x, max: T, fn: B }) => /* @__PURE__ */ p(te, { size: "sm", type: "number", prefix: l, value: x, min: 0, max: T, onChange: (H) => {
|
|
1578
|
+
const P = +H.target.value;
|
|
1579
|
+
!isNaN(P) && P >= 0 && P <= T && B(P);
|
|
1580
|
+
}, className: "lucent-cp-field", style: { flex: 1 } }, l)) }),
|
|
1581
|
+
S === "hsb" && /* @__PURE__ */ p("div", { style: { display: "flex", gap: 6 }, children: [
|
|
1582
|
+
{ label: "H", val: m.h, max: 360, fn: (l) => $({ ...m, h: l }) },
|
|
1583
|
+
{ label: "S", val: m.s, max: 100, fn: (l) => $({ ...m, s: l }) },
|
|
1584
|
+
{ label: "B", val: m.v, max: 100, fn: (l) => $({ ...m, v: l }) },
|
|
1585
|
+
{ label: "A", val: Y, max: 100, fn: (l) => $({ ...m, a: l / 100 }) }
|
|
1586
|
+
].map(({ label: l, val: x, max: T, fn: B }) => /* @__PURE__ */ p(te, { size: "sm", type: "number", prefix: l, value: x, min: 0, max: T, onChange: (H) => {
|
|
1587
|
+
const P = +H.target.value;
|
|
1588
|
+
!isNaN(P) && P >= 0 && P <= T && B(P);
|
|
1589
|
+
}, className: "lucent-cp-field", style: { flex: 1 } }, l)) }),
|
|
1590
|
+
o.length > 0 && /* @__PURE__ */ I("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1591
|
+
o.length > 1 && /* @__PURE__ */ p(
|
|
1592
|
+
Ye,
|
|
1593
|
+
{
|
|
1594
|
+
size: "sm",
|
|
1595
|
+
value: String(v),
|
|
1596
|
+
onChange: (l) => b(Number(l.target.value)),
|
|
1597
|
+
options: o.map((l, x) => ({ value: String(x), label: l.label }))
|
|
1598
|
+
}
|
|
1599
|
+
),
|
|
1600
|
+
o.length === 1 && /* @__PURE__ */ p("span", { style: {
|
|
1601
|
+
fontSize: "var(--lucent-font-size-xs)",
|
|
1602
|
+
fontWeight: "var(--lucent-font-weight-medium)",
|
|
1603
|
+
color: "var(--lucent-text-secondary)",
|
|
1604
|
+
fontFamily: "var(--lucent-font-family-base)"
|
|
1605
|
+
}, children: (M = o[0]) == null ? void 0 : M.label }),
|
|
1606
|
+
/* @__PURE__ */ p("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: (((F = o[v]) == null ? void 0 : F.colors) ?? []).map((l) => {
|
|
1607
|
+
const x = Le(l).toLowerCase() === ae.slice(0, 7).toLowerCase();
|
|
1608
|
+
return /* @__PURE__ */ p(
|
|
1609
|
+
de,
|
|
1610
|
+
{
|
|
1611
|
+
color: l,
|
|
1612
|
+
selected: x,
|
|
1613
|
+
onClick: () => $(q(Je(l)))
|
|
1614
|
+
},
|
|
1615
|
+
l
|
|
1616
|
+
);
|
|
1617
|
+
}) })
|
|
1618
|
+
] })
|
|
1619
|
+
] })
|
|
1620
|
+
]
|
|
1621
|
+
}
|
|
1622
|
+
),
|
|
1623
|
+
c ?? document.body
|
|
1624
|
+
)
|
|
1625
|
+
]
|
|
1626
|
+
}
|
|
1627
|
+
);
|
|
1628
|
+
}
|
|
1629
|
+
ra.displayName = "ColorPicker";
|
|
1630
|
+
function dn({ tabs: e, defaultValue: t, value: s, onChange: a, variant: n = "underline", style: r }) {
|
|
1631
|
+
var Y;
|
|
1632
|
+
const o = s !== void 0, [c, u] = C(t ?? ((Y = e[0]) == null ? void 0 : Y.value) ?? ""), i = o ? s : c, [d, g] = C(null), h = U([]), [f, w] = C(null), S = U(!1), k = n === "pills", v = U(null), b = U(null), m = U(null), [D, L] = C(e.length), [X, O] = C(!1), [A, N] = C(!1), [Z, K] = C(null), $ = e.slice(0, D), E = e.slice(D), G = E.length > 0, W = E.some((y) => y.value === i), j = () => {
|
|
1633
|
+
if (W) {
|
|
1634
|
+
w(null);
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
const y = e.findIndex((M, F) => F < D && M.value === i), R = h.current[y];
|
|
1638
|
+
if (R) {
|
|
1639
|
+
if (k) {
|
|
1640
|
+
const M = R.querySelector("span");
|
|
1641
|
+
if (!M) return;
|
|
1642
|
+
w({ left: M.offsetLeft + R.offsetLeft, width: M.offsetWidth, animate: S.current });
|
|
1643
|
+
} else
|
|
1644
|
+
w({ left: R.offsetLeft, width: R.offsetWidth, animate: S.current });
|
|
1645
|
+
S.current = !0;
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
me(() => {
|
|
1649
|
+
j(), document.fonts.ready.then(j);
|
|
1650
|
+
}, [i, D, k]), ne(() => {
|
|
1651
|
+
const y = v.current;
|
|
1652
|
+
if (!y) return;
|
|
1653
|
+
const R = () => {
|
|
1654
|
+
const x = y.clientWidth, T = 70;
|
|
1655
|
+
let B = 0, H = 0;
|
|
1656
|
+
for (let P = 0; P < e.length; P++) {
|
|
1657
|
+
const J = h.current[P];
|
|
1658
|
+
if (!J) {
|
|
1659
|
+
H++;
|
|
1660
|
+
continue;
|
|
1661
|
+
}
|
|
1662
|
+
const Q = J.offsetWidth;
|
|
1663
|
+
if (P < e.length - 1) {
|
|
1664
|
+
if (B + Q + T > x) break;
|
|
1665
|
+
} else if (B + Q > x) break;
|
|
1666
|
+
B += Q, H++;
|
|
1667
|
+
}
|
|
1668
|
+
if (H >= e.length - 1 && H < e.length) {
|
|
1669
|
+
let P = 0;
|
|
1670
|
+
for (let J = 0; J < e.length; J++) {
|
|
1671
|
+
const Q = h.current[J];
|
|
1672
|
+
Q && (P += Q.offsetWidth);
|
|
1673
|
+
}
|
|
1674
|
+
P <= x && (H = e.length);
|
|
1675
|
+
}
|
|
1676
|
+
L(H < 1 ? 1 : H);
|
|
1677
|
+
};
|
|
1678
|
+
let M;
|
|
1679
|
+
(() => {
|
|
1680
|
+
M = requestAnimationFrame(() => {
|
|
1681
|
+
M = requestAnimationFrame(R);
|
|
1682
|
+
});
|
|
1683
|
+
})();
|
|
1684
|
+
const l = new ResizeObserver(R);
|
|
1685
|
+
return l.observe(y), () => {
|
|
1686
|
+
l.disconnect(), cancelAnimationFrame(M);
|
|
1687
|
+
};
|
|
1688
|
+
}, [e]), ne(() => {
|
|
1689
|
+
if (!X) return;
|
|
1690
|
+
const y = (R) => {
|
|
1691
|
+
m.current && !m.current.contains(R.target) && b.current && !b.current.contains(R.target) && (O(!1), K(null));
|
|
1692
|
+
};
|
|
1693
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
1694
|
+
}, [X]);
|
|
1695
|
+
const ae = (y) => {
|
|
1696
|
+
o || u(y), a == null || a(y);
|
|
1697
|
+
}, Se = (y, R) => {
|
|
1698
|
+
var x;
|
|
1699
|
+
const M = $.map((T, B) => T.disabled ? -1 : B).filter((T) => T !== -1), F = M.indexOf(R);
|
|
1700
|
+
let l = -1;
|
|
1701
|
+
y.key === "ArrowRight" && (l = M[(F + 1) % M.length] ?? -1), y.key === "ArrowLeft" && (l = M[(F - 1 + M.length) % M.length] ?? -1), y.key === "Home" && (l = M[0] ?? -1), y.key === "End" && (l = M[M.length - 1] ?? -1), l !== -1 && (y.preventDefault(), (x = h.current[l]) == null || x.focus(), ae($[l].value));
|
|
1702
|
+
};
|
|
1703
|
+
return /* @__PURE__ */ I("div", { style: { display: "flex", flexDirection: "column", position: "relative", ...r }, children: [
|
|
1704
|
+
/* @__PURE__ */ I(
|
|
1705
|
+
"div",
|
|
1706
|
+
{
|
|
1707
|
+
ref: v,
|
|
1708
|
+
role: "tablist",
|
|
1709
|
+
style: {
|
|
1710
|
+
position: "relative",
|
|
1711
|
+
display: "flex",
|
|
1712
|
+
overflow: "hidden",
|
|
1713
|
+
...k ? {
|
|
1714
|
+
padding: "var(--lucent-space-1)"
|
|
1715
|
+
} : {
|
|
1716
|
+
borderBottom: "1px solid var(--lucent-border-default)"
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
children: [
|
|
1720
|
+
e.map((y, R) => {
|
|
1721
|
+
const M = R < D, F = y.value === i, l = y.disabled ?? !1;
|
|
1722
|
+
return /* @__PURE__ */ I(
|
|
1723
|
+
"button",
|
|
1724
|
+
{
|
|
1725
|
+
ref: (x) => {
|
|
1726
|
+
h.current[R] = x;
|
|
1727
|
+
},
|
|
1728
|
+
role: "tab",
|
|
1729
|
+
"aria-selected": F,
|
|
1730
|
+
"aria-controls": `lucent-tabpanel-${y.value}`,
|
|
1731
|
+
id: `lucent-tab-${y.value}`,
|
|
1732
|
+
disabled: l,
|
|
1733
|
+
tabIndex: F && M ? 0 : -1,
|
|
1734
|
+
onClick: () => {
|
|
1735
|
+
l || ae(y.value);
|
|
1736
|
+
},
|
|
1737
|
+
onKeyDown: (x) => Se(x, R),
|
|
1738
|
+
onMouseEnter: () => {
|
|
1739
|
+
!l && M && g(R);
|
|
1740
|
+
},
|
|
1741
|
+
onMouseLeave: () => g(null),
|
|
1742
|
+
style: {
|
|
1743
|
+
padding: k ? "var(--lucent-space-1) var(--lucent-space-2)" : "var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-3)",
|
|
1744
|
+
background: "none",
|
|
1745
|
+
border: "none",
|
|
1746
|
+
cursor: l ? "not-allowed" : "pointer",
|
|
1747
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1748
|
+
fontSize: "var(--lucent-font-size-md)",
|
|
1749
|
+
fontWeight: F ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
1750
|
+
color: l ? "var(--lucent-text-disabled)" : k && F ? "var(--lucent-accent-fg)" : F ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
|
|
1751
|
+
transition: "color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
1752
|
+
whiteSpace: "nowrap",
|
|
1753
|
+
outline: "none",
|
|
1754
|
+
position: M ? "relative" : "absolute",
|
|
1755
|
+
zIndex: F ? 1 : 0,
|
|
1756
|
+
// Hidden overflow tabs are positioned off-screen for measurement
|
|
1757
|
+
...M ? {} : { visibility: "hidden", pointerEvents: "none", left: -9999 }
|
|
1758
|
+
},
|
|
1759
|
+
children: [
|
|
1760
|
+
/* @__PURE__ */ p("span", { style: {
|
|
1761
|
+
display: "block",
|
|
1762
|
+
padding: "var(--lucent-space-1) var(--lucent-space-3)",
|
|
1763
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1764
|
+
background: !k && d === R && !F && !l ? "var(--lucent-surface-secondary)" : "transparent",
|
|
1765
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
1766
|
+
}, children: y.label }),
|
|
1767
|
+
k && d === R && !F && !l && M && /* @__PURE__ */ p(
|
|
1768
|
+
"span",
|
|
1769
|
+
{
|
|
1770
|
+
"aria-hidden": !0,
|
|
1771
|
+
style: {
|
|
1772
|
+
position: "absolute",
|
|
1773
|
+
top: 0,
|
|
1774
|
+
bottom: 0,
|
|
1775
|
+
left: 0,
|
|
1776
|
+
right: 0,
|
|
1777
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1778
|
+
background: "var(--lucent-surface-secondary)",
|
|
1779
|
+
zIndex: -1,
|
|
1780
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
)
|
|
1784
|
+
]
|
|
1785
|
+
},
|
|
1786
|
+
y.value
|
|
1787
|
+
);
|
|
1788
|
+
}),
|
|
1789
|
+
G && /* @__PURE__ */ p(
|
|
1790
|
+
"button",
|
|
1791
|
+
{
|
|
1792
|
+
ref: b,
|
|
1793
|
+
onClick: () => O((y) => !y),
|
|
1794
|
+
onMouseEnter: () => N(!0),
|
|
1795
|
+
onMouseLeave: () => N(!1),
|
|
1796
|
+
style: {
|
|
1797
|
+
padding: k ? "var(--lucent-space-1) var(--lucent-space-2)" : "var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-3)",
|
|
1798
|
+
background: "none",
|
|
1799
|
+
border: "none",
|
|
1800
|
+
cursor: "pointer",
|
|
1801
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1802
|
+
fontSize: "var(--lucent-font-size-md)",
|
|
1803
|
+
fontWeight: W ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
1804
|
+
color: W ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
|
|
1805
|
+
whiteSpace: "nowrap",
|
|
1806
|
+
outline: "none",
|
|
1807
|
+
position: "relative",
|
|
1808
|
+
flexShrink: 0
|
|
1809
|
+
},
|
|
1810
|
+
children: /* @__PURE__ */ p("span", { style: {
|
|
1811
|
+
display: "block",
|
|
1812
|
+
padding: "var(--lucent-space-1) var(--lucent-space-3)",
|
|
1813
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1814
|
+
background: A ? "var(--lucent-surface-secondary)" : "transparent",
|
|
1815
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
1816
|
+
}, children: "More…" })
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
f != null && /* @__PURE__ */ p(
|
|
1820
|
+
"span",
|
|
1821
|
+
{
|
|
1822
|
+
"aria-hidden": !0,
|
|
1823
|
+
style: k ? {
|
|
1824
|
+
position: "absolute",
|
|
1825
|
+
top: "var(--lucent-space-1)",
|
|
1826
|
+
bottom: "var(--lucent-space-1)",
|
|
1827
|
+
left: f.left,
|
|
1828
|
+
width: f.width,
|
|
1829
|
+
background: "var(--lucent-accent-default)",
|
|
1830
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1831
|
+
transition: f.animate ? "left 220ms var(--lucent-easing-default), width 220ms var(--lucent-easing-default)" : "none"
|
|
1832
|
+
} : {
|
|
1833
|
+
position: "absolute",
|
|
1834
|
+
bottom: 0,
|
|
1835
|
+
left: f.left,
|
|
1836
|
+
width: f.width,
|
|
1837
|
+
height: 2,
|
|
1838
|
+
background: "var(--lucent-accent-default)",
|
|
1839
|
+
borderRadius: "var(--lucent-radius-sm)",
|
|
1840
|
+
transition: f.animate ? "left 220ms var(--lucent-easing-default), width 220ms var(--lucent-easing-default)" : "none"
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
)
|
|
1844
|
+
]
|
|
1845
|
+
}
|
|
1846
|
+
),
|
|
1847
|
+
G && X && /* @__PURE__ */ p(
|
|
1848
|
+
"div",
|
|
1849
|
+
{
|
|
1850
|
+
ref: m,
|
|
1851
|
+
style: {
|
|
1852
|
+
position: "absolute",
|
|
1853
|
+
top: "100%",
|
|
1854
|
+
right: 0,
|
|
1855
|
+
zIndex: 50,
|
|
1856
|
+
marginTop: "var(--lucent-space-1)",
|
|
1857
|
+
background: "var(--lucent-surface-primary)",
|
|
1858
|
+
border: "1px solid var(--lucent-border-default)",
|
|
1859
|
+
borderRadius: "var(--lucent-radius-md)",
|
|
1860
|
+
boxShadow: "var(--lucent-shadow-md)",
|
|
1861
|
+
padding: "var(--lucent-space-1) 0",
|
|
1862
|
+
minWidth: 140
|
|
1863
|
+
},
|
|
1864
|
+
children: E.map((y, R) => {
|
|
1865
|
+
const M = y.value === i, F = y.disabled ?? !1, l = Z === R;
|
|
1866
|
+
return /* @__PURE__ */ p(
|
|
1867
|
+
"button",
|
|
1868
|
+
{
|
|
1869
|
+
disabled: F,
|
|
1870
|
+
onClick: () => {
|
|
1871
|
+
F || (ae(y.value), O(!1));
|
|
1872
|
+
},
|
|
1873
|
+
onMouseEnter: () => {
|
|
1874
|
+
F || K(R);
|
|
1875
|
+
},
|
|
1876
|
+
onMouseLeave: () => K(null),
|
|
1877
|
+
style: {
|
|
1878
|
+
display: "block",
|
|
1879
|
+
width: "100%",
|
|
1880
|
+
padding: "var(--lucent-space-2) var(--lucent-space-4)",
|
|
1881
|
+
background: M || l ? "var(--lucent-surface-secondary)" : "none",
|
|
1882
|
+
border: "none",
|
|
1883
|
+
cursor: F ? "not-allowed" : "pointer",
|
|
1884
|
+
fontFamily: "var(--lucent-font-family-base)",
|
|
1885
|
+
fontSize: "var(--lucent-font-size-md)",
|
|
1886
|
+
fontWeight: M ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
1887
|
+
color: F ? "var(--lucent-text-disabled)" : M || l ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
|
|
1888
|
+
textAlign: "left",
|
|
1889
|
+
outline: "none",
|
|
1890
|
+
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default), color var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
1891
|
+
},
|
|
1892
|
+
children: y.label
|
|
1893
|
+
},
|
|
1894
|
+
y.value
|
|
1895
|
+
);
|
|
1896
|
+
})
|
|
1897
|
+
}
|
|
1898
|
+
),
|
|
1899
|
+
e.some((y) => y.content != null) && e.map((y) => /* @__PURE__ */ p(
|
|
1900
|
+
"div",
|
|
1901
|
+
{
|
|
1902
|
+
role: "tabpanel",
|
|
1903
|
+
id: `lucent-tabpanel-${y.value}`,
|
|
1904
|
+
"aria-labelledby": `lucent-tab-${y.value}`,
|
|
1905
|
+
hidden: y.value !== i,
|
|
1906
|
+
style: { padding: "var(--lucent-space-4) 0", outline: "none" },
|
|
1907
|
+
tabIndex: 0,
|
|
1908
|
+
children: y.content
|
|
1909
|
+
},
|
|
1910
|
+
y.value
|
|
1911
|
+
))
|
|
1912
|
+
] });
|
|
1913
|
+
}
|
|
1914
|
+
const sa = {
|
|
1915
|
+
fontFamilyBase: '"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
1916
|
+
fontFamilyMono: '"DM Mono", "Fira Code", "Cascadia Code", monospace',
|
|
1917
|
+
fontFamilyDisplay: '"Georama", "DM Sans", sans-serif',
|
|
1918
|
+
fontSizeXs: "0.75rem",
|
|
1919
|
+
fontSizeSm: "0.875rem",
|
|
1920
|
+
fontSizeMd: "1rem",
|
|
1921
|
+
fontSizeLg: "1.125rem",
|
|
1922
|
+
fontSizeXl: "1.25rem",
|
|
1923
|
+
fontSize2xl: "1.5rem",
|
|
1924
|
+
fontSize3xl: "1.875rem",
|
|
1925
|
+
fontWeightRegular: "400",
|
|
1926
|
+
fontWeightMedium: "500",
|
|
1927
|
+
fontWeightSemibold: "600",
|
|
1928
|
+
fontWeightBold: "700",
|
|
1929
|
+
lineHeightTight: "1.25",
|
|
1930
|
+
lineHeightBase: "1.5",
|
|
1931
|
+
lineHeightRelaxed: "1.75",
|
|
1932
|
+
letterSpacingTight: "-0.02em",
|
|
1933
|
+
letterSpacingBase: "0em",
|
|
1934
|
+
letterSpacingWide: "0.04em"
|
|
1935
|
+
}, oa = {
|
|
1936
|
+
space0: "0px",
|
|
1937
|
+
space1: "0.25rem",
|
|
1938
|
+
space2: "0.5rem",
|
|
1939
|
+
space3: "0.75rem",
|
|
1940
|
+
space4: "1rem",
|
|
1941
|
+
space5: "1.25rem",
|
|
1942
|
+
space6: "1.5rem",
|
|
1943
|
+
space8: "2rem",
|
|
1944
|
+
space10: "2.5rem",
|
|
1945
|
+
space12: "3rem",
|
|
1946
|
+
space16: "4rem",
|
|
1947
|
+
space20: "5rem",
|
|
1948
|
+
space24: "6rem"
|
|
1949
|
+
}, la = {
|
|
1950
|
+
radiusNone: "0px",
|
|
1951
|
+
radiusSm: "0.25rem",
|
|
1952
|
+
radiusMd: "0.375rem",
|
|
1953
|
+
radiusLg: "0.5rem",
|
|
1954
|
+
radiusXl: "0.75rem",
|
|
1955
|
+
radiusFull: "9999px"
|
|
1956
|
+
}, ca = {
|
|
1957
|
+
durationFast: "100ms",
|
|
1958
|
+
durationBase: "200ms",
|
|
1959
|
+
durationSlow: "350ms",
|
|
1960
|
+
easingDefault: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
1961
|
+
easingEmphasized: "cubic-bezier(0.2, 0, 0, 1)",
|
|
1962
|
+
easingDecelerate: "cubic-bezier(0, 0, 0.2, 1)"
|
|
1963
|
+
}, ia = {
|
|
1964
|
+
shadowNone: "none",
|
|
1965
|
+
shadowSm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
1966
|
+
shadowMd: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
1967
|
+
shadowLg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
1968
|
+
shadowXl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"
|
|
1969
|
+
}, ua = {
|
|
1970
|
+
shadowNone: "none",
|
|
1971
|
+
shadowSm: "inset 0 1px 0 0 rgba(255, 255, 255, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.2)",
|
|
1972
|
+
shadowMd: "inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.25)",
|
|
1973
|
+
shadowLg: "inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.3)",
|
|
1974
|
+
shadowXl: "inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.35)"
|
|
1975
|
+
}, he = {
|
|
1976
|
+
...sa,
|
|
1977
|
+
...oa,
|
|
1978
|
+
...la,
|
|
1979
|
+
...ca,
|
|
1980
|
+
...ia,
|
|
1981
|
+
// Backgrounds — page/layout layer only
|
|
1982
|
+
bgBase: "#ffffff",
|
|
1983
|
+
bgSubtle: "#f9fafb",
|
|
1984
|
+
bgOverlay: "rgb(0 0 0 / 0.4)",
|
|
1985
|
+
// Surfaces — component elevation layer
|
|
1986
|
+
surface: "#ffffff",
|
|
1987
|
+
surfaceSecondary: "#f3f4f6",
|
|
1988
|
+
surfaceRaised: "#ffffff",
|
|
1989
|
+
surfaceOverlay: "#ffffff",
|
|
1990
|
+
surfaceTint: "#f2f2f2",
|
|
1991
|
+
// adjustLightness(bgBase, -0.05) — derived when bgBase is customized
|
|
1992
|
+
// Borders
|
|
1993
|
+
borderDefault: "#e5e7eb",
|
|
1994
|
+
borderSubtle: "#f3f4f6",
|
|
1995
|
+
borderStrong: "#9ca3af",
|
|
1996
|
+
controlTrack: "#d1d5db",
|
|
1997
|
+
// Text
|
|
1998
|
+
textPrimary: "#111827",
|
|
1999
|
+
textSecondary: "#6b7280",
|
|
2000
|
+
textDisabled: "#9ca3af",
|
|
2001
|
+
textInverse: "#ffffff",
|
|
2002
|
+
// Accent (monochrome default — near-black for universal, high-contrast out of the box)
|
|
2003
|
+
// Use `brandTokens` to opt in to the gold palette.
|
|
2004
|
+
accentDefault: "#111827",
|
|
2005
|
+
accentHover: "#1f2937",
|
|
2006
|
+
accentSubtle: "#f3f4f6",
|
|
2007
|
+
// placeholder — actual value is recomputed in LucentProvider
|
|
2008
|
+
accentBorder: "#111827",
|
|
2009
|
+
accentFg: "#ffffff",
|
|
2010
|
+
// auto-recomputed by LucentProvider via getContrastText
|
|
2011
|
+
// Status
|
|
2012
|
+
successDefault: "#16a34a",
|
|
2013
|
+
successSubtle: "#f0fdf4",
|
|
2014
|
+
successText: "#15803d",
|
|
2015
|
+
warningDefault: "#d97706",
|
|
2016
|
+
warningSubtle: "#fffbeb",
|
|
2017
|
+
warningText: "#b45309",
|
|
2018
|
+
dangerDefault: "#dc2626",
|
|
2019
|
+
dangerHover: "#b91c1c",
|
|
2020
|
+
dangerSubtle: "#fef2f2",
|
|
2021
|
+
dangerText: "#b91c1c",
|
|
2022
|
+
infoDefault: "#2563eb",
|
|
2023
|
+
infoSubtle: "#eff6ff",
|
|
2024
|
+
infoText: "#1d4ed8"
|
|
2025
|
+
};
|
|
2026
|
+
function da(e) {
|
|
2027
|
+
const t = parseInt(e.slice(1, 3), 16), s = parseInt(e.slice(3, 5), 16), a = parseInt(e.slice(5, 7), 16);
|
|
2028
|
+
return { r: t, g: s, b: a };
|
|
2029
|
+
}
|
|
2030
|
+
function fa({ r: e, g: t, b: s }) {
|
|
2031
|
+
const a = (n) => n.toString(16).padStart(2, "0");
|
|
2032
|
+
return `#${a(e)}${a(t)}${a(s)}`;
|
|
2033
|
+
}
|
|
2034
|
+
function V(e) {
|
|
2035
|
+
const { r: t, g: s, b: a } = da(e), n = t / 255, r = s / 255, o = a / 255, c = Math.max(n, r, o), u = Math.min(n, r, o);
|
|
2036
|
+
let i = 0, d = 0;
|
|
2037
|
+
const g = (c + u) / 2;
|
|
2038
|
+
if (c !== u) {
|
|
2039
|
+
const h = c - u;
|
|
2040
|
+
switch (d = g > 0.5 ? h / (2 - c - u) : h / (c + u), c) {
|
|
2041
|
+
case n:
|
|
2042
|
+
i = (r - o) / h + (r < o ? 6 : 0);
|
|
2043
|
+
break;
|
|
2044
|
+
case r:
|
|
2045
|
+
i = (o - n) / h + 2;
|
|
2046
|
+
break;
|
|
2047
|
+
case o:
|
|
2048
|
+
i = (n - r) / h + 4;
|
|
2049
|
+
break;
|
|
2050
|
+
}
|
|
2051
|
+
i /= 6;
|
|
2052
|
+
}
|
|
2053
|
+
return [i * 360, d, g];
|
|
2054
|
+
}
|
|
2055
|
+
function _(e, t, s) {
|
|
2056
|
+
e = (e % 360 + 360) % 360, t = Math.min(1, Math.max(0, t)), s = Math.min(1, Math.max(0, s));
|
|
2057
|
+
const a = (1 - Math.abs(2 * s - 1)) * t, n = a * (1 - Math.abs(e / 60 % 2 - 1)), r = s - a / 2;
|
|
2058
|
+
let o = 0, c = 0, u = 0;
|
|
2059
|
+
return e < 60 ? (o = a, c = n) : e < 120 ? (o = n, c = a) : e < 180 ? (c = a, u = n) : e < 240 ? (c = n, u = a) : e < 300 ? (o = n, u = a) : (o = a, u = n), fa({ r: Math.round((o + r) * 255), g: Math.round((c + r) * 255), b: Math.round((u + r) * 255) });
|
|
2060
|
+
}
|
|
2061
|
+
function z(e, t) {
|
|
2062
|
+
const [s, a, n] = V(e);
|
|
2063
|
+
return _(s, a, Math.min(1, Math.max(0, n + t)));
|
|
2064
|
+
}
|
|
2065
|
+
const pa = 222, ga = 0.12;
|
|
2066
|
+
function et(e, t) {
|
|
2067
|
+
return t < 0.04 ? [pa, ga] : [e, t];
|
|
2068
|
+
}
|
|
2069
|
+
function ba(e) {
|
|
2070
|
+
const [t, s, a] = V(e), [n, r] = et(t, s);
|
|
2071
|
+
return _(n, r, Math.max(0.04, Math.min(0.2, 0.07 + (1 - a))));
|
|
2072
|
+
}
|
|
2073
|
+
function Te(e) {
|
|
2074
|
+
const [t, s, a] = V(e), [n, r] = et(t, s);
|
|
2075
|
+
return _(n, r, Math.max(0.06, Math.min(0.5, (1 - a) * 0.6 + 0.06)));
|
|
2076
|
+
}
|
|
2077
|
+
function Ie(e) {
|
|
2078
|
+
const [t, s, a] = V(e);
|
|
2079
|
+
return _(t, s, Math.max(0.04, Math.min(0.97, 1 - a + 0.04)));
|
|
2080
|
+
}
|
|
2081
|
+
function Be(e) {
|
|
2082
|
+
const [t, s, a] = V(e);
|
|
2083
|
+
return _(t, s, Math.max(0.02, Math.min(0.98, 1 - a)));
|
|
2084
|
+
}
|
|
2085
|
+
function xa(e) {
|
|
2086
|
+
const t = ba(e.bgBase), [s, a, n] = V(t), r = (o) => _(s, a, Math.min(0.25, n + o));
|
|
2087
|
+
return {
|
|
2088
|
+
// ── Non-color tokens: carry over from light unchanged ──────────────────
|
|
2089
|
+
...e,
|
|
2090
|
+
// ── Shadows: dark variants have higher opacity for visibility ───────────
|
|
2091
|
+
...ua,
|
|
2092
|
+
// ── Backgrounds ─────────────────────────────────────────────────────────
|
|
2093
|
+
bgBase: t,
|
|
2094
|
+
bgSubtle: r(0.02),
|
|
2095
|
+
bgOverlay: "rgb(0 0 0 / 0.6)",
|
|
2096
|
+
// ── Surfaces: slight elevation steps above bgBase ────────────────────────
|
|
2097
|
+
surface: r(0.02),
|
|
2098
|
+
surfaceSecondary: r(0.05),
|
|
2099
|
+
surfaceRaised: r(0.08),
|
|
2100
|
+
surfaceOverlay: r(0.08),
|
|
2101
|
+
surfaceTint: r(0.03),
|
|
2102
|
+
// ── Borders ──────────────────────────────────────────────────────────────
|
|
2103
|
+
borderDefault: Te(e.borderDefault),
|
|
2104
|
+
borderSubtle: Te(e.borderSubtle),
|
|
2105
|
+
borderStrong: Te(e.borderStrong),
|
|
2106
|
+
controlTrack: r(0.1),
|
|
2107
|
+
// ── Text ─────────────────────────────────────────────────────────────────
|
|
2108
|
+
textPrimary: Ie(e.textPrimary),
|
|
2109
|
+
textSecondary: Ie(e.textSecondary),
|
|
2110
|
+
textDisabled: Ie(e.textDisabled),
|
|
2111
|
+
// textInverse flips to dark bg so it reads on light accent surfaces
|
|
2112
|
+
textInverse: t,
|
|
2113
|
+
// ── Accent ───────────────────────────────────────────────────────────────
|
|
2114
|
+
accentDefault: Be(e.accentDefault),
|
|
2115
|
+
accentHover: Be(e.accentHover),
|
|
2116
|
+
accentSubtle: Be(e.accentSubtle),
|
|
2117
|
+
accentBorder: e.accentBorder,
|
|
2118
|
+
// auto-recomputed by LucentProvider
|
|
2119
|
+
accentFg: e.accentFg,
|
|
2120
|
+
// auto-recomputed by LucentProvider
|
|
2121
|
+
// ── Status: lighten defaults for visibility; darken for subtle bg ─────────
|
|
2122
|
+
successDefault: z(e.successDefault, 0.1),
|
|
2123
|
+
successSubtle: z(e.successDefault, -0.25),
|
|
2124
|
+
successText: z(e.successText, 0.15),
|
|
2125
|
+
warningDefault: z(e.warningDefault, 0.1),
|
|
2126
|
+
warningSubtle: z(e.warningDefault, -0.25),
|
|
2127
|
+
warningText: z(e.warningText, 0.15),
|
|
2128
|
+
dangerDefault: z(e.dangerDefault, 0.1),
|
|
2129
|
+
dangerHover: z(e.dangerHover, 0.1),
|
|
2130
|
+
dangerSubtle: z(e.dangerDefault, -0.25),
|
|
2131
|
+
dangerText: z(e.dangerText, 0.15),
|
|
2132
|
+
infoDefault: z(e.infoDefault, 0.1),
|
|
2133
|
+
infoSubtle: z(e.infoDefault, -0.25),
|
|
2134
|
+
infoText: z(e.infoText, 0.15)
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
const tt = xa(he);
|
|
2138
|
+
function ma(e) {
|
|
2139
|
+
return "--lucent-" + e.replace(/([A-Z])/g, (t) => `-${t.toLowerCase()}`).replace(/([a-z])(\d)/g, (t, s, a) => `${s}-${a}`);
|
|
2140
|
+
}
|
|
2141
|
+
function ha(e, t = ":root") {
|
|
2142
|
+
const s = Object.entries(e).map(([a, n]) => ` ${ma(a)}: ${n};`).join(`
|
|
2143
|
+
`);
|
|
2144
|
+
return `${t} {
|
|
2145
|
+
${s}
|
|
2146
|
+
}`;
|
|
2147
|
+
}
|
|
2148
|
+
function va(e) {
|
|
2149
|
+
const t = parseInt(e.slice(1, 3), 16) / 255, s = parseInt(e.slice(3, 5), 16) / 255, a = parseInt(e.slice(5, 7), 16) / 255, n = (r) => r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
2150
|
+
return 0.2126 * n(t) + 0.7152 * n(s) + 0.0722 * n(a);
|
|
2151
|
+
}
|
|
2152
|
+
const ya = 0.2126729, wa = 0.7151522, ka = 0.072175, Da = 0.56, Sa = 0.57, Ma = 0.65, za = 0.62, je = 0.022, Ta = 1.414, Ia = 1.14, Ba = 1.14, Ue = 0.027, qe = 0.027;
|
|
2153
|
+
function Ge(e) {
|
|
2154
|
+
const t = parseInt(e.slice(1, 3), 16) / 255, s = parseInt(e.slice(3, 5), 16) / 255, a = parseInt(e.slice(5, 7), 16) / 255, n = Math.pow(t, 2.4), r = Math.pow(s, 2.4), o = Math.pow(a, 2.4);
|
|
2155
|
+
let c = ya * n + wa * r + ka * o;
|
|
2156
|
+
return c < 0 && (c = 0), c < je ? c + Math.pow(je - c, Ta) : c;
|
|
2157
|
+
}
|
|
2158
|
+
function ge(e, t) {
|
|
2159
|
+
const s = Ge(e), a = Ge(t);
|
|
2160
|
+
let n;
|
|
2161
|
+
if (s > a) {
|
|
2162
|
+
const r = (Math.pow(s, Da) - Math.pow(a, Sa)) * Ia;
|
|
2163
|
+
n = r < Ue ? 0 : r - Ue;
|
|
2164
|
+
} else {
|
|
2165
|
+
const r = (Math.pow(s, Ma) - Math.pow(a, za)) * Ba;
|
|
2166
|
+
n = r > -qe ? 0 : r + qe;
|
|
2167
|
+
}
|
|
2168
|
+
return n * 100;
|
|
2169
|
+
}
|
|
2170
|
+
function $a(e) {
|
|
2171
|
+
const t = Math.abs(ge(e, "#ffffff")), s = Math.abs(ge(e, "#000000"));
|
|
2172
|
+
return t >= s ? "#ffffff" : "#000000";
|
|
2173
|
+
}
|
|
2174
|
+
function at(e) {
|
|
2175
|
+
const t = parseInt(e.slice(1, 3), 16) / 255, s = parseInt(e.slice(3, 5), 16) / 255, a = parseInt(e.slice(5, 7), 16) / 255, n = Math.max(t, s, a), r = Math.min(t, s, a);
|
|
2176
|
+
let o = 0, c = 0;
|
|
2177
|
+
if (n !== r) {
|
|
2178
|
+
const i = n - r;
|
|
2179
|
+
c = (n + r) / 2 > 0.5 ? i / (2 - n - r) : i / (n + r), n === t ? o = ((s - a) / i + (s < a ? 6 : 0)) / 6 : n === s ? o = ((a - t) / i + 2) / 6 : o = ((t - s) / i + 4) / 6;
|
|
2180
|
+
}
|
|
2181
|
+
return $a(e) === "#000000" ? Re(o, Math.min(c, 0.6), 0.12) : Re(o, Math.min(c, 0.2), 0.95);
|
|
2182
|
+
}
|
|
2183
|
+
function Ra(e, t, s = 60) {
|
|
2184
|
+
if (Math.abs(ge(e, t)) >= s) return e;
|
|
2185
|
+
const a = parseInt(e.slice(1, 3), 16) / 255, n = parseInt(e.slice(3, 5), 16) / 255, r = parseInt(e.slice(5, 7), 16) / 255, o = Math.max(a, n, r), c = Math.min(a, n, r);
|
|
2186
|
+
let u = 0, i = 0, d = (o + c) / 2;
|
|
2187
|
+
if (o !== c) {
|
|
2188
|
+
const f = o - c;
|
|
2189
|
+
i = d > 0.5 ? f / (2 - o - c) : f / (o + c), o === a ? u = ((n - r) / f + (n < r ? 6 : 0)) / 6 : o === n ? u = ((r - a) / f + 2) / 6 : u = ((a - n) / f + 4) / 6;
|
|
2190
|
+
}
|
|
2191
|
+
const h = va(t) > 0.5 ? -5e-3 : 5e-3;
|
|
2192
|
+
for (let f = 0; f < 100; f++) {
|
|
2193
|
+
d = Math.min(1, Math.max(0, d + h));
|
|
2194
|
+
const w = Re(u, i, d);
|
|
2195
|
+
if (Math.abs(ge(w, t)) >= s) return w;
|
|
2196
|
+
}
|
|
2197
|
+
return e;
|
|
2198
|
+
}
|
|
2199
|
+
function Re(e, t, s) {
|
|
2200
|
+
const a = (u, i, d) => (d < 0 && (d += 1), d > 1 && (d -= 1), d < 0.16666666666666666 ? u + (i - u) * 6 * d : d < 0.5 ? i : d < 0.6666666666666666 ? u + (i - u) * (0.6666666666666666 - d) * 6 : u);
|
|
2201
|
+
let n, r, o;
|
|
2202
|
+
if (t === 0)
|
|
2203
|
+
n = r = o = s;
|
|
2204
|
+
else {
|
|
2205
|
+
const u = s < 0.5 ? s * (1 + t) : s + t - s * t, i = 2 * s - u;
|
|
2206
|
+
n = a(i, u, e + 1 / 3), r = a(i, u, e), o = a(i, u, e - 1 / 3);
|
|
2207
|
+
}
|
|
2208
|
+
const c = (u) => Math.round(u * 255).toString(16).padStart(2, "0");
|
|
2209
|
+
return `#${c(n)}${c(r)}${c(o)}`;
|
|
2210
|
+
}
|
|
2211
|
+
function La(e, t) {
|
|
2212
|
+
const [s, a, n] = V(e);
|
|
2213
|
+
return t ? _(s, a * 0.3, Math.min(1, n + (1 - n) * 0.85)) : _(s, a, Math.min(0.25, n + 0.04));
|
|
2214
|
+
}
|
|
2215
|
+
const be = {
|
|
2216
|
+
subtle: { light: 0.95, dark: 0.12 },
|
|
2217
|
+
text: { light: 0.28, dark: 0.78 }
|
|
2218
|
+
};
|
|
2219
|
+
function ce(e, t) {
|
|
2220
|
+
const [s, a] = V(e);
|
|
2221
|
+
return _(s, a * 0.5, t ? be.subtle.light : be.subtle.dark);
|
|
2222
|
+
}
|
|
2223
|
+
function ie(e, t) {
|
|
2224
|
+
const [s, a] = V(e);
|
|
2225
|
+
return _(s, a, t ? be.text.light : be.text.dark);
|
|
2226
|
+
}
|
|
2227
|
+
function nt(e, t, s) {
|
|
2228
|
+
const a = {}, n = s === "light";
|
|
2229
|
+
if ("borderDefault" in e && ("borderSubtle" in e || (a.borderSubtle = z(t.borderDefault, n ? 0.05 : -0.02)), "borderStrong" in e || (a.borderStrong = z(t.borderDefault, n ? -0.27 : 0.19))), "bgBase" in e && ("bgSubtle" in e || (a.bgSubtle = z(t.bgBase, n ? -0.02 : 0.02)), "surfaceTint" in e || (a.surfaceTint = z(t.bgBase, n ? -0.04 : 0.03)), !("surface" in e))) {
|
|
2230
|
+
const r = La(t.bgBase, n);
|
|
2231
|
+
a.surface = r, "surfaceSecondary" in e || (a.surfaceSecondary = z(r, n ? -0.04 : 0.03)), "surfaceRaised" in e || (a.surfaceRaised = z(r, n ? 0 : 0.06)), "surfaceOverlay" in e || (a.surfaceOverlay = z(r, n ? 0 : 0.06));
|
|
2232
|
+
}
|
|
2233
|
+
return "surface" in e && ("surfaceSecondary" in e || (a.surfaceSecondary = z(t.surface, n ? -0.04 : 0.03)), "surfaceRaised" in e || (a.surfaceRaised = z(t.surface, n ? 0 : 0.06)), "surfaceOverlay" in e || (a.surfaceOverlay = z(t.surface, n ? 0 : 0.06))), "textPrimary" in e && ("textSecondary" in e || (a.textSecondary = z(t.textPrimary, n ? 0.2 : -0.15)), "textDisabled" in e || (a.textDisabled = z(t.textPrimary, n ? 0.35 : -0.4))), "accentDefault" in e && ("accentHover" in e || (a.accentHover = z(t.accentDefault, n ? 0.05 : -0.07)), "accentSubtle" in e || (a.accentSubtle = z(t.accentDefault, n ? 0.85 : -0.6))), "successDefault" in e && ("successSubtle" in e || (a.successSubtle = ce(t.successDefault, n)), "successText" in e || (a.successText = ie(t.successDefault, n))), "warningDefault" in e && ("warningSubtle" in e || (a.warningSubtle = ce(t.warningDefault, n)), "warningText" in e || (a.warningText = ie(t.warningDefault, n))), "dangerDefault" in e && ("dangerHover" in e || (a.dangerHover = z(t.dangerDefault, n ? 0.05 : -0.07)), "dangerSubtle" in e || (a.dangerSubtle = ce(t.dangerDefault, n)), "dangerText" in e || (a.dangerText = ie(t.dangerDefault, n))), "infoDefault" in e && ("infoSubtle" in e || (a.infoSubtle = ce(t.infoDefault, n)), "infoText" in e || (a.infoText = ie(t.infoDefault, n))), a;
|
|
2234
|
+
}
|
|
2235
|
+
function rt(e, t = "light") {
|
|
2236
|
+
const a = { ...t === "dark" ? tt : he, ...e }, n = nt(e, a, t), r = t === "light" ? z(a.accentDefault, -0.15) : z(a.accentDefault, 0.15);
|
|
2237
|
+
return {
|
|
2238
|
+
...a,
|
|
2239
|
+
...n,
|
|
2240
|
+
accentFg: at(a.accentDefault),
|
|
2241
|
+
accentBorder: r
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
const st = {
|
|
2245
|
+
name: "default",
|
|
2246
|
+
light: {
|
|
2247
|
+
bgBase: "#ffffff",
|
|
2248
|
+
surface: "#ffffff",
|
|
2249
|
+
borderDefault: "#e5e7eb",
|
|
2250
|
+
accentDefault: "#111827",
|
|
2251
|
+
successDefault: "#16a34a",
|
|
2252
|
+
warningDefault: "#d97706",
|
|
2253
|
+
dangerDefault: "#dc2626",
|
|
2254
|
+
infoDefault: "#2563eb"
|
|
2255
|
+
},
|
|
2256
|
+
dark: {
|
|
2257
|
+
bgBase: "#111318",
|
|
2258
|
+
surface: "#181a20",
|
|
2259
|
+
borderDefault: "#2e3039",
|
|
2260
|
+
accentDefault: "#f9fafb",
|
|
2261
|
+
successDefault: "#22c55e",
|
|
2262
|
+
warningDefault: "#f59e0b",
|
|
2263
|
+
dangerDefault: "#ef4444",
|
|
2264
|
+
infoDefault: "#3b82f6"
|
|
2265
|
+
}
|
|
2266
|
+
}, Ca = {
|
|
2267
|
+
name: "brand",
|
|
2268
|
+
light: {
|
|
2269
|
+
bgBase: "#fffefb",
|
|
2270
|
+
surface: "#fffdf7",
|
|
2271
|
+
borderDefault: "#e8e3d6",
|
|
2272
|
+
accentDefault: "#e9c96b",
|
|
2273
|
+
successDefault: "#16a34a",
|
|
2274
|
+
warningDefault: "#d97706",
|
|
2275
|
+
dangerDefault: "#dc2626",
|
|
2276
|
+
infoDefault: "#2563eb"
|
|
2277
|
+
},
|
|
2278
|
+
dark: {
|
|
2279
|
+
bgBase: "#151310",
|
|
2280
|
+
surface: "#1c1a15",
|
|
2281
|
+
borderDefault: "#33302a",
|
|
2282
|
+
accentDefault: "#e9c96b",
|
|
2283
|
+
successDefault: "#22c55e",
|
|
2284
|
+
warningDefault: "#f59e0b",
|
|
2285
|
+
dangerDefault: "#ef4444",
|
|
2286
|
+
infoDefault: "#3b82f6"
|
|
2287
|
+
}
|
|
2288
|
+
}, ve = {
|
|
2289
|
+
name: "indigo",
|
|
2290
|
+
light: {
|
|
2291
|
+
bgBase: "#fdfcff",
|
|
2292
|
+
surface: "#faf9fe",
|
|
2293
|
+
borderDefault: "#e0dde9",
|
|
2294
|
+
accentDefault: "#6366f1",
|
|
2295
|
+
successDefault: "#16a34a",
|
|
2296
|
+
warningDefault: "#d97706",
|
|
2297
|
+
dangerDefault: "#dc2626",
|
|
2298
|
+
infoDefault: "#2563eb"
|
|
2299
|
+
},
|
|
2300
|
+
dark: {
|
|
2301
|
+
bgBase: "#12111a",
|
|
2302
|
+
surface: "#191820",
|
|
2303
|
+
borderDefault: "#2e2d3a",
|
|
2304
|
+
accentDefault: "#818cf8",
|
|
2305
|
+
successDefault: "#22c55e",
|
|
2306
|
+
warningDefault: "#f59e0b",
|
|
2307
|
+
dangerDefault: "#ef4444",
|
|
2308
|
+
infoDefault: "#3b82f6"
|
|
2309
|
+
}
|
|
2310
|
+
}, ot = {
|
|
2311
|
+
name: "violet",
|
|
2312
|
+
light: {
|
|
2313
|
+
bgBase: "#fdfcfe",
|
|
2314
|
+
surface: "#faf8fd",
|
|
2315
|
+
borderDefault: "#e2dce9",
|
|
2316
|
+
accentDefault: "#8b5cf6",
|
|
2317
|
+
successDefault: "#16a34a",
|
|
2318
|
+
warningDefault: "#d97706",
|
|
2319
|
+
dangerDefault: "#dc2626",
|
|
2320
|
+
infoDefault: "#2563eb"
|
|
2321
|
+
},
|
|
2322
|
+
dark: {
|
|
2323
|
+
bgBase: "#13111a",
|
|
2324
|
+
surface: "#1a1822",
|
|
2325
|
+
borderDefault: "#302d3b",
|
|
2326
|
+
accentDefault: "#a78bfa",
|
|
2327
|
+
successDefault: "#22c55e",
|
|
2328
|
+
warningDefault: "#f59e0b",
|
|
2329
|
+
dangerDefault: "#ef4444",
|
|
2330
|
+
infoDefault: "#3b82f6"
|
|
2331
|
+
}
|
|
2332
|
+
}, lt = {
|
|
2333
|
+
name: "emerald",
|
|
2334
|
+
light: {
|
|
2335
|
+
bgBase: "#fbfefc",
|
|
2336
|
+
surface: "#f7fcf9",
|
|
2337
|
+
borderDefault: "#dbe8df",
|
|
2338
|
+
accentDefault: "#10b981",
|
|
2339
|
+
successDefault: "#16a34a",
|
|
2340
|
+
warningDefault: "#d97706",
|
|
2341
|
+
dangerDefault: "#dc2626",
|
|
2342
|
+
infoDefault: "#2563eb"
|
|
2343
|
+
},
|
|
2344
|
+
dark: {
|
|
2345
|
+
bgBase: "#0f1512",
|
|
2346
|
+
surface: "#151c18",
|
|
2347
|
+
borderDefault: "#263330",
|
|
2348
|
+
accentDefault: "#34d399",
|
|
2349
|
+
successDefault: "#22c55e",
|
|
2350
|
+
warningDefault: "#f59e0b",
|
|
2351
|
+
dangerDefault: "#ef4444",
|
|
2352
|
+
infoDefault: "#3b82f6"
|
|
2353
|
+
}
|
|
2354
|
+
}, Fa = {
|
|
2355
|
+
name: "teal",
|
|
2356
|
+
light: {
|
|
2357
|
+
bgBase: "#fbfefd",
|
|
2358
|
+
surface: "#f6fcfa",
|
|
2359
|
+
borderDefault: "#d4e5e0",
|
|
2360
|
+
accentDefault: "#0d9488",
|
|
2361
|
+
successDefault: "#16a34a",
|
|
2362
|
+
warningDefault: "#d97706",
|
|
2363
|
+
dangerDefault: "#dc2626",
|
|
2364
|
+
infoDefault: "#2563eb"
|
|
2365
|
+
},
|
|
2366
|
+
dark: {
|
|
2367
|
+
bgBase: "#0f1514",
|
|
2368
|
+
surface: "#161d1c",
|
|
2369
|
+
borderDefault: "#283836",
|
|
2370
|
+
accentDefault: "#2dd4bf",
|
|
2371
|
+
successDefault: "#22c55e",
|
|
2372
|
+
warningDefault: "#f59e0b",
|
|
2373
|
+
dangerDefault: "#ef4444",
|
|
2374
|
+
infoDefault: "#3b82f6"
|
|
2375
|
+
}
|
|
2376
|
+
}, ct = {
|
|
2377
|
+
name: "rose",
|
|
2378
|
+
light: {
|
|
2379
|
+
bgBase: "#fffcfd",
|
|
2380
|
+
surface: "#fef9fa",
|
|
2381
|
+
borderDefault: "#ecdde1",
|
|
2382
|
+
accentDefault: "#f43f5e",
|
|
2383
|
+
successDefault: "#16a34a",
|
|
2384
|
+
warningDefault: "#d97706",
|
|
2385
|
+
dangerDefault: "#dc2626",
|
|
2386
|
+
infoDefault: "#2563eb"
|
|
2387
|
+
},
|
|
2388
|
+
dark: {
|
|
2389
|
+
bgBase: "#161012",
|
|
2390
|
+
surface: "#1d1518",
|
|
2391
|
+
borderDefault: "#3a282e",
|
|
2392
|
+
accentDefault: "#fb7185",
|
|
2393
|
+
successDefault: "#22c55e",
|
|
2394
|
+
warningDefault: "#f59e0b",
|
|
2395
|
+
dangerDefault: "#ef4444",
|
|
2396
|
+
infoDefault: "#3b82f6"
|
|
2397
|
+
}
|
|
2398
|
+
}, it = {
|
|
2399
|
+
name: "coral",
|
|
2400
|
+
light: {
|
|
2401
|
+
bgBase: "#fffcfb",
|
|
2402
|
+
surface: "#fef9f7",
|
|
2403
|
+
borderDefault: "#e9ddd8",
|
|
2404
|
+
accentDefault: "#e8624a",
|
|
2405
|
+
successDefault: "#16a34a",
|
|
2406
|
+
warningDefault: "#d97706",
|
|
2407
|
+
dangerDefault: "#b91c1c",
|
|
2408
|
+
infoDefault: "#2563eb"
|
|
2409
|
+
},
|
|
2410
|
+
dark: {
|
|
2411
|
+
bgBase: "#171210",
|
|
2412
|
+
surface: "#1e1816",
|
|
2413
|
+
borderDefault: "#3b312c",
|
|
2414
|
+
accentDefault: "#f38b76",
|
|
2415
|
+
successDefault: "#22c55e",
|
|
2416
|
+
warningDefault: "#f59e0b",
|
|
2417
|
+
dangerDefault: "#ef4444",
|
|
2418
|
+
infoDefault: "#3b82f6"
|
|
2419
|
+
}
|
|
2420
|
+
}, Pa = {
|
|
2421
|
+
name: "amber",
|
|
2422
|
+
light: {
|
|
2423
|
+
bgBase: "#fffefb",
|
|
2424
|
+
surface: "#fefcf6",
|
|
2425
|
+
borderDefault: "#e8e1d0",
|
|
2426
|
+
accentDefault: "#d97706",
|
|
2427
|
+
successDefault: "#16a34a",
|
|
2428
|
+
warningDefault: "#b45309",
|
|
2429
|
+
dangerDefault: "#dc2626",
|
|
2430
|
+
infoDefault: "#2563eb"
|
|
2431
|
+
},
|
|
2432
|
+
dark: {
|
|
2433
|
+
bgBase: "#171310",
|
|
2434
|
+
surface: "#1e1a15",
|
|
2435
|
+
borderDefault: "#3a3329",
|
|
2436
|
+
accentDefault: "#f59e0b",
|
|
2437
|
+
successDefault: "#22c55e",
|
|
2438
|
+
warningDefault: "#d97706",
|
|
2439
|
+
dangerDefault: "#ef4444",
|
|
2440
|
+
infoDefault: "#3b82f6"
|
|
2441
|
+
}
|
|
2442
|
+
}, ut = {
|
|
2443
|
+
name: "ocean",
|
|
2444
|
+
light: {
|
|
2445
|
+
bgBase: "#fbfdff",
|
|
2446
|
+
surface: "#f6fafd",
|
|
2447
|
+
borderDefault: "#d9e4ec",
|
|
2448
|
+
accentDefault: "#0ea5e9",
|
|
2449
|
+
successDefault: "#16a34a",
|
|
2450
|
+
warningDefault: "#d97706",
|
|
2451
|
+
dangerDefault: "#dc2626",
|
|
2452
|
+
infoDefault: "#2563eb"
|
|
2453
|
+
},
|
|
2454
|
+
dark: {
|
|
2455
|
+
bgBase: "#0e1318",
|
|
2456
|
+
surface: "#141a20",
|
|
2457
|
+
borderDefault: "#243038",
|
|
2458
|
+
accentDefault: "#38bdf8",
|
|
2459
|
+
successDefault: "#22c55e",
|
|
2460
|
+
warningDefault: "#f59e0b",
|
|
2461
|
+
dangerDefault: "#ef4444",
|
|
2462
|
+
infoDefault: "#3b82f6"
|
|
2463
|
+
}
|
|
2464
|
+
}, dt = {
|
|
2465
|
+
name: "slate",
|
|
2466
|
+
light: {
|
|
2467
|
+
bgBase: "#fafbfc",
|
|
2468
|
+
surface: "#f7f8fa",
|
|
2469
|
+
borderDefault: "#dde1e6",
|
|
2470
|
+
accentDefault: "#475569",
|
|
2471
|
+
successDefault: "#16a34a",
|
|
2472
|
+
warningDefault: "#d97706",
|
|
2473
|
+
dangerDefault: "#dc2626",
|
|
2474
|
+
infoDefault: "#2563eb"
|
|
2475
|
+
},
|
|
2476
|
+
dark: {
|
|
2477
|
+
bgBase: "#0f1116",
|
|
2478
|
+
surface: "#161920",
|
|
2479
|
+
borderDefault: "#2b3040",
|
|
2480
|
+
accentDefault: "#94a3b8",
|
|
2481
|
+
successDefault: "#22c55e",
|
|
2482
|
+
warningDefault: "#f59e0b",
|
|
2483
|
+
dangerDefault: "#ef4444",
|
|
2484
|
+
infoDefault: "#3b82f6"
|
|
2485
|
+
}
|
|
2486
|
+
}, Wa = {
|
|
2487
|
+
name: "sage",
|
|
2488
|
+
light: {
|
|
2489
|
+
bgBase: "#fbfcfb",
|
|
2490
|
+
surface: "#f5f7f5",
|
|
2491
|
+
borderDefault: "#d8ddd6",
|
|
2492
|
+
accentDefault: "#5f8c6e",
|
|
2493
|
+
successDefault: "#16a34a",
|
|
2494
|
+
warningDefault: "#d97706",
|
|
2495
|
+
dangerDefault: "#dc2626",
|
|
2496
|
+
infoDefault: "#2563eb"
|
|
2497
|
+
},
|
|
2498
|
+
dark: {
|
|
2499
|
+
bgBase: "#101410",
|
|
2500
|
+
surface: "#171c17",
|
|
2501
|
+
borderDefault: "#2c372c",
|
|
2502
|
+
accentDefault: "#86b394",
|
|
2503
|
+
successDefault: "#22c55e",
|
|
2504
|
+
warningDefault: "#f59e0b",
|
|
2505
|
+
dangerDefault: "#ef4444",
|
|
2506
|
+
infoDefault: "#3b82f6"
|
|
2507
|
+
}
|
|
2508
|
+
}, ye = {
|
|
2509
|
+
name: "sharp",
|
|
2510
|
+
tokens: {
|
|
2511
|
+
radiusNone: "0px",
|
|
2512
|
+
radiusSm: "0.125rem",
|
|
2513
|
+
radiusMd: "0.1875rem",
|
|
2514
|
+
radiusLg: "0.25rem",
|
|
2515
|
+
radiusXl: "0.375rem",
|
|
2516
|
+
radiusFull: "9999px"
|
|
2517
|
+
}
|
|
2518
|
+
}, re = {
|
|
2519
|
+
name: "rounded",
|
|
2520
|
+
tokens: {
|
|
2521
|
+
radiusNone: "0px",
|
|
2522
|
+
radiusSm: "0.25rem",
|
|
2523
|
+
radiusMd: "0.375rem",
|
|
2524
|
+
radiusLg: "0.5rem",
|
|
2525
|
+
radiusXl: "0.75rem",
|
|
2526
|
+
radiusFull: "9999px"
|
|
2527
|
+
}
|
|
2528
|
+
}, we = {
|
|
2529
|
+
name: "pill",
|
|
2530
|
+
tokens: {
|
|
2531
|
+
radiusNone: "0px",
|
|
2532
|
+
radiusSm: "0.5rem",
|
|
2533
|
+
radiusMd: "0.75rem",
|
|
2534
|
+
radiusLg: "1rem",
|
|
2535
|
+
radiusXl: "1.5rem",
|
|
2536
|
+
radiusFull: "9999px"
|
|
2537
|
+
}
|
|
2538
|
+
}, ke = {
|
|
2539
|
+
name: "compact",
|
|
2540
|
+
tokens: {
|
|
2541
|
+
space0: "0px",
|
|
2542
|
+
space1: "0.1rem",
|
|
2543
|
+
space2: "0.25rem",
|
|
2544
|
+
space3: "0.6rem",
|
|
2545
|
+
space4: "0.8rem",
|
|
2546
|
+
space5: "1rem",
|
|
2547
|
+
space6: "1.2rem",
|
|
2548
|
+
space8: "1.6rem",
|
|
2549
|
+
space10: "2rem",
|
|
2550
|
+
space12: "2.4rem",
|
|
2551
|
+
space16: "3.2rem",
|
|
2552
|
+
space20: "4rem",
|
|
2553
|
+
space24: "4.8rem"
|
|
2554
|
+
}
|
|
2555
|
+
}, se = {
|
|
2556
|
+
name: "default",
|
|
2557
|
+
tokens: {
|
|
2558
|
+
space0: "0px",
|
|
2559
|
+
space1: "0.25rem",
|
|
2560
|
+
space2: "0.5rem",
|
|
2561
|
+
space3: "0.75rem",
|
|
2562
|
+
space4: "1rem",
|
|
2563
|
+
space5: "1.25rem",
|
|
2564
|
+
space6: "1.5rem",
|
|
2565
|
+
space8: "2rem",
|
|
2566
|
+
space10: "2.5rem",
|
|
2567
|
+
space12: "3rem",
|
|
2568
|
+
space16: "4rem",
|
|
2569
|
+
space20: "5rem",
|
|
2570
|
+
space24: "6rem"
|
|
2571
|
+
}
|
|
2572
|
+
}, De = {
|
|
2573
|
+
name: "spacious",
|
|
2574
|
+
tokens: {
|
|
2575
|
+
space0: "0px",
|
|
2576
|
+
space1: "0.375rem",
|
|
2577
|
+
space2: "0.75rem",
|
|
2578
|
+
space3: "1.125rem",
|
|
2579
|
+
space4: "1.25rem",
|
|
2580
|
+
space5: "1.5625rem",
|
|
2581
|
+
space6: "1.875rem",
|
|
2582
|
+
space8: "2.5rem",
|
|
2583
|
+
space10: "3.125rem",
|
|
2584
|
+
space12: "3.75rem",
|
|
2585
|
+
space16: "5rem",
|
|
2586
|
+
space20: "6.25rem",
|
|
2587
|
+
space24: "7.5rem"
|
|
2588
|
+
}
|
|
2589
|
+
}, Ce = {
|
|
2590
|
+
name: "flat",
|
|
2591
|
+
light: {
|
|
2592
|
+
shadowNone: "none",
|
|
2593
|
+
shadowSm: "none",
|
|
2594
|
+
shadowMd: "none",
|
|
2595
|
+
shadowLg: "none",
|
|
2596
|
+
shadowXl: "none"
|
|
2597
|
+
},
|
|
2598
|
+
dark: {
|
|
2599
|
+
shadowNone: "none",
|
|
2600
|
+
shadowSm: "none",
|
|
2601
|
+
shadowMd: "none",
|
|
2602
|
+
shadowLg: "none",
|
|
2603
|
+
shadowXl: "none"
|
|
2604
|
+
}
|
|
2605
|
+
}, ft = {
|
|
2606
|
+
name: "subtle",
|
|
2607
|
+
light: {
|
|
2608
|
+
shadowNone: "none",
|
|
2609
|
+
shadowSm: "rgba(17, 17, 26, 0.04) 0px 2px 8px, rgba(17, 17, 26, 0.02) 0px 4px 16px",
|
|
2610
|
+
shadowMd: "rgba(17, 17, 26, 0.06) 0px 4px 16px, rgba(17, 17, 26, 0.03) 0px 8px 32px",
|
|
2611
|
+
shadowLg: "rgba(17, 17, 26, 0.06) 0px 8px 24px, rgba(17, 17, 26, 0.04) 0px 16px 48px",
|
|
2612
|
+
shadowXl: "rgba(17, 17, 26, 0.08) 0px 12px 32px, rgba(17, 17, 26, 0.05) 0px 24px 64px"
|
|
2613
|
+
},
|
|
2614
|
+
dark: {
|
|
2615
|
+
shadowNone: "none",
|
|
2616
|
+
shadowSm: "0 0 20px color-mix(in srgb, var(--lucent-accent-default) 5%, transparent)",
|
|
2617
|
+
shadowMd: "0 0 30px color-mix(in srgb, var(--lucent-accent-default) 7%, transparent), inset 0 1px 0 0 rgba(255, 255, 255, 0.04)",
|
|
2618
|
+
shadowLg: "0 0 40px color-mix(in srgb, var(--lucent-accent-default) 9%, transparent), inset 0 1px 0 0 rgba(255, 255, 255, 0.05)",
|
|
2619
|
+
shadowXl: "0 0 56px color-mix(in srgb, var(--lucent-accent-default) 12%, transparent), inset 0 1px 0 0 rgba(255, 255, 255, 0.06)"
|
|
2620
|
+
}
|
|
2621
|
+
}, pt = {
|
|
2622
|
+
name: "elevated",
|
|
2623
|
+
light: {
|
|
2624
|
+
shadowNone: "none",
|
|
2625
|
+
shadowSm: "rgba(17, 17, 26, 0.05) 0px 2px 8px, rgba(17, 17, 26, 0.03) 0px 4px 16px",
|
|
2626
|
+
shadowMd: "rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px",
|
|
2627
|
+
shadowLg: "rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.08) 0px 16px 48px",
|
|
2628
|
+
shadowXl: "rgba(17, 17, 26, 0.12) 0px 12px 32px, rgba(17, 17, 26, 0.1) 0px 24px 64px"
|
|
2629
|
+
},
|
|
2630
|
+
dark: {
|
|
2631
|
+
shadowNone: "none",
|
|
2632
|
+
shadowSm: "inset 0 1px 0 0 rgba(255, 255, 255, 0.06), inset 0 0 12px rgba(255, 255, 255, 0.02)",
|
|
2633
|
+
shadowMd: "inset 0 1px 0 0 rgba(255, 255, 255, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.03), 0 0 1px rgba(255, 255, 255, 0.06)",
|
|
2634
|
+
shadowLg: "inset 0 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 0 28px rgba(255, 255, 255, 0.04), 0 0 1px rgba(255, 255, 255, 0.08)",
|
|
2635
|
+
shadowXl: "inset 0 1px 0 0 rgba(255, 255, 255, 0.12), inset 0 0 36px rgba(255, 255, 255, 0.05), 0 0 1px rgba(255, 255, 255, 0.1)"
|
|
2636
|
+
}
|
|
2637
|
+
}, gt = {
|
|
2638
|
+
name: "liquidGlass",
|
|
2639
|
+
light: {
|
|
2640
|
+
shadowNone: "none",
|
|
2641
|
+
shadowSm: "0 4px 30px rgba(0, 0, 0, 0.04)",
|
|
2642
|
+
shadowMd: "0 8px 50px rgba(0, 0, 0, 0.05), 0 2px 10px rgba(0, 0, 0, 0.02)",
|
|
2643
|
+
shadowLg: "0 12px 60px rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.03)",
|
|
2644
|
+
shadowXl: "0 20px 80px rgba(0, 0, 0, 0.08), 0 8px 30px rgba(0, 0, 0, 0.04)"
|
|
2645
|
+
},
|
|
2646
|
+
dark: {
|
|
2647
|
+
shadowNone: "none",
|
|
2648
|
+
shadowSm: "inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 0 30px rgba(255, 255, 255, 0.02)",
|
|
2649
|
+
shadowMd: "inset 0 1px 0 0 rgba(255, 255, 255, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.02), 0 0 40px rgba(255, 255, 255, 0.03)",
|
|
2650
|
+
shadowLg: "inset 0 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 0 30px rgba(255, 255, 255, 0.03), 0 0 50px rgba(255, 255, 255, 0.04)",
|
|
2651
|
+
shadowXl: "inset 0 1px 0 0 rgba(255, 255, 255, 0.12), inset 0 0 40px rgba(255, 255, 255, 0.04), 0 0 70px rgba(255, 255, 255, 0.05)"
|
|
2652
|
+
}
|
|
2653
|
+
}, bt = {
|
|
2654
|
+
name: "brutalist",
|
|
2655
|
+
light: {
|
|
2656
|
+
shadowNone: "none",
|
|
2657
|
+
shadowSm: "0 0 0 2px var(--lucent-text-primary), 3px 3px 0 0 color-mix(in srgb, var(--lucent-accent-default) 50%, transparent)",
|
|
2658
|
+
shadowMd: "0 0 0 2px var(--lucent-text-primary), 5px 5px 0 0 color-mix(in srgb, var(--lucent-accent-default) 60%, transparent)",
|
|
2659
|
+
shadowLg: "0 0 0 3px var(--lucent-text-primary), 6px 6px 0 0 color-mix(in srgb, var(--lucent-accent-default) 70%, transparent)",
|
|
2660
|
+
shadowXl: "0 0 0 3px var(--lucent-text-primary), 8px 8px 0 0 color-mix(in srgb, var(--lucent-accent-default) 80%, transparent)"
|
|
2661
|
+
},
|
|
2662
|
+
dark: {
|
|
2663
|
+
shadowNone: "none",
|
|
2664
|
+
shadowSm: "0 0 0 2px color-mix(in srgb, var(--lucent-accent-default) 60%, transparent), 3px 3px 0 0 color-mix(in srgb, var(--lucent-accent-default) 30%, transparent)",
|
|
2665
|
+
shadowMd: "0 0 0 2px color-mix(in srgb, var(--lucent-accent-default) 65%, transparent), 5px 5px 0 0 color-mix(in srgb, var(--lucent-accent-default) 35%, transparent)",
|
|
2666
|
+
shadowLg: "0 0 0 3px color-mix(in srgb, var(--lucent-accent-default) 70%, transparent), 6px 6px 0 0 color-mix(in srgb, var(--lucent-accent-default) 40%, transparent)",
|
|
2667
|
+
shadowXl: "0 0 0 3px color-mix(in srgb, var(--lucent-accent-default) 75%, transparent), 8px 8px 0 0 color-mix(in srgb, var(--lucent-accent-default) 45%, transparent)"
|
|
2668
|
+
}
|
|
2669
|
+
}, xt = {
|
|
2670
|
+
name: "neumorphic",
|
|
2671
|
+
light: {
|
|
2672
|
+
shadowNone: "none",
|
|
2673
|
+
shadowSm: "3px 3px 8px #d1d5db, -3px -3px 8px #ffffff",
|
|
2674
|
+
shadowMd: "5px 5px 14px #d1d5db, -5px -5px 14px #ffffff",
|
|
2675
|
+
shadowLg: "8px 8px 20px #d1d5db, -8px -8px 20px #ffffff",
|
|
2676
|
+
shadowXl: "12px 12px 28px #d1d5db, -12px -12px 28px #ffffff"
|
|
2677
|
+
},
|
|
2678
|
+
dark: {
|
|
2679
|
+
shadowNone: "none",
|
|
2680
|
+
shadowSm: "3px 3px 10px color-mix(in srgb, var(--lucent-accent-default) 12%, transparent), -3px -3px 10px rgba(255, 255, 255, 0.03)",
|
|
2681
|
+
shadowMd: "5px 5px 16px color-mix(in srgb, var(--lucent-accent-default) 15%, transparent), -5px -5px 16px rgba(255, 255, 255, 0.04)",
|
|
2682
|
+
shadowLg: "8px 8px 24px color-mix(in srgb, var(--lucent-accent-default) 18%, transparent), -8px -8px 24px rgba(255, 255, 255, 0.05)",
|
|
2683
|
+
shadowXl: "12px 12px 32px color-mix(in srgb, var(--lucent-accent-default) 22%, transparent), -12px -12px 32px rgba(255, 255, 255, 0.06)"
|
|
2684
|
+
}
|
|
2685
|
+
}, mt = {
|
|
2686
|
+
name: "natural",
|
|
2687
|
+
light: {
|
|
2688
|
+
shadowNone: "none",
|
|
2689
|
+
shadowSm: "0 1px 1px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.06)",
|
|
2690
|
+
shadowMd: "0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.06)",
|
|
2691
|
+
shadowLg: "0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.05)",
|
|
2692
|
+
shadowXl: "0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.04), 0 16px 32px rgba(0, 0, 0, 0.04)"
|
|
2693
|
+
},
|
|
2694
|
+
dark: {
|
|
2695
|
+
shadowNone: "none",
|
|
2696
|
+
shadowSm: "inset 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.03)",
|
|
2697
|
+
shadowMd: "inset 0 1px 0 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 1px 3px rgba(0, 0, 0, 0.15)",
|
|
2698
|
+
shadowLg: "inset 0 1px 0 0 rgba(255, 255, 255, 0.09), inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 16px rgba(255, 255, 255, 0.02), 0 2px 6px rgba(0, 0, 0, 0.15)",
|
|
2699
|
+
shadowXl: "inset 0 1px 0 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 24px rgba(255, 255, 255, 0.03), 0 4px 10px rgba(0, 0, 0, 0.15)"
|
|
2700
|
+
}
|
|
2701
|
+
}, Fe = {
|
|
2702
|
+
name: "glow",
|
|
2703
|
+
light: {
|
|
2704
|
+
shadowNone: "none",
|
|
2705
|
+
shadowSm: "0 1px 3px rgba(0, 0, 0, 0.06), 0 0 12px color-mix(in srgb, var(--lucent-accent-default) 12%, transparent)",
|
|
2706
|
+
shadowMd: "0 2px 6px rgba(0, 0, 0, 0.06), 0 0 20px color-mix(in srgb, var(--lucent-accent-default) 16%, transparent)",
|
|
2707
|
+
shadowLg: "0 4px 10px rgba(0, 0, 0, 0.06), 0 0 30px color-mix(in srgb, var(--lucent-accent-default) 20%, transparent)",
|
|
2708
|
+
shadowXl: "0 6px 14px rgba(0, 0, 0, 0.06), 0 0 44px color-mix(in srgb, var(--lucent-accent-default) 25%, transparent)"
|
|
2709
|
+
},
|
|
2710
|
+
dark: {
|
|
2711
|
+
shadowNone: "none",
|
|
2712
|
+
shadowSm: "0 0 16px color-mix(in srgb, var(--lucent-accent-default) 20%, transparent)",
|
|
2713
|
+
shadowMd: "0 0 24px color-mix(in srgb, var(--lucent-accent-default) 28%, transparent)",
|
|
2714
|
+
shadowLg: "0 0 36px color-mix(in srgb, var(--lucent-accent-default) 35%, transparent)",
|
|
2715
|
+
shadowXl: "0 0 50px color-mix(in srgb, var(--lucent-accent-default) 40%, transparent)"
|
|
2716
|
+
}
|
|
2717
|
+
}, Ha = {
|
|
2718
|
+
name: "modern",
|
|
2719
|
+
palette: ve,
|
|
2720
|
+
shape: re,
|
|
2721
|
+
density: se,
|
|
2722
|
+
shadow: ft
|
|
2723
|
+
}, Na = {
|
|
2724
|
+
name: "enterprise",
|
|
2725
|
+
palette: st,
|
|
2726
|
+
shape: ye,
|
|
2727
|
+
density: ke,
|
|
2728
|
+
shadow: Ce
|
|
2729
|
+
}, Ea = {
|
|
2730
|
+
name: "playful",
|
|
2731
|
+
palette: ct,
|
|
2732
|
+
shape: we,
|
|
2733
|
+
density: De,
|
|
2734
|
+
shadow: pt
|
|
2735
|
+
}, Aa = {
|
|
2736
|
+
name: "liquidGlass",
|
|
2737
|
+
palette: ut,
|
|
2738
|
+
shape: we,
|
|
2739
|
+
density: De,
|
|
2740
|
+
shadow: gt
|
|
2741
|
+
}, Oa = {
|
|
2742
|
+
name: "bento",
|
|
2743
|
+
palette: ve,
|
|
2744
|
+
shape: re,
|
|
2745
|
+
density: se,
|
|
2746
|
+
shadow: mt
|
|
2747
|
+
}, Xa = {
|
|
2748
|
+
name: "brutalist",
|
|
2749
|
+
palette: it,
|
|
2750
|
+
shape: ye,
|
|
2751
|
+
density: ke,
|
|
2752
|
+
shadow: bt
|
|
2753
|
+
}, ja = {
|
|
2754
|
+
name: "terminal",
|
|
2755
|
+
palette: lt,
|
|
2756
|
+
shape: ye,
|
|
2757
|
+
density: ke,
|
|
2758
|
+
shadow: Fe
|
|
2759
|
+
}, Ua = {
|
|
2760
|
+
name: "softUI",
|
|
2761
|
+
palette: ot,
|
|
2762
|
+
shape: we,
|
|
2763
|
+
density: se,
|
|
2764
|
+
shadow: xt
|
|
2765
|
+
}, qa = {
|
|
2766
|
+
name: "bloom",
|
|
2767
|
+
palette: ve,
|
|
2768
|
+
shape: re,
|
|
2769
|
+
density: De,
|
|
2770
|
+
shadow: Fe
|
|
2771
|
+
}, Ga = {
|
|
2772
|
+
name: "minimal",
|
|
2773
|
+
palette: dt,
|
|
2774
|
+
shape: re,
|
|
2775
|
+
density: se,
|
|
2776
|
+
shadow: Ce
|
|
2777
|
+
}, _a = {
|
|
2778
|
+
default: st,
|
|
2779
|
+
brand: Ca,
|
|
2780
|
+
indigo: ve,
|
|
2781
|
+
violet: ot,
|
|
2782
|
+
emerald: lt,
|
|
2783
|
+
teal: Fa,
|
|
2784
|
+
rose: ct,
|
|
2785
|
+
coral: it,
|
|
2786
|
+
amber: Pa,
|
|
2787
|
+
ocean: ut,
|
|
2788
|
+
slate: dt,
|
|
2789
|
+
sage: Wa
|
|
2790
|
+
}, Va = {
|
|
2791
|
+
sharp: ye,
|
|
2792
|
+
rounded: re,
|
|
2793
|
+
pill: we
|
|
2794
|
+
}, Ka = {
|
|
2795
|
+
compact: ke,
|
|
2796
|
+
default: se,
|
|
2797
|
+
spacious: De
|
|
2798
|
+
}, Ya = {
|
|
2799
|
+
flat: Ce,
|
|
2800
|
+
subtle: ft,
|
|
2801
|
+
elevated: pt,
|
|
2802
|
+
liquidGlass: gt,
|
|
2803
|
+
brutalist: bt,
|
|
2804
|
+
neumorphic: xt,
|
|
2805
|
+
natural: mt,
|
|
2806
|
+
glow: Fe
|
|
2807
|
+
}, Za = {
|
|
2808
|
+
modern: Ha,
|
|
2809
|
+
enterprise: Na,
|
|
2810
|
+
playful: Ea,
|
|
2811
|
+
liquidGlass: Aa,
|
|
2812
|
+
bento: Oa,
|
|
2813
|
+
brutalist: Xa,
|
|
2814
|
+
terminal: ja,
|
|
2815
|
+
softUI: Ua,
|
|
2816
|
+
bloom: qa,
|
|
2817
|
+
minimal: Ga
|
|
2818
|
+
};
|
|
2819
|
+
function Ja(e) {
|
|
2820
|
+
return typeof e == "string" ? _a[e] : e;
|
|
2821
|
+
}
|
|
2822
|
+
function Qa(e) {
|
|
2823
|
+
return typeof e == "string" ? Va[e] : e;
|
|
2824
|
+
}
|
|
2825
|
+
function en(e) {
|
|
2826
|
+
return typeof e == "string" ? Ka[e] : e;
|
|
2827
|
+
}
|
|
2828
|
+
function tn(e) {
|
|
2829
|
+
return typeof e == "string" ? Ya[e] : e;
|
|
2830
|
+
}
|
|
2831
|
+
function an(e, t) {
|
|
2832
|
+
let s, a, n, r;
|
|
2833
|
+
if (typeof e == "string") {
|
|
2834
|
+
const c = Za[e];
|
|
2835
|
+
if (!c) return {};
|
|
2836
|
+
s = c.palette, a = c.shape, n = c.density, r = c.shadow;
|
|
2837
|
+
} else
|
|
2838
|
+
e.palette !== void 0 && (s = Ja(e.palette)), e.shape !== void 0 && (a = Qa(e.shape)), e.density !== void 0 && (n = en(e.density)), e.shadow !== void 0 && (r = tn(e.shadow));
|
|
2839
|
+
const o = {};
|
|
2840
|
+
if (s) {
|
|
2841
|
+
const c = rt(s[t], t);
|
|
2842
|
+
Object.assign(o, c);
|
|
2843
|
+
}
|
|
2844
|
+
return a && Object.assign(o, a.tokens), n && Object.assign(o, n.tokens), r && Object.assign(o, r[t]), o;
|
|
2845
|
+
}
|
|
2846
|
+
const ht = yt({
|
|
2847
|
+
theme: "light",
|
|
2848
|
+
tokens: he
|
|
2849
|
+
});
|
|
2850
|
+
function fn({
|
|
2851
|
+
theme: e = "light",
|
|
2852
|
+
preset: t,
|
|
2853
|
+
tokens: s,
|
|
2854
|
+
anchors: a,
|
|
2855
|
+
children: n
|
|
2856
|
+
}) {
|
|
2857
|
+
const r = Ve().replace(/:/g, ""), o = t ? an(t, e) : void 0, c = (() => {
|
|
2858
|
+
if (a) {
|
|
2859
|
+
const k = rt(a, e);
|
|
2860
|
+
if (o) {
|
|
2861
|
+
const v = {};
|
|
2862
|
+
for (const [b, m] of Object.entries(o))
|
|
2863
|
+
(b.startsWith("space") || b.startsWith("radius") || b.startsWith("shadow") || b.startsWith("duration") || b.startsWith("easing")) && (v[b] = m);
|
|
2864
|
+
return { ...k, ...v };
|
|
2865
|
+
}
|
|
2866
|
+
return k;
|
|
2867
|
+
}
|
|
2868
|
+
const i = e === "dark" ? tt : he, d = o ? { ...o, ...s } : s, g = d ? { ...i, ...d } : i, h = d ? nt(d, g, e) : {}, f = (d == null ? void 0 : d.accentBorder) ?? (e === "light" ? z(g.accentDefault, -0.15) : z(g.accentDefault, 0.15)), w = (d == null ? void 0 : d.accentFg) ?? at(g.accentDefault), S = Ra(g.accentDefault, w);
|
|
2869
|
+
return {
|
|
2870
|
+
...g,
|
|
2871
|
+
...h,
|
|
2872
|
+
accentDefault: S,
|
|
2873
|
+
accentFg: w,
|
|
2874
|
+
accentBorder: f
|
|
2875
|
+
};
|
|
2876
|
+
})(), u = `html { font-size: 14px; }
|
|
2877
|
+
` + ha(c, ":root");
|
|
2878
|
+
return me(() => {
|
|
2879
|
+
let i = document.getElementById(`lucent-tokens-${r}`);
|
|
2880
|
+
return i || (i = document.createElement("style"), i.id = `lucent-tokens-${r}`, document.head.appendChild(i)), i.textContent = u, () => {
|
|
2881
|
+
var d;
|
|
2882
|
+
(d = document.getElementById(`lucent-tokens-${r}`)) == null || d.remove();
|
|
2883
|
+
};
|
|
2884
|
+
}, [r, u]), /* @__PURE__ */ p(ht.Provider, { value: { theme: e, tokens: c }, children: n });
|
|
2885
|
+
}
|
|
2886
|
+
function pn() {
|
|
2887
|
+
return vt(ht);
|
|
2888
|
+
}
|
|
2889
|
+
export {
|
|
2890
|
+
ma as $,
|
|
2891
|
+
ve as A,
|
|
2892
|
+
Ke as B,
|
|
2893
|
+
ra as C,
|
|
2894
|
+
he as D,
|
|
2895
|
+
Aa as E,
|
|
2896
|
+
gt as F,
|
|
2897
|
+
ha as G,
|
|
2898
|
+
Ga as H,
|
|
2899
|
+
te as I,
|
|
2900
|
+
Ha as J,
|
|
2901
|
+
mt as K,
|
|
2902
|
+
fn as L,
|
|
2903
|
+
xt as M,
|
|
2904
|
+
ut as N,
|
|
2905
|
+
we as O,
|
|
2906
|
+
Ea as P,
|
|
2907
|
+
an as Q,
|
|
2908
|
+
ct as R,
|
|
2909
|
+
Ze as S,
|
|
2910
|
+
cn as T,
|
|
2911
|
+
re as U,
|
|
2912
|
+
ye as V,
|
|
2913
|
+
Ua as W,
|
|
2914
|
+
De as X,
|
|
2915
|
+
ft as Y,
|
|
2916
|
+
ja as Z,
|
|
2917
|
+
pn as _,
|
|
2918
|
+
z as a,
|
|
2919
|
+
ua as a0,
|
|
2920
|
+
ia as a1,
|
|
2921
|
+
Ra as a2,
|
|
2922
|
+
V as a3,
|
|
2923
|
+
_ as a4,
|
|
2924
|
+
on as b,
|
|
2925
|
+
de as c,
|
|
2926
|
+
Ye as d,
|
|
2927
|
+
un as e,
|
|
2928
|
+
dn as f,
|
|
2929
|
+
at as g,
|
|
2930
|
+
ln as h,
|
|
2931
|
+
Oa as i,
|
|
2932
|
+
qa as j,
|
|
2933
|
+
Ca as k,
|
|
2934
|
+
Xa as l,
|
|
2935
|
+
bt as m,
|
|
2936
|
+
ke as n,
|
|
2937
|
+
rt as o,
|
|
2938
|
+
tt as p,
|
|
2939
|
+
se as q,
|
|
2940
|
+
st as r,
|
|
2941
|
+
xa as s,
|
|
2942
|
+
nt as t,
|
|
2943
|
+
pt as u,
|
|
2944
|
+
lt as v,
|
|
2945
|
+
Na as w,
|
|
2946
|
+
Ce as x,
|
|
2947
|
+
$a as y,
|
|
2948
|
+
Fe as z
|
|
2949
|
+
};
|