@akira-io/ui 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/dist/blocks.d.ts +162 -9
- package/dist/blocks.js +1410 -36
- package/dist/blocks.js.map +1 -1
- package/dist/button-Bj6My68b.d.ts +17 -0
- package/dist/chunk-2WIIRDHT.js +83 -0
- package/dist/chunk-2WIIRDHT.js.map +1 -0
- package/dist/{chunk-A2SIZOEA.js → chunk-4SOQAVUP.js} +125 -45
- package/dist/chunk-4SOQAVUP.js.map +1 -0
- package/dist/chunk-5AJFQ6C4.js +35 -0
- package/dist/chunk-5AJFQ6C4.js.map +1 -0
- package/dist/chunk-CFDDAFPJ.js +1243 -0
- package/dist/chunk-CFDDAFPJ.js.map +1 -0
- package/dist/chunk-FWQFB37J.js +45 -0
- package/dist/chunk-FWQFB37J.js.map +1 -0
- package/dist/chunk-IQMRJXEO.js +59 -0
- package/dist/chunk-IQMRJXEO.js.map +1 -0
- package/dist/chunk-L2H5GIF7.js +22 -0
- package/dist/chunk-L2H5GIF7.js.map +1 -0
- package/dist/chunk-ODYCBCKS.js +290 -0
- package/dist/chunk-ODYCBCKS.js.map +1 -0
- package/dist/{chunk-5MQWJVM2.js → chunk-QHZWW55M.js} +383 -326
- package/dist/chunk-QHZWW55M.js.map +1 -0
- package/dist/chunk-RPCL7VFQ.js +123 -0
- package/dist/chunk-RPCL7VFQ.js.map +1 -0
- package/dist/chunk-T2INZOCM.js +165 -0
- package/dist/chunk-T2INZOCM.js.map +1 -0
- package/dist/chunk-TGF54WAO.js +29 -0
- package/dist/chunk-TGF54WAO.js.map +1 -0
- package/dist/chunk-XZCC6MTE.js +26 -0
- package/dist/chunk-XZCC6MTE.js.map +1 -0
- package/dist/{chunk-UXL33CZ4.js → chunk-YOVY3KT6.js} +13 -11
- package/dist/chunk-YOVY3KT6.js.map +1 -0
- package/dist/code.d.ts +9 -0
- package/dist/code.js +650 -0
- package/dist/code.js.map +1 -0
- package/dist/context-YWbxMH0C.d.ts +383 -0
- package/dist/editor.d.ts +128 -0
- package/dist/editor.js +450 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +298 -222
- package/dist/index.js +1300 -670
- package/dist/index.js.map +1 -1
- package/dist/inertia.d.ts +47 -2
- package/dist/inertia.js +138 -7
- package/dist/inertia.js.map +1 -1
- package/dist/input-Dpi7pXeR.d.ts +6 -0
- package/dist/json-viewer-BARA2RCW.d.ts +51 -0
- package/dist/{language-Bft6rBBt.d.ts → language-Dgjr9bm3.d.ts} +1 -1
- package/dist/locales/pt.d.ts +26 -4
- package/dist/locales/pt.js +127 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/password-input-DcXX7SG9.d.ts +51 -0
- package/dist/shells.d.ts +45 -7
- package/dist/shells.js +96 -60
- package/dist/shells.js.map +1 -1
- package/dist/sidebar-DqkFRUxQ.d.ts +81 -0
- package/dist/types-B-eGPoFD.d.ts +111 -0
- package/dist/types-cmBL8zOc.d.ts +51 -0
- package/package.json +170 -130
- package/theme.css +20 -0
- package/themes/nosferry.css +4 -0
- package/dist/chunk-42BJBH56.js +0 -786
- package/dist/chunk-42BJBH56.js.map +0 -1
- package/dist/chunk-5MQWJVM2.js.map +0 -1
- package/dist/chunk-A2SIZOEA.js.map +0 -1
- package/dist/chunk-POE7OYET.js +0 -96
- package/dist/chunk-POE7OYET.js.map +0 -1
- package/dist/chunk-UXL33CZ4.js.map +0 -1
- package/dist/date-range-filter-QEa8fhUM.d.ts +0 -149
- package/dist/sidebar-BDhG9SUU.d.ts +0 -88
- package/dist/types-Cno1_Ijx.d.ts +0 -40
- package/dist/types-cOieac8G.d.ts +0 -77
package/dist/index.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Select, SelectTrigger, SelectContent, SelectItem, Calendar, FieldContext, FieldError, useField, ConfirmDialog } from './chunk-CFDDAFPJ.js';
|
|
2
|
+
export { Alert, AlertDescription, AlertTitle, Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetStack, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, confirmDialogDefaultLabels, floatingSheetDefaultLabels, useField } from './chunk-CFDDAFPJ.js';
|
|
3
|
+
export { CopyButton, copyButtonLabels } from './chunk-2WIIRDHT.js';
|
|
4
|
+
import { toggleVariants } from './chunk-FWQFB37J.js';
|
|
5
|
+
export { Toggle, toggleVariants } from './chunk-FWQFB37J.js';
|
|
6
|
+
import { Label } from './chunk-T2INZOCM.js';
|
|
7
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Label } from './chunk-T2INZOCM.js';
|
|
8
|
+
import { useAppearance } from './chunk-IQMRJXEO.js';
|
|
9
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants } from './chunk-RPCL7VFQ.js';
|
|
10
|
+
import { useUiLabels } from './chunk-5AJFQ6C4.js';
|
|
11
|
+
export { UiLocaleProvider, useUiLabels, useUiLocale } from './chunk-5AJFQ6C4.js';
|
|
12
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuItem } from './chunk-QHZWW55M.js';
|
|
13
|
+
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, 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-QHZWW55M.js';
|
|
14
|
+
export { Separator } from './chunk-TGF54WAO.js';
|
|
15
|
+
import { Input } from './chunk-XZCC6MTE.js';
|
|
16
|
+
export { Input } from './chunk-XZCC6MTE.js';
|
|
17
|
+
import { cn, focusRing, nestedRadius, nestedSurfaceReset, nestedEdgeToEdge, elevatedSurface, modalSurface, Button, menuSurface, quietFocus, fieldSurface, floatingSurface, panelSurface, buttonVariants, Spinner } from './chunk-ODYCBCKS.js';
|
|
18
|
+
export { Button, Spinner, buttonVariants, cn, controlFill, elevatedSurface, focusRing, menuHighlight, nestedEdgeToEdge, nestedRadius, nestedSurfaceReset, recessedSurface, spinnerVariants, surface } from './chunk-ODYCBCKS.js';
|
|
19
|
+
import * as React3 from 'react';
|
|
20
|
+
import { useState, useRef, useCallback, useEffect, useMemo, useId } from 'react';
|
|
8
21
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
-
import * as React2 from 'react';
|
|
10
|
-
import { useState, useMemo, useId, useEffect } from 'react';
|
|
11
22
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
12
|
-
import {
|
|
23
|
+
import { ChevronDown, SunIcon, MoonIcon, MonitorIcon, ArrowLeft, ArrowRight, CheckIcon, ChevronsUpDown, Check, ChevronRightIcon, CircleIcon, MoreVertical, SearchX, Search, X, Plus, ArrowUpDown, ChevronLeft, ChevronRight, CalendarIcon, CalendarRange, ChevronDownIcon, ChevronLeftIcon, MoreHorizontalIcon, EyeOff, Eye, TriangleAlert, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, PlusCircle } from 'lucide-react';
|
|
13
24
|
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';
|
|
25
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
14
26
|
import { Slot } from '@radix-ui/react-slot';
|
|
27
|
+
import { cva } from 'class-variance-authority';
|
|
15
28
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
16
29
|
import * as RechartsPrimitive from 'recharts';
|
|
17
30
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
@@ -19,82 +32,100 @@ import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRow
|
|
|
19
32
|
import { format } from 'date-fns';
|
|
20
33
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
21
34
|
import { useFormContext, FormProvider, Controller } from 'react-hook-form';
|
|
22
|
-
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
23
35
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
24
36
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
25
37
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
26
38
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
27
39
|
export { toast } from 'sonner';
|
|
28
|
-
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
29
|
-
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var AUTOSAVE_DELAY = 700;
|
|
42
|
+
function shallowEqual(a, b) {
|
|
43
|
+
if (Object.is(a, b)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const keys = Object.keys(a);
|
|
50
|
+
if (keys.length !== Object.keys(b).length) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return keys.every(
|
|
54
|
+
(key) => Object.is(
|
|
55
|
+
a[key],
|
|
56
|
+
b[key]
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function messageOf(reason) {
|
|
61
|
+
if (reason instanceof Error) {
|
|
62
|
+
return reason.message;
|
|
63
|
+
}
|
|
64
|
+
return typeof reason === "string" ? reason : void 0;
|
|
65
|
+
}
|
|
66
|
+
function useAutosave(values, onSave, options = {}) {
|
|
67
|
+
const { delay = AUTOSAVE_DELAY, enabled = true, isEqual } = options;
|
|
68
|
+
const [status, setStatus] = useState("idle");
|
|
69
|
+
const [error, setError] = useState(void 0);
|
|
70
|
+
const latest = useRef(values);
|
|
71
|
+
const dispatched = useRef(values);
|
|
72
|
+
const timer = useRef(void 0);
|
|
73
|
+
const issued = useRef(0);
|
|
74
|
+
const settled = useRef(0);
|
|
75
|
+
const mounted = useRef(true);
|
|
76
|
+
const save = useRef(onSave);
|
|
77
|
+
const equal = useRef(isEqual ?? shallowEqual);
|
|
78
|
+
latest.current = values;
|
|
79
|
+
save.current = onSave;
|
|
80
|
+
equal.current = isEqual ?? shallowEqual;
|
|
81
|
+
const run = useCallback(async () => {
|
|
82
|
+
const payload = latest.current;
|
|
83
|
+
const ticket = issued.current += 1;
|
|
84
|
+
setStatus("saving");
|
|
85
|
+
setError(void 0);
|
|
86
|
+
try {
|
|
87
|
+
await save.current(payload);
|
|
88
|
+
if (ticket < settled.current || !mounted.current) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
settled.current = ticket;
|
|
92
|
+
setStatus("saved");
|
|
93
|
+
} catch (reason) {
|
|
94
|
+
if (ticket < settled.current || !mounted.current) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
settled.current = ticket;
|
|
98
|
+
setError(messageOf(reason));
|
|
99
|
+
setStatus("error");
|
|
46
100
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
101
|
+
}, []);
|
|
102
|
+
const flush = useCallback(() => {
|
|
103
|
+
clearTimeout(timer.current);
|
|
104
|
+
dispatched.current = latest.current;
|
|
105
|
+
void run();
|
|
106
|
+
}, [run]);
|
|
107
|
+
const reset = useCallback(() => {
|
|
108
|
+
clearTimeout(timer.current);
|
|
109
|
+
dispatched.current = latest.current;
|
|
110
|
+
setError(void 0);
|
|
111
|
+
setStatus("idle");
|
|
112
|
+
}, []);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
mounted.current = true;
|
|
115
|
+
return () => {
|
|
116
|
+
mounted.current = false;
|
|
117
|
+
clearTimeout(timer.current);
|
|
118
|
+
};
|
|
119
|
+
}, []);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!enabled || equal.current(values, dispatched.current)) {
|
|
52
122
|
return;
|
|
53
123
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
] }) });
|
|
124
|
+
dispatched.current = values;
|
|
125
|
+
clearTimeout(timer.current);
|
|
126
|
+
timer.current = setTimeout(() => void run(), delay);
|
|
127
|
+
}, [values, delay, enabled, run]);
|
|
128
|
+
return { status, error, flush, reset };
|
|
98
129
|
}
|
|
99
130
|
function useConfirmDialog() {
|
|
100
131
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -129,37 +160,38 @@ function useConfirmDialog() {
|
|
|
129
160
|
}
|
|
130
161
|
function Accordion({
|
|
131
162
|
className,
|
|
163
|
+
slotName = "accordion",
|
|
132
164
|
...props
|
|
133
165
|
}) {
|
|
134
166
|
return /* @__PURE__ */ jsx(
|
|
135
167
|
AccordionPrimitive.Root,
|
|
136
168
|
{
|
|
137
|
-
"data-slot": "accordion",
|
|
138
169
|
className: cn(elevatedSurface, "px-5 bg-card", className),
|
|
139
|
-
...props
|
|
170
|
+
...props,
|
|
171
|
+
"data-slot": slotName
|
|
140
172
|
}
|
|
141
173
|
);
|
|
142
174
|
}
|
|
143
|
-
var AccordionItem =
|
|
175
|
+
var AccordionItem = React3.forwardRef(({ className, slotName = "accordion-item", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
144
176
|
AccordionPrimitive.Item,
|
|
145
177
|
{
|
|
146
|
-
"data-slot": "accordion-item",
|
|
147
178
|
ref,
|
|
148
179
|
className: cn("border-b border-border last:border-b-0", className),
|
|
149
|
-
...props
|
|
180
|
+
...props,
|
|
181
|
+
"data-slot": slotName
|
|
150
182
|
}
|
|
151
183
|
));
|
|
152
184
|
AccordionItem.displayName = "AccordionItem";
|
|
153
|
-
var AccordionTrigger =
|
|
185
|
+
var AccordionTrigger = React3.forwardRef(({ className, children, slotName = "accordion-trigger", ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
154
186
|
AccordionPrimitive.Trigger,
|
|
155
187
|
{
|
|
156
|
-
"data-slot": "accordion-trigger",
|
|
157
188
|
ref,
|
|
158
189
|
className: cn(
|
|
159
190
|
`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
191
|
className
|
|
161
192
|
),
|
|
162
193
|
...props,
|
|
194
|
+
"data-slot": slotName,
|
|
163
195
|
children: [
|
|
164
196
|
children,
|
|
165
197
|
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
|
|
@@ -167,121 +199,56 @@ var AccordionTrigger = React2.forwardRef(({ className, children, ...props }, ref
|
|
|
167
199
|
}
|
|
168
200
|
) }));
|
|
169
201
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
170
|
-
var AccordionContent =
|
|
202
|
+
var AccordionContent = React3.forwardRef(({ className, children, slotName = "accordion-content", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
171
203
|
AccordionPrimitive.Content,
|
|
172
204
|
{
|
|
173
|
-
"data-slot": "accordion-content",
|
|
174
205
|
ref,
|
|
175
206
|
className: "text-md data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden transition-all",
|
|
176
207
|
...props,
|
|
208
|
+
"data-slot": slotName,
|
|
177
209
|
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0", className), children })
|
|
178
210
|
}
|
|
179
211
|
));
|
|
180
212
|
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
213
|
function AlertDialog({
|
|
214
|
+
slotName = "alert-dialog",
|
|
240
215
|
...props
|
|
241
216
|
}) {
|
|
242
|
-
return /* @__PURE__ */ jsx(AlertDialog$1.Root, { "data-slot":
|
|
217
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Root, { ...props, "data-slot": slotName });
|
|
243
218
|
}
|
|
244
219
|
function AlertDialogTrigger({
|
|
220
|
+
slotName = "alert-dialog-trigger",
|
|
245
221
|
...props
|
|
246
222
|
}) {
|
|
247
|
-
return /* @__PURE__ */ jsx(
|
|
248
|
-
AlertDialog$1.Trigger,
|
|
249
|
-
{
|
|
250
|
-
"data-slot": "alert-dialog-trigger",
|
|
251
|
-
...props
|
|
252
|
-
}
|
|
253
|
-
);
|
|
223
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, { ...props, "data-slot": slotName });
|
|
254
224
|
}
|
|
255
225
|
function AlertDialogPortal({
|
|
226
|
+
slotName = "alert-dialog-portal",
|
|
256
227
|
...props
|
|
257
228
|
}) {
|
|
258
|
-
return /* @__PURE__ */ jsx(
|
|
259
|
-
AlertDialog$1.Portal,
|
|
260
|
-
{
|
|
261
|
-
"data-slot": "alert-dialog-portal",
|
|
262
|
-
...props
|
|
263
|
-
}
|
|
264
|
-
);
|
|
229
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Portal, { ...props, "data-slot": slotName });
|
|
265
230
|
}
|
|
266
231
|
function AlertDialogOverlay({
|
|
267
232
|
className,
|
|
233
|
+
slotName = "alert-dialog-overlay",
|
|
268
234
|
...props
|
|
269
235
|
}) {
|
|
270
236
|
return /* @__PURE__ */ jsx(
|
|
271
237
|
AlertDialog$1.Overlay,
|
|
272
238
|
{
|
|
273
|
-
"data-slot": "alert-dialog-overlay",
|
|
274
239
|
className: cn(
|
|
275
240
|
"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
241
|
className
|
|
277
242
|
),
|
|
278
|
-
...props
|
|
243
|
+
...props,
|
|
244
|
+
"data-slot": slotName
|
|
279
245
|
}
|
|
280
246
|
);
|
|
281
247
|
}
|
|
282
248
|
function AlertDialogContent({
|
|
283
249
|
className,
|
|
284
250
|
size = "default",
|
|
251
|
+
slotName = "alert-dialog-content",
|
|
285
252
|
...props
|
|
286
253
|
}) {
|
|
287
254
|
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
@@ -289,91 +256,96 @@ function AlertDialogContent({
|
|
|
289
256
|
/* @__PURE__ */ jsx(
|
|
290
257
|
AlertDialog$1.Content,
|
|
291
258
|
{
|
|
292
|
-
"data-slot": "alert-dialog-content",
|
|
293
259
|
"data-size": size,
|
|
294
260
|
className: cn(
|
|
295
261
|
`${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
262
|
className
|
|
297
263
|
),
|
|
298
|
-
...props
|
|
264
|
+
...props,
|
|
265
|
+
"data-slot": slotName
|
|
299
266
|
}
|
|
300
267
|
)
|
|
301
268
|
] });
|
|
302
269
|
}
|
|
303
270
|
function AlertDialogHeader({
|
|
304
271
|
className,
|
|
272
|
+
slotName = "alert-dialog-header",
|
|
305
273
|
...props
|
|
306
274
|
}) {
|
|
307
275
|
return /* @__PURE__ */ jsx(
|
|
308
276
|
"div",
|
|
309
277
|
{
|
|
310
|
-
"data-slot": "alert-dialog-header",
|
|
311
278
|
className: cn(
|
|
312
279
|
"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
280
|
className
|
|
314
281
|
),
|
|
315
|
-
...props
|
|
282
|
+
...props,
|
|
283
|
+
"data-slot": slotName
|
|
316
284
|
}
|
|
317
285
|
);
|
|
318
286
|
}
|
|
319
287
|
function AlertDialogFooter({
|
|
320
288
|
className,
|
|
289
|
+
slotName = "alert-dialog-footer",
|
|
321
290
|
...props
|
|
322
291
|
}) {
|
|
323
292
|
return /* @__PURE__ */ jsx(
|
|
324
293
|
"div",
|
|
325
294
|
{
|
|
326
|
-
"data-slot": "alert-dialog-footer",
|
|
327
295
|
className: cn(
|
|
328
296
|
"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
297
|
className
|
|
330
298
|
),
|
|
331
|
-
...props
|
|
299
|
+
...props,
|
|
300
|
+
"data-slot": slotName
|
|
332
301
|
}
|
|
333
302
|
);
|
|
334
303
|
}
|
|
335
304
|
function AlertDialogTitle({
|
|
336
305
|
className,
|
|
306
|
+
slotName = "alert-dialog-title",
|
|
337
307
|
...props
|
|
338
308
|
}) {
|
|
339
309
|
return /* @__PURE__ */ jsx(
|
|
340
310
|
AlertDialog$1.Title,
|
|
341
311
|
{
|
|
342
|
-
"data-slot": "alert-dialog-title",
|
|
343
312
|
className: cn(
|
|
344
313
|
"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
314
|
className
|
|
346
315
|
),
|
|
347
|
-
...props
|
|
316
|
+
...props,
|
|
317
|
+
"data-slot": slotName
|
|
348
318
|
}
|
|
349
319
|
);
|
|
350
320
|
}
|
|
351
321
|
function AlertDialogDescription({
|
|
352
322
|
className,
|
|
323
|
+
slotName = "alert-dialog-description",
|
|
353
324
|
...props
|
|
354
325
|
}) {
|
|
355
326
|
return /* @__PURE__ */ jsx(
|
|
356
327
|
AlertDialog$1.Description,
|
|
357
328
|
{
|
|
358
|
-
"data-slot": "alert-dialog-description",
|
|
359
329
|
className: cn("text-sm text-muted-foreground", className),
|
|
360
|
-
...props
|
|
330
|
+
...props,
|
|
331
|
+
"data-slot": slotName
|
|
361
332
|
}
|
|
362
333
|
);
|
|
363
334
|
}
|
|
364
335
|
function AlertDialogMedia({
|
|
365
336
|
className,
|
|
337
|
+
slotName = "alert-dialog-media",
|
|
366
338
|
...props
|
|
367
339
|
}) {
|
|
368
340
|
return /* @__PURE__ */ jsx(
|
|
369
341
|
"div",
|
|
370
342
|
{
|
|
371
|
-
"data-slot": "alert-dialog-media",
|
|
372
343
|
className: cn(
|
|
373
344
|
"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
345
|
className
|
|
375
346
|
),
|
|
376
|
-
...props
|
|
347
|
+
...props,
|
|
348
|
+
"data-slot": slotName
|
|
377
349
|
}
|
|
378
350
|
);
|
|
379
351
|
}
|
|
@@ -381,14 +353,15 @@ function AlertDialogAction({
|
|
|
381
353
|
className,
|
|
382
354
|
variant = "default",
|
|
383
355
|
size = "default",
|
|
356
|
+
slotName = "alert-dialog-action",
|
|
384
357
|
...props
|
|
385
358
|
}) {
|
|
386
359
|
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
387
360
|
AlertDialog$1.Action,
|
|
388
361
|
{
|
|
389
|
-
"data-slot": "alert-dialog-action",
|
|
390
362
|
className: cn(className),
|
|
391
|
-
...props
|
|
363
|
+
...props,
|
|
364
|
+
"data-slot": slotName
|
|
392
365
|
}
|
|
393
366
|
) });
|
|
394
367
|
}
|
|
@@ -396,151 +369,224 @@ function AlertDialogCancel({
|
|
|
396
369
|
className,
|
|
397
370
|
variant = "outline",
|
|
398
371
|
size = "default",
|
|
372
|
+
slotName = "alert-dialog-cancel",
|
|
399
373
|
...props
|
|
400
374
|
}) {
|
|
401
375
|
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
402
376
|
AlertDialog$1.Cancel,
|
|
403
377
|
{
|
|
404
|
-
"data-slot": "alert-dialog-cancel",
|
|
405
378
|
className: cn(className),
|
|
406
|
-
...props
|
|
379
|
+
...props,
|
|
380
|
+
"data-slot": slotName
|
|
407
381
|
}
|
|
408
382
|
) });
|
|
409
383
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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({
|
|
384
|
+
var ToggleGroupContext = React3.createContext({
|
|
385
|
+
size: "default",
|
|
386
|
+
variant: "default"
|
|
387
|
+
});
|
|
388
|
+
function ToggleGroup({
|
|
432
389
|
className,
|
|
433
390
|
variant,
|
|
434
|
-
|
|
391
|
+
size,
|
|
392
|
+
children,
|
|
393
|
+
slotName = "toggle-group",
|
|
435
394
|
...props
|
|
436
395
|
}) {
|
|
437
|
-
const Comp = asChild ? Slot : "span";
|
|
438
396
|
return /* @__PURE__ */ jsx(
|
|
439
|
-
|
|
397
|
+
ToggleGroupPrimitive.Root,
|
|
440
398
|
{
|
|
441
|
-
"data-
|
|
442
|
-
|
|
443
|
-
|
|
399
|
+
"data-variant": variant,
|
|
400
|
+
"data-size": size,
|
|
401
|
+
className: cn(
|
|
402
|
+
"group/toggle-group data-[variant=outline]:shadow-xs rounded-2xl flex items-center",
|
|
403
|
+
className
|
|
404
|
+
),
|
|
405
|
+
...props,
|
|
406
|
+
"data-slot": slotName,
|
|
407
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
444
408
|
}
|
|
445
409
|
);
|
|
446
410
|
}
|
|
447
|
-
|
|
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({
|
|
411
|
+
function ToggleGroupItem({
|
|
470
412
|
className,
|
|
413
|
+
children,
|
|
471
414
|
variant,
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
inset = false,
|
|
415
|
+
size,
|
|
416
|
+
slotName = "toggle-group-item",
|
|
475
417
|
...props
|
|
476
418
|
}) {
|
|
419
|
+
const context = React3.useContext(ToggleGroupContext);
|
|
477
420
|
return /* @__PURE__ */ jsx(
|
|
478
|
-
|
|
421
|
+
ToggleGroupPrimitive.Item,
|
|
479
422
|
{
|
|
480
|
-
"data-
|
|
481
|
-
"data-
|
|
423
|
+
"data-variant": context.variant || variant,
|
|
424
|
+
"data-size": context.size || size,
|
|
482
425
|
className: cn(
|
|
483
|
-
|
|
484
|
-
|
|
426
|
+
toggleVariants({
|
|
427
|
+
variant: context.variant || variant,
|
|
428
|
+
size: context.size || size
|
|
429
|
+
}),
|
|
430
|
+
"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",
|
|
485
431
|
className
|
|
486
432
|
),
|
|
487
|
-
...props
|
|
433
|
+
...props,
|
|
434
|
+
"data-slot": slotName,
|
|
435
|
+
children
|
|
488
436
|
}
|
|
489
437
|
);
|
|
490
438
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
439
|
+
var appearanceToggleDefaultLabels = {
|
|
440
|
+
groupLabel: "Appearance",
|
|
441
|
+
lightLabel: "Light",
|
|
442
|
+
darkLabel: "Dark",
|
|
443
|
+
systemLabel: "System"
|
|
444
|
+
};
|
|
445
|
+
var OPTIONS = [
|
|
446
|
+
{ value: "light", icon: SunIcon, label: (labels) => labels.lightLabel },
|
|
447
|
+
{ value: "dark", icon: MoonIcon, label: (labels) => labels.darkLabel },
|
|
448
|
+
{
|
|
449
|
+
value: "system",
|
|
450
|
+
icon: MonitorIcon,
|
|
451
|
+
label: (labels) => labels.systemLabel
|
|
452
|
+
}
|
|
453
|
+
];
|
|
454
|
+
function AppearanceToggle({
|
|
455
|
+
className,
|
|
456
|
+
variant = "segmented",
|
|
457
|
+
labels: labelOverrides,
|
|
458
|
+
slotName = "appearance-toggle",
|
|
459
|
+
...props
|
|
460
|
+
}) {
|
|
461
|
+
const labels = useUiLabels(
|
|
462
|
+
"appearanceToggle",
|
|
463
|
+
appearanceToggleDefaultLabels,
|
|
464
|
+
labelOverrides
|
|
499
465
|
);
|
|
500
|
-
}
|
|
501
|
-
|
|
466
|
+
const { appearance, updateAppearance } = useAppearance();
|
|
467
|
+
const current = OPTIONS.find((option) => option.value === appearance);
|
|
468
|
+
const CurrentIcon = current?.icon ?? MonitorIcon;
|
|
469
|
+
if (variant === "menu") {
|
|
470
|
+
return /* @__PURE__ */ jsx(
|
|
471
|
+
"div",
|
|
472
|
+
{
|
|
473
|
+
"data-variant": "menu",
|
|
474
|
+
className: cn("inline-flex", className),
|
|
475
|
+
...props,
|
|
476
|
+
"data-slot": slotName,
|
|
477
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
478
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
479
|
+
Button,
|
|
480
|
+
{
|
|
481
|
+
slotName: "appearance-toggle-trigger",
|
|
482
|
+
variant: "ghost",
|
|
483
|
+
size: "icon-sm",
|
|
484
|
+
"aria-label": labels.groupLabel,
|
|
485
|
+
children: /* @__PURE__ */ jsx(CurrentIcon, { "aria-hidden": "true" })
|
|
486
|
+
}
|
|
487
|
+
) }),
|
|
488
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: /* @__PURE__ */ jsx(
|
|
489
|
+
DropdownMenuRadioGroup,
|
|
490
|
+
{
|
|
491
|
+
value: appearance,
|
|
492
|
+
onValueChange: (value) => updateAppearance(value),
|
|
493
|
+
children: OPTIONS.map((option) => /* @__PURE__ */ jsxs(
|
|
494
|
+
DropdownMenuRadioItem,
|
|
495
|
+
{
|
|
496
|
+
slotName: "appearance-toggle-item",
|
|
497
|
+
value: option.value,
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsx(option.icon, { "aria-hidden": "true" }),
|
|
500
|
+
option.label(labels)
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
option.value
|
|
504
|
+
))
|
|
505
|
+
}
|
|
506
|
+
) })
|
|
507
|
+
] })
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
502
511
|
return /* @__PURE__ */ jsx(
|
|
503
512
|
"div",
|
|
504
513
|
{
|
|
505
|
-
"data-
|
|
506
|
-
className: cn("
|
|
507
|
-
...props
|
|
514
|
+
"data-variant": "segmented",
|
|
515
|
+
className: cn("inline-flex", className),
|
|
516
|
+
...props,
|
|
517
|
+
"data-slot": slotName,
|
|
518
|
+
children: /* @__PURE__ */ jsx(
|
|
519
|
+
ToggleGroup,
|
|
520
|
+
{
|
|
521
|
+
type: "single",
|
|
522
|
+
size: "sm",
|
|
523
|
+
value: appearance,
|
|
524
|
+
"aria-label": labels.groupLabel,
|
|
525
|
+
onValueChange: (value) => {
|
|
526
|
+
if (value) {
|
|
527
|
+
updateAppearance(value);
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
children: OPTIONS.map((option) => /* @__PURE__ */ jsxs(
|
|
531
|
+
ToggleGroupItem,
|
|
532
|
+
{
|
|
533
|
+
slotName: "appearance-toggle-item",
|
|
534
|
+
value: option.value,
|
|
535
|
+
"aria-label": option.label(labels),
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ jsx(option.icon, { "aria-hidden": "true" }),
|
|
538
|
+
/* @__PURE__ */ jsx("span", { children: option.label(labels) })
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
option.value
|
|
542
|
+
))
|
|
543
|
+
}
|
|
544
|
+
)
|
|
508
545
|
}
|
|
509
546
|
);
|
|
510
547
|
}
|
|
511
|
-
function
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
517
|
-
...props
|
|
518
|
-
}
|
|
519
|
-
);
|
|
548
|
+
function AspectRatio({
|
|
549
|
+
slotName = "aspect-ratio",
|
|
550
|
+
...props
|
|
551
|
+
}) {
|
|
552
|
+
return /* @__PURE__ */ jsx(AspectRatio$1.Root, { ...props, "data-slot": slotName });
|
|
520
553
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
{
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
554
|
+
var badgeVariants = cva(
|
|
555
|
+
"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",
|
|
556
|
+
{
|
|
557
|
+
variants: {
|
|
558
|
+
variant: {
|
|
559
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
560
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
561
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
562
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
defaultVariants: {
|
|
566
|
+
variant: "default"
|
|
528
567
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
function
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
function Badge({
|
|
571
|
+
className,
|
|
572
|
+
variant,
|
|
573
|
+
asChild = false,
|
|
574
|
+
slotName = "badge",
|
|
575
|
+
...props
|
|
576
|
+
}) {
|
|
577
|
+
const Comp = asChild ? Slot : "span";
|
|
532
578
|
return /* @__PURE__ */ jsx(
|
|
533
|
-
|
|
579
|
+
Comp,
|
|
534
580
|
{
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
581
|
+
className: cn(badgeVariants({ variant }), className),
|
|
582
|
+
...props,
|
|
583
|
+
"data-slot": slotName
|
|
538
584
|
}
|
|
539
585
|
);
|
|
540
586
|
}
|
|
541
|
-
var CarouselContext =
|
|
587
|
+
var CarouselContext = React3.createContext(null);
|
|
542
588
|
function useCarousel() {
|
|
543
|
-
const context =
|
|
589
|
+
const context = React3.useContext(CarouselContext);
|
|
544
590
|
if (!context) {
|
|
545
591
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
546
592
|
}
|
|
@@ -553,6 +599,7 @@ function Carousel({
|
|
|
553
599
|
plugins,
|
|
554
600
|
className,
|
|
555
601
|
children,
|
|
602
|
+
slotName = "carousel",
|
|
556
603
|
...props
|
|
557
604
|
}) {
|
|
558
605
|
const [carouselRef, api] = useEmblaCarousel(
|
|
@@ -562,20 +609,20 @@ function Carousel({
|
|
|
562
609
|
},
|
|
563
610
|
plugins
|
|
564
611
|
);
|
|
565
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
566
|
-
const [canScrollNext, setCanScrollNext] =
|
|
567
|
-
const onSelect =
|
|
612
|
+
const [canScrollPrev, setCanScrollPrev] = React3.useState(false);
|
|
613
|
+
const [canScrollNext, setCanScrollNext] = React3.useState(false);
|
|
614
|
+
const onSelect = React3.useCallback((api2) => {
|
|
568
615
|
if (!api2) return;
|
|
569
616
|
setCanScrollPrev(api2.canScrollPrev());
|
|
570
617
|
setCanScrollNext(api2.canScrollNext());
|
|
571
618
|
}, []);
|
|
572
|
-
const scrollPrev =
|
|
619
|
+
const scrollPrev = React3.useCallback(() => {
|
|
573
620
|
api?.scrollPrev();
|
|
574
621
|
}, [api]);
|
|
575
|
-
const scrollNext =
|
|
622
|
+
const scrollNext = React3.useCallback(() => {
|
|
576
623
|
api?.scrollNext();
|
|
577
624
|
}, [api]);
|
|
578
|
-
const handleKeyDown =
|
|
625
|
+
const handleKeyDown = React3.useCallback(
|
|
579
626
|
(event) => {
|
|
580
627
|
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
|
|
581
628
|
return;
|
|
@@ -589,11 +636,11 @@ function Carousel({
|
|
|
589
636
|
},
|
|
590
637
|
[scrollPrev, scrollNext]
|
|
591
638
|
);
|
|
592
|
-
|
|
639
|
+
React3.useEffect(() => {
|
|
593
640
|
if (!api || !setApi) return;
|
|
594
641
|
setApi(api);
|
|
595
642
|
}, [api, setApi]);
|
|
596
|
-
|
|
643
|
+
React3.useEffect(() => {
|
|
597
644
|
if (!api) return;
|
|
598
645
|
onSelect(api);
|
|
599
646
|
api.on("reInit", onSelect);
|
|
@@ -627,22 +674,26 @@ function Carousel({
|
|
|
627
674
|
),
|
|
628
675
|
role: "region",
|
|
629
676
|
"aria-roledescription": "carousel",
|
|
630
|
-
"data-slot": "carousel",
|
|
631
677
|
...props,
|
|
678
|
+
"data-slot": slotName,
|
|
632
679
|
children
|
|
633
680
|
}
|
|
634
681
|
)
|
|
635
682
|
}
|
|
636
683
|
);
|
|
637
684
|
}
|
|
638
|
-
function CarouselContent({
|
|
685
|
+
function CarouselContent({
|
|
686
|
+
className,
|
|
687
|
+
slotName = "carousel-content",
|
|
688
|
+
...props
|
|
689
|
+
}) {
|
|
639
690
|
const { carouselRef, orientation } = useCarousel();
|
|
640
691
|
return /* @__PURE__ */ jsx(
|
|
641
692
|
"div",
|
|
642
693
|
{
|
|
643
694
|
ref: carouselRef,
|
|
644
695
|
className: cn(nestedRadius, "overflow-hidden"),
|
|
645
|
-
"data-slot":
|
|
696
|
+
"data-slot": slotName,
|
|
646
697
|
children: /* @__PURE__ */ jsx(
|
|
647
698
|
"div",
|
|
648
699
|
{
|
|
@@ -657,20 +708,24 @@ function CarouselContent({ className, ...props }) {
|
|
|
657
708
|
}
|
|
658
709
|
);
|
|
659
710
|
}
|
|
660
|
-
function CarouselItem({
|
|
711
|
+
function CarouselItem({
|
|
712
|
+
className,
|
|
713
|
+
slotName = "carousel-item",
|
|
714
|
+
...props
|
|
715
|
+
}) {
|
|
661
716
|
const { orientation } = useCarousel();
|
|
662
717
|
return /* @__PURE__ */ jsx(
|
|
663
718
|
"div",
|
|
664
719
|
{
|
|
665
720
|
role: "group",
|
|
666
721
|
"aria-roledescription": "slide",
|
|
667
|
-
"data-slot": "carousel-item",
|
|
668
722
|
className: cn(
|
|
669
723
|
"min-w-0 shrink-0 grow-0 basis-full",
|
|
670
724
|
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
671
725
|
className
|
|
672
726
|
),
|
|
673
|
-
...props
|
|
727
|
+
...props,
|
|
728
|
+
"data-slot": slotName
|
|
674
729
|
}
|
|
675
730
|
);
|
|
676
731
|
}
|
|
@@ -678,13 +733,13 @@ function CarouselPrevious({
|
|
|
678
733
|
className,
|
|
679
734
|
variant = "outline",
|
|
680
735
|
size = "icon",
|
|
736
|
+
slotName = "carousel-previous",
|
|
681
737
|
...props
|
|
682
738
|
}) {
|
|
683
739
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
684
740
|
return /* @__PURE__ */ jsxs(
|
|
685
741
|
Button,
|
|
686
742
|
{
|
|
687
|
-
"data-slot": "carousel-previous",
|
|
688
743
|
variant,
|
|
689
744
|
size,
|
|
690
745
|
className: cn(
|
|
@@ -695,6 +750,7 @@ function CarouselPrevious({
|
|
|
695
750
|
disabled: !canScrollPrev,
|
|
696
751
|
onClick: scrollPrev,
|
|
697
752
|
...props,
|
|
753
|
+
slotName,
|
|
698
754
|
children: [
|
|
699
755
|
/* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
700
756
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
@@ -706,13 +762,13 @@ function CarouselNext({
|
|
|
706
762
|
className,
|
|
707
763
|
variant = "outline",
|
|
708
764
|
size = "icon",
|
|
765
|
+
slotName = "carousel-next",
|
|
709
766
|
...props
|
|
710
767
|
}) {
|
|
711
768
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
712
769
|
return /* @__PURE__ */ jsxs(
|
|
713
770
|
Button,
|
|
714
771
|
{
|
|
715
|
-
"data-slot": "carousel-next",
|
|
716
772
|
variant,
|
|
717
773
|
size,
|
|
718
774
|
className: cn(
|
|
@@ -723,6 +779,7 @@ function CarouselNext({
|
|
|
723
779
|
disabled: !canScrollNext,
|
|
724
780
|
onClick: scrollNext,
|
|
725
781
|
...props,
|
|
782
|
+
slotName,
|
|
726
783
|
children: [
|
|
727
784
|
/* @__PURE__ */ jsx(ArrowRight, {}),
|
|
728
785
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
@@ -732,9 +789,9 @@ function CarouselNext({
|
|
|
732
789
|
}
|
|
733
790
|
var THEMES = { light: "", dark: ".dark" };
|
|
734
791
|
var INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
735
|
-
var ChartContext =
|
|
792
|
+
var ChartContext = React3.createContext(null);
|
|
736
793
|
function useChart() {
|
|
737
|
-
const context =
|
|
794
|
+
const context = React3.useContext(ChartContext);
|
|
738
795
|
if (!context) {
|
|
739
796
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
740
797
|
}
|
|
@@ -746,14 +803,14 @@ function ChartContainer({
|
|
|
746
803
|
children,
|
|
747
804
|
config,
|
|
748
805
|
initialDimension = INITIAL_DIMENSION,
|
|
806
|
+
slotName = "chart",
|
|
749
807
|
...props
|
|
750
808
|
}) {
|
|
751
|
-
const uniqueId =
|
|
809
|
+
const uniqueId = React3.useId();
|
|
752
810
|
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
753
811
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
754
812
|
"div",
|
|
755
813
|
{
|
|
756
|
-
"data-slot": "chart",
|
|
757
814
|
"data-chart": chartId,
|
|
758
815
|
className: cn(
|
|
759
816
|
elevatedSurface,
|
|
@@ -763,6 +820,7 @@ function ChartContainer({
|
|
|
763
820
|
className
|
|
764
821
|
),
|
|
765
822
|
...props,
|
|
823
|
+
"data-slot": slotName,
|
|
766
824
|
children: [
|
|
767
825
|
/* @__PURE__ */ jsx(ChartStyle, { id: chartId, config }),
|
|
768
826
|
/* @__PURE__ */ jsx(
|
|
@@ -818,7 +876,7 @@ function ChartTooltipContent({
|
|
|
818
876
|
labelKey
|
|
819
877
|
}) {
|
|
820
878
|
const { config } = useChart();
|
|
821
|
-
const tooltipLabel =
|
|
879
|
+
const tooltipLabel = React3.useMemo(() => {
|
|
822
880
|
if (hideLabel || !payload?.length) {
|
|
823
881
|
return null;
|
|
824
882
|
}
|
|
@@ -989,17 +1047,18 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
989
1047
|
}
|
|
990
1048
|
function Checkbox({
|
|
991
1049
|
className,
|
|
1050
|
+
slotName = "checkbox",
|
|
992
1051
|
...props
|
|
993
1052
|
}) {
|
|
994
1053
|
return /* @__PURE__ */ jsx(
|
|
995
1054
|
CheckboxPrimitive.Root,
|
|
996
1055
|
{
|
|
997
|
-
"data-slot": "checkbox",
|
|
998
1056
|
className: cn(
|
|
999
1057
|
`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
1058
|
className
|
|
1001
1059
|
),
|
|
1002
1060
|
...props,
|
|
1061
|
+
"data-slot": slotName,
|
|
1003
1062
|
children: /* @__PURE__ */ jsx(
|
|
1004
1063
|
CheckboxPrimitive.Indicator,
|
|
1005
1064
|
{
|
|
@@ -1011,36 +1070,53 @@ function Checkbox({
|
|
|
1011
1070
|
}
|
|
1012
1071
|
);
|
|
1013
1072
|
}
|
|
1073
|
+
var comboboxDefaultLabels = {
|
|
1074
|
+
placeholder: "Select an option",
|
|
1075
|
+
searchPlaceholder: "Search...",
|
|
1076
|
+
emptyText: "No results."
|
|
1077
|
+
};
|
|
1014
1078
|
function Combobox({
|
|
1015
|
-
id,
|
|
1016
1079
|
value,
|
|
1017
1080
|
options,
|
|
1018
1081
|
onChange,
|
|
1019
|
-
placeholder
|
|
1020
|
-
searchPlaceholder
|
|
1021
|
-
emptyText
|
|
1082
|
+
placeholder,
|
|
1083
|
+
searchPlaceholder,
|
|
1084
|
+
emptyText,
|
|
1022
1085
|
disabled = false,
|
|
1023
|
-
invalid = false
|
|
1086
|
+
invalid = false,
|
|
1087
|
+
required,
|
|
1088
|
+
className,
|
|
1089
|
+
"aria-invalid": ariaInvalid,
|
|
1090
|
+
slotName = "combobox",
|
|
1091
|
+
...trigger
|
|
1024
1092
|
}) {
|
|
1093
|
+
const labels = useUiLabels("combobox", comboboxDefaultLabels, {
|
|
1094
|
+
placeholder,
|
|
1095
|
+
searchPlaceholder,
|
|
1096
|
+
emptyText
|
|
1097
|
+
});
|
|
1025
1098
|
const [open, setOpen] = useState(false);
|
|
1026
1099
|
const selected = options.find((option) => option.value === value);
|
|
1027
1100
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
1028
1101
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1029
1102
|
Button,
|
|
1030
1103
|
{
|
|
1031
|
-
"data-slot": "combobox",
|
|
1032
|
-
id,
|
|
1033
1104
|
variant: "outline",
|
|
1105
|
+
...trigger,
|
|
1034
1106
|
role: "combobox",
|
|
1035
1107
|
"aria-expanded": open,
|
|
1108
|
+
"aria-required": required || void 0,
|
|
1109
|
+
"aria-invalid": ariaInvalid ?? (invalid || void 0),
|
|
1036
1110
|
disabled,
|
|
1037
1111
|
className: cn(
|
|
1038
1112
|
"h-11 rounded-2xl w-full justify-between border-border bg-muted/40 hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",
|
|
1039
1113
|
!selected && "text-muted-foreground",
|
|
1040
|
-
invalid && "border-destructive ring-destructive"
|
|
1114
|
+
invalid && "border-destructive ring-destructive",
|
|
1115
|
+
className
|
|
1041
1116
|
),
|
|
1117
|
+
slotName,
|
|
1042
1118
|
children: [
|
|
1043
|
-
selected ? selected.label : placeholder,
|
|
1119
|
+
selected ? selected.label : labels.placeholder,
|
|
1044
1120
|
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1045
1121
|
]
|
|
1046
1122
|
}
|
|
@@ -1054,12 +1130,12 @@ function Combobox({
|
|
|
1054
1130
|
/* @__PURE__ */ jsx(
|
|
1055
1131
|
CommandInput,
|
|
1056
1132
|
{
|
|
1057
|
-
placeholder: searchPlaceholder,
|
|
1133
|
+
placeholder: labels.searchPlaceholder,
|
|
1058
1134
|
className: "h-11"
|
|
1059
1135
|
}
|
|
1060
1136
|
),
|
|
1061
1137
|
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
1062
|
-
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
1138
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: labels.emptyText }),
|
|
1063
1139
|
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1064
1140
|
CommandItem,
|
|
1065
1141
|
{
|
|
@@ -1091,69 +1167,58 @@ function Combobox({
|
|
|
1091
1167
|
] });
|
|
1092
1168
|
}
|
|
1093
1169
|
function ContextMenu({
|
|
1170
|
+
slotName = "context-menu",
|
|
1094
1171
|
...props
|
|
1095
1172
|
}) {
|
|
1096
|
-
return /* @__PURE__ */ jsx(ContextMenu$1.Root, { "data-slot":
|
|
1173
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Root, { ...props, "data-slot": slotName });
|
|
1097
1174
|
}
|
|
1098
1175
|
function ContextMenuTrigger({
|
|
1176
|
+
slotName = "context-menu-trigger",
|
|
1099
1177
|
...props
|
|
1100
1178
|
}) {
|
|
1101
|
-
return /* @__PURE__ */ jsx(
|
|
1102
|
-
ContextMenu$1.Trigger,
|
|
1103
|
-
{
|
|
1104
|
-
"data-slot": "context-menu-trigger",
|
|
1105
|
-
...props
|
|
1106
|
-
}
|
|
1107
|
-
);
|
|
1179
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Trigger, { ...props, "data-slot": slotName });
|
|
1108
1180
|
}
|
|
1109
1181
|
function ContextMenuGroup({
|
|
1182
|
+
slotName = "context-menu-group",
|
|
1110
1183
|
...props
|
|
1111
1184
|
}) {
|
|
1112
|
-
return /* @__PURE__ */ jsx(ContextMenu$1.Group, { "data-slot":
|
|
1185
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Group, { ...props, "data-slot": slotName });
|
|
1113
1186
|
}
|
|
1114
1187
|
function ContextMenuPortal({
|
|
1188
|
+
slotName = "context-menu-portal",
|
|
1115
1189
|
...props
|
|
1116
1190
|
}) {
|
|
1117
|
-
return /* @__PURE__ */ jsx(
|
|
1118
|
-
ContextMenu$1.Portal,
|
|
1119
|
-
{
|
|
1120
|
-
"data-slot": "context-menu-portal",
|
|
1121
|
-
...props
|
|
1122
|
-
}
|
|
1123
|
-
);
|
|
1191
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { ...props, "data-slot": slotName });
|
|
1124
1192
|
}
|
|
1125
1193
|
function ContextMenuSub({
|
|
1194
|
+
slotName = "context-menu-sub",
|
|
1126
1195
|
...props
|
|
1127
1196
|
}) {
|
|
1128
|
-
return /* @__PURE__ */ jsx(ContextMenu$1.Sub, { "data-slot":
|
|
1197
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Sub, { ...props, "data-slot": slotName });
|
|
1129
1198
|
}
|
|
1130
1199
|
function ContextMenuRadioGroup({
|
|
1200
|
+
slotName = "context-menu-radio-group",
|
|
1131
1201
|
...props
|
|
1132
1202
|
}) {
|
|
1133
|
-
return /* @__PURE__ */ jsx(
|
|
1134
|
-
ContextMenu$1.RadioGroup,
|
|
1135
|
-
{
|
|
1136
|
-
"data-slot": "context-menu-radio-group",
|
|
1137
|
-
...props
|
|
1138
|
-
}
|
|
1139
|
-
);
|
|
1203
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.RadioGroup, { ...props, "data-slot": slotName });
|
|
1140
1204
|
}
|
|
1141
1205
|
function ContextMenuSubTrigger({
|
|
1142
1206
|
className,
|
|
1143
1207
|
inset,
|
|
1144
1208
|
children,
|
|
1209
|
+
slotName = "context-menu-sub-trigger",
|
|
1145
1210
|
...props
|
|
1146
1211
|
}) {
|
|
1147
1212
|
return /* @__PURE__ */ jsxs(
|
|
1148
1213
|
ContextMenu$1.SubTrigger,
|
|
1149
1214
|
{
|
|
1150
|
-
"data-slot": "context-menu-sub-trigger",
|
|
1151
1215
|
"data-inset": inset,
|
|
1152
1216
|
className: cn(
|
|
1153
1217
|
"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
1218
|
className
|
|
1155
1219
|
),
|
|
1156
1220
|
...props,
|
|
1221
|
+
"data-slot": slotName,
|
|
1157
1222
|
children: [
|
|
1158
1223
|
children,
|
|
1159
1224
|
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
|
|
@@ -1163,33 +1228,35 @@ function ContextMenuSubTrigger({
|
|
|
1163
1228
|
}
|
|
1164
1229
|
function ContextMenuSubContent({
|
|
1165
1230
|
className,
|
|
1231
|
+
slotName = "context-menu-sub-content",
|
|
1166
1232
|
...props
|
|
1167
1233
|
}) {
|
|
1168
1234
|
return /* @__PURE__ */ jsx(
|
|
1169
1235
|
ContextMenu$1.SubContent,
|
|
1170
1236
|
{
|
|
1171
|
-
"data-slot": "context-menu-sub-content",
|
|
1172
1237
|
className: cn(
|
|
1173
1238
|
`${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
1239
|
className
|
|
1175
1240
|
),
|
|
1176
|
-
...props
|
|
1241
|
+
...props,
|
|
1242
|
+
"data-slot": slotName
|
|
1177
1243
|
}
|
|
1178
1244
|
);
|
|
1179
1245
|
}
|
|
1180
1246
|
function ContextMenuContent({
|
|
1181
1247
|
className,
|
|
1248
|
+
slotName = "context-menu-content",
|
|
1182
1249
|
...props
|
|
1183
1250
|
}) {
|
|
1184
1251
|
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
1185
1252
|
ContextMenu$1.Content,
|
|
1186
1253
|
{
|
|
1187
|
-
"data-slot": "context-menu-content",
|
|
1188
1254
|
className: cn(
|
|
1189
1255
|
`${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
1256
|
className
|
|
1191
1257
|
),
|
|
1192
|
-
...props
|
|
1258
|
+
...props,
|
|
1259
|
+
"data-slot": slotName
|
|
1193
1260
|
}
|
|
1194
1261
|
) });
|
|
1195
1262
|
}
|
|
@@ -1197,19 +1264,20 @@ function ContextMenuItem({
|
|
|
1197
1264
|
className,
|
|
1198
1265
|
inset,
|
|
1199
1266
|
variant = "default",
|
|
1267
|
+
slotName = "context-menu-item",
|
|
1200
1268
|
...props
|
|
1201
1269
|
}) {
|
|
1202
1270
|
return /* @__PURE__ */ jsx(
|
|
1203
1271
|
ContextMenu$1.Item,
|
|
1204
1272
|
{
|
|
1205
|
-
"data-slot": "context-menu-item",
|
|
1206
1273
|
"data-inset": inset,
|
|
1207
1274
|
"data-variant": variant,
|
|
1208
1275
|
className: cn(
|
|
1209
1276
|
"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
1277
|
className
|
|
1211
1278
|
),
|
|
1212
|
-
...props
|
|
1279
|
+
...props,
|
|
1280
|
+
"data-slot": slotName
|
|
1213
1281
|
}
|
|
1214
1282
|
);
|
|
1215
1283
|
}
|
|
@@ -1217,18 +1285,19 @@ function ContextMenuCheckboxItem({
|
|
|
1217
1285
|
className,
|
|
1218
1286
|
children,
|
|
1219
1287
|
checked,
|
|
1288
|
+
slotName = "context-menu-checkbox-item",
|
|
1220
1289
|
...props
|
|
1221
1290
|
}) {
|
|
1222
1291
|
return /* @__PURE__ */ jsxs(
|
|
1223
1292
|
ContextMenu$1.CheckboxItem,
|
|
1224
1293
|
{
|
|
1225
|
-
"data-slot": "context-menu-checkbox-item",
|
|
1226
1294
|
className: cn(
|
|
1227
1295
|
"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
1296
|
className
|
|
1229
1297
|
),
|
|
1230
1298
|
checked,
|
|
1231
1299
|
...props,
|
|
1300
|
+
"data-slot": slotName,
|
|
1232
1301
|
children: [
|
|
1233
1302
|
/* @__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
1303
|
children
|
|
@@ -1239,17 +1308,18 @@ function ContextMenuCheckboxItem({
|
|
|
1239
1308
|
function ContextMenuRadioItem({
|
|
1240
1309
|
className,
|
|
1241
1310
|
children,
|
|
1311
|
+
slotName = "context-menu-radio-item",
|
|
1242
1312
|
...props
|
|
1243
1313
|
}) {
|
|
1244
1314
|
return /* @__PURE__ */ jsxs(
|
|
1245
1315
|
ContextMenu$1.RadioItem,
|
|
1246
1316
|
{
|
|
1247
|
-
"data-slot": "context-menu-radio-item",
|
|
1248
1317
|
className: cn(
|
|
1249
1318
|
"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
1319
|
className
|
|
1251
1320
|
),
|
|
1252
1321
|
...props,
|
|
1322
|
+
"data-slot": slotName,
|
|
1253
1323
|
children: [
|
|
1254
1324
|
/* @__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
1325
|
children
|
|
@@ -1260,65 +1330,72 @@ function ContextMenuRadioItem({
|
|
|
1260
1330
|
function ContextMenuLabel({
|
|
1261
1331
|
className,
|
|
1262
1332
|
inset,
|
|
1333
|
+
slotName = "context-menu-label",
|
|
1263
1334
|
...props
|
|
1264
1335
|
}) {
|
|
1265
1336
|
return /* @__PURE__ */ jsx(
|
|
1266
1337
|
ContextMenu$1.Label,
|
|
1267
1338
|
{
|
|
1268
|
-
"data-slot": "context-menu-label",
|
|
1269
1339
|
"data-inset": inset,
|
|
1270
1340
|
className: cn(
|
|
1271
1341
|
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8 text-foreground",
|
|
1272
1342
|
className
|
|
1273
1343
|
),
|
|
1274
|
-
...props
|
|
1344
|
+
...props,
|
|
1345
|
+
"data-slot": slotName
|
|
1275
1346
|
}
|
|
1276
1347
|
);
|
|
1277
1348
|
}
|
|
1278
1349
|
function ContextMenuSeparator({
|
|
1279
1350
|
className,
|
|
1351
|
+
slotName = "context-menu-separator",
|
|
1280
1352
|
...props
|
|
1281
1353
|
}) {
|
|
1282
1354
|
return /* @__PURE__ */ jsx(
|
|
1283
1355
|
ContextMenu$1.Separator,
|
|
1284
1356
|
{
|
|
1285
|
-
"data-slot": "context-menu-separator",
|
|
1286
1357
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1287
|
-
...props
|
|
1358
|
+
...props,
|
|
1359
|
+
"data-slot": slotName
|
|
1288
1360
|
}
|
|
1289
1361
|
);
|
|
1290
1362
|
}
|
|
1291
1363
|
function ContextMenuShortcut({
|
|
1292
1364
|
className,
|
|
1365
|
+
slotName = "context-menu-shortcut",
|
|
1293
1366
|
...props
|
|
1294
1367
|
}) {
|
|
1295
1368
|
return /* @__PURE__ */ jsx(
|
|
1296
1369
|
"span",
|
|
1297
1370
|
{
|
|
1298
|
-
"data-slot": "context-menu-shortcut",
|
|
1299
1371
|
className: cn(
|
|
1300
1372
|
"text-xs tracking-widest ml-auto text-muted-foreground",
|
|
1301
1373
|
className
|
|
1302
1374
|
),
|
|
1303
|
-
...props
|
|
1375
|
+
...props,
|
|
1376
|
+
"data-slot": slotName
|
|
1304
1377
|
}
|
|
1305
1378
|
);
|
|
1306
1379
|
}
|
|
1380
|
+
var dataTableFacetedFilterDefaultLabels = {
|
|
1381
|
+
noOptionsLabel: "No options."
|
|
1382
|
+
};
|
|
1307
1383
|
function FilterPopover({
|
|
1308
1384
|
label,
|
|
1309
1385
|
options,
|
|
1310
1386
|
selected,
|
|
1311
1387
|
onToggle,
|
|
1312
1388
|
width,
|
|
1313
|
-
noOptionsLabel
|
|
1389
|
+
noOptionsLabel,
|
|
1390
|
+
slotName = "data-table-faceted-filter"
|
|
1314
1391
|
}) {
|
|
1315
1392
|
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
1316
1393
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1317
1394
|
Button,
|
|
1318
1395
|
{
|
|
1319
1396
|
variant: "outline",
|
|
1320
|
-
"data-slot": "data-table-faceted-filter",
|
|
1321
1397
|
className: "h-11 rounded-2xl border-dashed border-border",
|
|
1398
|
+
slotName,
|
|
1322
1399
|
children: [
|
|
1323
1400
|
/* @__PURE__ */ jsx(PlusCircle, { className: "mr-2 size-4" }),
|
|
1324
1401
|
label,
|
|
@@ -1365,6 +1442,11 @@ function FacetedFilter({
|
|
|
1365
1442
|
filter,
|
|
1366
1443
|
noOptionsLabel
|
|
1367
1444
|
}) {
|
|
1445
|
+
const labels = useUiLabels(
|
|
1446
|
+
"dataTableFacetedFilter",
|
|
1447
|
+
dataTableFacetedFilterDefaultLabels,
|
|
1448
|
+
{ noOptionsLabel }
|
|
1449
|
+
);
|
|
1368
1450
|
const selected = new Set(column?.getFilterValue() ?? []);
|
|
1369
1451
|
const toggle = (value) => {
|
|
1370
1452
|
const next = new Set(selected);
|
|
@@ -1384,7 +1466,7 @@ function FacetedFilter({
|
|
|
1384
1466
|
selected,
|
|
1385
1467
|
onToggle: toggle,
|
|
1386
1468
|
width: "w-[220px]",
|
|
1387
|
-
noOptionsLabel
|
|
1469
|
+
noOptionsLabel: labels.noOptionsLabel
|
|
1388
1470
|
}
|
|
1389
1471
|
);
|
|
1390
1472
|
}
|
|
@@ -1394,6 +1476,11 @@ function ServerFacetedFilter({
|
|
|
1394
1476
|
onChange,
|
|
1395
1477
|
noOptionsLabel
|
|
1396
1478
|
}) {
|
|
1479
|
+
const labels = useUiLabels(
|
|
1480
|
+
"dataTableFacetedFilter",
|
|
1481
|
+
dataTableFacetedFilterDefaultLabels,
|
|
1482
|
+
{ noOptionsLabel }
|
|
1483
|
+
);
|
|
1397
1484
|
const selectedSet = new Set(selected);
|
|
1398
1485
|
const toggle = (value) => {
|
|
1399
1486
|
const next = new Set(selectedSet);
|
|
@@ -1412,20 +1499,21 @@ function ServerFacetedFilter({
|
|
|
1412
1499
|
selected: selectedSet,
|
|
1413
1500
|
onToggle: toggle,
|
|
1414
1501
|
width: "w-[240px]",
|
|
1415
|
-
noOptionsLabel
|
|
1502
|
+
noOptionsLabel: labels.noOptionsLabel
|
|
1416
1503
|
}
|
|
1417
1504
|
);
|
|
1418
1505
|
}
|
|
1419
1506
|
function RowActionsMenu({
|
|
1420
1507
|
row,
|
|
1421
|
-
actions
|
|
1508
|
+
actions,
|
|
1509
|
+
slotName = "data-table-row-actions"
|
|
1422
1510
|
}) {
|
|
1423
1511
|
return /* @__PURE__ */ jsx(
|
|
1424
1512
|
"div",
|
|
1425
1513
|
{
|
|
1426
1514
|
className: "flex justify-end",
|
|
1427
|
-
"data-slot": "data-table-row-actions",
|
|
1428
1515
|
onClick: (event) => event.stopPropagation(),
|
|
1516
|
+
"data-slot": slotName,
|
|
1429
1517
|
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1430
1518
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1431
1519
|
Button,
|
|
@@ -1452,16 +1540,95 @@ function RowActionsMenu({
|
|
|
1452
1540
|
}
|
|
1453
1541
|
);
|
|
1454
1542
|
}
|
|
1455
|
-
var
|
|
1543
|
+
var emptyStateLabels = {
|
|
1544
|
+
title: "Nothing to show"
|
|
1545
|
+
};
|
|
1546
|
+
function EmptyState({
|
|
1547
|
+
icon: Icon2 = SearchX,
|
|
1548
|
+
title = emptyStateLabels.title,
|
|
1549
|
+
description,
|
|
1550
|
+
actions,
|
|
1551
|
+
compact = false,
|
|
1552
|
+
className,
|
|
1553
|
+
slotName = "empty-state"
|
|
1554
|
+
}) {
|
|
1555
|
+
return /* @__PURE__ */ jsxs(
|
|
1556
|
+
"div",
|
|
1557
|
+
{
|
|
1558
|
+
"data-compact": compact || void 0,
|
|
1559
|
+
className: cn(
|
|
1560
|
+
"flex h-full w-full flex-col items-center justify-center text-center",
|
|
1561
|
+
compact ? "gap-2 px-4 py-6" : "gap-3 px-6 py-12",
|
|
1562
|
+
className
|
|
1563
|
+
),
|
|
1564
|
+
"data-slot": slotName,
|
|
1565
|
+
children: [
|
|
1566
|
+
/* @__PURE__ */ jsx(
|
|
1567
|
+
"span",
|
|
1568
|
+
{
|
|
1569
|
+
"data-slot": "empty-state-icon",
|
|
1570
|
+
className: cn(
|
|
1571
|
+
"flex shrink-0 items-center justify-center rounded-full bg-surface-recessed text-muted-foreground",
|
|
1572
|
+
compact ? "size-8" : "size-10"
|
|
1573
|
+
),
|
|
1574
|
+
children: /* @__PURE__ */ jsx(Icon2, { className: compact ? "size-4" : "size-5" })
|
|
1575
|
+
}
|
|
1576
|
+
),
|
|
1577
|
+
/* @__PURE__ */ jsxs(
|
|
1578
|
+
"div",
|
|
1579
|
+
{
|
|
1580
|
+
className: cn(
|
|
1581
|
+
"max-w-md flex flex-col",
|
|
1582
|
+
compact ? "gap-0.5" : "gap-1"
|
|
1583
|
+
),
|
|
1584
|
+
children: [
|
|
1585
|
+
/* @__PURE__ */ jsx(
|
|
1586
|
+
"p",
|
|
1587
|
+
{
|
|
1588
|
+
"data-slot": "empty-state-title",
|
|
1589
|
+
className: cn(
|
|
1590
|
+
"font-semibold text-foreground",
|
|
1591
|
+
compact ? "text-sm" : "text-base"
|
|
1592
|
+
),
|
|
1593
|
+
children: title
|
|
1594
|
+
}
|
|
1595
|
+
),
|
|
1596
|
+
description && /* @__PURE__ */ jsx(
|
|
1597
|
+
"p",
|
|
1598
|
+
{
|
|
1599
|
+
"data-slot": "empty-state-description",
|
|
1600
|
+
className: "text-sm font-medium text-muted-foreground",
|
|
1601
|
+
children: description
|
|
1602
|
+
}
|
|
1603
|
+
)
|
|
1604
|
+
]
|
|
1605
|
+
}
|
|
1606
|
+
),
|
|
1607
|
+
actions && /* @__PURE__ */ jsx(
|
|
1608
|
+
"div",
|
|
1609
|
+
{
|
|
1610
|
+
"data-slot": "empty-state-actions",
|
|
1611
|
+
className: cn(
|
|
1612
|
+
"gap-2 flex flex-wrap items-center justify-center",
|
|
1613
|
+
compact ? "mt-1" : "mt-2"
|
|
1614
|
+
),
|
|
1615
|
+
children: actions
|
|
1616
|
+
}
|
|
1617
|
+
)
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
var Table = React3.forwardRef(({ className, slotName = "table-container", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1456
1623
|
"div",
|
|
1457
1624
|
{
|
|
1458
|
-
"data-slot": "table-container",
|
|
1459
1625
|
className: cn(
|
|
1460
1626
|
elevatedSurface,
|
|
1461
1627
|
nestedSurfaceReset,
|
|
1462
1628
|
nestedEdgeToEdge,
|
|
1463
1629
|
"relative w-full overflow-hidden bg-card"
|
|
1464
1630
|
),
|
|
1631
|
+
"data-slot": slotName,
|
|
1465
1632
|
children: /* @__PURE__ */ jsx(
|
|
1466
1633
|
"div",
|
|
1467
1634
|
{
|
|
@@ -1484,9 +1651,9 @@ var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1484
1651
|
}
|
|
1485
1652
|
));
|
|
1486
1653
|
Table.displayName = "Table";
|
|
1487
|
-
var TableHeader =
|
|
1654
|
+
var TableHeader = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1488
1655
|
TableHeader.displayName = "TableHeader";
|
|
1489
|
-
var TableBody =
|
|
1656
|
+
var TableBody = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1490
1657
|
"tbody",
|
|
1491
1658
|
{
|
|
1492
1659
|
ref,
|
|
@@ -1495,7 +1662,7 @@ var TableBody = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1495
1662
|
}
|
|
1496
1663
|
));
|
|
1497
1664
|
TableBody.displayName = "TableBody";
|
|
1498
|
-
var TableFooter =
|
|
1665
|
+
var TableFooter = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1499
1666
|
"tfoot",
|
|
1500
1667
|
{
|
|
1501
1668
|
ref,
|
|
@@ -1507,7 +1674,7 @@ var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1507
1674
|
}
|
|
1508
1675
|
));
|
|
1509
1676
|
TableFooter.displayName = "TableFooter";
|
|
1510
|
-
var TableRow =
|
|
1677
|
+
var TableRow = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1511
1678
|
"tr",
|
|
1512
1679
|
{
|
|
1513
1680
|
ref,
|
|
@@ -1519,7 +1686,7 @@ var TableRow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1519
1686
|
}
|
|
1520
1687
|
));
|
|
1521
1688
|
TableRow.displayName = "TableRow";
|
|
1522
|
-
var TableHead =
|
|
1689
|
+
var TableHead = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1523
1690
|
"th",
|
|
1524
1691
|
{
|
|
1525
1692
|
ref,
|
|
@@ -1531,7 +1698,7 @@ var TableHead = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1531
1698
|
}
|
|
1532
1699
|
));
|
|
1533
1700
|
TableHead.displayName = "TableHead";
|
|
1534
|
-
var TableCell =
|
|
1701
|
+
var TableCell = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1535
1702
|
"td",
|
|
1536
1703
|
{
|
|
1537
1704
|
ref,
|
|
@@ -1543,7 +1710,7 @@ var TableCell = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1543
1710
|
}
|
|
1544
1711
|
));
|
|
1545
1712
|
TableCell.displayName = "TableCell";
|
|
1546
|
-
var TableCaption =
|
|
1713
|
+
var TableCaption = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1547
1714
|
"caption",
|
|
1548
1715
|
{
|
|
1549
1716
|
ref,
|
|
@@ -1568,11 +1735,20 @@ function pageRange(current, last) {
|
|
|
1568
1735
|
pages.push(last);
|
|
1569
1736
|
return pages;
|
|
1570
1737
|
}
|
|
1738
|
+
var dataTableDefaultLabels = {
|
|
1739
|
+
searchPlaceholder: "Search...",
|
|
1740
|
+
emptyLabel: "No results.",
|
|
1741
|
+
createLabel: "New",
|
|
1742
|
+
clearFiltersLabel: "Clear filters",
|
|
1743
|
+
paginationLabel: (page, pages) => `Page ${page} of ${pages}`,
|
|
1744
|
+
noOptionsLabel: "No options.",
|
|
1745
|
+
totalLabel: (total) => `${total.toLocaleString("en-US")} records`
|
|
1746
|
+
};
|
|
1571
1747
|
function DataTable({
|
|
1572
1748
|
columns,
|
|
1573
1749
|
data,
|
|
1574
1750
|
searchKey,
|
|
1575
|
-
searchPlaceholder
|
|
1751
|
+
searchPlaceholder,
|
|
1576
1752
|
pageSize = 10,
|
|
1577
1753
|
pageSizeOptions = [10, 25, 50, 100],
|
|
1578
1754
|
onPageSizeChange,
|
|
@@ -1584,11 +1760,11 @@ function DataTable({
|
|
|
1584
1760
|
onClearFilters,
|
|
1585
1761
|
toolbarExtra,
|
|
1586
1762
|
toolbarAction,
|
|
1587
|
-
emptyLabel
|
|
1588
|
-
clearFiltersLabel
|
|
1589
|
-
paginationLabel
|
|
1590
|
-
noOptionsLabel
|
|
1591
|
-
totalLabel
|
|
1763
|
+
emptyLabel,
|
|
1764
|
+
clearFiltersLabel,
|
|
1765
|
+
paginationLabel,
|
|
1766
|
+
noOptionsLabel,
|
|
1767
|
+
totalLabel,
|
|
1592
1768
|
renderRow,
|
|
1593
1769
|
onRowClick,
|
|
1594
1770
|
isRowActive,
|
|
@@ -1601,8 +1777,18 @@ function DataTable({
|
|
|
1601
1777
|
total,
|
|
1602
1778
|
onPageChange,
|
|
1603
1779
|
onCreate,
|
|
1604
|
-
createLabel
|
|
1605
|
-
|
|
1780
|
+
createLabel,
|
|
1781
|
+
slotName = "data-table"
|
|
1782
|
+
}) {
|
|
1783
|
+
const labels = useUiLabels("dataTable", dataTableDefaultLabels, {
|
|
1784
|
+
searchPlaceholder,
|
|
1785
|
+
emptyLabel,
|
|
1786
|
+
createLabel,
|
|
1787
|
+
clearFiltersLabel,
|
|
1788
|
+
paginationLabel,
|
|
1789
|
+
noOptionsLabel,
|
|
1790
|
+
totalLabel
|
|
1791
|
+
});
|
|
1606
1792
|
const [sorting, setSorting] = useState([]);
|
|
1607
1793
|
const [globalFilter, setGlobalFilter] = useState("");
|
|
1608
1794
|
const [columnFilters, setColumnFilters] = useState([]);
|
|
@@ -1658,8 +1844,8 @@ function DataTable({
|
|
|
1658
1844
|
return /* @__PURE__ */ jsxs(
|
|
1659
1845
|
"div",
|
|
1660
1846
|
{
|
|
1661
|
-
"data-slot": "data-table",
|
|
1662
1847
|
className: cn(elevatedSurface, "space-y-4 p-5 bg-card"),
|
|
1848
|
+
"data-slot": slotName,
|
|
1663
1849
|
children: [
|
|
1664
1850
|
hasToolbar && /* @__PURE__ */ jsxs("div", { className: "gap-2 flex flex-wrap items-center", children: [
|
|
1665
1851
|
searchKey !== void 0 && /* @__PURE__ */ jsxs("div", { className: "relative min-w-[200px] flex-1", children: [
|
|
@@ -1669,8 +1855,8 @@ function DataTable({
|
|
|
1669
1855
|
{
|
|
1670
1856
|
value: serverSearch ? searchValue ?? "" : globalFilter,
|
|
1671
1857
|
onChange: (e) => serverSearch ? onSearchChange?.(e.target.value) : setGlobalFilter(e.target.value),
|
|
1672
|
-
placeholder: searchPlaceholder,
|
|
1673
|
-
className:
|
|
1858
|
+
placeholder: labels.searchPlaceholder,
|
|
1859
|
+
className: `h-11 rounded-2xl pl-11 font-medium border-none bg-muted/50 focus:bg-muted ${quietFocus}`
|
|
1674
1860
|
}
|
|
1675
1861
|
)
|
|
1676
1862
|
] }),
|
|
@@ -1679,7 +1865,7 @@ function DataTable({
|
|
|
1679
1865
|
{
|
|
1680
1866
|
column: table.getColumn(filter.columnId),
|
|
1681
1867
|
filter,
|
|
1682
|
-
noOptionsLabel
|
|
1868
|
+
noOptionsLabel: labels.noOptionsLabel
|
|
1683
1869
|
},
|
|
1684
1870
|
filter.columnId
|
|
1685
1871
|
)),
|
|
@@ -1689,7 +1875,7 @@ function DataTable({
|
|
|
1689
1875
|
filter,
|
|
1690
1876
|
selected: filterValues?.[filter.paramKey] ?? [],
|
|
1691
1877
|
onChange: (values) => onFilterChange?.(filter.paramKey, values),
|
|
1692
|
-
noOptionsLabel
|
|
1878
|
+
noOptionsLabel: labels.noOptionsLabel
|
|
1693
1879
|
},
|
|
1694
1880
|
filter.paramKey
|
|
1695
1881
|
)),
|
|
@@ -1708,7 +1894,7 @@ function DataTable({
|
|
|
1708
1894
|
},
|
|
1709
1895
|
className: "h-11 rounded-2xl",
|
|
1710
1896
|
children: [
|
|
1711
|
-
clearFiltersLabel,
|
|
1897
|
+
labels.clearFiltersLabel,
|
|
1712
1898
|
/* @__PURE__ */ jsx(X, { className: "ml-1 size-4" })
|
|
1713
1899
|
]
|
|
1714
1900
|
}
|
|
@@ -1717,7 +1903,7 @@ function DataTable({
|
|
|
1717
1903
|
Button,
|
|
1718
1904
|
{
|
|
1719
1905
|
onClick: onCreate,
|
|
1720
|
-
"aria-label": createLabel,
|
|
1906
|
+
"aria-label": labels.createLabel,
|
|
1721
1907
|
size: "icon",
|
|
1722
1908
|
className: "size-11 rounded-2xl shrink-0 cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1723
1909
|
children: /* @__PURE__ */ jsx(Plus, { className: "size-5" })
|
|
@@ -1787,8 +1973,8 @@ function DataTable({
|
|
|
1787
1973
|
TableCell,
|
|
1788
1974
|
{
|
|
1789
1975
|
colSpan: tableColumns.length,
|
|
1790
|
-
className: "h-24
|
|
1791
|
-
children: emptyLabel
|
|
1976
|
+
className: "h-24 p-0",
|
|
1977
|
+
children: /* @__PURE__ */ jsx(EmptyState, { compact: true, title: labels.emptyLabel })
|
|
1792
1978
|
}
|
|
1793
1979
|
) }) })
|
|
1794
1980
|
] }),
|
|
@@ -1814,8 +2000,8 @@ function DataTable({
|
|
|
1814
2000
|
}
|
|
1815
2001
|
),
|
|
1816
2002
|
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
1817
|
-
paginationLabel(currentPage, lastPage),
|
|
1818
|
-
total !== void 0 && ` \xB7 ${totalLabel(total)}`
|
|
2003
|
+
labels.paginationLabel(currentPage, lastPage),
|
|
2004
|
+
total !== void 0 && ` \xB7 ${labels.totalLabel(total)}`
|
|
1819
2005
|
] })
|
|
1820
2006
|
] }),
|
|
1821
2007
|
/* @__PURE__ */ jsxs("div", { className: "gap-1.5 flex items-center", children: [
|
|
@@ -1869,117 +2055,282 @@ function DataTable({
|
|
|
1869
2055
|
}
|
|
1870
2056
|
);
|
|
1871
2057
|
}
|
|
1872
|
-
function
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
dateFormat = "dd MMM yy"
|
|
2058
|
+
function CalendarPopover({
|
|
2059
|
+
open,
|
|
2060
|
+
onOpenChange,
|
|
2061
|
+
trigger,
|
|
2062
|
+
align = "start",
|
|
2063
|
+
className,
|
|
2064
|
+
children,
|
|
2065
|
+
slotName = "calendar-popover"
|
|
1881
2066
|
}) {
|
|
1882
|
-
|
|
1883
|
-
|
|
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
|
-
) }),
|
|
2067
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange, children: [
|
|
2068
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
1911
2069
|
/* @__PURE__ */ jsx(
|
|
1912
2070
|
PopoverContent,
|
|
1913
2071
|
{
|
|
1914
|
-
className: "p-2 w-auto",
|
|
1915
|
-
align
|
|
2072
|
+
className: cn("p-2 w-auto", className),
|
|
2073
|
+
align,
|
|
1916
2074
|
sideOffset: 4,
|
|
1917
2075
|
collisionPadding: 16,
|
|
2076
|
+
slotName,
|
|
2077
|
+
children
|
|
2078
|
+
}
|
|
2079
|
+
)
|
|
2080
|
+
] });
|
|
2081
|
+
}
|
|
2082
|
+
var datePickerDefaultLabels = {
|
|
2083
|
+
placeholder: "Pick a date",
|
|
2084
|
+
dateFormat: "dd MMM yy",
|
|
2085
|
+
clearLabel: "Clear date"
|
|
2086
|
+
};
|
|
2087
|
+
var triggerClasses = `h-11 px-4 text-sm font-medium flex w-full cursor-pointer items-center gap-2 text-left transition-all disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 ${fieldSurface} ${focusRing}`;
|
|
2088
|
+
function boundaries(minDate, maxDate, disabledDays) {
|
|
2089
|
+
const matchers = [];
|
|
2090
|
+
if (minDate) {
|
|
2091
|
+
matchers.push({ before: minDate });
|
|
2092
|
+
}
|
|
2093
|
+
if (maxDate) {
|
|
2094
|
+
matchers.push({ after: maxDate });
|
|
2095
|
+
}
|
|
2096
|
+
if (disabledDays) {
|
|
2097
|
+
matchers.push(disabledDays);
|
|
2098
|
+
}
|
|
2099
|
+
return matchers;
|
|
2100
|
+
}
|
|
2101
|
+
function DatePicker(props) {
|
|
2102
|
+
const {
|
|
2103
|
+
value,
|
|
2104
|
+
defaultValue,
|
|
2105
|
+
onChange,
|
|
2106
|
+
minDate,
|
|
2107
|
+
maxDate,
|
|
2108
|
+
disabledDays,
|
|
2109
|
+
disabled = false,
|
|
2110
|
+
clearable = true,
|
|
2111
|
+
invalid = false,
|
|
2112
|
+
required,
|
|
2113
|
+
formatDate,
|
|
2114
|
+
placeholder,
|
|
2115
|
+
dateFormat,
|
|
2116
|
+
clearLabel,
|
|
2117
|
+
className,
|
|
2118
|
+
"aria-invalid": ariaInvalid,
|
|
2119
|
+
slotName = "date-picker",
|
|
2120
|
+
...trigger
|
|
2121
|
+
} = props;
|
|
2122
|
+
const labels = useUiLabels("datePicker", datePickerDefaultLabels, {
|
|
2123
|
+
placeholder,
|
|
2124
|
+
dateFormat,
|
|
2125
|
+
clearLabel
|
|
2126
|
+
});
|
|
2127
|
+
const [open, setOpen] = useState(false);
|
|
2128
|
+
const [ownValue, setOwnValue] = useState(defaultValue);
|
|
2129
|
+
const isControlled = "value" in props;
|
|
2130
|
+
const selected = isControlled ? value : ownValue;
|
|
2131
|
+
const showClear = clearable && !disabled && selected !== void 0;
|
|
2132
|
+
const label = selected ? formatDate?.(selected) ?? format(selected, labels.dateFormat) : labels.placeholder;
|
|
2133
|
+
function commit(next) {
|
|
2134
|
+
if (!isControlled) {
|
|
2135
|
+
setOwnValue(next);
|
|
2136
|
+
}
|
|
2137
|
+
onChange?.(next);
|
|
2138
|
+
}
|
|
2139
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full", className), "data-slot": slotName, children: [
|
|
2140
|
+
/* @__PURE__ */ jsx(
|
|
2141
|
+
CalendarPopover,
|
|
2142
|
+
{
|
|
2143
|
+
open,
|
|
2144
|
+
onOpenChange: setOpen,
|
|
2145
|
+
trigger: /* @__PURE__ */ jsxs(
|
|
2146
|
+
"button",
|
|
2147
|
+
{
|
|
2148
|
+
...trigger,
|
|
2149
|
+
type: "button",
|
|
2150
|
+
"data-slot": "date-picker-trigger",
|
|
2151
|
+
disabled,
|
|
2152
|
+
"aria-required": required || void 0,
|
|
2153
|
+
"aria-invalid": ariaInvalid ?? (invalid || void 0),
|
|
2154
|
+
className: cn(triggerClasses, showClear && "pr-11"),
|
|
2155
|
+
children: [
|
|
2156
|
+
/* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0 opacity-60" }),
|
|
2157
|
+
/* @__PURE__ */ jsx(
|
|
2158
|
+
"span",
|
|
2159
|
+
{
|
|
2160
|
+
className: cn(
|
|
2161
|
+
"truncate",
|
|
2162
|
+
!selected && "text-muted-foreground"
|
|
2163
|
+
),
|
|
2164
|
+
children: label
|
|
2165
|
+
}
|
|
2166
|
+
)
|
|
2167
|
+
]
|
|
2168
|
+
}
|
|
2169
|
+
),
|
|
1918
2170
|
children: /* @__PURE__ */ jsx(
|
|
1919
2171
|
Calendar,
|
|
1920
2172
|
{
|
|
1921
|
-
mode: "
|
|
1922
|
-
|
|
1923
|
-
defaultMonth: parse(from),
|
|
2173
|
+
mode: "single",
|
|
2174
|
+
autoFocus: true,
|
|
1924
2175
|
selected,
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2176
|
+
defaultMonth: selected ?? minDate,
|
|
2177
|
+
startMonth: minDate,
|
|
2178
|
+
endMonth: maxDate,
|
|
2179
|
+
disabled: boundaries(minDate, maxDate, disabledDays),
|
|
2180
|
+
onSelect: (date) => {
|
|
2181
|
+
if (!date) {
|
|
2182
|
+
return;
|
|
2183
|
+
}
|
|
2184
|
+
commit(date);
|
|
2185
|
+
setOpen(false);
|
|
2186
|
+
},
|
|
1929
2187
|
className: "rounded-2xl bg-transparent"
|
|
1930
2188
|
}
|
|
1931
2189
|
)
|
|
1932
2190
|
}
|
|
2191
|
+
),
|
|
2192
|
+
showClear && /* @__PURE__ */ jsx(
|
|
2193
|
+
"button",
|
|
2194
|
+
{
|
|
2195
|
+
type: "button",
|
|
2196
|
+
"data-slot": "date-picker-clear",
|
|
2197
|
+
"aria-label": labels.clearLabel,
|
|
2198
|
+
onClick: () => commit(void 0),
|
|
2199
|
+
className: `size-7 rounded-xl right-2 absolute top-1/2 inline-flex -translate-y-1/2 cursor-pointer items-center justify-center text-muted-foreground hover:text-foreground ${focusRing}`,
|
|
2200
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
|
|
2201
|
+
}
|
|
1933
2202
|
)
|
|
1934
2203
|
] });
|
|
1935
2204
|
}
|
|
2205
|
+
function parse(value) {
|
|
2206
|
+
return value ? /* @__PURE__ */ new Date(`${value}T00:00:00`) : void 0;
|
|
2207
|
+
}
|
|
2208
|
+
var dateRangeFilterDefaultLabels = {
|
|
2209
|
+
emptyLabel: "Date range",
|
|
2210
|
+
dateFormat: "dd MMM yy"
|
|
2211
|
+
};
|
|
2212
|
+
function DateRangeFilter({
|
|
2213
|
+
from,
|
|
2214
|
+
to,
|
|
2215
|
+
onChange,
|
|
2216
|
+
emptyLabel,
|
|
2217
|
+
dateFormat,
|
|
2218
|
+
className,
|
|
2219
|
+
slotName = "date-range-filter",
|
|
2220
|
+
...trigger
|
|
2221
|
+
}) {
|
|
2222
|
+
const labels = useUiLabels(
|
|
2223
|
+
"dateRangeFilter",
|
|
2224
|
+
dateRangeFilterDefaultLabels,
|
|
2225
|
+
{ emptyLabel, dateFormat }
|
|
2226
|
+
);
|
|
2227
|
+
const [open, setOpen] = useState(false);
|
|
2228
|
+
const selected = from || to ? { from: parse(from), to: parse(to) } : void 0;
|
|
2229
|
+
const label = from ? to && to !== from ? `${format(parse(from), labels.dateFormat)} - ${format(parse(to), labels.dateFormat)}` : format(parse(from), labels.dateFormat) : labels.emptyLabel;
|
|
2230
|
+
return /* @__PURE__ */ jsx(
|
|
2231
|
+
CalendarPopover,
|
|
2232
|
+
{
|
|
2233
|
+
open,
|
|
2234
|
+
onOpenChange: setOpen,
|
|
2235
|
+
align: "end",
|
|
2236
|
+
trigger: /* @__PURE__ */ jsxs(
|
|
2237
|
+
Button,
|
|
2238
|
+
{
|
|
2239
|
+
variant: "outline",
|
|
2240
|
+
...trigger,
|
|
2241
|
+
className: cn(
|
|
2242
|
+
"h-11 rounded-2xl cursor-pointer border-dashed border-border",
|
|
2243
|
+
className
|
|
2244
|
+
),
|
|
2245
|
+
slotName,
|
|
2246
|
+
children: [
|
|
2247
|
+
/* @__PURE__ */ jsx(CalendarRange, { className: "mr-2 size-4" }),
|
|
2248
|
+
label,
|
|
2249
|
+
(from || to) && /* @__PURE__ */ jsx(
|
|
2250
|
+
"span",
|
|
2251
|
+
{
|
|
2252
|
+
role: "button",
|
|
2253
|
+
tabIndex: 0,
|
|
2254
|
+
onClick: (event) => {
|
|
2255
|
+
event.stopPropagation();
|
|
2256
|
+
onChange({ from: void 0, to: void 0 });
|
|
2257
|
+
},
|
|
2258
|
+
className: "ml-2 inline-flex",
|
|
2259
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5 opacity-60 hover:opacity-100" })
|
|
2260
|
+
}
|
|
2261
|
+
)
|
|
2262
|
+
]
|
|
2263
|
+
}
|
|
2264
|
+
),
|
|
2265
|
+
children: /* @__PURE__ */ jsx(
|
|
2266
|
+
Calendar,
|
|
2267
|
+
{
|
|
2268
|
+
mode: "range",
|
|
2269
|
+
numberOfMonths: 2,
|
|
2270
|
+
defaultMonth: parse(from),
|
|
2271
|
+
selected,
|
|
2272
|
+
onSelect: (range) => onChange({
|
|
2273
|
+
from: range?.from ? format(range.from, "yyyy-MM-dd") : void 0,
|
|
2274
|
+
to: range?.to ? format(range.to, "yyyy-MM-dd") : void 0
|
|
2275
|
+
}),
|
|
2276
|
+
className: "rounded-2xl bg-transparent"
|
|
2277
|
+
}
|
|
2278
|
+
)
|
|
2279
|
+
}
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
1936
2282
|
function Drawer({
|
|
2283
|
+
slotName = "drawer",
|
|
1937
2284
|
...props
|
|
1938
2285
|
}) {
|
|
1939
|
-
return /* @__PURE__ */ jsx(Drawer$1.Root, { "data-slot":
|
|
2286
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, { ...props, "data-slot": slotName });
|
|
1940
2287
|
}
|
|
1941
2288
|
function DrawerTrigger({
|
|
2289
|
+
slotName = "drawer-trigger",
|
|
1942
2290
|
...props
|
|
1943
2291
|
}) {
|
|
1944
|
-
return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot":
|
|
2292
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, { ...props, "data-slot": slotName });
|
|
1945
2293
|
}
|
|
1946
2294
|
function DrawerPortal({
|
|
2295
|
+
slotName = "drawer-portal",
|
|
1947
2296
|
...props
|
|
1948
2297
|
}) {
|
|
1949
|
-
return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot":
|
|
2298
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, { ...props, "data-slot": slotName });
|
|
1950
2299
|
}
|
|
1951
2300
|
function DrawerClose({
|
|
2301
|
+
slotName = "drawer-close",
|
|
1952
2302
|
...props
|
|
1953
2303
|
}) {
|
|
1954
|
-
return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot":
|
|
2304
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, { ...props, "data-slot": slotName });
|
|
1955
2305
|
}
|
|
1956
2306
|
function DrawerOverlay({
|
|
1957
2307
|
className,
|
|
2308
|
+
slotName = "drawer-overlay",
|
|
1958
2309
|
...props
|
|
1959
2310
|
}) {
|
|
1960
2311
|
return /* @__PURE__ */ jsx(
|
|
1961
2312
|
Drawer$1.Overlay,
|
|
1962
2313
|
{
|
|
1963
|
-
"data-slot": "drawer-overlay",
|
|
1964
2314
|
className: cn(
|
|
1965
2315
|
"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
2316
|
className
|
|
1967
2317
|
),
|
|
1968
|
-
...props
|
|
2318
|
+
...props,
|
|
2319
|
+
"data-slot": slotName
|
|
1969
2320
|
}
|
|
1970
2321
|
);
|
|
1971
2322
|
}
|
|
1972
2323
|
function DrawerContent({
|
|
1973
2324
|
className,
|
|
1974
2325
|
children,
|
|
2326
|
+
slotName = "drawer-content",
|
|
1975
2327
|
...props
|
|
1976
2328
|
}) {
|
|
1977
|
-
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
2329
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { slotName: "drawer-portal", children: [
|
|
1978
2330
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
1979
2331
|
/* @__PURE__ */ jsxs(
|
|
1980
2332
|
Drawer$1.Content,
|
|
1981
2333
|
{
|
|
1982
|
-
"data-slot": "drawer-content",
|
|
1983
2334
|
className: cn(
|
|
1984
2335
|
`${floatingSurface} group/drawer-content fixed z-50 flex h-auto flex-col border-border`,
|
|
1985
2336
|
"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",
|
|
@@ -1989,6 +2340,7 @@ function DrawerContent({
|
|
|
1989
2340
|
className
|
|
1990
2341
|
),
|
|
1991
2342
|
...props,
|
|
2343
|
+
"data-slot": slotName,
|
|
1992
2344
|
children: [
|
|
1993
2345
|
/* @__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
2346
|
children
|
|
@@ -1997,70 +2349,221 @@ function DrawerContent({
|
|
|
1997
2349
|
)
|
|
1998
2350
|
] });
|
|
1999
2351
|
}
|
|
2000
|
-
function DrawerHeader({
|
|
2352
|
+
function DrawerHeader({
|
|
2353
|
+
className,
|
|
2354
|
+
slotName = "drawer-header",
|
|
2355
|
+
...props
|
|
2356
|
+
}) {
|
|
2001
2357
|
return /* @__PURE__ */ jsx(
|
|
2002
2358
|
"div",
|
|
2003
2359
|
{
|
|
2004
|
-
"data-slot": "drawer-header",
|
|
2005
2360
|
className: cn(
|
|
2006
2361
|
"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
2362
|
className
|
|
2008
2363
|
),
|
|
2009
|
-
...props
|
|
2364
|
+
...props,
|
|
2365
|
+
"data-slot": slotName
|
|
2366
|
+
}
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
function DrawerFooter({
|
|
2370
|
+
className,
|
|
2371
|
+
slotName = "drawer-footer",
|
|
2372
|
+
...props
|
|
2373
|
+
}) {
|
|
2374
|
+
return /* @__PURE__ */ jsx(
|
|
2375
|
+
"div",
|
|
2376
|
+
{
|
|
2377
|
+
className: cn("gap-2 p-4 mt-auto flex flex-col", className),
|
|
2378
|
+
...props,
|
|
2379
|
+
"data-slot": slotName
|
|
2380
|
+
}
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2383
|
+
function DrawerTitle({
|
|
2384
|
+
className,
|
|
2385
|
+
slotName = "drawer-title",
|
|
2386
|
+
...props
|
|
2387
|
+
}) {
|
|
2388
|
+
return /* @__PURE__ */ jsx(
|
|
2389
|
+
Drawer$1.Title,
|
|
2390
|
+
{
|
|
2391
|
+
className: cn("font-semibold text-foreground", className),
|
|
2392
|
+
...props,
|
|
2393
|
+
"data-slot": slotName
|
|
2394
|
+
}
|
|
2395
|
+
);
|
|
2396
|
+
}
|
|
2397
|
+
function DrawerDescription({
|
|
2398
|
+
className,
|
|
2399
|
+
slotName = "drawer-description",
|
|
2400
|
+
...props
|
|
2401
|
+
}) {
|
|
2402
|
+
return /* @__PURE__ */ jsx(
|
|
2403
|
+
Drawer$1.Description,
|
|
2404
|
+
{
|
|
2405
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
2406
|
+
...props,
|
|
2407
|
+
"data-slot": slotName
|
|
2408
|
+
}
|
|
2409
|
+
);
|
|
2410
|
+
}
|
|
2411
|
+
function Field({
|
|
2412
|
+
className,
|
|
2413
|
+
children,
|
|
2414
|
+
id,
|
|
2415
|
+
orientation = "vertical",
|
|
2416
|
+
error,
|
|
2417
|
+
invalid,
|
|
2418
|
+
required = false,
|
|
2419
|
+
slotName = "field",
|
|
2420
|
+
...props
|
|
2421
|
+
}) {
|
|
2422
|
+
const generatedId = React3.useId();
|
|
2423
|
+
const fieldId = id ?? generatedId;
|
|
2424
|
+
const [hasDescription, setHasDescription] = React3.useState(false);
|
|
2425
|
+
const isInvalid = invalid ?? Boolean(error);
|
|
2426
|
+
const field = React3.useMemo(
|
|
2427
|
+
() => ({
|
|
2428
|
+
controlId: fieldId,
|
|
2429
|
+
descriptionId: `${fieldId}-description`,
|
|
2430
|
+
errorId: `${fieldId}-error`,
|
|
2431
|
+
orientation,
|
|
2432
|
+
invalid: isInvalid,
|
|
2433
|
+
required,
|
|
2434
|
+
hasDescription,
|
|
2435
|
+
setHasDescription
|
|
2436
|
+
}),
|
|
2437
|
+
[fieldId, orientation, isInvalid, required, hasDescription]
|
|
2438
|
+
);
|
|
2439
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, { value: field, children: /* @__PURE__ */ jsxs(
|
|
2440
|
+
"div",
|
|
2441
|
+
{
|
|
2442
|
+
"data-orientation": orientation,
|
|
2443
|
+
"data-invalid": isInvalid ? "true" : void 0,
|
|
2444
|
+
className: cn(
|
|
2445
|
+
"group/field",
|
|
2446
|
+
orientation === "horizontal" ? "gap-x-4 gap-y-1 grid grid-cols-[1fr_auto] items-center" : "gap-2 flex flex-col",
|
|
2447
|
+
className
|
|
2448
|
+
),
|
|
2449
|
+
...props,
|
|
2450
|
+
"data-slot": slotName,
|
|
2451
|
+
children: [
|
|
2452
|
+
children,
|
|
2453
|
+
/* @__PURE__ */ jsx(FieldError, { message: error })
|
|
2454
|
+
]
|
|
2010
2455
|
}
|
|
2011
|
-
);
|
|
2456
|
+
) });
|
|
2012
2457
|
}
|
|
2013
|
-
function
|
|
2458
|
+
function FieldGroup({
|
|
2459
|
+
className,
|
|
2460
|
+
slotName = "field-group",
|
|
2461
|
+
...props
|
|
2462
|
+
}) {
|
|
2014
2463
|
return /* @__PURE__ */ jsx(
|
|
2015
2464
|
"div",
|
|
2016
2465
|
{
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2466
|
+
className: cn("gap-6 flex w-full flex-col", className),
|
|
2467
|
+
...props,
|
|
2468
|
+
"data-slot": slotName
|
|
2020
2469
|
}
|
|
2021
2470
|
);
|
|
2022
2471
|
}
|
|
2023
|
-
function
|
|
2472
|
+
function FieldLabel({
|
|
2024
2473
|
className,
|
|
2474
|
+
children,
|
|
2475
|
+
requiredLabel = "Required",
|
|
2476
|
+
slotName = "field-label",
|
|
2025
2477
|
...props
|
|
2026
2478
|
}) {
|
|
2027
|
-
|
|
2028
|
-
|
|
2479
|
+
const { controlId, invalid, required } = useField();
|
|
2480
|
+
return /* @__PURE__ */ jsxs(
|
|
2481
|
+
Label,
|
|
2029
2482
|
{
|
|
2030
|
-
|
|
2031
|
-
className: cn(
|
|
2032
|
-
|
|
2483
|
+
htmlFor: controlId,
|
|
2484
|
+
className: cn(
|
|
2485
|
+
"gap-1 flex items-center group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-1",
|
|
2486
|
+
invalid && "text-destructive",
|
|
2487
|
+
className
|
|
2488
|
+
),
|
|
2489
|
+
...props,
|
|
2490
|
+
slotName,
|
|
2491
|
+
children: [
|
|
2492
|
+
children,
|
|
2493
|
+
required ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2494
|
+
/* @__PURE__ */ jsx(
|
|
2495
|
+
"span",
|
|
2496
|
+
{
|
|
2497
|
+
"data-slot": "field-required",
|
|
2498
|
+
"aria-hidden": "true",
|
|
2499
|
+
className: "text-destructive",
|
|
2500
|
+
children: "*"
|
|
2501
|
+
}
|
|
2502
|
+
),
|
|
2503
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: requiredLabel })
|
|
2504
|
+
] }) : null
|
|
2505
|
+
]
|
|
2033
2506
|
}
|
|
2034
2507
|
);
|
|
2035
2508
|
}
|
|
2036
|
-
function
|
|
2509
|
+
function FieldDescription({
|
|
2037
2510
|
className,
|
|
2511
|
+
slotName = "field-description",
|
|
2038
2512
|
...props
|
|
2039
2513
|
}) {
|
|
2514
|
+
const { descriptionId, setHasDescription } = useField();
|
|
2515
|
+
React3.useEffect(() => {
|
|
2516
|
+
setHasDescription(true);
|
|
2517
|
+
return () => setHasDescription(false);
|
|
2518
|
+
}, [setHasDescription]);
|
|
2040
2519
|
return /* @__PURE__ */ jsx(
|
|
2041
|
-
|
|
2520
|
+
"p",
|
|
2042
2521
|
{
|
|
2043
|
-
|
|
2044
|
-
className: cn(
|
|
2045
|
-
|
|
2522
|
+
id: descriptionId,
|
|
2523
|
+
className: cn(
|
|
2524
|
+
"ml-1 text-xs font-medium text-muted-foreground group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-2",
|
|
2525
|
+
className
|
|
2526
|
+
),
|
|
2527
|
+
...props,
|
|
2528
|
+
"data-slot": slotName
|
|
2046
2529
|
}
|
|
2047
2530
|
);
|
|
2048
2531
|
}
|
|
2049
|
-
function
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2532
|
+
function FieldControl({
|
|
2533
|
+
className,
|
|
2534
|
+
...props
|
|
2535
|
+
}) {
|
|
2536
|
+
const {
|
|
2537
|
+
controlId,
|
|
2538
|
+
descriptionId,
|
|
2539
|
+
errorId,
|
|
2540
|
+
invalid,
|
|
2541
|
+
required,
|
|
2542
|
+
hasDescription
|
|
2543
|
+
} = useField();
|
|
2544
|
+
const requiredProps = required ? { required: true } : {};
|
|
2545
|
+
const describedBy = [
|
|
2546
|
+
hasDescription ? descriptionId : null,
|
|
2547
|
+
invalid ? errorId : null
|
|
2548
|
+
].filter(Boolean).join(" ");
|
|
2053
2549
|
return /* @__PURE__ */ jsx(
|
|
2054
|
-
|
|
2550
|
+
Slot,
|
|
2055
2551
|
{
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2552
|
+
"data-field-control": "true",
|
|
2553
|
+
id: controlId,
|
|
2554
|
+
"aria-describedby": describedBy || void 0,
|
|
2555
|
+
"aria-invalid": invalid ? true : void 0,
|
|
2556
|
+
...requiredProps,
|
|
2557
|
+
className: cn(
|
|
2558
|
+
"group-data-[orientation=horizontal]/field:col-start-2 group-data-[orientation=horizontal]/field:row-span-2 group-data-[orientation=horizontal]/field:row-start-1 group-data-[orientation=horizontal]/field:justify-self-end",
|
|
2559
|
+
className
|
|
2560
|
+
),
|
|
2561
|
+
...props
|
|
2059
2562
|
}
|
|
2060
2563
|
);
|
|
2061
2564
|
}
|
|
2062
2565
|
var Form = FormProvider;
|
|
2063
|
-
var FormFieldContext =
|
|
2566
|
+
var FormFieldContext = React3.createContext(
|
|
2064
2567
|
{}
|
|
2065
2568
|
);
|
|
2066
2569
|
var FormField = ({
|
|
@@ -2069,8 +2572,8 @@ var FormField = ({
|
|
|
2069
2572
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
2070
2573
|
};
|
|
2071
2574
|
var useFormField = () => {
|
|
2072
|
-
const fieldContext =
|
|
2073
|
-
const itemContext =
|
|
2575
|
+
const fieldContext = React3.useContext(FormFieldContext);
|
|
2576
|
+
const itemContext = React3.useContext(FormItemContext);
|
|
2074
2577
|
const { getFieldState, formState } = useFormContext();
|
|
2075
2578
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
2076
2579
|
if (!fieldContext) {
|
|
@@ -2086,23 +2589,23 @@ var useFormField = () => {
|
|
|
2086
2589
|
...fieldState
|
|
2087
2590
|
};
|
|
2088
2591
|
};
|
|
2089
|
-
var FormItemContext =
|
|
2592
|
+
var FormItemContext = React3.createContext(
|
|
2090
2593
|
{}
|
|
2091
2594
|
);
|
|
2092
|
-
var FormItem =
|
|
2093
|
-
const id =
|
|
2595
|
+
var FormItem = React3.forwardRef(({ className, slotName = "form-item", ...props }, ref) => {
|
|
2596
|
+
const id = React3.useId();
|
|
2094
2597
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
|
|
2095
2598
|
"div",
|
|
2096
2599
|
{
|
|
2097
2600
|
ref,
|
|
2098
2601
|
className: cn("space-y-2", className),
|
|
2099
|
-
|
|
2100
|
-
|
|
2602
|
+
...props,
|
|
2603
|
+
"data-slot": slotName
|
|
2101
2604
|
}
|
|
2102
2605
|
) });
|
|
2103
2606
|
});
|
|
2104
2607
|
FormItem.displayName = "FormItem";
|
|
2105
|
-
var FormLabel =
|
|
2608
|
+
var FormLabel = React3.forwardRef(({ className, ...props }, ref) => {
|
|
2106
2609
|
const { error, formItemId } = useFormField();
|
|
2107
2610
|
return /* @__PURE__ */ jsx(
|
|
2108
2611
|
Label,
|
|
@@ -2115,7 +2618,7 @@ var FormLabel = React2.forwardRef(({ className, ...props }, ref) => {
|
|
|
2115
2618
|
);
|
|
2116
2619
|
});
|
|
2117
2620
|
FormLabel.displayName = "FormLabel";
|
|
2118
|
-
var FormControl =
|
|
2621
|
+
var FormControl = React3.forwardRef(({ ...props }, ref) => {
|
|
2119
2622
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
2120
2623
|
return /* @__PURE__ */ jsx(
|
|
2121
2624
|
Slot,
|
|
@@ -2129,7 +2632,7 @@ var FormControl = React2.forwardRef(({ ...props }, ref) => {
|
|
|
2129
2632
|
);
|
|
2130
2633
|
});
|
|
2131
2634
|
FormControl.displayName = "FormControl";
|
|
2132
|
-
var FormDescription =
|
|
2635
|
+
var FormDescription = React3.forwardRef(({ className, ...props }, ref) => {
|
|
2133
2636
|
const { formDescriptionId } = useFormField();
|
|
2134
2637
|
return /* @__PURE__ */ jsx(
|
|
2135
2638
|
"p",
|
|
@@ -2142,7 +2645,7 @@ var FormDescription = React2.forwardRef(({ className, ...props }, ref) => {
|
|
|
2142
2645
|
);
|
|
2143
2646
|
});
|
|
2144
2647
|
FormDescription.displayName = "FormDescription";
|
|
2145
|
-
var FormMessage =
|
|
2648
|
+
var FormMessage = React3.forwardRef(({ className, children, ...props }, ref) => {
|
|
2146
2649
|
const { error, formMessageId } = useFormField();
|
|
2147
2650
|
const body = error ? String(error?.message ?? "") : children;
|
|
2148
2651
|
if (!body) {
|
|
@@ -2164,131 +2667,93 @@ var FormMessage = React2.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2164
2667
|
});
|
|
2165
2668
|
FormMessage.displayName = "FormMessage";
|
|
2166
2669
|
function HoverCard({
|
|
2670
|
+
slotName = "hover-card",
|
|
2167
2671
|
...props
|
|
2168
2672
|
}) {
|
|
2169
|
-
return /* @__PURE__ */ jsx(HoverCard$1.Root, { "data-slot":
|
|
2673
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Root, { ...props, "data-slot": slotName });
|
|
2170
2674
|
}
|
|
2171
2675
|
function HoverCardTrigger({
|
|
2676
|
+
slotName = "hover-card-trigger",
|
|
2172
2677
|
...props
|
|
2173
2678
|
}) {
|
|
2174
|
-
return /* @__PURE__ */ jsx(HoverCard$1.Trigger, { "data-slot":
|
|
2679
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Trigger, { ...props, "data-slot": slotName });
|
|
2175
2680
|
}
|
|
2176
2681
|
function HoverCardContent({
|
|
2177
2682
|
className,
|
|
2178
2683
|
align = "center",
|
|
2179
2684
|
sideOffset = 4,
|
|
2685
|
+
slotName = "hover-card-content",
|
|
2180
2686
|
...props
|
|
2181
2687
|
}) {
|
|
2182
2688
|
return /* @__PURE__ */ jsx(HoverCard$1.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
|
|
2183
2689
|
HoverCard$1.Content,
|
|
2184
2690
|
{
|
|
2185
|
-
"data-slot": "hover-card-content",
|
|
2186
2691
|
align,
|
|
2187
2692
|
sideOffset,
|
|
2188
2693
|
className: cn(
|
|
2189
2694
|
`${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
2695
|
className
|
|
2191
2696
|
),
|
|
2192
|
-
...props
|
|
2697
|
+
...props,
|
|
2698
|
+
"data-slot": slotName
|
|
2193
2699
|
}
|
|
2194
2700
|
) });
|
|
2195
2701
|
}
|
|
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
2702
|
function Menubar({
|
|
2238
2703
|
className,
|
|
2704
|
+
slotName = "menubar",
|
|
2239
2705
|
...props
|
|
2240
2706
|
}) {
|
|
2241
2707
|
return /* @__PURE__ */ jsx(
|
|
2242
2708
|
Menubar$1.Root,
|
|
2243
2709
|
{
|
|
2244
|
-
"data-slot": "menubar",
|
|
2245
2710
|
className: cn(
|
|
2246
2711
|
"h-9 gap-1 p-1 shadow-sm backdrop-blur-xl rounded-2xl flex items-center border border-border bg-card/60",
|
|
2247
2712
|
className
|
|
2248
2713
|
),
|
|
2249
|
-
...props
|
|
2714
|
+
...props,
|
|
2715
|
+
"data-slot": slotName
|
|
2250
2716
|
}
|
|
2251
2717
|
);
|
|
2252
2718
|
}
|
|
2253
2719
|
function MenubarMenu({
|
|
2720
|
+
slotName = "menubar-menu",
|
|
2254
2721
|
...props
|
|
2255
2722
|
}) {
|
|
2256
|
-
return /* @__PURE__ */ jsx(Menubar$1.Menu, { "data-slot":
|
|
2723
|
+
return /* @__PURE__ */ jsx(Menubar$1.Menu, { ...props, "data-slot": slotName });
|
|
2257
2724
|
}
|
|
2258
2725
|
function MenubarGroup({
|
|
2726
|
+
slotName = "menubar-group",
|
|
2259
2727
|
...props
|
|
2260
2728
|
}) {
|
|
2261
|
-
return /* @__PURE__ */ jsx(Menubar$1.Group, { "data-slot":
|
|
2729
|
+
return /* @__PURE__ */ jsx(Menubar$1.Group, { ...props, "data-slot": slotName });
|
|
2262
2730
|
}
|
|
2263
2731
|
function MenubarPortal({
|
|
2732
|
+
slotName = "menubar-portal",
|
|
2264
2733
|
...props
|
|
2265
2734
|
}) {
|
|
2266
|
-
return /* @__PURE__ */ jsx(Menubar$1.Portal, { "data-slot":
|
|
2735
|
+
return /* @__PURE__ */ jsx(Menubar$1.Portal, { ...props, "data-slot": slotName });
|
|
2267
2736
|
}
|
|
2268
2737
|
function MenubarRadioGroup({
|
|
2738
|
+
slotName = "menubar-radio-group",
|
|
2269
2739
|
...props
|
|
2270
2740
|
}) {
|
|
2271
|
-
return /* @__PURE__ */ jsx(
|
|
2272
|
-
Menubar$1.RadioGroup,
|
|
2273
|
-
{
|
|
2274
|
-
"data-slot": "menubar-radio-group",
|
|
2275
|
-
...props
|
|
2276
|
-
}
|
|
2277
|
-
);
|
|
2741
|
+
return /* @__PURE__ */ jsx(Menubar$1.RadioGroup, { ...props, "data-slot": slotName });
|
|
2278
2742
|
}
|
|
2279
2743
|
function MenubarTrigger({
|
|
2280
2744
|
className,
|
|
2745
|
+
slotName = "menubar-trigger",
|
|
2281
2746
|
...props
|
|
2282
2747
|
}) {
|
|
2283
2748
|
return /* @__PURE__ */ jsx(
|
|
2284
2749
|
Menubar$1.Trigger,
|
|
2285
2750
|
{
|
|
2286
|
-
"data-slot": "menubar-trigger",
|
|
2287
2751
|
className: cn(
|
|
2288
2752
|
"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
2753
|
className
|
|
2290
2754
|
),
|
|
2291
|
-
...props
|
|
2755
|
+
...props,
|
|
2756
|
+
"data-slot": slotName
|
|
2292
2757
|
}
|
|
2293
2758
|
);
|
|
2294
2759
|
}
|
|
@@ -2297,12 +2762,12 @@ function MenubarContent({
|
|
|
2297
2762
|
align = "start",
|
|
2298
2763
|
alignOffset = -4,
|
|
2299
2764
|
sideOffset = 8,
|
|
2765
|
+
slotName = "menubar-content",
|
|
2300
2766
|
...props
|
|
2301
2767
|
}) {
|
|
2302
2768
|
return /* @__PURE__ */ jsx(MenubarPortal, { children: /* @__PURE__ */ jsx(
|
|
2303
2769
|
Menubar$1.Content,
|
|
2304
2770
|
{
|
|
2305
|
-
"data-slot": "menubar-content",
|
|
2306
2771
|
align,
|
|
2307
2772
|
alignOffset,
|
|
2308
2773
|
sideOffset,
|
|
@@ -2310,7 +2775,8 @@ function MenubarContent({
|
|
|
2310
2775
|
`${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
2776
|
className
|
|
2312
2777
|
),
|
|
2313
|
-
...props
|
|
2778
|
+
...props,
|
|
2779
|
+
"data-slot": slotName
|
|
2314
2780
|
}
|
|
2315
2781
|
) });
|
|
2316
2782
|
}
|
|
@@ -2318,19 +2784,20 @@ function MenubarItem({
|
|
|
2318
2784
|
className,
|
|
2319
2785
|
inset,
|
|
2320
2786
|
variant = "default",
|
|
2787
|
+
slotName = "menubar-item",
|
|
2321
2788
|
...props
|
|
2322
2789
|
}) {
|
|
2323
2790
|
return /* @__PURE__ */ jsx(
|
|
2324
2791
|
Menubar$1.Item,
|
|
2325
2792
|
{
|
|
2326
|
-
"data-slot": "menubar-item",
|
|
2327
2793
|
"data-inset": inset,
|
|
2328
2794
|
"data-variant": variant,
|
|
2329
2795
|
className: cn(
|
|
2330
2796
|
"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
2797
|
className
|
|
2332
2798
|
),
|
|
2333
|
-
...props
|
|
2799
|
+
...props,
|
|
2800
|
+
"data-slot": slotName
|
|
2334
2801
|
}
|
|
2335
2802
|
);
|
|
2336
2803
|
}
|
|
@@ -2338,18 +2805,19 @@ function MenubarCheckboxItem({
|
|
|
2338
2805
|
className,
|
|
2339
2806
|
children,
|
|
2340
2807
|
checked,
|
|
2808
|
+
slotName = "menubar-checkbox-item",
|
|
2341
2809
|
...props
|
|
2342
2810
|
}) {
|
|
2343
2811
|
return /* @__PURE__ */ jsxs(
|
|
2344
2812
|
Menubar$1.CheckboxItem,
|
|
2345
2813
|
{
|
|
2346
|
-
"data-slot": "menubar-checkbox-item",
|
|
2347
2814
|
className: cn(
|
|
2348
2815
|
"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
2816
|
className
|
|
2350
2817
|
),
|
|
2351
2818
|
checked,
|
|
2352
2819
|
...props,
|
|
2820
|
+
"data-slot": slotName,
|
|
2353
2821
|
children: [
|
|
2354
2822
|
/* @__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
2823
|
children
|
|
@@ -2360,17 +2828,18 @@ function MenubarCheckboxItem({
|
|
|
2360
2828
|
function MenubarRadioItem({
|
|
2361
2829
|
className,
|
|
2362
2830
|
children,
|
|
2831
|
+
slotName = "menubar-radio-item",
|
|
2363
2832
|
...props
|
|
2364
2833
|
}) {
|
|
2365
2834
|
return /* @__PURE__ */ jsxs(
|
|
2366
2835
|
Menubar$1.RadioItem,
|
|
2367
2836
|
{
|
|
2368
|
-
"data-slot": "menubar-radio-item",
|
|
2369
2837
|
className: cn(
|
|
2370
2838
|
"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
2839
|
className
|
|
2372
2840
|
),
|
|
2373
2841
|
...props,
|
|
2842
|
+
"data-slot": slotName,
|
|
2374
2843
|
children: [
|
|
2375
2844
|
/* @__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
2845
|
children
|
|
@@ -2381,71 +2850,76 @@ function MenubarRadioItem({
|
|
|
2381
2850
|
function MenubarLabel({
|
|
2382
2851
|
className,
|
|
2383
2852
|
inset,
|
|
2853
|
+
slotName = "menubar-label",
|
|
2384
2854
|
...props
|
|
2385
2855
|
}) {
|
|
2386
2856
|
return /* @__PURE__ */ jsx(
|
|
2387
2857
|
Menubar$1.Label,
|
|
2388
2858
|
{
|
|
2389
|
-
"data-slot": "menubar-label",
|
|
2390
2859
|
"data-inset": inset,
|
|
2391
2860
|
className: cn(
|
|
2392
2861
|
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
2393
2862
|
className
|
|
2394
2863
|
),
|
|
2395
|
-
...props
|
|
2864
|
+
...props,
|
|
2865
|
+
"data-slot": slotName
|
|
2396
2866
|
}
|
|
2397
2867
|
);
|
|
2398
2868
|
}
|
|
2399
2869
|
function MenubarSeparator({
|
|
2400
2870
|
className,
|
|
2871
|
+
slotName = "menubar-separator",
|
|
2401
2872
|
...props
|
|
2402
2873
|
}) {
|
|
2403
2874
|
return /* @__PURE__ */ jsx(
|
|
2404
2875
|
Menubar$1.Separator,
|
|
2405
2876
|
{
|
|
2406
|
-
"data-slot": "menubar-separator",
|
|
2407
2877
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
2408
|
-
...props
|
|
2878
|
+
...props,
|
|
2879
|
+
"data-slot": slotName
|
|
2409
2880
|
}
|
|
2410
2881
|
);
|
|
2411
2882
|
}
|
|
2412
2883
|
function MenubarShortcut({
|
|
2413
2884
|
className,
|
|
2885
|
+
slotName = "menubar-shortcut",
|
|
2414
2886
|
...props
|
|
2415
2887
|
}) {
|
|
2416
2888
|
return /* @__PURE__ */ jsx(
|
|
2417
2889
|
"span",
|
|
2418
2890
|
{
|
|
2419
|
-
"data-slot": "menubar-shortcut",
|
|
2420
2891
|
className: cn(
|
|
2421
2892
|
"text-xs tracking-widest ml-auto text-muted-foreground",
|
|
2422
2893
|
className
|
|
2423
2894
|
),
|
|
2424
|
-
...props
|
|
2895
|
+
...props,
|
|
2896
|
+
"data-slot": slotName
|
|
2425
2897
|
}
|
|
2426
2898
|
);
|
|
2427
2899
|
}
|
|
2428
2900
|
function MenubarSub({
|
|
2901
|
+
slotName = "menubar-sub",
|
|
2429
2902
|
...props
|
|
2430
2903
|
}) {
|
|
2431
|
-
return /* @__PURE__ */ jsx(Menubar$1.Sub, { "data-slot":
|
|
2904
|
+
return /* @__PURE__ */ jsx(Menubar$1.Sub, { ...props, "data-slot": slotName });
|
|
2432
2905
|
}
|
|
2433
2906
|
function MenubarSubTrigger({
|
|
2434
2907
|
className,
|
|
2435
2908
|
inset,
|
|
2436
2909
|
children,
|
|
2910
|
+
slotName = "menubar-sub-trigger",
|
|
2437
2911
|
...props
|
|
2438
2912
|
}) {
|
|
2439
2913
|
return /* @__PURE__ */ jsxs(
|
|
2440
2914
|
Menubar$1.SubTrigger,
|
|
2441
2915
|
{
|
|
2442
|
-
"data-slot": "menubar-sub-trigger",
|
|
2443
2916
|
"data-inset": inset,
|
|
2444
2917
|
className: cn(
|
|
2445
2918
|
"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
2919
|
className
|
|
2447
2920
|
),
|
|
2448
2921
|
...props,
|
|
2922
|
+
"data-slot": slotName,
|
|
2449
2923
|
children: [
|
|
2450
2924
|
children,
|
|
2451
2925
|
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-4 w-4 ml-auto" })
|
|
@@ -2455,17 +2929,18 @@ function MenubarSubTrigger({
|
|
|
2455
2929
|
}
|
|
2456
2930
|
function MenubarSubContent({
|
|
2457
2931
|
className,
|
|
2932
|
+
slotName = "menubar-sub-content",
|
|
2458
2933
|
...props
|
|
2459
2934
|
}) {
|
|
2460
2935
|
return /* @__PURE__ */ jsx(
|
|
2461
2936
|
Menubar$1.SubContent,
|
|
2462
2937
|
{
|
|
2463
|
-
"data-slot": "menubar-sub-content",
|
|
2464
2938
|
className: cn(
|
|
2465
2939
|
`${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
2940
|
className
|
|
2467
2941
|
),
|
|
2468
|
-
...props
|
|
2942
|
+
...props,
|
|
2943
|
+
"data-slot": slotName
|
|
2469
2944
|
}
|
|
2470
2945
|
);
|
|
2471
2946
|
}
|
|
@@ -2473,18 +2948,19 @@ function NavigationMenu({
|
|
|
2473
2948
|
className,
|
|
2474
2949
|
children,
|
|
2475
2950
|
viewport = true,
|
|
2951
|
+
slotName = "navigation-menu",
|
|
2476
2952
|
...props
|
|
2477
2953
|
}) {
|
|
2478
2954
|
return /* @__PURE__ */ jsxs(
|
|
2479
2955
|
NavigationMenuPrimitive.Root,
|
|
2480
2956
|
{
|
|
2481
|
-
"data-slot": "navigation-menu",
|
|
2482
2957
|
"data-viewport": viewport,
|
|
2483
2958
|
className: cn(
|
|
2484
2959
|
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
2485
2960
|
className
|
|
2486
2961
|
),
|
|
2487
2962
|
...props,
|
|
2963
|
+
"data-slot": slotName,
|
|
2488
2964
|
children: [
|
|
2489
2965
|
children,
|
|
2490
2966
|
viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})
|
|
@@ -2494,30 +2970,32 @@ function NavigationMenu({
|
|
|
2494
2970
|
}
|
|
2495
2971
|
function NavigationMenuList({
|
|
2496
2972
|
className,
|
|
2973
|
+
slotName = "navigation-menu-list",
|
|
2497
2974
|
...props
|
|
2498
2975
|
}) {
|
|
2499
2976
|
return /* @__PURE__ */ jsx(
|
|
2500
2977
|
NavigationMenuPrimitive.List,
|
|
2501
2978
|
{
|
|
2502
|
-
"data-slot": "navigation-menu-list",
|
|
2503
2979
|
className: cn(
|
|
2504
2980
|
"group gap-1 flex flex-1 list-none items-center justify-center",
|
|
2505
2981
|
className
|
|
2506
2982
|
),
|
|
2507
|
-
...props
|
|
2983
|
+
...props,
|
|
2984
|
+
"data-slot": slotName
|
|
2508
2985
|
}
|
|
2509
2986
|
);
|
|
2510
2987
|
}
|
|
2511
2988
|
function NavigationMenuItem({
|
|
2512
2989
|
className,
|
|
2990
|
+
slotName = "navigation-menu-item",
|
|
2513
2991
|
...props
|
|
2514
2992
|
}) {
|
|
2515
2993
|
return /* @__PURE__ */ jsx(
|
|
2516
2994
|
NavigationMenuPrimitive.Item,
|
|
2517
2995
|
{
|
|
2518
|
-
"data-slot": "navigation-menu-item",
|
|
2519
2996
|
className: cn("relative", className),
|
|
2520
|
-
...props
|
|
2997
|
+
...props,
|
|
2998
|
+
"data-slot": slotName
|
|
2521
2999
|
}
|
|
2522
3000
|
);
|
|
2523
3001
|
}
|
|
@@ -2527,14 +3005,15 @@ var navigationMenuTriggerStyle = cva(
|
|
|
2527
3005
|
function NavigationMenuTrigger({
|
|
2528
3006
|
className,
|
|
2529
3007
|
children,
|
|
3008
|
+
slotName = "navigation-menu-trigger",
|
|
2530
3009
|
...props
|
|
2531
3010
|
}) {
|
|
2532
3011
|
return /* @__PURE__ */ jsxs(
|
|
2533
3012
|
NavigationMenuPrimitive.Trigger,
|
|
2534
3013
|
{
|
|
2535
|
-
"data-slot": "navigation-menu-trigger",
|
|
2536
3014
|
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
2537
3015
|
...props,
|
|
3016
|
+
"data-slot": slotName,
|
|
2538
3017
|
children: [
|
|
2539
3018
|
children,
|
|
2540
3019
|
" ",
|
|
@@ -2551,23 +3030,25 @@ function NavigationMenuTrigger({
|
|
|
2551
3030
|
}
|
|
2552
3031
|
function NavigationMenuContent({
|
|
2553
3032
|
className,
|
|
3033
|
+
slotName = "navigation-menu-content",
|
|
2554
3034
|
...props
|
|
2555
3035
|
}) {
|
|
2556
3036
|
return /* @__PURE__ */ jsx(
|
|
2557
3037
|
NavigationMenuPrimitive.Content,
|
|
2558
3038
|
{
|
|
2559
|
-
"data-slot": "navigation-menu-content",
|
|
2560
3039
|
className: cn(
|
|
2561
3040
|
"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
3041
|
"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
3042
|
className
|
|
2564
3043
|
),
|
|
2565
|
-
...props
|
|
3044
|
+
...props,
|
|
3045
|
+
"data-slot": slotName
|
|
2566
3046
|
}
|
|
2567
3047
|
);
|
|
2568
3048
|
}
|
|
2569
3049
|
function NavigationMenuViewport({
|
|
2570
3050
|
className,
|
|
3051
|
+
slotName = "navigation-menu-viewport",
|
|
2571
3052
|
...props
|
|
2572
3053
|
}) {
|
|
2573
3054
|
return /* @__PURE__ */ jsx(
|
|
@@ -2579,12 +3060,12 @@ function NavigationMenuViewport({
|
|
|
2579
3060
|
children: /* @__PURE__ */ jsx(
|
|
2580
3061
|
NavigationMenuPrimitive.Viewport,
|
|
2581
3062
|
{
|
|
2582
|
-
"data-slot": "navigation-menu-viewport",
|
|
2583
3063
|
className: cn(
|
|
2584
3064
|
`${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
3065
|
className
|
|
2586
3066
|
),
|
|
2587
|
-
...props
|
|
3067
|
+
...props,
|
|
3068
|
+
"data-slot": slotName
|
|
2588
3069
|
}
|
|
2589
3070
|
)
|
|
2590
3071
|
}
|
|
@@ -2592,76 +3073,86 @@ function NavigationMenuViewport({
|
|
|
2592
3073
|
}
|
|
2593
3074
|
function NavigationMenuLink({
|
|
2594
3075
|
className,
|
|
3076
|
+
slotName = "navigation-menu-link",
|
|
2595
3077
|
...props
|
|
2596
3078
|
}) {
|
|
2597
3079
|
return /* @__PURE__ */ jsx(
|
|
2598
3080
|
NavigationMenuPrimitive.Link,
|
|
2599
3081
|
{
|
|
2600
|
-
"data-slot": "navigation-menu-link",
|
|
2601
3082
|
className: cn(
|
|
2602
3083
|
"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
3084
|
className
|
|
2604
3085
|
),
|
|
2605
|
-
...props
|
|
3086
|
+
...props,
|
|
3087
|
+
"data-slot": slotName
|
|
2606
3088
|
}
|
|
2607
3089
|
);
|
|
2608
3090
|
}
|
|
2609
3091
|
function NavigationMenuIndicator({
|
|
2610
3092
|
className,
|
|
3093
|
+
slotName = "navigation-menu-indicator",
|
|
2611
3094
|
...props
|
|
2612
3095
|
}) {
|
|
2613
3096
|
return /* @__PURE__ */ jsx(
|
|
2614
3097
|
NavigationMenuPrimitive.Indicator,
|
|
2615
3098
|
{
|
|
2616
|
-
"data-slot": "navigation-menu-indicator",
|
|
2617
3099
|
className: cn(
|
|
2618
3100
|
"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
3101
|
className
|
|
2620
3102
|
),
|
|
2621
3103
|
...props,
|
|
3104
|
+
"data-slot": slotName,
|
|
2622
3105
|
children: /* @__PURE__ */ jsx("div", { className: "h-2 w-2 shadow-md rounded-tl-xs relative top-[60%] rotate-45 bg-border" })
|
|
2623
3106
|
}
|
|
2624
3107
|
);
|
|
2625
3108
|
}
|
|
2626
|
-
function Pagination({
|
|
3109
|
+
function Pagination({
|
|
3110
|
+
className,
|
|
3111
|
+
slotName = "pagination",
|
|
3112
|
+
...props
|
|
3113
|
+
}) {
|
|
2627
3114
|
return /* @__PURE__ */ jsx(
|
|
2628
3115
|
"nav",
|
|
2629
3116
|
{
|
|
2630
3117
|
role: "navigation",
|
|
2631
3118
|
"aria-label": "pagination",
|
|
2632
|
-
"data-slot": "pagination",
|
|
2633
3119
|
className: cn("mx-auto flex w-full justify-center", className),
|
|
2634
|
-
...props
|
|
3120
|
+
...props,
|
|
3121
|
+
"data-slot": slotName
|
|
2635
3122
|
}
|
|
2636
3123
|
);
|
|
2637
3124
|
}
|
|
2638
3125
|
function PaginationContent({
|
|
2639
3126
|
className,
|
|
3127
|
+
slotName = "pagination-content",
|
|
2640
3128
|
...props
|
|
2641
3129
|
}) {
|
|
2642
3130
|
return /* @__PURE__ */ jsx(
|
|
2643
3131
|
"ul",
|
|
2644
3132
|
{
|
|
2645
|
-
"data-slot": "pagination-content",
|
|
2646
3133
|
className: cn("gap-1 flex flex-row items-center", className),
|
|
2647
|
-
...props
|
|
3134
|
+
...props,
|
|
3135
|
+
"data-slot": slotName
|
|
2648
3136
|
}
|
|
2649
3137
|
);
|
|
2650
3138
|
}
|
|
2651
|
-
function PaginationItem({
|
|
2652
|
-
|
|
3139
|
+
function PaginationItem({
|
|
3140
|
+
slotName = "pagination-item",
|
|
3141
|
+
...props
|
|
3142
|
+
}) {
|
|
3143
|
+
return /* @__PURE__ */ jsx("li", { ...props, "data-slot": slotName });
|
|
2653
3144
|
}
|
|
2654
3145
|
function PaginationLink({
|
|
2655
3146
|
className,
|
|
2656
3147
|
isActive,
|
|
2657
3148
|
size = "icon",
|
|
3149
|
+
slotName = "pagination-link",
|
|
2658
3150
|
...props
|
|
2659
3151
|
}) {
|
|
2660
3152
|
return /* @__PURE__ */ jsx(
|
|
2661
3153
|
"a",
|
|
2662
3154
|
{
|
|
2663
3155
|
"aria-current": isActive ? "page" : void 0,
|
|
2664
|
-
"data-slot": "pagination-link",
|
|
2665
3156
|
"data-active": isActive,
|
|
2666
3157
|
className: cn(
|
|
2667
3158
|
buttonVariants({
|
|
@@ -2670,7 +3161,8 @@ function PaginationLink({
|
|
|
2670
3161
|
}),
|
|
2671
3162
|
className
|
|
2672
3163
|
),
|
|
2673
|
-
...props
|
|
3164
|
+
...props,
|
|
3165
|
+
"data-slot": slotName
|
|
2674
3166
|
}
|
|
2675
3167
|
);
|
|
2676
3168
|
}
|
|
@@ -2712,18 +3204,19 @@ function PaginationNext({
|
|
|
2712
3204
|
}
|
|
2713
3205
|
function PaginationEllipsis({
|
|
2714
3206
|
className,
|
|
3207
|
+
slotName = "pagination-ellipsis",
|
|
2715
3208
|
...props
|
|
2716
3209
|
}) {
|
|
2717
3210
|
return /* @__PURE__ */ jsxs(
|
|
2718
3211
|
"span",
|
|
2719
3212
|
{
|
|
2720
3213
|
"aria-hidden": true,
|
|
2721
|
-
"data-slot": "pagination-ellipsis",
|
|
2722
3214
|
className: cn(
|
|
2723
3215
|
"size-9 rounded-xl flex items-center justify-center",
|
|
2724
3216
|
className
|
|
2725
3217
|
),
|
|
2726
3218
|
...props,
|
|
3219
|
+
"data-slot": slotName,
|
|
2727
3220
|
children: [
|
|
2728
3221
|
/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
|
|
2729
3222
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
@@ -2731,9 +3224,48 @@ function PaginationEllipsis({
|
|
|
2731
3224
|
}
|
|
2732
3225
|
);
|
|
2733
3226
|
}
|
|
2734
|
-
function
|
|
3227
|
+
function PasswordInput({
|
|
3228
|
+
className,
|
|
3229
|
+
revealable = true,
|
|
3230
|
+
showLabel = "Show password",
|
|
3231
|
+
hideLabel = "Hide password",
|
|
3232
|
+
slotName = "password-input",
|
|
3233
|
+
...props
|
|
3234
|
+
}) {
|
|
3235
|
+
const [visible, setVisible] = React3.useState(false);
|
|
3236
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", "data-slot": slotName, children: [
|
|
3237
|
+
/* @__PURE__ */ jsx(
|
|
3238
|
+
Input,
|
|
3239
|
+
{
|
|
3240
|
+
type: visible ? "text" : "password",
|
|
3241
|
+
className: cn(revealable && "pr-12", className),
|
|
3242
|
+
...props
|
|
3243
|
+
}
|
|
3244
|
+
),
|
|
3245
|
+
revealable ? /* @__PURE__ */ jsx(
|
|
3246
|
+
Button,
|
|
3247
|
+
{
|
|
3248
|
+
type: "button",
|
|
3249
|
+
variant: "ghost",
|
|
3250
|
+
size: "icon-sm",
|
|
3251
|
+
slotName: "password-input-toggle",
|
|
3252
|
+
"aria-label": visible ? hideLabel : showLabel,
|
|
3253
|
+
"aria-pressed": visible,
|
|
3254
|
+
disabled: props.disabled,
|
|
3255
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
3256
|
+
onClick: () => setVisible((current) => !current),
|
|
3257
|
+
className: "right-1 absolute top-1/2 -translate-y-1/2",
|
|
3258
|
+
children: visible ? /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Eye, { "aria-hidden": "true" })
|
|
3259
|
+
}
|
|
3260
|
+
) : null
|
|
3261
|
+
] });
|
|
3262
|
+
}
|
|
3263
|
+
function PlaceholderPattern({
|
|
3264
|
+
className,
|
|
3265
|
+
slotName = "placeholder-pattern"
|
|
3266
|
+
}) {
|
|
2735
3267
|
const patternId = useId();
|
|
2736
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
3268
|
+
return /* @__PURE__ */ jsxs("svg", { className, fill: "none", "data-slot": slotName, children: [
|
|
2737
3269
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
2738
3270
|
"pattern",
|
|
2739
3271
|
{
|
|
@@ -2766,17 +3298,18 @@ function PlaceholderPattern({ className }) {
|
|
|
2766
3298
|
function Progress({
|
|
2767
3299
|
className,
|
|
2768
3300
|
value,
|
|
3301
|
+
slotName = "progress",
|
|
2769
3302
|
...props
|
|
2770
3303
|
}) {
|
|
2771
3304
|
return /* @__PURE__ */ jsx(
|
|
2772
3305
|
Progress$1.Root,
|
|
2773
3306
|
{
|
|
2774
|
-
"data-slot": "progress",
|
|
2775
3307
|
className: cn(
|
|
2776
3308
|
"h-2 relative w-full overflow-hidden rounded-full bg-primary/20",
|
|
2777
3309
|
className
|
|
2778
3310
|
),
|
|
2779
3311
|
...props,
|
|
3312
|
+
"data-slot": slotName,
|
|
2780
3313
|
children: /* @__PURE__ */ jsx(
|
|
2781
3314
|
Progress$1.Indicator,
|
|
2782
3315
|
{
|
|
@@ -2790,30 +3323,32 @@ function Progress({
|
|
|
2790
3323
|
}
|
|
2791
3324
|
function RadioGroup({
|
|
2792
3325
|
className,
|
|
3326
|
+
slotName = "radio-group",
|
|
2793
3327
|
...props
|
|
2794
3328
|
}) {
|
|
2795
3329
|
return /* @__PURE__ */ jsx(
|
|
2796
3330
|
RadioGroup$1.Root,
|
|
2797
3331
|
{
|
|
2798
|
-
"data-slot": "radio-group",
|
|
2799
3332
|
className: cn("gap-3 grid", className),
|
|
2800
|
-
...props
|
|
3333
|
+
...props,
|
|
3334
|
+
"data-slot": slotName
|
|
2801
3335
|
}
|
|
2802
3336
|
);
|
|
2803
3337
|
}
|
|
2804
3338
|
function RadioGroupItem({
|
|
2805
3339
|
className,
|
|
3340
|
+
slotName = "radio-group-item",
|
|
2806
3341
|
...props
|
|
2807
3342
|
}) {
|
|
2808
3343
|
return /* @__PURE__ */ jsx(
|
|
2809
3344
|
RadioGroup$1.Item,
|
|
2810
3345
|
{
|
|
2811
|
-
"data-slot": "radio-group-item",
|
|
2812
3346
|
className: cn(
|
|
2813
3347
|
`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
3348
|
className
|
|
2815
3349
|
),
|
|
2816
3350
|
...props,
|
|
3351
|
+
"data-slot": slotName,
|
|
2817
3352
|
children: /* @__PURE__ */ jsx(
|
|
2818
3353
|
RadioGroup$1.Indicator,
|
|
2819
3354
|
{
|
|
@@ -2827,47 +3362,141 @@ function RadioGroupItem({
|
|
|
2827
3362
|
}
|
|
2828
3363
|
function ResizablePanelGroup({
|
|
2829
3364
|
className,
|
|
3365
|
+
slotName = "resizable-panel-group",
|
|
2830
3366
|
...props
|
|
2831
3367
|
}) {
|
|
2832
3368
|
return /* @__PURE__ */ jsx(
|
|
2833
3369
|
ResizablePrimitive.Group,
|
|
2834
3370
|
{
|
|
2835
|
-
"data-slot": "resizable-panel-group",
|
|
2836
3371
|
className: cn(
|
|
2837
3372
|
elevatedSurface,
|
|
2838
3373
|
nestedSurfaceReset,
|
|
2839
3374
|
"flex h-full w-full overflow-hidden bg-card aria-[orientation=vertical]:flex-col",
|
|
2840
3375
|
className
|
|
2841
3376
|
),
|
|
2842
|
-
...props
|
|
3377
|
+
...props,
|
|
3378
|
+
"data-slot": slotName
|
|
2843
3379
|
}
|
|
2844
3380
|
);
|
|
2845
3381
|
}
|
|
2846
|
-
function ResizablePanel({
|
|
2847
|
-
|
|
3382
|
+
function ResizablePanel({
|
|
3383
|
+
slotName = "resizable-panel",
|
|
3384
|
+
...props
|
|
3385
|
+
}) {
|
|
3386
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, { ...props, "data-slot": slotName });
|
|
2848
3387
|
}
|
|
2849
3388
|
function ResizableHandle({
|
|
2850
3389
|
withHandle,
|
|
2851
3390
|
className,
|
|
3391
|
+
slotName = "resizable-handle",
|
|
2852
3392
|
...props
|
|
2853
3393
|
}) {
|
|
2854
3394
|
return /* @__PURE__ */ jsx(
|
|
2855
3395
|
ResizablePrimitive.Separator,
|
|
2856
3396
|
{
|
|
2857
|
-
"data-slot": "resizable-handle",
|
|
2858
3397
|
className: cn(
|
|
2859
3398
|
"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
3399
|
className
|
|
2861
3400
|
),
|
|
2862
3401
|
...props,
|
|
3402
|
+
"data-slot": slotName,
|
|
2863
3403
|
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
3404
|
}
|
|
2865
3405
|
);
|
|
2866
3406
|
}
|
|
2867
|
-
var
|
|
3407
|
+
var saveStatusLabels = {
|
|
3408
|
+
error: "Your changes could not be saved",
|
|
3409
|
+
idle: "Changes are saved automatically",
|
|
3410
|
+
saved: "Saved",
|
|
3411
|
+
saving: "Saving"
|
|
3412
|
+
};
|
|
3413
|
+
var SAVED_DURATION = 2e3;
|
|
3414
|
+
function SaveStatus({
|
|
3415
|
+
status,
|
|
3416
|
+
message,
|
|
3417
|
+
showIdle = false,
|
|
3418
|
+
savedDuration = SAVED_DURATION,
|
|
3419
|
+
labels,
|
|
3420
|
+
className,
|
|
3421
|
+
slotName = "save-status",
|
|
3422
|
+
...props
|
|
3423
|
+
}) {
|
|
3424
|
+
const text = useUiLabels("saveStatus", saveStatusLabels, labels);
|
|
3425
|
+
const [faded, setFaded] = React3.useState(false);
|
|
3426
|
+
React3.useEffect(() => {
|
|
3427
|
+
if (status !== "saved" || savedDuration <= 0) {
|
|
3428
|
+
setFaded(false);
|
|
3429
|
+
return;
|
|
3430
|
+
}
|
|
3431
|
+
setFaded(false);
|
|
3432
|
+
const timer = setTimeout(() => setFaded(true), savedDuration);
|
|
3433
|
+
return () => clearTimeout(timer);
|
|
3434
|
+
}, [status, savedDuration, message]);
|
|
3435
|
+
const hidden = status === "saved" && faded;
|
|
3436
|
+
return /* @__PURE__ */ jsxs(
|
|
3437
|
+
"div",
|
|
3438
|
+
{
|
|
3439
|
+
...props,
|
|
3440
|
+
"data-state": status,
|
|
3441
|
+
"data-faded": hidden || void 0,
|
|
3442
|
+
role: "status",
|
|
3443
|
+
"aria-live": "polite",
|
|
3444
|
+
"aria-hidden": hidden || void 0,
|
|
3445
|
+
className: cn(
|
|
3446
|
+
"gap-2 text-xs font-medium min-h-5 flex items-center transition-opacity duration-300",
|
|
3447
|
+
hidden ? "opacity-0" : "opacity-100",
|
|
3448
|
+
className
|
|
3449
|
+
),
|
|
3450
|
+
"data-slot": slotName,
|
|
3451
|
+
children: [
|
|
3452
|
+
status === "idle" && showIdle && /* @__PURE__ */ jsx(
|
|
3453
|
+
"span",
|
|
3454
|
+
{
|
|
3455
|
+
"data-slot": "save-status-idle",
|
|
3456
|
+
className: "text-muted-foreground",
|
|
3457
|
+
children: text.idle
|
|
3458
|
+
}
|
|
3459
|
+
),
|
|
3460
|
+
status === "saving" && /* @__PURE__ */ jsxs(
|
|
3461
|
+
"span",
|
|
3462
|
+
{
|
|
3463
|
+
"data-slot": "save-status-saving",
|
|
3464
|
+
className: "gap-2 flex items-center text-muted-foreground",
|
|
3465
|
+
children: [
|
|
3466
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm", label: "", "aria-hidden": "true" }),
|
|
3467
|
+
text.saving
|
|
3468
|
+
]
|
|
3469
|
+
}
|
|
3470
|
+
),
|
|
3471
|
+
status === "saved" && /* @__PURE__ */ jsxs(
|
|
3472
|
+
"span",
|
|
3473
|
+
{
|
|
3474
|
+
"data-slot": "save-status-saved",
|
|
3475
|
+
className: "gap-2 flex items-center text-success",
|
|
3476
|
+
children: [
|
|
3477
|
+
/* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "size-3.5" }),
|
|
3478
|
+
text.saved
|
|
3479
|
+
]
|
|
3480
|
+
}
|
|
3481
|
+
),
|
|
3482
|
+
status === "error" && /* @__PURE__ */ jsxs(
|
|
3483
|
+
"span",
|
|
3484
|
+
{
|
|
3485
|
+
"data-slot": "save-status-error",
|
|
3486
|
+
className: "gap-2 flex items-center text-destructive",
|
|
3487
|
+
children: [
|
|
3488
|
+
/* @__PURE__ */ jsx(TriangleAlert, { "aria-hidden": "true", className: "size-3.5" }),
|
|
3489
|
+
message ?? text.error
|
|
3490
|
+
]
|
|
3491
|
+
}
|
|
3492
|
+
)
|
|
3493
|
+
]
|
|
3494
|
+
}
|
|
3495
|
+
);
|
|
3496
|
+
}
|
|
3497
|
+
var ScrollArea = React3.forwardRef(({ className, children, slotName = "scroll-area", ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2868
3498
|
ScrollAreaPrimitive.Root,
|
|
2869
3499
|
{
|
|
2870
|
-
"data-slot": "scroll-area",
|
|
2871
3500
|
ref,
|
|
2872
3501
|
className: cn(
|
|
2873
3502
|
elevatedSurface,
|
|
@@ -2877,6 +3506,7 @@ var ScrollArea = React2.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
2877
3506
|
className
|
|
2878
3507
|
),
|
|
2879
3508
|
...props,
|
|
3509
|
+
"data-slot": slotName,
|
|
2880
3510
|
children: [
|
|
2881
3511
|
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
2882
3512
|
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
@@ -2885,22 +3515,29 @@ var ScrollArea = React2.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
2885
3515
|
}
|
|
2886
3516
|
));
|
|
2887
3517
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2888
|
-
var ScrollBar =
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
3518
|
+
var ScrollBar = React3.forwardRef(
|
|
3519
|
+
({
|
|
3520
|
+
className,
|
|
3521
|
+
orientation = "vertical",
|
|
3522
|
+
slotName = "scroll-area-scrollbar",
|
|
3523
|
+
...props
|
|
3524
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
3525
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3526
|
+
{
|
|
3527
|
+
ref,
|
|
3528
|
+
orientation,
|
|
3529
|
+
className: cn(
|
|
3530
|
+
"flex touch-none transition-colors select-none",
|
|
3531
|
+
orientation === "vertical" && "w-2.5 h-full border-l border-l-transparent p-[1px]",
|
|
3532
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
3533
|
+
className
|
|
3534
|
+
),
|
|
3535
|
+
...props,
|
|
3536
|
+
"data-slot": slotName,
|
|
3537
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3538
|
+
}
|
|
3539
|
+
)
|
|
3540
|
+
);
|
|
2904
3541
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2905
3542
|
function Slider({
|
|
2906
3543
|
className,
|
|
@@ -2908,16 +3545,16 @@ function Slider({
|
|
|
2908
3545
|
value,
|
|
2909
3546
|
min = 0,
|
|
2910
3547
|
max = 100,
|
|
3548
|
+
slotName = "slider",
|
|
2911
3549
|
...props
|
|
2912
3550
|
}) {
|
|
2913
|
-
const _values =
|
|
3551
|
+
const _values = React3.useMemo(
|
|
2914
3552
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
2915
3553
|
[value, defaultValue, min, max]
|
|
2916
3554
|
);
|
|
2917
3555
|
return /* @__PURE__ */ jsxs(
|
|
2918
3556
|
Slider$1.Root,
|
|
2919
3557
|
{
|
|
2920
|
-
"data-slot": "slider",
|
|
2921
3558
|
defaultValue,
|
|
2922
3559
|
value,
|
|
2923
3560
|
min,
|
|
@@ -2927,6 +3564,7 @@ function Slider({
|
|
|
2927
3564
|
className
|
|
2928
3565
|
),
|
|
2929
3566
|
...props,
|
|
3567
|
+
"data-slot": slotName,
|
|
2930
3568
|
children: [
|
|
2931
3569
|
/* @__PURE__ */ jsx(
|
|
2932
3570
|
Slider$1.Track,
|
|
@@ -3000,95 +3638,87 @@ var Toaster = ({ theme, ...props }) => {
|
|
|
3000
3638
|
}
|
|
3001
3639
|
);
|
|
3002
3640
|
};
|
|
3003
|
-
var
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
}
|
|
3016
|
-
},
|
|
3017
|
-
defaultVariants: {
|
|
3018
|
-
variant: "default",
|
|
3019
|
-
size: "default"
|
|
3020
|
-
}
|
|
3641
|
+
var statusBadgeVariants = cva("", {
|
|
3642
|
+
variants: {
|
|
3643
|
+
status: {
|
|
3644
|
+
neutral: "border-border bg-muted text-muted-foreground",
|
|
3645
|
+
info: "border-info/20 bg-info/10 text-info",
|
|
3646
|
+
success: "border-success/20 bg-success/10 text-success",
|
|
3647
|
+
warning: "border-warning/20 bg-warning/10 text-warning",
|
|
3648
|
+
danger: "border-destructive/20 bg-destructive/10 text-destructive"
|
|
3649
|
+
}
|
|
3650
|
+
},
|
|
3651
|
+
defaultVariants: {
|
|
3652
|
+
status: "neutral"
|
|
3021
3653
|
}
|
|
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
3654
|
});
|
|
3042
|
-
function
|
|
3655
|
+
function StatusBadge({
|
|
3043
3656
|
className,
|
|
3044
|
-
|
|
3045
|
-
|
|
3657
|
+
status = "neutral",
|
|
3658
|
+
dot = false,
|
|
3046
3659
|
children,
|
|
3660
|
+
slotName = "status-badge",
|
|
3047
3661
|
...props
|
|
3048
3662
|
}) {
|
|
3049
|
-
|
|
3050
|
-
|
|
3663
|
+
const resolvedStatus = status ?? "neutral";
|
|
3664
|
+
return /* @__PURE__ */ jsxs(
|
|
3665
|
+
Badge,
|
|
3051
3666
|
{
|
|
3052
|
-
|
|
3053
|
-
"data-
|
|
3054
|
-
"data-size": size,
|
|
3667
|
+
variant: "outline",
|
|
3668
|
+
"data-status": resolvedStatus,
|
|
3055
3669
|
className: cn(
|
|
3056
|
-
|
|
3670
|
+
statusBadgeVariants({ status: resolvedStatus }),
|
|
3057
3671
|
className
|
|
3058
3672
|
),
|
|
3059
3673
|
...props,
|
|
3060
|
-
|
|
3674
|
+
slotName,
|
|
3675
|
+
children: [
|
|
3676
|
+
dot && /* @__PURE__ */ jsx(
|
|
3677
|
+
"span",
|
|
3678
|
+
{
|
|
3679
|
+
"aria-hidden": "true",
|
|
3680
|
+
"data-slot": "status-badge-dot",
|
|
3681
|
+
className: "size-1.5 shrink-0 rounded-full bg-current"
|
|
3682
|
+
}
|
|
3683
|
+
),
|
|
3684
|
+
children
|
|
3685
|
+
]
|
|
3061
3686
|
}
|
|
3062
3687
|
);
|
|
3063
3688
|
}
|
|
3064
|
-
|
|
3689
|
+
var textLinkVariants = cva(
|
|
3690
|
+
`cursor-pointer rounded-xl underline decoration-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current ${focusRing}`,
|
|
3691
|
+
{
|
|
3692
|
+
variants: {
|
|
3693
|
+
variant: {
|
|
3694
|
+
default: "text-foreground",
|
|
3695
|
+
muted: "text-muted-foreground hover:text-foreground"
|
|
3696
|
+
}
|
|
3697
|
+
},
|
|
3698
|
+
defaultVariants: {
|
|
3699
|
+
variant: "default"
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
);
|
|
3703
|
+
function TextLink({
|
|
3065
3704
|
className,
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3705
|
+
variant = "default",
|
|
3706
|
+
asChild = false,
|
|
3707
|
+
slotName = "text-link",
|
|
3069
3708
|
...props
|
|
3070
3709
|
}) {
|
|
3071
|
-
const
|
|
3710
|
+
const Comp = asChild ? Slot : "a";
|
|
3072
3711
|
return /* @__PURE__ */ jsx(
|
|
3073
|
-
|
|
3712
|
+
Comp,
|
|
3074
3713
|
{
|
|
3075
|
-
"data-
|
|
3076
|
-
|
|
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
|
-
),
|
|
3714
|
+
"data-variant": variant,
|
|
3715
|
+
className: cn(textLinkVariants({ variant }), className),
|
|
3086
3716
|
...props,
|
|
3087
|
-
|
|
3717
|
+
"data-slot": slotName
|
|
3088
3718
|
}
|
|
3089
3719
|
);
|
|
3090
3720
|
}
|
|
3091
3721
|
|
|
3092
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger,
|
|
3722
|
+
export { AUTOSAVE_DELAY, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppearanceToggle, AspectRatio, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Combobox, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, DateRangeFilter, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, EmptyState, FacetedFilter, Field, FieldControl, FieldDescription, FieldGroup, FieldLabel, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, 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, PasswordInput, PlaceholderPattern, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowActionsMenu, SAVED_DURATION, SaveStatus, ScrollArea, ScrollBar, ServerFacetedFilter, Slider, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TextLink, Toaster, ToggleGroup, ToggleGroupItem, appearanceToggleDefaultLabels, badgeVariants, comboboxDefaultLabels, dataTableDefaultLabels, dataTableFacetedFilterDefaultLabels, datePickerDefaultLabels, dateRangeFilterDefaultLabels, emptyStateLabels, navigationMenuTriggerStyle, saveStatusLabels, statusBadgeVariants, textLinkVariants, useAutosave, useConfirmDialog, useFormField };
|
|
3093
3723
|
//# sourceMappingURL=index.js.map
|
|
3094
3724
|
//# sourceMappingURL=index.js.map
|