@stackvibe-studio/ui 0.2.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/README.md +44 -33
- package/dist/components/accordion.d.ts +19 -0
- 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 +12 -4
- package/dist/components/card.d.ts +8 -1
- package/dist/components/dialog.d.ts +24 -0
- package/dist/components/drawer.d.ts +17 -0
- package/dist/components/dropdown-menu.d.ts +16 -0
- package/dist/components/input.d.ts +13 -3
- package/dist/components/progress.d.ts +14 -0
- package/dist/components/select.d.ts +11 -3
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/switch.d.ts +16 -0
- package/dist/components/tabs.d.ts +8 -1
- package/dist/components/textarea.d.ts +10 -1
- package/dist/components/toast.d.ts +19 -0
- package/dist/components/tooltip.d.ts +14 -0
- package/dist/index.cjs +1155 -92
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1139 -91
- package/package.json +31 -1
package/dist/index.js
CHANGED
|
@@ -1,118 +1,437 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/components/
|
|
3
|
+
// src/components/accordion.tsx
|
|
4
|
+
import { useState } from "react";
|
|
4
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
|
+
};
|
|
12
|
+
function Accordion({
|
|
13
|
+
items,
|
|
14
|
+
type = "single",
|
|
15
|
+
variant = "bordered",
|
|
16
|
+
radius = "lg",
|
|
17
|
+
defaultOpen = [],
|
|
18
|
+
className = "",
|
|
19
|
+
customIcon
|
|
20
|
+
}) {
|
|
21
|
+
const [openIds, setOpenIds] = useState(defaultOpen);
|
|
22
|
+
const toggle = (id) => {
|
|
23
|
+
if (type === "single") {
|
|
24
|
+
setOpenIds(openIds.includes(id) ? [] : [id]);
|
|
25
|
+
} else {
|
|
26
|
+
setOpenIds(
|
|
27
|
+
openIds.includes(id) ? openIds.filter((item) => item !== id) : [...openIds, id]
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
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
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/components/alert.tsx
|
|
87
|
+
import { useState as useState2 } from "react";
|
|
88
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
5
89
|
var variantClasses = {
|
|
6
|
-
info: "border-cyan-500/
|
|
7
|
-
success: "border-emerald-500/
|
|
8
|
-
warning: "border-amber-500/
|
|
9
|
-
|
|
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"
|
|
10
102
|
};
|
|
11
|
-
|
|
12
|
-
|
|
103
|
+
var radiusClasses2 = {
|
|
104
|
+
sm: "rounded-lg",
|
|
105
|
+
md: "rounded-xl",
|
|
106
|
+
lg: "rounded-2xl",
|
|
107
|
+
xl: "rounded-3xl"
|
|
108
|
+
};
|
|
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
|
+
};
|
|
126
|
+
return /* @__PURE__ */ jsxs2(
|
|
13
127
|
"div",
|
|
14
128
|
{
|
|
15
129
|
...props,
|
|
16
|
-
className: ["rounded-2xl border p-4 text-sm", variantClasses[variant], className].join(" "),
|
|
17
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(" "),
|
|
18
137
|
children: [
|
|
19
|
-
|
|
20
|
-
/* @__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
|
+
)
|
|
21
153
|
]
|
|
22
154
|
}
|
|
23
155
|
);
|
|
24
156
|
}
|
|
25
157
|
|
|
26
158
|
// src/components/avatar.tsx
|
|
27
|
-
import { jsx as
|
|
159
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
28
160
|
var sizeClasses = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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"
|
|
167
|
+
};
|
|
168
|
+
var shapeClasses = {
|
|
169
|
+
circle: "rounded-full",
|
|
170
|
+
rounded: "rounded-2xl",
|
|
171
|
+
square: "rounded-lg"
|
|
32
172
|
};
|
|
33
|
-
|
|
34
|
-
|
|
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(
|
|
35
191
|
"img",
|
|
36
192
|
{
|
|
37
193
|
...props,
|
|
38
194
|
src,
|
|
39
195
|
alt,
|
|
40
|
-
className: ["
|
|
196
|
+
className: ["object-cover ring-1 ring-white/10 shadow-md", sizeClasses[size], commonShape, className].join(" ")
|
|
41
197
|
}
|
|
42
|
-
) : /* @__PURE__ */
|
|
198
|
+
) : /* @__PURE__ */ jsx3(
|
|
43
199
|
"div",
|
|
44
200
|
{
|
|
45
|
-
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(" "),
|
|
46
207
|
children: fallback
|
|
47
208
|
}
|
|
48
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
|
+
] });
|
|
49
223
|
}
|
|
50
224
|
|
|
51
225
|
// src/components/badge.tsx
|
|
52
|
-
import { jsx as
|
|
226
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
53
227
|
var variants = {
|
|
54
|
-
primary: "bg-
|
|
55
|
-
secondary: "bg-
|
|
56
|
-
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"
|
|
57
249
|
};
|
|
58
|
-
|
|
59
|
-
|
|
250
|
+
var radiuses = {
|
|
251
|
+
sm: "rounded-md",
|
|
252
|
+
md: "rounded-lg",
|
|
253
|
+
lg: "rounded-xl",
|
|
254
|
+
full: "rounded-full"
|
|
255
|
+
};
|
|
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(
|
|
60
268
|
"span",
|
|
61
269
|
{
|
|
62
270
|
...props,
|
|
63
|
-
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
|
+
]
|
|
64
289
|
}
|
|
65
290
|
);
|
|
66
291
|
}
|
|
67
292
|
|
|
68
293
|
// src/components/button.tsx
|
|
69
|
-
import { jsx as
|
|
294
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
70
295
|
var variantClasses2 = {
|
|
71
|
-
primary: "bg-
|
|
72
|
-
secondary: "bg-
|
|
73
|
-
ghost: "bg-white/5 text-white hover:bg-white/10",
|
|
74
|
-
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"
|
|
75
303
|
};
|
|
76
304
|
var sizeClasses2 = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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"
|
|
80
318
|
};
|
|
81
319
|
function Button(props) {
|
|
82
|
-
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;
|
|
83
336
|
const commonClassName = [
|
|
84
|
-
"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",
|
|
85
338
|
variantClasses2[variant],
|
|
86
339
|
sizeClasses2[size],
|
|
340
|
+
radiusClasses3[radius],
|
|
341
|
+
fullWidth ? "w-full" : "",
|
|
87
342
|
className
|
|
88
|
-
].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
|
+
] });
|
|
89
369
|
if (as === "a") {
|
|
90
370
|
const { href, ...anchorProps } = rest;
|
|
91
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx5("a", { ...anchorProps, href, className: commonClassName, children: content });
|
|
92
372
|
}
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
373
|
+
const buttonProps = rest;
|
|
374
|
+
return /* @__PURE__ */ jsx5("button", { ...buttonProps, disabled: isDisabled, className: commonClassName, children: content });
|
|
95
375
|
}
|
|
96
376
|
|
|
97
377
|
// src/components/card.tsx
|
|
98
|
-
import { jsx as
|
|
99
|
-
|
|
100
|
-
|
|
378
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
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
|
+
}) {
|
|
413
|
+
return /* @__PURE__ */ jsx6(
|
|
101
414
|
Component,
|
|
102
415
|
{
|
|
103
416
|
...props,
|
|
417
|
+
style: {
|
|
418
|
+
...glow ? { boxShadow: "0 0 30px var(--glow, rgba(139, 92, 246, 0.25))" } : {},
|
|
419
|
+
...style
|
|
420
|
+
},
|
|
104
421
|
className: [
|
|
105
|
-
|
|
422
|
+
variantStyles[variant],
|
|
423
|
+
radiusStyles[radius],
|
|
424
|
+
paddingStyles[padding],
|
|
106
425
|
className
|
|
107
|
-
].join(" ")
|
|
426
|
+
].filter(Boolean).join(" ")
|
|
108
427
|
}
|
|
109
428
|
);
|
|
110
429
|
}
|
|
111
430
|
|
|
112
431
|
// src/components/checkbox.tsx
|
|
113
|
-
import { jsx as
|
|
432
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
114
433
|
function Checkbox({ className = "", ...props }) {
|
|
115
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ jsx7(
|
|
116
435
|
"input",
|
|
117
436
|
{
|
|
118
437
|
...props,
|
|
@@ -122,92 +441,806 @@ function Checkbox({ className = "", ...props }) {
|
|
|
122
441
|
);
|
|
123
442
|
}
|
|
124
443
|
|
|
125
|
-
// src/components/
|
|
126
|
-
import {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
444
|
+
// src/components/dialog.tsx
|
|
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";
|
|
448
|
+
function Dialog({ open, onOpenChange, children, className = "" }) {
|
|
449
|
+
const dialogRef = useRef(null);
|
|
450
|
+
const [mounted, setMounted] = useState3(false);
|
|
451
|
+
useEffect(() => {
|
|
452
|
+
setMounted(true);
|
|
453
|
+
}, []);
|
|
454
|
+
useEffect(() => {
|
|
455
|
+
const handleKeyDown = (e) => {
|
|
456
|
+
if (e.key === "Escape" && open) {
|
|
457
|
+
onOpenChange(false);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
if (open) {
|
|
461
|
+
document.body.style.overflow = "hidden";
|
|
462
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
463
|
+
} else {
|
|
464
|
+
document.body.style.overflow = "";
|
|
465
|
+
}
|
|
466
|
+
return () => {
|
|
467
|
+
document.body.style.overflow = "";
|
|
468
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
469
|
+
};
|
|
470
|
+
}, [open, onOpenChange]);
|
|
471
|
+
if (!open || !mounted) return null;
|
|
472
|
+
const content = /* @__PURE__ */ jsx8(
|
|
473
|
+
"div",
|
|
130
474
|
{
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
475
|
+
role: "dialog",
|
|
476
|
+
"aria-modal": "true",
|
|
477
|
+
className: "fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md transition-opacity duration-200",
|
|
478
|
+
onClick: (e) => {
|
|
479
|
+
if (e.target === e.currentTarget) onOpenChange(false);
|
|
480
|
+
},
|
|
481
|
+
children: /* @__PURE__ */ jsxs6(
|
|
482
|
+
"div",
|
|
483
|
+
{
|
|
484
|
+
ref: dialogRef,
|
|
485
|
+
className: [
|
|
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",
|
|
487
|
+
className
|
|
488
|
+
].join(" "),
|
|
489
|
+
children: [
|
|
490
|
+
/* @__PURE__ */ jsx8(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
type: "button",
|
|
494
|
+
onClick: () => onOpenChange(false),
|
|
495
|
+
"aria-label": "Close dialog",
|
|
496
|
+
className: "absolute right-5 top-5 rounded-xl border border-white/10 bg-white/5 p-1.5 text-slate-400 hover:bg-white/10 hover:text-white transition cursor-pointer",
|
|
497
|
+
children: /* @__PURE__ */ jsx8("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
498
|
+
}
|
|
499
|
+
),
|
|
500
|
+
children
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
)
|
|
136
504
|
}
|
|
137
505
|
);
|
|
506
|
+
return typeof document !== "undefined" ? createPortal(content, document.body) : null;
|
|
507
|
+
}
|
|
508
|
+
function DialogHeader({ children, className = "" }) {
|
|
509
|
+
return /* @__PURE__ */ jsx8("div", { className: ["mb-4 space-y-1.5", className].join(" "), children });
|
|
510
|
+
}
|
|
511
|
+
function DialogTitle({ children, className = "" }) {
|
|
512
|
+
return /* @__PURE__ */ jsx8("h2", { className: ["text-xl font-bold tracking-tight text-white", className].join(" "), children });
|
|
513
|
+
}
|
|
514
|
+
function DialogDescription({ children, className = "" }) {
|
|
515
|
+
return /* @__PURE__ */ jsx8("p", { className: ["text-sm text-slate-300 leading-relaxed", className].join(" "), children });
|
|
516
|
+
}
|
|
517
|
+
function DialogFooter({ children, className = "" }) {
|
|
518
|
+
return /* @__PURE__ */ jsx8("div", { className: ["mt-6 flex flex-wrap items-center justify-end gap-3", className].join(" "), children });
|
|
138
519
|
}
|
|
139
520
|
|
|
140
|
-
// src/components/
|
|
141
|
-
import {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
521
|
+
// src/components/drawer.tsx
|
|
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";
|
|
525
|
+
function Drawer({
|
|
526
|
+
open,
|
|
527
|
+
onOpenChange,
|
|
528
|
+
position = "right",
|
|
529
|
+
children,
|
|
530
|
+
className = ""
|
|
531
|
+
}) {
|
|
532
|
+
const [mounted, setMounted] = useState4(false);
|
|
533
|
+
useEffect2(() => {
|
|
534
|
+
setMounted(true);
|
|
535
|
+
}, []);
|
|
536
|
+
useEffect2(() => {
|
|
537
|
+
const handleKeyDown = (e) => {
|
|
538
|
+
if (e.key === "Escape" && open) onOpenChange(false);
|
|
539
|
+
};
|
|
540
|
+
if (open) {
|
|
541
|
+
document.body.style.overflow = "hidden";
|
|
542
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
543
|
+
} else {
|
|
544
|
+
document.body.style.overflow = "";
|
|
545
|
+
}
|
|
546
|
+
return () => {
|
|
547
|
+
document.body.style.overflow = "";
|
|
548
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
549
|
+
};
|
|
550
|
+
}, [open, onOpenChange]);
|
|
551
|
+
if (!open || !mounted) return null;
|
|
552
|
+
const positionClasses = {
|
|
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"
|
|
556
|
+
};
|
|
557
|
+
const content = /* @__PURE__ */ jsx9(
|
|
558
|
+
"div",
|
|
559
|
+
{
|
|
560
|
+
role: "dialog",
|
|
561
|
+
"aria-modal": "true",
|
|
562
|
+
className: "fixed inset-0 z-[9999] bg-black/80 backdrop-blur-sm transition-opacity duration-200",
|
|
563
|
+
onClick: (e) => {
|
|
564
|
+
if (e.target === e.currentTarget) onOpenChange(false);
|
|
565
|
+
},
|
|
566
|
+
children: /* @__PURE__ */ jsxs7(
|
|
567
|
+
"div",
|
|
568
|
+
{
|
|
569
|
+
className: [
|
|
570
|
+
"fixed z-[10000] bg-slate-900/95 p-6 text-white backdrop-blur-xl overflow-y-auto transition-transform duration-300",
|
|
571
|
+
positionClasses[position],
|
|
572
|
+
className
|
|
573
|
+
].join(" "),
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx9(
|
|
576
|
+
"button",
|
|
577
|
+
{
|
|
578
|
+
type: "button",
|
|
579
|
+
onClick: () => onOpenChange(false),
|
|
580
|
+
"aria-label": "Close drawer",
|
|
581
|
+
className: "absolute right-5 top-5 rounded-xl border border-white/10 bg-white/5 p-1.5 text-slate-400 hover:bg-white/10 hover:text-white transition cursor-pointer",
|
|
582
|
+
children: /* @__PURE__ */ jsx9("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
children
|
|
586
|
+
]
|
|
587
|
+
}
|
|
588
|
+
)
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
return typeof document !== "undefined" ? createPortal2(content, document.body) : null;
|
|
592
|
+
}
|
|
593
|
+
function DrawerHeader({ children, className = "" }) {
|
|
594
|
+
return /* @__PURE__ */ jsx9("div", { className: ["mb-4 space-y-1.5", className].join(" "), children });
|
|
595
|
+
}
|
|
596
|
+
function DrawerTitle({ children, className = "" }) {
|
|
597
|
+
return /* @__PURE__ */ jsx9("h2", { className: ["text-xl font-bold tracking-tight text-white", className].join(" "), children });
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// src/components/dropdown-menu.tsx
|
|
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";
|
|
603
|
+
function DropdownMenu({
|
|
604
|
+
trigger,
|
|
605
|
+
items,
|
|
606
|
+
align = "right",
|
|
607
|
+
className = ""
|
|
608
|
+
}) {
|
|
609
|
+
const [open, setOpen] = useState5(false);
|
|
610
|
+
const menuRef = useRef2(null);
|
|
611
|
+
useEffect3(() => {
|
|
612
|
+
const handleClickOutside = (e) => {
|
|
613
|
+
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
614
|
+
setOpen(false);
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
if (open) {
|
|
618
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
619
|
+
}
|
|
620
|
+
return () => {
|
|
621
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
622
|
+
};
|
|
623
|
+
}, [open]);
|
|
624
|
+
return /* @__PURE__ */ jsxs8("div", { ref: menuRef, className: "relative inline-block text-left", children: [
|
|
625
|
+
/* @__PURE__ */ jsx10("div", { onClick: () => setOpen(!open), className: "cursor-pointer", children: trigger }),
|
|
626
|
+
open && /* @__PURE__ */ jsx10(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
role: "menu",
|
|
630
|
+
className: [
|
|
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",
|
|
632
|
+
align === "right" ? "right-0" : "left-0",
|
|
633
|
+
className
|
|
634
|
+
].join(" "),
|
|
635
|
+
children: items.map((item) => /* @__PURE__ */ jsxs8(
|
|
636
|
+
"button",
|
|
637
|
+
{
|
|
638
|
+
type: "button",
|
|
639
|
+
role: "menuitem",
|
|
640
|
+
disabled: item.disabled,
|
|
641
|
+
onClick: () => {
|
|
642
|
+
if (!item.disabled) {
|
|
643
|
+
item.onClick?.();
|
|
644
|
+
setOpen(false);
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
className: [
|
|
648
|
+
"flex w-full items-center gap-2.5 rounded-xl px-3 py-2 text-xs font-medium transition cursor-pointer text-left",
|
|
649
|
+
item.disabled ? "opacity-40 cursor-not-allowed text-slate-400" : item.destructive ? "text-rose-400 hover:bg-rose-500/10 hover:text-rose-300" : "text-slate-200 hover:bg-white/10 hover:text-white"
|
|
650
|
+
].join(" "),
|
|
651
|
+
children: [
|
|
652
|
+
item.icon && /* @__PURE__ */ jsx10("span", { className: "h-4 w-4 shrink-0", children: item.icon }),
|
|
653
|
+
/* @__PURE__ */ jsx10("span", { className: "flex-1", children: item.label })
|
|
654
|
+
]
|
|
655
|
+
},
|
|
656
|
+
item.id
|
|
657
|
+
))
|
|
658
|
+
}
|
|
659
|
+
)
|
|
660
|
+
] });
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
// src/components/input.tsx
|
|
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(
|
|
696
|
+
"input",
|
|
145
697
|
{
|
|
146
698
|
...props,
|
|
699
|
+
disabled,
|
|
147
700
|
className: [
|
|
148
|
-
"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" : "",
|
|
149
708
|
className
|
|
150
|
-
].join(" ")
|
|
151
|
-
children
|
|
709
|
+
].filter(Boolean).join(" ")
|
|
152
710
|
}
|
|
153
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
|
+
] });
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// src/components/progress.tsx
|
|
724
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
725
|
+
var variantGradients = {
|
|
726
|
+
primary: "from-[var(--primary,#8b5cf6)] to-[var(--accent,#c084fc)]",
|
|
727
|
+
secondary: "from-[var(--secondary,#22d3ee)] to-blue-500",
|
|
728
|
+
success: "from-emerald-500 to-teal-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"
|
|
739
|
+
};
|
|
740
|
+
function Progress({
|
|
741
|
+
value = 0,
|
|
742
|
+
max = 100,
|
|
743
|
+
variant = "primary",
|
|
744
|
+
size = "md",
|
|
745
|
+
striped = false,
|
|
746
|
+
animated = false,
|
|
747
|
+
showLabel = false,
|
|
748
|
+
label = "Progress",
|
|
749
|
+
className = "",
|
|
750
|
+
...props
|
|
751
|
+
}) {
|
|
752
|
+
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
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: [
|
|
757
|
+
Math.round(percentage),
|
|
758
|
+
"%"
|
|
759
|
+
] })
|
|
760
|
+
] }),
|
|
761
|
+
/* @__PURE__ */ jsx12(
|
|
762
|
+
"div",
|
|
763
|
+
{
|
|
764
|
+
role: "progressbar",
|
|
765
|
+
"aria-valuenow": value,
|
|
766
|
+
"aria-valuemin": 0,
|
|
767
|
+
"aria-valuemax": max,
|
|
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(" "),
|
|
772
|
+
children: /* @__PURE__ */ jsx12(
|
|
773
|
+
"div",
|
|
774
|
+
{
|
|
775
|
+
className: [
|
|
776
|
+
"h-full rounded-full bg-gradient-to-r transition-all duration-300 ease-out shadow-sm",
|
|
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(" "),
|
|
781
|
+
style: { width: `${percentage}%` }
|
|
782
|
+
}
|
|
783
|
+
)
|
|
784
|
+
}
|
|
785
|
+
)
|
|
786
|
+
] });
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// src/components/select.tsx
|
|
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
|
+
] });
|
|
154
842
|
}
|
|
155
843
|
|
|
156
844
|
// src/components/skeleton.tsx
|
|
157
|
-
import { jsx as
|
|
845
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
158
846
|
var roundedClasses = {
|
|
847
|
+
none: "rounded-none",
|
|
159
848
|
sm: "rounded-md",
|
|
160
849
|
md: "rounded-xl",
|
|
161
850
|
lg: "rounded-2xl",
|
|
851
|
+
xl: "rounded-3xl",
|
|
162
852
|
full: "rounded-full"
|
|
163
853
|
};
|
|
164
|
-
function Skeleton({
|
|
165
|
-
|
|
854
|
+
function Skeleton({
|
|
855
|
+
className = "",
|
|
856
|
+
rounded = "md",
|
|
857
|
+
animation = "pulse",
|
|
858
|
+
...props
|
|
859
|
+
}) {
|
|
860
|
+
return /* @__PURE__ */ jsx14(
|
|
166
861
|
"div",
|
|
167
862
|
{
|
|
168
863
|
...props,
|
|
169
|
-
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(" "),
|
|
170
871
|
"aria-hidden": "true"
|
|
171
872
|
}
|
|
172
873
|
);
|
|
173
874
|
}
|
|
174
875
|
|
|
876
|
+
// src/components/switch.tsx
|
|
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
|
+
};
|
|
893
|
+
function Switch({
|
|
894
|
+
checked,
|
|
895
|
+
defaultChecked = false,
|
|
896
|
+
onCheckedChange,
|
|
897
|
+
size = "md",
|
|
898
|
+
color,
|
|
899
|
+
checkedIcon,
|
|
900
|
+
uncheckedIcon,
|
|
901
|
+
disabled = false,
|
|
902
|
+
className = "",
|
|
903
|
+
id,
|
|
904
|
+
"aria-label": ariaLabel
|
|
905
|
+
}) {
|
|
906
|
+
const isChecked = checked ?? defaultChecked;
|
|
907
|
+
return /* @__PURE__ */ jsx15(
|
|
908
|
+
"button",
|
|
909
|
+
{
|
|
910
|
+
type: "button",
|
|
911
|
+
role: "switch",
|
|
912
|
+
id,
|
|
913
|
+
"aria-label": ariaLabel,
|
|
914
|
+
"aria-checked": isChecked,
|
|
915
|
+
disabled,
|
|
916
|
+
onClick: () => onCheckedChange?.(!isChecked),
|
|
917
|
+
style: isChecked ? { backgroundColor: color || "var(--primary, #8b5cf6)" } : void 0,
|
|
918
|
+
className: [
|
|
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",
|
|
922
|
+
className
|
|
923
|
+
].filter(Boolean).join(" "),
|
|
924
|
+
children: /* @__PURE__ */ jsx15(
|
|
925
|
+
"span",
|
|
926
|
+
{
|
|
927
|
+
className: [
|
|
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
|
|
933
|
+
}
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
|
|
175
939
|
// src/components/tabs.tsx
|
|
176
|
-
import { useState } from "react";
|
|
177
|
-
import { jsx as
|
|
178
|
-
|
|
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
|
+
}) {
|
|
179
955
|
const initialTab = defaultTab ?? items[0]?.id ?? "";
|
|
180
|
-
const [activeTab, setActiveTab] =
|
|
956
|
+
const [activeTab, setActiveTab] = useState6(initialTab);
|
|
181
957
|
const activeItem = items.find((item) => item.id === activeTab) ?? items[0];
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"
|
|
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",
|
|
185
994
|
{
|
|
186
|
-
type: "button",
|
|
187
|
-
onClick: () => setActiveTab(item.id),
|
|
188
995
|
className: [
|
|
189
|
-
"
|
|
190
|
-
|
|
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" : ""
|
|
191
999
|
].join(" "),
|
|
192
|
-
children: item
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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 })
|
|
197
1020
|
] });
|
|
198
1021
|
}
|
|
199
1022
|
|
|
200
1023
|
// src/components/textarea.tsx
|
|
201
|
-
import { jsx as
|
|
202
|
-
|
|
203
|
-
|
|
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(
|
|
204
1058
|
"textarea",
|
|
205
1059
|
{
|
|
206
1060
|
...props,
|
|
1061
|
+
disabled,
|
|
207
1062
|
className: [
|
|
208
|
-
"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" : "",
|
|
209
1069
|
className
|
|
210
|
-
].join(" ")
|
|
1070
|
+
].filter(Boolean).join(" ")
|
|
1071
|
+
}
|
|
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
|
+
] });
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// src/components/toast.tsx
|
|
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";
|
|
1084
|
+
var toasts = [];
|
|
1085
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1086
|
+
function notify() {
|
|
1087
|
+
listeners.forEach((l) => l([...toasts]));
|
|
1088
|
+
}
|
|
1089
|
+
var toast = {
|
|
1090
|
+
show(message, options) {
|
|
1091
|
+
const id = Math.random().toString(36).substring(2, 9);
|
|
1092
|
+
const newToast = {
|
|
1093
|
+
id,
|
|
1094
|
+
message,
|
|
1095
|
+
type: options?.type || "info",
|
|
1096
|
+
title: options?.title,
|
|
1097
|
+
duration: options?.duration || 4e3
|
|
1098
|
+
};
|
|
1099
|
+
toasts = [...toasts, newToast];
|
|
1100
|
+
notify();
|
|
1101
|
+
setTimeout(() => {
|
|
1102
|
+
toast.dismiss(id);
|
|
1103
|
+
}, newToast.duration);
|
|
1104
|
+
return id;
|
|
1105
|
+
},
|
|
1106
|
+
success(message, title) {
|
|
1107
|
+
return toast.show(message, { type: "success", title });
|
|
1108
|
+
},
|
|
1109
|
+
error(message, title) {
|
|
1110
|
+
return toast.show(message, { type: "error", title });
|
|
1111
|
+
},
|
|
1112
|
+
info(message, title) {
|
|
1113
|
+
return toast.show(message, { type: "info", title });
|
|
1114
|
+
},
|
|
1115
|
+
warning(message, title) {
|
|
1116
|
+
return toast.show(message, { type: "warning", title });
|
|
1117
|
+
},
|
|
1118
|
+
dismiss(id) {
|
|
1119
|
+
toasts = toasts.filter((t) => t.id !== id);
|
|
1120
|
+
notify();
|
|
1121
|
+
}
|
|
1122
|
+
};
|
|
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);
|
|
1134
|
+
useEffect4(() => {
|
|
1135
|
+
setMounted(true);
|
|
1136
|
+
listeners.add(setActiveToasts);
|
|
1137
|
+
return () => {
|
|
1138
|
+
listeners.delete(setActiveToasts);
|
|
1139
|
+
};
|
|
1140
|
+
}, []);
|
|
1141
|
+
if (!mounted || activeToasts.length === 0) return null;
|
|
1142
|
+
const typeStyles = {
|
|
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"
|
|
1147
|
+
};
|
|
1148
|
+
const content = /* @__PURE__ */ jsx18(
|
|
1149
|
+
"div",
|
|
1150
|
+
{
|
|
1151
|
+
className: [
|
|
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]
|
|
1154
|
+
].join(" "),
|
|
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;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// src/components/tooltip.tsx
|
|
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
|
+
};
|
|
1200
|
+
function Tooltip({
|
|
1201
|
+
content,
|
|
1202
|
+
children,
|
|
1203
|
+
side,
|
|
1204
|
+
position = "top",
|
|
1205
|
+
theme = "dark",
|
|
1206
|
+
arrow = true,
|
|
1207
|
+
delay = 100,
|
|
1208
|
+
className = ""
|
|
1209
|
+
}) {
|
|
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);
|
|
1219
|
+
};
|
|
1220
|
+
return /* @__PURE__ */ jsxs15(
|
|
1221
|
+
"div",
|
|
1222
|
+
{
|
|
1223
|
+
className: "relative inline-flex",
|
|
1224
|
+
onMouseEnter: show,
|
|
1225
|
+
onMouseLeave: hide,
|
|
1226
|
+
onFocus: show,
|
|
1227
|
+
onBlur: hide,
|
|
1228
|
+
children: [
|
|
1229
|
+
children,
|
|
1230
|
+
isVisible && /* @__PURE__ */ jsx19(
|
|
1231
|
+
"div",
|
|
1232
|
+
{
|
|
1233
|
+
role: "tooltip",
|
|
1234
|
+
className: [
|
|
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],
|
|
1238
|
+
className
|
|
1239
|
+
].join(" "),
|
|
1240
|
+
children: content
|
|
1241
|
+
}
|
|
1242
|
+
)
|
|
1243
|
+
]
|
|
211
1244
|
}
|
|
212
1245
|
);
|
|
213
1246
|
}
|
|
@@ -229,17 +1262,32 @@ var themeTokens = {
|
|
|
229
1262
|
};
|
|
230
1263
|
var cx = (...classes) => classes.filter(Boolean).join(" ");
|
|
231
1264
|
export {
|
|
1265
|
+
Accordion,
|
|
232
1266
|
Alert,
|
|
233
1267
|
Avatar,
|
|
234
1268
|
Badge,
|
|
235
1269
|
Button,
|
|
236
1270
|
Card,
|
|
237
1271
|
Checkbox,
|
|
1272
|
+
Dialog,
|
|
1273
|
+
DialogDescription,
|
|
1274
|
+
DialogFooter,
|
|
1275
|
+
DialogHeader,
|
|
1276
|
+
DialogTitle,
|
|
1277
|
+
Drawer,
|
|
1278
|
+
DrawerHeader,
|
|
1279
|
+
DrawerTitle,
|
|
1280
|
+
DropdownMenu,
|
|
238
1281
|
Input,
|
|
1282
|
+
Progress,
|
|
239
1283
|
Select,
|
|
240
1284
|
Skeleton,
|
|
1285
|
+
Switch,
|
|
241
1286
|
Tabs,
|
|
242
1287
|
Textarea,
|
|
1288
|
+
Toaster,
|
|
1289
|
+
Tooltip,
|
|
243
1290
|
cx,
|
|
244
|
-
themeTokens
|
|
1291
|
+
themeTokens,
|
|
1292
|
+
toast
|
|
245
1293
|
};
|