@stackvibe-studio/ui 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.d.ts +7 -1
- package/dist/components/alert.d.ts +8 -3
- package/dist/components/avatar.d.ts +7 -2
- package/dist/components/badge.d.ts +10 -3
- package/dist/components/button.d.ts +11 -3
- package/dist/components/card.d.ts +8 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/input.d.ts +13 -3
- package/dist/components/progress.d.ts +8 -2
- package/dist/components/select.d.ts +11 -3
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/switch.d.ts +7 -1
- package/dist/components/tabs.d.ts +8 -1
- package/dist/components/textarea.d.ts +10 -1
- package/dist/components/toast.d.ts +5 -1
- package/dist/components/tooltip.d.ts +8 -2
- package/dist/index.cjs +750 -184
- package/dist/index.js +765 -199
- package/package.json +31 -1
package/dist/index.js
CHANGED
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
// src/components/accordion.tsx
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var radiusClasses = {
|
|
7
|
+
sm: "rounded-lg",
|
|
8
|
+
md: "rounded-xl",
|
|
9
|
+
lg: "rounded-2xl",
|
|
10
|
+
xl: "rounded-3xl"
|
|
11
|
+
};
|
|
6
12
|
function Accordion({
|
|
7
13
|
items,
|
|
8
14
|
type = "single",
|
|
15
|
+
variant = "bordered",
|
|
16
|
+
radius = "lg",
|
|
9
17
|
defaultOpen = [],
|
|
10
|
-
className = ""
|
|
18
|
+
className = "",
|
|
19
|
+
customIcon
|
|
11
20
|
}) {
|
|
12
21
|
const [openIds, setOpenIds] = useState(defaultOpen);
|
|
13
22
|
const toggle = (id) => {
|
|
@@ -19,141 +28,402 @@ function Accordion({
|
|
|
19
28
|
);
|
|
20
29
|
}
|
|
21
30
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
const isSeparated = variant === "separated";
|
|
32
|
+
const isGhost = variant === "ghost";
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: [
|
|
37
|
+
isSeparated ? "space-y-3" : isGhost ? "divide-y divide-white/10" : "divide-y divide-white/10 border border-white/10 bg-slate-900/60 overflow-hidden shadow-lg backdrop-blur-md",
|
|
38
|
+
!isSeparated && !isGhost ? radiusClasses[radius] : "",
|
|
39
|
+
className
|
|
40
|
+
].filter(Boolean).join(" "),
|
|
41
|
+
children: items.map((item) => {
|
|
42
|
+
const isOpen = openIds.includes(item.id);
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: [
|
|
47
|
+
"transition duration-200",
|
|
48
|
+
isSeparated ? ["border border-white/10 bg-slate-900/60 overflow-hidden shadow-md backdrop-blur-sm", radiusClasses[radius]].join(" ") : ""
|
|
49
|
+
].filter(Boolean).join(" "),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxs(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: () => toggle(item.id),
|
|
56
|
+
className: "flex w-full items-center justify-between px-5 py-4 text-left font-medium text-white hover:bg-white/5 transition cursor-pointer select-none",
|
|
57
|
+
"aria-expanded": isOpen,
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
60
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "text-[var(--primary,#8b5cf6)] shrink-0", children: item.icon }),
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: item.title })
|
|
62
|
+
] }),
|
|
63
|
+
customIcon ? customIcon(isOpen) : /* @__PURE__ */ jsx(
|
|
64
|
+
"svg",
|
|
65
|
+
{
|
|
66
|
+
className: `h-4 w-4 transform text-slate-400 transition-transform duration-200 ${isOpen ? "rotate-180 text-[var(--primary,#8b5cf6)]" : ""}`,
|
|
67
|
+
fill: "none",
|
|
68
|
+
viewBox: "0 0 24 24",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: "border-t border-white/5 px-5 pb-5 pt-3 text-xs leading-relaxed text-slate-300", children: item.content })
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
item.id
|
|
80
|
+
);
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
);
|
|
50
84
|
}
|
|
51
85
|
|
|
52
86
|
// src/components/alert.tsx
|
|
87
|
+
import { useState as useState2 } from "react";
|
|
53
88
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
54
89
|
var variantClasses = {
|
|
55
|
-
info: "border-cyan-500/
|
|
56
|
-
success: "border-emerald-500/
|
|
57
|
-
warning: "border-amber-500/
|
|
58
|
-
|
|
90
|
+
info: "border-cyan-500/30 bg-cyan-500/10 text-cyan-100",
|
|
91
|
+
success: "border-emerald-500/30 bg-emerald-500/10 text-emerald-100",
|
|
92
|
+
warning: "border-amber-500/30 bg-amber-500/10 text-amber-100",
|
|
93
|
+
destructive: "border-rose-500/30 bg-rose-500/10 text-rose-100",
|
|
94
|
+
primary: "border-[var(--primary,#8b5cf6)]/30 bg-[var(--primary,#8b5cf6)]/10 text-slate-100"
|
|
95
|
+
};
|
|
96
|
+
var defaultIcons = {
|
|
97
|
+
info: "\u2139",
|
|
98
|
+
success: "\u2713",
|
|
99
|
+
warning: "\u26A0",
|
|
100
|
+
destructive: "\u2715",
|
|
101
|
+
primary: "\u26A1"
|
|
102
|
+
};
|
|
103
|
+
var radiusClasses2 = {
|
|
104
|
+
sm: "rounded-lg",
|
|
105
|
+
md: "rounded-xl",
|
|
106
|
+
lg: "rounded-2xl",
|
|
107
|
+
xl: "rounded-3xl"
|
|
59
108
|
};
|
|
60
|
-
function Alert({
|
|
109
|
+
function Alert({
|
|
110
|
+
title,
|
|
111
|
+
variant = "info",
|
|
112
|
+
radius = "lg",
|
|
113
|
+
icon,
|
|
114
|
+
dismissible = false,
|
|
115
|
+
onDismiss,
|
|
116
|
+
className = "",
|
|
117
|
+
children,
|
|
118
|
+
...props
|
|
119
|
+
}) {
|
|
120
|
+
const [visible, setVisible] = useState2(true);
|
|
121
|
+
if (!visible) return null;
|
|
122
|
+
const handleDismiss = () => {
|
|
123
|
+
setVisible(false);
|
|
124
|
+
onDismiss?.();
|
|
125
|
+
};
|
|
61
126
|
return /* @__PURE__ */ jsxs2(
|
|
62
127
|
"div",
|
|
63
128
|
{
|
|
64
129
|
...props,
|
|
65
|
-
className: ["rounded-2xl border p-4 text-sm", variantClasses[variant], className].join(" "),
|
|
66
130
|
role: "alert",
|
|
131
|
+
className: [
|
|
132
|
+
"relative flex items-start gap-3 border p-4 text-sm shadow-md backdrop-blur-sm transition-all duration-200",
|
|
133
|
+
variantClasses[variant],
|
|
134
|
+
radiusClasses2[radius],
|
|
135
|
+
className
|
|
136
|
+
].filter(Boolean).join(" "),
|
|
67
137
|
children: [
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ jsx2("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center font-bold", children: icon || defaultIcons[variant] }),
|
|
139
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1", children: [
|
|
140
|
+
title && /* @__PURE__ */ jsx2("p", { className: "mb-1 font-bold tracking-tight", children: title }),
|
|
141
|
+
/* @__PURE__ */ jsx2("div", { className: "leading-relaxed opacity-90", children })
|
|
142
|
+
] }),
|
|
143
|
+
dismissible && /* @__PURE__ */ jsx2(
|
|
144
|
+
"button",
|
|
145
|
+
{
|
|
146
|
+
type: "button",
|
|
147
|
+
onClick: handleDismiss,
|
|
148
|
+
"aria-label": "Dismiss alert",
|
|
149
|
+
className: "shrink-0 rounded-lg p-1 text-current opacity-60 hover:opacity-100 hover:bg-white/10 transition cursor-pointer",
|
|
150
|
+
children: /* @__PURE__ */ jsx2("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
151
|
+
}
|
|
152
|
+
)
|
|
70
153
|
]
|
|
71
154
|
}
|
|
72
155
|
);
|
|
73
156
|
}
|
|
74
157
|
|
|
75
158
|
// src/components/avatar.tsx
|
|
76
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
159
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
77
160
|
var sizeClasses = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
161
|
+
xs: "h-6 w-6 text-[10px]",
|
|
162
|
+
sm: "h-8 w-8 text-xs",
|
|
163
|
+
md: "h-11 w-11 text-sm",
|
|
164
|
+
lg: "h-14 w-14 text-base",
|
|
165
|
+
xl: "h-18 w-18 text-lg",
|
|
166
|
+
"2xl": "h-24 w-24 text-xl"
|
|
81
167
|
};
|
|
82
|
-
|
|
83
|
-
|
|
168
|
+
var shapeClasses = {
|
|
169
|
+
circle: "rounded-full",
|
|
170
|
+
rounded: "rounded-2xl",
|
|
171
|
+
square: "rounded-lg"
|
|
172
|
+
};
|
|
173
|
+
var statusColors = {
|
|
174
|
+
online: "bg-emerald-500",
|
|
175
|
+
offline: "bg-slate-500",
|
|
176
|
+
busy: "bg-rose-500",
|
|
177
|
+
away: "bg-amber-500"
|
|
178
|
+
};
|
|
179
|
+
function Avatar({
|
|
180
|
+
src,
|
|
181
|
+
alt = "avatar",
|
|
182
|
+
fallback = "SV",
|
|
183
|
+
size = "md",
|
|
184
|
+
shape = "circle",
|
|
185
|
+
status,
|
|
186
|
+
className = "",
|
|
187
|
+
...props
|
|
188
|
+
}) {
|
|
189
|
+
const commonShape = shapeClasses[shape];
|
|
190
|
+
const content = src ? /* @__PURE__ */ jsx3(
|
|
84
191
|
"img",
|
|
85
192
|
{
|
|
86
193
|
...props,
|
|
87
194
|
src,
|
|
88
195
|
alt,
|
|
89
|
-
className: ["
|
|
196
|
+
className: ["object-cover ring-1 ring-white/10 shadow-md", sizeClasses[size], commonShape, className].join(" ")
|
|
90
197
|
}
|
|
91
198
|
) : /* @__PURE__ */ jsx3(
|
|
92
199
|
"div",
|
|
93
200
|
{
|
|
94
|
-
className: [
|
|
201
|
+
className: [
|
|
202
|
+
"flex items-center justify-center bg-[var(--primary,#8b5cf6)]/20 font-bold text-[var(--primary,#c084fc)] ring-1 ring-[var(--primary,#8b5cf6)]/30 shadow-md",
|
|
203
|
+
sizeClasses[size],
|
|
204
|
+
commonShape,
|
|
205
|
+
className
|
|
206
|
+
].join(" "),
|
|
95
207
|
children: fallback
|
|
96
208
|
}
|
|
97
209
|
);
|
|
210
|
+
if (!status) return content;
|
|
211
|
+
return /* @__PURE__ */ jsxs3("div", { className: "relative inline-block", children: [
|
|
212
|
+
content,
|
|
213
|
+
/* @__PURE__ */ jsx3(
|
|
214
|
+
"span",
|
|
215
|
+
{
|
|
216
|
+
className: [
|
|
217
|
+
"absolute bottom-0 right-0 h-3 w-3 rounded-full ring-2 ring-slate-950",
|
|
218
|
+
statusColors[status]
|
|
219
|
+
].join(" ")
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
] });
|
|
98
223
|
}
|
|
99
224
|
|
|
100
225
|
// src/components/badge.tsx
|
|
101
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
226
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
102
227
|
var variants = {
|
|
103
|
-
primary: "bg-
|
|
104
|
-
secondary: "bg-
|
|
105
|
-
outline: "bg-transparent text-slate-200 ring-1 ring-white/
|
|
228
|
+
primary: "bg-[var(--primary,#8b5cf6)]/20 text-[var(--primary,#c084fc)] ring-1 ring-[var(--primary,#8b5cf6)]/30",
|
|
229
|
+
secondary: "bg-[var(--secondary,#22d3ee)]/20 text-[var(--secondary,#22d3ee)] ring-1 ring-[var(--secondary,#22d3ee)]/30",
|
|
230
|
+
outline: "bg-transparent text-slate-200 ring-1 ring-white/15",
|
|
231
|
+
destructive: "bg-rose-500/15 text-rose-300 ring-1 ring-rose-500/30",
|
|
232
|
+
success: "bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/30",
|
|
233
|
+
warning: "bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/30",
|
|
234
|
+
glass: "bg-white/10 text-white backdrop-blur-md ring-1 ring-white/20"
|
|
235
|
+
};
|
|
236
|
+
var dotColors = {
|
|
237
|
+
primary: "bg-[var(--primary,#8b5cf6)]",
|
|
238
|
+
secondary: "bg-[var(--secondary,#22d3ee)]",
|
|
239
|
+
outline: "bg-slate-400",
|
|
240
|
+
destructive: "bg-rose-400",
|
|
241
|
+
success: "bg-emerald-400",
|
|
242
|
+
warning: "bg-amber-400",
|
|
243
|
+
glass: "bg-white"
|
|
244
|
+
};
|
|
245
|
+
var sizes = {
|
|
246
|
+
sm: "px-2 py-0.5 text-[10px] gap-1",
|
|
247
|
+
md: "px-2.5 py-1 text-xs gap-1.5",
|
|
248
|
+
lg: "px-3 py-1.5 text-sm gap-2"
|
|
249
|
+
};
|
|
250
|
+
var radiuses = {
|
|
251
|
+
sm: "rounded-md",
|
|
252
|
+
md: "rounded-lg",
|
|
253
|
+
lg: "rounded-xl",
|
|
254
|
+
full: "rounded-full"
|
|
106
255
|
};
|
|
107
|
-
function Badge({
|
|
108
|
-
|
|
256
|
+
function Badge({
|
|
257
|
+
variant = "primary",
|
|
258
|
+
size = "md",
|
|
259
|
+
radius = "full",
|
|
260
|
+
dot = false,
|
|
261
|
+
leftIcon,
|
|
262
|
+
rightIcon,
|
|
263
|
+
children,
|
|
264
|
+
className = "",
|
|
265
|
+
...props
|
|
266
|
+
}) {
|
|
267
|
+
return /* @__PURE__ */ jsxs4(
|
|
109
268
|
"span",
|
|
110
269
|
{
|
|
111
270
|
...props,
|
|
112
|
-
className: [
|
|
271
|
+
className: [
|
|
272
|
+
"inline-flex items-center font-medium select-none",
|
|
273
|
+
variants[variant],
|
|
274
|
+
sizes[size],
|
|
275
|
+
radiuses[radius],
|
|
276
|
+
className
|
|
277
|
+
].filter(Boolean).join(" "),
|
|
278
|
+
children: [
|
|
279
|
+
dot && /* @__PURE__ */ jsx4(
|
|
280
|
+
"span",
|
|
281
|
+
{
|
|
282
|
+
className: ["h-1.5 w-1.5 rounded-full shrink-0 animate-pulse", dotColors[variant]].join(" ")
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
leftIcon && /* @__PURE__ */ jsx4("span", { className: "shrink-0", children: leftIcon }),
|
|
286
|
+
/* @__PURE__ */ jsx4("span", { children }),
|
|
287
|
+
rightIcon && /* @__PURE__ */ jsx4("span", { className: "shrink-0", children: rightIcon })
|
|
288
|
+
]
|
|
113
289
|
}
|
|
114
290
|
);
|
|
115
291
|
}
|
|
116
292
|
|
|
117
293
|
// src/components/button.tsx
|
|
118
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
294
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
119
295
|
var variantClasses2 = {
|
|
120
|
-
primary: "bg-
|
|
121
|
-
secondary: "bg-
|
|
122
|
-
ghost: "bg-white/5 text-white hover:bg-white/10",
|
|
123
|
-
outline: "border border-
|
|
296
|
+
primary: "bg-[var(--primary,#8b5cf6)] text-white hover:brightness-110 shadow-lg shadow-[var(--glow,rgba(139,92,246,0.3))]",
|
|
297
|
+
secondary: "bg-[var(--secondary,#22d3ee)] text-slate-950 hover:brightness-110 shadow-md shadow-[var(--secondary,#22d3ee)]/20",
|
|
298
|
+
ghost: "bg-white/5 text-white hover:bg-white/10 hover:text-white",
|
|
299
|
+
outline: "border border-[var(--primary,#8b5cf6)]/40 bg-transparent text-white hover:bg-[var(--primary,#8b5cf6)]/10",
|
|
300
|
+
destructive: "bg-rose-600 text-white hover:bg-rose-500 shadow-md shadow-rose-600/30",
|
|
301
|
+
glass: "border border-white/15 bg-white/10 text-white backdrop-blur-md hover:bg-white/20 shadow-lg",
|
|
302
|
+
gradient: "bg-gradient-to-r from-[var(--primary,#8b5cf6)] via-[var(--accent,#c084fc)] to-[var(--secondary,#22d3ee)] text-white shadow-xl hover:brightness-110"
|
|
124
303
|
};
|
|
125
304
|
var sizeClasses2 = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
305
|
+
xs: "px-2.5 py-1 text-xs gap-1",
|
|
306
|
+
sm: "px-3 py-1.5 text-xs font-medium gap-1.5",
|
|
307
|
+
md: "px-4 py-2 text-sm font-medium gap-2",
|
|
308
|
+
lg: "px-5 py-2.5 text-base font-semibold gap-2.5",
|
|
309
|
+
xl: "px-6 py-3.5 text-lg font-bold gap-3"
|
|
310
|
+
};
|
|
311
|
+
var radiusClasses3 = {
|
|
312
|
+
none: "rounded-none",
|
|
313
|
+
sm: "rounded-md",
|
|
314
|
+
md: "rounded-xl",
|
|
315
|
+
lg: "rounded-2xl",
|
|
316
|
+
xl: "rounded-3xl",
|
|
317
|
+
full: "rounded-full"
|
|
129
318
|
};
|
|
130
319
|
function Button(props) {
|
|
131
|
-
const {
|
|
320
|
+
const {
|
|
321
|
+
as = "button",
|
|
322
|
+
variant = "primary",
|
|
323
|
+
size = "md",
|
|
324
|
+
radius = "md",
|
|
325
|
+
fullWidth = false,
|
|
326
|
+
loading = false,
|
|
327
|
+
loadingText,
|
|
328
|
+
leftIcon,
|
|
329
|
+
rightIcon,
|
|
330
|
+
children,
|
|
331
|
+
className = "",
|
|
332
|
+
disabled,
|
|
333
|
+
...rest
|
|
334
|
+
} = props;
|
|
335
|
+
const isDisabled = disabled || loading;
|
|
132
336
|
const commonClassName = [
|
|
133
|
-
"inline-flex items-center justify-center
|
|
337
|
+
"inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary,#8b5cf6)] disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none",
|
|
134
338
|
variantClasses2[variant],
|
|
135
339
|
sizeClasses2[size],
|
|
340
|
+
radiusClasses3[radius],
|
|
341
|
+
fullWidth ? "w-full" : "",
|
|
136
342
|
className
|
|
137
|
-
].join(" ");
|
|
343
|
+
].filter(Boolean).join(" ");
|
|
344
|
+
const content = /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
345
|
+
loading && /* @__PURE__ */ jsxs5(
|
|
346
|
+
"svg",
|
|
347
|
+
{
|
|
348
|
+
className: "animate-spin h-4 w-4 shrink-0 text-current",
|
|
349
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
350
|
+
fill: "none",
|
|
351
|
+
viewBox: "0 0 24 24",
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ jsx5("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
354
|
+
/* @__PURE__ */ jsx5(
|
|
355
|
+
"path",
|
|
356
|
+
{
|
|
357
|
+
className: "opacity-75",
|
|
358
|
+
fill: "currentColor",
|
|
359
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
!loading && leftIcon && /* @__PURE__ */ jsx5("span", { className: "shrink-0", children: leftIcon }),
|
|
366
|
+
/* @__PURE__ */ jsx5("span", { children: loading && loadingText ? loadingText : children }),
|
|
367
|
+
!loading && rightIcon && /* @__PURE__ */ jsx5("span", { className: "shrink-0", children: rightIcon })
|
|
368
|
+
] });
|
|
138
369
|
if (as === "a") {
|
|
139
370
|
const { href, ...anchorProps } = rest;
|
|
140
|
-
return /* @__PURE__ */ jsx5("a", { ...anchorProps, href, className: commonClassName });
|
|
371
|
+
return /* @__PURE__ */ jsx5("a", { ...anchorProps, href, className: commonClassName, children: content });
|
|
141
372
|
}
|
|
142
|
-
const
|
|
143
|
-
return /* @__PURE__ */ jsx5("button", { ...buttonProps,
|
|
373
|
+
const buttonProps = rest;
|
|
374
|
+
return /* @__PURE__ */ jsx5("button", { ...buttonProps, disabled: isDisabled, className: commonClassName, children: content });
|
|
144
375
|
}
|
|
145
376
|
|
|
146
377
|
// src/components/card.tsx
|
|
147
378
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
148
|
-
|
|
379
|
+
var variantStyles = {
|
|
380
|
+
default: "border border-white/10 bg-[var(--surface,rgba(15,23,42,0.6))] backdrop-blur-md shadow-lg shadow-black/20",
|
|
381
|
+
glass: "border border-white/15 bg-white/5 backdrop-blur-xl shadow-2xl",
|
|
382
|
+
gradient: "border border-white/10 bg-gradient-to-br from-[var(--surface,rgba(15,23,42,0.8))] to-[var(--background,rgba(2,6,23,0.9))] shadow-xl",
|
|
383
|
+
bordered: "border-2 border-[var(--primary,#8b5cf6)]/30 bg-[var(--surface,rgba(15,23,42,0.5))] shadow-md",
|
|
384
|
+
interactive: "border border-white/10 bg-[var(--surface,rgba(15,23,42,0.6))] backdrop-blur-md shadow-lg transition-all duration-300 hover:-translate-y-1 hover:border-white/20 hover:shadow-2xl cursor-pointer",
|
|
385
|
+
elevated: "border border-white/10 bg-slate-900/90 shadow-2xl shadow-black/40"
|
|
386
|
+
};
|
|
387
|
+
var radiusStyles = {
|
|
388
|
+
none: "rounded-none",
|
|
389
|
+
sm: "rounded-lg",
|
|
390
|
+
md: "rounded-xl",
|
|
391
|
+
lg: "rounded-2xl",
|
|
392
|
+
xl: "rounded-3xl",
|
|
393
|
+
"2xl": "rounded-[2rem]",
|
|
394
|
+
"3xl": "rounded-[2.5rem]"
|
|
395
|
+
};
|
|
396
|
+
var paddingStyles = {
|
|
397
|
+
none: "p-0",
|
|
398
|
+
sm: "p-3",
|
|
399
|
+
md: "p-5",
|
|
400
|
+
lg: "p-7",
|
|
401
|
+
xl: "p-10"
|
|
402
|
+
};
|
|
403
|
+
function Card({
|
|
404
|
+
as: Component = "div",
|
|
405
|
+
variant = "default",
|
|
406
|
+
radius = "lg",
|
|
407
|
+
padding = "md",
|
|
408
|
+
glow = false,
|
|
409
|
+
className = "",
|
|
410
|
+
style,
|
|
411
|
+
...props
|
|
412
|
+
}) {
|
|
149
413
|
return /* @__PURE__ */ jsx6(
|
|
150
414
|
Component,
|
|
151
415
|
{
|
|
152
416
|
...props,
|
|
417
|
+
style: {
|
|
418
|
+
...glow ? { boxShadow: "0 0 30px var(--glow, rgba(139, 92, 246, 0.25))" } : {},
|
|
419
|
+
...style
|
|
420
|
+
},
|
|
153
421
|
className: [
|
|
154
|
-
|
|
422
|
+
variantStyles[variant],
|
|
423
|
+
radiusStyles[radius],
|
|
424
|
+
paddingStyles[padding],
|
|
155
425
|
className
|
|
156
|
-
].join(" ")
|
|
426
|
+
].filter(Boolean).join(" ")
|
|
157
427
|
}
|
|
158
428
|
);
|
|
159
429
|
}
|
|
@@ -172,10 +442,15 @@ function Checkbox({ className = "", ...props }) {
|
|
|
172
442
|
}
|
|
173
443
|
|
|
174
444
|
// src/components/dialog.tsx
|
|
175
|
-
import { useEffect, useRef } from "react";
|
|
176
|
-
import {
|
|
445
|
+
import { useEffect, useRef, useState as useState3 } from "react";
|
|
446
|
+
import { createPortal } from "react-dom";
|
|
447
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
177
448
|
function Dialog({ open, onOpenChange, children, className = "" }) {
|
|
178
449
|
const dialogRef = useRef(null);
|
|
450
|
+
const [mounted, setMounted] = useState3(false);
|
|
451
|
+
useEffect(() => {
|
|
452
|
+
setMounted(true);
|
|
453
|
+
}, []);
|
|
179
454
|
useEffect(() => {
|
|
180
455
|
const handleKeyDown = (e) => {
|
|
181
456
|
if (e.key === "Escape" && open) {
|
|
@@ -193,22 +468,22 @@ function Dialog({ open, onOpenChange, children, className = "" }) {
|
|
|
193
468
|
window.removeEventListener("keydown", handleKeyDown);
|
|
194
469
|
};
|
|
195
470
|
}, [open, onOpenChange]);
|
|
196
|
-
if (!open) return null;
|
|
197
|
-
|
|
471
|
+
if (!open || !mounted) return null;
|
|
472
|
+
const content = /* @__PURE__ */ jsx8(
|
|
198
473
|
"div",
|
|
199
474
|
{
|
|
200
475
|
role: "dialog",
|
|
201
476
|
"aria-modal": "true",
|
|
202
|
-
className: "fixed inset-0 z-
|
|
477
|
+
className: "fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md transition-opacity duration-200",
|
|
203
478
|
onClick: (e) => {
|
|
204
479
|
if (e.target === e.currentTarget) onOpenChange(false);
|
|
205
480
|
},
|
|
206
|
-
children: /* @__PURE__ */
|
|
481
|
+
children: /* @__PURE__ */ jsxs6(
|
|
207
482
|
"div",
|
|
208
483
|
{
|
|
209
484
|
ref: dialogRef,
|
|
210
485
|
className: [
|
|
211
|
-
"relative w-full max-w-lg rounded-3xl border border-white/10 bg-slate-900/95 p-6 shadow-2xl
|
|
486
|
+
"relative w-full max-w-lg rounded-3xl border border-white/10 bg-slate-900/95 p-6 shadow-2xl text-white backdrop-blur-xl transition-transform duration-200",
|
|
212
487
|
className
|
|
213
488
|
].join(" "),
|
|
214
489
|
children: [
|
|
@@ -228,6 +503,7 @@ function Dialog({ open, onOpenChange, children, className = "" }) {
|
|
|
228
503
|
)
|
|
229
504
|
}
|
|
230
505
|
);
|
|
506
|
+
return typeof document !== "undefined" ? createPortal(content, document.body) : null;
|
|
231
507
|
}
|
|
232
508
|
function DialogHeader({ children, className = "" }) {
|
|
233
509
|
return /* @__PURE__ */ jsx8("div", { className: ["mb-4 space-y-1.5", className].join(" "), children });
|
|
@@ -243,8 +519,9 @@ function DialogFooter({ children, className = "" }) {
|
|
|
243
519
|
}
|
|
244
520
|
|
|
245
521
|
// src/components/drawer.tsx
|
|
246
|
-
import { useEffect as useEffect2 } from "react";
|
|
247
|
-
import {
|
|
522
|
+
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
523
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
524
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
248
525
|
function Drawer({
|
|
249
526
|
open,
|
|
250
527
|
onOpenChange,
|
|
@@ -252,6 +529,10 @@ function Drawer({
|
|
|
252
529
|
children,
|
|
253
530
|
className = ""
|
|
254
531
|
}) {
|
|
532
|
+
const [mounted, setMounted] = useState4(false);
|
|
533
|
+
useEffect2(() => {
|
|
534
|
+
setMounted(true);
|
|
535
|
+
}, []);
|
|
255
536
|
useEffect2(() => {
|
|
256
537
|
const handleKeyDown = (e) => {
|
|
257
538
|
if (e.key === "Escape" && open) onOpenChange(false);
|
|
@@ -267,26 +548,26 @@ function Drawer({
|
|
|
267
548
|
window.removeEventListener("keydown", handleKeyDown);
|
|
268
549
|
};
|
|
269
550
|
}, [open, onOpenChange]);
|
|
270
|
-
if (!open) return null;
|
|
551
|
+
if (!open || !mounted) return null;
|
|
271
552
|
const positionClasses = {
|
|
272
|
-
right: "inset-y-0 right-0 w-full max-w-md border-l border-white/10
|
|
273
|
-
left: "inset-y-0 left-0 w-full max-w-md border-r border-white/10
|
|
274
|
-
bottom: "inset-x-0 bottom-0 max-h-[85vh] w-full border-t border-white/10 rounded-t-3xl
|
|
553
|
+
right: "inset-y-0 right-0 w-full max-w-md border-l border-white/10 shadow-2xl",
|
|
554
|
+
left: "inset-y-0 left-0 w-full max-w-md border-r border-white/10 shadow-2xl",
|
|
555
|
+
bottom: "inset-x-0 bottom-0 max-h-[85vh] w-full border-t border-white/10 rounded-t-3xl shadow-2xl"
|
|
275
556
|
};
|
|
276
|
-
|
|
557
|
+
const content = /* @__PURE__ */ jsx9(
|
|
277
558
|
"div",
|
|
278
559
|
{
|
|
279
560
|
role: "dialog",
|
|
280
561
|
"aria-modal": "true",
|
|
281
|
-
className: "fixed inset-0 z-
|
|
562
|
+
className: "fixed inset-0 z-[9999] bg-black/80 backdrop-blur-sm transition-opacity duration-200",
|
|
282
563
|
onClick: (e) => {
|
|
283
564
|
if (e.target === e.currentTarget) onOpenChange(false);
|
|
284
565
|
},
|
|
285
|
-
children: /* @__PURE__ */
|
|
566
|
+
children: /* @__PURE__ */ jsxs7(
|
|
286
567
|
"div",
|
|
287
568
|
{
|
|
288
569
|
className: [
|
|
289
|
-
"fixed bg-slate-900/95 p-6
|
|
570
|
+
"fixed z-[10000] bg-slate-900/95 p-6 text-white backdrop-blur-xl overflow-y-auto transition-transform duration-300",
|
|
290
571
|
positionClasses[position],
|
|
291
572
|
className
|
|
292
573
|
].join(" "),
|
|
@@ -307,24 +588,25 @@ function Drawer({
|
|
|
307
588
|
)
|
|
308
589
|
}
|
|
309
590
|
);
|
|
591
|
+
return typeof document !== "undefined" ? createPortal2(content, document.body) : null;
|
|
310
592
|
}
|
|
311
593
|
function DrawerHeader({ children, className = "" }) {
|
|
312
|
-
return /* @__PURE__ */ jsx9("div", { className: ["mb-
|
|
594
|
+
return /* @__PURE__ */ jsx9("div", { className: ["mb-4 space-y-1.5", className].join(" "), children });
|
|
313
595
|
}
|
|
314
596
|
function DrawerTitle({ children, className = "" }) {
|
|
315
597
|
return /* @__PURE__ */ jsx9("h2", { className: ["text-xl font-bold tracking-tight text-white", className].join(" "), children });
|
|
316
598
|
}
|
|
317
599
|
|
|
318
600
|
// src/components/dropdown-menu.tsx
|
|
319
|
-
import { useState as
|
|
320
|
-
import { jsx as jsx10, jsxs as
|
|
601
|
+
import { useState as useState5, useRef as useRef2, useEffect as useEffect3 } from "react";
|
|
602
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
321
603
|
function DropdownMenu({
|
|
322
604
|
trigger,
|
|
323
605
|
items,
|
|
324
606
|
align = "right",
|
|
325
607
|
className = ""
|
|
326
608
|
}) {
|
|
327
|
-
const [open, setOpen] =
|
|
609
|
+
const [open, setOpen] = useState5(false);
|
|
328
610
|
const menuRef = useRef2(null);
|
|
329
611
|
useEffect3(() => {
|
|
330
612
|
const handleClickOutside = (e) => {
|
|
@@ -339,18 +621,18 @@ function DropdownMenu({
|
|
|
339
621
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
340
622
|
};
|
|
341
623
|
}, [open]);
|
|
342
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsxs8("div", { ref: menuRef, className: "relative inline-block text-left", children: [
|
|
343
625
|
/* @__PURE__ */ jsx10("div", { onClick: () => setOpen(!open), className: "cursor-pointer", children: trigger }),
|
|
344
626
|
open && /* @__PURE__ */ jsx10(
|
|
345
627
|
"div",
|
|
346
628
|
{
|
|
347
629
|
role: "menu",
|
|
348
630
|
className: [
|
|
349
|
-
"absolute z-50 mt-2 min-w-[12rem] rounded-2xl border border-white/10 bg-slate-900/95 p-1.5 shadow-2xl backdrop-blur-xl
|
|
631
|
+
"absolute z-50 mt-2 min-w-[12rem] rounded-2xl border border-white/10 bg-slate-900/95 p-1.5 shadow-2xl backdrop-blur-xl transition-all duration-150",
|
|
350
632
|
align === "right" ? "right-0" : "left-0",
|
|
351
633
|
className
|
|
352
634
|
].join(" "),
|
|
353
|
-
children: items.map((item) => /* @__PURE__ */
|
|
635
|
+
children: items.map((item) => /* @__PURE__ */ jsxs8(
|
|
354
636
|
"button",
|
|
355
637
|
{
|
|
356
638
|
type: "button",
|
|
@@ -379,41 +661,99 @@ function DropdownMenu({
|
|
|
379
661
|
}
|
|
380
662
|
|
|
381
663
|
// src/components/input.tsx
|
|
382
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
383
|
-
|
|
384
|
-
|
|
664
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
665
|
+
var variantStyles2 = {
|
|
666
|
+
default: "border border-white/10 bg-slate-900/80 text-white placeholder:text-slate-500 focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25",
|
|
667
|
+
filled: "border border-transparent bg-white/5 text-white placeholder:text-slate-500 hover:bg-white/10 focus:bg-slate-900 focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25",
|
|
668
|
+
flushed: "border-0 border-b-2 border-white/15 bg-transparent rounded-none px-0 text-white placeholder:text-slate-500 focus:border-[var(--primary,#8b5cf6)] focus:ring-0"
|
|
669
|
+
};
|
|
670
|
+
var sizeStyles = {
|
|
671
|
+
sm: "px-3 py-1.5 text-xs",
|
|
672
|
+
md: "px-3.5 py-2 text-sm",
|
|
673
|
+
lg: "px-4 py-3 text-base"
|
|
674
|
+
};
|
|
675
|
+
var radiusStyles2 = {
|
|
676
|
+
none: "rounded-none",
|
|
677
|
+
sm: "rounded-lg",
|
|
678
|
+
md: "rounded-xl",
|
|
679
|
+
lg: "rounded-2xl",
|
|
680
|
+
full: "rounded-full"
|
|
681
|
+
};
|
|
682
|
+
function Input({
|
|
683
|
+
variant = "default",
|
|
684
|
+
size = "md",
|
|
685
|
+
radius = "md",
|
|
686
|
+
leftElement,
|
|
687
|
+
rightElement,
|
|
688
|
+
error,
|
|
689
|
+
fullWidth = true,
|
|
690
|
+
className = "",
|
|
691
|
+
disabled,
|
|
692
|
+
...props
|
|
693
|
+
}) {
|
|
694
|
+
const isFlushed = variant === "flushed";
|
|
695
|
+
const inputElement = /* @__PURE__ */ jsx11(
|
|
385
696
|
"input",
|
|
386
697
|
{
|
|
387
698
|
...props,
|
|
699
|
+
disabled,
|
|
388
700
|
className: [
|
|
389
|
-
"w-full
|
|
701
|
+
"w-full transition-all duration-200 outline-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
702
|
+
variantStyles2[variant],
|
|
703
|
+
sizeStyles[size],
|
|
704
|
+
!isFlushed ? radiusStyles2[radius] : "",
|
|
705
|
+
leftElement ? "pl-9" : "",
|
|
706
|
+
rightElement ? "pr-9" : "",
|
|
707
|
+
error ? "!border-rose-500 !ring-rose-500/30" : "",
|
|
390
708
|
className
|
|
391
|
-
].join(" ")
|
|
709
|
+
].filter(Boolean).join(" ")
|
|
392
710
|
}
|
|
393
711
|
);
|
|
712
|
+
if (!leftElement && !rightElement && !error) {
|
|
713
|
+
return inputElement;
|
|
714
|
+
}
|
|
715
|
+
return /* @__PURE__ */ jsxs9("div", { className: ["relative", fullWidth ? "w-full" : "inline-block"].join(" "), children: [
|
|
716
|
+
leftElement && /* @__PURE__ */ jsx11("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none flex items-center justify-center", children: leftElement }),
|
|
717
|
+
inputElement,
|
|
718
|
+
rightElement && /* @__PURE__ */ jsx11("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 flex items-center justify-center", children: rightElement }),
|
|
719
|
+
typeof error === "string" && /* @__PURE__ */ jsx11("p", { className: "mt-1 text-xs text-rose-400", children: error })
|
|
720
|
+
] });
|
|
394
721
|
}
|
|
395
722
|
|
|
396
723
|
// src/components/progress.tsx
|
|
397
|
-
import { jsx as jsx12, jsxs as
|
|
724
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
398
725
|
var variantGradients = {
|
|
399
|
-
primary: "from-
|
|
400
|
-
secondary: "from-
|
|
726
|
+
primary: "from-[var(--primary,#8b5cf6)] to-[var(--accent,#c084fc)]",
|
|
727
|
+
secondary: "from-[var(--secondary,#22d3ee)] to-blue-500",
|
|
401
728
|
success: "from-emerald-500 to-teal-400",
|
|
402
|
-
warning: "from-amber-500 to-orange-400"
|
|
729
|
+
warning: "from-amber-500 to-orange-400",
|
|
730
|
+
destructive: "from-rose-500 to-red-600",
|
|
731
|
+
gradient: "from-[var(--primary,#8b5cf6)] via-[var(--secondary,#22d3ee)] to-emerald-400"
|
|
732
|
+
};
|
|
733
|
+
var sizeStyles2 = {
|
|
734
|
+
xs: "h-1",
|
|
735
|
+
sm: "h-1.5",
|
|
736
|
+
md: "h-2.5",
|
|
737
|
+
lg: "h-4",
|
|
738
|
+
xl: "h-6"
|
|
403
739
|
};
|
|
404
740
|
function Progress({
|
|
405
741
|
value = 0,
|
|
406
742
|
max = 100,
|
|
407
743
|
variant = "primary",
|
|
744
|
+
size = "md",
|
|
745
|
+
striped = false,
|
|
746
|
+
animated = false,
|
|
408
747
|
showLabel = false,
|
|
748
|
+
label = "Progress",
|
|
409
749
|
className = "",
|
|
410
750
|
...props
|
|
411
751
|
}) {
|
|
412
752
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
-
showLabel && /* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */ jsx12("span", { children:
|
|
416
|
-
/* @__PURE__ */
|
|
753
|
+
return /* @__PURE__ */ jsxs10("div", { className: ["w-full space-y-1.5", className].join(" "), ...props, children: [
|
|
754
|
+
showLabel && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between text-xs font-semibold text-slate-300", children: [
|
|
755
|
+
/* @__PURE__ */ jsx12("span", { children: label }),
|
|
756
|
+
/* @__PURE__ */ jsxs10("span", { className: "font-mono", children: [
|
|
417
757
|
Math.round(percentage),
|
|
418
758
|
"%"
|
|
419
759
|
] })
|
|
@@ -425,14 +765,19 @@ function Progress({
|
|
|
425
765
|
"aria-valuenow": value,
|
|
426
766
|
"aria-valuemin": 0,
|
|
427
767
|
"aria-valuemax": max,
|
|
428
|
-
className:
|
|
768
|
+
className: [
|
|
769
|
+
"relative w-full overflow-hidden rounded-full bg-slate-800 ring-1 ring-white/10 shadow-inner",
|
|
770
|
+
sizeStyles2[size]
|
|
771
|
+
].join(" "),
|
|
429
772
|
children: /* @__PURE__ */ jsx12(
|
|
430
773
|
"div",
|
|
431
774
|
{
|
|
432
775
|
className: [
|
|
433
776
|
"h-full rounded-full bg-gradient-to-r transition-all duration-300 ease-out shadow-sm",
|
|
434
|
-
variantGradients[variant]
|
|
435
|
-
|
|
777
|
+
variantGradients[variant],
|
|
778
|
+
striped ? "bg-[length:1rem_1rem] bg-[linear-gradient(45deg,rgba(255,255,255,0.15)_25%,transparent_25%,transparent_50%,rgba(255,255,255,0.15)_50%,rgba(255,255,255,0.15)_75%,transparent_75%,transparent)]" : "",
|
|
779
|
+
animated ? "animate-pulse" : ""
|
|
780
|
+
].filter(Boolean).join(" "),
|
|
436
781
|
style: { width: `${percentage}%` }
|
|
437
782
|
}
|
|
438
783
|
)
|
|
@@ -442,35 +787,87 @@ function Progress({
|
|
|
442
787
|
}
|
|
443
788
|
|
|
444
789
|
// src/components/select.tsx
|
|
445
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
790
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
791
|
+
var variantStyles3 = {
|
|
792
|
+
default: "border border-white/10 bg-slate-900/80 text-white focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25",
|
|
793
|
+
filled: "border border-transparent bg-white/5 text-white hover:bg-white/10 focus:bg-slate-900 focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25"
|
|
794
|
+
};
|
|
795
|
+
var sizeStyles3 = {
|
|
796
|
+
sm: "px-3 py-1.5 text-xs",
|
|
797
|
+
md: "px-3.5 py-2 text-sm",
|
|
798
|
+
lg: "px-4 py-3 text-base"
|
|
799
|
+
};
|
|
800
|
+
var radiusStyles3 = {
|
|
801
|
+
none: "rounded-none",
|
|
802
|
+
sm: "rounded-lg",
|
|
803
|
+
md: "rounded-xl",
|
|
804
|
+
lg: "rounded-2xl",
|
|
805
|
+
full: "rounded-full"
|
|
806
|
+
};
|
|
807
|
+
function Select({
|
|
808
|
+
variant = "default",
|
|
809
|
+
size = "md",
|
|
810
|
+
radius = "md",
|
|
811
|
+
error,
|
|
812
|
+
icon,
|
|
813
|
+
className = "",
|
|
814
|
+
children,
|
|
815
|
+
disabled,
|
|
816
|
+
...props
|
|
817
|
+
}) {
|
|
818
|
+
const selectElement = /* @__PURE__ */ jsxs11("div", { className: "relative w-full", children: [
|
|
819
|
+
/* @__PURE__ */ jsx13(
|
|
820
|
+
"select",
|
|
821
|
+
{
|
|
822
|
+
...props,
|
|
823
|
+
disabled,
|
|
824
|
+
className: [
|
|
825
|
+
"w-full appearance-none transition-all duration-200 outline-none pr-9 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
826
|
+
variantStyles3[variant],
|
|
827
|
+
sizeStyles3[size],
|
|
828
|
+
radiusStyles3[radius],
|
|
829
|
+
error ? "!border-rose-500 !ring-rose-500/30" : "",
|
|
830
|
+
className
|
|
831
|
+
].filter(Boolean).join(" "),
|
|
832
|
+
children
|
|
833
|
+
}
|
|
834
|
+
),
|
|
835
|
+
/* @__PURE__ */ jsx13("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400", children: icon || /* @__PURE__ */ jsx13("svg", { className: "h-4 w-4 fill-none stroke-current", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) })
|
|
836
|
+
] });
|
|
837
|
+
if (!error) return selectElement;
|
|
838
|
+
return /* @__PURE__ */ jsxs11("div", { className: "w-full", children: [
|
|
839
|
+
selectElement,
|
|
840
|
+
typeof error === "string" && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-rose-400", children: error })
|
|
841
|
+
] });
|
|
458
842
|
}
|
|
459
843
|
|
|
460
844
|
// src/components/skeleton.tsx
|
|
461
845
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
462
846
|
var roundedClasses = {
|
|
847
|
+
none: "rounded-none",
|
|
463
848
|
sm: "rounded-md",
|
|
464
849
|
md: "rounded-xl",
|
|
465
850
|
lg: "rounded-2xl",
|
|
851
|
+
xl: "rounded-3xl",
|
|
466
852
|
full: "rounded-full"
|
|
467
853
|
};
|
|
468
|
-
function Skeleton({
|
|
854
|
+
function Skeleton({
|
|
855
|
+
className = "",
|
|
856
|
+
rounded = "md",
|
|
857
|
+
animation = "pulse",
|
|
858
|
+
...props
|
|
859
|
+
}) {
|
|
469
860
|
return /* @__PURE__ */ jsx14(
|
|
470
861
|
"div",
|
|
471
862
|
{
|
|
472
863
|
...props,
|
|
473
|
-
className: [
|
|
864
|
+
className: [
|
|
865
|
+
"bg-slate-800/80 ring-1 ring-white/5",
|
|
866
|
+
animation === "pulse" ? "animate-pulse" : "",
|
|
867
|
+
animation === "shimmer" ? "relative overflow-hidden before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent" : "",
|
|
868
|
+
roundedClasses[rounded],
|
|
869
|
+
className
|
|
870
|
+
].filter(Boolean).join(" "),
|
|
474
871
|
"aria-hidden": "true"
|
|
475
872
|
}
|
|
476
873
|
);
|
|
@@ -478,15 +875,35 @@ function Skeleton({ className = "", rounded = "md", ...props }) {
|
|
|
478
875
|
|
|
479
876
|
// src/components/switch.tsx
|
|
480
877
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
878
|
+
var sizeTrackStyles = {
|
|
879
|
+
sm: "h-5 w-9",
|
|
880
|
+
md: "h-6 w-11",
|
|
881
|
+
lg: "h-7 w-14"
|
|
882
|
+
};
|
|
883
|
+
var sizeThumbStyles = {
|
|
884
|
+
sm: "h-4 w-4",
|
|
885
|
+
md: "h-5 w-5",
|
|
886
|
+
lg: "h-6 w-6"
|
|
887
|
+
};
|
|
888
|
+
var sizeTranslateStyles = {
|
|
889
|
+
sm: "translate-x-4",
|
|
890
|
+
md: "translate-x-5",
|
|
891
|
+
lg: "translate-x-7"
|
|
892
|
+
};
|
|
481
893
|
function Switch({
|
|
482
894
|
checked,
|
|
483
895
|
defaultChecked = false,
|
|
484
896
|
onCheckedChange,
|
|
897
|
+
size = "md",
|
|
898
|
+
color,
|
|
899
|
+
checkedIcon,
|
|
900
|
+
uncheckedIcon,
|
|
485
901
|
disabled = false,
|
|
486
902
|
className = "",
|
|
487
903
|
id,
|
|
488
904
|
"aria-label": ariaLabel
|
|
489
905
|
}) {
|
|
906
|
+
const isChecked = checked ?? defaultChecked;
|
|
490
907
|
return /* @__PURE__ */ jsx15(
|
|
491
908
|
"button",
|
|
492
909
|
{
|
|
@@ -494,21 +911,25 @@ function Switch({
|
|
|
494
911
|
role: "switch",
|
|
495
912
|
id,
|
|
496
913
|
"aria-label": ariaLabel,
|
|
497
|
-
"aria-checked":
|
|
914
|
+
"aria-checked": isChecked,
|
|
498
915
|
disabled,
|
|
499
|
-
onClick: () => onCheckedChange?.(!
|
|
916
|
+
onClick: () => onCheckedChange?.(!isChecked),
|
|
917
|
+
style: isChecked ? { backgroundColor: color || "var(--primary, #8b5cf6)" } : void 0,
|
|
500
918
|
className: [
|
|
501
|
-
"relative inline-flex
|
|
502
|
-
|
|
919
|
+
"relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary,#8b5cf6)] focus-visible:ring-offset-2 focus-visible:ring-offset-slate-950 disabled:cursor-not-allowed disabled:opacity-50",
|
|
920
|
+
sizeTrackStyles[size],
|
|
921
|
+
isChecked ? "" : "bg-slate-800",
|
|
503
922
|
className
|
|
504
|
-
].join(" "),
|
|
923
|
+
].filter(Boolean).join(" "),
|
|
505
924
|
children: /* @__PURE__ */ jsx15(
|
|
506
925
|
"span",
|
|
507
926
|
{
|
|
508
927
|
className: [
|
|
509
|
-
"pointer-events-none
|
|
510
|
-
|
|
511
|
-
|
|
928
|
+
"pointer-events-none flex items-center justify-center transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out text-slate-900",
|
|
929
|
+
sizeThumbStyles[size],
|
|
930
|
+
isChecked ? sizeTranslateStyles[size] : "translate-x-0"
|
|
931
|
+
].join(" "),
|
|
932
|
+
children: isChecked ? checkedIcon : uncheckedIcon
|
|
512
933
|
}
|
|
513
934
|
)
|
|
514
935
|
}
|
|
@@ -516,48 +937,150 @@ function Switch({
|
|
|
516
937
|
}
|
|
517
938
|
|
|
518
939
|
// src/components/tabs.tsx
|
|
519
|
-
import { useState as
|
|
520
|
-
import { jsx as jsx16, jsxs as
|
|
521
|
-
|
|
940
|
+
import { useState as useState6 } from "react";
|
|
941
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
942
|
+
var sizeStyles4 = {
|
|
943
|
+
sm: "px-3 py-1 text-xs gap-1.5",
|
|
944
|
+
md: "px-4 py-2 text-sm gap-2",
|
|
945
|
+
lg: "px-5 py-2.5 text-base gap-2.5"
|
|
946
|
+
};
|
|
947
|
+
function Tabs({
|
|
948
|
+
items,
|
|
949
|
+
defaultTab,
|
|
950
|
+
variant = "pills",
|
|
951
|
+
size = "md",
|
|
952
|
+
fullWidth = false,
|
|
953
|
+
className = ""
|
|
954
|
+
}) {
|
|
522
955
|
const initialTab = defaultTab ?? items[0]?.id ?? "";
|
|
523
|
-
const [activeTab, setActiveTab] =
|
|
956
|
+
const [activeTab, setActiveTab] = useState6(initialTab);
|
|
524
957
|
const activeItem = items.find((item) => item.id === activeTab) ?? items[0];
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
"
|
|
958
|
+
const getTabButtonClass = (isActive) => {
|
|
959
|
+
switch (variant) {
|
|
960
|
+
case "underline":
|
|
961
|
+
return [
|
|
962
|
+
"border-b-2 font-medium transition cursor-pointer flex items-center justify-center",
|
|
963
|
+
isActive ? "border-[var(--primary,#8b5cf6)] text-white font-bold" : "border-transparent text-slate-400 hover:text-white hover:border-white/20",
|
|
964
|
+
sizeStyles4[size],
|
|
965
|
+
fullWidth ? "flex-1" : ""
|
|
966
|
+
].join(" ");
|
|
967
|
+
case "bordered":
|
|
968
|
+
return [
|
|
969
|
+
"rounded-xl border font-medium transition cursor-pointer flex items-center justify-center",
|
|
970
|
+
isActive ? "border-[var(--primary,#8b5cf6)] bg-[var(--primary,#8b5cf6)]/15 text-white shadow-md" : "border-white/10 bg-slate-900/40 text-slate-400 hover:bg-white/5 hover:text-white",
|
|
971
|
+
sizeStyles4[size],
|
|
972
|
+
fullWidth ? "flex-1" : ""
|
|
973
|
+
].join(" ");
|
|
974
|
+
case "segmented":
|
|
975
|
+
return [
|
|
976
|
+
"rounded-xl font-medium transition cursor-pointer flex items-center justify-center",
|
|
977
|
+
isActive ? "bg-slate-900 text-white shadow-lg shadow-black/40 font-bold" : "text-slate-400 hover:text-white",
|
|
978
|
+
sizeStyles4[size],
|
|
979
|
+
fullWidth ? "flex-1" : ""
|
|
980
|
+
].join(" ");
|
|
981
|
+
case "pills":
|
|
982
|
+
default:
|
|
983
|
+
return [
|
|
984
|
+
"rounded-full font-medium transition cursor-pointer flex items-center justify-center",
|
|
985
|
+
isActive ? "bg-[var(--primary,#8b5cf6)] text-white shadow-lg shadow-[var(--glow,rgba(139,92,246,0.25))] font-bold" : "bg-white/5 text-slate-300 hover:bg-white/10 hover:text-white",
|
|
986
|
+
sizeStyles4[size],
|
|
987
|
+
fullWidth ? "flex-1" : ""
|
|
988
|
+
].join(" ");
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
return /* @__PURE__ */ jsxs12("div", { className: ["w-full space-y-4", className].join(" "), children: [
|
|
992
|
+
/* @__PURE__ */ jsx16(
|
|
993
|
+
"div",
|
|
528
994
|
{
|
|
529
|
-
type: "button",
|
|
530
|
-
onClick: () => setActiveTab(item.id),
|
|
531
995
|
className: [
|
|
532
|
-
"
|
|
533
|
-
|
|
996
|
+
"flex flex-wrap gap-2 select-none",
|
|
997
|
+
variant === "underline" ? "border-b border-white/10 gap-4" : "",
|
|
998
|
+
variant === "segmented" ? "rounded-2xl border border-white/10 bg-slate-950/80 p-1.5" : ""
|
|
534
999
|
].join(" "),
|
|
535
|
-
children: item
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
1000
|
+
children: items.map((item) => {
|
|
1001
|
+
const isActive = item.id === activeItem?.id;
|
|
1002
|
+
return /* @__PURE__ */ jsxs12(
|
|
1003
|
+
"button",
|
|
1004
|
+
{
|
|
1005
|
+
type: "button",
|
|
1006
|
+
onClick: () => setActiveTab(item.id),
|
|
1007
|
+
className: getTabButtonClass(isActive),
|
|
1008
|
+
children: [
|
|
1009
|
+
item.icon && /* @__PURE__ */ jsx16("span", { className: "shrink-0", children: item.icon }),
|
|
1010
|
+
/* @__PURE__ */ jsx16("span", { children: item.label }),
|
|
1011
|
+
item.badge && /* @__PURE__ */ jsx16("span", { className: "shrink-0", children: item.badge })
|
|
1012
|
+
]
|
|
1013
|
+
},
|
|
1014
|
+
item.id
|
|
1015
|
+
);
|
|
1016
|
+
})
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
/* @__PURE__ */ jsx16("div", { className: "rounded-2xl border border-white/10 bg-[var(--surface,rgba(15,23,42,0.6))] p-5 text-sm text-slate-200 shadow-xl backdrop-blur-md", children: activeItem?.content })
|
|
540
1020
|
] });
|
|
541
1021
|
}
|
|
542
1022
|
|
|
543
1023
|
// src/components/textarea.tsx
|
|
544
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
545
|
-
|
|
546
|
-
|
|
1024
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1025
|
+
var variantStyles4 = {
|
|
1026
|
+
default: "border border-white/10 bg-slate-900/80 text-white placeholder:text-slate-500 focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25",
|
|
1027
|
+
filled: "border border-transparent bg-white/5 text-white placeholder:text-slate-500 hover:bg-white/10 focus:bg-slate-900 focus:border-[var(--primary,#8b5cf6)] focus:ring-2 focus:ring-[var(--primary,#8b5cf6)]/25"
|
|
1028
|
+
};
|
|
1029
|
+
var sizeStyles5 = {
|
|
1030
|
+
sm: "px-3 py-1.5 text-xs",
|
|
1031
|
+
md: "px-3.5 py-2.5 text-sm",
|
|
1032
|
+
lg: "px-4 py-3 text-base"
|
|
1033
|
+
};
|
|
1034
|
+
var radiusStyles4 = {
|
|
1035
|
+
none: "rounded-none",
|
|
1036
|
+
sm: "rounded-lg",
|
|
1037
|
+
md: "rounded-xl",
|
|
1038
|
+
lg: "rounded-2xl",
|
|
1039
|
+
xl: "rounded-3xl"
|
|
1040
|
+
};
|
|
1041
|
+
var resizeStyles = {
|
|
1042
|
+
none: "resize-none",
|
|
1043
|
+
vertical: "resize-y",
|
|
1044
|
+
horizontal: "resize-x",
|
|
1045
|
+
both: "resize"
|
|
1046
|
+
};
|
|
1047
|
+
function Textarea({
|
|
1048
|
+
variant = "default",
|
|
1049
|
+
size = "md",
|
|
1050
|
+
radius = "md",
|
|
1051
|
+
resize = "vertical",
|
|
1052
|
+
error,
|
|
1053
|
+
className = "",
|
|
1054
|
+
disabled,
|
|
1055
|
+
...props
|
|
1056
|
+
}) {
|
|
1057
|
+
const textareaElement = /* @__PURE__ */ jsx17(
|
|
547
1058
|
"textarea",
|
|
548
1059
|
{
|
|
549
1060
|
...props,
|
|
1061
|
+
disabled,
|
|
550
1062
|
className: [
|
|
551
|
-
"w-full
|
|
1063
|
+
"w-full transition-all duration-200 outline-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1064
|
+
variantStyles4[variant],
|
|
1065
|
+
sizeStyles5[size],
|
|
1066
|
+
radiusStyles4[radius],
|
|
1067
|
+
resizeStyles[resize],
|
|
1068
|
+
error ? "!border-rose-500 !ring-rose-500/30" : "",
|
|
552
1069
|
className
|
|
553
|
-
].join(" ")
|
|
1070
|
+
].filter(Boolean).join(" ")
|
|
554
1071
|
}
|
|
555
1072
|
);
|
|
1073
|
+
if (!error) return textareaElement;
|
|
1074
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full", children: [
|
|
1075
|
+
textareaElement,
|
|
1076
|
+
typeof error === "string" && /* @__PURE__ */ jsx17("p", { className: "mt-1 text-xs text-rose-400", children: error })
|
|
1077
|
+
] });
|
|
556
1078
|
}
|
|
557
1079
|
|
|
558
1080
|
// src/components/toast.tsx
|
|
559
|
-
import { useState as
|
|
560
|
-
import {
|
|
1081
|
+
import { useState as useState7, useEffect as useEffect4 } from "react";
|
|
1082
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
1083
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
561
1084
|
var toasts = [];
|
|
562
1085
|
var listeners = /* @__PURE__ */ new Set();
|
|
563
1086
|
function notify() {
|
|
@@ -589,77 +1112,119 @@ var toast = {
|
|
|
589
1112
|
info(message, title) {
|
|
590
1113
|
return toast.show(message, { type: "info", title });
|
|
591
1114
|
},
|
|
1115
|
+
warning(message, title) {
|
|
1116
|
+
return toast.show(message, { type: "warning", title });
|
|
1117
|
+
},
|
|
592
1118
|
dismiss(id) {
|
|
593
1119
|
toasts = toasts.filter((t) => t.id !== id);
|
|
594
1120
|
notify();
|
|
595
1121
|
}
|
|
596
1122
|
};
|
|
597
|
-
|
|
598
|
-
|
|
1123
|
+
var positionStyles = {
|
|
1124
|
+
"bottom-right": "bottom-5 right-5 items-end",
|
|
1125
|
+
"bottom-left": "bottom-5 left-5 items-start",
|
|
1126
|
+
"top-right": "top-5 right-5 items-end",
|
|
1127
|
+
"top-left": "top-5 left-5 items-start",
|
|
1128
|
+
"top-center": "top-5 left-1/2 -translate-x-1/2 items-center",
|
|
1129
|
+
"bottom-center": "bottom-5 left-1/2 -translate-x-1/2 items-center"
|
|
1130
|
+
};
|
|
1131
|
+
function Toaster({ position = "bottom-right" }) {
|
|
1132
|
+
const [activeToasts, setActiveToasts] = useState7([]);
|
|
1133
|
+
const [mounted, setMounted] = useState7(false);
|
|
599
1134
|
useEffect4(() => {
|
|
1135
|
+
setMounted(true);
|
|
600
1136
|
listeners.add(setActiveToasts);
|
|
601
1137
|
return () => {
|
|
602
1138
|
listeners.delete(setActiveToasts);
|
|
603
1139
|
};
|
|
604
1140
|
}, []);
|
|
605
|
-
if (activeToasts.length === 0) return null;
|
|
1141
|
+
if (!mounted || activeToasts.length === 0) return null;
|
|
606
1142
|
const typeStyles = {
|
|
607
|
-
success: "border-emerald-500/40 bg-slate-900/95 text-emerald-100 shadow-emerald-500/
|
|
608
|
-
error: "border-rose-500/40 bg-slate-900/95 text-rose-100 shadow-rose-500/
|
|
609
|
-
info: "border-
|
|
610
|
-
warning: "border-amber-500/40 bg-slate-900/95 text-amber-100 shadow-amber-500/
|
|
1143
|
+
success: "border-emerald-500/40 bg-slate-900/95 text-emerald-100 shadow-emerald-500/15",
|
|
1144
|
+
error: "border-rose-500/40 bg-slate-900/95 text-rose-100 shadow-rose-500/15",
|
|
1145
|
+
info: "border-[var(--primary,#8b5cf6)]/40 bg-slate-900/95 text-slate-100 shadow-[var(--glow,rgba(139,92,246,0.15))]",
|
|
1146
|
+
warning: "border-amber-500/40 bg-slate-900/95 text-amber-100 shadow-amber-500/15"
|
|
611
1147
|
};
|
|
612
|
-
|
|
1148
|
+
const content = /* @__PURE__ */ jsx18(
|
|
613
1149
|
"div",
|
|
614
1150
|
{
|
|
615
1151
|
className: [
|
|
616
|
-
"
|
|
617
|
-
|
|
1152
|
+
"fixed z-[99999] flex flex-col gap-2.5 max-w-sm w-full pointer-events-none transition-all duration-300",
|
|
1153
|
+
positionStyles[position]
|
|
618
1154
|
].join(" "),
|
|
619
|
-
children:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
"
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
1155
|
+
children: activeToasts.map((t) => /* @__PURE__ */ jsxs14(
|
|
1156
|
+
"div",
|
|
1157
|
+
{
|
|
1158
|
+
className: [
|
|
1159
|
+
"pointer-events-auto flex items-start justify-between rounded-2xl border p-4 shadow-2xl backdrop-blur-xl transition-all duration-200",
|
|
1160
|
+
typeStyles[t.type || "info"]
|
|
1161
|
+
].join(" "),
|
|
1162
|
+
children: [
|
|
1163
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-1", children: [
|
|
1164
|
+
t.title && /* @__PURE__ */ jsx18("p", { className: "font-bold text-xs tracking-wide uppercase text-white", children: t.title }),
|
|
1165
|
+
/* @__PURE__ */ jsx18("p", { className: "text-sm font-medium leading-relaxed", children: t.message })
|
|
1166
|
+
] }),
|
|
1167
|
+
/* @__PURE__ */ jsx18(
|
|
1168
|
+
"button",
|
|
1169
|
+
{
|
|
1170
|
+
type: "button",
|
|
1171
|
+
onClick: () => toast.dismiss(t.id),
|
|
1172
|
+
"aria-label": "Close notification",
|
|
1173
|
+
className: "ml-3 text-slate-400 hover:text-white transition cursor-pointer text-lg leading-none",
|
|
1174
|
+
children: "\xD7"
|
|
1175
|
+
}
|
|
1176
|
+
)
|
|
1177
|
+
]
|
|
1178
|
+
},
|
|
1179
|
+
t.id
|
|
1180
|
+
))
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
return typeof document !== "undefined" ? createPortal3(content, document.body) : null;
|
|
637
1184
|
}
|
|
638
1185
|
|
|
639
1186
|
// src/components/tooltip.tsx
|
|
640
|
-
import { useState as
|
|
641
|
-
import { jsx as jsx19, jsxs as
|
|
1187
|
+
import { useState as useState8, useRef as useRef3 } from "react";
|
|
1188
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1189
|
+
var sideClasses = {
|
|
1190
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
1191
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
1192
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
1193
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
1194
|
+
};
|
|
1195
|
+
var themeClasses = {
|
|
1196
|
+
dark: "border border-white/10 bg-slate-900/95 text-slate-100 shadow-xl",
|
|
1197
|
+
light: "border border-slate-200 bg-white text-slate-900 shadow-xl font-semibold",
|
|
1198
|
+
primary: "border border-[var(--primary,#8b5cf6)]/40 bg-[var(--primary,#8b5cf6)] text-white shadow-lg shadow-[var(--glow,rgba(139,92,246,0.3))]"
|
|
1199
|
+
};
|
|
642
1200
|
function Tooltip({
|
|
643
1201
|
content,
|
|
644
1202
|
children,
|
|
645
|
-
side
|
|
1203
|
+
side,
|
|
1204
|
+
position = "top",
|
|
1205
|
+
theme = "dark",
|
|
1206
|
+
arrow = true,
|
|
1207
|
+
delay = 100,
|
|
646
1208
|
className = ""
|
|
647
1209
|
}) {
|
|
648
|
-
const
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
1210
|
+
const activeSide = side || position;
|
|
1211
|
+
const [isVisible, setIsVisible] = useState8(false);
|
|
1212
|
+
const timeoutRef = useRef3(null);
|
|
1213
|
+
const show = () => {
|
|
1214
|
+
timeoutRef.current = setTimeout(() => setIsVisible(true), delay);
|
|
1215
|
+
};
|
|
1216
|
+
const hide = () => {
|
|
1217
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
1218
|
+
setIsVisible(false);
|
|
654
1219
|
};
|
|
655
|
-
return /* @__PURE__ */
|
|
1220
|
+
return /* @__PURE__ */ jsxs15(
|
|
656
1221
|
"div",
|
|
657
1222
|
{
|
|
658
1223
|
className: "relative inline-flex",
|
|
659
|
-
onMouseEnter:
|
|
660
|
-
onMouseLeave:
|
|
661
|
-
onFocus:
|
|
662
|
-
onBlur:
|
|
1224
|
+
onMouseEnter: show,
|
|
1225
|
+
onMouseLeave: hide,
|
|
1226
|
+
onFocus: show,
|
|
1227
|
+
onBlur: hide,
|
|
663
1228
|
children: [
|
|
664
1229
|
children,
|
|
665
1230
|
isVisible && /* @__PURE__ */ jsx19(
|
|
@@ -667,8 +1232,9 @@ function Tooltip({
|
|
|
667
1232
|
{
|
|
668
1233
|
role: "tooltip",
|
|
669
1234
|
className: [
|
|
670
|
-
"absolute z-50 whitespace-nowrap rounded-lg
|
|
671
|
-
sideClasses[
|
|
1235
|
+
"absolute z-50 whitespace-nowrap rounded-lg px-2.5 py-1 text-xs font-medium shadow-2xl backdrop-blur-md transition-all duration-150 pointer-events-none",
|
|
1236
|
+
sideClasses[activeSide],
|
|
1237
|
+
themeClasses[theme],
|
|
672
1238
|
className
|
|
673
1239
|
].join(" "),
|
|
674
1240
|
children: content
|