yems-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/index.css +320 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +450 -0
- package/dist/index.d.ts +450 -0
- package/dist/index.js +2361 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2210 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +94 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2210 @@
|
|
|
1
|
+
import * as React7 from 'react';
|
|
2
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
+
import { ChevronDown, X, ChevronRight, Loader2, Check, Circle, ChevronLeft, MoreHorizontal, ChevronUp } from 'lucide-react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
9
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
10
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
11
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
12
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
13
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
14
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
15
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
16
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
17
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
18
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
19
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
20
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
21
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
22
|
+
|
|
23
|
+
// src/components/accordion.tsx
|
|
24
|
+
function cn(...inputs) {
|
|
25
|
+
return twMerge(clsx(inputs));
|
|
26
|
+
}
|
|
27
|
+
function formatCurrency(amount, currency = "NGN") {
|
|
28
|
+
return new Intl.NumberFormat("en-NG", {
|
|
29
|
+
style: "currency",
|
|
30
|
+
currency,
|
|
31
|
+
minimumFractionDigits: 0,
|
|
32
|
+
maximumFractionDigits: 2
|
|
33
|
+
}).format(amount);
|
|
34
|
+
}
|
|
35
|
+
function formatDate(date, options) {
|
|
36
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
37
|
+
return new Intl.DateTimeFormat("en-NG", {
|
|
38
|
+
dateStyle: "medium",
|
|
39
|
+
...options
|
|
40
|
+
}).format(dateObj);
|
|
41
|
+
}
|
|
42
|
+
function formatRelativeTime(date) {
|
|
43
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
44
|
+
const now = /* @__PURE__ */ new Date();
|
|
45
|
+
const diffInSeconds = Math.floor((now.getTime() - dateObj.getTime()) / 1e3);
|
|
46
|
+
const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
47
|
+
if (diffInSeconds < 60) return rtf.format(-diffInSeconds, "second");
|
|
48
|
+
if (diffInSeconds < 3600) return rtf.format(-Math.floor(diffInSeconds / 60), "minute");
|
|
49
|
+
if (diffInSeconds < 86400) return rtf.format(-Math.floor(diffInSeconds / 3600), "hour");
|
|
50
|
+
if (diffInSeconds < 604800) return rtf.format(-Math.floor(diffInSeconds / 86400), "day");
|
|
51
|
+
if (diffInSeconds < 2592e3) return rtf.format(-Math.floor(diffInSeconds / 604800), "week");
|
|
52
|
+
if (diffInSeconds < 31536e3) return rtf.format(-Math.floor(diffInSeconds / 2592e3), "month");
|
|
53
|
+
return rtf.format(-Math.floor(diffInSeconds / 31536e3), "year");
|
|
54
|
+
}
|
|
55
|
+
function getInitials(name) {
|
|
56
|
+
return name.split(" ").map((part) => part.charAt(0).toUpperCase()).slice(0, 2).join("");
|
|
57
|
+
}
|
|
58
|
+
function truncate(text, maxLength) {
|
|
59
|
+
if (text.length <= maxLength) return text;
|
|
60
|
+
return text.slice(0, maxLength - 3) + "...";
|
|
61
|
+
}
|
|
62
|
+
function debounce(func, wait) {
|
|
63
|
+
let timeoutId;
|
|
64
|
+
return (...args) => {
|
|
65
|
+
clearTimeout(timeoutId);
|
|
66
|
+
timeoutId = setTimeout(() => func(...args), wait);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function sleep(ms) {
|
|
70
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
71
|
+
}
|
|
72
|
+
function generateId() {
|
|
73
|
+
return Math.random().toString(36).substring(2, 11);
|
|
74
|
+
}
|
|
75
|
+
var Accordion = AccordionPrimitive.Root;
|
|
76
|
+
var AccordionItem = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
77
|
+
AccordionPrimitive.Item,
|
|
78
|
+
{
|
|
79
|
+
ref,
|
|
80
|
+
className: cn("glass-card rounded-xl border border-border mb-2", className),
|
|
81
|
+
...props
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
AccordionItem.displayName = "AccordionItem";
|
|
85
|
+
var AccordionTrigger = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
86
|
+
AccordionPrimitive.Trigger,
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: cn(
|
|
90
|
+
"flex flex-1 items-center justify-between p-4 font-medium transition-all",
|
|
91
|
+
"hover:bg-muted/50 rounded-xl",
|
|
92
|
+
"[&[data-state=open]>svg]:rotate-180",
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
...props,
|
|
96
|
+
children: [
|
|
97
|
+
children,
|
|
98
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
) }));
|
|
102
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
103
|
+
var AccordionContent = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
104
|
+
AccordionPrimitive.Content,
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
108
|
+
...props,
|
|
109
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0 px-4", className), children })
|
|
110
|
+
}
|
|
111
|
+
));
|
|
112
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
113
|
+
var alertVariants = cva(
|
|
114
|
+
[
|
|
115
|
+
"relative w-full rounded-xl glass-card border p-4",
|
|
116
|
+
"transition-all duration-300",
|
|
117
|
+
"[&>svg~*]:pl-7 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground"
|
|
118
|
+
],
|
|
119
|
+
{
|
|
120
|
+
variants: {
|
|
121
|
+
variant: {
|
|
122
|
+
default: "bg-background text-foreground border-border",
|
|
123
|
+
info: "border-primary/50 bg-primary/5 text-primary [&>svg]:text-primary",
|
|
124
|
+
success: "border-success/50 bg-success/5 text-success [&>svg]:text-success",
|
|
125
|
+
warning: "border-warning/50 bg-warning/5 text-warning [&>svg]:text-warning",
|
|
126
|
+
error: "border-error/50 bg-error/5 text-error [&>svg]:text-error"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
defaultVariants: {
|
|
130
|
+
variant: "default"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
var Alert = React7.forwardRef(
|
|
135
|
+
({ className, variant, dismissible, onDismiss, children, ...props }, ref) => {
|
|
136
|
+
const [isVisible, setIsVisible] = React7.useState(true);
|
|
137
|
+
const handleDismiss = () => {
|
|
138
|
+
setIsVisible(false);
|
|
139
|
+
setTimeout(() => onDismiss?.(), 300);
|
|
140
|
+
};
|
|
141
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: isVisible && /* @__PURE__ */ jsxs(
|
|
142
|
+
motion.div,
|
|
143
|
+
{
|
|
144
|
+
ref,
|
|
145
|
+
initial: { opacity: 0, y: -10, scale: 0.95 },
|
|
146
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
147
|
+
exit: { opacity: 0, scale: 0.95, transition: { duration: 0.2 } },
|
|
148
|
+
className: cn(alertVariants({ variant }), className),
|
|
149
|
+
...props,
|
|
150
|
+
children: [
|
|
151
|
+
children,
|
|
152
|
+
dismissible && /* @__PURE__ */ jsx(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
onClick: handleDismiss,
|
|
156
|
+
className: "absolute right-4 top-4 rounded-md p-1 transition-colors hover:bg-muted",
|
|
157
|
+
"aria-label": "Dismiss",
|
|
158
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
) });
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
Alert.displayName = "Alert";
|
|
167
|
+
var AlertTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
168
|
+
"h5",
|
|
169
|
+
{
|
|
170
|
+
ref,
|
|
171
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
172
|
+
...props
|
|
173
|
+
}
|
|
174
|
+
));
|
|
175
|
+
AlertTitle.displayName = "AlertTitle";
|
|
176
|
+
var AlertDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
ref,
|
|
180
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
181
|
+
...props
|
|
182
|
+
}
|
|
183
|
+
));
|
|
184
|
+
AlertDescription.displayName = "AlertDescription";
|
|
185
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
186
|
+
AvatarPrimitive.Root,
|
|
187
|
+
{
|
|
188
|
+
ref,
|
|
189
|
+
className: cn(
|
|
190
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
191
|
+
className
|
|
192
|
+
),
|
|
193
|
+
...props
|
|
194
|
+
}
|
|
195
|
+
));
|
|
196
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
197
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
198
|
+
AvatarPrimitive.Image,
|
|
199
|
+
{
|
|
200
|
+
ref,
|
|
201
|
+
className: cn("aspect-square h-full w-full", className),
|
|
202
|
+
...props
|
|
203
|
+
}
|
|
204
|
+
));
|
|
205
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
206
|
+
var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
207
|
+
AvatarPrimitive.Fallback,
|
|
208
|
+
{
|
|
209
|
+
ref,
|
|
210
|
+
className: cn(
|
|
211
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted text-sm font-medium",
|
|
212
|
+
className
|
|
213
|
+
),
|
|
214
|
+
...props
|
|
215
|
+
}
|
|
216
|
+
));
|
|
217
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
218
|
+
var badgeVariants = cva(
|
|
219
|
+
[
|
|
220
|
+
"inline-flex items-center rounded-full px-2.5 py-0.5",
|
|
221
|
+
"text-xs font-semibold",
|
|
222
|
+
"transition-colors"
|
|
223
|
+
],
|
|
224
|
+
{
|
|
225
|
+
variants: {
|
|
226
|
+
variant: {
|
|
227
|
+
// Filled variants
|
|
228
|
+
primary: "bg-true-azure text-seasalt",
|
|
229
|
+
secondary: "bg-dark-amethyst text-seasalt",
|
|
230
|
+
accent: "bg-sunflower-gold text-black",
|
|
231
|
+
ember: "bg-autumn-ember text-seasalt",
|
|
232
|
+
success: "bg-success text-seasalt",
|
|
233
|
+
warning: "bg-warning text-black",
|
|
234
|
+
error: "bg-error text-seasalt",
|
|
235
|
+
// Outline variants
|
|
236
|
+
"outline-primary": "border border-true-azure text-true-azure bg-transparent",
|
|
237
|
+
"outline-secondary": "border border-dark-amethyst text-dark-amethyst bg-transparent",
|
|
238
|
+
"outline-accent": "border border-sunflower-gold text-sunflower-gold bg-transparent",
|
|
239
|
+
"outline-success": "border border-success text-success bg-transparent",
|
|
240
|
+
"outline-warning": "border border-warning text-warning bg-transparent",
|
|
241
|
+
"outline-error": "border border-error text-error bg-transparent",
|
|
242
|
+
// Soft variants (light background)
|
|
243
|
+
"soft-primary": "bg-true-azure/10 text-true-azure",
|
|
244
|
+
"soft-secondary": "bg-dark-amethyst/10 text-dark-amethyst",
|
|
245
|
+
"soft-accent": "bg-sunflower-gold/10 text-sunflower-gold",
|
|
246
|
+
"soft-success": "bg-success/10 text-success",
|
|
247
|
+
"soft-warning": "bg-warning/10 text-warning",
|
|
248
|
+
"soft-error": "bg-error/10 text-error",
|
|
249
|
+
// Default/neutral
|
|
250
|
+
default: "bg-muted text-muted-foreground"
|
|
251
|
+
},
|
|
252
|
+
size: {
|
|
253
|
+
sm: "px-2 py-0.5 text-[10px]",
|
|
254
|
+
default: "px-2.5 py-0.5 text-xs",
|
|
255
|
+
lg: "px-3 py-1 text-sm"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
defaultVariants: {
|
|
259
|
+
variant: "default",
|
|
260
|
+
size: "default"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
var Badge = React7.forwardRef(
|
|
265
|
+
({ className, variant, size, dot, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
ref,
|
|
269
|
+
className: cn(badgeVariants({ variant, size }), className),
|
|
270
|
+
...props,
|
|
271
|
+
children: [
|
|
272
|
+
dot && /* @__PURE__ */ jsx(
|
|
273
|
+
"span",
|
|
274
|
+
{
|
|
275
|
+
className: cn(
|
|
276
|
+
"mr-1.5 h-1.5 w-1.5 rounded-full",
|
|
277
|
+
variant?.includes("success") && "bg-success",
|
|
278
|
+
variant?.includes("warning") && "bg-warning",
|
|
279
|
+
variant?.includes("error") && "bg-error",
|
|
280
|
+
variant?.includes("primary") && "bg-true-azure",
|
|
281
|
+
!variant && "bg-current"
|
|
282
|
+
)
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
children
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
);
|
|
290
|
+
Badge.displayName = "Badge";
|
|
291
|
+
var statusMap = {
|
|
292
|
+
active: { variant: "soft-success", label: "Active" },
|
|
293
|
+
inactive: { variant: "default", label: "Inactive" },
|
|
294
|
+
pending: { variant: "soft-warning", label: "Pending" },
|
|
295
|
+
success: { variant: "soft-success", label: "Success" },
|
|
296
|
+
error: { variant: "soft-error", label: "Error" },
|
|
297
|
+
warning: { variant: "soft-warning", label: "Warning" }
|
|
298
|
+
};
|
|
299
|
+
var StatusBadge = ({
|
|
300
|
+
status,
|
|
301
|
+
children,
|
|
302
|
+
className
|
|
303
|
+
}) => {
|
|
304
|
+
const { variant, label } = statusMap[status];
|
|
305
|
+
return /* @__PURE__ */ jsx(Badge, { variant, dot: true, className, children: children || label });
|
|
306
|
+
};
|
|
307
|
+
StatusBadge.displayName = "StatusBadge";
|
|
308
|
+
var Breadcrumbs = React7.forwardRef(
|
|
309
|
+
({ className, items, separator, ...props }, ref) => {
|
|
310
|
+
return /* @__PURE__ */ jsx(
|
|
311
|
+
"nav",
|
|
312
|
+
{
|
|
313
|
+
ref,
|
|
314
|
+
"aria-label": "Breadcrumb",
|
|
315
|
+
className: cn("flex items-center space-x-1 text-sm", className),
|
|
316
|
+
...props,
|
|
317
|
+
children: /* @__PURE__ */ jsx("ol", { className: "flex items-center space-x-1", children: items.map((item, index) => {
|
|
318
|
+
const isLast = index === items.length - 1;
|
|
319
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex items-center space-x-1", children: [
|
|
320
|
+
item.href || item.onClick ? /* @__PURE__ */ jsx(
|
|
321
|
+
motion.a,
|
|
322
|
+
{
|
|
323
|
+
href: item.href,
|
|
324
|
+
onClick: item.onClick,
|
|
325
|
+
whileHover: { x: 2 },
|
|
326
|
+
className: cn(
|
|
327
|
+
"transition-colors hover:text-primary",
|
|
328
|
+
isLast ? "text-foreground font-medium" : "text-muted-foreground"
|
|
329
|
+
),
|
|
330
|
+
"aria-current": isLast ? "page" : void 0,
|
|
331
|
+
children: item.label
|
|
332
|
+
}
|
|
333
|
+
) : /* @__PURE__ */ jsx(
|
|
334
|
+
"span",
|
|
335
|
+
{
|
|
336
|
+
className: cn(
|
|
337
|
+
isLast ? "text-foreground font-medium" : "text-muted-foreground"
|
|
338
|
+
),
|
|
339
|
+
"aria-current": isLast ? "page" : void 0,
|
|
340
|
+
children: item.label
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
!isLast && /* @__PURE__ */ jsx(
|
|
344
|
+
ChevronRight,
|
|
345
|
+
{
|
|
346
|
+
className: "h-4 w-4 text-muted-foreground",
|
|
347
|
+
"aria-hidden": "true"
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
] }, index);
|
|
351
|
+
}) })
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
357
|
+
function setRef(ref, value) {
|
|
358
|
+
if (typeof ref === "function") {
|
|
359
|
+
return ref(value);
|
|
360
|
+
} else if (ref !== null && ref !== void 0) {
|
|
361
|
+
ref.current = value;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function composeRefs(...refs) {
|
|
365
|
+
return (node) => {
|
|
366
|
+
let hasCleanup = false;
|
|
367
|
+
const cleanups = refs.map((ref) => {
|
|
368
|
+
const cleanup = setRef(ref, node);
|
|
369
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
370
|
+
hasCleanup = true;
|
|
371
|
+
}
|
|
372
|
+
return cleanup;
|
|
373
|
+
});
|
|
374
|
+
if (hasCleanup) {
|
|
375
|
+
return () => {
|
|
376
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
377
|
+
const cleanup = cleanups[i];
|
|
378
|
+
if (typeof cleanup == "function") {
|
|
379
|
+
cleanup();
|
|
380
|
+
} else {
|
|
381
|
+
setRef(refs[i], null);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
// @__NO_SIDE_EFFECTS__
|
|
389
|
+
function createSlot(ownerName) {
|
|
390
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
391
|
+
const Slot2 = React7.forwardRef((props, forwardedRef) => {
|
|
392
|
+
const { children, ...slotProps } = props;
|
|
393
|
+
const childrenArray = React7.Children.toArray(children);
|
|
394
|
+
const slottable = childrenArray.find(isSlottable);
|
|
395
|
+
if (slottable) {
|
|
396
|
+
const newElement = slottable.props.children;
|
|
397
|
+
const newChildren = childrenArray.map((child) => {
|
|
398
|
+
if (child === slottable) {
|
|
399
|
+
if (React7.Children.count(newElement) > 1) return React7.Children.only(null);
|
|
400
|
+
return React7.isValidElement(newElement) ? newElement.props.children : null;
|
|
401
|
+
} else {
|
|
402
|
+
return child;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React7.isValidElement(newElement) ? React7.cloneElement(newElement, void 0, newChildren) : null });
|
|
406
|
+
}
|
|
407
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
408
|
+
});
|
|
409
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
410
|
+
return Slot2;
|
|
411
|
+
}
|
|
412
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
413
|
+
// @__NO_SIDE_EFFECTS__
|
|
414
|
+
function createSlotClone(ownerName) {
|
|
415
|
+
const SlotClone = React7.forwardRef((props, forwardedRef) => {
|
|
416
|
+
const { children, ...slotProps } = props;
|
|
417
|
+
if (React7.isValidElement(children)) {
|
|
418
|
+
const childrenRef = getElementRef(children);
|
|
419
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
420
|
+
if (children.type !== React7.Fragment) {
|
|
421
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
422
|
+
}
|
|
423
|
+
return React7.cloneElement(children, props2);
|
|
424
|
+
}
|
|
425
|
+
return React7.Children.count(children) > 1 ? React7.Children.only(null) : null;
|
|
426
|
+
});
|
|
427
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
428
|
+
return SlotClone;
|
|
429
|
+
}
|
|
430
|
+
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
431
|
+
function isSlottable(child) {
|
|
432
|
+
return React7.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
433
|
+
}
|
|
434
|
+
function mergeProps(slotProps, childProps) {
|
|
435
|
+
const overrideProps = { ...childProps };
|
|
436
|
+
for (const propName in childProps) {
|
|
437
|
+
const slotPropValue = slotProps[propName];
|
|
438
|
+
const childPropValue = childProps[propName];
|
|
439
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
440
|
+
if (isHandler) {
|
|
441
|
+
if (slotPropValue && childPropValue) {
|
|
442
|
+
overrideProps[propName] = (...args) => {
|
|
443
|
+
const result = childPropValue(...args);
|
|
444
|
+
slotPropValue(...args);
|
|
445
|
+
return result;
|
|
446
|
+
};
|
|
447
|
+
} else if (slotPropValue) {
|
|
448
|
+
overrideProps[propName] = slotPropValue;
|
|
449
|
+
}
|
|
450
|
+
} else if (propName === "style") {
|
|
451
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
452
|
+
} else if (propName === "className") {
|
|
453
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return { ...slotProps, ...overrideProps };
|
|
457
|
+
}
|
|
458
|
+
function getElementRef(element) {
|
|
459
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
460
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
461
|
+
if (mayWarn) {
|
|
462
|
+
return element.ref;
|
|
463
|
+
}
|
|
464
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
465
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
466
|
+
if (mayWarn) {
|
|
467
|
+
return element.props.ref;
|
|
468
|
+
}
|
|
469
|
+
return element.props.ref || element.ref;
|
|
470
|
+
}
|
|
471
|
+
var buttonVariants = cva(
|
|
472
|
+
[
|
|
473
|
+
"inline-flex items-center justify-center gap-2",
|
|
474
|
+
"whitespace-nowrap rounded-xl text-sm font-medium",
|
|
475
|
+
"transition-all duration-250",
|
|
476
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
477
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
478
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
479
|
+
"relative overflow-hidden"
|
|
480
|
+
],
|
|
481
|
+
{
|
|
482
|
+
variants: {
|
|
483
|
+
variant: {
|
|
484
|
+
// Filled variants with glass effect
|
|
485
|
+
primary: [
|
|
486
|
+
"bg-true-azure text-seasalt",
|
|
487
|
+
"hover:bg-true-azure/90 hover:shadow-primary",
|
|
488
|
+
"active:scale-95"
|
|
489
|
+
],
|
|
490
|
+
secondary: [
|
|
491
|
+
"bg-dark-amethyst text-seasalt",
|
|
492
|
+
"hover:bg-dark-amethyst/90",
|
|
493
|
+
"active:scale-95"
|
|
494
|
+
],
|
|
495
|
+
accent: [
|
|
496
|
+
"bg-sunflower-gold text-black",
|
|
497
|
+
"hover:bg-sunflower-gold/90 hover:shadow-accent",
|
|
498
|
+
"active:scale-95"
|
|
499
|
+
],
|
|
500
|
+
ember: [
|
|
501
|
+
"bg-autumn-ember text-seasalt",
|
|
502
|
+
"hover:bg-autumn-ember/90",
|
|
503
|
+
"active:scale-95"
|
|
504
|
+
],
|
|
505
|
+
destructive: [
|
|
506
|
+
"bg-error text-seasalt",
|
|
507
|
+
"hover:bg-error/90",
|
|
508
|
+
"active:scale-95"
|
|
509
|
+
],
|
|
510
|
+
// Glass outline variants
|
|
511
|
+
"outline-primary": [
|
|
512
|
+
"glass border-2 border-true-azure text-true-azure",
|
|
513
|
+
"hover:bg-true-azure/10 hover:border-true-azure/80"
|
|
514
|
+
],
|
|
515
|
+
"outline-secondary": [
|
|
516
|
+
"glass border-2 border-dark-amethyst text-dark-amethyst",
|
|
517
|
+
"hover:bg-dark-amethyst/10"
|
|
518
|
+
],
|
|
519
|
+
"outline-accent": [
|
|
520
|
+
"glass border-2 border-sunflower-gold text-sunflower-gold",
|
|
521
|
+
"hover:bg-sunflower-gold/10"
|
|
522
|
+
],
|
|
523
|
+
"outline-ember": [
|
|
524
|
+
"glass border-2 border-autumn-ember text-autumn-ember",
|
|
525
|
+
"hover:bg-autumn-ember/10"
|
|
526
|
+
],
|
|
527
|
+
"outline-destructive": [
|
|
528
|
+
"glass border-2 border-error text-error",
|
|
529
|
+
"hover:bg-error/10"
|
|
530
|
+
],
|
|
531
|
+
// Ghost glass variants
|
|
532
|
+
"ghost-primary": ["glass text-true-azure", "hover:bg-true-azure/10"],
|
|
533
|
+
"ghost-secondary": [
|
|
534
|
+
"glass text-dark-amethyst",
|
|
535
|
+
"hover:bg-dark-amethyst/10"
|
|
536
|
+
],
|
|
537
|
+
"ghost-accent": [
|
|
538
|
+
"glass text-sunflower-gold",
|
|
539
|
+
"hover:bg-sunflower-gold/10"
|
|
540
|
+
],
|
|
541
|
+
"ghost-ember": ["glass text-autumn-ember", "hover:bg-autumn-ember/10"],
|
|
542
|
+
"ghost-destructive": ["glass text-error", "hover:bg-error/10"],
|
|
543
|
+
link: ["text-true-azure underline-offset-4", "hover:underline"],
|
|
544
|
+
ghost: ["glass text-foreground", "hover:bg-muted"],
|
|
545
|
+
outline: [
|
|
546
|
+
"glass border border-border text-foreground",
|
|
547
|
+
"hover:bg-muted"
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
size: {
|
|
551
|
+
default: "h-10 px-4 py-2",
|
|
552
|
+
sm: "h-8 rounded-lg px-3 text-xs",
|
|
553
|
+
lg: "h-12 rounded-xl px-6 text-base",
|
|
554
|
+
xl: "h-14 rounded-xl px-8 text-lg",
|
|
555
|
+
icon: "h-10 w-10",
|
|
556
|
+
"icon-sm": "h-8 w-8",
|
|
557
|
+
"icon-lg": "h-12 w-12"
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
defaultVariants: {
|
|
561
|
+
variant: "primary",
|
|
562
|
+
size: "default"
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
);
|
|
566
|
+
var Ripple = ({ x, y }) => /* @__PURE__ */ jsx(
|
|
567
|
+
motion.span,
|
|
568
|
+
{
|
|
569
|
+
className: "absolute rounded-full bg-white/30",
|
|
570
|
+
style: {
|
|
571
|
+
left: x,
|
|
572
|
+
top: y,
|
|
573
|
+
width: 0,
|
|
574
|
+
height: 0
|
|
575
|
+
},
|
|
576
|
+
initial: { width: 0, height: 0, opacity: 0.5 },
|
|
577
|
+
animate: { width: 300, height: 300, opacity: 0 },
|
|
578
|
+
transition: { duration: 0.6, ease: "easeOut" }
|
|
579
|
+
}
|
|
580
|
+
);
|
|
581
|
+
var Button = React7.forwardRef(
|
|
582
|
+
({
|
|
583
|
+
className,
|
|
584
|
+
variant,
|
|
585
|
+
size,
|
|
586
|
+
asChild = false,
|
|
587
|
+
isLoading = false,
|
|
588
|
+
leftIcon,
|
|
589
|
+
rightIcon,
|
|
590
|
+
children,
|
|
591
|
+
disabled,
|
|
592
|
+
onClick,
|
|
593
|
+
...props
|
|
594
|
+
}, ref) => {
|
|
595
|
+
const [ripples, setRipples] = React7.useState([]);
|
|
596
|
+
const handleClick = (e) => {
|
|
597
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
598
|
+
const x = e.clientX - rect.left;
|
|
599
|
+
const y = e.clientY - rect.top;
|
|
600
|
+
setRipples([...ripples, { x, y, id: Date.now() }]);
|
|
601
|
+
setTimeout(() => setRipples((prev) => prev.slice(1)), 600);
|
|
602
|
+
onClick?.(e);
|
|
603
|
+
};
|
|
604
|
+
const Comp = asChild ? Slot : "button";
|
|
605
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
606
|
+
ripples.map((ripple) => /* @__PURE__ */ jsx(Ripple, { x: ripple.x, y: ripple.y }, ripple.id)),
|
|
607
|
+
isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) : leftIcon ? leftIcon : null,
|
|
608
|
+
children,
|
|
609
|
+
!isLoading && rightIcon
|
|
610
|
+
] });
|
|
611
|
+
if (asChild) {
|
|
612
|
+
return /* @__PURE__ */ jsx(
|
|
613
|
+
Comp,
|
|
614
|
+
{
|
|
615
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
616
|
+
ref,
|
|
617
|
+
disabled: disabled || isLoading,
|
|
618
|
+
...props,
|
|
619
|
+
children: content
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
return /* @__PURE__ */ jsx(
|
|
624
|
+
motion.button,
|
|
625
|
+
{
|
|
626
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
627
|
+
ref,
|
|
628
|
+
disabled: disabled || isLoading,
|
|
629
|
+
onClick: handleClick,
|
|
630
|
+
whileHover: { scale: disabled || isLoading ? 1 : 1.03 },
|
|
631
|
+
whileTap: { scale: disabled || isLoading ? 1 : 0.97 },
|
|
632
|
+
transition: { type: "spring", stiffness: 400, damping: 17 },
|
|
633
|
+
...props,
|
|
634
|
+
children: content
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
Button.displayName = "Button";
|
|
640
|
+
var IconButton = React7.forwardRef(
|
|
641
|
+
({ size = "icon", children, className, ...props }, ref) => {
|
|
642
|
+
return /* @__PURE__ */ jsx(
|
|
643
|
+
Button,
|
|
644
|
+
{
|
|
645
|
+
ref,
|
|
646
|
+
size,
|
|
647
|
+
className: cn("rounded-full", className),
|
|
648
|
+
...props,
|
|
649
|
+
children
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
);
|
|
654
|
+
IconButton.displayName = "IconButton";
|
|
655
|
+
var Card = React7.forwardRef(({ className, hover = false, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
656
|
+
motion.div,
|
|
657
|
+
{
|
|
658
|
+
ref,
|
|
659
|
+
className: cn(
|
|
660
|
+
"glass-card rounded-xl",
|
|
661
|
+
hover && "glass-hover cursor-pointer",
|
|
662
|
+
className
|
|
663
|
+
),
|
|
664
|
+
initial: { opacity: 0, y: 20 },
|
|
665
|
+
animate: { opacity: 1, y: 0 },
|
|
666
|
+
...hover ? {
|
|
667
|
+
whileHover: { y: -4, scale: 1.01 },
|
|
668
|
+
whileTap: { scale: 0.99 },
|
|
669
|
+
transition: { type: "spring", stiffness: 300, damping: 20 }
|
|
670
|
+
} : {
|
|
671
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
672
|
+
},
|
|
673
|
+
...props
|
|
674
|
+
}
|
|
675
|
+
));
|
|
676
|
+
Card.displayName = "Card";
|
|
677
|
+
var CardHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
678
|
+
"div",
|
|
679
|
+
{
|
|
680
|
+
ref,
|
|
681
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
682
|
+
...props
|
|
683
|
+
}
|
|
684
|
+
));
|
|
685
|
+
CardHeader.displayName = "CardHeader";
|
|
686
|
+
var CardTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
687
|
+
"h3",
|
|
688
|
+
{
|
|
689
|
+
ref,
|
|
690
|
+
className: cn(
|
|
691
|
+
"text-xl font-semibold leading-none tracking-tight",
|
|
692
|
+
"transition-colors duration-200",
|
|
693
|
+
className
|
|
694
|
+
),
|
|
695
|
+
...props
|
|
696
|
+
}
|
|
697
|
+
));
|
|
698
|
+
CardTitle.displayName = "CardTitle";
|
|
699
|
+
var CardDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
700
|
+
"p",
|
|
701
|
+
{
|
|
702
|
+
ref,
|
|
703
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
704
|
+
...props
|
|
705
|
+
}
|
|
706
|
+
));
|
|
707
|
+
CardDescription.displayName = "CardDescription";
|
|
708
|
+
var CardContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
709
|
+
CardContent.displayName = "CardContent";
|
|
710
|
+
var CardFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
711
|
+
"div",
|
|
712
|
+
{
|
|
713
|
+
ref,
|
|
714
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
715
|
+
...props
|
|
716
|
+
}
|
|
717
|
+
));
|
|
718
|
+
CardFooter.displayName = "CardFooter";
|
|
719
|
+
var StatCard = ({
|
|
720
|
+
title,
|
|
721
|
+
value,
|
|
722
|
+
icon,
|
|
723
|
+
trend,
|
|
724
|
+
description,
|
|
725
|
+
className
|
|
726
|
+
}) => /* @__PURE__ */ jsx(
|
|
727
|
+
motion.div,
|
|
728
|
+
{
|
|
729
|
+
className: cn("glass-card rounded-xl overflow-hidden", className),
|
|
730
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
731
|
+
animate: { opacity: 1, scale: 1 },
|
|
732
|
+
whileHover: { y: -6, scale: 1.02 },
|
|
733
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
734
|
+
children: /* @__PURE__ */ jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
735
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 flex-1", children: [
|
|
736
|
+
/* @__PURE__ */ jsx(
|
|
737
|
+
motion.p,
|
|
738
|
+
{
|
|
739
|
+
className: "text-sm font-medium text-muted-foreground",
|
|
740
|
+
initial: { opacity: 0 },
|
|
741
|
+
animate: { opacity: 1 },
|
|
742
|
+
transition: { delay: 0.1 },
|
|
743
|
+
children: title
|
|
744
|
+
}
|
|
745
|
+
),
|
|
746
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
|
|
747
|
+
/* @__PURE__ */ jsx(
|
|
748
|
+
motion.span,
|
|
749
|
+
{
|
|
750
|
+
className: "text-3xl font-bold text-foreground",
|
|
751
|
+
initial: { opacity: 0, x: -10 },
|
|
752
|
+
animate: { opacity: 1, x: 0 },
|
|
753
|
+
transition: { delay: 0.2, type: "spring" },
|
|
754
|
+
children: value
|
|
755
|
+
}
|
|
756
|
+
),
|
|
757
|
+
trend && /* @__PURE__ */ jsxs(
|
|
758
|
+
motion.span,
|
|
759
|
+
{
|
|
760
|
+
className: cn(
|
|
761
|
+
"text-sm font-medium flex items-center gap-1",
|
|
762
|
+
trend.isPositive ? "text-success" : "text-error"
|
|
763
|
+
),
|
|
764
|
+
initial: { opacity: 0, scale: 0 },
|
|
765
|
+
animate: { opacity: 1, scale: 1 },
|
|
766
|
+
transition: { delay: 0.3, type: "spring", stiffness: 500 },
|
|
767
|
+
children: [
|
|
768
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg", children: trend.isPositive ? "\u2191" : "\u2193" }),
|
|
769
|
+
Math.abs(trend.value),
|
|
770
|
+
"%"
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
] }),
|
|
775
|
+
description && /* @__PURE__ */ jsx(
|
|
776
|
+
motion.p,
|
|
777
|
+
{
|
|
778
|
+
className: "text-xs text-muted-foreground",
|
|
779
|
+
initial: { opacity: 0 },
|
|
780
|
+
animate: { opacity: 1 },
|
|
781
|
+
transition: { delay: 0.4 },
|
|
782
|
+
children: description
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
] }),
|
|
786
|
+
icon && /* @__PURE__ */ jsx(
|
|
787
|
+
motion.div,
|
|
788
|
+
{
|
|
789
|
+
className: "rounded-lg bg-primary/10 p-3 text-primary",
|
|
790
|
+
initial: { opacity: 0, rotate: -180, scale: 0 },
|
|
791
|
+
animate: { opacity: 1, rotate: 0, scale: 1 },
|
|
792
|
+
transition: { delay: 0.2, type: "spring", stiffness: 200 },
|
|
793
|
+
whileHover: { rotate: 360, scale: 1.1 },
|
|
794
|
+
children: icon
|
|
795
|
+
}
|
|
796
|
+
)
|
|
797
|
+
] }) })
|
|
798
|
+
}
|
|
799
|
+
);
|
|
800
|
+
StatCard.displayName = "StatCard";
|
|
801
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
802
|
+
CheckboxPrimitive.Root,
|
|
803
|
+
{
|
|
804
|
+
ref,
|
|
805
|
+
className: cn(
|
|
806
|
+
"peer h-5 w-5 shrink-0 rounded-md glass-card border border-border ring-offset-background",
|
|
807
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
808
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
809
|
+
"data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary",
|
|
810
|
+
"transition-all duration-200",
|
|
811
|
+
className
|
|
812
|
+
),
|
|
813
|
+
...props,
|
|
814
|
+
children: /* @__PURE__ */ jsx(
|
|
815
|
+
CheckboxPrimitive.Indicator,
|
|
816
|
+
{
|
|
817
|
+
className: cn("flex items-center justify-center text-current"),
|
|
818
|
+
children: /* @__PURE__ */ jsx(
|
|
819
|
+
motion.div,
|
|
820
|
+
{
|
|
821
|
+
initial: { scale: 0, rotate: -180 },
|
|
822
|
+
animate: { scale: 1, rotate: 0 },
|
|
823
|
+
transition: { type: "spring", stiffness: 500, damping: 15 },
|
|
824
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
}
|
|
830
|
+
));
|
|
831
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
832
|
+
var Dialog = DialogPrimitive.Root;
|
|
833
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
834
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
835
|
+
var DialogClose = DialogPrimitive.Close;
|
|
836
|
+
var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
837
|
+
DialogPrimitive.Overlay,
|
|
838
|
+
{
|
|
839
|
+
ref,
|
|
840
|
+
className: cn(
|
|
841
|
+
"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",
|
|
842
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
843
|
+
className
|
|
844
|
+
),
|
|
845
|
+
...props
|
|
846
|
+
}
|
|
847
|
+
));
|
|
848
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
849
|
+
var DialogContent = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
850
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
851
|
+
/* @__PURE__ */ jsxs(
|
|
852
|
+
DialogPrimitive.Content,
|
|
853
|
+
{
|
|
854
|
+
ref,
|
|
855
|
+
className: cn(
|
|
856
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6",
|
|
857
|
+
"glass-strong border-2 border-white/30 rounded-2xl shadow-2xl",
|
|
858
|
+
// Enhanced liquid glass effect
|
|
859
|
+
"backdrop-blur-3xl bg-gradient-to-br from-white/80 via-white/60 to-white/40",
|
|
860
|
+
"dark:from-gray-900/80 dark:via-gray-900/60 dark:to-gray-900/40",
|
|
861
|
+
// Subtle glow effect
|
|
862
|
+
"shadow-[0_0_30px_rgba(80,0,171,0.2),0_20px_60px_rgba(0,0,0,0.3)]",
|
|
863
|
+
"dark:shadow-[0_0_40px_rgba(80,0,171,0.3),0_20px_80px_rgba(0,0,0,0.5)]",
|
|
864
|
+
// Animations
|
|
865
|
+
"duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
866
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
867
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
868
|
+
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
869
|
+
"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
870
|
+
className
|
|
871
|
+
),
|
|
872
|
+
...props,
|
|
873
|
+
children: [
|
|
874
|
+
children,
|
|
875
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-lg p-2 glass hover:bg-muted/50 transition-all hover:rotate-90 duration-300 ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
876
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
877
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
878
|
+
] })
|
|
879
|
+
]
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
] }));
|
|
883
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
884
|
+
var DialogHeader = ({
|
|
885
|
+
className,
|
|
886
|
+
...props
|
|
887
|
+
}) => /* @__PURE__ */ jsx(
|
|
888
|
+
"div",
|
|
889
|
+
{
|
|
890
|
+
className: cn(
|
|
891
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
892
|
+
className
|
|
893
|
+
),
|
|
894
|
+
...props
|
|
895
|
+
}
|
|
896
|
+
);
|
|
897
|
+
DialogHeader.displayName = "DialogHeader";
|
|
898
|
+
var DialogFooter = ({
|
|
899
|
+
className,
|
|
900
|
+
...props
|
|
901
|
+
}) => /* @__PURE__ */ jsx(
|
|
902
|
+
"div",
|
|
903
|
+
{
|
|
904
|
+
className: cn(
|
|
905
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
906
|
+
className
|
|
907
|
+
),
|
|
908
|
+
...props
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
DialogFooter.displayName = "DialogFooter";
|
|
912
|
+
var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
913
|
+
DialogPrimitive.Title,
|
|
914
|
+
{
|
|
915
|
+
ref,
|
|
916
|
+
className: cn(
|
|
917
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
918
|
+
className
|
|
919
|
+
),
|
|
920
|
+
...props
|
|
921
|
+
}
|
|
922
|
+
));
|
|
923
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
924
|
+
var DialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
925
|
+
DialogPrimitive.Description,
|
|
926
|
+
{
|
|
927
|
+
ref,
|
|
928
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
929
|
+
...props
|
|
930
|
+
}
|
|
931
|
+
));
|
|
932
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
933
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
934
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
935
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
936
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
937
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
938
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
939
|
+
var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
940
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
941
|
+
{
|
|
942
|
+
ref,
|
|
943
|
+
className: cn(
|
|
944
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
945
|
+
inset && "pl-8",
|
|
946
|
+
className
|
|
947
|
+
),
|
|
948
|
+
...props,
|
|
949
|
+
children: [
|
|
950
|
+
children,
|
|
951
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
952
|
+
]
|
|
953
|
+
}
|
|
954
|
+
));
|
|
955
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
956
|
+
var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
957
|
+
DropdownMenuPrimitive.SubContent,
|
|
958
|
+
{
|
|
959
|
+
ref,
|
|
960
|
+
className: cn(
|
|
961
|
+
"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
962
|
+
className
|
|
963
|
+
),
|
|
964
|
+
...props
|
|
965
|
+
}
|
|
966
|
+
));
|
|
967
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
968
|
+
var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
969
|
+
DropdownMenuPrimitive.Content,
|
|
970
|
+
{
|
|
971
|
+
ref,
|
|
972
|
+
sideOffset,
|
|
973
|
+
className: cn(
|
|
974
|
+
"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
975
|
+
className
|
|
976
|
+
),
|
|
977
|
+
...props
|
|
978
|
+
}
|
|
979
|
+
) }));
|
|
980
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
981
|
+
var DropdownMenuItem = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
982
|
+
DropdownMenuPrimitive.Item,
|
|
983
|
+
{
|
|
984
|
+
ref,
|
|
985
|
+
className: cn(
|
|
986
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
987
|
+
inset && "pl-8",
|
|
988
|
+
className
|
|
989
|
+
),
|
|
990
|
+
...props
|
|
991
|
+
}
|
|
992
|
+
));
|
|
993
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
994
|
+
var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
995
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
996
|
+
{
|
|
997
|
+
ref,
|
|
998
|
+
className: cn(
|
|
999
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1000
|
+
className
|
|
1001
|
+
),
|
|
1002
|
+
checked,
|
|
1003
|
+
...props,
|
|
1004
|
+
children: [
|
|
1005
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
1006
|
+
children
|
|
1007
|
+
]
|
|
1008
|
+
}
|
|
1009
|
+
));
|
|
1010
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1011
|
+
var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1012
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1013
|
+
{
|
|
1014
|
+
ref,
|
|
1015
|
+
className: cn(
|
|
1016
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1017
|
+
className
|
|
1018
|
+
),
|
|
1019
|
+
...props,
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1022
|
+
children
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
));
|
|
1026
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1027
|
+
var DropdownMenuLabel = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1028
|
+
DropdownMenuPrimitive.Label,
|
|
1029
|
+
{
|
|
1030
|
+
ref,
|
|
1031
|
+
className: cn(
|
|
1032
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
1033
|
+
inset && "pl-8",
|
|
1034
|
+
className
|
|
1035
|
+
),
|
|
1036
|
+
...props
|
|
1037
|
+
}
|
|
1038
|
+
));
|
|
1039
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1040
|
+
var DropdownMenuSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1041
|
+
DropdownMenuPrimitive.Separator,
|
|
1042
|
+
{
|
|
1043
|
+
ref,
|
|
1044
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1045
|
+
...props
|
|
1046
|
+
}
|
|
1047
|
+
));
|
|
1048
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1049
|
+
var DropdownMenuShortcut = ({
|
|
1050
|
+
className,
|
|
1051
|
+
...props
|
|
1052
|
+
}) => {
|
|
1053
|
+
return /* @__PURE__ */ jsx(
|
|
1054
|
+
"span",
|
|
1055
|
+
{
|
|
1056
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1057
|
+
...props
|
|
1058
|
+
}
|
|
1059
|
+
);
|
|
1060
|
+
};
|
|
1061
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1062
|
+
var EmptyState = React7.forwardRef(
|
|
1063
|
+
({ className, icon, title, description, action, ...props }, ref) => {
|
|
1064
|
+
return /* @__PURE__ */ jsxs(
|
|
1065
|
+
motion.div,
|
|
1066
|
+
{
|
|
1067
|
+
ref,
|
|
1068
|
+
initial: { opacity: 0, y: 20 },
|
|
1069
|
+
animate: { opacity: 1, y: 0 },
|
|
1070
|
+
className: cn(
|
|
1071
|
+
"flex flex-col items-center justify-center text-center p-8 glass-card rounded-xl",
|
|
1072
|
+
className
|
|
1073
|
+
),
|
|
1074
|
+
...props,
|
|
1075
|
+
children: [
|
|
1076
|
+
icon && /* @__PURE__ */ jsx(
|
|
1077
|
+
motion.div,
|
|
1078
|
+
{
|
|
1079
|
+
initial: { scale: 0 },
|
|
1080
|
+
animate: { scale: 1 },
|
|
1081
|
+
transition: {
|
|
1082
|
+
type: "spring",
|
|
1083
|
+
stiffness: 200,
|
|
1084
|
+
damping: 15,
|
|
1085
|
+
delay: 0.1
|
|
1086
|
+
},
|
|
1087
|
+
className: "mb-4 text-muted-foreground",
|
|
1088
|
+
children: icon
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ jsx(
|
|
1092
|
+
motion.h3,
|
|
1093
|
+
{
|
|
1094
|
+
initial: { opacity: 0 },
|
|
1095
|
+
animate: { opacity: 1 },
|
|
1096
|
+
transition: { delay: 0.2 },
|
|
1097
|
+
className: "text-lg font-semibold text-foreground mb-2",
|
|
1098
|
+
children: title
|
|
1099
|
+
}
|
|
1100
|
+
),
|
|
1101
|
+
description && /* @__PURE__ */ jsx(
|
|
1102
|
+
motion.p,
|
|
1103
|
+
{
|
|
1104
|
+
initial: { opacity: 0 },
|
|
1105
|
+
animate: { opacity: 1 },
|
|
1106
|
+
transition: { delay: 0.3 },
|
|
1107
|
+
className: "text-sm text-muted-foreground mb-6 max-w-md",
|
|
1108
|
+
children: description
|
|
1109
|
+
}
|
|
1110
|
+
),
|
|
1111
|
+
action && /* @__PURE__ */ jsx(
|
|
1112
|
+
motion.div,
|
|
1113
|
+
{
|
|
1114
|
+
initial: { opacity: 0, y: 10 },
|
|
1115
|
+
animate: { opacity: 1, y: 0 },
|
|
1116
|
+
transition: { delay: 0.4 },
|
|
1117
|
+
children: /* @__PURE__ */ jsx(Button, { onClick: action.onClick, variant: "primary", children: action.label })
|
|
1118
|
+
}
|
|
1119
|
+
)
|
|
1120
|
+
]
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
);
|
|
1125
|
+
EmptyState.displayName = "EmptyState";
|
|
1126
|
+
var inputVariants = cva(
|
|
1127
|
+
[
|
|
1128
|
+
"flex w-full rounded-xl px-3 py-2",
|
|
1129
|
+
"text-base text-foreground",
|
|
1130
|
+
"placeholder:text-muted-foreground",
|
|
1131
|
+
"transition-all duration-250",
|
|
1132
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
1133
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1134
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
1135
|
+
"md:text-sm"
|
|
1136
|
+
],
|
|
1137
|
+
{
|
|
1138
|
+
variants: {
|
|
1139
|
+
variant: {
|
|
1140
|
+
default: [
|
|
1141
|
+
"glass border border-border",
|
|
1142
|
+
"focus-visible:border-primary focus-visible:shadow-primary"
|
|
1143
|
+
],
|
|
1144
|
+
filled: [
|
|
1145
|
+
"glass-card",
|
|
1146
|
+
"focus-visible:glass-strong focus-visible:border-primary"
|
|
1147
|
+
],
|
|
1148
|
+
ghost: [
|
|
1149
|
+
"glass",
|
|
1150
|
+
"hover:glass-card",
|
|
1151
|
+
"focus-visible:glass-strong focus-visible:border-primary"
|
|
1152
|
+
]
|
|
1153
|
+
},
|
|
1154
|
+
inputSize: {
|
|
1155
|
+
sm: "h-8 px-2 text-xs rounded-lg",
|
|
1156
|
+
default: "h-10 px-3",
|
|
1157
|
+
lg: "h-12 px-4 text-base"
|
|
1158
|
+
},
|
|
1159
|
+
state: {
|
|
1160
|
+
default: "",
|
|
1161
|
+
error: [
|
|
1162
|
+
"border-error text-error",
|
|
1163
|
+
"focus-visible:ring-error/50 focus-visible:border-error"
|
|
1164
|
+
],
|
|
1165
|
+
success: [
|
|
1166
|
+
"border-success text-success",
|
|
1167
|
+
"focus-visible:ring-success/50 focus-visible:border-success"
|
|
1168
|
+
]
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
defaultVariants: {
|
|
1172
|
+
variant: "default",
|
|
1173
|
+
inputSize: "default",
|
|
1174
|
+
state: "default"
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
);
|
|
1178
|
+
var Input = React7.forwardRef(
|
|
1179
|
+
({
|
|
1180
|
+
className,
|
|
1181
|
+
type = "text",
|
|
1182
|
+
variant,
|
|
1183
|
+
inputSize,
|
|
1184
|
+
state,
|
|
1185
|
+
leftIcon,
|
|
1186
|
+
rightIcon,
|
|
1187
|
+
leftAddon,
|
|
1188
|
+
rightAddon,
|
|
1189
|
+
error,
|
|
1190
|
+
hint,
|
|
1191
|
+
disabled,
|
|
1192
|
+
...props
|
|
1193
|
+
}, ref) => {
|
|
1194
|
+
const [isFocused, setIsFocused] = React7.useState(false);
|
|
1195
|
+
const hasError = !!error || state === "error";
|
|
1196
|
+
const currentState = hasError ? "error" : state;
|
|
1197
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
1198
|
+
/* @__PURE__ */ jsxs(
|
|
1199
|
+
motion.div,
|
|
1200
|
+
{
|
|
1201
|
+
className: "relative flex items-center",
|
|
1202
|
+
animate: {
|
|
1203
|
+
scale: isFocused ? 1.01 : 1
|
|
1204
|
+
},
|
|
1205
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
1206
|
+
children: [
|
|
1207
|
+
leftAddon && /* @__PURE__ */ jsx("div", { className: "flex items-center glass-card border border-r-0 border-border rounded-l-xl px-3 h-10", children: leftAddon }),
|
|
1208
|
+
leftIcon && !leftAddon && /* @__PURE__ */ jsx(
|
|
1209
|
+
motion.div,
|
|
1210
|
+
{
|
|
1211
|
+
className: "absolute left-3 text-muted-foreground pointer-events-none",
|
|
1212
|
+
animate: {
|
|
1213
|
+
x: isFocused ? 2 : 0,
|
|
1214
|
+
scale: isFocused ? 1.1 : 1
|
|
1215
|
+
},
|
|
1216
|
+
transition: { type: "spring", stiffness: 400, damping: 20 },
|
|
1217
|
+
children: leftIcon
|
|
1218
|
+
}
|
|
1219
|
+
),
|
|
1220
|
+
/* @__PURE__ */ jsx(
|
|
1221
|
+
"input",
|
|
1222
|
+
{
|
|
1223
|
+
type,
|
|
1224
|
+
className: cn(
|
|
1225
|
+
inputVariants({ variant, inputSize, state: currentState }),
|
|
1226
|
+
leftIcon && !leftAddon && "pl-10",
|
|
1227
|
+
rightIcon && !rightAddon && "pr-10",
|
|
1228
|
+
leftAddon && "rounded-l-none",
|
|
1229
|
+
rightAddon && "rounded-r-none",
|
|
1230
|
+
className
|
|
1231
|
+
),
|
|
1232
|
+
ref,
|
|
1233
|
+
disabled,
|
|
1234
|
+
onFocus: () => setIsFocused(true),
|
|
1235
|
+
onBlur: () => setIsFocused(false),
|
|
1236
|
+
"aria-invalid": hasError,
|
|
1237
|
+
"aria-describedby": error ? `${props.id}-error` : hint ? `${props.id}-hint` : void 0,
|
|
1238
|
+
...props
|
|
1239
|
+
}
|
|
1240
|
+
),
|
|
1241
|
+
rightIcon && !rightAddon && /* @__PURE__ */ jsx(
|
|
1242
|
+
motion.div,
|
|
1243
|
+
{
|
|
1244
|
+
className: "absolute right-3 text-muted-foreground pointer-events-none",
|
|
1245
|
+
animate: {
|
|
1246
|
+
x: isFocused ? -2 : 0,
|
|
1247
|
+
scale: isFocused ? 1.1 : 1
|
|
1248
|
+
},
|
|
1249
|
+
transition: { type: "spring", stiffness: 400, damping: 20 },
|
|
1250
|
+
children: rightIcon
|
|
1251
|
+
}
|
|
1252
|
+
),
|
|
1253
|
+
rightAddon && /* @__PURE__ */ jsx("div", { className: "flex items-center glass-card border border-l-0 border-border rounded-r-xl px-3 h-10", children: rightAddon })
|
|
1254
|
+
]
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1257
|
+
error && /* @__PURE__ */ jsx(
|
|
1258
|
+
motion.p,
|
|
1259
|
+
{
|
|
1260
|
+
initial: { opacity: 0, y: -10, height: 0 },
|
|
1261
|
+
animate: { opacity: 1, y: 0, height: "auto" },
|
|
1262
|
+
exit: { opacity: 0, y: -10, height: 0 },
|
|
1263
|
+
className: "mt-1.5 text-xs text-error",
|
|
1264
|
+
id: `${props.id}-error`,
|
|
1265
|
+
children: error
|
|
1266
|
+
}
|
|
1267
|
+
),
|
|
1268
|
+
hint && !error && /* @__PURE__ */ jsx(
|
|
1269
|
+
"p",
|
|
1270
|
+
{
|
|
1271
|
+
className: "mt-1.5 text-xs text-muted-foreground",
|
|
1272
|
+
id: `${props.id}-hint`,
|
|
1273
|
+
children: hint
|
|
1274
|
+
}
|
|
1275
|
+
)
|
|
1276
|
+
] });
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
Input.displayName = "Input";
|
|
1280
|
+
var Label2 = React7.forwardRef(
|
|
1281
|
+
({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1282
|
+
"label",
|
|
1283
|
+
{
|
|
1284
|
+
ref,
|
|
1285
|
+
className: cn(
|
|
1286
|
+
"text-sm font-medium text-foreground leading-none",
|
|
1287
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1288
|
+
"transition-all duration-200 hover:translate-x-0.5",
|
|
1289
|
+
className
|
|
1290
|
+
),
|
|
1291
|
+
...props,
|
|
1292
|
+
children: [
|
|
1293
|
+
children,
|
|
1294
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-error ml-1", children: "*" })
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
)
|
|
1298
|
+
);
|
|
1299
|
+
Label2.displayName = "Label";
|
|
1300
|
+
var FormField = ({
|
|
1301
|
+
label,
|
|
1302
|
+
htmlFor,
|
|
1303
|
+
required,
|
|
1304
|
+
error,
|
|
1305
|
+
hint,
|
|
1306
|
+
children,
|
|
1307
|
+
className
|
|
1308
|
+
}) => {
|
|
1309
|
+
return /* @__PURE__ */ jsxs(
|
|
1310
|
+
motion.div,
|
|
1311
|
+
{
|
|
1312
|
+
className: cn("space-y-2", className),
|
|
1313
|
+
initial: { opacity: 0, y: 20 },
|
|
1314
|
+
animate: { opacity: 1, y: 0 },
|
|
1315
|
+
transition: { duration: 0.3 },
|
|
1316
|
+
children: [
|
|
1317
|
+
/* @__PURE__ */ jsx(Label2, { htmlFor, required, children: label }),
|
|
1318
|
+
children,
|
|
1319
|
+
error && /* @__PURE__ */ jsx(
|
|
1320
|
+
motion.p,
|
|
1321
|
+
{
|
|
1322
|
+
initial: { opacity: 0, y: -10 },
|
|
1323
|
+
animate: { opacity: 1, y: 0 },
|
|
1324
|
+
className: "text-xs text-error",
|
|
1325
|
+
children: error
|
|
1326
|
+
}
|
|
1327
|
+
),
|
|
1328
|
+
hint && !error && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint })
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1332
|
+
};
|
|
1333
|
+
FormField.displayName = "FormField";
|
|
1334
|
+
var Textarea = React7.forwardRef(
|
|
1335
|
+
({ className, variant, state, error, hint, ...props }, ref) => {
|
|
1336
|
+
const [isFocused, setIsFocused] = React7.useState(false);
|
|
1337
|
+
const hasError = !!error || state === "error";
|
|
1338
|
+
const currentState = hasError ? "error" : state;
|
|
1339
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
1340
|
+
/* @__PURE__ */ jsx(
|
|
1341
|
+
"textarea",
|
|
1342
|
+
{
|
|
1343
|
+
className: cn(
|
|
1344
|
+
inputVariants({ variant, state: currentState }),
|
|
1345
|
+
"min-h-[80px] resize-y transition-transform duration-200",
|
|
1346
|
+
isFocused && "scale-[1.01]",
|
|
1347
|
+
className
|
|
1348
|
+
),
|
|
1349
|
+
ref,
|
|
1350
|
+
onFocus: () => setIsFocused(true),
|
|
1351
|
+
onBlur: () => setIsFocused(false),
|
|
1352
|
+
"aria-invalid": hasError,
|
|
1353
|
+
...props
|
|
1354
|
+
}
|
|
1355
|
+
),
|
|
1356
|
+
error && /* @__PURE__ */ jsx(
|
|
1357
|
+
motion.p,
|
|
1358
|
+
{
|
|
1359
|
+
initial: { opacity: 0, y: -10 },
|
|
1360
|
+
animate: { opacity: 1, y: 0 },
|
|
1361
|
+
className: "mt-1.5 text-xs text-error",
|
|
1362
|
+
children: error
|
|
1363
|
+
}
|
|
1364
|
+
),
|
|
1365
|
+
hint && !error && /* @__PURE__ */ jsx("p", { className: "mt-1.5 text-xs text-muted-foreground", children: hint })
|
|
1366
|
+
] });
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
Textarea.displayName = "Textarea";
|
|
1370
|
+
var Pagination = React7.forwardRef(
|
|
1371
|
+
({
|
|
1372
|
+
className,
|
|
1373
|
+
currentPage,
|
|
1374
|
+
totalPages,
|
|
1375
|
+
onPageChange,
|
|
1376
|
+
siblingCount = 1,
|
|
1377
|
+
...props
|
|
1378
|
+
}, ref) => {
|
|
1379
|
+
const range = (start, end) => {
|
|
1380
|
+
const length = end - start + 1;
|
|
1381
|
+
return Array.from({ length }, (_, idx) => start + idx);
|
|
1382
|
+
};
|
|
1383
|
+
const paginationRange = React7.useMemo(() => {
|
|
1384
|
+
const totalPageNumbers = siblingCount + 5;
|
|
1385
|
+
if (totalPageNumbers >= totalPages) {
|
|
1386
|
+
return range(1, totalPages);
|
|
1387
|
+
}
|
|
1388
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
1389
|
+
const rightSiblingIndex = Math.min(
|
|
1390
|
+
currentPage + siblingCount,
|
|
1391
|
+
totalPages
|
|
1392
|
+
);
|
|
1393
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
1394
|
+
const shouldShowRightDots = rightSiblingIndex < totalPages - 2;
|
|
1395
|
+
const firstPageIndex = 1;
|
|
1396
|
+
const lastPageIndex = totalPages;
|
|
1397
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
1398
|
+
const leftItemCount = 3 + 2 * siblingCount;
|
|
1399
|
+
const leftRange = range(1, leftItemCount);
|
|
1400
|
+
return [...leftRange, "dots", totalPages];
|
|
1401
|
+
}
|
|
1402
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
1403
|
+
const rightItemCount = 3 + 2 * siblingCount;
|
|
1404
|
+
const rightRange = range(totalPages - rightItemCount + 1, totalPages);
|
|
1405
|
+
return [firstPageIndex, "dots", ...rightRange];
|
|
1406
|
+
}
|
|
1407
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
1408
|
+
const middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
1409
|
+
return [firstPageIndex, "dots", ...middleRange, "dots", lastPageIndex];
|
|
1410
|
+
}
|
|
1411
|
+
return [];
|
|
1412
|
+
}, [totalPages, siblingCount, currentPage]);
|
|
1413
|
+
return /* @__PURE__ */ jsx(
|
|
1414
|
+
"nav",
|
|
1415
|
+
{
|
|
1416
|
+
ref,
|
|
1417
|
+
role: "navigation",
|
|
1418
|
+
"aria-label": "pagination",
|
|
1419
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
1420
|
+
...props,
|
|
1421
|
+
children: /* @__PURE__ */ jsxs("ul", { className: "flex flex-row items-center gap-1", children: [
|
|
1422
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
1423
|
+
Button,
|
|
1424
|
+
{
|
|
1425
|
+
variant: "ghost-primary",
|
|
1426
|
+
size: "icon",
|
|
1427
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
1428
|
+
disabled: currentPage === 1,
|
|
1429
|
+
"aria-label": "Go to previous page",
|
|
1430
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
1431
|
+
}
|
|
1432
|
+
) }),
|
|
1433
|
+
paginationRange.map((pageNumber, index) => {
|
|
1434
|
+
if (pageNumber === "dots") {
|
|
1435
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("span", { className: "flex h-9 w-9 items-center justify-center", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }, `dots-${index}`);
|
|
1436
|
+
}
|
|
1437
|
+
const isActive = pageNumber === currentPage;
|
|
1438
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
1439
|
+
motion.button,
|
|
1440
|
+
{
|
|
1441
|
+
whileHover: { scale: 1.05 },
|
|
1442
|
+
whileTap: { scale: 0.95 },
|
|
1443
|
+
onClick: () => onPageChange(pageNumber),
|
|
1444
|
+
className: cn(
|
|
1445
|
+
"flex h-9 w-9 items-center justify-center rounded-lg text-sm font-medium transition-all",
|
|
1446
|
+
isActive ? "glass-card border border-primary bg-primary/10 text-primary shadow-primary-glow" : "glass hover:bg-muted text-foreground"
|
|
1447
|
+
),
|
|
1448
|
+
"aria-label": `Go to page ${pageNumber}`,
|
|
1449
|
+
"aria-current": isActive ? "page" : void 0,
|
|
1450
|
+
children: pageNumber
|
|
1451
|
+
}
|
|
1452
|
+
) }, pageNumber);
|
|
1453
|
+
}),
|
|
1454
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
1455
|
+
Button,
|
|
1456
|
+
{
|
|
1457
|
+
variant: "ghost-primary",
|
|
1458
|
+
size: "icon",
|
|
1459
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
1460
|
+
disabled: currentPage === totalPages,
|
|
1461
|
+
"aria-label": "Go to next page",
|
|
1462
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
1463
|
+
}
|
|
1464
|
+
) })
|
|
1465
|
+
] })
|
|
1466
|
+
}
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
);
|
|
1470
|
+
Pagination.displayName = "Pagination";
|
|
1471
|
+
var Popover = PopoverPrimitive.Root;
|
|
1472
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1473
|
+
var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1474
|
+
PopoverPrimitive.Content,
|
|
1475
|
+
{
|
|
1476
|
+
ref,
|
|
1477
|
+
align,
|
|
1478
|
+
sideOffset,
|
|
1479
|
+
className: cn(
|
|
1480
|
+
"z-50 w-72 rounded-xl glass-strong border border-border p-4 shadow-lg outline-none",
|
|
1481
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1482
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1483
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1484
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
1485
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
1486
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
1487
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
1488
|
+
className
|
|
1489
|
+
),
|
|
1490
|
+
...props
|
|
1491
|
+
}
|
|
1492
|
+
) }));
|
|
1493
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1494
|
+
var Progress = React7.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1495
|
+
ProgressPrimitive.Root,
|
|
1496
|
+
{
|
|
1497
|
+
ref,
|
|
1498
|
+
className: cn(
|
|
1499
|
+
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
1500
|
+
className
|
|
1501
|
+
),
|
|
1502
|
+
...props,
|
|
1503
|
+
children: /* @__PURE__ */ jsx(
|
|
1504
|
+
ProgressPrimitive.Indicator,
|
|
1505
|
+
{
|
|
1506
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
1507
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
1508
|
+
}
|
|
1509
|
+
)
|
|
1510
|
+
}
|
|
1511
|
+
));
|
|
1512
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
1513
|
+
var RadioGroup2 = React7.forwardRef(({ className, ...props }, ref) => {
|
|
1514
|
+
return /* @__PURE__ */ jsx(
|
|
1515
|
+
RadioGroupPrimitive.Root,
|
|
1516
|
+
{
|
|
1517
|
+
className: cn("grid gap-2", className),
|
|
1518
|
+
...props,
|
|
1519
|
+
ref
|
|
1520
|
+
}
|
|
1521
|
+
);
|
|
1522
|
+
});
|
|
1523
|
+
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
1524
|
+
var RadioGroupItem = React7.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
1525
|
+
const [isChecked, setIsChecked] = React7.useState(false);
|
|
1526
|
+
const [showExplosion, setShowExplosion] = React7.useState(false);
|
|
1527
|
+
const handleClick = (e) => {
|
|
1528
|
+
setIsChecked(true);
|
|
1529
|
+
setShowExplosion(true);
|
|
1530
|
+
setTimeout(() => setShowExplosion(false), 800);
|
|
1531
|
+
onClick?.(e);
|
|
1532
|
+
};
|
|
1533
|
+
return /* @__PURE__ */ jsxs(
|
|
1534
|
+
RadioGroupPrimitive.Item,
|
|
1535
|
+
{
|
|
1536
|
+
ref,
|
|
1537
|
+
className: cn(
|
|
1538
|
+
"aspect-square h-5 w-5 rounded-full glass-card border-2 border-border text-primary ring-offset-background relative",
|
|
1539
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1540
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1541
|
+
"transition-all duration-300",
|
|
1542
|
+
"data-[state=checked]:border-primary data-[state=checked]:bg-primary/10",
|
|
1543
|
+
// Subtle glow
|
|
1544
|
+
"data-[state=checked]:shadow-[0_0_15px_rgba(80,0,171,0.3)]",
|
|
1545
|
+
"hover:scale-110 hover:shadow-[0_0_10px_rgba(80,0,171,0.2)]",
|
|
1546
|
+
className
|
|
1547
|
+
),
|
|
1548
|
+
onClick: handleClick,
|
|
1549
|
+
...props,
|
|
1550
|
+
children: [
|
|
1551
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: showExplosion && /* @__PURE__ */ jsx(Fragment, { children: [...Array(12)].map((_, i) => {
|
|
1552
|
+
const baseAngle = i * 360 / 12;
|
|
1553
|
+
const angleVariation = (Math.random() - 0.5) * 30;
|
|
1554
|
+
const angle = baseAngle + angleVariation;
|
|
1555
|
+
const baseDistance = 25;
|
|
1556
|
+
const distanceVariation = Math.random() * 15 - 5;
|
|
1557
|
+
const distance = baseDistance + distanceVariation;
|
|
1558
|
+
const size = 1 + Math.random() * 1.5;
|
|
1559
|
+
return /* @__PURE__ */ jsx(
|
|
1560
|
+
motion.div,
|
|
1561
|
+
{
|
|
1562
|
+
className: "absolute inset-0 pointer-events-none",
|
|
1563
|
+
initial: {
|
|
1564
|
+
scale: 0,
|
|
1565
|
+
opacity: 1,
|
|
1566
|
+
x: 0,
|
|
1567
|
+
y: 0
|
|
1568
|
+
},
|
|
1569
|
+
animate: {
|
|
1570
|
+
scale: 0,
|
|
1571
|
+
opacity: 0,
|
|
1572
|
+
x: Math.cos(angle * Math.PI / 180) * distance,
|
|
1573
|
+
y: Math.sin(angle * Math.PI / 180) * distance
|
|
1574
|
+
},
|
|
1575
|
+
exit: { opacity: 0 },
|
|
1576
|
+
transition: {
|
|
1577
|
+
duration: 0.6 + Math.random() * 0.2,
|
|
1578
|
+
ease: [0.16, 1, 0.3, 1]
|
|
1579
|
+
},
|
|
1580
|
+
children: /* @__PURE__ */ jsx(
|
|
1581
|
+
"div",
|
|
1582
|
+
{
|
|
1583
|
+
className: "absolute top-1/2 left-1/2 rounded-full bg-primary shadow-[0_0_4px_rgba(80,0,171,0.5)]",
|
|
1584
|
+
style: {
|
|
1585
|
+
width: `${size}px`,
|
|
1586
|
+
height: `${size}px`,
|
|
1587
|
+
transform: "translate(-50%, -50%)"
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
)
|
|
1591
|
+
},
|
|
1592
|
+
i
|
|
1593
|
+
);
|
|
1594
|
+
}) }) }),
|
|
1595
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: isChecked && /* @__PURE__ */ jsx(
|
|
1596
|
+
motion.div,
|
|
1597
|
+
{
|
|
1598
|
+
className: "absolute inset-0 rounded-full bg-primary/20 shadow-[0_0_15px_rgba(80,0,171,0.3)]",
|
|
1599
|
+
initial: { scale: 0, opacity: 0.6 },
|
|
1600
|
+
animate: { scale: 2.5, opacity: 0 },
|
|
1601
|
+
exit: { opacity: 0 },
|
|
1602
|
+
transition: { duration: 0.6, ease: "easeOut" }
|
|
1603
|
+
}
|
|
1604
|
+
) }),
|
|
1605
|
+
/* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
1606
|
+
motion.div,
|
|
1607
|
+
{
|
|
1608
|
+
initial: { scale: 0 },
|
|
1609
|
+
animate: { scale: 1 },
|
|
1610
|
+
transition: { type: "spring", stiffness: 500, damping: 15 },
|
|
1611
|
+
children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-primary text-primary drop-shadow-[0_0_4px_rgba(80,0,171,0.5)]" })
|
|
1612
|
+
}
|
|
1613
|
+
) })
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
});
|
|
1618
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
1619
|
+
var Select = SelectPrimitive.Root;
|
|
1620
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
1621
|
+
var SelectValue = SelectPrimitive.Value;
|
|
1622
|
+
var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1623
|
+
SelectPrimitive.Trigger,
|
|
1624
|
+
{
|
|
1625
|
+
ref,
|
|
1626
|
+
className: cn(
|
|
1627
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-border bg-background px-3 py-2 text-sm",
|
|
1628
|
+
"placeholder:text-muted-foreground",
|
|
1629
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",
|
|
1630
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1631
|
+
"[&>span]:line-clamp-1",
|
|
1632
|
+
className
|
|
1633
|
+
),
|
|
1634
|
+
...props,
|
|
1635
|
+
children: [
|
|
1636
|
+
children,
|
|
1637
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
1638
|
+
]
|
|
1639
|
+
}
|
|
1640
|
+
));
|
|
1641
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1642
|
+
var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1643
|
+
SelectPrimitive.ScrollUpButton,
|
|
1644
|
+
{
|
|
1645
|
+
ref,
|
|
1646
|
+
className: cn(
|
|
1647
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1648
|
+
className
|
|
1649
|
+
),
|
|
1650
|
+
...props,
|
|
1651
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
1652
|
+
}
|
|
1653
|
+
));
|
|
1654
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1655
|
+
var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1656
|
+
SelectPrimitive.ScrollDownButton,
|
|
1657
|
+
{
|
|
1658
|
+
ref,
|
|
1659
|
+
className: cn(
|
|
1660
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1661
|
+
className
|
|
1662
|
+
),
|
|
1663
|
+
...props,
|
|
1664
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
1665
|
+
}
|
|
1666
|
+
));
|
|
1667
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1668
|
+
var SelectContent = React7.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
1669
|
+
SelectPrimitive.Content,
|
|
1670
|
+
{
|
|
1671
|
+
ref,
|
|
1672
|
+
className: cn(
|
|
1673
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md",
|
|
1674
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1675
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1676
|
+
className
|
|
1677
|
+
),
|
|
1678
|
+
position,
|
|
1679
|
+
...props,
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
1682
|
+
/* @__PURE__ */ jsx(
|
|
1683
|
+
SelectPrimitive.Viewport,
|
|
1684
|
+
{
|
|
1685
|
+
className: cn(
|
|
1686
|
+
"p-1",
|
|
1687
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
1688
|
+
),
|
|
1689
|
+
children
|
|
1690
|
+
}
|
|
1691
|
+
),
|
|
1692
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
1693
|
+
]
|
|
1694
|
+
}
|
|
1695
|
+
) }));
|
|
1696
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1697
|
+
var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1698
|
+
SelectPrimitive.Label,
|
|
1699
|
+
{
|
|
1700
|
+
ref,
|
|
1701
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
1702
|
+
...props
|
|
1703
|
+
}
|
|
1704
|
+
));
|
|
1705
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1706
|
+
var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1707
|
+
SelectPrimitive.Item,
|
|
1708
|
+
{
|
|
1709
|
+
ref,
|
|
1710
|
+
className: cn(
|
|
1711
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
1712
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
1713
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1714
|
+
className
|
|
1715
|
+
),
|
|
1716
|
+
...props,
|
|
1717
|
+
children: [
|
|
1718
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
1719
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
1720
|
+
]
|
|
1721
|
+
}
|
|
1722
|
+
));
|
|
1723
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1724
|
+
var SelectSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1725
|
+
SelectPrimitive.Separator,
|
|
1726
|
+
{
|
|
1727
|
+
ref,
|
|
1728
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1729
|
+
...props
|
|
1730
|
+
}
|
|
1731
|
+
));
|
|
1732
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1733
|
+
var Separator3 = React7.forwardRef(
|
|
1734
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1735
|
+
SeparatorPrimitive.Root,
|
|
1736
|
+
{
|
|
1737
|
+
ref,
|
|
1738
|
+
decorative,
|
|
1739
|
+
orientation,
|
|
1740
|
+
className: cn(
|
|
1741
|
+
"shrink-0 bg-border",
|
|
1742
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1743
|
+
className
|
|
1744
|
+
),
|
|
1745
|
+
...props
|
|
1746
|
+
}
|
|
1747
|
+
)
|
|
1748
|
+
);
|
|
1749
|
+
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
1750
|
+
var Skeleton = React7.forwardRef(
|
|
1751
|
+
({ className, variant = "rectangular", animation = "pulse", ...props }, ref) => {
|
|
1752
|
+
const baseClasses = "glass-card bg-muted/50";
|
|
1753
|
+
const variantClasses = {
|
|
1754
|
+
text: "h-4 w-full rounded",
|
|
1755
|
+
circular: "rounded-full",
|
|
1756
|
+
rectangular: "rounded-xl"
|
|
1757
|
+
};
|
|
1758
|
+
const animationClasses = {
|
|
1759
|
+
pulse: "animate-pulse",
|
|
1760
|
+
wave: "animate-shimmer bg-gradient-to-r from-muted/50 via-muted/80 to-muted/50 bg-[length:200%_100%]",
|
|
1761
|
+
none: ""
|
|
1762
|
+
};
|
|
1763
|
+
return /* @__PURE__ */ jsx(
|
|
1764
|
+
"div",
|
|
1765
|
+
{
|
|
1766
|
+
ref,
|
|
1767
|
+
className: cn(
|
|
1768
|
+
baseClasses,
|
|
1769
|
+
variantClasses[variant],
|
|
1770
|
+
animationClasses[animation],
|
|
1771
|
+
className
|
|
1772
|
+
),
|
|
1773
|
+
...props
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
);
|
|
1778
|
+
Skeleton.displayName = "Skeleton";
|
|
1779
|
+
var SkeletonText = ({
|
|
1780
|
+
lines = 3,
|
|
1781
|
+
className
|
|
1782
|
+
}) => /* @__PURE__ */ jsx("div", { className: cn("space-y-2", className), children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ jsx(
|
|
1783
|
+
Skeleton,
|
|
1784
|
+
{
|
|
1785
|
+
variant: "text",
|
|
1786
|
+
className: i === lines - 1 ? "w-3/4" : "w-full"
|
|
1787
|
+
},
|
|
1788
|
+
i
|
|
1789
|
+
)) });
|
|
1790
|
+
var SkeletonCard = ({ className }) => /* @__PURE__ */ jsxs("div", { className: cn("glass-card rounded-xl p-4 space-y-3", className), children: [
|
|
1791
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full" }),
|
|
1792
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", className: "w-3/4" }),
|
|
1793
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", className: "w-1/2" })
|
|
1794
|
+
] });
|
|
1795
|
+
var SkeletonAvatar = ({ size = "md", className }) => {
|
|
1796
|
+
const sizeClasses = {
|
|
1797
|
+
sm: "h-8 w-8",
|
|
1798
|
+
md: "h-10 w-10",
|
|
1799
|
+
lg: "h-12 w-12"
|
|
1800
|
+
};
|
|
1801
|
+
return /* @__PURE__ */ jsx(Skeleton, { variant: "circular", className: cn(sizeClasses[size], className) });
|
|
1802
|
+
};
|
|
1803
|
+
var SkeletonTable = ({ rows = 5, columns = 4, className }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
|
|
1804
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-4", children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-8 flex-1" }, `header-${i}`)) }),
|
|
1805
|
+
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsx(
|
|
1806
|
+
Skeleton,
|
|
1807
|
+
{
|
|
1808
|
+
className: "h-12 flex-1"
|
|
1809
|
+
},
|
|
1810
|
+
`cell-${rowIndex}-${colIndex}`
|
|
1811
|
+
)) }, `row-${rowIndex}`))
|
|
1812
|
+
] });
|
|
1813
|
+
var Switch = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1814
|
+
SwitchPrimitives.Root,
|
|
1815
|
+
{
|
|
1816
|
+
className: cn(
|
|
1817
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-border/50",
|
|
1818
|
+
"glass-card transition-all duration-300",
|
|
1819
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1820
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1821
|
+
"data-[state=checked]:bg-primary data-[state=checked]:border-primary",
|
|
1822
|
+
"data-[state=unchecked]:bg-muted",
|
|
1823
|
+
className
|
|
1824
|
+
),
|
|
1825
|
+
...props,
|
|
1826
|
+
ref,
|
|
1827
|
+
children: /* @__PURE__ */ jsx(
|
|
1828
|
+
SwitchPrimitives.Thumb,
|
|
1829
|
+
{
|
|
1830
|
+
className: cn(
|
|
1831
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0",
|
|
1832
|
+
"transition-transform duration-300 ease-out",
|
|
1833
|
+
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
1834
|
+
)
|
|
1835
|
+
}
|
|
1836
|
+
)
|
|
1837
|
+
}
|
|
1838
|
+
));
|
|
1839
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
1840
|
+
var Table = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
1841
|
+
"table",
|
|
1842
|
+
{
|
|
1843
|
+
ref,
|
|
1844
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
1845
|
+
...props
|
|
1846
|
+
}
|
|
1847
|
+
) }));
|
|
1848
|
+
Table.displayName = "Table";
|
|
1849
|
+
var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1850
|
+
TableHeader.displayName = "TableHeader";
|
|
1851
|
+
var TableBody = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1852
|
+
"tbody",
|
|
1853
|
+
{
|
|
1854
|
+
ref,
|
|
1855
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
1856
|
+
...props
|
|
1857
|
+
}
|
|
1858
|
+
));
|
|
1859
|
+
TableBody.displayName = "TableBody";
|
|
1860
|
+
var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1861
|
+
"tfoot",
|
|
1862
|
+
{
|
|
1863
|
+
ref,
|
|
1864
|
+
className: cn(
|
|
1865
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
1866
|
+
className
|
|
1867
|
+
),
|
|
1868
|
+
...props
|
|
1869
|
+
}
|
|
1870
|
+
));
|
|
1871
|
+
TableFooter.displayName = "TableFooter";
|
|
1872
|
+
var TableRow = React7.forwardRef(({ className, hover = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1873
|
+
"tr",
|
|
1874
|
+
{
|
|
1875
|
+
ref,
|
|
1876
|
+
className: cn(
|
|
1877
|
+
"border-b border-border transition-colors",
|
|
1878
|
+
hover && "hover:bg-muted/50 cursor-pointer",
|
|
1879
|
+
"data-[state=selected]:bg-muted",
|
|
1880
|
+
className
|
|
1881
|
+
),
|
|
1882
|
+
...props
|
|
1883
|
+
}
|
|
1884
|
+
));
|
|
1885
|
+
TableRow.displayName = "TableRow";
|
|
1886
|
+
var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1887
|
+
"th",
|
|
1888
|
+
{
|
|
1889
|
+
ref,
|
|
1890
|
+
className: cn(
|
|
1891
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
1892
|
+
className
|
|
1893
|
+
),
|
|
1894
|
+
...props
|
|
1895
|
+
}
|
|
1896
|
+
));
|
|
1897
|
+
TableHead.displayName = "TableHead";
|
|
1898
|
+
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1899
|
+
"td",
|
|
1900
|
+
{
|
|
1901
|
+
ref,
|
|
1902
|
+
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
1903
|
+
...props
|
|
1904
|
+
}
|
|
1905
|
+
));
|
|
1906
|
+
TableCell.displayName = "TableCell";
|
|
1907
|
+
var TableCaption = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1908
|
+
"caption",
|
|
1909
|
+
{
|
|
1910
|
+
ref,
|
|
1911
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
1912
|
+
...props
|
|
1913
|
+
}
|
|
1914
|
+
));
|
|
1915
|
+
TableCaption.displayName = "TableCaption";
|
|
1916
|
+
var Tabs = TabsPrimitive.Root;
|
|
1917
|
+
var TabsList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1918
|
+
TabsPrimitive.List,
|
|
1919
|
+
{
|
|
1920
|
+
ref,
|
|
1921
|
+
className: cn(
|
|
1922
|
+
"glass-card inline-flex h-10 items-center justify-center rounded-xl p-1 text-muted-foreground",
|
|
1923
|
+
className
|
|
1924
|
+
),
|
|
1925
|
+
...props
|
|
1926
|
+
}
|
|
1927
|
+
));
|
|
1928
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
1929
|
+
var TabsTrigger = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1930
|
+
TabsPrimitive.Trigger,
|
|
1931
|
+
{
|
|
1932
|
+
ref,
|
|
1933
|
+
className: cn(
|
|
1934
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-lg px-3 py-1.5 text-sm font-medium ring-offset-background transition-all",
|
|
1935
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1936
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1937
|
+
"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1938
|
+
"hover:bg-muted/50",
|
|
1939
|
+
className
|
|
1940
|
+
),
|
|
1941
|
+
...props,
|
|
1942
|
+
children: /* @__PURE__ */ jsx(
|
|
1943
|
+
motion.span,
|
|
1944
|
+
{
|
|
1945
|
+
initial: { scale: 1 },
|
|
1946
|
+
whileHover: { scale: 1.05 },
|
|
1947
|
+
whileTap: { scale: 0.95 },
|
|
1948
|
+
transition: { type: "spring", stiffness: 400, damping: 17 },
|
|
1949
|
+
children
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
1952
|
+
}
|
|
1953
|
+
));
|
|
1954
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
1955
|
+
var TabsContent = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1956
|
+
TabsPrimitive.Content,
|
|
1957
|
+
{
|
|
1958
|
+
ref,
|
|
1959
|
+
className: cn(
|
|
1960
|
+
"mt-2 ring-offset-background",
|
|
1961
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1962
|
+
className
|
|
1963
|
+
),
|
|
1964
|
+
...props,
|
|
1965
|
+
children: /* @__PURE__ */ jsx(
|
|
1966
|
+
motion.div,
|
|
1967
|
+
{
|
|
1968
|
+
initial: { opacity: 0, y: 10 },
|
|
1969
|
+
animate: { opacity: 1, y: 0 },
|
|
1970
|
+
transition: { duration: 0.2 },
|
|
1971
|
+
children
|
|
1972
|
+
}
|
|
1973
|
+
)
|
|
1974
|
+
}
|
|
1975
|
+
));
|
|
1976
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
1977
|
+
var ToastProvider = ToastPrimitives.Provider;
|
|
1978
|
+
var ToastViewport = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1979
|
+
ToastPrimitives.Viewport,
|
|
1980
|
+
{
|
|
1981
|
+
ref,
|
|
1982
|
+
className: cn(
|
|
1983
|
+
"fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
1984
|
+
className
|
|
1985
|
+
),
|
|
1986
|
+
...props
|
|
1987
|
+
}
|
|
1988
|
+
));
|
|
1989
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
1990
|
+
var toastVariants = cva(
|
|
1991
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
1992
|
+
{
|
|
1993
|
+
variants: {
|
|
1994
|
+
variant: {
|
|
1995
|
+
default: "border bg-background text-foreground",
|
|
1996
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
1997
|
+
}
|
|
1998
|
+
},
|
|
1999
|
+
defaultVariants: {
|
|
2000
|
+
variant: "default"
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
);
|
|
2004
|
+
var Toast = React7.forwardRef(({ className, variant, ...props }, ref) => {
|
|
2005
|
+
return /* @__PURE__ */ jsx(
|
|
2006
|
+
ToastPrimitives.Root,
|
|
2007
|
+
{
|
|
2008
|
+
ref,
|
|
2009
|
+
className: cn(toastVariants({ variant }), className),
|
|
2010
|
+
...props
|
|
2011
|
+
}
|
|
2012
|
+
);
|
|
2013
|
+
});
|
|
2014
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
2015
|
+
var ToastAction = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2016
|
+
ToastPrimitives.Action,
|
|
2017
|
+
{
|
|
2018
|
+
ref,
|
|
2019
|
+
className: cn(
|
|
2020
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
2021
|
+
className
|
|
2022
|
+
),
|
|
2023
|
+
...props
|
|
2024
|
+
}
|
|
2025
|
+
));
|
|
2026
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
2027
|
+
var ToastClose = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2028
|
+
ToastPrimitives.Close,
|
|
2029
|
+
{
|
|
2030
|
+
ref,
|
|
2031
|
+
className: cn(
|
|
2032
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
2033
|
+
className
|
|
2034
|
+
),
|
|
2035
|
+
"toast-close": "",
|
|
2036
|
+
...props,
|
|
2037
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
2038
|
+
}
|
|
2039
|
+
));
|
|
2040
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
2041
|
+
var ToastTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2042
|
+
ToastPrimitives.Title,
|
|
2043
|
+
{
|
|
2044
|
+
ref,
|
|
2045
|
+
className: cn("text-sm font-semibold", className),
|
|
2046
|
+
...props
|
|
2047
|
+
}
|
|
2048
|
+
));
|
|
2049
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
2050
|
+
var ToastDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2051
|
+
ToastPrimitives.Description,
|
|
2052
|
+
{
|
|
2053
|
+
ref,
|
|
2054
|
+
className: cn("text-sm opacity-90", className),
|
|
2055
|
+
...props
|
|
2056
|
+
}
|
|
2057
|
+
));
|
|
2058
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
2059
|
+
var TOAST_LIMIT = 1;
|
|
2060
|
+
var TOAST_REMOVE_DELAY = 1e6;
|
|
2061
|
+
var count = 0;
|
|
2062
|
+
function genId() {
|
|
2063
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
2064
|
+
return count.toString();
|
|
2065
|
+
}
|
|
2066
|
+
var toastTimeouts = /* @__PURE__ */ new Map();
|
|
2067
|
+
var addToRemoveQueue = (toastId) => {
|
|
2068
|
+
if (toastTimeouts.has(toastId)) {
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
const timeout = setTimeout(() => {
|
|
2072
|
+
toastTimeouts.delete(toastId);
|
|
2073
|
+
dispatch({
|
|
2074
|
+
type: "REMOVE_TOAST",
|
|
2075
|
+
toastId
|
|
2076
|
+
});
|
|
2077
|
+
}, TOAST_REMOVE_DELAY);
|
|
2078
|
+
toastTimeouts.set(toastId, timeout);
|
|
2079
|
+
};
|
|
2080
|
+
var reducer = (state, action) => {
|
|
2081
|
+
switch (action.type) {
|
|
2082
|
+
case "ADD_TOAST":
|
|
2083
|
+
return {
|
|
2084
|
+
...state,
|
|
2085
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
|
2086
|
+
};
|
|
2087
|
+
case "UPDATE_TOAST":
|
|
2088
|
+
return {
|
|
2089
|
+
...state,
|
|
2090
|
+
toasts: state.toasts.map(
|
|
2091
|
+
(t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
|
|
2092
|
+
)
|
|
2093
|
+
};
|
|
2094
|
+
case "DISMISS_TOAST": {
|
|
2095
|
+
const { toastId } = action;
|
|
2096
|
+
if (toastId) {
|
|
2097
|
+
addToRemoveQueue(toastId);
|
|
2098
|
+
} else {
|
|
2099
|
+
state.toasts.forEach((toast2) => {
|
|
2100
|
+
addToRemoveQueue(toast2.id);
|
|
2101
|
+
});
|
|
2102
|
+
}
|
|
2103
|
+
return {
|
|
2104
|
+
...state,
|
|
2105
|
+
toasts: state.toasts.map(
|
|
2106
|
+
(t) => t.id === toastId || toastId === void 0 ? {
|
|
2107
|
+
...t,
|
|
2108
|
+
open: false
|
|
2109
|
+
} : t
|
|
2110
|
+
)
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
case "REMOVE_TOAST":
|
|
2114
|
+
if (action.toastId === void 0) {
|
|
2115
|
+
return {
|
|
2116
|
+
...state,
|
|
2117
|
+
toasts: []
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
return {
|
|
2121
|
+
...state,
|
|
2122
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
};
|
|
2126
|
+
var listeners = [];
|
|
2127
|
+
var memoryState = { toasts: [] };
|
|
2128
|
+
function dispatch(action) {
|
|
2129
|
+
memoryState = reducer(memoryState, action);
|
|
2130
|
+
listeners.forEach((listener) => {
|
|
2131
|
+
listener(memoryState);
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function toast({ ...props }) {
|
|
2135
|
+
const id = genId();
|
|
2136
|
+
const update = (props2) => dispatch({
|
|
2137
|
+
type: "UPDATE_TOAST",
|
|
2138
|
+
toast: { ...props2, id }
|
|
2139
|
+
});
|
|
2140
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
2141
|
+
dispatch({
|
|
2142
|
+
type: "ADD_TOAST",
|
|
2143
|
+
toast: {
|
|
2144
|
+
...props,
|
|
2145
|
+
id,
|
|
2146
|
+
open: true,
|
|
2147
|
+
onOpenChange: (open) => {
|
|
2148
|
+
if (!open) dismiss();
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2152
|
+
return {
|
|
2153
|
+
id,
|
|
2154
|
+
dismiss,
|
|
2155
|
+
update
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
function useToast() {
|
|
2159
|
+
const [state, setState] = React7.useState(memoryState);
|
|
2160
|
+
React7.useEffect(() => {
|
|
2161
|
+
listeners.push(setState);
|
|
2162
|
+
return () => {
|
|
2163
|
+
const index = listeners.indexOf(setState);
|
|
2164
|
+
if (index > -1) {
|
|
2165
|
+
listeners.splice(index, 1);
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
}, [state]);
|
|
2169
|
+
return {
|
|
2170
|
+
...state,
|
|
2171
|
+
toast,
|
|
2172
|
+
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
function Toaster() {
|
|
2176
|
+
const { toasts } = useToast();
|
|
2177
|
+
return /* @__PURE__ */ jsxs(ToastProvider, { children: [
|
|
2178
|
+
toasts.map(function({ id, title, description, action, ...props }) {
|
|
2179
|
+
return /* @__PURE__ */ jsxs(Toast, { ...props, children: [
|
|
2180
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
|
|
2181
|
+
title && /* @__PURE__ */ jsx(ToastTitle, { children: title }),
|
|
2182
|
+
description && /* @__PURE__ */ jsx(ToastDescription, { children: description })
|
|
2183
|
+
] }),
|
|
2184
|
+
action,
|
|
2185
|
+
/* @__PURE__ */ jsx(ToastClose, {})
|
|
2186
|
+
] }, id);
|
|
2187
|
+
}),
|
|
2188
|
+
/* @__PURE__ */ jsx(ToastViewport, {})
|
|
2189
|
+
] });
|
|
2190
|
+
}
|
|
2191
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2192
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
2193
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2194
|
+
var TooltipContent = React7.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2195
|
+
TooltipPrimitive.Content,
|
|
2196
|
+
{
|
|
2197
|
+
ref,
|
|
2198
|
+
sideOffset,
|
|
2199
|
+
className: cn(
|
|
2200
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2201
|
+
className
|
|
2202
|
+
),
|
|
2203
|
+
...props
|
|
2204
|
+
}
|
|
2205
|
+
));
|
|
2206
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2207
|
+
|
|
2208
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormField, IconButton, Input, Label2 as Label, Pagination, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonTable, SkeletonText, StatCard, StatusBadge, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, debounce, formatCurrency, formatDate, formatRelativeTime, generateId, getInitials, inputVariants, reducer, sleep, toast, truncate, useToast };
|
|
2209
|
+
//# sourceMappingURL=index.mjs.map
|
|
2210
|
+
//# sourceMappingURL=index.mjs.map
|