@akira-io/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 +151 -0
- package/dist/blocks.d.ts +186 -0
- package/dist/blocks.js +921 -0
- package/dist/blocks.js.map +1 -0
- package/dist/chunk-42BJBH56.js +786 -0
- package/dist/chunk-42BJBH56.js.map +1 -0
- package/dist/chunk-5MQWJVM2.js +1291 -0
- package/dist/chunk-5MQWJVM2.js.map +1 -0
- package/dist/chunk-A2SIZOEA.js +413 -0
- package/dist/chunk-A2SIZOEA.js.map +1 -0
- package/dist/chunk-POE7OYET.js +96 -0
- package/dist/chunk-POE7OYET.js.map +1 -0
- package/dist/chunk-UXL33CZ4.js +170 -0
- package/dist/chunk-UXL33CZ4.js.map +1 -0
- package/dist/date-range-filter-QEa8fhUM.d.ts +149 -0
- package/dist/index.d.ts +474 -0
- package/dist/index.js +3094 -0
- package/dist/index.js.map +1 -0
- package/dist/inertia.d.ts +41 -0
- package/dist/inertia.js +86 -0
- package/dist/inertia.js.map +1 -0
- package/dist/language-Bft6rBBt.d.ts +14 -0
- package/dist/locales/pt.d.ts +21 -0
- package/dist/locales/pt.js +79 -0
- package/dist/locales/pt.js.map +1 -0
- package/dist/shells.d.ts +121 -0
- package/dist/shells.js +101 -0
- package/dist/shells.js.map +1 -0
- package/dist/sidebar-BDhG9SUU.d.ts +88 -0
- package/dist/types-Cno1_Ijx.d.ts +40 -0
- package/dist/types-cOieac8G.d.ts +77 -0
- package/dist/types-u1qfmJQi.d.ts +28 -0
- package/package.json +142 -0
- package/theme.css +224 -0
- package/themes/nosferry.css +9 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3094 @@
|
|
|
1
|
+
import { Label, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Select, SelectTrigger, SelectContent, SelectItem, Calendar } from './chunk-42BJBH56.js';
|
|
2
|
+
export { Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea } from './chunk-42BJBH56.js';
|
|
3
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-5MQWJVM2.js';
|
|
4
|
+
export { Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Collapsible, CollapsibleContent, CollapsibleTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Icon, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useSidebar } from './chunk-5MQWJVM2.js';
|
|
5
|
+
import { cn, focusRing, elevatedSurface, nestedRadius, nestedSurfaceReset, nestedEdgeToEdge, glassControl, controlFill, Button, modalSurface, recessedSurface, menuSurface, Input, floatingSurface, panelSurface, buttonVariants } from './chunk-POE7OYET.js';
|
|
6
|
+
export { Button, Input, buttonVariants, cn, controlFill, elevatedSurface, focusRing, menuHighlight, nestedEdgeToEdge, nestedRadius, nestedSurfaceReset, recessedSurface, surface } from './chunk-POE7OYET.js';
|
|
7
|
+
import { ChevronDown, Minus, AlertCircle, ChevronRight, ArrowLeft, ArrowRight, CheckIcon, ChevronsUpDown, Check, ChevronRightIcon, CircleIcon, MoreVertical, Search, X, Plus, ArrowUpDown, ChevronLeft, CalendarRange, ChevronDownIcon, ChevronLeftIcon, MoreHorizontalIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, PlusCircle } from 'lucide-react';
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import * as React2 from 'react';
|
|
10
|
+
import { useState, useMemo, useId, useEffect } from 'react';
|
|
11
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
12
|
+
import { cva } from 'class-variance-authority';
|
|
13
|
+
import { AlertDialog as AlertDialog$1, AspectRatio as AspectRatio$1, ContextMenu as ContextMenu$1, HoverCard as HoverCard$1, Menubar as Menubar$1, Progress as Progress$1, RadioGroup as RadioGroup$1, Slider as Slider$1 } from 'radix-ui';
|
|
14
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
15
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
16
|
+
import * as RechartsPrimitive from 'recharts';
|
|
17
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
18
|
+
import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
19
|
+
import { format } from 'date-fns';
|
|
20
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
21
|
+
import { useFormContext, FormProvider, Controller } from 'react-hook-form';
|
|
22
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
23
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
24
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
25
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
26
|
+
import { Toaster as Toaster$1 } from 'sonner';
|
|
27
|
+
export { toast } from 'sonner';
|
|
28
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
29
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
30
|
+
|
|
31
|
+
function ConfirmDialog({
|
|
32
|
+
open,
|
|
33
|
+
onOpenChange,
|
|
34
|
+
title = "Confirm Action",
|
|
35
|
+
description = "Are you sure you want to continue? This action cannot be undone.",
|
|
36
|
+
confirmText = "Confirm",
|
|
37
|
+
cancelText = "Cancel",
|
|
38
|
+
variant = "destructive",
|
|
39
|
+
processing = false,
|
|
40
|
+
onConfirm,
|
|
41
|
+
onCancel
|
|
42
|
+
}) {
|
|
43
|
+
const handleConfirm = () => {
|
|
44
|
+
if (processing) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
onConfirm();
|
|
48
|
+
onOpenChange(false);
|
|
49
|
+
};
|
|
50
|
+
const handleCancel = () => {
|
|
51
|
+
if (processing) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
onCancel?.();
|
|
55
|
+
onOpenChange(false);
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md p-0", "data-slot": "confirm-dialog", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "p-6 md:p-8", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"size-16 rounded-3xl shadow-xl flex items-center justify-center",
|
|
64
|
+
variant === "destructive" ? "bg-destructive text-destructive-foreground shadow-destructive/20" : "bg-primary text-primary-foreground shadow-primary/20"
|
|
65
|
+
),
|
|
66
|
+
children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8" })
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
70
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx(DialogFooter, { className: "p-6 md:p-8", children: /* @__PURE__ */ jsxs("div", { className: "gap-4 sm:grid-cols-2 grid w-full", children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Button,
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
disabled: processing,
|
|
79
|
+
onClick: handleCancel,
|
|
80
|
+
className: "text-muted-foreground",
|
|
81
|
+
children: cancelText
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsxs(
|
|
85
|
+
Button,
|
|
86
|
+
{
|
|
87
|
+
variant,
|
|
88
|
+
disabled: processing,
|
|
89
|
+
onClick: handleConfirm,
|
|
90
|
+
children: [
|
|
91
|
+
confirmText,
|
|
92
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-2 h-5 w-5" })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) })
|
|
97
|
+
] }) });
|
|
98
|
+
}
|
|
99
|
+
function useConfirmDialog() {
|
|
100
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
101
|
+
const [options, setOptions] = useState({});
|
|
102
|
+
const [onConfirmCallback, setOnConfirmCallback] = useState(null);
|
|
103
|
+
const [onCancelCallback, setOnCancelCallback] = useState(null);
|
|
104
|
+
const confirm = (onConfirm, confirmOptions, onCancel) => {
|
|
105
|
+
setOptions(confirmOptions || {});
|
|
106
|
+
setOnConfirmCallback(() => onConfirm);
|
|
107
|
+
setOnCancelCallback(() => onCancel ?? null);
|
|
108
|
+
setIsOpen(true);
|
|
109
|
+
};
|
|
110
|
+
const handleConfirm = () => {
|
|
111
|
+
onConfirmCallback?.();
|
|
112
|
+
setIsOpen(false);
|
|
113
|
+
};
|
|
114
|
+
const handleCancel = () => {
|
|
115
|
+
onCancelCallback?.();
|
|
116
|
+
setIsOpen(false);
|
|
117
|
+
};
|
|
118
|
+
const ConfirmDialogComponent = () => /* @__PURE__ */ jsx(
|
|
119
|
+
ConfirmDialog,
|
|
120
|
+
{
|
|
121
|
+
open: isOpen,
|
|
122
|
+
onOpenChange: setIsOpen,
|
|
123
|
+
onConfirm: handleConfirm,
|
|
124
|
+
onCancel: handleCancel,
|
|
125
|
+
...options
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
return { confirm, ConfirmDialog: ConfirmDialogComponent };
|
|
129
|
+
}
|
|
130
|
+
function Accordion({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
AccordionPrimitive.Root,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "accordion",
|
|
138
|
+
className: cn(elevatedSurface, "px-5 bg-card", className),
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
var AccordionItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
144
|
+
AccordionPrimitive.Item,
|
|
145
|
+
{
|
|
146
|
+
"data-slot": "accordion-item",
|
|
147
|
+
ref,
|
|
148
|
+
className: cn("border-b border-border last:border-b-0", className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
));
|
|
152
|
+
AccordionItem.displayName = "AccordionItem";
|
|
153
|
+
var AccordionTrigger = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
154
|
+
AccordionPrimitive.Trigger,
|
|
155
|
+
{
|
|
156
|
+
"data-slot": "accordion-trigger",
|
|
157
|
+
ref,
|
|
158
|
+
className: cn(
|
|
159
|
+
`text-base py-4 font-medium rounded-xl data-[state=open]:font-semibold flex flex-1 items-center justify-between transition-all [&[data-state=open]>svg]:rotate-180 ${focusRing}`,
|
|
160
|
+
className
|
|
161
|
+
),
|
|
162
|
+
...props,
|
|
163
|
+
children: [
|
|
164
|
+
children,
|
|
165
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
) }));
|
|
169
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
170
|
+
var AccordionContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
171
|
+
AccordionPrimitive.Content,
|
|
172
|
+
{
|
|
173
|
+
"data-slot": "accordion-content",
|
|
174
|
+
ref,
|
|
175
|
+
className: "text-md data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden transition-all",
|
|
176
|
+
...props,
|
|
177
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0", className), children })
|
|
178
|
+
}
|
|
179
|
+
));
|
|
180
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
181
|
+
var alertVariants = cva(
|
|
182
|
+
`${elevatedSurface} relative w-full px-5 py-4 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,
|
|
183
|
+
{
|
|
184
|
+
variants: {
|
|
185
|
+
variant: {
|
|
186
|
+
default: "bg-card/60 text-card-foreground",
|
|
187
|
+
destructive: "border-destructive/30 bg-destructive/10 text-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/80"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
defaultVariants: {
|
|
191
|
+
variant: "default"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
function Alert({
|
|
196
|
+
className,
|
|
197
|
+
variant,
|
|
198
|
+
...props
|
|
199
|
+
}) {
|
|
200
|
+
return /* @__PURE__ */ jsx(
|
|
201
|
+
"div",
|
|
202
|
+
{
|
|
203
|
+
"data-slot": "alert",
|
|
204
|
+
role: "alert",
|
|
205
|
+
className: cn(alertVariants({ variant }), className),
|
|
206
|
+
...props
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function AlertTitle({ className, ...props }) {
|
|
211
|
+
return /* @__PURE__ */ jsx(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
"data-slot": "alert-title",
|
|
215
|
+
className: cn(
|
|
216
|
+
"min-h-4 font-medium tracking-tight col-start-2 line-clamp-1",
|
|
217
|
+
className
|
|
218
|
+
),
|
|
219
|
+
...props
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
function AlertDescription({
|
|
224
|
+
className,
|
|
225
|
+
...props
|
|
226
|
+
}) {
|
|
227
|
+
return /* @__PURE__ */ jsx(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
"data-slot": "alert-description",
|
|
231
|
+
className: cn(
|
|
232
|
+
"gap-1 text-sm [&_p]:leading-relaxed col-start-2 grid justify-items-start text-muted-foreground",
|
|
233
|
+
className
|
|
234
|
+
),
|
|
235
|
+
...props
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
function AlertDialog({
|
|
240
|
+
...props
|
|
241
|
+
}) {
|
|
242
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Root, { "data-slot": "alert-dialog", ...props });
|
|
243
|
+
}
|
|
244
|
+
function AlertDialogTrigger({
|
|
245
|
+
...props
|
|
246
|
+
}) {
|
|
247
|
+
return /* @__PURE__ */ jsx(
|
|
248
|
+
AlertDialog$1.Trigger,
|
|
249
|
+
{
|
|
250
|
+
"data-slot": "alert-dialog-trigger",
|
|
251
|
+
...props
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function AlertDialogPortal({
|
|
256
|
+
...props
|
|
257
|
+
}) {
|
|
258
|
+
return /* @__PURE__ */ jsx(
|
|
259
|
+
AlertDialog$1.Portal,
|
|
260
|
+
{
|
|
261
|
+
"data-slot": "alert-dialog-portal",
|
|
262
|
+
...props
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
function AlertDialogOverlay({
|
|
267
|
+
className,
|
|
268
|
+
...props
|
|
269
|
+
}) {
|
|
270
|
+
return /* @__PURE__ */ jsx(
|
|
271
|
+
AlertDialog$1.Overlay,
|
|
272
|
+
{
|
|
273
|
+
"data-slot": "alert-dialog-overlay",
|
|
274
|
+
className: cn(
|
|
275
|
+
"inset-0 bg-black/60 backdrop-blur-sm data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed z-50",
|
|
276
|
+
className
|
|
277
|
+
),
|
|
278
|
+
...props
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
function AlertDialogContent({
|
|
283
|
+
className,
|
|
284
|
+
size = "default",
|
|
285
|
+
...props
|
|
286
|
+
}) {
|
|
287
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
288
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
289
|
+
/* @__PURE__ */ jsx(
|
|
290
|
+
AlertDialog$1.Content,
|
|
291
|
+
{
|
|
292
|
+
"data-slot": "alert-dialog-content",
|
|
293
|
+
"data-size": size,
|
|
294
|
+
className: cn(
|
|
295
|
+
`${modalSurface} group/alert-dialog-content gap-4 p-6 md:p-8 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] duration-200`,
|
|
296
|
+
className
|
|
297
|
+
),
|
|
298
|
+
...props
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
function AlertDialogHeader({
|
|
304
|
+
className,
|
|
305
|
+
...props
|
|
306
|
+
}) {
|
|
307
|
+
return /* @__PURE__ */ jsx(
|
|
308
|
+
"div",
|
|
309
|
+
{
|
|
310
|
+
"data-slot": "alert-dialog-header",
|
|
311
|
+
className: cn(
|
|
312
|
+
"gap-1.5 has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr] grid grid-rows-[auto_1fr] place-items-center text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr]",
|
|
313
|
+
className
|
|
314
|
+
),
|
|
315
|
+
...props
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
function AlertDialogFooter({
|
|
320
|
+
className,
|
|
321
|
+
...props
|
|
322
|
+
}) {
|
|
323
|
+
return /* @__PURE__ */ jsx(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
"data-slot": "alert-dialog-footer",
|
|
327
|
+
className: cn(
|
|
328
|
+
"gap-2 sm:flex-row sm:justify-end flex flex-col-reverse group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2",
|
|
329
|
+
className
|
|
330
|
+
),
|
|
331
|
+
...props
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function AlertDialogTitle({
|
|
336
|
+
className,
|
|
337
|
+
...props
|
|
338
|
+
}) {
|
|
339
|
+
return /* @__PURE__ */ jsx(
|
|
340
|
+
AlertDialog$1.Title,
|
|
341
|
+
{
|
|
342
|
+
"data-slot": "alert-dialog-title",
|
|
343
|
+
className: cn(
|
|
344
|
+
"text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
345
|
+
className
|
|
346
|
+
),
|
|
347
|
+
...props
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
function AlertDialogDescription({
|
|
352
|
+
className,
|
|
353
|
+
...props
|
|
354
|
+
}) {
|
|
355
|
+
return /* @__PURE__ */ jsx(
|
|
356
|
+
AlertDialog$1.Description,
|
|
357
|
+
{
|
|
358
|
+
"data-slot": "alert-dialog-description",
|
|
359
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
360
|
+
...props
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
function AlertDialogMedia({
|
|
365
|
+
className,
|
|
366
|
+
...props
|
|
367
|
+
}) {
|
|
368
|
+
return /* @__PURE__ */ jsx(
|
|
369
|
+
"div",
|
|
370
|
+
{
|
|
371
|
+
"data-slot": "alert-dialog-media",
|
|
372
|
+
className: cn(
|
|
373
|
+
"mb-2 size-16 sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8 rounded-2xl inline-flex items-center justify-center bg-muted",
|
|
374
|
+
className
|
|
375
|
+
),
|
|
376
|
+
...props
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
function AlertDialogAction({
|
|
381
|
+
className,
|
|
382
|
+
variant = "default",
|
|
383
|
+
size = "default",
|
|
384
|
+
...props
|
|
385
|
+
}) {
|
|
386
|
+
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
387
|
+
AlertDialog$1.Action,
|
|
388
|
+
{
|
|
389
|
+
"data-slot": "alert-dialog-action",
|
|
390
|
+
className: cn(className),
|
|
391
|
+
...props
|
|
392
|
+
}
|
|
393
|
+
) });
|
|
394
|
+
}
|
|
395
|
+
function AlertDialogCancel({
|
|
396
|
+
className,
|
|
397
|
+
variant = "outline",
|
|
398
|
+
size = "default",
|
|
399
|
+
...props
|
|
400
|
+
}) {
|
|
401
|
+
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
402
|
+
AlertDialog$1.Cancel,
|
|
403
|
+
{
|
|
404
|
+
"data-slot": "alert-dialog-cancel",
|
|
405
|
+
className: cn(className),
|
|
406
|
+
...props
|
|
407
|
+
}
|
|
408
|
+
) });
|
|
409
|
+
}
|
|
410
|
+
function AspectRatio({
|
|
411
|
+
...props
|
|
412
|
+
}) {
|
|
413
|
+
return /* @__PURE__ */ jsx(AspectRatio$1.Root, { "data-slot": "aspect-ratio", ...props });
|
|
414
|
+
}
|
|
415
|
+
var badgeVariants = cva(
|
|
416
|
+
"inline-flex items-center justify-center rounded-full border px-2.5 py-1 text-xs font-semibold w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
417
|
+
{
|
|
418
|
+
variants: {
|
|
419
|
+
variant: {
|
|
420
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
421
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
422
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
423
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
defaultVariants: {
|
|
427
|
+
variant: "default"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
function Badge({
|
|
432
|
+
className,
|
|
433
|
+
variant,
|
|
434
|
+
asChild = false,
|
|
435
|
+
...props
|
|
436
|
+
}) {
|
|
437
|
+
const Comp = asChild ? Slot : "span";
|
|
438
|
+
return /* @__PURE__ */ jsx(
|
|
439
|
+
Comp,
|
|
440
|
+
{
|
|
441
|
+
"data-slot": "badge",
|
|
442
|
+
className: cn(badgeVariants({ variant }), className),
|
|
443
|
+
...props
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
var cardVariants = cva(
|
|
448
|
+
`relative flex flex-col gap-6 overflow-hidden text-card-foreground ${elevatedSurface}`,
|
|
449
|
+
{
|
|
450
|
+
variants: {
|
|
451
|
+
variant: {
|
|
452
|
+
default: "bg-card/60",
|
|
453
|
+
subtle: "border-border/60 bg-card/40",
|
|
454
|
+
solid: "bg-card"
|
|
455
|
+
},
|
|
456
|
+
interactive: {
|
|
457
|
+
true: "transition-colors duration-200 hover:border-foreground/20",
|
|
458
|
+
false: ""
|
|
459
|
+
},
|
|
460
|
+
padding: { none: "py-0", sm: "py-4", md: "py-6", lg: "py-8" }
|
|
461
|
+
},
|
|
462
|
+
defaultVariants: {
|
|
463
|
+
variant: "default",
|
|
464
|
+
interactive: false,
|
|
465
|
+
padding: "md"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
function Card({
|
|
470
|
+
className,
|
|
471
|
+
variant,
|
|
472
|
+
interactive,
|
|
473
|
+
padding,
|
|
474
|
+
inset = false,
|
|
475
|
+
...props
|
|
476
|
+
}) {
|
|
477
|
+
return /* @__PURE__ */ jsx(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
"data-slot": "card",
|
|
481
|
+
"data-inset": inset || void 0,
|
|
482
|
+
className: cn(
|
|
483
|
+
cardVariants({ variant, interactive, padding }),
|
|
484
|
+
inset && recessedSurface,
|
|
485
|
+
className
|
|
486
|
+
),
|
|
487
|
+
...props
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
function CardHeader({ className, ...props }) {
|
|
492
|
+
return /* @__PURE__ */ jsx(
|
|
493
|
+
"div",
|
|
494
|
+
{
|
|
495
|
+
"data-slot": "card-header",
|
|
496
|
+
className: cn("gap-1.5 px-6 flex flex-col", className),
|
|
497
|
+
...props
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
function CardTitle({ className, ...props }) {
|
|
502
|
+
return /* @__PURE__ */ jsx(
|
|
503
|
+
"div",
|
|
504
|
+
{
|
|
505
|
+
"data-slot": "card-title",
|
|
506
|
+
className: cn("font-semibold leading-none", className),
|
|
507
|
+
...props
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
function CardDescription({ className, ...props }) {
|
|
512
|
+
return /* @__PURE__ */ jsx(
|
|
513
|
+
"div",
|
|
514
|
+
{
|
|
515
|
+
"data-slot": "card-description",
|
|
516
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
517
|
+
...props
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
function CardContent({ className, ...props }) {
|
|
522
|
+
return /* @__PURE__ */ jsx(
|
|
523
|
+
"div",
|
|
524
|
+
{
|
|
525
|
+
"data-slot": "card-content",
|
|
526
|
+
className: cn("px-6", className),
|
|
527
|
+
...props
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
function CardFooter({ className, ...props }) {
|
|
532
|
+
return /* @__PURE__ */ jsx(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
"data-slot": "card-footer",
|
|
536
|
+
className: cn("px-6 flex items-center", className),
|
|
537
|
+
...props
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
var CarouselContext = React2.createContext(null);
|
|
542
|
+
function useCarousel() {
|
|
543
|
+
const context = React2.useContext(CarouselContext);
|
|
544
|
+
if (!context) {
|
|
545
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
546
|
+
}
|
|
547
|
+
return context;
|
|
548
|
+
}
|
|
549
|
+
function Carousel({
|
|
550
|
+
orientation = "horizontal",
|
|
551
|
+
opts,
|
|
552
|
+
setApi,
|
|
553
|
+
plugins,
|
|
554
|
+
className,
|
|
555
|
+
children,
|
|
556
|
+
...props
|
|
557
|
+
}) {
|
|
558
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
559
|
+
{
|
|
560
|
+
...opts,
|
|
561
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
562
|
+
},
|
|
563
|
+
plugins
|
|
564
|
+
);
|
|
565
|
+
const [canScrollPrev, setCanScrollPrev] = React2.useState(false);
|
|
566
|
+
const [canScrollNext, setCanScrollNext] = React2.useState(false);
|
|
567
|
+
const onSelect = React2.useCallback((api2) => {
|
|
568
|
+
if (!api2) return;
|
|
569
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
570
|
+
setCanScrollNext(api2.canScrollNext());
|
|
571
|
+
}, []);
|
|
572
|
+
const scrollPrev = React2.useCallback(() => {
|
|
573
|
+
api?.scrollPrev();
|
|
574
|
+
}, [api]);
|
|
575
|
+
const scrollNext = React2.useCallback(() => {
|
|
576
|
+
api?.scrollNext();
|
|
577
|
+
}, [api]);
|
|
578
|
+
const handleKeyDown = React2.useCallback(
|
|
579
|
+
(event) => {
|
|
580
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
event.preventDefault();
|
|
584
|
+
if (event.key === "ArrowLeft") {
|
|
585
|
+
scrollPrev();
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
scrollNext();
|
|
589
|
+
},
|
|
590
|
+
[scrollPrev, scrollNext]
|
|
591
|
+
);
|
|
592
|
+
React2.useEffect(() => {
|
|
593
|
+
if (!api || !setApi) return;
|
|
594
|
+
setApi(api);
|
|
595
|
+
}, [api, setApi]);
|
|
596
|
+
React2.useEffect(() => {
|
|
597
|
+
if (!api) return;
|
|
598
|
+
onSelect(api);
|
|
599
|
+
api.on("reInit", onSelect);
|
|
600
|
+
api.on("select", onSelect);
|
|
601
|
+
return () => {
|
|
602
|
+
api?.off("select", onSelect);
|
|
603
|
+
};
|
|
604
|
+
}, [api, onSelect]);
|
|
605
|
+
return /* @__PURE__ */ jsx(
|
|
606
|
+
CarouselContext.Provider,
|
|
607
|
+
{
|
|
608
|
+
value: {
|
|
609
|
+
carouselRef,
|
|
610
|
+
api,
|
|
611
|
+
opts,
|
|
612
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
613
|
+
scrollPrev,
|
|
614
|
+
scrollNext,
|
|
615
|
+
canScrollPrev,
|
|
616
|
+
canScrollNext
|
|
617
|
+
},
|
|
618
|
+
children: /* @__PURE__ */ jsx(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
onKeyDownCapture: handleKeyDown,
|
|
622
|
+
className: cn(
|
|
623
|
+
elevatedSurface,
|
|
624
|
+
nestedSurfaceReset,
|
|
625
|
+
"p-4 relative bg-card",
|
|
626
|
+
className
|
|
627
|
+
),
|
|
628
|
+
role: "region",
|
|
629
|
+
"aria-roledescription": "carousel",
|
|
630
|
+
"data-slot": "carousel",
|
|
631
|
+
...props,
|
|
632
|
+
children
|
|
633
|
+
}
|
|
634
|
+
)
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
function CarouselContent({ className, ...props }) {
|
|
639
|
+
const { carouselRef, orientation } = useCarousel();
|
|
640
|
+
return /* @__PURE__ */ jsx(
|
|
641
|
+
"div",
|
|
642
|
+
{
|
|
643
|
+
ref: carouselRef,
|
|
644
|
+
className: cn(nestedRadius, "overflow-hidden"),
|
|
645
|
+
"data-slot": "carousel-content",
|
|
646
|
+
children: /* @__PURE__ */ jsx(
|
|
647
|
+
"div",
|
|
648
|
+
{
|
|
649
|
+
className: cn(
|
|
650
|
+
"flex",
|
|
651
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
652
|
+
className
|
|
653
|
+
),
|
|
654
|
+
...props
|
|
655
|
+
}
|
|
656
|
+
)
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
function CarouselItem({ className, ...props }) {
|
|
661
|
+
const { orientation } = useCarousel();
|
|
662
|
+
return /* @__PURE__ */ jsx(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
role: "group",
|
|
666
|
+
"aria-roledescription": "slide",
|
|
667
|
+
"data-slot": "carousel-item",
|
|
668
|
+
className: cn(
|
|
669
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
670
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
671
|
+
className
|
|
672
|
+
),
|
|
673
|
+
...props
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
function CarouselPrevious({
|
|
678
|
+
className,
|
|
679
|
+
variant = "outline",
|
|
680
|
+
size = "icon",
|
|
681
|
+
...props
|
|
682
|
+
}) {
|
|
683
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
684
|
+
return /* @__PURE__ */ jsxs(
|
|
685
|
+
Button,
|
|
686
|
+
{
|
|
687
|
+
"data-slot": "carousel-previous",
|
|
688
|
+
variant,
|
|
689
|
+
size,
|
|
690
|
+
className: cn(
|
|
691
|
+
"size-9 absolute rounded-full",
|
|
692
|
+
orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
693
|
+
className
|
|
694
|
+
),
|
|
695
|
+
disabled: !canScrollPrev,
|
|
696
|
+
onClick: scrollPrev,
|
|
697
|
+
...props,
|
|
698
|
+
children: [
|
|
699
|
+
/* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
700
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
701
|
+
]
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
function CarouselNext({
|
|
706
|
+
className,
|
|
707
|
+
variant = "outline",
|
|
708
|
+
size = "icon",
|
|
709
|
+
...props
|
|
710
|
+
}) {
|
|
711
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
712
|
+
return /* @__PURE__ */ jsxs(
|
|
713
|
+
Button,
|
|
714
|
+
{
|
|
715
|
+
"data-slot": "carousel-next",
|
|
716
|
+
variant,
|
|
717
|
+
size,
|
|
718
|
+
className: cn(
|
|
719
|
+
"size-9 absolute rounded-full",
|
|
720
|
+
orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
721
|
+
className
|
|
722
|
+
),
|
|
723
|
+
disabled: !canScrollNext,
|
|
724
|
+
onClick: scrollNext,
|
|
725
|
+
...props,
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ jsx(ArrowRight, {}),
|
|
728
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
729
|
+
]
|
|
730
|
+
}
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
var THEMES = { light: "", dark: ".dark" };
|
|
734
|
+
var INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
735
|
+
var ChartContext = React2.createContext(null);
|
|
736
|
+
function useChart() {
|
|
737
|
+
const context = React2.useContext(ChartContext);
|
|
738
|
+
if (!context) {
|
|
739
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
740
|
+
}
|
|
741
|
+
return context;
|
|
742
|
+
}
|
|
743
|
+
function ChartContainer({
|
|
744
|
+
id,
|
|
745
|
+
className,
|
|
746
|
+
children,
|
|
747
|
+
config,
|
|
748
|
+
initialDimension = INITIAL_DIMENSION,
|
|
749
|
+
...props
|
|
750
|
+
}) {
|
|
751
|
+
const uniqueId = React2.useId();
|
|
752
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
753
|
+
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
754
|
+
"div",
|
|
755
|
+
{
|
|
756
|
+
"data-slot": "chart",
|
|
757
|
+
"data-chart": chartId,
|
|
758
|
+
className: cn(
|
|
759
|
+
elevatedSurface,
|
|
760
|
+
nestedSurfaceReset,
|
|
761
|
+
"p-4 bg-card",
|
|
762
|
+
"aspect-video text-xs flex justify-center [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
763
|
+
className
|
|
764
|
+
),
|
|
765
|
+
...props,
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsx(ChartStyle, { id: chartId, config }),
|
|
768
|
+
/* @__PURE__ */ jsx(
|
|
769
|
+
RechartsPrimitive.ResponsiveContainer,
|
|
770
|
+
{
|
|
771
|
+
initialDimension,
|
|
772
|
+
children
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
) });
|
|
778
|
+
}
|
|
779
|
+
var ChartStyle = ({ id, config }) => {
|
|
780
|
+
const colorConfig = Object.entries(config).filter(
|
|
781
|
+
([, config2]) => config2.theme ?? config2.color
|
|
782
|
+
);
|
|
783
|
+
if (!colorConfig.length) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
return /* @__PURE__ */ jsx(
|
|
787
|
+
"style",
|
|
788
|
+
{
|
|
789
|
+
dangerouslySetInnerHTML: {
|
|
790
|
+
__html: Object.entries(THEMES).map(
|
|
791
|
+
([theme, prefix]) => `
|
|
792
|
+
${prefix} [data-chart=${id}] {
|
|
793
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
794
|
+
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
795
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
796
|
+
}).join("\n")}
|
|
797
|
+
}
|
|
798
|
+
`
|
|
799
|
+
).join("\n")
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
};
|
|
804
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
805
|
+
function ChartTooltipContent({
|
|
806
|
+
active,
|
|
807
|
+
payload,
|
|
808
|
+
className,
|
|
809
|
+
indicator = "dot",
|
|
810
|
+
hideLabel = false,
|
|
811
|
+
hideIndicator = false,
|
|
812
|
+
label,
|
|
813
|
+
labelFormatter,
|
|
814
|
+
labelClassName,
|
|
815
|
+
formatter,
|
|
816
|
+
color,
|
|
817
|
+
nameKey,
|
|
818
|
+
labelKey
|
|
819
|
+
}) {
|
|
820
|
+
const { config } = useChart();
|
|
821
|
+
const tooltipLabel = React2.useMemo(() => {
|
|
822
|
+
if (hideLabel || !payload?.length) {
|
|
823
|
+
return null;
|
|
824
|
+
}
|
|
825
|
+
const [item] = payload;
|
|
826
|
+
const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
|
|
827
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
828
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
|
|
829
|
+
if (labelFormatter) {
|
|
830
|
+
return /* @__PURE__ */ jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
831
|
+
}
|
|
832
|
+
if (!value) {
|
|
833
|
+
return null;
|
|
834
|
+
}
|
|
835
|
+
return /* @__PURE__ */ jsx("div", { className: cn("font-medium", labelClassName), children: value });
|
|
836
|
+
}, [
|
|
837
|
+
label,
|
|
838
|
+
labelFormatter,
|
|
839
|
+
payload,
|
|
840
|
+
hideLabel,
|
|
841
|
+
labelClassName,
|
|
842
|
+
config,
|
|
843
|
+
labelKey
|
|
844
|
+
]);
|
|
845
|
+
if (!active || !payload?.length) {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
849
|
+
return /* @__PURE__ */ jsxs(
|
|
850
|
+
"div",
|
|
851
|
+
{
|
|
852
|
+
className: cn(
|
|
853
|
+
`${menuSurface} gap-1.5 px-3 py-2 text-xs grid min-w-[8rem] items-start`,
|
|
854
|
+
className
|
|
855
|
+
),
|
|
856
|
+
children: [
|
|
857
|
+
!nestLabel ? tooltipLabel : null,
|
|
858
|
+
/* @__PURE__ */ jsx("div", { className: "gap-1.5 grid", children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
859
|
+
const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
|
|
860
|
+
const itemConfig = getPayloadConfigFromPayload(
|
|
861
|
+
config,
|
|
862
|
+
item,
|
|
863
|
+
key
|
|
864
|
+
);
|
|
865
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color;
|
|
866
|
+
return /* @__PURE__ */ jsx(
|
|
867
|
+
"div",
|
|
868
|
+
{
|
|
869
|
+
className: cn(
|
|
870
|
+
"gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 flex w-full flex-wrap items-stretch [&>svg]:text-muted-foreground",
|
|
871
|
+
indicator === "dot" && "items-center"
|
|
872
|
+
),
|
|
873
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(
|
|
874
|
+
item.value,
|
|
875
|
+
item.name,
|
|
876
|
+
item,
|
|
877
|
+
index,
|
|
878
|
+
item.payload
|
|
879
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
880
|
+
itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx(
|
|
881
|
+
"div",
|
|
882
|
+
{
|
|
883
|
+
className: cn(
|
|
884
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
885
|
+
{
|
|
886
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
887
|
+
"w-1": indicator === "line",
|
|
888
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
889
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
890
|
+
}
|
|
891
|
+
),
|
|
892
|
+
style: {
|
|
893
|
+
"--color-bg": indicatorColor,
|
|
894
|
+
"--color-border": indicatorColor
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
/* @__PURE__ */ jsxs(
|
|
899
|
+
"div",
|
|
900
|
+
{
|
|
901
|
+
className: cn(
|
|
902
|
+
"flex flex-1 justify-between leading-none",
|
|
903
|
+
nestLabel ? "items-end" : "items-center"
|
|
904
|
+
),
|
|
905
|
+
children: [
|
|
906
|
+
/* @__PURE__ */ jsxs("div", { className: "gap-1.5 grid", children: [
|
|
907
|
+
nestLabel ? tooltipLabel : null,
|
|
908
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: itemConfig?.label ?? item.name })
|
|
909
|
+
] }),
|
|
910
|
+
item.value != null && /* @__PURE__ */ jsx("span", { className: "font-mono font-medium text-foreground tabular-nums", children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] })
|
|
915
|
+
},
|
|
916
|
+
index
|
|
917
|
+
);
|
|
918
|
+
}) })
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
924
|
+
function ChartLegendContent({
|
|
925
|
+
className,
|
|
926
|
+
hideIcon = false,
|
|
927
|
+
payload,
|
|
928
|
+
verticalAlign = "bottom",
|
|
929
|
+
nameKey
|
|
930
|
+
}) {
|
|
931
|
+
const { config } = useChart();
|
|
932
|
+
if (!payload?.length) {
|
|
933
|
+
return null;
|
|
934
|
+
}
|
|
935
|
+
return /* @__PURE__ */ jsx(
|
|
936
|
+
"div",
|
|
937
|
+
{
|
|
938
|
+
className: cn(
|
|
939
|
+
"gap-4 flex items-center justify-center",
|
|
940
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
941
|
+
className
|
|
942
|
+
),
|
|
943
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
944
|
+
const key = `${nameKey ?? item.dataKey ?? "value"}`;
|
|
945
|
+
const itemConfig = getPayloadConfigFromPayload(
|
|
946
|
+
config,
|
|
947
|
+
item,
|
|
948
|
+
key
|
|
949
|
+
);
|
|
950
|
+
return /* @__PURE__ */ jsxs(
|
|
951
|
+
"div",
|
|
952
|
+
{
|
|
953
|
+
className: cn(
|
|
954
|
+
"gap-1.5 [&>svg]:h-3 [&>svg]:w-3 flex items-center [&>svg]:text-muted-foreground"
|
|
955
|
+
),
|
|
956
|
+
children: [
|
|
957
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx(
|
|
958
|
+
"div",
|
|
959
|
+
{
|
|
960
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
961
|
+
style: {
|
|
962
|
+
backgroundColor: item.color
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
),
|
|
966
|
+
itemConfig?.label
|
|
967
|
+
]
|
|
968
|
+
},
|
|
969
|
+
index
|
|
970
|
+
);
|
|
971
|
+
})
|
|
972
|
+
}
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
976
|
+
if (typeof payload !== "object" || payload === null) {
|
|
977
|
+
return void 0;
|
|
978
|
+
}
|
|
979
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
980
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
981
|
+
const configLabelKey = payload[key];
|
|
982
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
983
|
+
}
|
|
984
|
+
if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
985
|
+
const configLabelKey = payloadPayload[key];
|
|
986
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
987
|
+
}
|
|
988
|
+
return config[key];
|
|
989
|
+
}
|
|
990
|
+
function Checkbox({
|
|
991
|
+
className,
|
|
992
|
+
...props
|
|
993
|
+
}) {
|
|
994
|
+
return /* @__PURE__ */ jsx(
|
|
995
|
+
CheckboxPrimitive.Root,
|
|
996
|
+
{
|
|
997
|
+
"data-slot": "checkbox",
|
|
998
|
+
className: cn(
|
|
999
|
+
`peer size-5 shadow-xs shrink-0 rounded-md border border-border transition-all disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground ${focusRing}`,
|
|
1000
|
+
className
|
|
1001
|
+
),
|
|
1002
|
+
...props,
|
|
1003
|
+
children: /* @__PURE__ */ jsx(
|
|
1004
|
+
CheckboxPrimitive.Indicator,
|
|
1005
|
+
{
|
|
1006
|
+
"data-slot": "checkbox-indicator",
|
|
1007
|
+
className: "flex items-center justify-center text-current transition-none",
|
|
1008
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
1009
|
+
}
|
|
1010
|
+
)
|
|
1011
|
+
}
|
|
1012
|
+
);
|
|
1013
|
+
}
|
|
1014
|
+
function Combobox({
|
|
1015
|
+
id,
|
|
1016
|
+
value,
|
|
1017
|
+
options,
|
|
1018
|
+
onChange,
|
|
1019
|
+
placeholder = "Select an option",
|
|
1020
|
+
searchPlaceholder = "Search...",
|
|
1021
|
+
emptyText = "No results.",
|
|
1022
|
+
disabled = false,
|
|
1023
|
+
invalid = false
|
|
1024
|
+
}) {
|
|
1025
|
+
const [open, setOpen] = useState(false);
|
|
1026
|
+
const selected = options.find((option) => option.value === value);
|
|
1027
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
1028
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1029
|
+
Button,
|
|
1030
|
+
{
|
|
1031
|
+
"data-slot": "combobox",
|
|
1032
|
+
id,
|
|
1033
|
+
variant: "outline",
|
|
1034
|
+
role: "combobox",
|
|
1035
|
+
"aria-expanded": open,
|
|
1036
|
+
disabled,
|
|
1037
|
+
className: cn(
|
|
1038
|
+
"h-11 rounded-2xl w-full justify-between border-border bg-muted/40 hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",
|
|
1039
|
+
!selected && "text-muted-foreground",
|
|
1040
|
+
invalid && "border-destructive ring-destructive"
|
|
1041
|
+
),
|
|
1042
|
+
children: [
|
|
1043
|
+
selected ? selected.label : placeholder,
|
|
1044
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1045
|
+
]
|
|
1046
|
+
}
|
|
1047
|
+
) }),
|
|
1048
|
+
/* @__PURE__ */ jsx(
|
|
1049
|
+
PopoverContent,
|
|
1050
|
+
{
|
|
1051
|
+
className: "p-0 w-[var(--radix-popover-trigger-width)]",
|
|
1052
|
+
align: "start",
|
|
1053
|
+
children: /* @__PURE__ */ jsxs(Command, { children: [
|
|
1054
|
+
/* @__PURE__ */ jsx(
|
|
1055
|
+
CommandInput,
|
|
1056
|
+
{
|
|
1057
|
+
placeholder: searchPlaceholder,
|
|
1058
|
+
className: "h-11"
|
|
1059
|
+
}
|
|
1060
|
+
),
|
|
1061
|
+
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
1062
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
1063
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1064
|
+
CommandItem,
|
|
1065
|
+
{
|
|
1066
|
+
value: option.label,
|
|
1067
|
+
onSelect: () => {
|
|
1068
|
+
onChange(option.value);
|
|
1069
|
+
setOpen(false);
|
|
1070
|
+
},
|
|
1071
|
+
className: "h-11 rounded-xl",
|
|
1072
|
+
children: [
|
|
1073
|
+
/* @__PURE__ */ jsx(
|
|
1074
|
+
Check,
|
|
1075
|
+
{
|
|
1076
|
+
className: cn(
|
|
1077
|
+
"mr-2 h-4 w-4",
|
|
1078
|
+
selected?.value === option.value ? "opacity-100" : "opacity-0"
|
|
1079
|
+
)
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
option.label
|
|
1083
|
+
]
|
|
1084
|
+
},
|
|
1085
|
+
option.value
|
|
1086
|
+
)) })
|
|
1087
|
+
] })
|
|
1088
|
+
] })
|
|
1089
|
+
}
|
|
1090
|
+
)
|
|
1091
|
+
] });
|
|
1092
|
+
}
|
|
1093
|
+
function ContextMenu({
|
|
1094
|
+
...props
|
|
1095
|
+
}) {
|
|
1096
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Root, { "data-slot": "context-menu", ...props });
|
|
1097
|
+
}
|
|
1098
|
+
function ContextMenuTrigger({
|
|
1099
|
+
...props
|
|
1100
|
+
}) {
|
|
1101
|
+
return /* @__PURE__ */ jsx(
|
|
1102
|
+
ContextMenu$1.Trigger,
|
|
1103
|
+
{
|
|
1104
|
+
"data-slot": "context-menu-trigger",
|
|
1105
|
+
...props
|
|
1106
|
+
}
|
|
1107
|
+
);
|
|
1108
|
+
}
|
|
1109
|
+
function ContextMenuGroup({
|
|
1110
|
+
...props
|
|
1111
|
+
}) {
|
|
1112
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Group, { "data-slot": "context-menu-group", ...props });
|
|
1113
|
+
}
|
|
1114
|
+
function ContextMenuPortal({
|
|
1115
|
+
...props
|
|
1116
|
+
}) {
|
|
1117
|
+
return /* @__PURE__ */ jsx(
|
|
1118
|
+
ContextMenu$1.Portal,
|
|
1119
|
+
{
|
|
1120
|
+
"data-slot": "context-menu-portal",
|
|
1121
|
+
...props
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
function ContextMenuSub({
|
|
1126
|
+
...props
|
|
1127
|
+
}) {
|
|
1128
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Sub, { "data-slot": "context-menu-sub", ...props });
|
|
1129
|
+
}
|
|
1130
|
+
function ContextMenuRadioGroup({
|
|
1131
|
+
...props
|
|
1132
|
+
}) {
|
|
1133
|
+
return /* @__PURE__ */ jsx(
|
|
1134
|
+
ContextMenu$1.RadioGroup,
|
|
1135
|
+
{
|
|
1136
|
+
"data-slot": "context-menu-radio-group",
|
|
1137
|
+
...props
|
|
1138
|
+
}
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
function ContextMenuSubTrigger({
|
|
1142
|
+
className,
|
|
1143
|
+
inset,
|
|
1144
|
+
children,
|
|
1145
|
+
...props
|
|
1146
|
+
}) {
|
|
1147
|
+
return /* @__PURE__ */ jsxs(
|
|
1148
|
+
ContextMenu$1.SubTrigger,
|
|
1149
|
+
{
|
|
1150
|
+
"data-slot": "context-menu-sub-trigger",
|
|
1151
|
+
"data-inset": inset,
|
|
1152
|
+
className: cn(
|
|
1153
|
+
"px-2 py-1.5 text-sm data-[inset]:pl-8 [&_svg:not([class*='size-'])]:size-4 rounded-xl flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
1154
|
+
className
|
|
1155
|
+
),
|
|
1156
|
+
...props,
|
|
1157
|
+
children: [
|
|
1158
|
+
children,
|
|
1159
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
|
|
1160
|
+
]
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
function ContextMenuSubContent({
|
|
1165
|
+
className,
|
|
1166
|
+
...props
|
|
1167
|
+
}) {
|
|
1168
|
+
return /* @__PURE__ */ jsx(
|
|
1169
|
+
ContextMenu$1.SubContent,
|
|
1170
|
+
{
|
|
1171
|
+
"data-slot": "context-menu-sub-content",
|
|
1172
|
+
className: cn(
|
|
1173
|
+
`${menuSurface} p-1.5 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden`,
|
|
1174
|
+
className
|
|
1175
|
+
),
|
|
1176
|
+
...props
|
|
1177
|
+
}
|
|
1178
|
+
);
|
|
1179
|
+
}
|
|
1180
|
+
function ContextMenuContent({
|
|
1181
|
+
className,
|
|
1182
|
+
...props
|
|
1183
|
+
}) {
|
|
1184
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
1185
|
+
ContextMenu$1.Content,
|
|
1186
|
+
{
|
|
1187
|
+
"data-slot": "context-menu-content",
|
|
1188
|
+
className: cn(
|
|
1189
|
+
`${menuSurface} p-1.5 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto`,
|
|
1190
|
+
className
|
|
1191
|
+
),
|
|
1192
|
+
...props
|
|
1193
|
+
}
|
|
1194
|
+
) });
|
|
1195
|
+
}
|
|
1196
|
+
function ContextMenuItem({
|
|
1197
|
+
className,
|
|
1198
|
+
inset,
|
|
1199
|
+
variant = "default",
|
|
1200
|
+
...props
|
|
1201
|
+
}) {
|
|
1202
|
+
return /* @__PURE__ */ jsx(
|
|
1203
|
+
ContextMenu$1.Item,
|
|
1204
|
+
{
|
|
1205
|
+
"data-slot": "context-menu-item",
|
|
1206
|
+
"data-inset": inset,
|
|
1207
|
+
"data-variant": variant,
|
|
1208
|
+
className: cn(
|
|
1209
|
+
"gap-2 px-2 py-1.5 text-sm data-[inset]:pl-8 [&_svg:not([class*='size-'])]:size-4 rounded-xl relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
1210
|
+
className
|
|
1211
|
+
),
|
|
1212
|
+
...props
|
|
1213
|
+
}
|
|
1214
|
+
);
|
|
1215
|
+
}
|
|
1216
|
+
function ContextMenuCheckboxItem({
|
|
1217
|
+
className,
|
|
1218
|
+
children,
|
|
1219
|
+
checked,
|
|
1220
|
+
...props
|
|
1221
|
+
}) {
|
|
1222
|
+
return /* @__PURE__ */ jsxs(
|
|
1223
|
+
ContextMenu$1.CheckboxItem,
|
|
1224
|
+
{
|
|
1225
|
+
"data-slot": "context-menu-checkbox-item",
|
|
1226
|
+
className: cn(
|
|
1227
|
+
"gap-2 py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1228
|
+
className
|
|
1229
|
+
),
|
|
1230
|
+
checked,
|
|
1231
|
+
...props,
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsx("span", { className: "left-2 size-3.5 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
1234
|
+
children
|
|
1235
|
+
]
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
function ContextMenuRadioItem({
|
|
1240
|
+
className,
|
|
1241
|
+
children,
|
|
1242
|
+
...props
|
|
1243
|
+
}) {
|
|
1244
|
+
return /* @__PURE__ */ jsxs(
|
|
1245
|
+
ContextMenu$1.RadioItem,
|
|
1246
|
+
{
|
|
1247
|
+
"data-slot": "context-menu-radio-item",
|
|
1248
|
+
className: cn(
|
|
1249
|
+
"gap-2 py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1250
|
+
className
|
|
1251
|
+
),
|
|
1252
|
+
...props,
|
|
1253
|
+
children: [
|
|
1254
|
+
/* @__PURE__ */ jsx("span", { className: "left-2 size-3.5 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
1255
|
+
children
|
|
1256
|
+
]
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
function ContextMenuLabel({
|
|
1261
|
+
className,
|
|
1262
|
+
inset,
|
|
1263
|
+
...props
|
|
1264
|
+
}) {
|
|
1265
|
+
return /* @__PURE__ */ jsx(
|
|
1266
|
+
ContextMenu$1.Label,
|
|
1267
|
+
{
|
|
1268
|
+
"data-slot": "context-menu-label",
|
|
1269
|
+
"data-inset": inset,
|
|
1270
|
+
className: cn(
|
|
1271
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8 text-foreground",
|
|
1272
|
+
className
|
|
1273
|
+
),
|
|
1274
|
+
...props
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
}
|
|
1278
|
+
function ContextMenuSeparator({
|
|
1279
|
+
className,
|
|
1280
|
+
...props
|
|
1281
|
+
}) {
|
|
1282
|
+
return /* @__PURE__ */ jsx(
|
|
1283
|
+
ContextMenu$1.Separator,
|
|
1284
|
+
{
|
|
1285
|
+
"data-slot": "context-menu-separator",
|
|
1286
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1287
|
+
...props
|
|
1288
|
+
}
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
function ContextMenuShortcut({
|
|
1292
|
+
className,
|
|
1293
|
+
...props
|
|
1294
|
+
}) {
|
|
1295
|
+
return /* @__PURE__ */ jsx(
|
|
1296
|
+
"span",
|
|
1297
|
+
{
|
|
1298
|
+
"data-slot": "context-menu-shortcut",
|
|
1299
|
+
className: cn(
|
|
1300
|
+
"text-xs tracking-widest ml-auto text-muted-foreground",
|
|
1301
|
+
className
|
|
1302
|
+
),
|
|
1303
|
+
...props
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
function FilterPopover({
|
|
1308
|
+
label,
|
|
1309
|
+
options,
|
|
1310
|
+
selected,
|
|
1311
|
+
onToggle,
|
|
1312
|
+
width,
|
|
1313
|
+
noOptionsLabel = "No options."
|
|
1314
|
+
}) {
|
|
1315
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
1316
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1317
|
+
Button,
|
|
1318
|
+
{
|
|
1319
|
+
variant: "outline",
|
|
1320
|
+
"data-slot": "data-table-faceted-filter",
|
|
1321
|
+
className: "h-11 rounded-2xl border-dashed border-border",
|
|
1322
|
+
children: [
|
|
1323
|
+
/* @__PURE__ */ jsx(PlusCircle, { className: "mr-2 size-4" }),
|
|
1324
|
+
label,
|
|
1325
|
+
selected.size > 0 && /* @__PURE__ */ jsx(
|
|
1326
|
+
Badge,
|
|
1327
|
+
{
|
|
1328
|
+
variant: "secondary",
|
|
1329
|
+
className: "ml-2 px-2 rounded-full tabular-nums",
|
|
1330
|
+
children: selected.size
|
|
1331
|
+
}
|
|
1332
|
+
)
|
|
1333
|
+
]
|
|
1334
|
+
}
|
|
1335
|
+
) }),
|
|
1336
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: cn("p-0", width), align: "start", children: /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */ jsxs(CommandList, { children: [
|
|
1337
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: noOptionsLabel }),
|
|
1338
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1339
|
+
CommandItem,
|
|
1340
|
+
{
|
|
1341
|
+
value: option.label,
|
|
1342
|
+
onSelect: () => onToggle(option.value),
|
|
1343
|
+
className: "h-10 rounded-xl",
|
|
1344
|
+
children: [
|
|
1345
|
+
/* @__PURE__ */ jsx(
|
|
1346
|
+
"div",
|
|
1347
|
+
{
|
|
1348
|
+
className: cn(
|
|
1349
|
+
"mr-2 size-4 flex items-center justify-center rounded-md border border-border",
|
|
1350
|
+
selected.has(option.value) ? "bg-primary text-primary-foreground" : "opacity-50"
|
|
1351
|
+
),
|
|
1352
|
+
children: selected.has(option.value) && /* @__PURE__ */ jsx(Check, { className: "size-3" })
|
|
1353
|
+
}
|
|
1354
|
+
),
|
|
1355
|
+
option.label
|
|
1356
|
+
]
|
|
1357
|
+
},
|
|
1358
|
+
option.value
|
|
1359
|
+
)) })
|
|
1360
|
+
] }) }) })
|
|
1361
|
+
] });
|
|
1362
|
+
}
|
|
1363
|
+
function FacetedFilter({
|
|
1364
|
+
column,
|
|
1365
|
+
filter,
|
|
1366
|
+
noOptionsLabel
|
|
1367
|
+
}) {
|
|
1368
|
+
const selected = new Set(column?.getFilterValue() ?? []);
|
|
1369
|
+
const toggle = (value) => {
|
|
1370
|
+
const next = new Set(selected);
|
|
1371
|
+
if (next.has(value)) {
|
|
1372
|
+
next.delete(value);
|
|
1373
|
+
} else {
|
|
1374
|
+
next.add(value);
|
|
1375
|
+
}
|
|
1376
|
+
const arr = Array.from(next);
|
|
1377
|
+
column?.setFilterValue(arr.length ? arr : void 0);
|
|
1378
|
+
};
|
|
1379
|
+
return /* @__PURE__ */ jsx(
|
|
1380
|
+
FilterPopover,
|
|
1381
|
+
{
|
|
1382
|
+
label: filter.label,
|
|
1383
|
+
options: filter.options,
|
|
1384
|
+
selected,
|
|
1385
|
+
onToggle: toggle,
|
|
1386
|
+
width: "w-[220px]",
|
|
1387
|
+
noOptionsLabel
|
|
1388
|
+
}
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
function ServerFacetedFilter({
|
|
1392
|
+
filter,
|
|
1393
|
+
selected,
|
|
1394
|
+
onChange,
|
|
1395
|
+
noOptionsLabel
|
|
1396
|
+
}) {
|
|
1397
|
+
const selectedSet = new Set(selected);
|
|
1398
|
+
const toggle = (value) => {
|
|
1399
|
+
const next = new Set(selectedSet);
|
|
1400
|
+
if (next.has(value)) {
|
|
1401
|
+
next.delete(value);
|
|
1402
|
+
} else {
|
|
1403
|
+
next.add(value);
|
|
1404
|
+
}
|
|
1405
|
+
onChange(Array.from(next));
|
|
1406
|
+
};
|
|
1407
|
+
return /* @__PURE__ */ jsx(
|
|
1408
|
+
FilterPopover,
|
|
1409
|
+
{
|
|
1410
|
+
label: filter.label,
|
|
1411
|
+
options: filter.options,
|
|
1412
|
+
selected: selectedSet,
|
|
1413
|
+
onToggle: toggle,
|
|
1414
|
+
width: "w-[240px]",
|
|
1415
|
+
noOptionsLabel
|
|
1416
|
+
}
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
function RowActionsMenu({
|
|
1420
|
+
row,
|
|
1421
|
+
actions
|
|
1422
|
+
}) {
|
|
1423
|
+
return /* @__PURE__ */ jsx(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
className: "flex justify-end",
|
|
1427
|
+
"data-slot": "data-table-row-actions",
|
|
1428
|
+
onClick: (event) => event.stopPropagation(),
|
|
1429
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1430
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1431
|
+
Button,
|
|
1432
|
+
{
|
|
1433
|
+
variant: "ghost",
|
|
1434
|
+
size: "icon",
|
|
1435
|
+
className: "size-8 rounded-xl text-muted-foreground hover:text-foreground",
|
|
1436
|
+
children: /* @__PURE__ */ jsx(MoreVertical, { className: "size-4" })
|
|
1437
|
+
}
|
|
1438
|
+
) }),
|
|
1439
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "rounded-2xl", children: actions.map((action) => /* @__PURE__ */ jsxs(
|
|
1440
|
+
DropdownMenuItem,
|
|
1441
|
+
{
|
|
1442
|
+
onClick: () => action.onClick(row),
|
|
1443
|
+
className: action.variant === "destructive" ? "rounded-xl text-destructive focus:text-destructive" : "rounded-xl",
|
|
1444
|
+
children: [
|
|
1445
|
+
action.icon && /* @__PURE__ */ jsx(action.icon, { className: "size-4" }),
|
|
1446
|
+
action.label
|
|
1447
|
+
]
|
|
1448
|
+
},
|
|
1449
|
+
action.label
|
|
1450
|
+
)) })
|
|
1451
|
+
] })
|
|
1452
|
+
}
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1456
|
+
"div",
|
|
1457
|
+
{
|
|
1458
|
+
"data-slot": "table-container",
|
|
1459
|
+
className: cn(
|
|
1460
|
+
elevatedSurface,
|
|
1461
|
+
nestedSurfaceReset,
|
|
1462
|
+
nestedEdgeToEdge,
|
|
1463
|
+
"relative w-full overflow-hidden bg-card"
|
|
1464
|
+
),
|
|
1465
|
+
children: /* @__PURE__ */ jsx(
|
|
1466
|
+
"div",
|
|
1467
|
+
{
|
|
1468
|
+
className: cn(
|
|
1469
|
+
nestedRadius,
|
|
1470
|
+
nestedSurfaceReset,
|
|
1471
|
+
nestedEdgeToEdge,
|
|
1472
|
+
"w-full overflow-x-auto"
|
|
1473
|
+
),
|
|
1474
|
+
children: /* @__PURE__ */ jsx(
|
|
1475
|
+
"table",
|
|
1476
|
+
{
|
|
1477
|
+
ref,
|
|
1478
|
+
className: cn("text-sm w-full caption-bottom", className),
|
|
1479
|
+
...props
|
|
1480
|
+
}
|
|
1481
|
+
)
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
}
|
|
1485
|
+
));
|
|
1486
|
+
Table.displayName = "Table";
|
|
1487
|
+
var TableHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1488
|
+
TableHeader.displayName = "TableHeader";
|
|
1489
|
+
var TableBody = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1490
|
+
"tbody",
|
|
1491
|
+
{
|
|
1492
|
+
ref,
|
|
1493
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
1494
|
+
...props
|
|
1495
|
+
}
|
|
1496
|
+
));
|
|
1497
|
+
TableBody.displayName = "TableBody";
|
|
1498
|
+
var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1499
|
+
"tfoot",
|
|
1500
|
+
{
|
|
1501
|
+
ref,
|
|
1502
|
+
className: cn(
|
|
1503
|
+
"font-medium border-t bg-muted/50 [&>tr]:last:border-b-0",
|
|
1504
|
+
className
|
|
1505
|
+
),
|
|
1506
|
+
...props
|
|
1507
|
+
}
|
|
1508
|
+
));
|
|
1509
|
+
TableFooter.displayName = "TableFooter";
|
|
1510
|
+
var TableRow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1511
|
+
"tr",
|
|
1512
|
+
{
|
|
1513
|
+
ref,
|
|
1514
|
+
className: cn(
|
|
1515
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1516
|
+
className
|
|
1517
|
+
),
|
|
1518
|
+
...props
|
|
1519
|
+
}
|
|
1520
|
+
));
|
|
1521
|
+
TableRow.displayName = "TableRow";
|
|
1522
|
+
var TableHead = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1523
|
+
"th",
|
|
1524
|
+
{
|
|
1525
|
+
ref,
|
|
1526
|
+
className: cn(
|
|
1527
|
+
"h-11 px-4 text-xs font-medium tracking-wider [&:has([role=checkbox])]:pr-0 text-left align-middle text-muted-foreground uppercase",
|
|
1528
|
+
className
|
|
1529
|
+
),
|
|
1530
|
+
...props
|
|
1531
|
+
}
|
|
1532
|
+
));
|
|
1533
|
+
TableHead.displayName = "TableHead";
|
|
1534
|
+
var TableCell = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1535
|
+
"td",
|
|
1536
|
+
{
|
|
1537
|
+
ref,
|
|
1538
|
+
className: cn(
|
|
1539
|
+
"p-4 [&:has([role=checkbox])]:pr-0 align-middle",
|
|
1540
|
+
className
|
|
1541
|
+
),
|
|
1542
|
+
...props
|
|
1543
|
+
}
|
|
1544
|
+
));
|
|
1545
|
+
TableCell.displayName = "TableCell";
|
|
1546
|
+
var TableCaption = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1547
|
+
"caption",
|
|
1548
|
+
{
|
|
1549
|
+
ref,
|
|
1550
|
+
className: cn(
|
|
1551
|
+
"mt-4 px-4 pb-4 text-sm text-muted-foreground",
|
|
1552
|
+
className
|
|
1553
|
+
),
|
|
1554
|
+
...props
|
|
1555
|
+
}
|
|
1556
|
+
));
|
|
1557
|
+
TableCaption.displayName = "TableCaption";
|
|
1558
|
+
function pageRange(current, last) {
|
|
1559
|
+
if (last <= 7) {
|
|
1560
|
+
return Array.from({ length: last }, (_, i) => i + 1);
|
|
1561
|
+
}
|
|
1562
|
+
const pages = [1];
|
|
1563
|
+
const left = Math.max(2, current - 1);
|
|
1564
|
+
const right = Math.min(last - 1, current + 1);
|
|
1565
|
+
if (left > 2) pages.push("ellipsis");
|
|
1566
|
+
for (let i = left; i <= right; i++) pages.push(i);
|
|
1567
|
+
if (right < last - 1) pages.push("ellipsis");
|
|
1568
|
+
pages.push(last);
|
|
1569
|
+
return pages;
|
|
1570
|
+
}
|
|
1571
|
+
function DataTable({
|
|
1572
|
+
columns,
|
|
1573
|
+
data,
|
|
1574
|
+
searchKey,
|
|
1575
|
+
searchPlaceholder = "Search...",
|
|
1576
|
+
pageSize = 10,
|
|
1577
|
+
pageSizeOptions = [10, 25, 50, 100],
|
|
1578
|
+
onPageSizeChange,
|
|
1579
|
+
filters,
|
|
1580
|
+
serverFilters,
|
|
1581
|
+
filterValues,
|
|
1582
|
+
onFilterChange,
|
|
1583
|
+
canClearFilters,
|
|
1584
|
+
onClearFilters,
|
|
1585
|
+
toolbarExtra,
|
|
1586
|
+
toolbarAction,
|
|
1587
|
+
emptyLabel = "No results.",
|
|
1588
|
+
clearFiltersLabel = "Clear filters",
|
|
1589
|
+
paginationLabel = (page, pages) => `Page ${page} of ${pages}`,
|
|
1590
|
+
noOptionsLabel = "No options.",
|
|
1591
|
+
totalLabel = (total2) => `${total2.toLocaleString("en-US")} records`,
|
|
1592
|
+
renderRow,
|
|
1593
|
+
onRowClick,
|
|
1594
|
+
isRowActive,
|
|
1595
|
+
rowActions,
|
|
1596
|
+
searchValue,
|
|
1597
|
+
onSearchChange,
|
|
1598
|
+
manualPagination = false,
|
|
1599
|
+
pageCount,
|
|
1600
|
+
pageIndex = 0,
|
|
1601
|
+
total,
|
|
1602
|
+
onPageChange,
|
|
1603
|
+
onCreate,
|
|
1604
|
+
createLabel = "New"
|
|
1605
|
+
}) {
|
|
1606
|
+
const [sorting, setSorting] = useState([]);
|
|
1607
|
+
const [globalFilter, setGlobalFilter] = useState("");
|
|
1608
|
+
const [columnFilters, setColumnFilters] = useState([]);
|
|
1609
|
+
const serverSearch = onSearchChange !== void 0;
|
|
1610
|
+
const tableColumns = useMemo(() => {
|
|
1611
|
+
if (!rowActions || rowActions.length === 0) {
|
|
1612
|
+
return columns;
|
|
1613
|
+
}
|
|
1614
|
+
return [
|
|
1615
|
+
...columns,
|
|
1616
|
+
{
|
|
1617
|
+
id: "__actions",
|
|
1618
|
+
header: "",
|
|
1619
|
+
enableSorting: false,
|
|
1620
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(RowActionsMenu, { row: row.original, actions: rowActions })
|
|
1621
|
+
}
|
|
1622
|
+
];
|
|
1623
|
+
}, [columns, rowActions]);
|
|
1624
|
+
const table = useReactTable({
|
|
1625
|
+
data,
|
|
1626
|
+
columns: tableColumns,
|
|
1627
|
+
state: {
|
|
1628
|
+
sorting,
|
|
1629
|
+
columnFilters,
|
|
1630
|
+
...serverSearch ? {} : { globalFilter }
|
|
1631
|
+
},
|
|
1632
|
+
onSortingChange: setSorting,
|
|
1633
|
+
onGlobalFilterChange: serverSearch ? void 0 : setGlobalFilter,
|
|
1634
|
+
onColumnFiltersChange: setColumnFilters,
|
|
1635
|
+
getCoreRowModel: getCoreRowModel(),
|
|
1636
|
+
getSortedRowModel: getSortedRowModel(),
|
|
1637
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
1638
|
+
...manualPagination ? { manualPagination: true, pageCount: pageCount ?? -1 } : { getPaginationRowModel: getPaginationRowModel() },
|
|
1639
|
+
initialState: { pagination: { pageSize } }
|
|
1640
|
+
});
|
|
1641
|
+
const hasServerSelection = serverFilters?.some(
|
|
1642
|
+
(filter) => (filterValues?.[filter.paramKey]?.length ?? 0) > 0
|
|
1643
|
+
) ?? false;
|
|
1644
|
+
const hasToolbar = searchKey !== void 0 || filters && filters.length > 0 || serverFilters && serverFilters.length > 0 || onCreate !== void 0 || toolbarExtra !== void 0 || toolbarAction !== void 0;
|
|
1645
|
+
const showFooter = manualPagination || table.getPageCount() > 1;
|
|
1646
|
+
const currentPage = manualPagination ? pageIndex + 1 : table.getState().pagination.pageIndex + 1;
|
|
1647
|
+
const lastPage = manualPagination ? Math.max(1, pageCount ?? 1) : table.getPageCount();
|
|
1648
|
+
const canPrev = manualPagination ? pageIndex > 0 : table.getCanPreviousPage();
|
|
1649
|
+
const canNext = manualPagination ? pageIndex + 1 < (pageCount ?? 1) : table.getCanNextPage();
|
|
1650
|
+
const prev = () => manualPagination ? onPageChange?.(pageIndex - 1) : table.previousPage();
|
|
1651
|
+
const next = () => manualPagination ? onPageChange?.(pageIndex + 1) : table.nextPage();
|
|
1652
|
+
const goTo = (page) => manualPagination ? onPageChange?.(page - 1) : table.setPageIndex(page - 1);
|
|
1653
|
+
const activePageSize = manualPagination ? pageSize : table.getState().pagination.pageSize;
|
|
1654
|
+
const changePageSize = (size) => onPageSizeChange ? onPageSizeChange(size) : table.setPageSize(size);
|
|
1655
|
+
const sizeChoices = [.../* @__PURE__ */ new Set([...pageSizeOptions, activePageSize])].sort(
|
|
1656
|
+
(a, b) => a - b
|
|
1657
|
+
);
|
|
1658
|
+
return /* @__PURE__ */ jsxs(
|
|
1659
|
+
"div",
|
|
1660
|
+
{
|
|
1661
|
+
"data-slot": "data-table",
|
|
1662
|
+
className: cn(elevatedSurface, "space-y-4 p-5 bg-card"),
|
|
1663
|
+
children: [
|
|
1664
|
+
hasToolbar && /* @__PURE__ */ jsxs("div", { className: "gap-2 flex flex-wrap items-center", children: [
|
|
1665
|
+
searchKey !== void 0 && /* @__PURE__ */ jsxs("div", { className: "relative min-w-[200px] flex-1", children: [
|
|
1666
|
+
/* @__PURE__ */ jsx(Search, { className: "left-4 size-4 pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-muted-foreground" }),
|
|
1667
|
+
/* @__PURE__ */ jsx(
|
|
1668
|
+
Input,
|
|
1669
|
+
{
|
|
1670
|
+
value: serverSearch ? searchValue ?? "" : globalFilter,
|
|
1671
|
+
onChange: (e) => serverSearch ? onSearchChange?.(e.target.value) : setGlobalFilter(e.target.value),
|
|
1672
|
+
placeholder: searchPlaceholder,
|
|
1673
|
+
className: "h-11 rounded-2xl pl-11 font-medium focus:shadow-lg border-none bg-muted/50 focus:bg-muted"
|
|
1674
|
+
}
|
|
1675
|
+
)
|
|
1676
|
+
] }),
|
|
1677
|
+
filters?.map((filter) => /* @__PURE__ */ jsx(
|
|
1678
|
+
FacetedFilter,
|
|
1679
|
+
{
|
|
1680
|
+
column: table.getColumn(filter.columnId),
|
|
1681
|
+
filter,
|
|
1682
|
+
noOptionsLabel
|
|
1683
|
+
},
|
|
1684
|
+
filter.columnId
|
|
1685
|
+
)),
|
|
1686
|
+
serverFilters?.map((filter) => /* @__PURE__ */ jsx(
|
|
1687
|
+
ServerFacetedFilter,
|
|
1688
|
+
{
|
|
1689
|
+
filter,
|
|
1690
|
+
selected: filterValues?.[filter.paramKey] ?? [],
|
|
1691
|
+
onChange: (values) => onFilterChange?.(filter.paramKey, values),
|
|
1692
|
+
noOptionsLabel
|
|
1693
|
+
},
|
|
1694
|
+
filter.paramKey
|
|
1695
|
+
)),
|
|
1696
|
+
toolbarExtra,
|
|
1697
|
+
(columnFilters.length > 0 || hasServerSelection || canClearFilters && onClearFilters) && /* @__PURE__ */ jsxs(
|
|
1698
|
+
Button,
|
|
1699
|
+
{
|
|
1700
|
+
variant: "ghost",
|
|
1701
|
+
onClick: () => {
|
|
1702
|
+
if (columnFilters.length > 0) {
|
|
1703
|
+
table.resetColumnFilters();
|
|
1704
|
+
}
|
|
1705
|
+
if (hasServerSelection || canClearFilters) {
|
|
1706
|
+
onClearFilters?.();
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
className: "h-11 rounded-2xl",
|
|
1710
|
+
children: [
|
|
1711
|
+
clearFiltersLabel,
|
|
1712
|
+
/* @__PURE__ */ jsx(X, { className: "ml-1 size-4" })
|
|
1713
|
+
]
|
|
1714
|
+
}
|
|
1715
|
+
),
|
|
1716
|
+
onCreate && /* @__PURE__ */ jsx(
|
|
1717
|
+
Button,
|
|
1718
|
+
{
|
|
1719
|
+
onClick: onCreate,
|
|
1720
|
+
"aria-label": createLabel,
|
|
1721
|
+
size: "icon",
|
|
1722
|
+
className: "size-11 rounded-2xl shrink-0 cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1723
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "size-5" })
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
toolbarAction && /* @__PURE__ */ jsx("div", { className: "ml-auto", children: toolbarAction })
|
|
1727
|
+
] }),
|
|
1728
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
1729
|
+
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
|
|
1730
|
+
TableRow,
|
|
1731
|
+
{
|
|
1732
|
+
className: "hover:bg-transparent",
|
|
1733
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
1734
|
+
TableHead,
|
|
1735
|
+
{
|
|
1736
|
+
className: "h-11 px-4 font-medium tracking-wider text-[11px] text-muted-foreground uppercase",
|
|
1737
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs(
|
|
1738
|
+
"button",
|
|
1739
|
+
{
|
|
1740
|
+
type: "button",
|
|
1741
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
1742
|
+
className: "gap-1 inline-flex items-center transition-colors hover:text-foreground",
|
|
1743
|
+
children: [
|
|
1744
|
+
flexRender(
|
|
1745
|
+
header.column.columnDef.header,
|
|
1746
|
+
header.getContext()
|
|
1747
|
+
),
|
|
1748
|
+
/* @__PURE__ */ jsx(ArrowUpDown, { className: "size-3 opacity-50" })
|
|
1749
|
+
]
|
|
1750
|
+
}
|
|
1751
|
+
) : flexRender(
|
|
1752
|
+
header.column.columnDef.header,
|
|
1753
|
+
header.getContext()
|
|
1754
|
+
)
|
|
1755
|
+
},
|
|
1756
|
+
header.id
|
|
1757
|
+
))
|
|
1758
|
+
},
|
|
1759
|
+
headerGroup.id
|
|
1760
|
+
)) }),
|
|
1761
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows.length ? table.getRowModel().rows.map(
|
|
1762
|
+
(row) => renderRow ? renderRow(row) : /* @__PURE__ */ jsx(
|
|
1763
|
+
TableRow,
|
|
1764
|
+
{
|
|
1765
|
+
onClick: onRowClick ? () => onRowClick(row.original) : void 0,
|
|
1766
|
+
"data-active": isRowActive?.(row.original) || void 0,
|
|
1767
|
+
className: cn(
|
|
1768
|
+
"border-border transition-colors hover:bg-muted/50",
|
|
1769
|
+
onRowClick && "cursor-pointer",
|
|
1770
|
+
"data-[active=true]:bg-primary/5"
|
|
1771
|
+
),
|
|
1772
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(
|
|
1773
|
+
TableCell,
|
|
1774
|
+
{
|
|
1775
|
+
className: "px-4 py-3",
|
|
1776
|
+
children: flexRender(
|
|
1777
|
+
cell.column.columnDef.cell,
|
|
1778
|
+
cell.getContext()
|
|
1779
|
+
)
|
|
1780
|
+
},
|
|
1781
|
+
cell.id
|
|
1782
|
+
))
|
|
1783
|
+
},
|
|
1784
|
+
row.id
|
|
1785
|
+
)
|
|
1786
|
+
) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
1787
|
+
TableCell,
|
|
1788
|
+
{
|
|
1789
|
+
colSpan: tableColumns.length,
|
|
1790
|
+
className: "h-24 text-sm font-medium text-center text-muted-foreground italic",
|
|
1791
|
+
children: emptyLabel
|
|
1792
|
+
}
|
|
1793
|
+
) }) })
|
|
1794
|
+
] }),
|
|
1795
|
+
showFooter && /* @__PURE__ */ jsxs("div", { className: "gap-3 pt-4 flex flex-wrap items-center justify-between border-t border-border", children: [
|
|
1796
|
+
/* @__PURE__ */ jsxs("div", { className: "gap-3 flex items-center", children: [
|
|
1797
|
+
/* @__PURE__ */ jsxs(
|
|
1798
|
+
Select,
|
|
1799
|
+
{
|
|
1800
|
+
value: String(activePageSize),
|
|
1801
|
+
onValueChange: (value) => changePageSize(Number(value)),
|
|
1802
|
+
children: [
|
|
1803
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-9 rounded-xl w-[74px]", children: /* @__PURE__ */ jsx("span", { children: activePageSize }) }),
|
|
1804
|
+
/* @__PURE__ */ jsx(SelectContent, { className: "rounded-xl", children: sizeChoices.map((size) => /* @__PURE__ */ jsx(
|
|
1805
|
+
SelectItem,
|
|
1806
|
+
{
|
|
1807
|
+
value: String(size),
|
|
1808
|
+
className: "font-medium",
|
|
1809
|
+
children: size
|
|
1810
|
+
},
|
|
1811
|
+
size
|
|
1812
|
+
)) })
|
|
1813
|
+
]
|
|
1814
|
+
}
|
|
1815
|
+
),
|
|
1816
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
1817
|
+
paginationLabel(currentPage, lastPage),
|
|
1818
|
+
total !== void 0 && ` \xB7 ${totalLabel(total)}`
|
|
1819
|
+
] })
|
|
1820
|
+
] }),
|
|
1821
|
+
/* @__PURE__ */ jsxs("div", { className: "gap-1.5 flex items-center", children: [
|
|
1822
|
+
/* @__PURE__ */ jsx(
|
|
1823
|
+
Button,
|
|
1824
|
+
{
|
|
1825
|
+
variant: "outline",
|
|
1826
|
+
size: "icon",
|
|
1827
|
+
className: "size-9 rounded-xl",
|
|
1828
|
+
onClick: prev,
|
|
1829
|
+
disabled: !canPrev,
|
|
1830
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
pageRange(currentPage, lastPage).map(
|
|
1834
|
+
(page, index) => page === "ellipsis" ? /* @__PURE__ */ jsx(
|
|
1835
|
+
"span",
|
|
1836
|
+
{
|
|
1837
|
+
className: "px-1 text-sm font-medium text-muted-foreground",
|
|
1838
|
+
children: "\u2026"
|
|
1839
|
+
},
|
|
1840
|
+
`ellipsis-${index}`
|
|
1841
|
+
) : /* @__PURE__ */ jsx(
|
|
1842
|
+
Button,
|
|
1843
|
+
{
|
|
1844
|
+
variant: "outline",
|
|
1845
|
+
onClick: () => goTo(page),
|
|
1846
|
+
className: cn(
|
|
1847
|
+
"h-9 min-w-9 rounded-xl px-2.5 tabular-nums",
|
|
1848
|
+
page === currentPage && "border-primary bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1849
|
+
),
|
|
1850
|
+
children: page
|
|
1851
|
+
},
|
|
1852
|
+
page
|
|
1853
|
+
)
|
|
1854
|
+
),
|
|
1855
|
+
/* @__PURE__ */ jsx(
|
|
1856
|
+
Button,
|
|
1857
|
+
{
|
|
1858
|
+
variant: "outline",
|
|
1859
|
+
size: "icon",
|
|
1860
|
+
className: "size-9 rounded-xl",
|
|
1861
|
+
onClick: next,
|
|
1862
|
+
disabled: !canNext,
|
|
1863
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
1864
|
+
}
|
|
1865
|
+
)
|
|
1866
|
+
] })
|
|
1867
|
+
] })
|
|
1868
|
+
]
|
|
1869
|
+
}
|
|
1870
|
+
);
|
|
1871
|
+
}
|
|
1872
|
+
function parse(value) {
|
|
1873
|
+
return value ? /* @__PURE__ */ new Date(`${value}T00:00:00`) : void 0;
|
|
1874
|
+
}
|
|
1875
|
+
function DateRangeFilter({
|
|
1876
|
+
from,
|
|
1877
|
+
to,
|
|
1878
|
+
onChange,
|
|
1879
|
+
emptyLabel = "Date range",
|
|
1880
|
+
dateFormat = "dd MMM yy"
|
|
1881
|
+
}) {
|
|
1882
|
+
const [open, setOpen] = useState(false);
|
|
1883
|
+
const selected = from || to ? { from: parse(from), to: parse(to) } : void 0;
|
|
1884
|
+
const label = from ? to && to !== from ? `${format(parse(from), dateFormat)} - ${format(parse(to), dateFormat)}` : format(parse(from), dateFormat) : emptyLabel;
|
|
1885
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
1886
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1887
|
+
Button,
|
|
1888
|
+
{
|
|
1889
|
+
variant: "outline",
|
|
1890
|
+
"data-slot": "date-range-filter",
|
|
1891
|
+
className: "h-11 rounded-2xl cursor-pointer border-dashed border-border",
|
|
1892
|
+
children: [
|
|
1893
|
+
/* @__PURE__ */ jsx(CalendarRange, { className: "mr-2 size-4" }),
|
|
1894
|
+
label,
|
|
1895
|
+
(from || to) && /* @__PURE__ */ jsx(
|
|
1896
|
+
"span",
|
|
1897
|
+
{
|
|
1898
|
+
role: "button",
|
|
1899
|
+
tabIndex: 0,
|
|
1900
|
+
onClick: (event) => {
|
|
1901
|
+
event.stopPropagation();
|
|
1902
|
+
onChange({ from: void 0, to: void 0 });
|
|
1903
|
+
},
|
|
1904
|
+
className: "ml-2 inline-flex",
|
|
1905
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5 opacity-60 hover:opacity-100" })
|
|
1906
|
+
}
|
|
1907
|
+
)
|
|
1908
|
+
]
|
|
1909
|
+
}
|
|
1910
|
+
) }),
|
|
1911
|
+
/* @__PURE__ */ jsx(
|
|
1912
|
+
PopoverContent,
|
|
1913
|
+
{
|
|
1914
|
+
className: "p-2 w-auto",
|
|
1915
|
+
align: "end",
|
|
1916
|
+
sideOffset: 4,
|
|
1917
|
+
collisionPadding: 16,
|
|
1918
|
+
children: /* @__PURE__ */ jsx(
|
|
1919
|
+
Calendar,
|
|
1920
|
+
{
|
|
1921
|
+
mode: "range",
|
|
1922
|
+
numberOfMonths: 2,
|
|
1923
|
+
defaultMonth: parse(from),
|
|
1924
|
+
selected,
|
|
1925
|
+
onSelect: (range) => onChange({
|
|
1926
|
+
from: range?.from ? format(range.from, "yyyy-MM-dd") : void 0,
|
|
1927
|
+
to: range?.to ? format(range.to, "yyyy-MM-dd") : void 0
|
|
1928
|
+
}),
|
|
1929
|
+
className: "rounded-2xl bg-transparent"
|
|
1930
|
+
}
|
|
1931
|
+
)
|
|
1932
|
+
}
|
|
1933
|
+
)
|
|
1934
|
+
] });
|
|
1935
|
+
}
|
|
1936
|
+
function Drawer({
|
|
1937
|
+
...props
|
|
1938
|
+
}) {
|
|
1939
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, { "data-slot": "drawer", ...props });
|
|
1940
|
+
}
|
|
1941
|
+
function DrawerTrigger({
|
|
1942
|
+
...props
|
|
1943
|
+
}) {
|
|
1944
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
1945
|
+
}
|
|
1946
|
+
function DrawerPortal({
|
|
1947
|
+
...props
|
|
1948
|
+
}) {
|
|
1949
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
|
|
1950
|
+
}
|
|
1951
|
+
function DrawerClose({
|
|
1952
|
+
...props
|
|
1953
|
+
}) {
|
|
1954
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
|
|
1955
|
+
}
|
|
1956
|
+
function DrawerOverlay({
|
|
1957
|
+
className,
|
|
1958
|
+
...props
|
|
1959
|
+
}) {
|
|
1960
|
+
return /* @__PURE__ */ jsx(
|
|
1961
|
+
Drawer$1.Overlay,
|
|
1962
|
+
{
|
|
1963
|
+
"data-slot": "drawer-overlay",
|
|
1964
|
+
className: cn(
|
|
1965
|
+
"inset-0 bg-black/60 backdrop-blur-sm data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed z-50",
|
|
1966
|
+
className
|
|
1967
|
+
),
|
|
1968
|
+
...props
|
|
1969
|
+
}
|
|
1970
|
+
);
|
|
1971
|
+
}
|
|
1972
|
+
function DrawerContent({
|
|
1973
|
+
className,
|
|
1974
|
+
children,
|
|
1975
|
+
...props
|
|
1976
|
+
}) {
|
|
1977
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
1978
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
1979
|
+
/* @__PURE__ */ jsxs(
|
|
1980
|
+
Drawer$1.Content,
|
|
1981
|
+
{
|
|
1982
|
+
"data-slot": "drawer-content",
|
|
1983
|
+
className: cn(
|
|
1984
|
+
`${floatingSurface} group/drawer-content fixed z-50 flex h-auto flex-col border-border`,
|
|
1985
|
+
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-3xl data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:border-b",
|
|
1986
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-3xl data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:border-t",
|
|
1987
|
+
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:sm:max-w-sm data-[vaul-drawer-direction=right]:rounded-l-3xl data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l",
|
|
1988
|
+
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=left]:rounded-r-3xl data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r",
|
|
1989
|
+
className
|
|
1990
|
+
),
|
|
1991
|
+
...props,
|
|
1992
|
+
children: [
|
|
1993
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 h-2 mx-auto hidden w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
1994
|
+
children
|
|
1995
|
+
]
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
] });
|
|
1999
|
+
}
|
|
2000
|
+
function DrawerHeader({ className, ...props }) {
|
|
2001
|
+
return /* @__PURE__ */ jsx(
|
|
2002
|
+
"div",
|
|
2003
|
+
{
|
|
2004
|
+
"data-slot": "drawer-header",
|
|
2005
|
+
className: cn(
|
|
2006
|
+
"gap-0.5 p-4 md:gap-1.5 md:text-left flex flex-col group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center",
|
|
2007
|
+
className
|
|
2008
|
+
),
|
|
2009
|
+
...props
|
|
2010
|
+
}
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
2013
|
+
function DrawerFooter({ className, ...props }) {
|
|
2014
|
+
return /* @__PURE__ */ jsx(
|
|
2015
|
+
"div",
|
|
2016
|
+
{
|
|
2017
|
+
"data-slot": "drawer-footer",
|
|
2018
|
+
className: cn("gap-2 p-4 mt-auto flex flex-col", className),
|
|
2019
|
+
...props
|
|
2020
|
+
}
|
|
2021
|
+
);
|
|
2022
|
+
}
|
|
2023
|
+
function DrawerTitle({
|
|
2024
|
+
className,
|
|
2025
|
+
...props
|
|
2026
|
+
}) {
|
|
2027
|
+
return /* @__PURE__ */ jsx(
|
|
2028
|
+
Drawer$1.Title,
|
|
2029
|
+
{
|
|
2030
|
+
"data-slot": "drawer-title",
|
|
2031
|
+
className: cn("font-semibold text-foreground", className),
|
|
2032
|
+
...props
|
|
2033
|
+
}
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
function DrawerDescription({
|
|
2037
|
+
className,
|
|
2038
|
+
...props
|
|
2039
|
+
}) {
|
|
2040
|
+
return /* @__PURE__ */ jsx(
|
|
2041
|
+
Drawer$1.Description,
|
|
2042
|
+
{
|
|
2043
|
+
"data-slot": "drawer-description",
|
|
2044
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
2045
|
+
...props
|
|
2046
|
+
}
|
|
2047
|
+
);
|
|
2048
|
+
}
|
|
2049
|
+
function FieldError({ message }) {
|
|
2050
|
+
if (!message) {
|
|
2051
|
+
return null;
|
|
2052
|
+
}
|
|
2053
|
+
return /* @__PURE__ */ jsx(
|
|
2054
|
+
"p",
|
|
2055
|
+
{
|
|
2056
|
+
className: "ml-1 text-xs font-medium text-destructive",
|
|
2057
|
+
"data-slot": "field-error",
|
|
2058
|
+
children: message
|
|
2059
|
+
}
|
|
2060
|
+
);
|
|
2061
|
+
}
|
|
2062
|
+
var Form = FormProvider;
|
|
2063
|
+
var FormFieldContext = React2.createContext(
|
|
2064
|
+
{}
|
|
2065
|
+
);
|
|
2066
|
+
var FormField = ({
|
|
2067
|
+
...props
|
|
2068
|
+
}) => {
|
|
2069
|
+
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
2070
|
+
};
|
|
2071
|
+
var useFormField = () => {
|
|
2072
|
+
const fieldContext = React2.useContext(FormFieldContext);
|
|
2073
|
+
const itemContext = React2.useContext(FormItemContext);
|
|
2074
|
+
const { getFieldState, formState } = useFormContext();
|
|
2075
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
2076
|
+
if (!fieldContext) {
|
|
2077
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
2078
|
+
}
|
|
2079
|
+
const { id } = itemContext;
|
|
2080
|
+
return {
|
|
2081
|
+
id,
|
|
2082
|
+
name: fieldContext.name,
|
|
2083
|
+
formItemId: `${id}-form-item`,
|
|
2084
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
2085
|
+
formMessageId: `${id}-form-item-message`,
|
|
2086
|
+
...fieldState
|
|
2087
|
+
};
|
|
2088
|
+
};
|
|
2089
|
+
var FormItemContext = React2.createContext(
|
|
2090
|
+
{}
|
|
2091
|
+
);
|
|
2092
|
+
var FormItem = React2.forwardRef(({ className, ...props }, ref) => {
|
|
2093
|
+
const id = React2.useId();
|
|
2094
|
+
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
|
|
2095
|
+
"div",
|
|
2096
|
+
{
|
|
2097
|
+
ref,
|
|
2098
|
+
className: cn("space-y-2", className),
|
|
2099
|
+
"data-slot": "form-item",
|
|
2100
|
+
...props
|
|
2101
|
+
}
|
|
2102
|
+
) });
|
|
2103
|
+
});
|
|
2104
|
+
FormItem.displayName = "FormItem";
|
|
2105
|
+
var FormLabel = React2.forwardRef(({ className, ...props }, ref) => {
|
|
2106
|
+
const { error, formItemId } = useFormField();
|
|
2107
|
+
return /* @__PURE__ */ jsx(
|
|
2108
|
+
Label,
|
|
2109
|
+
{
|
|
2110
|
+
ref,
|
|
2111
|
+
className: cn(error && "text-destructive", className),
|
|
2112
|
+
htmlFor: formItemId,
|
|
2113
|
+
...props
|
|
2114
|
+
}
|
|
2115
|
+
);
|
|
2116
|
+
});
|
|
2117
|
+
FormLabel.displayName = "FormLabel";
|
|
2118
|
+
var FormControl = React2.forwardRef(({ ...props }, ref) => {
|
|
2119
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
2120
|
+
return /* @__PURE__ */ jsx(
|
|
2121
|
+
Slot,
|
|
2122
|
+
{
|
|
2123
|
+
ref,
|
|
2124
|
+
id: formItemId,
|
|
2125
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
2126
|
+
"aria-invalid": !!error,
|
|
2127
|
+
...props
|
|
2128
|
+
}
|
|
2129
|
+
);
|
|
2130
|
+
});
|
|
2131
|
+
FormControl.displayName = "FormControl";
|
|
2132
|
+
var FormDescription = React2.forwardRef(({ className, ...props }, ref) => {
|
|
2133
|
+
const { formDescriptionId } = useFormField();
|
|
2134
|
+
return /* @__PURE__ */ jsx(
|
|
2135
|
+
"p",
|
|
2136
|
+
{
|
|
2137
|
+
ref,
|
|
2138
|
+
id: formDescriptionId,
|
|
2139
|
+
className: cn("text-[0.8rem] text-muted-foreground", className),
|
|
2140
|
+
...props
|
|
2141
|
+
}
|
|
2142
|
+
);
|
|
2143
|
+
});
|
|
2144
|
+
FormDescription.displayName = "FormDescription";
|
|
2145
|
+
var FormMessage = React2.forwardRef(({ className, children, ...props }, ref) => {
|
|
2146
|
+
const { error, formMessageId } = useFormField();
|
|
2147
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
2148
|
+
if (!body) {
|
|
2149
|
+
return null;
|
|
2150
|
+
}
|
|
2151
|
+
return /* @__PURE__ */ jsx(
|
|
2152
|
+
"p",
|
|
2153
|
+
{
|
|
2154
|
+
ref,
|
|
2155
|
+
id: formMessageId,
|
|
2156
|
+
className: cn(
|
|
2157
|
+
"font-medium text-[0.8rem] text-destructive",
|
|
2158
|
+
className
|
|
2159
|
+
),
|
|
2160
|
+
...props,
|
|
2161
|
+
children: body
|
|
2162
|
+
}
|
|
2163
|
+
);
|
|
2164
|
+
});
|
|
2165
|
+
FormMessage.displayName = "FormMessage";
|
|
2166
|
+
function HoverCard({
|
|
2167
|
+
...props
|
|
2168
|
+
}) {
|
|
2169
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Root, { "data-slot": "hover-card", ...props });
|
|
2170
|
+
}
|
|
2171
|
+
function HoverCardTrigger({
|
|
2172
|
+
...props
|
|
2173
|
+
}) {
|
|
2174
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
2175
|
+
}
|
|
2176
|
+
function HoverCardContent({
|
|
2177
|
+
className,
|
|
2178
|
+
align = "center",
|
|
2179
|
+
sideOffset = 4,
|
|
2180
|
+
...props
|
|
2181
|
+
}) {
|
|
2182
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
|
|
2183
|
+
HoverCard$1.Content,
|
|
2184
|
+
{
|
|
2185
|
+
"data-slot": "hover-card-content",
|
|
2186
|
+
align,
|
|
2187
|
+
sideOffset,
|
|
2188
|
+
className: cn(
|
|
2189
|
+
`${panelSurface} w-64 p-4 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 origin-(--radix-hover-card-content-transform-origin) bg-popover/90 outline-hidden`,
|
|
2190
|
+
className
|
|
2191
|
+
),
|
|
2192
|
+
...props
|
|
2193
|
+
}
|
|
2194
|
+
) });
|
|
2195
|
+
}
|
|
2196
|
+
var InputOTP = React2.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2197
|
+
OTPInput,
|
|
2198
|
+
{
|
|
2199
|
+
ref,
|
|
2200
|
+
containerClassName: cn(
|
|
2201
|
+
"gap-2 flex items-center has-[:disabled]:opacity-50",
|
|
2202
|
+
containerClassName
|
|
2203
|
+
),
|
|
2204
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
2205
|
+
...props
|
|
2206
|
+
}
|
|
2207
|
+
));
|
|
2208
|
+
InputOTP.displayName = "InputOTP";
|
|
2209
|
+
var InputOTPGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
2210
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
2211
|
+
var InputOTPSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
|
|
2212
|
+
const inputOTPContext = React2.useContext(OTPInputContext);
|
|
2213
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
2214
|
+
return /* @__PURE__ */ jsxs(
|
|
2215
|
+
"div",
|
|
2216
|
+
{
|
|
2217
|
+
ref,
|
|
2218
|
+
"data-slot": "input-otp-slot",
|
|
2219
|
+
className: cn(
|
|
2220
|
+
glassControl,
|
|
2221
|
+
controlFill,
|
|
2222
|
+
"size-11 text-sm font-medium first:rounded-l-2xl last:rounded-r-2xl relative flex items-center justify-center rounded-none transition-all",
|
|
2223
|
+
isActive && "z-10 ring-[3px] ring-ring/50",
|
|
2224
|
+
className
|
|
2225
|
+
),
|
|
2226
|
+
...props,
|
|
2227
|
+
children: [
|
|
2228
|
+
char,
|
|
2229
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "inset-0 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 animate-caret-blink w-px bg-foreground duration-1000" }) })
|
|
2230
|
+
]
|
|
2231
|
+
}
|
|
2232
|
+
);
|
|
2233
|
+
});
|
|
2234
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
2235
|
+
var InputOTPSeparator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, {}) }));
|
|
2236
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
2237
|
+
function Menubar({
|
|
2238
|
+
className,
|
|
2239
|
+
...props
|
|
2240
|
+
}) {
|
|
2241
|
+
return /* @__PURE__ */ jsx(
|
|
2242
|
+
Menubar$1.Root,
|
|
2243
|
+
{
|
|
2244
|
+
"data-slot": "menubar",
|
|
2245
|
+
className: cn(
|
|
2246
|
+
"h-9 gap-1 p-1 shadow-sm backdrop-blur-xl rounded-2xl flex items-center border border-border bg-card/60",
|
|
2247
|
+
className
|
|
2248
|
+
),
|
|
2249
|
+
...props
|
|
2250
|
+
}
|
|
2251
|
+
);
|
|
2252
|
+
}
|
|
2253
|
+
function MenubarMenu({
|
|
2254
|
+
...props
|
|
2255
|
+
}) {
|
|
2256
|
+
return /* @__PURE__ */ jsx(Menubar$1.Menu, { "data-slot": "menubar-menu", ...props });
|
|
2257
|
+
}
|
|
2258
|
+
function MenubarGroup({
|
|
2259
|
+
...props
|
|
2260
|
+
}) {
|
|
2261
|
+
return /* @__PURE__ */ jsx(Menubar$1.Group, { "data-slot": "menubar-group", ...props });
|
|
2262
|
+
}
|
|
2263
|
+
function MenubarPortal({
|
|
2264
|
+
...props
|
|
2265
|
+
}) {
|
|
2266
|
+
return /* @__PURE__ */ jsx(Menubar$1.Portal, { "data-slot": "menubar-portal", ...props });
|
|
2267
|
+
}
|
|
2268
|
+
function MenubarRadioGroup({
|
|
2269
|
+
...props
|
|
2270
|
+
}) {
|
|
2271
|
+
return /* @__PURE__ */ jsx(
|
|
2272
|
+
Menubar$1.RadioGroup,
|
|
2273
|
+
{
|
|
2274
|
+
"data-slot": "menubar-radio-group",
|
|
2275
|
+
...props
|
|
2276
|
+
}
|
|
2277
|
+
);
|
|
2278
|
+
}
|
|
2279
|
+
function MenubarTrigger({
|
|
2280
|
+
className,
|
|
2281
|
+
...props
|
|
2282
|
+
}) {
|
|
2283
|
+
return /* @__PURE__ */ jsx(
|
|
2284
|
+
Menubar$1.Trigger,
|
|
2285
|
+
{
|
|
2286
|
+
"data-slot": "menubar-trigger",
|
|
2287
|
+
className: cn(
|
|
2288
|
+
"px-2 py-1 text-sm font-medium rounded-xl flex items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
2289
|
+
className
|
|
2290
|
+
),
|
|
2291
|
+
...props
|
|
2292
|
+
}
|
|
2293
|
+
);
|
|
2294
|
+
}
|
|
2295
|
+
function MenubarContent({
|
|
2296
|
+
className,
|
|
2297
|
+
align = "start",
|
|
2298
|
+
alignOffset = -4,
|
|
2299
|
+
sideOffset = 8,
|
|
2300
|
+
...props
|
|
2301
|
+
}) {
|
|
2302
|
+
return /* @__PURE__ */ jsx(MenubarPortal, { children: /* @__PURE__ */ jsx(
|
|
2303
|
+
Menubar$1.Content,
|
|
2304
|
+
{
|
|
2305
|
+
"data-slot": "menubar-content",
|
|
2306
|
+
align,
|
|
2307
|
+
alignOffset,
|
|
2308
|
+
sideOffset,
|
|
2309
|
+
className: cn(
|
|
2310
|
+
`${menuSurface} p-1.5 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 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden`,
|
|
2311
|
+
className
|
|
2312
|
+
),
|
|
2313
|
+
...props
|
|
2314
|
+
}
|
|
2315
|
+
) });
|
|
2316
|
+
}
|
|
2317
|
+
function MenubarItem({
|
|
2318
|
+
className,
|
|
2319
|
+
inset,
|
|
2320
|
+
variant = "default",
|
|
2321
|
+
...props
|
|
2322
|
+
}) {
|
|
2323
|
+
return /* @__PURE__ */ jsx(
|
|
2324
|
+
Menubar$1.Item,
|
|
2325
|
+
{
|
|
2326
|
+
"data-slot": "menubar-item",
|
|
2327
|
+
"data-inset": inset,
|
|
2328
|
+
"data-variant": variant,
|
|
2329
|
+
className: cn(
|
|
2330
|
+
"gap-2 px-2 py-1.5 text-sm data-[inset]:pl-8 [&_svg:not([class*='size-'])]:size-4 rounded-xl relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
2331
|
+
className
|
|
2332
|
+
),
|
|
2333
|
+
...props
|
|
2334
|
+
}
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
function MenubarCheckboxItem({
|
|
2338
|
+
className,
|
|
2339
|
+
children,
|
|
2340
|
+
checked,
|
|
2341
|
+
...props
|
|
2342
|
+
}) {
|
|
2343
|
+
return /* @__PURE__ */ jsxs(
|
|
2344
|
+
Menubar$1.CheckboxItem,
|
|
2345
|
+
{
|
|
2346
|
+
"data-slot": "menubar-checkbox-item",
|
|
2347
|
+
className: cn(
|
|
2348
|
+
"gap-2 rounded-xl py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2349
|
+
className
|
|
2350
|
+
),
|
|
2351
|
+
checked,
|
|
2352
|
+
...props,
|
|
2353
|
+
children: [
|
|
2354
|
+
/* @__PURE__ */ jsx("span", { className: "left-2 size-3.5 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx(Menubar$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
2355
|
+
children
|
|
2356
|
+
]
|
|
2357
|
+
}
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
function MenubarRadioItem({
|
|
2361
|
+
className,
|
|
2362
|
+
children,
|
|
2363
|
+
...props
|
|
2364
|
+
}) {
|
|
2365
|
+
return /* @__PURE__ */ jsxs(
|
|
2366
|
+
Menubar$1.RadioItem,
|
|
2367
|
+
{
|
|
2368
|
+
"data-slot": "menubar-radio-item",
|
|
2369
|
+
className: cn(
|
|
2370
|
+
"gap-2 rounded-xl py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2371
|
+
className
|
|
2372
|
+
),
|
|
2373
|
+
...props,
|
|
2374
|
+
children: [
|
|
2375
|
+
/* @__PURE__ */ jsx("span", { className: "left-2 size-3.5 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx(Menubar$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
2376
|
+
children
|
|
2377
|
+
]
|
|
2378
|
+
}
|
|
2379
|
+
);
|
|
2380
|
+
}
|
|
2381
|
+
function MenubarLabel({
|
|
2382
|
+
className,
|
|
2383
|
+
inset,
|
|
2384
|
+
...props
|
|
2385
|
+
}) {
|
|
2386
|
+
return /* @__PURE__ */ jsx(
|
|
2387
|
+
Menubar$1.Label,
|
|
2388
|
+
{
|
|
2389
|
+
"data-slot": "menubar-label",
|
|
2390
|
+
"data-inset": inset,
|
|
2391
|
+
className: cn(
|
|
2392
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
2393
|
+
className
|
|
2394
|
+
),
|
|
2395
|
+
...props
|
|
2396
|
+
}
|
|
2397
|
+
);
|
|
2398
|
+
}
|
|
2399
|
+
function MenubarSeparator({
|
|
2400
|
+
className,
|
|
2401
|
+
...props
|
|
2402
|
+
}) {
|
|
2403
|
+
return /* @__PURE__ */ jsx(
|
|
2404
|
+
Menubar$1.Separator,
|
|
2405
|
+
{
|
|
2406
|
+
"data-slot": "menubar-separator",
|
|
2407
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
2408
|
+
...props
|
|
2409
|
+
}
|
|
2410
|
+
);
|
|
2411
|
+
}
|
|
2412
|
+
function MenubarShortcut({
|
|
2413
|
+
className,
|
|
2414
|
+
...props
|
|
2415
|
+
}) {
|
|
2416
|
+
return /* @__PURE__ */ jsx(
|
|
2417
|
+
"span",
|
|
2418
|
+
{
|
|
2419
|
+
"data-slot": "menubar-shortcut",
|
|
2420
|
+
className: cn(
|
|
2421
|
+
"text-xs tracking-widest ml-auto text-muted-foreground",
|
|
2422
|
+
className
|
|
2423
|
+
),
|
|
2424
|
+
...props
|
|
2425
|
+
}
|
|
2426
|
+
);
|
|
2427
|
+
}
|
|
2428
|
+
function MenubarSub({
|
|
2429
|
+
...props
|
|
2430
|
+
}) {
|
|
2431
|
+
return /* @__PURE__ */ jsx(Menubar$1.Sub, { "data-slot": "menubar-sub", ...props });
|
|
2432
|
+
}
|
|
2433
|
+
function MenubarSubTrigger({
|
|
2434
|
+
className,
|
|
2435
|
+
inset,
|
|
2436
|
+
children,
|
|
2437
|
+
...props
|
|
2438
|
+
}) {
|
|
2439
|
+
return /* @__PURE__ */ jsxs(
|
|
2440
|
+
Menubar$1.SubTrigger,
|
|
2441
|
+
{
|
|
2442
|
+
"data-slot": "menubar-sub-trigger",
|
|
2443
|
+
"data-inset": inset,
|
|
2444
|
+
className: cn(
|
|
2445
|
+
"px-2 py-1.5 text-sm data-[inset]:pl-8 rounded-xl flex cursor-default items-center outline-none select-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
2446
|
+
className
|
|
2447
|
+
),
|
|
2448
|
+
...props,
|
|
2449
|
+
children: [
|
|
2450
|
+
children,
|
|
2451
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-4 w-4 ml-auto" })
|
|
2452
|
+
]
|
|
2453
|
+
}
|
|
2454
|
+
);
|
|
2455
|
+
}
|
|
2456
|
+
function MenubarSubContent({
|
|
2457
|
+
className,
|
|
2458
|
+
...props
|
|
2459
|
+
}) {
|
|
2460
|
+
return /* @__PURE__ */ jsx(
|
|
2461
|
+
Menubar$1.SubContent,
|
|
2462
|
+
{
|
|
2463
|
+
"data-slot": "menubar-sub-content",
|
|
2464
|
+
className: cn(
|
|
2465
|
+
`${menuSurface} p-1.5 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden`,
|
|
2466
|
+
className
|
|
2467
|
+
),
|
|
2468
|
+
...props
|
|
2469
|
+
}
|
|
2470
|
+
);
|
|
2471
|
+
}
|
|
2472
|
+
function NavigationMenu({
|
|
2473
|
+
className,
|
|
2474
|
+
children,
|
|
2475
|
+
viewport = true,
|
|
2476
|
+
...props
|
|
2477
|
+
}) {
|
|
2478
|
+
return /* @__PURE__ */ jsxs(
|
|
2479
|
+
NavigationMenuPrimitive.Root,
|
|
2480
|
+
{
|
|
2481
|
+
"data-slot": "navigation-menu",
|
|
2482
|
+
"data-viewport": viewport,
|
|
2483
|
+
className: cn(
|
|
2484
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
2485
|
+
className
|
|
2486
|
+
),
|
|
2487
|
+
...props,
|
|
2488
|
+
children: [
|
|
2489
|
+
children,
|
|
2490
|
+
viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})
|
|
2491
|
+
]
|
|
2492
|
+
}
|
|
2493
|
+
);
|
|
2494
|
+
}
|
|
2495
|
+
function NavigationMenuList({
|
|
2496
|
+
className,
|
|
2497
|
+
...props
|
|
2498
|
+
}) {
|
|
2499
|
+
return /* @__PURE__ */ jsx(
|
|
2500
|
+
NavigationMenuPrimitive.List,
|
|
2501
|
+
{
|
|
2502
|
+
"data-slot": "navigation-menu-list",
|
|
2503
|
+
className: cn(
|
|
2504
|
+
"group gap-1 flex flex-1 list-none items-center justify-center",
|
|
2505
|
+
className
|
|
2506
|
+
),
|
|
2507
|
+
...props
|
|
2508
|
+
}
|
|
2509
|
+
);
|
|
2510
|
+
}
|
|
2511
|
+
function NavigationMenuItem({
|
|
2512
|
+
className,
|
|
2513
|
+
...props
|
|
2514
|
+
}) {
|
|
2515
|
+
return /* @__PURE__ */ jsx(
|
|
2516
|
+
NavigationMenuPrimitive.Item,
|
|
2517
|
+
{
|
|
2518
|
+
"data-slot": "navigation-menu-item",
|
|
2519
|
+
className: cn("relative", className),
|
|
2520
|
+
...props
|
|
2521
|
+
}
|
|
2522
|
+
);
|
|
2523
|
+
}
|
|
2524
|
+
var navigationMenuTriggerStyle = cva(
|
|
2525
|
+
"group inline-flex h-11 w-max items-center justify-center rounded-xl bg-background px-4 text-sm font-medium data-[state=open]:font-semibold hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-accent/50 data-[state=open]:bg-accent/50 data-[active=true]:text-accent-foreground transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
2526
|
+
);
|
|
2527
|
+
function NavigationMenuTrigger({
|
|
2528
|
+
className,
|
|
2529
|
+
children,
|
|
2530
|
+
...props
|
|
2531
|
+
}) {
|
|
2532
|
+
return /* @__PURE__ */ jsxs(
|
|
2533
|
+
NavigationMenuPrimitive.Trigger,
|
|
2534
|
+
{
|
|
2535
|
+
"data-slot": "navigation-menu-trigger",
|
|
2536
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
2537
|
+
...props,
|
|
2538
|
+
children: [
|
|
2539
|
+
children,
|
|
2540
|
+
" ",
|
|
2541
|
+
/* @__PURE__ */ jsx(
|
|
2542
|
+
ChevronDownIcon,
|
|
2543
|
+
{
|
|
2544
|
+
className: "ml-1 size-3 relative top-[1px] transition duration-300 group-data-[state=open]:rotate-180",
|
|
2545
|
+
"aria-hidden": "true"
|
|
2546
|
+
}
|
|
2547
|
+
)
|
|
2548
|
+
]
|
|
2549
|
+
}
|
|
2550
|
+
);
|
|
2551
|
+
}
|
|
2552
|
+
function NavigationMenuContent({
|
|
2553
|
+
className,
|
|
2554
|
+
...props
|
|
2555
|
+
}) {
|
|
2556
|
+
return /* @__PURE__ */ jsx(
|
|
2557
|
+
NavigationMenuPrimitive.Content,
|
|
2558
|
+
{
|
|
2559
|
+
"data-slot": "navigation-menu-content",
|
|
2560
|
+
className: cn(
|
|
2561
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 p-2 pr-2.5 md:absolute md:w-auto w-full",
|
|
2562
|
+
"group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:shadow-2xl group-data-[viewport=false]/navigation-menu:backdrop-blur-xl group-data-[viewport=false]/navigation-menu:rounded-2xl group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:border-border group-data-[viewport=false]/navigation-menu:bg-popover/90 group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
|
|
2563
|
+
className
|
|
2564
|
+
),
|
|
2565
|
+
...props
|
|
2566
|
+
}
|
|
2567
|
+
);
|
|
2568
|
+
}
|
|
2569
|
+
function NavigationMenuViewport({
|
|
2570
|
+
className,
|
|
2571
|
+
...props
|
|
2572
|
+
}) {
|
|
2573
|
+
return /* @__PURE__ */ jsx(
|
|
2574
|
+
"div",
|
|
2575
|
+
{
|
|
2576
|
+
className: cn(
|
|
2577
|
+
"left-0 absolute top-full isolate z-50 flex justify-center"
|
|
2578
|
+
),
|
|
2579
|
+
children: /* @__PURE__ */ jsx(
|
|
2580
|
+
NavigationMenuPrimitive.Viewport,
|
|
2581
|
+
{
|
|
2582
|
+
"data-slot": "navigation-menu-viewport",
|
|
2583
|
+
className: cn(
|
|
2584
|
+
`${panelSurface} origin-top-center data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 mt-1.5 md:w-[var(--radix-navigation-menu-viewport-width)] relative h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden bg-popover/90`,
|
|
2585
|
+
className
|
|
2586
|
+
),
|
|
2587
|
+
...props
|
|
2588
|
+
}
|
|
2589
|
+
)
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
}
|
|
2593
|
+
function NavigationMenuLink({
|
|
2594
|
+
className,
|
|
2595
|
+
...props
|
|
2596
|
+
}) {
|
|
2597
|
+
return /* @__PURE__ */ jsx(
|
|
2598
|
+
NavigationMenuPrimitive.Link,
|
|
2599
|
+
{
|
|
2600
|
+
"data-slot": "navigation-menu-link",
|
|
2601
|
+
className: cn(
|
|
2602
|
+
"gap-1 p-2 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl data-[active=true]:font-semibold flex flex-col transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
2603
|
+
className
|
|
2604
|
+
),
|
|
2605
|
+
...props
|
|
2606
|
+
}
|
|
2607
|
+
);
|
|
2608
|
+
}
|
|
2609
|
+
function NavigationMenuIndicator({
|
|
2610
|
+
className,
|
|
2611
|
+
...props
|
|
2612
|
+
}) {
|
|
2613
|
+
return /* @__PURE__ */ jsx(
|
|
2614
|
+
NavigationMenuPrimitive.Indicator,
|
|
2615
|
+
{
|
|
2616
|
+
"data-slot": "navigation-menu-indicator",
|
|
2617
|
+
className: cn(
|
|
2618
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in h-1.5 top-full z-[1] flex items-end justify-center overflow-hidden",
|
|
2619
|
+
className
|
|
2620
|
+
),
|
|
2621
|
+
...props,
|
|
2622
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-2 w-2 shadow-md rounded-tl-xs relative top-[60%] rotate-45 bg-border" })
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2626
|
+
function Pagination({ className, ...props }) {
|
|
2627
|
+
return /* @__PURE__ */ jsx(
|
|
2628
|
+
"nav",
|
|
2629
|
+
{
|
|
2630
|
+
role: "navigation",
|
|
2631
|
+
"aria-label": "pagination",
|
|
2632
|
+
"data-slot": "pagination",
|
|
2633
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
2634
|
+
...props
|
|
2635
|
+
}
|
|
2636
|
+
);
|
|
2637
|
+
}
|
|
2638
|
+
function PaginationContent({
|
|
2639
|
+
className,
|
|
2640
|
+
...props
|
|
2641
|
+
}) {
|
|
2642
|
+
return /* @__PURE__ */ jsx(
|
|
2643
|
+
"ul",
|
|
2644
|
+
{
|
|
2645
|
+
"data-slot": "pagination-content",
|
|
2646
|
+
className: cn("gap-1 flex flex-row items-center", className),
|
|
2647
|
+
...props
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
function PaginationItem({ ...props }) {
|
|
2652
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
|
|
2653
|
+
}
|
|
2654
|
+
function PaginationLink({
|
|
2655
|
+
className,
|
|
2656
|
+
isActive,
|
|
2657
|
+
size = "icon",
|
|
2658
|
+
...props
|
|
2659
|
+
}) {
|
|
2660
|
+
return /* @__PURE__ */ jsx(
|
|
2661
|
+
"a",
|
|
2662
|
+
{
|
|
2663
|
+
"aria-current": isActive ? "page" : void 0,
|
|
2664
|
+
"data-slot": "pagination-link",
|
|
2665
|
+
"data-active": isActive,
|
|
2666
|
+
className: cn(
|
|
2667
|
+
buttonVariants({
|
|
2668
|
+
variant: isActive ? "outline" : "ghost",
|
|
2669
|
+
size
|
|
2670
|
+
}),
|
|
2671
|
+
className
|
|
2672
|
+
),
|
|
2673
|
+
...props
|
|
2674
|
+
}
|
|
2675
|
+
);
|
|
2676
|
+
}
|
|
2677
|
+
function PaginationPrevious({
|
|
2678
|
+
className,
|
|
2679
|
+
...props
|
|
2680
|
+
}) {
|
|
2681
|
+
return /* @__PURE__ */ jsxs(
|
|
2682
|
+
PaginationLink,
|
|
2683
|
+
{
|
|
2684
|
+
"aria-label": "Go to previous page",
|
|
2685
|
+
size: "default",
|
|
2686
|
+
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
2687
|
+
...props,
|
|
2688
|
+
children: [
|
|
2689
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
2690
|
+
/* @__PURE__ */ jsx("span", { className: "sm:block hidden", children: "Previous" })
|
|
2691
|
+
]
|
|
2692
|
+
}
|
|
2693
|
+
);
|
|
2694
|
+
}
|
|
2695
|
+
function PaginationNext({
|
|
2696
|
+
className,
|
|
2697
|
+
...props
|
|
2698
|
+
}) {
|
|
2699
|
+
return /* @__PURE__ */ jsxs(
|
|
2700
|
+
PaginationLink,
|
|
2701
|
+
{
|
|
2702
|
+
"aria-label": "Go to next page",
|
|
2703
|
+
size: "default",
|
|
2704
|
+
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
2705
|
+
...props,
|
|
2706
|
+
children: [
|
|
2707
|
+
/* @__PURE__ */ jsx("span", { className: "sm:block hidden", children: "Next" }),
|
|
2708
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
2709
|
+
]
|
|
2710
|
+
}
|
|
2711
|
+
);
|
|
2712
|
+
}
|
|
2713
|
+
function PaginationEllipsis({
|
|
2714
|
+
className,
|
|
2715
|
+
...props
|
|
2716
|
+
}) {
|
|
2717
|
+
return /* @__PURE__ */ jsxs(
|
|
2718
|
+
"span",
|
|
2719
|
+
{
|
|
2720
|
+
"aria-hidden": true,
|
|
2721
|
+
"data-slot": "pagination-ellipsis",
|
|
2722
|
+
className: cn(
|
|
2723
|
+
"size-9 rounded-xl flex items-center justify-center",
|
|
2724
|
+
className
|
|
2725
|
+
),
|
|
2726
|
+
...props,
|
|
2727
|
+
children: [
|
|
2728
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
|
|
2729
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
2730
|
+
]
|
|
2731
|
+
}
|
|
2732
|
+
);
|
|
2733
|
+
}
|
|
2734
|
+
function PlaceholderPattern({ className }) {
|
|
2735
|
+
const patternId = useId();
|
|
2736
|
+
return /* @__PURE__ */ jsxs("svg", { "data-slot": "placeholder-pattern", className, fill: "none", children: [
|
|
2737
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
2738
|
+
"pattern",
|
|
2739
|
+
{
|
|
2740
|
+
id: patternId,
|
|
2741
|
+
x: "0",
|
|
2742
|
+
y: "0",
|
|
2743
|
+
width: "10",
|
|
2744
|
+
height: "10",
|
|
2745
|
+
patternUnits: "userSpaceOnUse",
|
|
2746
|
+
children: /* @__PURE__ */ jsx(
|
|
2747
|
+
"path",
|
|
2748
|
+
{
|
|
2749
|
+
d: "M-3 13 15-5M-5 5l18-18M-1 21 17 3",
|
|
2750
|
+
stroke: "currentColor"
|
|
2751
|
+
}
|
|
2752
|
+
)
|
|
2753
|
+
}
|
|
2754
|
+
) }),
|
|
2755
|
+
/* @__PURE__ */ jsx(
|
|
2756
|
+
"rect",
|
|
2757
|
+
{
|
|
2758
|
+
stroke: "none",
|
|
2759
|
+
fill: `url(#${patternId})`,
|
|
2760
|
+
width: "100%",
|
|
2761
|
+
height: "100%"
|
|
2762
|
+
}
|
|
2763
|
+
)
|
|
2764
|
+
] });
|
|
2765
|
+
}
|
|
2766
|
+
function Progress({
|
|
2767
|
+
className,
|
|
2768
|
+
value,
|
|
2769
|
+
...props
|
|
2770
|
+
}) {
|
|
2771
|
+
return /* @__PURE__ */ jsx(
|
|
2772
|
+
Progress$1.Root,
|
|
2773
|
+
{
|
|
2774
|
+
"data-slot": "progress",
|
|
2775
|
+
className: cn(
|
|
2776
|
+
"h-2 relative w-full overflow-hidden rounded-full bg-primary/20",
|
|
2777
|
+
className
|
|
2778
|
+
),
|
|
2779
|
+
...props,
|
|
2780
|
+
children: /* @__PURE__ */ jsx(
|
|
2781
|
+
Progress$1.Indicator,
|
|
2782
|
+
{
|
|
2783
|
+
"data-slot": "progress-indicator",
|
|
2784
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
2785
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
2786
|
+
}
|
|
2787
|
+
)
|
|
2788
|
+
}
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
function RadioGroup({
|
|
2792
|
+
className,
|
|
2793
|
+
...props
|
|
2794
|
+
}) {
|
|
2795
|
+
return /* @__PURE__ */ jsx(
|
|
2796
|
+
RadioGroup$1.Root,
|
|
2797
|
+
{
|
|
2798
|
+
"data-slot": "radio-group",
|
|
2799
|
+
className: cn("gap-3 grid", className),
|
|
2800
|
+
...props
|
|
2801
|
+
}
|
|
2802
|
+
);
|
|
2803
|
+
}
|
|
2804
|
+
function RadioGroupItem({
|
|
2805
|
+
className,
|
|
2806
|
+
...props
|
|
2807
|
+
}) {
|
|
2808
|
+
return /* @__PURE__ */ jsx(
|
|
2809
|
+
RadioGroup$1.Item,
|
|
2810
|
+
{
|
|
2811
|
+
"data-slot": "radio-group-item",
|
|
2812
|
+
className: cn(
|
|
2813
|
+
`size-5 shadow-xs aspect-square shrink-0 rounded-full border border-border text-primary transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 ${focusRing}`,
|
|
2814
|
+
className
|
|
2815
|
+
),
|
|
2816
|
+
...props,
|
|
2817
|
+
children: /* @__PURE__ */ jsx(
|
|
2818
|
+
RadioGroup$1.Indicator,
|
|
2819
|
+
{
|
|
2820
|
+
"data-slot": "radio-group-indicator",
|
|
2821
|
+
className: "relative flex items-center justify-center",
|
|
2822
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2.5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 fill-primary" })
|
|
2823
|
+
}
|
|
2824
|
+
)
|
|
2825
|
+
}
|
|
2826
|
+
);
|
|
2827
|
+
}
|
|
2828
|
+
function ResizablePanelGroup({
|
|
2829
|
+
className,
|
|
2830
|
+
...props
|
|
2831
|
+
}) {
|
|
2832
|
+
return /* @__PURE__ */ jsx(
|
|
2833
|
+
ResizablePrimitive.Group,
|
|
2834
|
+
{
|
|
2835
|
+
"data-slot": "resizable-panel-group",
|
|
2836
|
+
className: cn(
|
|
2837
|
+
elevatedSurface,
|
|
2838
|
+
nestedSurfaceReset,
|
|
2839
|
+
"flex h-full w-full overflow-hidden bg-card aria-[orientation=vertical]:flex-col",
|
|
2840
|
+
className
|
|
2841
|
+
),
|
|
2842
|
+
...props
|
|
2843
|
+
}
|
|
2844
|
+
);
|
|
2845
|
+
}
|
|
2846
|
+
function ResizablePanel({ ...props }) {
|
|
2847
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, { "data-slot": "resizable-panel", ...props });
|
|
2848
|
+
}
|
|
2849
|
+
function ResizableHandle({
|
|
2850
|
+
withHandle,
|
|
2851
|
+
className,
|
|
2852
|
+
...props
|
|
2853
|
+
}) {
|
|
2854
|
+
return /* @__PURE__ */ jsx(
|
|
2855
|
+
ResizablePrimitive.Separator,
|
|
2856
|
+
{
|
|
2857
|
+
"data-slot": "resizable-handle",
|
|
2858
|
+
className: cn(
|
|
2859
|
+
"after:inset-y-0 after:w-1 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:translate-x-0 relative flex w-px items-center justify-center bg-border after:absolute after:left-1/2 after:-translate-x-1/2 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
2860
|
+
className
|
|
2861
|
+
),
|
|
2862
|
+
...props,
|
|
2863
|
+
children: withHandle && /* @__PURE__ */ jsx("div", { className: "h-8 w-1.5 z-10 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-muted-foreground/60" })
|
|
2864
|
+
}
|
|
2865
|
+
);
|
|
2866
|
+
}
|
|
2867
|
+
var ScrollArea = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2868
|
+
ScrollAreaPrimitive.Root,
|
|
2869
|
+
{
|
|
2870
|
+
"data-slot": "scroll-area",
|
|
2871
|
+
ref,
|
|
2872
|
+
className: cn(
|
|
2873
|
+
elevatedSurface,
|
|
2874
|
+
nestedSurfaceReset,
|
|
2875
|
+
nestedEdgeToEdge,
|
|
2876
|
+
"relative overflow-hidden bg-card",
|
|
2877
|
+
className
|
|
2878
|
+
),
|
|
2879
|
+
...props,
|
|
2880
|
+
children: [
|
|
2881
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
2882
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
2883
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
2884
|
+
]
|
|
2885
|
+
}
|
|
2886
|
+
));
|
|
2887
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2888
|
+
var ScrollBar = React2.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2889
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2890
|
+
{
|
|
2891
|
+
"data-slot": "scroll-area-scrollbar",
|
|
2892
|
+
ref,
|
|
2893
|
+
orientation,
|
|
2894
|
+
className: cn(
|
|
2895
|
+
"flex touch-none transition-colors select-none",
|
|
2896
|
+
orientation === "vertical" && "w-2.5 h-full border-l border-l-transparent p-[1px]",
|
|
2897
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
2898
|
+
className
|
|
2899
|
+
),
|
|
2900
|
+
...props,
|
|
2901
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
2902
|
+
}
|
|
2903
|
+
));
|
|
2904
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2905
|
+
function Slider({
|
|
2906
|
+
className,
|
|
2907
|
+
defaultValue,
|
|
2908
|
+
value,
|
|
2909
|
+
min = 0,
|
|
2910
|
+
max = 100,
|
|
2911
|
+
...props
|
|
2912
|
+
}) {
|
|
2913
|
+
const _values = React2.useMemo(
|
|
2914
|
+
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
2915
|
+
[value, defaultValue, min, max]
|
|
2916
|
+
);
|
|
2917
|
+
return /* @__PURE__ */ jsxs(
|
|
2918
|
+
Slider$1.Root,
|
|
2919
|
+
{
|
|
2920
|
+
"data-slot": "slider",
|
|
2921
|
+
defaultValue,
|
|
2922
|
+
value,
|
|
2923
|
+
min,
|
|
2924
|
+
max,
|
|
2925
|
+
className: cn(
|
|
2926
|
+
"data-[orientation=vertical]:min-h-44 relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
2927
|
+
className
|
|
2928
|
+
),
|
|
2929
|
+
...props,
|
|
2930
|
+
children: [
|
|
2931
|
+
/* @__PURE__ */ jsx(
|
|
2932
|
+
Slider$1.Track,
|
|
2933
|
+
{
|
|
2934
|
+
"data-slot": "slider-track",
|
|
2935
|
+
className: cn(
|
|
2936
|
+
"data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full"
|
|
2937
|
+
),
|
|
2938
|
+
children: /* @__PURE__ */ jsx(
|
|
2939
|
+
Slider$1.Range,
|
|
2940
|
+
{
|
|
2941
|
+
"data-slot": "slider-range",
|
|
2942
|
+
className: cn(
|
|
2943
|
+
"absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
2944
|
+
)
|
|
2945
|
+
}
|
|
2946
|
+
)
|
|
2947
|
+
}
|
|
2948
|
+
),
|
|
2949
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
2950
|
+
Slider$1.Thumb,
|
|
2951
|
+
{
|
|
2952
|
+
"data-slot": "slider-thumb",
|
|
2953
|
+
className: cn(
|
|
2954
|
+
"size-5 shadow-sm block shrink-0 rounded-full border border-primary bg-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50",
|
|
2955
|
+
focusRing
|
|
2956
|
+
)
|
|
2957
|
+
},
|
|
2958
|
+
index
|
|
2959
|
+
))
|
|
2960
|
+
]
|
|
2961
|
+
}
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
function useDocumentScheme() {
|
|
2965
|
+
const [scheme, setScheme] = useState("light");
|
|
2966
|
+
useEffect(() => {
|
|
2967
|
+
const root = document.documentElement;
|
|
2968
|
+
const read = () => setScheme(root.classList.contains("dark") ? "dark" : "light");
|
|
2969
|
+
read();
|
|
2970
|
+
const observer = new MutationObserver(read);
|
|
2971
|
+
observer.observe(root, {
|
|
2972
|
+
attributes: true,
|
|
2973
|
+
attributeFilter: ["class"]
|
|
2974
|
+
});
|
|
2975
|
+
return () => observer.disconnect();
|
|
2976
|
+
}, []);
|
|
2977
|
+
return scheme;
|
|
2978
|
+
}
|
|
2979
|
+
var Toaster = ({ theme, ...props }) => {
|
|
2980
|
+
const scheme = useDocumentScheme();
|
|
2981
|
+
return /* @__PURE__ */ jsx(
|
|
2982
|
+
Toaster$1,
|
|
2983
|
+
{
|
|
2984
|
+
theme: theme ?? scheme,
|
|
2985
|
+
className: "toaster group [&_[data-sonner-toast]]:shadow-2xl [&_[data-sonner-toast]]:backdrop-blur-xl",
|
|
2986
|
+
icons: {
|
|
2987
|
+
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
2988
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
2989
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
2990
|
+
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
2991
|
+
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
|
|
2992
|
+
},
|
|
2993
|
+
style: {
|
|
2994
|
+
"--normal-bg": "color-mix(in oklab, var(--popover) 90%, transparent)",
|
|
2995
|
+
"--normal-text": "var(--popover-foreground)",
|
|
2996
|
+
"--normal-border": "var(--border)",
|
|
2997
|
+
"--border-radius": "1rem"
|
|
2998
|
+
},
|
|
2999
|
+
...props
|
|
3000
|
+
}
|
|
3001
|
+
);
|
|
3002
|
+
};
|
|
3003
|
+
var toggleVariants = cva(
|
|
3004
|
+
`inline-flex items-center justify-center gap-2 rounded-xl text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:font-semibold data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 transition-[color,box-shadow] aria-invalid:ring-destructive/20 aria-invalid:border-destructive ${focusRing}`,
|
|
3005
|
+
{
|
|
3006
|
+
variants: {
|
|
3007
|
+
variant: {
|
|
3008
|
+
default: "bg-transparent",
|
|
3009
|
+
outline: `${glassControl} ${controlFill} hover:bg-accent hover:text-accent-foreground`
|
|
3010
|
+
},
|
|
3011
|
+
size: {
|
|
3012
|
+
default: "h-11 px-4 min-w-11",
|
|
3013
|
+
sm: "h-9 px-3 min-w-9",
|
|
3014
|
+
lg: "h-12 px-6 min-w-12"
|
|
3015
|
+
}
|
|
3016
|
+
},
|
|
3017
|
+
defaultVariants: {
|
|
3018
|
+
variant: "default",
|
|
3019
|
+
size: "default"
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
);
|
|
3023
|
+
function Toggle({
|
|
3024
|
+
className,
|
|
3025
|
+
variant,
|
|
3026
|
+
size,
|
|
3027
|
+
...props
|
|
3028
|
+
}) {
|
|
3029
|
+
return /* @__PURE__ */ jsx(
|
|
3030
|
+
TogglePrimitive.Root,
|
|
3031
|
+
{
|
|
3032
|
+
"data-slot": "toggle",
|
|
3033
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
3034
|
+
...props
|
|
3035
|
+
}
|
|
3036
|
+
);
|
|
3037
|
+
}
|
|
3038
|
+
var ToggleGroupContext = React2.createContext({
|
|
3039
|
+
size: "default",
|
|
3040
|
+
variant: "default"
|
|
3041
|
+
});
|
|
3042
|
+
function ToggleGroup({
|
|
3043
|
+
className,
|
|
3044
|
+
variant,
|
|
3045
|
+
size,
|
|
3046
|
+
children,
|
|
3047
|
+
...props
|
|
3048
|
+
}) {
|
|
3049
|
+
return /* @__PURE__ */ jsx(
|
|
3050
|
+
ToggleGroupPrimitive.Root,
|
|
3051
|
+
{
|
|
3052
|
+
"data-slot": "toggle-group",
|
|
3053
|
+
"data-variant": variant,
|
|
3054
|
+
"data-size": size,
|
|
3055
|
+
className: cn(
|
|
3056
|
+
"group/toggle-group data-[variant=outline]:shadow-xs rounded-2xl flex items-center",
|
|
3057
|
+
className
|
|
3058
|
+
),
|
|
3059
|
+
...props,
|
|
3060
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
3061
|
+
}
|
|
3062
|
+
);
|
|
3063
|
+
}
|
|
3064
|
+
function ToggleGroupItem({
|
|
3065
|
+
className,
|
|
3066
|
+
children,
|
|
3067
|
+
variant,
|
|
3068
|
+
size,
|
|
3069
|
+
...props
|
|
3070
|
+
}) {
|
|
3071
|
+
const context = React2.useContext(ToggleGroupContext);
|
|
3072
|
+
return /* @__PURE__ */ jsx(
|
|
3073
|
+
ToggleGroupPrimitive.Item,
|
|
3074
|
+
{
|
|
3075
|
+
"data-slot": "toggle-group-item",
|
|
3076
|
+
"data-variant": context.variant || variant,
|
|
3077
|
+
"data-size": context.size || size,
|
|
3078
|
+
className: cn(
|
|
3079
|
+
toggleVariants({
|
|
3080
|
+
variant: context.variant || variant,
|
|
3081
|
+
size: context.size || size
|
|
3082
|
+
}),
|
|
3083
|
+
"min-w-0 first:rounded-l-2xl last:rounded-r-2xl shrink-0 rounded-none shadow-none focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
|
|
3084
|
+
className
|
|
3085
|
+
),
|
|
3086
|
+
...props,
|
|
3087
|
+
children
|
|
3088
|
+
}
|
|
3089
|
+
);
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Combobox, ConfirmDialog, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DateRangeFilter, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, FacetedFilter, FieldError, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlaceholderPattern, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowActionsMenu, ScrollArea, ScrollBar, ServerFacetedFilter, Slider, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Toaster, Toggle, ToggleGroup, ToggleGroupItem, badgeVariants, cardVariants, navigationMenuTriggerStyle, toggleVariants, useConfirmDialog, useFormField };
|
|
3093
|
+
//# sourceMappingURL=index.js.map
|
|
3094
|
+
//# sourceMappingURL=index.js.map
|