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