Commit ·
12a2337
1
Parent(s): 50cf5bb
Updates for build success
Browse files- .eslintrc.json +6 -1
- next.config.ts +10 -1
- src/app/layout.tsx +14 -1
- src/components/ui/alert-dialog.tsx +2 -2
- src/components/ui/alert.tsx +3 -3
- src/components/ui/avatar.tsx +1 -1
- src/components/ui/badge.tsx +5 -5
- src/components/ui/breadcrumb.tsx +3 -3
- src/components/ui/button.tsx +7 -7
- src/components/ui/calendar.tsx +7 -7
- src/components/ui/card.tsx +2 -2
- src/components/ui/chart.tsx +5 -5
- src/components/ui/checkbox.tsx +1 -1
- src/components/ui/command.tsx +7 -7
- src/components/ui/context-menu.tsx +9 -9
- src/components/ui/dialog.tsx +3 -3
- src/components/ui/drawer.tsx +3 -3
- src/components/ui/dropdown-menu.tsx +7 -7
- src/components/ui/form.tsx +3 -3
- src/components/ui/hover-card.tsx +1 -1
- src/components/ui/input-otp.tsx +3 -3
- src/components/ui/input.tsx +1 -1
- src/components/ui/menubar.tsx +10 -10
- src/components/ui/navigation-menu.tsx +5 -5
- src/components/ui/pagination.tsx +21 -21
- src/components/ui/popover.tsx +1 -1
- src/components/ui/progress.tsx +2 -2
- src/components/ui/radio-group.tsx +1 -1
- src/components/ui/resizable.tsx +2 -2
- src/components/ui/scroll-area.tsx +1 -1
- src/components/ui/select.tsx +4 -4
- src/components/ui/separator.tsx +1 -1
- src/components/ui/sheet.tsx +4 -4
- src/components/ui/sidebar.tsx +0 -763
- src/components/ui/skeleton.tsx +1 -1
- src/components/ui/slider.tsx +3 -3
- src/components/ui/sonner.tsx +0 -31
- src/components/ui/switch.tsx +2 -2
- src/components/ui/table.tsx +4 -4
- src/components/ui/tabs.tsx +3 -3
- src/components/ui/textarea.tsx +1 -1
- src/components/ui/toast.tsx +24 -121
- src/components/ui/toaster.tsx +0 -35
- src/components/ui/toggle.tsx +2 -2
- src/components/ui/tooltip.tsx +1 -1
- src/hooks/use-toast.ts +0 -194
- src/webzero/preview.tsx +8 -5
.eslintrc.json
CHANGED
|
@@ -1,3 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"extends": ["next/core-web-vitals", "next/typescript"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"extends": ["next/core-web-vitals", "next/typescript"],
|
| 3 |
+
"rules": {
|
| 4 |
+
"react/no-unescaped-entities": "off",
|
| 5 |
+
"@next/next/no-page-custom-font": "off",
|
| 6 |
+
"@typescript-eslint/no-unused-vars": "off"
|
| 7 |
+
}
|
| 8 |
}
|
next.config.ts
CHANGED
|
@@ -3,7 +3,16 @@ import type { NextConfig } from "next";
|
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
experimental: {
|
| 5 |
externalDir: true,
|
| 6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
};
|
| 8 |
|
| 9 |
export default nextConfig;
|
|
|
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
experimental: {
|
| 5 |
externalDir: true,
|
| 6 |
+
},
|
| 7 |
+
images: {
|
| 8 |
+
domains: [],
|
| 9 |
+
remotePatterns: [
|
| 10 |
+
{
|
| 11 |
+
protocol: "https",
|
| 12 |
+
hostname: "**",
|
| 13 |
+
},
|
| 14 |
+
],
|
| 15 |
+
},
|
| 16 |
};
|
| 17 |
|
| 18 |
export default nextConfig;
|
src/app/layout.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
import "./globals.css";
|
|
|
|
|
|
|
| 3 |
|
| 4 |
export const metadata: Metadata = {
|
| 5 |
title: "webzero",
|
|
@@ -16,7 +18,18 @@ export default function RootLayout({
|
|
| 16 |
<head>
|
| 17 |
<script dangerouslySetInnerHTML={{ __html: "var exports = {};" }} />
|
| 18 |
</head>
|
| 19 |
-
<body className="antialiased overflow-hidden">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
</html>
|
| 21 |
);
|
| 22 |
}
|
|
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
import "./globals.css";
|
| 3 |
+
import { ThemeProvider } from "@/components/theme-provider";
|
| 4 |
+
import { Toaster } from "@/components/ui/toast";
|
| 5 |
|
| 6 |
export const metadata: Metadata = {
|
| 7 |
title: "webzero",
|
|
|
|
| 18 |
<head>
|
| 19 |
<script dangerouslySetInnerHTML={{ __html: "var exports = {};" }} />
|
| 20 |
</head>
|
| 21 |
+
<body className="antialiased overflow-hidden">
|
| 22 |
+
{/* <ThemeProvider
|
| 23 |
+
attribute="class"
|
| 24 |
+
defaultTheme="light"
|
| 25 |
+
enableSystem
|
| 26 |
+
disableTransitionOnChange
|
| 27 |
+
storageKey="theme"
|
| 28 |
+
> */}
|
| 29 |
+
<main>{children}</main>
|
| 30 |
+
<Toaster />
|
| 31 |
+
{/* </ThemeProvider> */}
|
| 32 |
+
</body>
|
| 33 |
</html>
|
| 34 |
);
|
| 35 |
}
|
src/components/ui/alert-dialog.tsx
CHANGED
|
@@ -36,7 +36,7 @@ const AlertDialogContent = React.forwardRef<
|
|
| 36 |
<AlertDialogPrimitive.Content
|
| 37 |
ref={ref}
|
| 38 |
className={cn(
|
| 39 |
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-
|
| 40 |
className
|
| 41 |
)}
|
| 42 |
{...props}
|
|
@@ -91,7 +91,7 @@ const AlertDialogDescription = React.forwardRef<
|
|
| 91 |
>(({ className, ...props }, ref) => (
|
| 92 |
<AlertDialogPrimitive.Description
|
| 93 |
ref={ref}
|
| 94 |
-
className={cn("text-sm text-
|
| 95 |
{...props}
|
| 96 |
/>
|
| 97 |
))
|
|
|
|
| 36 |
<AlertDialogPrimitive.Content
|
| 37 |
ref={ref}
|
| 38 |
className={cn(
|
| 39 |
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",
|
| 40 |
className
|
| 41 |
)}
|
| 42 |
{...props}
|
|
|
|
| 91 |
>(({ className, ...props }, ref) => (
|
| 92 |
<AlertDialogPrimitive.Description
|
| 93 |
ref={ref}
|
| 94 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 95 |
{...props}
|
| 96 |
/>
|
| 97 |
))
|
src/components/ui/alert.tsx
CHANGED
|
@@ -4,13 +4,13 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
| 4 |
import { cn } from "@/lib/utils"
|
| 5 |
|
| 6 |
const alertVariants = cva(
|
| 7 |
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-
|
| 8 |
{
|
| 9 |
variants: {
|
| 10 |
variant: {
|
| 11 |
-
default: "bg-
|
| 12 |
destructive:
|
| 13 |
-
"border-
|
| 14 |
},
|
| 15 |
},
|
| 16 |
defaultVariants: {
|
|
|
|
| 4 |
import { cn } from "@/lib/utils"
|
| 5 |
|
| 6 |
const alertVariants = cva(
|
| 7 |
+
"relative w-full rounded-lg border border-neutral-200 p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-neutral-950 dark:border-neutral-800 dark:[&>svg]:text-neutral-50",
|
| 8 |
{
|
| 9 |
variants: {
|
| 10 |
variant: {
|
| 11 |
+
default: "bg-white text-neutral-950 dark:bg-neutral-950 dark:text-neutral-50",
|
| 12 |
destructive:
|
| 13 |
+
"border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500 dark:border-red-900/50 dark:text-red-900 dark:dark:border-red-900 dark:[&>svg]:text-red-900",
|
| 14 |
},
|
| 15 |
},
|
| 16 |
defaultVariants: {
|
src/components/ui/avatar.tsx
CHANGED
|
@@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef<
|
|
| 39 |
<AvatarPrimitive.Fallback
|
| 40 |
ref={ref}
|
| 41 |
className={cn(
|
| 42 |
-
"flex h-full w-full items-center justify-center rounded-full bg-
|
| 43 |
className
|
| 44 |
)}
|
| 45 |
{...props}
|
|
|
|
| 39 |
<AvatarPrimitive.Fallback
|
| 40 |
ref={ref}
|
| 41 |
className={cn(
|
| 42 |
+
"flex h-full w-full items-center justify-center rounded-full bg-neutral-100 dark:bg-neutral-800",
|
| 43 |
className
|
| 44 |
)}
|
| 45 |
{...props}
|
src/components/ui/badge.tsx
CHANGED
|
@@ -4,17 +4,17 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
| 4 |
import { cn } from "@/lib/utils"
|
| 5 |
|
| 6 |
const badgeVariants = cva(
|
| 7 |
-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-
|
| 8 |
{
|
| 9 |
variants: {
|
| 10 |
variant: {
|
| 11 |
default:
|
| 12 |
-
"border-transparent bg-
|
| 13 |
secondary:
|
| 14 |
-
"border-transparent bg-
|
| 15 |
destructive:
|
| 16 |
-
"border-transparent bg-
|
| 17 |
-
outline: "text-
|
| 18 |
},
|
| 19 |
},
|
| 20 |
defaultVariants: {
|
|
|
|
| 4 |
import { cn } from "@/lib/utils"
|
| 5 |
|
| 6 |
const badgeVariants = cva(
|
| 7 |
+
"inline-flex items-center rounded-full border border-neutral-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 dark:border-neutral-800 dark:focus:ring-neutral-300",
|
| 8 |
{
|
| 9 |
variants: {
|
| 10 |
variant: {
|
| 11 |
default:
|
| 12 |
+
"border-transparent bg-neutral-900 text-neutral-50 hover:bg-neutral-900/80 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/80",
|
| 13 |
secondary:
|
| 14 |
+
"border-transparent bg-neutral-100 text-neutral-900 hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
|
| 15 |
destructive:
|
| 16 |
+
"border-transparent bg-red-500 text-neutral-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/80",
|
| 17 |
+
outline: "text-neutral-950 dark:text-neutral-50",
|
| 18 |
},
|
| 19 |
},
|
| 20 |
defaultVariants: {
|
src/components/ui/breadcrumb.tsx
CHANGED
|
@@ -19,7 +19,7 @@ const BreadcrumbList = React.forwardRef<
|
|
| 19 |
<ol
|
| 20 |
ref={ref}
|
| 21 |
className={cn(
|
| 22 |
-
"flex flex-wrap items-center gap-1.5 break-words text-sm text-
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
@@ -50,7 +50,7 @@ const BreadcrumbLink = React.forwardRef<
|
|
| 50 |
return (
|
| 51 |
<Comp
|
| 52 |
ref={ref}
|
| 53 |
-
className={cn("transition-colors hover:text-
|
| 54 |
{...props}
|
| 55 |
/>
|
| 56 |
)
|
|
@@ -66,7 +66,7 @@ const BreadcrumbPage = React.forwardRef<
|
|
| 66 |
role="link"
|
| 67 |
aria-disabled="true"
|
| 68 |
aria-current="page"
|
| 69 |
-
className={cn("font-normal text-
|
| 70 |
{...props}
|
| 71 |
/>
|
| 72 |
))
|
|
|
|
| 19 |
<ol
|
| 20 |
ref={ref}
|
| 21 |
className={cn(
|
| 22 |
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-neutral-500 sm:gap-2.5 dark:text-neutral-400",
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
|
|
| 50 |
return (
|
| 51 |
<Comp
|
| 52 |
ref={ref}
|
| 53 |
+
className={cn("transition-colors hover:text-neutral-950 dark:hover:text-neutral-50", className)}
|
| 54 |
{...props}
|
| 55 |
/>
|
| 56 |
)
|
|
|
|
| 66 |
role="link"
|
| 67 |
aria-disabled="true"
|
| 68 |
aria-current="page"
|
| 69 |
+
className={cn("font-normal text-neutral-950 dark:text-neutral-50", className)}
|
| 70 |
{...props}
|
| 71 |
/>
|
| 72 |
))
|
src/components/ui/button.tsx
CHANGED
|
@@ -5,19 +5,19 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
| 5 |
import { cn } from "@/lib/utils"
|
| 6 |
|
| 7 |
const buttonVariants = cva(
|
| 8 |
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-
|
| 9 |
{
|
| 10 |
variants: {
|
| 11 |
variant: {
|
| 12 |
-
default: "bg-
|
| 13 |
destructive:
|
| 14 |
-
"bg-
|
| 15 |
outline:
|
| 16 |
-
"border border-
|
| 17 |
secondary:
|
| 18 |
-
"bg-
|
| 19 |
-
ghost: "hover:bg-
|
| 20 |
-
link: "text-
|
| 21 |
},
|
| 22 |
size: {
|
| 23 |
default: "h-10 px-4 py-2",
|
|
|
|
| 5 |
import { cn } from "@/lib/utils"
|
| 6 |
|
| 7 |
const buttonVariants = cva(
|
| 8 |
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300",
|
| 9 |
{
|
| 10 |
variants: {
|
| 11 |
variant: {
|
| 12 |
+
default: "bg-neutral-900 text-neutral-50 hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",
|
| 13 |
destructive:
|
| 14 |
+
"bg-red-500 text-neutral-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/90",
|
| 15 |
outline:
|
| 16 |
+
"border border-neutral-200 bg-white hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
| 17 |
secondary:
|
| 18 |
+
"bg-neutral-100 text-neutral-900 hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
|
| 19 |
+
ghost: "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
| 20 |
+
link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50",
|
| 21 |
},
|
| 22 |
size: {
|
| 23 |
default: "h-10 px-4 py-2",
|
src/components/ui/calendar.tsx
CHANGED
|
@@ -34,22 +34,22 @@ function Calendar({
|
|
| 34 |
table: "w-full border-collapse space-y-1",
|
| 35 |
head_row: "flex",
|
| 36 |
head_cell:
|
| 37 |
-
"text-
|
| 38 |
row: "flex w-full mt-2",
|
| 39 |
-
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-
|
| 40 |
day: cn(
|
| 41 |
buttonVariants({ variant: "ghost" }),
|
| 42 |
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
| 43 |
),
|
| 44 |
day_range_end: "day-range-end",
|
| 45 |
day_selected:
|
| 46 |
-
"bg-
|
| 47 |
-
day_today: "bg-
|
| 48 |
day_outside:
|
| 49 |
-
"day-outside text-
|
| 50 |
-
day_disabled: "text-
|
| 51 |
day_range_middle:
|
| 52 |
-
"aria-selected:bg-
|
| 53 |
day_hidden: "invisible",
|
| 54 |
...classNames,
|
| 55 |
}}
|
|
|
|
| 34 |
table: "w-full border-collapse space-y-1",
|
| 35 |
head_row: "flex",
|
| 36 |
head_cell:
|
| 37 |
+
"text-neutral-500 rounded-md w-9 font-normal text-[0.8rem] dark:text-neutral-400",
|
| 38 |
row: "flex w-full mt-2",
|
| 39 |
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-neutral-100/50 [&:has([aria-selected])]:bg-neutral-100 first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 dark:[&:has([aria-selected].day-outside)]:bg-neutral-800/50 dark:[&:has([aria-selected])]:bg-neutral-800",
|
| 40 |
day: cn(
|
| 41 |
buttonVariants({ variant: "ghost" }),
|
| 42 |
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
| 43 |
),
|
| 44 |
day_range_end: "day-range-end",
|
| 45 |
day_selected:
|
| 46 |
+
"bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
|
| 47 |
+
day_today: "bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50",
|
| 48 |
day_outside:
|
| 49 |
+
"day-outside text-neutral-500 aria-selected:bg-neutral-100/50 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:bg-neutral-800/50 dark:aria-selected:text-neutral-400",
|
| 50 |
+
day_disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
|
| 51 |
day_range_middle:
|
| 52 |
+
"aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50",
|
| 53 |
day_hidden: "invisible",
|
| 54 |
...classNames,
|
| 55 |
}}
|
src/components/ui/card.tsx
CHANGED
|
@@ -9,7 +9,7 @@ const Card = React.forwardRef<
|
|
| 9 |
<div
|
| 10 |
ref={ref}
|
| 11 |
className={cn(
|
| 12 |
-
"rounded-lg border bg-
|
| 13 |
className
|
| 14 |
)}
|
| 15 |
{...props}
|
|
@@ -50,7 +50,7 @@ const CardDescription = React.forwardRef<
|
|
| 50 |
>(({ className, ...props }, ref) => (
|
| 51 |
<div
|
| 52 |
ref={ref}
|
| 53 |
-
className={cn("text-sm text-
|
| 54 |
{...props}
|
| 55 |
/>
|
| 56 |
))
|
|
|
|
| 9 |
<div
|
| 10 |
ref={ref}
|
| 11 |
className={cn(
|
| 12 |
+
"rounded-lg border border-neutral-200 bg-white text-neutral-950 shadow-sm dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 13 |
className
|
| 14 |
)}
|
| 15 |
{...props}
|
|
|
|
| 50 |
>(({ className, ...props }, ref) => (
|
| 51 |
<div
|
| 52 |
ref={ref}
|
| 53 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 54 |
{...props}
|
| 55 |
/>
|
| 56 |
))
|
src/components/ui/chart.tsx
CHANGED
|
@@ -179,7 +179,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
| 179 |
<div
|
| 180 |
ref={ref}
|
| 181 |
className={cn(
|
| 182 |
-
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-
|
| 183 |
className
|
| 184 |
)}
|
| 185 |
>
|
|
@@ -194,7 +194,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
| 194 |
<div
|
| 195 |
key={item.dataKey}
|
| 196 |
className={cn(
|
| 197 |
-
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-
|
| 198 |
indicator === "dot" && "items-center"
|
| 199 |
)}
|
| 200 |
>
|
|
@@ -234,12 +234,12 @@ const ChartTooltipContent = React.forwardRef<
|
|
| 234 |
>
|
| 235 |
<div className="grid gap-1.5">
|
| 236 |
{nestLabel ? tooltipLabel : null}
|
| 237 |
-
<span className="text-
|
| 238 |
{itemConfig?.label || item.name}
|
| 239 |
</span>
|
| 240 |
</div>
|
| 241 |
{item.value && (
|
| 242 |
-
<span className="font-mono font-medium tabular-nums text-
|
| 243 |
{item.value.toLocaleString()}
|
| 244 |
</span>
|
| 245 |
)}
|
|
@@ -293,7 +293,7 @@ const ChartLegendContent = React.forwardRef<
|
|
| 293 |
<div
|
| 294 |
key={item.value}
|
| 295 |
className={cn(
|
| 296 |
-
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-
|
| 297 |
)}
|
| 298 |
>
|
| 299 |
{itemConfig?.icon && !hideIcon ? (
|
|
|
|
| 179 |
<div
|
| 180 |
ref={ref}
|
| 181 |
className={cn(
|
| 182 |
+
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-neutral-200 border-neutral-200/50 bg-white px-2.5 py-1.5 text-xs shadow-xl dark:border-neutral-800 dark:border-neutral-800/50 dark:bg-neutral-950",
|
| 183 |
className
|
| 184 |
)}
|
| 185 |
>
|
|
|
|
| 194 |
<div
|
| 195 |
key={item.dataKey}
|
| 196 |
className={cn(
|
| 197 |
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500 dark:[&>svg]:text-neutral-400",
|
| 198 |
indicator === "dot" && "items-center"
|
| 199 |
)}
|
| 200 |
>
|
|
|
|
| 234 |
>
|
| 235 |
<div className="grid gap-1.5">
|
| 236 |
{nestLabel ? tooltipLabel : null}
|
| 237 |
+
<span className="text-neutral-500 dark:text-neutral-400">
|
| 238 |
{itemConfig?.label || item.name}
|
| 239 |
</span>
|
| 240 |
</div>
|
| 241 |
{item.value && (
|
| 242 |
+
<span className="font-mono font-medium tabular-nums text-neutral-950 dark:text-neutral-50">
|
| 243 |
{item.value.toLocaleString()}
|
| 244 |
</span>
|
| 245 |
)}
|
|
|
|
| 293 |
<div
|
| 294 |
key={item.value}
|
| 295 |
className={cn(
|
| 296 |
+
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-neutral-500 dark:[&>svg]:text-neutral-400"
|
| 297 |
)}
|
| 298 |
>
|
| 299 |
{itemConfig?.icon && !hideIcon ? (
|
src/components/ui/checkbox.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const Checkbox = React.forwardRef<
|
|
| 13 |
<CheckboxPrimitive.Root
|
| 14 |
ref={ref}
|
| 15 |
className={cn(
|
| 16 |
-
"peer h-4 w-4 shrink-0 rounded-sm border border-
|
| 17 |
className
|
| 18 |
)}
|
| 19 |
{...props}
|
|
|
|
| 13 |
<CheckboxPrimitive.Root
|
| 14 |
ref={ref}
|
| 15 |
className={cn(
|
| 16 |
+
"peer h-4 w-4 shrink-0 rounded-sm border border-neutral-200 border-neutral-900 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 dark:border-neutral-800 dark:border-neutral-50 dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900",
|
| 17 |
className
|
| 18 |
)}
|
| 19 |
{...props}
|
src/components/ui/command.tsx
CHANGED
|
@@ -15,7 +15,7 @@ const Command = React.forwardRef<
|
|
| 15 |
<CommandPrimitive
|
| 16 |
ref={ref}
|
| 17 |
className={cn(
|
| 18 |
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-
|
| 19 |
className
|
| 20 |
)}
|
| 21 |
{...props}
|
|
@@ -27,7 +27,7 @@ const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
| 27 |
return (
|
| 28 |
<Dialog {...props}>
|
| 29 |
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
| 30 |
-
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-
|
| 31 |
{children}
|
| 32 |
</Command>
|
| 33 |
</DialogContent>
|
|
@@ -44,7 +44,7 @@ const CommandInput = React.forwardRef<
|
|
| 44 |
<CommandPrimitive.Input
|
| 45 |
ref={ref}
|
| 46 |
className={cn(
|
| 47 |
-
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-
|
| 48 |
className
|
| 49 |
)}
|
| 50 |
{...props}
|
|
@@ -87,7 +87,7 @@ const CommandGroup = React.forwardRef<
|
|
| 87 |
<CommandPrimitive.Group
|
| 88 |
ref={ref}
|
| 89 |
className={cn(
|
| 90 |
-
"overflow-hidden p-1 text-
|
| 91 |
className
|
| 92 |
)}
|
| 93 |
{...props}
|
|
@@ -102,7 +102,7 @@ const CommandSeparator = React.forwardRef<
|
|
| 102 |
>(({ className, ...props }, ref) => (
|
| 103 |
<CommandPrimitive.Separator
|
| 104 |
ref={ref}
|
| 105 |
-
className={cn("-mx-1 h-px bg-
|
| 106 |
{...props}
|
| 107 |
/>
|
| 108 |
))
|
|
@@ -115,7 +115,7 @@ const CommandItem = React.forwardRef<
|
|
| 115 |
<CommandPrimitive.Item
|
| 116 |
ref={ref}
|
| 117 |
className={cn(
|
| 118 |
-
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-
|
| 119 |
className
|
| 120 |
)}
|
| 121 |
{...props}
|
|
@@ -131,7 +131,7 @@ const CommandShortcut = ({
|
|
| 131 |
return (
|
| 132 |
<span
|
| 133 |
className={cn(
|
| 134 |
-
"ml-auto text-xs tracking-widest text-
|
| 135 |
className
|
| 136 |
)}
|
| 137 |
{...props}
|
|
|
|
| 15 |
<CommandPrimitive
|
| 16 |
ref={ref}
|
| 17 |
className={cn(
|
| 18 |
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-neutral-950 dark:bg-neutral-950 dark:text-neutral-50",
|
| 19 |
className
|
| 20 |
)}
|
| 21 |
{...props}
|
|
|
|
| 27 |
return (
|
| 28 |
<Dialog {...props}>
|
| 29 |
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
| 30 |
+
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-neutral-400">
|
| 31 |
{children}
|
| 32 |
</Command>
|
| 33 |
</DialogContent>
|
|
|
|
| 44 |
<CommandPrimitive.Input
|
| 45 |
ref={ref}
|
| 46 |
className={cn(
|
| 47 |
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-neutral-400",
|
| 48 |
className
|
| 49 |
)}
|
| 50 |
{...props}
|
|
|
|
| 87 |
<CommandPrimitive.Group
|
| 88 |
ref={ref}
|
| 89 |
className={cn(
|
| 90 |
+
"overflow-hidden p-1 text-neutral-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 dark:text-neutral-50 dark:[&_[cmdk-group-heading]]:text-neutral-400",
|
| 91 |
className
|
| 92 |
)}
|
| 93 |
{...props}
|
|
|
|
| 102 |
>(({ className, ...props }, ref) => (
|
| 103 |
<CommandPrimitive.Separator
|
| 104 |
ref={ref}
|
| 105 |
+
className={cn("-mx-1 h-px bg-neutral-200 dark:bg-neutral-800", className)}
|
| 106 |
{...props}
|
| 107 |
/>
|
| 108 |
))
|
|
|
|
| 115 |
<CommandPrimitive.Item
|
| 116 |
ref={ref}
|
| 117 |
className={cn(
|
| 118 |
+
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:data-[selected='true']:bg-neutral-800 dark:data-[selected=true]:text-neutral-50",
|
| 119 |
className
|
| 120 |
)}
|
| 121 |
{...props}
|
|
|
|
| 131 |
return (
|
| 132 |
<span
|
| 133 |
className={cn(
|
| 134 |
+
"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400",
|
| 135 |
className
|
| 136 |
)}
|
| 137 |
{...props}
|
src/components/ui/context-menu.tsx
CHANGED
|
@@ -27,7 +27,7 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
| 27 |
<ContextMenuPrimitive.SubTrigger
|
| 28 |
ref={ref}
|
| 29 |
className={cn(
|
| 30 |
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-
|
| 31 |
inset && "pl-8",
|
| 32 |
className
|
| 33 |
)}
|
|
@@ -46,7 +46,7 @@ const ContextMenuSubContent = React.forwardRef<
|
|
| 46 |
<ContextMenuPrimitive.SubContent
|
| 47 |
ref={ref}
|
| 48 |
className={cn(
|
| 49 |
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 50 |
className
|
| 51 |
)}
|
| 52 |
{...props}
|
|
@@ -62,7 +62,7 @@ const ContextMenuContent = React.forwardRef<
|
|
| 62 |
<ContextMenuPrimitive.Content
|
| 63 |
ref={ref}
|
| 64 |
className={cn(
|
| 65 |
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 66 |
className
|
| 67 |
)}
|
| 68 |
{...props}
|
|
@@ -80,7 +80,7 @@ const ContextMenuItem = React.forwardRef<
|
|
| 80 |
<ContextMenuPrimitive.Item
|
| 81 |
ref={ref}
|
| 82 |
className={cn(
|
| 83 |
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-
|
| 84 |
inset && "pl-8",
|
| 85 |
className
|
| 86 |
)}
|
|
@@ -96,7 +96,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
| 96 |
<ContextMenuPrimitive.CheckboxItem
|
| 97 |
ref={ref}
|
| 98 |
className={cn(
|
| 99 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
| 100 |
className
|
| 101 |
)}
|
| 102 |
checked={checked}
|
|
@@ -120,7 +120,7 @@ const ContextMenuRadioItem = React.forwardRef<
|
|
| 120 |
<ContextMenuPrimitive.RadioItem
|
| 121 |
ref={ref}
|
| 122 |
className={cn(
|
| 123 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
| 124 |
className
|
| 125 |
)}
|
| 126 |
{...props}
|
|
@@ -144,7 +144,7 @@ const ContextMenuLabel = React.forwardRef<
|
|
| 144 |
<ContextMenuPrimitive.Label
|
| 145 |
ref={ref}
|
| 146 |
className={cn(
|
| 147 |
-
"px-2 py-1.5 text-sm font-semibold text-
|
| 148 |
inset && "pl-8",
|
| 149 |
className
|
| 150 |
)}
|
|
@@ -159,7 +159,7 @@ const ContextMenuSeparator = React.forwardRef<
|
|
| 159 |
>(({ className, ...props }, ref) => (
|
| 160 |
<ContextMenuPrimitive.Separator
|
| 161 |
ref={ref}
|
| 162 |
-
className={cn("-mx-1 my-1 h-px bg-
|
| 163 |
{...props}
|
| 164 |
/>
|
| 165 |
))
|
|
@@ -172,7 +172,7 @@ const ContextMenuShortcut = ({
|
|
| 172 |
return (
|
| 173 |
<span
|
| 174 |
className={cn(
|
| 175 |
-
"ml-auto text-xs tracking-widest text-
|
| 176 |
className
|
| 177 |
)}
|
| 178 |
{...props}
|
|
|
|
| 27 |
<ContextMenuPrimitive.SubTrigger
|
| 28 |
ref={ref}
|
| 29 |
className={cn(
|
| 30 |
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50",
|
| 31 |
inset && "pl-8",
|
| 32 |
className
|
| 33 |
)}
|
|
|
|
| 46 |
<ContextMenuPrimitive.SubContent
|
| 47 |
ref={ref}
|
| 48 |
className={cn(
|
| 49 |
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 50 |
className
|
| 51 |
)}
|
| 52 |
{...props}
|
|
|
|
| 62 |
<ContextMenuPrimitive.Content
|
| 63 |
ref={ref}
|
| 64 |
className={cn(
|
| 65 |
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 66 |
className
|
| 67 |
)}
|
| 68 |
{...props}
|
|
|
|
| 80 |
<ContextMenuPrimitive.Item
|
| 81 |
ref={ref}
|
| 82 |
className={cn(
|
| 83 |
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 84 |
inset && "pl-8",
|
| 85 |
className
|
| 86 |
)}
|
|
|
|
| 96 |
<ContextMenuPrimitive.CheckboxItem
|
| 97 |
ref={ref}
|
| 98 |
className={cn(
|
| 99 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 100 |
className
|
| 101 |
)}
|
| 102 |
checked={checked}
|
|
|
|
| 120 |
<ContextMenuPrimitive.RadioItem
|
| 121 |
ref={ref}
|
| 122 |
className={cn(
|
| 123 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 124 |
className
|
| 125 |
)}
|
| 126 |
{...props}
|
|
|
|
| 144 |
<ContextMenuPrimitive.Label
|
| 145 |
ref={ref}
|
| 146 |
className={cn(
|
| 147 |
+
"px-2 py-1.5 text-sm font-semibold text-neutral-950 dark:text-neutral-50",
|
| 148 |
inset && "pl-8",
|
| 149 |
className
|
| 150 |
)}
|
|
|
|
| 159 |
>(({ className, ...props }, ref) => (
|
| 160 |
<ContextMenuPrimitive.Separator
|
| 161 |
ref={ref}
|
| 162 |
+
className={cn("-mx-1 my-1 h-px bg-neutral-200 dark:bg-neutral-800", className)}
|
| 163 |
{...props}
|
| 164 |
/>
|
| 165 |
))
|
|
|
|
| 172 |
return (
|
| 173 |
<span
|
| 174 |
className={cn(
|
| 175 |
+
"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400",
|
| 176 |
className
|
| 177 |
)}
|
| 178 |
{...props}
|
src/components/ui/dialog.tsx
CHANGED
|
@@ -38,13 +38,13 @@ const DialogContent = React.forwardRef<
|
|
| 38 |
<DialogPrimitive.Content
|
| 39 |
ref={ref}
|
| 40 |
className={cn(
|
| 41 |
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-
|
| 42 |
className
|
| 43 |
)}
|
| 44 |
{...props}
|
| 45 |
>
|
| 46 |
{children}
|
| 47 |
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-
|
| 48 |
<X className="h-4 w-4" />
|
| 49 |
<span className="sr-only">Close</span>
|
| 50 |
</DialogPrimitive.Close>
|
|
@@ -102,7 +102,7 @@ const DialogDescription = React.forwardRef<
|
|
| 102 |
>(({ className, ...props }, ref) => (
|
| 103 |
<DialogPrimitive.Description
|
| 104 |
ref={ref}
|
| 105 |
-
className={cn("text-sm text-
|
| 106 |
{...props}
|
| 107 |
/>
|
| 108 |
))
|
|
|
|
| 38 |
<DialogPrimitive.Content
|
| 39 |
ref={ref}
|
| 40 |
className={cn(
|
| 41 |
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",
|
| 42 |
className
|
| 43 |
)}
|
| 44 |
{...props}
|
| 45 |
>
|
| 46 |
{children}
|
| 47 |
+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400">
|
| 48 |
<X className="h-4 w-4" />
|
| 49 |
<span className="sr-only">Close</span>
|
| 50 |
</DialogPrimitive.Close>
|
|
|
|
| 102 |
>(({ className, ...props }, ref) => (
|
| 103 |
<DialogPrimitive.Description
|
| 104 |
ref={ref}
|
| 105 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 106 |
{...props}
|
| 107 |
/>
|
| 108 |
))
|
src/components/ui/drawer.tsx
CHANGED
|
@@ -43,12 +43,12 @@ const DrawerContent = React.forwardRef<
|
|
| 43 |
<DrawerPrimitive.Content
|
| 44 |
ref={ref}
|
| 45 |
className={cn(
|
| 46 |
-
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-
|
| 47 |
className
|
| 48 |
)}
|
| 49 |
{...props}
|
| 50 |
>
|
| 51 |
-
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-
|
| 52 |
{children}
|
| 53 |
</DrawerPrimitive.Content>
|
| 54 |
</DrawerPortal>
|
|
@@ -98,7 +98,7 @@ const DrawerDescription = React.forwardRef<
|
|
| 98 |
>(({ className, ...props }, ref) => (
|
| 99 |
<DrawerPrimitive.Description
|
| 100 |
ref={ref}
|
| 101 |
-
className={cn("text-sm text-
|
| 102 |
{...props}
|
| 103 |
/>
|
| 104 |
))
|
|
|
|
| 43 |
<DrawerPrimitive.Content
|
| 44 |
ref={ref}
|
| 45 |
className={cn(
|
| 46 |
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-950",
|
| 47 |
className
|
| 48 |
)}
|
| 49 |
{...props}
|
| 50 |
>
|
| 51 |
+
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-neutral-100 dark:bg-neutral-800" />
|
| 52 |
{children}
|
| 53 |
</DrawerPrimitive.Content>
|
| 54 |
</DrawerPortal>
|
|
|
|
| 98 |
>(({ className, ...props }, ref) => (
|
| 99 |
<DrawerPrimitive.Description
|
| 100 |
ref={ref}
|
| 101 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 102 |
{...props}
|
| 103 |
/>
|
| 104 |
))
|
src/components/ui/dropdown-menu.tsx
CHANGED
|
@@ -27,7 +27,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
| 27 |
<DropdownMenuPrimitive.SubTrigger
|
| 28 |
ref={ref}
|
| 29 |
className={cn(
|
| 30 |
-
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-
|
| 31 |
inset && "pl-8",
|
| 32 |
className
|
| 33 |
)}
|
|
@@ -47,7 +47,7 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
| 47 |
<DropdownMenuPrimitive.SubContent
|
| 48 |
ref={ref}
|
| 49 |
className={cn(
|
| 50 |
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 51 |
className
|
| 52 |
)}
|
| 53 |
{...props}
|
|
@@ -65,7 +65,7 @@ const DropdownMenuContent = React.forwardRef<
|
|
| 65 |
ref={ref}
|
| 66 |
sideOffset={sideOffset}
|
| 67 |
className={cn(
|
| 68 |
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 69 |
className
|
| 70 |
)}
|
| 71 |
{...props}
|
|
@@ -83,7 +83,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
| 83 |
<DropdownMenuPrimitive.Item
|
| 84 |
ref={ref}
|
| 85 |
className={cn(
|
| 86 |
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-
|
| 87 |
inset && "pl-8",
|
| 88 |
className
|
| 89 |
)}
|
|
@@ -99,7 +99,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
| 99 |
<DropdownMenuPrimitive.CheckboxItem
|
| 100 |
ref={ref}
|
| 101 |
className={cn(
|
| 102 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-
|
| 103 |
className
|
| 104 |
)}
|
| 105 |
checked={checked}
|
|
@@ -123,7 +123,7 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
| 123 |
<DropdownMenuPrimitive.RadioItem
|
| 124 |
ref={ref}
|
| 125 |
className={cn(
|
| 126 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-
|
| 127 |
className
|
| 128 |
)}
|
| 129 |
{...props}
|
|
@@ -162,7 +162,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
| 162 |
>(({ className, ...props }, ref) => (
|
| 163 |
<DropdownMenuPrimitive.Separator
|
| 164 |
ref={ref}
|
| 165 |
-
className={cn("-mx-1 my-1 h-px bg-
|
| 166 |
{...props}
|
| 167 |
/>
|
| 168 |
))
|
|
|
|
| 27 |
<DropdownMenuPrimitive.SubTrigger
|
| 28 |
ref={ref}
|
| 29 |
className={cn(
|
| 30 |
+
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 data-[state=open]:bg-neutral-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:focus:bg-neutral-800 dark:data-[state=open]:bg-neutral-800",
|
| 31 |
inset && "pl-8",
|
| 32 |
className
|
| 33 |
)}
|
|
|
|
| 47 |
<DropdownMenuPrimitive.SubContent
|
| 48 |
ref={ref}
|
| 49 |
className={cn(
|
| 50 |
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 51 |
className
|
| 52 |
)}
|
| 53 |
{...props}
|
|
|
|
| 65 |
ref={ref}
|
| 66 |
sideOffset={sideOffset}
|
| 67 |
className={cn(
|
| 68 |
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 69 |
className
|
| 70 |
)}
|
| 71 |
{...props}
|
|
|
|
| 83 |
<DropdownMenuPrimitive.Item
|
| 84 |
ref={ref}
|
| 85 |
className={cn(
|
| 86 |
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 87 |
inset && "pl-8",
|
| 88 |
className
|
| 89 |
)}
|
|
|
|
| 99 |
<DropdownMenuPrimitive.CheckboxItem
|
| 100 |
ref={ref}
|
| 101 |
className={cn(
|
| 102 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 103 |
className
|
| 104 |
)}
|
| 105 |
checked={checked}
|
|
|
|
| 123 |
<DropdownMenuPrimitive.RadioItem
|
| 124 |
ref={ref}
|
| 125 |
className={cn(
|
| 126 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 127 |
className
|
| 128 |
)}
|
| 129 |
{...props}
|
|
|
|
| 162 |
>(({ className, ...props }, ref) => (
|
| 163 |
<DropdownMenuPrimitive.Separator
|
| 164 |
ref={ref}
|
| 165 |
+
className={cn("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800", className)}
|
| 166 |
{...props}
|
| 167 |
/>
|
| 168 |
))
|
src/components/ui/form.tsx
CHANGED
|
@@ -95,7 +95,7 @@ const FormLabel = React.forwardRef<
|
|
| 95 |
return (
|
| 96 |
<Label
|
| 97 |
ref={ref}
|
| 98 |
-
className={cn(error && "text-
|
| 99 |
htmlFor={formItemId}
|
| 100 |
{...props}
|
| 101 |
/>
|
|
@@ -135,7 +135,7 @@ const FormDescription = React.forwardRef<
|
|
| 135 |
<p
|
| 136 |
ref={ref}
|
| 137 |
id={formDescriptionId}
|
| 138 |
-
className={cn("text-sm text-
|
| 139 |
{...props}
|
| 140 |
/>
|
| 141 |
)
|
|
@@ -157,7 +157,7 @@ const FormMessage = React.forwardRef<
|
|
| 157 |
<p
|
| 158 |
ref={ref}
|
| 159 |
id={formMessageId}
|
| 160 |
-
className={cn("text-sm font-medium text-
|
| 161 |
{...props}
|
| 162 |
>
|
| 163 |
{body}
|
|
|
|
| 95 |
return (
|
| 96 |
<Label
|
| 97 |
ref={ref}
|
| 98 |
+
className={cn(error && "text-red-500 dark:text-red-900", className)}
|
| 99 |
htmlFor={formItemId}
|
| 100 |
{...props}
|
| 101 |
/>
|
|
|
|
| 135 |
<p
|
| 136 |
ref={ref}
|
| 137 |
id={formDescriptionId}
|
| 138 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 139 |
{...props}
|
| 140 |
/>
|
| 141 |
)
|
|
|
|
| 157 |
<p
|
| 158 |
ref={ref}
|
| 159 |
id={formMessageId}
|
| 160 |
+
className={cn("text-sm font-medium text-red-500 dark:text-red-900", className)}
|
| 161 |
{...props}
|
| 162 |
>
|
| 163 |
{body}
|
src/components/ui/hover-card.tsx
CHANGED
|
@@ -18,7 +18,7 @@ const HoverCardContent = React.forwardRef<
|
|
| 18 |
align={align}
|
| 19 |
sideOffset={sideOffset}
|
| 20 |
className={cn(
|
| 21 |
-
"z-50 w-64 rounded-md border bg-
|
| 22 |
className
|
| 23 |
)}
|
| 24 |
{...props}
|
|
|
|
| 18 |
align={align}
|
| 19 |
sideOffset={sideOffset}
|
| 20 |
className={cn(
|
| 21 |
+
"z-50 w-64 rounded-md border border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 22 |
className
|
| 23 |
)}
|
| 24 |
{...props}
|
src/components/ui/input-otp.tsx
CHANGED
|
@@ -41,8 +41,8 @@ const InputOTPSlot = React.forwardRef<
|
|
| 41 |
<div
|
| 42 |
ref={ref}
|
| 43 |
className={cn(
|
| 44 |
-
"relative flex h-10 w-10 items-center justify-center border-y border-r border-
|
| 45 |
-
isActive && "z-10 ring-2 ring-ring ring-offset-
|
| 46 |
className
|
| 47 |
)}
|
| 48 |
{...props}
|
|
@@ -50,7 +50,7 @@ const InputOTPSlot = React.forwardRef<
|
|
| 50 |
{char}
|
| 51 |
{hasFakeCaret && (
|
| 52 |
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
| 53 |
-
<div className="h-4 w-px animate-caret-blink bg-
|
| 54 |
</div>
|
| 55 |
)}
|
| 56 |
</div>
|
|
|
|
| 41 |
<div
|
| 42 |
ref={ref}
|
| 43 |
className={cn(
|
| 44 |
+
"relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800",
|
| 45 |
+
isActive && "z-10 ring-2 ring-neutral-950 ring-offset-white dark:ring-neutral-300 dark:ring-offset-neutral-950",
|
| 46 |
className
|
| 47 |
)}
|
| 48 |
{...props}
|
|
|
|
| 50 |
{char}
|
| 51 |
{hasFakeCaret && (
|
| 52 |
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
| 53 |
+
<div className="h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50" />
|
| 54 |
</div>
|
| 55 |
)}
|
| 56 |
</div>
|
src/components/ui/input.tsx
CHANGED
|
@@ -8,7 +8,7 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
| 8 |
<input
|
| 9 |
type={type}
|
| 10 |
className={cn(
|
| 11 |
-
"flex h-10 w-full rounded-md border border-
|
| 12 |
className
|
| 13 |
)}
|
| 14 |
ref={ref}
|
|
|
|
| 8 |
<input
|
| 9 |
type={type}
|
| 10 |
className={cn(
|
| 11 |
+
"flex h-10 w-full rounded-md border border-neutral-200 bg-white px-3 py-2 text-base ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:file:text-neutral-50 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",
|
| 12 |
className
|
| 13 |
)}
|
| 14 |
ref={ref}
|
src/components/ui/menubar.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const Menubar = React.forwardRef<
|
|
| 23 |
<MenubarPrimitive.Root
|
| 24 |
ref={ref}
|
| 25 |
className={cn(
|
| 26 |
-
"flex h-10 items-center space-x-1 rounded-md border bg-
|
| 27 |
className
|
| 28 |
)}
|
| 29 |
{...props}
|
|
@@ -38,7 +38,7 @@ const MenubarTrigger = React.forwardRef<
|
|
| 38 |
<MenubarPrimitive.Trigger
|
| 39 |
ref={ref}
|
| 40 |
className={cn(
|
| 41 |
-
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-
|
| 42 |
className
|
| 43 |
)}
|
| 44 |
{...props}
|
|
@@ -55,7 +55,7 @@ const MenubarSubTrigger = React.forwardRef<
|
|
| 55 |
<MenubarPrimitive.SubTrigger
|
| 56 |
ref={ref}
|
| 57 |
className={cn(
|
| 58 |
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-
|
| 59 |
inset && "pl-8",
|
| 60 |
className
|
| 61 |
)}
|
|
@@ -74,7 +74,7 @@ const MenubarSubContent = React.forwardRef<
|
|
| 74 |
<MenubarPrimitive.SubContent
|
| 75 |
ref={ref}
|
| 76 |
className={cn(
|
| 77 |
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 78 |
className
|
| 79 |
)}
|
| 80 |
{...props}
|
|
@@ -97,7 +97,7 @@ const MenubarContent = React.forwardRef<
|
|
| 97 |
alignOffset={alignOffset}
|
| 98 |
sideOffset={sideOffset}
|
| 99 |
className={cn(
|
| 100 |
-
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-
|
| 101 |
className
|
| 102 |
)}
|
| 103 |
{...props}
|
|
@@ -116,7 +116,7 @@ const MenubarItem = React.forwardRef<
|
|
| 116 |
<MenubarPrimitive.Item
|
| 117 |
ref={ref}
|
| 118 |
className={cn(
|
| 119 |
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-
|
| 120 |
inset && "pl-8",
|
| 121 |
className
|
| 122 |
)}
|
|
@@ -132,7 +132,7 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
| 132 |
<MenubarPrimitive.CheckboxItem
|
| 133 |
ref={ref}
|
| 134 |
className={cn(
|
| 135 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
| 136 |
className
|
| 137 |
)}
|
| 138 |
checked={checked}
|
|
@@ -155,7 +155,7 @@ const MenubarRadioItem = React.forwardRef<
|
|
| 155 |
<MenubarPrimitive.RadioItem
|
| 156 |
ref={ref}
|
| 157 |
className={cn(
|
| 158 |
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
| 159 |
className
|
| 160 |
)}
|
| 161 |
{...props}
|
|
@@ -194,7 +194,7 @@ const MenubarSeparator = React.forwardRef<
|
|
| 194 |
>(({ className, ...props }, ref) => (
|
| 195 |
<MenubarPrimitive.Separator
|
| 196 |
ref={ref}
|
| 197 |
-
className={cn("-mx-1 my-1 h-px bg-
|
| 198 |
{...props}
|
| 199 |
/>
|
| 200 |
))
|
|
@@ -207,7 +207,7 @@ const MenubarShortcut = ({
|
|
| 207 |
return (
|
| 208 |
<span
|
| 209 |
className={cn(
|
| 210 |
-
"ml-auto text-xs tracking-widest text-
|
| 211 |
className
|
| 212 |
)}
|
| 213 |
{...props}
|
|
|
|
| 23 |
<MenubarPrimitive.Root
|
| 24 |
ref={ref}
|
| 25 |
className={cn(
|
| 26 |
+
"flex h-10 items-center space-x-1 rounded-md border border-neutral-200 bg-white p-1 dark:border-neutral-800 dark:bg-neutral-950",
|
| 27 |
className
|
| 28 |
)}
|
| 29 |
{...props}
|
|
|
|
| 38 |
<MenubarPrimitive.Trigger
|
| 39 |
ref={ref}
|
| 40 |
className={cn(
|
| 41 |
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50",
|
| 42 |
className
|
| 43 |
)}
|
| 44 |
{...props}
|
|
|
|
| 55 |
<MenubarPrimitive.SubTrigger
|
| 56 |
ref={ref}
|
| 57 |
className={cn(
|
| 58 |
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50",
|
| 59 |
inset && "pl-8",
|
| 60 |
className
|
| 61 |
)}
|
|
|
|
| 74 |
<MenubarPrimitive.SubContent
|
| 75 |
ref={ref}
|
| 76 |
className={cn(
|
| 77 |
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 78 |
className
|
| 79 |
)}
|
| 80 |
{...props}
|
|
|
|
| 97 |
alignOffset={alignOffset}
|
| 98 |
sideOffset={sideOffset}
|
| 99 |
className={cn(
|
| 100 |
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 101 |
className
|
| 102 |
)}
|
| 103 |
{...props}
|
|
|
|
| 116 |
<MenubarPrimitive.Item
|
| 117 |
ref={ref}
|
| 118 |
className={cn(
|
| 119 |
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 120 |
inset && "pl-8",
|
| 121 |
className
|
| 122 |
)}
|
|
|
|
| 132 |
<MenubarPrimitive.CheckboxItem
|
| 133 |
ref={ref}
|
| 134 |
className={cn(
|
| 135 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 136 |
className
|
| 137 |
)}
|
| 138 |
checked={checked}
|
|
|
|
| 155 |
<MenubarPrimitive.RadioItem
|
| 156 |
ref={ref}
|
| 157 |
className={cn(
|
| 158 |
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 159 |
className
|
| 160 |
)}
|
| 161 |
{...props}
|
|
|
|
| 194 |
>(({ className, ...props }, ref) => (
|
| 195 |
<MenubarPrimitive.Separator
|
| 196 |
ref={ref}
|
| 197 |
+
className={cn("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800", className)}
|
| 198 |
{...props}
|
| 199 |
/>
|
| 200 |
))
|
|
|
|
| 207 |
return (
|
| 208 |
<span
|
| 209 |
className={cn(
|
| 210 |
+
"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400",
|
| 211 |
className
|
| 212 |
)}
|
| 213 |
{...props}
|
src/components/ui/navigation-menu.tsx
CHANGED
|
@@ -41,7 +41,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
| 41 |
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
| 42 |
|
| 43 |
const navigationMenuTriggerStyle = cva(
|
| 44 |
-
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-
|
| 45 |
)
|
| 46 |
|
| 47 |
const NavigationMenuTrigger = React.forwardRef<
|
|
@@ -53,7 +53,7 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
| 53 |
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
| 54 |
{...props}
|
| 55 |
>
|
| 56 |
-
{children}{"
|
| 57 |
<ChevronDown
|
| 58 |
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
| 59 |
aria-hidden="true"
|
|
@@ -69,7 +69,7 @@ const NavigationMenuContent = React.forwardRef<
|
|
| 69 |
<NavigationMenuPrimitive.Content
|
| 70 |
ref={ref}
|
| 71 |
className={cn(
|
| 72 |
-
"left-0 top-0 w-full 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 md:absolute md:w-auto
|
| 73 |
className
|
| 74 |
)}
|
| 75 |
{...props}
|
|
@@ -86,7 +86,7 @@ const NavigationMenuViewport = React.forwardRef<
|
|
| 86 |
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
| 87 |
<NavigationMenuPrimitive.Viewport
|
| 88 |
className={cn(
|
| 89 |
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-
|
| 90 |
className
|
| 91 |
)}
|
| 92 |
ref={ref}
|
|
@@ -109,7 +109,7 @@ const NavigationMenuIndicator = React.forwardRef<
|
|
| 109 |
)}
|
| 110 |
{...props}
|
| 111 |
>
|
| 112 |
-
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-
|
| 113 |
</NavigationMenuPrimitive.Indicator>
|
| 114 |
))
|
| 115 |
NavigationMenuIndicator.displayName =
|
|
|
|
| 41 |
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
| 42 |
|
| 43 |
const navigationMenuTriggerStyle = cva(
|
| 44 |
+
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium transition-colors hover:bg-neutral-100 hover:text-neutral-900 focus:bg-neutral-100 focus:text-neutral-900 focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-neutral-100/50 data-[state=open]:bg-neutral-100/50 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[active]:bg-neutral-800/50 dark:data-[state=open]:bg-neutral-800/50"
|
| 45 |
)
|
| 46 |
|
| 47 |
const NavigationMenuTrigger = React.forwardRef<
|
|
|
|
| 53 |
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
| 54 |
{...props}
|
| 55 |
>
|
| 56 |
+
{children}{""}
|
| 57 |
<ChevronDown
|
| 58 |
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
| 59 |
aria-hidden="true"
|
|
|
|
| 69 |
<NavigationMenuPrimitive.Content
|
| 70 |
ref={ref}
|
| 71 |
className={cn(
|
| 72 |
+
"left-0 top-0 w-full 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 md:absolute md:w-auto",
|
| 73 |
className
|
| 74 |
)}
|
| 75 |
{...props}
|
|
|
|
| 86 |
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
| 87 |
<NavigationMenuPrimitive.Viewport
|
| 88 |
className={cn(
|
| 89 |
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-neutral-200 bg-white text-neutral-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)] dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 90 |
className
|
| 91 |
)}
|
| 92 |
ref={ref}
|
|
|
|
| 109 |
)}
|
| 110 |
{...props}
|
| 111 |
>
|
| 112 |
+
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-neutral-200 shadow-md dark:bg-neutral-800" />
|
| 113 |
</NavigationMenuPrimitive.Indicator>
|
| 114 |
))
|
| 115 |
NavigationMenuIndicator.displayName =
|
src/components/ui/pagination.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
import * as React from "react"
|
| 2 |
-
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
| 3 |
|
| 4 |
-
import { cn } from "@/lib/utils"
|
| 5 |
-
import { ButtonProps, buttonVariants } from "@/components/ui/button"
|
| 6 |
|
| 7 |
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
| 8 |
<nav
|
|
@@ -11,8 +11,8 @@ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
|
| 11 |
className={cn("mx-auto flex w-full justify-center", className)}
|
| 12 |
{...props}
|
| 13 |
/>
|
| 14 |
-
)
|
| 15 |
-
Pagination.displayName = "Pagination"
|
| 16 |
|
| 17 |
const PaginationContent = React.forwardRef<
|
| 18 |
HTMLUListElement,
|
|
@@ -23,21 +23,21 @@ const PaginationContent = React.forwardRef<
|
|
| 23 |
className={cn("flex flex-row items-center gap-1", className)}
|
| 24 |
{...props}
|
| 25 |
/>
|
| 26 |
-
))
|
| 27 |
-
PaginationContent.displayName = "PaginationContent"
|
| 28 |
|
| 29 |
const PaginationItem = React.forwardRef<
|
| 30 |
HTMLLIElement,
|
| 31 |
React.ComponentProps<"li">
|
| 32 |
>(({ className, ...props }, ref) => (
|
| 33 |
<li ref={ref} className={cn("", className)} {...props} />
|
| 34 |
-
))
|
| 35 |
-
PaginationItem.displayName = "PaginationItem"
|
| 36 |
|
| 37 |
type PaginationLinkProps = {
|
| 38 |
-
isActive?: boolean
|
| 39 |
} & Pick<ButtonProps, "size"> &
|
| 40 |
-
React.ComponentProps<"a">
|
| 41 |
|
| 42 |
const PaginationLink = ({
|
| 43 |
className,
|
|
@@ -56,8 +56,8 @@ const PaginationLink = ({
|
|
| 56 |
)}
|
| 57 |
{...props}
|
| 58 |
/>
|
| 59 |
-
)
|
| 60 |
-
PaginationLink.displayName = "PaginationLink"
|
| 61 |
|
| 62 |
const PaginationPrevious = ({
|
| 63 |
className,
|
|
@@ -72,8 +72,8 @@ const PaginationPrevious = ({
|
|
| 72 |
<ChevronLeft className="h-4 w-4" />
|
| 73 |
<span>Previous</span>
|
| 74 |
</PaginationLink>
|
| 75 |
-
)
|
| 76 |
-
PaginationPrevious.displayName = "PaginationPrevious"
|
| 77 |
|
| 78 |
const PaginationNext = ({
|
| 79 |
className,
|
|
@@ -88,8 +88,8 @@ const PaginationNext = ({
|
|
| 88 |
<span>Next</span>
|
| 89 |
<ChevronRight className="h-4 w-4" />
|
| 90 |
</PaginationLink>
|
| 91 |
-
)
|
| 92 |
-
PaginationNext.displayName = "PaginationNext"
|
| 93 |
|
| 94 |
const PaginationEllipsis = ({
|
| 95 |
className,
|
|
@@ -103,8 +103,8 @@ const PaginationEllipsis = ({
|
|
| 103 |
<MoreHorizontal className="h-4 w-4" />
|
| 104 |
<span className="sr-only">More pages</span>
|
| 105 |
</span>
|
| 106 |
-
)
|
| 107 |
-
PaginationEllipsis.displayName = "PaginationEllipsis"
|
| 108 |
|
| 109 |
export {
|
| 110 |
Pagination,
|
|
@@ -114,4 +114,4 @@ export {
|
|
| 114 |
PaginationLink,
|
| 115 |
PaginationNext,
|
| 116 |
PaginationPrevious,
|
| 117 |
-
}
|
|
|
|
| 1 |
+
import * as React from "react";
|
| 2 |
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
| 3 |
|
| 4 |
+
import { cn } from "@/lib/utils";
|
| 5 |
+
import { ButtonProps, buttonVariants } from "@/components/ui/button";
|
| 6 |
|
| 7 |
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
| 8 |
<nav
|
|
|
|
| 11 |
className={cn("mx-auto flex w-full justify-center", className)}
|
| 12 |
{...props}
|
| 13 |
/>
|
| 14 |
+
);
|
| 15 |
+
Pagination.displayName = "Pagination";
|
| 16 |
|
| 17 |
const PaginationContent = React.forwardRef<
|
| 18 |
HTMLUListElement,
|
|
|
|
| 23 |
className={cn("flex flex-row items-center gap-1", className)}
|
| 24 |
{...props}
|
| 25 |
/>
|
| 26 |
+
));
|
| 27 |
+
PaginationContent.displayName = "PaginationContent";
|
| 28 |
|
| 29 |
const PaginationItem = React.forwardRef<
|
| 30 |
HTMLLIElement,
|
| 31 |
React.ComponentProps<"li">
|
| 32 |
>(({ className, ...props }, ref) => (
|
| 33 |
<li ref={ref} className={cn("", className)} {...props} />
|
| 34 |
+
));
|
| 35 |
+
PaginationItem.displayName = "PaginationItem";
|
| 36 |
|
| 37 |
type PaginationLinkProps = {
|
| 38 |
+
isActive?: boolean;
|
| 39 |
} & Pick<ButtonProps, "size"> &
|
| 40 |
+
React.ComponentProps<"a">;
|
| 41 |
|
| 42 |
const PaginationLink = ({
|
| 43 |
className,
|
|
|
|
| 56 |
)}
|
| 57 |
{...props}
|
| 58 |
/>
|
| 59 |
+
);
|
| 60 |
+
PaginationLink.displayName = "PaginationLink";
|
| 61 |
|
| 62 |
const PaginationPrevious = ({
|
| 63 |
className,
|
|
|
|
| 72 |
<ChevronLeft className="h-4 w-4" />
|
| 73 |
<span>Previous</span>
|
| 74 |
</PaginationLink>
|
| 75 |
+
);
|
| 76 |
+
PaginationPrevious.displayName = "PaginationPrevious";
|
| 77 |
|
| 78 |
const PaginationNext = ({
|
| 79 |
className,
|
|
|
|
| 88 |
<span>Next</span>
|
| 89 |
<ChevronRight className="h-4 w-4" />
|
| 90 |
</PaginationLink>
|
| 91 |
+
);
|
| 92 |
+
PaginationNext.displayName = "PaginationNext";
|
| 93 |
|
| 94 |
const PaginationEllipsis = ({
|
| 95 |
className,
|
|
|
|
| 103 |
<MoreHorizontal className="h-4 w-4" />
|
| 104 |
<span className="sr-only">More pages</span>
|
| 105 |
</span>
|
| 106 |
+
);
|
| 107 |
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
| 108 |
|
| 109 |
export {
|
| 110 |
Pagination,
|
|
|
|
| 114 |
PaginationLink,
|
| 115 |
PaginationNext,
|
| 116 |
PaginationPrevious,
|
| 117 |
+
};
|
src/components/ui/popover.tsx
CHANGED
|
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
|
|
| 19 |
align={align}
|
| 20 |
sideOffset={sideOffset}
|
| 21 |
className={cn(
|
| 22 |
-
"z-50 w-72 rounded-md border bg-
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
|
|
| 19 |
align={align}
|
| 20 |
sideOffset={sideOffset}
|
| 21 |
className={cn(
|
| 22 |
+
"z-50 w-72 rounded-md border border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
src/components/ui/progress.tsx
CHANGED
|
@@ -12,13 +12,13 @@ const Progress = React.forwardRef<
|
|
| 12 |
<ProgressPrimitive.Root
|
| 13 |
ref={ref}
|
| 14 |
className={cn(
|
| 15 |
-
"relative h-4 w-full overflow-hidden rounded-full bg-
|
| 16 |
className
|
| 17 |
)}
|
| 18 |
{...props}
|
| 19 |
>
|
| 20 |
<ProgressPrimitive.Indicator
|
| 21 |
-
className="h-full w-full flex-1 bg-
|
| 22 |
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
| 23 |
/>
|
| 24 |
</ProgressPrimitive.Root>
|
|
|
|
| 12 |
<ProgressPrimitive.Root
|
| 13 |
ref={ref}
|
| 14 |
className={cn(
|
| 15 |
+
"relative h-4 w-full overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800",
|
| 16 |
className
|
| 17 |
)}
|
| 18 |
{...props}
|
| 19 |
>
|
| 20 |
<ProgressPrimitive.Indicator
|
| 21 |
+
className="h-full w-full flex-1 bg-neutral-900 transition-all dark:bg-neutral-50"
|
| 22 |
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
| 23 |
/>
|
| 24 |
</ProgressPrimitive.Root>
|
src/components/ui/radio-group.tsx
CHANGED
|
@@ -28,7 +28,7 @@ const RadioGroupItem = React.forwardRef<
|
|
| 28 |
<RadioGroupPrimitive.Item
|
| 29 |
ref={ref}
|
| 30 |
className={cn(
|
| 31 |
-
"aspect-square h-4 w-4 rounded-full border border-
|
| 32 |
className
|
| 33 |
)}
|
| 34 |
{...props}
|
|
|
|
| 28 |
<RadioGroupPrimitive.Item
|
| 29 |
ref={ref}
|
| 30 |
className={cn(
|
| 31 |
+
"aspect-square h-4 w-4 rounded-full border border-neutral-200 border-neutral-900 text-neutral-900 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:border-neutral-50 dark:text-neutral-50 dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300",
|
| 32 |
className
|
| 33 |
)}
|
| 34 |
{...props}
|
src/components/ui/resizable.tsx
CHANGED
|
@@ -29,13 +29,13 @@ const ResizableHandle = ({
|
|
| 29 |
}) => (
|
| 30 |
<ResizablePrimitive.PanelResizeHandle
|
| 31 |
className={cn(
|
| 32 |
-
"relative flex w-px items-center justify-center bg-
|
| 33 |
className
|
| 34 |
)}
|
| 35 |
{...props}
|
| 36 |
>
|
| 37 |
{withHandle && (
|
| 38 |
-
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
| 39 |
<GripVertical className="h-2.5 w-2.5" />
|
| 40 |
</div>
|
| 41 |
)}
|
|
|
|
| 29 |
}) => (
|
| 30 |
<ResizablePrimitive.PanelResizeHandle
|
| 31 |
className={cn(
|
| 32 |
+
"relative flex w-px items-center justify-center bg-neutral-200 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 dark:bg-neutral-800 dark:focus-visible:ring-neutral-300",
|
| 33 |
className
|
| 34 |
)}
|
| 35 |
{...props}
|
| 36 |
>
|
| 37 |
{withHandle && (
|
| 38 |
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-neutral-200 bg-neutral-200 dark:border-neutral-800 dark:bg-neutral-800">
|
| 39 |
<GripVertical className="h-2.5 w-2.5" />
|
| 40 |
</div>
|
| 41 |
)}
|
src/components/ui/scroll-area.tsx
CHANGED
|
@@ -40,7 +40,7 @@ const ScrollBar = React.forwardRef<
|
|
| 40 |
)}
|
| 41 |
{...props}
|
| 42 |
>
|
| 43 |
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-
|
| 44 |
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
| 45 |
))
|
| 46 |
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
|
|
| 40 |
)}
|
| 41 |
{...props}
|
| 42 |
>
|
| 43 |
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800" />
|
| 44 |
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
| 45 |
))
|
| 46 |
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
src/components/ui/select.tsx
CHANGED
|
@@ -19,7 +19,7 @@ const SelectTrigger = React.forwardRef<
|
|
| 19 |
<SelectPrimitive.Trigger
|
| 20 |
ref={ref}
|
| 21 |
className={cn(
|
| 22 |
-
"flex h-10 w-full items-center justify-between rounded-md border border-
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
@@ -75,7 +75,7 @@ const SelectContent = React.forwardRef<
|
|
| 75 |
<SelectPrimitive.Content
|
| 76 |
ref={ref}
|
| 77 |
className={cn(
|
| 78 |
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-
|
| 79 |
position === "popper" &&
|
| 80 |
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
| 81 |
className
|
|
@@ -118,7 +118,7 @@ const SelectItem = React.forwardRef<
|
|
| 118 |
<SelectPrimitive.Item
|
| 119 |
ref={ref}
|
| 120 |
className={cn(
|
| 121 |
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
| 122 |
className
|
| 123 |
)}
|
| 124 |
{...props}
|
|
@@ -140,7 +140,7 @@ const SelectSeparator = React.forwardRef<
|
|
| 140 |
>(({ className, ...props }, ref) => (
|
| 141 |
<SelectPrimitive.Separator
|
| 142 |
ref={ref}
|
| 143 |
-
className={cn("-mx-1 my-1 h-px bg-
|
| 144 |
{...props}
|
| 145 |
/>
|
| 146 |
))
|
|
|
|
| 19 |
<SelectPrimitive.Trigger
|
| 20 |
ref={ref}
|
| 21 |
className={cn(
|
| 22 |
+
"flex h-10 w-full items-center justify-between rounded-md border border-neutral-200 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-neutral-500 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-300",
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
|
|
| 75 |
<SelectPrimitive.Content
|
| 76 |
ref={ref}
|
| 77 |
className={cn(
|
| 78 |
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 79 |
position === "popper" &&
|
| 80 |
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
| 81 |
className
|
|
|
|
| 118 |
<SelectPrimitive.Item
|
| 119 |
ref={ref}
|
| 120 |
className={cn(
|
| 121 |
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
| 122 |
className
|
| 123 |
)}
|
| 124 |
{...props}
|
|
|
|
| 140 |
>(({ className, ...props }, ref) => (
|
| 141 |
<SelectPrimitive.Separator
|
| 142 |
ref={ref}
|
| 143 |
+
className={cn("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800", className)}
|
| 144 |
{...props}
|
| 145 |
/>
|
| 146 |
))
|
src/components/ui/separator.tsx
CHANGED
|
@@ -18,7 +18,7 @@ const Separator = React.forwardRef<
|
|
| 18 |
decorative={decorative}
|
| 19 |
orientation={orientation}
|
| 20 |
className={cn(
|
| 21 |
-
"shrink-0 bg-
|
| 22 |
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
| 23 |
className
|
| 24 |
)}
|
|
|
|
| 18 |
decorative={decorative}
|
| 19 |
orientation={orientation}
|
| 20 |
className={cn(
|
| 21 |
+
"shrink-0 bg-neutral-200 dark:bg-neutral-800",
|
| 22 |
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
| 23 |
className
|
| 24 |
)}
|
src/components/ui/sheet.tsx
CHANGED
|
@@ -31,7 +31,7 @@ const SheetOverlay = React.forwardRef<
|
|
| 31 |
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
| 32 |
|
| 33 |
const sheetVariants = cva(
|
| 34 |
-
"fixed z-50 gap-4 bg-
|
| 35 |
{
|
| 36 |
variants: {
|
| 37 |
side: {
|
|
@@ -65,7 +65,7 @@ const SheetContent = React.forwardRef<
|
|
| 65 |
{...props}
|
| 66 |
>
|
| 67 |
{children}
|
| 68 |
-
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-
|
| 69 |
<X className="h-4 w-4" />
|
| 70 |
<span className="sr-only">Close</span>
|
| 71 |
</SheetPrimitive.Close>
|
|
@@ -108,7 +108,7 @@ const SheetTitle = React.forwardRef<
|
|
| 108 |
>(({ className, ...props }, ref) => (
|
| 109 |
<SheetPrimitive.Title
|
| 110 |
ref={ref}
|
| 111 |
-
className={cn("text-lg font-semibold text-
|
| 112 |
{...props}
|
| 113 |
/>
|
| 114 |
))
|
|
@@ -120,7 +120,7 @@ const SheetDescription = React.forwardRef<
|
|
| 120 |
>(({ className, ...props }, ref) => (
|
| 121 |
<SheetPrimitive.Description
|
| 122 |
ref={ref}
|
| 123 |
-
className={cn("text-sm text-
|
| 124 |
{...props}
|
| 125 |
/>
|
| 126 |
))
|
|
|
|
| 31 |
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
| 32 |
|
| 33 |
const sheetVariants = cva(
|
| 34 |
+
"fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-neutral-950",
|
| 35 |
{
|
| 36 |
variants: {
|
| 37 |
side: {
|
|
|
|
| 65 |
{...props}
|
| 66 |
>
|
| 67 |
{children}
|
| 68 |
+
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800">
|
| 69 |
<X className="h-4 w-4" />
|
| 70 |
<span className="sr-only">Close</span>
|
| 71 |
</SheetPrimitive.Close>
|
|
|
|
| 108 |
>(({ className, ...props }, ref) => (
|
| 109 |
<SheetPrimitive.Title
|
| 110 |
ref={ref}
|
| 111 |
+
className={cn("text-lg font-semibold text-neutral-950 dark:text-neutral-50", className)}
|
| 112 |
{...props}
|
| 113 |
/>
|
| 114 |
))
|
|
|
|
| 120 |
>(({ className, ...props }, ref) => (
|
| 121 |
<SheetPrimitive.Description
|
| 122 |
ref={ref}
|
| 123 |
+
className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 124 |
{...props}
|
| 125 |
/>
|
| 126 |
))
|
src/components/ui/sidebar.tsx
DELETED
|
@@ -1,763 +0,0 @@
|
|
| 1 |
-
"use client"
|
| 2 |
-
|
| 3 |
-
import * as React from "react"
|
| 4 |
-
import { Slot } from "@radix-ui/react-slot"
|
| 5 |
-
import { VariantProps, cva } from "class-variance-authority"
|
| 6 |
-
import { PanelLeft } from "lucide-react"
|
| 7 |
-
|
| 8 |
-
import { useIsMobile } from "@/hooks/use-mobile"
|
| 9 |
-
import { cn } from "@/lib/utils"
|
| 10 |
-
import { Button } from "@/components/ui/button"
|
| 11 |
-
import { Input } from "@/components/ui/input"
|
| 12 |
-
import { Separator } from "@/components/ui/separator"
|
| 13 |
-
import { Sheet, SheetContent } from "@/components/ui/sheet"
|
| 14 |
-
import { Skeleton } from "@/components/ui/skeleton"
|
| 15 |
-
import {
|
| 16 |
-
Tooltip,
|
| 17 |
-
TooltipContent,
|
| 18 |
-
TooltipProvider,
|
| 19 |
-
TooltipTrigger,
|
| 20 |
-
} from "@/components/ui/tooltip"
|
| 21 |
-
|
| 22 |
-
const SIDEBAR_COOKIE_NAME = "sidebar:state"
|
| 23 |
-
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
| 24 |
-
const SIDEBAR_WIDTH = "16rem"
|
| 25 |
-
const SIDEBAR_WIDTH_MOBILE = "18rem"
|
| 26 |
-
const SIDEBAR_WIDTH_ICON = "3rem"
|
| 27 |
-
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
| 28 |
-
|
| 29 |
-
type SidebarContext = {
|
| 30 |
-
state: "expanded" | "collapsed"
|
| 31 |
-
open: boolean
|
| 32 |
-
setOpen: (open: boolean) => void
|
| 33 |
-
openMobile: boolean
|
| 34 |
-
setOpenMobile: (open: boolean) => void
|
| 35 |
-
isMobile: boolean
|
| 36 |
-
toggleSidebar: () => void
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
const SidebarContext = React.createContext<SidebarContext | null>(null)
|
| 40 |
-
|
| 41 |
-
function useSidebar() {
|
| 42 |
-
const context = React.useContext(SidebarContext)
|
| 43 |
-
if (!context) {
|
| 44 |
-
throw new Error("useSidebar must be used within a SidebarProvider.")
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
return context
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
const SidebarProvider = React.forwardRef<
|
| 51 |
-
HTMLDivElement,
|
| 52 |
-
React.ComponentProps<"div"> & {
|
| 53 |
-
defaultOpen?: boolean
|
| 54 |
-
open?: boolean
|
| 55 |
-
onOpenChange?: (open: boolean) => void
|
| 56 |
-
}
|
| 57 |
-
>(
|
| 58 |
-
(
|
| 59 |
-
{
|
| 60 |
-
defaultOpen = true,
|
| 61 |
-
open: openProp,
|
| 62 |
-
onOpenChange: setOpenProp,
|
| 63 |
-
className,
|
| 64 |
-
style,
|
| 65 |
-
children,
|
| 66 |
-
...props
|
| 67 |
-
},
|
| 68 |
-
ref
|
| 69 |
-
) => {
|
| 70 |
-
const isMobile = useIsMobile()
|
| 71 |
-
const [openMobile, setOpenMobile] = React.useState(false)
|
| 72 |
-
|
| 73 |
-
// This is the internal state of the sidebar.
|
| 74 |
-
// We use openProp and setOpenProp for control from outside the component.
|
| 75 |
-
const [_open, _setOpen] = React.useState(defaultOpen)
|
| 76 |
-
const open = openProp ?? _open
|
| 77 |
-
const setOpen = React.useCallback(
|
| 78 |
-
(value: boolean | ((value: boolean) => boolean)) => {
|
| 79 |
-
const openState = typeof value === "function" ? value(open) : value
|
| 80 |
-
if (setOpenProp) {
|
| 81 |
-
setOpenProp(openState)
|
| 82 |
-
} else {
|
| 83 |
-
_setOpen(openState)
|
| 84 |
-
}
|
| 85 |
-
|
| 86 |
-
// This sets the cookie to keep the sidebar state.
|
| 87 |
-
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
|
| 88 |
-
},
|
| 89 |
-
[setOpenProp, open]
|
| 90 |
-
)
|
| 91 |
-
|
| 92 |
-
// Helper to toggle the sidebar.
|
| 93 |
-
const toggleSidebar = React.useCallback(() => {
|
| 94 |
-
return isMobile
|
| 95 |
-
? setOpenMobile((open) => !open)
|
| 96 |
-
: setOpen((open) => !open)
|
| 97 |
-
}, [isMobile, setOpen, setOpenMobile])
|
| 98 |
-
|
| 99 |
-
// Adds a keyboard shortcut to toggle the sidebar.
|
| 100 |
-
React.useEffect(() => {
|
| 101 |
-
const handleKeyDown = (event: KeyboardEvent) => {
|
| 102 |
-
if (
|
| 103 |
-
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
| 104 |
-
(event.metaKey || event.ctrlKey)
|
| 105 |
-
) {
|
| 106 |
-
event.preventDefault()
|
| 107 |
-
toggleSidebar()
|
| 108 |
-
}
|
| 109 |
-
}
|
| 110 |
-
|
| 111 |
-
window.addEventListener("keydown", handleKeyDown)
|
| 112 |
-
return () => window.removeEventListener("keydown", handleKeyDown)
|
| 113 |
-
}, [toggleSidebar])
|
| 114 |
-
|
| 115 |
-
// We add a state so that we can do data-state="expanded" or "collapsed".
|
| 116 |
-
// This makes it easier to style the sidebar with Tailwind classes.
|
| 117 |
-
const state = open ? "expanded" : "collapsed"
|
| 118 |
-
|
| 119 |
-
const contextValue = React.useMemo<SidebarContext>(
|
| 120 |
-
() => ({
|
| 121 |
-
state,
|
| 122 |
-
open,
|
| 123 |
-
setOpen,
|
| 124 |
-
isMobile,
|
| 125 |
-
openMobile,
|
| 126 |
-
setOpenMobile,
|
| 127 |
-
toggleSidebar,
|
| 128 |
-
}),
|
| 129 |
-
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
| 130 |
-
)
|
| 131 |
-
|
| 132 |
-
return (
|
| 133 |
-
<SidebarContext.Provider value={contextValue}>
|
| 134 |
-
<TooltipProvider delayDuration={0}>
|
| 135 |
-
<div
|
| 136 |
-
style={
|
| 137 |
-
{
|
| 138 |
-
"--sidebar-width": SIDEBAR_WIDTH,
|
| 139 |
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
| 140 |
-
...style,
|
| 141 |
-
} as React.CSSProperties
|
| 142 |
-
}
|
| 143 |
-
className={cn(
|
| 144 |
-
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
| 145 |
-
className
|
| 146 |
-
)}
|
| 147 |
-
ref={ref}
|
| 148 |
-
{...props}
|
| 149 |
-
>
|
| 150 |
-
{children}
|
| 151 |
-
</div>
|
| 152 |
-
</TooltipProvider>
|
| 153 |
-
</SidebarContext.Provider>
|
| 154 |
-
)
|
| 155 |
-
}
|
| 156 |
-
)
|
| 157 |
-
SidebarProvider.displayName = "SidebarProvider"
|
| 158 |
-
|
| 159 |
-
const Sidebar = React.forwardRef<
|
| 160 |
-
HTMLDivElement,
|
| 161 |
-
React.ComponentProps<"div"> & {
|
| 162 |
-
side?: "left" | "right"
|
| 163 |
-
variant?: "sidebar" | "floating" | "inset"
|
| 164 |
-
collapsible?: "offcanvas" | "icon" | "none"
|
| 165 |
-
}
|
| 166 |
-
>(
|
| 167 |
-
(
|
| 168 |
-
{
|
| 169 |
-
side = "left",
|
| 170 |
-
variant = "sidebar",
|
| 171 |
-
collapsible = "offcanvas",
|
| 172 |
-
className,
|
| 173 |
-
children,
|
| 174 |
-
...props
|
| 175 |
-
},
|
| 176 |
-
ref
|
| 177 |
-
) => {
|
| 178 |
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
|
| 179 |
-
|
| 180 |
-
if (collapsible === "none") {
|
| 181 |
-
return (
|
| 182 |
-
<div
|
| 183 |
-
className={cn(
|
| 184 |
-
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
| 185 |
-
className
|
| 186 |
-
)}
|
| 187 |
-
ref={ref}
|
| 188 |
-
{...props}
|
| 189 |
-
>
|
| 190 |
-
{children}
|
| 191 |
-
</div>
|
| 192 |
-
)
|
| 193 |
-
}
|
| 194 |
-
|
| 195 |
-
if (isMobile) {
|
| 196 |
-
return (
|
| 197 |
-
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
| 198 |
-
<SheetContent
|
| 199 |
-
data-sidebar="sidebar"
|
| 200 |
-
data-mobile="true"
|
| 201 |
-
className="w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
| 202 |
-
style={
|
| 203 |
-
{
|
| 204 |
-
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
| 205 |
-
} as React.CSSProperties
|
| 206 |
-
}
|
| 207 |
-
side={side}
|
| 208 |
-
>
|
| 209 |
-
<div className="flex h-full w-full flex-col">{children}</div>
|
| 210 |
-
</SheetContent>
|
| 211 |
-
</Sheet>
|
| 212 |
-
)
|
| 213 |
-
}
|
| 214 |
-
|
| 215 |
-
return (
|
| 216 |
-
<div
|
| 217 |
-
ref={ref}
|
| 218 |
-
className="group peer hidden md:block text-sidebar-foreground"
|
| 219 |
-
data-state={state}
|
| 220 |
-
data-collapsible={state === "collapsed" ? collapsible : ""}
|
| 221 |
-
data-variant={variant}
|
| 222 |
-
data-side={side}
|
| 223 |
-
>
|
| 224 |
-
{/* This is what handles the sidebar gap on desktop */}
|
| 225 |
-
<div
|
| 226 |
-
className={cn(
|
| 227 |
-
"duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
|
| 228 |
-
"group-data-[collapsible=offcanvas]:w-0",
|
| 229 |
-
"group-data-[side=right]:rotate-180",
|
| 230 |
-
variant === "floating" || variant === "inset"
|
| 231 |
-
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]"
|
| 232 |
-
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
| 233 |
-
)}
|
| 234 |
-
/>
|
| 235 |
-
<div
|
| 236 |
-
className={cn(
|
| 237 |
-
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",
|
| 238 |
-
side === "left"
|
| 239 |
-
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
| 240 |
-
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
| 241 |
-
// Adjust the padding for floating and inset variants.
|
| 242 |
-
variant === "floating" || variant === "inset"
|
| 243 |
-
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]"
|
| 244 |
-
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
| 245 |
-
className
|
| 246 |
-
)}
|
| 247 |
-
{...props}
|
| 248 |
-
>
|
| 249 |
-
<div
|
| 250 |
-
data-sidebar="sidebar"
|
| 251 |
-
className="flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
|
| 252 |
-
>
|
| 253 |
-
{children}
|
| 254 |
-
</div>
|
| 255 |
-
</div>
|
| 256 |
-
</div>
|
| 257 |
-
)
|
| 258 |
-
}
|
| 259 |
-
)
|
| 260 |
-
Sidebar.displayName = "Sidebar"
|
| 261 |
-
|
| 262 |
-
const SidebarTrigger = React.forwardRef<
|
| 263 |
-
React.ElementRef<typeof Button>,
|
| 264 |
-
React.ComponentProps<typeof Button>
|
| 265 |
-
>(({ className, onClick, ...props }, ref) => {
|
| 266 |
-
const { toggleSidebar } = useSidebar()
|
| 267 |
-
|
| 268 |
-
return (
|
| 269 |
-
<Button
|
| 270 |
-
ref={ref}
|
| 271 |
-
data-sidebar="trigger"
|
| 272 |
-
variant="ghost"
|
| 273 |
-
size="icon"
|
| 274 |
-
className={cn("h-7 w-7", className)}
|
| 275 |
-
onClick={(event) => {
|
| 276 |
-
onClick?.(event)
|
| 277 |
-
toggleSidebar()
|
| 278 |
-
}}
|
| 279 |
-
{...props}
|
| 280 |
-
>
|
| 281 |
-
<PanelLeft />
|
| 282 |
-
<span className="sr-only">Toggle Sidebar</span>
|
| 283 |
-
</Button>
|
| 284 |
-
)
|
| 285 |
-
})
|
| 286 |
-
SidebarTrigger.displayName = "SidebarTrigger"
|
| 287 |
-
|
| 288 |
-
const SidebarRail = React.forwardRef<
|
| 289 |
-
HTMLButtonElement,
|
| 290 |
-
React.ComponentProps<"button">
|
| 291 |
-
>(({ className, ...props }, ref) => {
|
| 292 |
-
const { toggleSidebar } = useSidebar()
|
| 293 |
-
|
| 294 |
-
return (
|
| 295 |
-
<button
|
| 296 |
-
ref={ref}
|
| 297 |
-
data-sidebar="rail"
|
| 298 |
-
aria-label="Toggle Sidebar"
|
| 299 |
-
tabIndex={-1}
|
| 300 |
-
onClick={toggleSidebar}
|
| 301 |
-
title="Toggle Sidebar"
|
| 302 |
-
className={cn(
|
| 303 |
-
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
| 304 |
-
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
| 305 |
-
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
| 306 |
-
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
| 307 |
-
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
| 308 |
-
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
| 309 |
-
className
|
| 310 |
-
)}
|
| 311 |
-
{...props}
|
| 312 |
-
/>
|
| 313 |
-
)
|
| 314 |
-
})
|
| 315 |
-
SidebarRail.displayName = "SidebarRail"
|
| 316 |
-
|
| 317 |
-
const SidebarInset = React.forwardRef<
|
| 318 |
-
HTMLDivElement,
|
| 319 |
-
React.ComponentProps<"main">
|
| 320 |
-
>(({ className, ...props }, ref) => {
|
| 321 |
-
return (
|
| 322 |
-
<main
|
| 323 |
-
ref={ref}
|
| 324 |
-
className={cn(
|
| 325 |
-
"relative flex min-h-svh flex-1 flex-col bg-background",
|
| 326 |
-
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
| 327 |
-
className
|
| 328 |
-
)}
|
| 329 |
-
{...props}
|
| 330 |
-
/>
|
| 331 |
-
)
|
| 332 |
-
})
|
| 333 |
-
SidebarInset.displayName = "SidebarInset"
|
| 334 |
-
|
| 335 |
-
const SidebarInput = React.forwardRef<
|
| 336 |
-
React.ElementRef<typeof Input>,
|
| 337 |
-
React.ComponentProps<typeof Input>
|
| 338 |
-
>(({ className, ...props }, ref) => {
|
| 339 |
-
return (
|
| 340 |
-
<Input
|
| 341 |
-
ref={ref}
|
| 342 |
-
data-sidebar="input"
|
| 343 |
-
className={cn(
|
| 344 |
-
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
| 345 |
-
className
|
| 346 |
-
)}
|
| 347 |
-
{...props}
|
| 348 |
-
/>
|
| 349 |
-
)
|
| 350 |
-
})
|
| 351 |
-
SidebarInput.displayName = "SidebarInput"
|
| 352 |
-
|
| 353 |
-
const SidebarHeader = React.forwardRef<
|
| 354 |
-
HTMLDivElement,
|
| 355 |
-
React.ComponentProps<"div">
|
| 356 |
-
>(({ className, ...props }, ref) => {
|
| 357 |
-
return (
|
| 358 |
-
<div
|
| 359 |
-
ref={ref}
|
| 360 |
-
data-sidebar="header"
|
| 361 |
-
className={cn("flex flex-col gap-2 p-2", className)}
|
| 362 |
-
{...props}
|
| 363 |
-
/>
|
| 364 |
-
)
|
| 365 |
-
})
|
| 366 |
-
SidebarHeader.displayName = "SidebarHeader"
|
| 367 |
-
|
| 368 |
-
const SidebarFooter = React.forwardRef<
|
| 369 |
-
HTMLDivElement,
|
| 370 |
-
React.ComponentProps<"div">
|
| 371 |
-
>(({ className, ...props }, ref) => {
|
| 372 |
-
return (
|
| 373 |
-
<div
|
| 374 |
-
ref={ref}
|
| 375 |
-
data-sidebar="footer"
|
| 376 |
-
className={cn("flex flex-col gap-2 p-2", className)}
|
| 377 |
-
{...props}
|
| 378 |
-
/>
|
| 379 |
-
)
|
| 380 |
-
})
|
| 381 |
-
SidebarFooter.displayName = "SidebarFooter"
|
| 382 |
-
|
| 383 |
-
const SidebarSeparator = React.forwardRef<
|
| 384 |
-
React.ElementRef<typeof Separator>,
|
| 385 |
-
React.ComponentProps<typeof Separator>
|
| 386 |
-
>(({ className, ...props }, ref) => {
|
| 387 |
-
return (
|
| 388 |
-
<Separator
|
| 389 |
-
ref={ref}
|
| 390 |
-
data-sidebar="separator"
|
| 391 |
-
className={cn("mx-2 w-auto bg-sidebar-border", className)}
|
| 392 |
-
{...props}
|
| 393 |
-
/>
|
| 394 |
-
)
|
| 395 |
-
})
|
| 396 |
-
SidebarSeparator.displayName = "SidebarSeparator"
|
| 397 |
-
|
| 398 |
-
const SidebarContent = React.forwardRef<
|
| 399 |
-
HTMLDivElement,
|
| 400 |
-
React.ComponentProps<"div">
|
| 401 |
-
>(({ className, ...props }, ref) => {
|
| 402 |
-
return (
|
| 403 |
-
<div
|
| 404 |
-
ref={ref}
|
| 405 |
-
data-sidebar="content"
|
| 406 |
-
className={cn(
|
| 407 |
-
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
| 408 |
-
className
|
| 409 |
-
)}
|
| 410 |
-
{...props}
|
| 411 |
-
/>
|
| 412 |
-
)
|
| 413 |
-
})
|
| 414 |
-
SidebarContent.displayName = "SidebarContent"
|
| 415 |
-
|
| 416 |
-
const SidebarGroup = React.forwardRef<
|
| 417 |
-
HTMLDivElement,
|
| 418 |
-
React.ComponentProps<"div">
|
| 419 |
-
>(({ className, ...props }, ref) => {
|
| 420 |
-
return (
|
| 421 |
-
<div
|
| 422 |
-
ref={ref}
|
| 423 |
-
data-sidebar="group"
|
| 424 |
-
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
|
| 425 |
-
{...props}
|
| 426 |
-
/>
|
| 427 |
-
)
|
| 428 |
-
})
|
| 429 |
-
SidebarGroup.displayName = "SidebarGroup"
|
| 430 |
-
|
| 431 |
-
const SidebarGroupLabel = React.forwardRef<
|
| 432 |
-
HTMLDivElement,
|
| 433 |
-
React.ComponentProps<"div"> & { asChild?: boolean }
|
| 434 |
-
>(({ className, asChild = false, ...props }, ref) => {
|
| 435 |
-
const Comp = asChild ? Slot : "div"
|
| 436 |
-
|
| 437 |
-
return (
|
| 438 |
-
<Comp
|
| 439 |
-
ref={ref}
|
| 440 |
-
data-sidebar="group-label"
|
| 441 |
-
className={cn(
|
| 442 |
-
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
| 443 |
-
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
| 444 |
-
className
|
| 445 |
-
)}
|
| 446 |
-
{...props}
|
| 447 |
-
/>
|
| 448 |
-
)
|
| 449 |
-
})
|
| 450 |
-
SidebarGroupLabel.displayName = "SidebarGroupLabel"
|
| 451 |
-
|
| 452 |
-
const SidebarGroupAction = React.forwardRef<
|
| 453 |
-
HTMLButtonElement,
|
| 454 |
-
React.ComponentProps<"button"> & { asChild?: boolean }
|
| 455 |
-
>(({ className, asChild = false, ...props }, ref) => {
|
| 456 |
-
const Comp = asChild ? Slot : "button"
|
| 457 |
-
|
| 458 |
-
return (
|
| 459 |
-
<Comp
|
| 460 |
-
ref={ref}
|
| 461 |
-
data-sidebar="group-action"
|
| 462 |
-
className={cn(
|
| 463 |
-
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
| 464 |
-
// Increases the hit area of the button on mobile.
|
| 465 |
-
"after:absolute after:-inset-2 after:md:hidden",
|
| 466 |
-
"group-data-[collapsible=icon]:hidden",
|
| 467 |
-
className
|
| 468 |
-
)}
|
| 469 |
-
{...props}
|
| 470 |
-
/>
|
| 471 |
-
)
|
| 472 |
-
})
|
| 473 |
-
SidebarGroupAction.displayName = "SidebarGroupAction"
|
| 474 |
-
|
| 475 |
-
const SidebarGroupContent = React.forwardRef<
|
| 476 |
-
HTMLDivElement,
|
| 477 |
-
React.ComponentProps<"div">
|
| 478 |
-
>(({ className, ...props }, ref) => (
|
| 479 |
-
<div
|
| 480 |
-
ref={ref}
|
| 481 |
-
data-sidebar="group-content"
|
| 482 |
-
className={cn("w-full text-sm", className)}
|
| 483 |
-
{...props}
|
| 484 |
-
/>
|
| 485 |
-
))
|
| 486 |
-
SidebarGroupContent.displayName = "SidebarGroupContent"
|
| 487 |
-
|
| 488 |
-
const SidebarMenu = React.forwardRef<
|
| 489 |
-
HTMLUListElement,
|
| 490 |
-
React.ComponentProps<"ul">
|
| 491 |
-
>(({ className, ...props }, ref) => (
|
| 492 |
-
<ul
|
| 493 |
-
ref={ref}
|
| 494 |
-
data-sidebar="menu"
|
| 495 |
-
className={cn("flex w-full min-w-0 flex-col gap-1", className)}
|
| 496 |
-
{...props}
|
| 497 |
-
/>
|
| 498 |
-
))
|
| 499 |
-
SidebarMenu.displayName = "SidebarMenu"
|
| 500 |
-
|
| 501 |
-
const SidebarMenuItem = React.forwardRef<
|
| 502 |
-
HTMLLIElement,
|
| 503 |
-
React.ComponentProps<"li">
|
| 504 |
-
>(({ className, ...props }, ref) => (
|
| 505 |
-
<li
|
| 506 |
-
ref={ref}
|
| 507 |
-
data-sidebar="menu-item"
|
| 508 |
-
className={cn("group/menu-item relative", className)}
|
| 509 |
-
{...props}
|
| 510 |
-
/>
|
| 511 |
-
))
|
| 512 |
-
SidebarMenuItem.displayName = "SidebarMenuItem"
|
| 513 |
-
|
| 514 |
-
const sidebarMenuButtonVariants = cva(
|
| 515 |
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
| 516 |
-
{
|
| 517 |
-
variants: {
|
| 518 |
-
variant: {
|
| 519 |
-
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
| 520 |
-
outline:
|
| 521 |
-
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
| 522 |
-
},
|
| 523 |
-
size: {
|
| 524 |
-
default: "h-8 text-sm",
|
| 525 |
-
sm: "h-7 text-xs",
|
| 526 |
-
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
|
| 527 |
-
},
|
| 528 |
-
},
|
| 529 |
-
defaultVariants: {
|
| 530 |
-
variant: "default",
|
| 531 |
-
size: "default",
|
| 532 |
-
},
|
| 533 |
-
}
|
| 534 |
-
)
|
| 535 |
-
|
| 536 |
-
const SidebarMenuButton = React.forwardRef<
|
| 537 |
-
HTMLButtonElement,
|
| 538 |
-
React.ComponentProps<"button"> & {
|
| 539 |
-
asChild?: boolean
|
| 540 |
-
isActive?: boolean
|
| 541 |
-
tooltip?: string | React.ComponentProps<typeof TooltipContent>
|
| 542 |
-
} & VariantProps<typeof sidebarMenuButtonVariants>
|
| 543 |
-
>(
|
| 544 |
-
(
|
| 545 |
-
{
|
| 546 |
-
asChild = false,
|
| 547 |
-
isActive = false,
|
| 548 |
-
variant = "default",
|
| 549 |
-
size = "default",
|
| 550 |
-
tooltip,
|
| 551 |
-
className,
|
| 552 |
-
...props
|
| 553 |
-
},
|
| 554 |
-
ref
|
| 555 |
-
) => {
|
| 556 |
-
const Comp = asChild ? Slot : "button"
|
| 557 |
-
const { isMobile, state } = useSidebar()
|
| 558 |
-
|
| 559 |
-
const button = (
|
| 560 |
-
<Comp
|
| 561 |
-
ref={ref}
|
| 562 |
-
data-sidebar="menu-button"
|
| 563 |
-
data-size={size}
|
| 564 |
-
data-active={isActive}
|
| 565 |
-
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
|
| 566 |
-
{...props}
|
| 567 |
-
/>
|
| 568 |
-
)
|
| 569 |
-
|
| 570 |
-
if (!tooltip) {
|
| 571 |
-
return button
|
| 572 |
-
}
|
| 573 |
-
|
| 574 |
-
if (typeof tooltip === "string") {
|
| 575 |
-
tooltip = {
|
| 576 |
-
children: tooltip,
|
| 577 |
-
}
|
| 578 |
-
}
|
| 579 |
-
|
| 580 |
-
return (
|
| 581 |
-
<Tooltip>
|
| 582 |
-
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
| 583 |
-
<TooltipContent
|
| 584 |
-
side="right"
|
| 585 |
-
align="center"
|
| 586 |
-
hidden={state !== "collapsed" || isMobile}
|
| 587 |
-
{...tooltip}
|
| 588 |
-
/>
|
| 589 |
-
</Tooltip>
|
| 590 |
-
)
|
| 591 |
-
}
|
| 592 |
-
)
|
| 593 |
-
SidebarMenuButton.displayName = "SidebarMenuButton"
|
| 594 |
-
|
| 595 |
-
const SidebarMenuAction = React.forwardRef<
|
| 596 |
-
HTMLButtonElement,
|
| 597 |
-
React.ComponentProps<"button"> & {
|
| 598 |
-
asChild?: boolean
|
| 599 |
-
showOnHover?: boolean
|
| 600 |
-
}
|
| 601 |
-
>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
| 602 |
-
const Comp = asChild ? Slot : "button"
|
| 603 |
-
|
| 604 |
-
return (
|
| 605 |
-
<Comp
|
| 606 |
-
ref={ref}
|
| 607 |
-
data-sidebar="menu-action"
|
| 608 |
-
className={cn(
|
| 609 |
-
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
| 610 |
-
// Increases the hit area of the button on mobile.
|
| 611 |
-
"after:absolute after:-inset-2 after:md:hidden",
|
| 612 |
-
"peer-data-[size=sm]/menu-button:top-1",
|
| 613 |
-
"peer-data-[size=default]/menu-button:top-1.5",
|
| 614 |
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
| 615 |
-
"group-data-[collapsible=icon]:hidden",
|
| 616 |
-
showOnHover &&
|
| 617 |
-
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
| 618 |
-
className
|
| 619 |
-
)}
|
| 620 |
-
{...props}
|
| 621 |
-
/>
|
| 622 |
-
)
|
| 623 |
-
})
|
| 624 |
-
SidebarMenuAction.displayName = "SidebarMenuAction"
|
| 625 |
-
|
| 626 |
-
const SidebarMenuBadge = React.forwardRef<
|
| 627 |
-
HTMLDivElement,
|
| 628 |
-
React.ComponentProps<"div">
|
| 629 |
-
>(({ className, ...props }, ref) => (
|
| 630 |
-
<div
|
| 631 |
-
ref={ref}
|
| 632 |
-
data-sidebar="menu-badge"
|
| 633 |
-
className={cn(
|
| 634 |
-
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
|
| 635 |
-
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
| 636 |
-
"peer-data-[size=sm]/menu-button:top-1",
|
| 637 |
-
"peer-data-[size=default]/menu-button:top-1.5",
|
| 638 |
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
| 639 |
-
"group-data-[collapsible=icon]:hidden",
|
| 640 |
-
className
|
| 641 |
-
)}
|
| 642 |
-
{...props}
|
| 643 |
-
/>
|
| 644 |
-
))
|
| 645 |
-
SidebarMenuBadge.displayName = "SidebarMenuBadge"
|
| 646 |
-
|
| 647 |
-
const SidebarMenuSkeleton = React.forwardRef<
|
| 648 |
-
HTMLDivElement,
|
| 649 |
-
React.ComponentProps<"div"> & {
|
| 650 |
-
showIcon?: boolean
|
| 651 |
-
}
|
| 652 |
-
>(({ className, showIcon = false, ...props }, ref) => {
|
| 653 |
-
// Random width between 50 to 90%.
|
| 654 |
-
const width = React.useMemo(() => {
|
| 655 |
-
return `${Math.floor(Math.random() * 40) + 50}%`
|
| 656 |
-
}, [])
|
| 657 |
-
|
| 658 |
-
return (
|
| 659 |
-
<div
|
| 660 |
-
ref={ref}
|
| 661 |
-
data-sidebar="menu-skeleton"
|
| 662 |
-
className={cn("rounded-md h-8 flex gap-2 px-2 items-center", className)}
|
| 663 |
-
{...props}
|
| 664 |
-
>
|
| 665 |
-
{showIcon && (
|
| 666 |
-
<Skeleton
|
| 667 |
-
className="size-4 rounded-md"
|
| 668 |
-
data-sidebar="menu-skeleton-icon"
|
| 669 |
-
/>
|
| 670 |
-
)}
|
| 671 |
-
<Skeleton
|
| 672 |
-
className="h-4 flex-1 max-w-[--skeleton-width]"
|
| 673 |
-
data-sidebar="menu-skeleton-text"
|
| 674 |
-
style={
|
| 675 |
-
{
|
| 676 |
-
"--skeleton-width": width,
|
| 677 |
-
} as React.CSSProperties
|
| 678 |
-
}
|
| 679 |
-
/>
|
| 680 |
-
</div>
|
| 681 |
-
)
|
| 682 |
-
})
|
| 683 |
-
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton"
|
| 684 |
-
|
| 685 |
-
const SidebarMenuSub = React.forwardRef<
|
| 686 |
-
HTMLUListElement,
|
| 687 |
-
React.ComponentProps<"ul">
|
| 688 |
-
>(({ className, ...props }, ref) => (
|
| 689 |
-
<ul
|
| 690 |
-
ref={ref}
|
| 691 |
-
data-sidebar="menu-sub"
|
| 692 |
-
className={cn(
|
| 693 |
-
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
| 694 |
-
"group-data-[collapsible=icon]:hidden",
|
| 695 |
-
className
|
| 696 |
-
)}
|
| 697 |
-
{...props}
|
| 698 |
-
/>
|
| 699 |
-
))
|
| 700 |
-
SidebarMenuSub.displayName = "SidebarMenuSub"
|
| 701 |
-
|
| 702 |
-
const SidebarMenuSubItem = React.forwardRef<
|
| 703 |
-
HTMLLIElement,
|
| 704 |
-
React.ComponentProps<"li">
|
| 705 |
-
>(({ ...props }, ref) => <li ref={ref} {...props} />)
|
| 706 |
-
SidebarMenuSubItem.displayName = "SidebarMenuSubItem"
|
| 707 |
-
|
| 708 |
-
const SidebarMenuSubButton = React.forwardRef<
|
| 709 |
-
HTMLAnchorElement,
|
| 710 |
-
React.ComponentProps<"a"> & {
|
| 711 |
-
asChild?: boolean
|
| 712 |
-
size?: "sm" | "md"
|
| 713 |
-
isActive?: boolean
|
| 714 |
-
}
|
| 715 |
-
>(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
| 716 |
-
const Comp = asChild ? Slot : "a"
|
| 717 |
-
|
| 718 |
-
return (
|
| 719 |
-
<Comp
|
| 720 |
-
ref={ref}
|
| 721 |
-
data-sidebar="menu-sub-button"
|
| 722 |
-
data-size={size}
|
| 723 |
-
data-active={isActive}
|
| 724 |
-
className={cn(
|
| 725 |
-
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
| 726 |
-
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
| 727 |
-
size === "sm" && "text-xs",
|
| 728 |
-
size === "md" && "text-sm",
|
| 729 |
-
"group-data-[collapsible=icon]:hidden",
|
| 730 |
-
className
|
| 731 |
-
)}
|
| 732 |
-
{...props}
|
| 733 |
-
/>
|
| 734 |
-
)
|
| 735 |
-
})
|
| 736 |
-
SidebarMenuSubButton.displayName = "SidebarMenuSubButton"
|
| 737 |
-
|
| 738 |
-
export {
|
| 739 |
-
Sidebar,
|
| 740 |
-
SidebarContent,
|
| 741 |
-
SidebarFooter,
|
| 742 |
-
SidebarGroup,
|
| 743 |
-
SidebarGroupAction,
|
| 744 |
-
SidebarGroupContent,
|
| 745 |
-
SidebarGroupLabel,
|
| 746 |
-
SidebarHeader,
|
| 747 |
-
SidebarInput,
|
| 748 |
-
SidebarInset,
|
| 749 |
-
SidebarMenu,
|
| 750 |
-
SidebarMenuAction,
|
| 751 |
-
SidebarMenuBadge,
|
| 752 |
-
SidebarMenuButton,
|
| 753 |
-
SidebarMenuItem,
|
| 754 |
-
SidebarMenuSkeleton,
|
| 755 |
-
SidebarMenuSub,
|
| 756 |
-
SidebarMenuSubButton,
|
| 757 |
-
SidebarMenuSubItem,
|
| 758 |
-
SidebarProvider,
|
| 759 |
-
SidebarRail,
|
| 760 |
-
SidebarSeparator,
|
| 761 |
-
SidebarTrigger,
|
| 762 |
-
useSidebar,
|
| 763 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/components/ui/skeleton.tsx
CHANGED
|
@@ -6,7 +6,7 @@ function Skeleton({
|
|
| 6 |
}: React.HTMLAttributes<HTMLDivElement>) {
|
| 7 |
return (
|
| 8 |
<div
|
| 9 |
-
className={cn("animate-pulse rounded-md bg-
|
| 10 |
{...props}
|
| 11 |
/>
|
| 12 |
)
|
|
|
|
| 6 |
}: React.HTMLAttributes<HTMLDivElement>) {
|
| 7 |
return (
|
| 8 |
<div
|
| 9 |
+
className={cn("animate-pulse rounded-md bg-neutral-100 dark:bg-neutral-800", className)}
|
| 10 |
{...props}
|
| 11 |
/>
|
| 12 |
)
|
src/components/ui/slider.tsx
CHANGED
|
@@ -17,10 +17,10 @@ const Slider = React.forwardRef<
|
|
| 17 |
)}
|
| 18 |
{...props}
|
| 19 |
>
|
| 20 |
-
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-
|
| 21 |
-
<SliderPrimitive.Range className="absolute h-full bg-
|
| 22 |
</SliderPrimitive.Track>
|
| 23 |
-
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-
|
| 24 |
</SliderPrimitive.Root>
|
| 25 |
))
|
| 26 |
Slider.displayName = SliderPrimitive.Root.displayName
|
|
|
|
| 17 |
)}
|
| 18 |
{...props}
|
| 19 |
>
|
| 20 |
+
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800">
|
| 21 |
+
<SliderPrimitive.Range className="absolute h-full bg-neutral-900 dark:bg-neutral-50" />
|
| 22 |
</SliderPrimitive.Track>
|
| 23 |
+
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-neutral-900 bg-white ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-50 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300" />
|
| 24 |
</SliderPrimitive.Root>
|
| 25 |
))
|
| 26 |
Slider.displayName = SliderPrimitive.Root.displayName
|
src/components/ui/sonner.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
| 1 |
-
"use client"
|
| 2 |
-
|
| 3 |
-
import { useTheme } from "next-themes"
|
| 4 |
-
import { Toaster as Sonner } from "sonner"
|
| 5 |
-
|
| 6 |
-
type ToasterProps = React.ComponentProps<typeof Sonner>
|
| 7 |
-
|
| 8 |
-
const Toaster = ({ ...props }: ToasterProps) => {
|
| 9 |
-
const { theme = "system" } = useTheme()
|
| 10 |
-
|
| 11 |
-
return (
|
| 12 |
-
<Sonner
|
| 13 |
-
theme={theme as ToasterProps["theme"]}
|
| 14 |
-
className="toaster group"
|
| 15 |
-
toastOptions={{
|
| 16 |
-
classNames: {
|
| 17 |
-
toast:
|
| 18 |
-
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
| 19 |
-
description: "group-[.toast]:text-muted-foreground",
|
| 20 |
-
actionButton:
|
| 21 |
-
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
| 22 |
-
cancelButton:
|
| 23 |
-
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
| 24 |
-
},
|
| 25 |
-
}}
|
| 26 |
-
{...props}
|
| 27 |
-
/>
|
| 28 |
-
)
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
export { Toaster }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/components/ui/switch.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const Switch = React.forwardRef<
|
|
| 11 |
>(({ className, ...props }, ref) => (
|
| 12 |
<SwitchPrimitives.Root
|
| 13 |
className={cn(
|
| 14 |
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-
|
| 15 |
className
|
| 16 |
)}
|
| 17 |
{...props}
|
|
@@ -19,7 +19,7 @@ const Switch = React.forwardRef<
|
|
| 19 |
>
|
| 20 |
<SwitchPrimitives.Thumb
|
| 21 |
className={cn(
|
| 22 |
-
"pointer-events-none block h-5 w-5 rounded-full bg-
|
| 23 |
)}
|
| 24 |
/>
|
| 25 |
</SwitchPrimitives.Root>
|
|
|
|
| 11 |
>(({ className, ...props }, ref) => (
|
| 12 |
<SwitchPrimitives.Root
|
| 13 |
className={cn(
|
| 14 |
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-neutral-900 data-[state=unchecked]:bg-neutral-200 dark:focus-visible:ring-neutral-300 dark:focus-visible:ring-offset-neutral-950 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=unchecked]:bg-neutral-800",
|
| 15 |
className
|
| 16 |
)}
|
| 17 |
{...props}
|
|
|
|
| 19 |
>
|
| 20 |
<SwitchPrimitives.Thumb
|
| 21 |
className={cn(
|
| 22 |
+
"pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-neutral-950"
|
| 23 |
)}
|
| 24 |
/>
|
| 25 |
</SwitchPrimitives.Root>
|
src/components/ui/table.tsx
CHANGED
|
@@ -43,7 +43,7 @@ const TableFooter = React.forwardRef<
|
|
| 43 |
<tfoot
|
| 44 |
ref={ref}
|
| 45 |
className={cn(
|
| 46 |
-
"border-t bg-
|
| 47 |
className
|
| 48 |
)}
|
| 49 |
{...props}
|
|
@@ -58,7 +58,7 @@ const TableRow = React.forwardRef<
|
|
| 58 |
<tr
|
| 59 |
ref={ref}
|
| 60 |
className={cn(
|
| 61 |
-
"border-b transition-colors hover:bg-
|
| 62 |
className
|
| 63 |
)}
|
| 64 |
{...props}
|
|
@@ -73,7 +73,7 @@ const TableHead = React.forwardRef<
|
|
| 73 |
<th
|
| 74 |
ref={ref}
|
| 75 |
className={cn(
|
| 76 |
-
"h-12 px-4 text-left align-middle font-medium text-
|
| 77 |
className
|
| 78 |
)}
|
| 79 |
{...props}
|
|
@@ -99,7 +99,7 @@ const TableCaption = React.forwardRef<
|
|
| 99 |
>(({ className, ...props }, ref) => (
|
| 100 |
<caption
|
| 101 |
ref={ref}
|
| 102 |
-
className={cn("mt-4 text-sm text-
|
| 103 |
{...props}
|
| 104 |
/>
|
| 105 |
))
|
|
|
|
| 43 |
<tfoot
|
| 44 |
ref={ref}
|
| 45 |
className={cn(
|
| 46 |
+
"border-t bg-neutral-100/50 font-medium [&>tr]:last:border-b-0 dark:bg-neutral-800/50",
|
| 47 |
className
|
| 48 |
)}
|
| 49 |
{...props}
|
|
|
|
| 58 |
<tr
|
| 59 |
ref={ref}
|
| 60 |
className={cn(
|
| 61 |
+
"border-b transition-colors hover:bg-neutral-100/50 data-[state=selected]:bg-neutral-100 dark:hover:bg-neutral-800/50 dark:data-[state=selected]:bg-neutral-800",
|
| 62 |
className
|
| 63 |
)}
|
| 64 |
{...props}
|
|
|
|
| 73 |
<th
|
| 74 |
ref={ref}
|
| 75 |
className={cn(
|
| 76 |
+
"h-12 px-4 text-left align-middle font-medium text-neutral-500 [&:has([role=checkbox])]:pr-0 dark:text-neutral-400",
|
| 77 |
className
|
| 78 |
)}
|
| 79 |
{...props}
|
|
|
|
| 99 |
>(({ className, ...props }, ref) => (
|
| 100 |
<caption
|
| 101 |
ref={ref}
|
| 102 |
+
className={cn("mt-4 text-sm text-neutral-500 dark:text-neutral-400", className)}
|
| 103 |
{...props}
|
| 104 |
/>
|
| 105 |
))
|
src/components/ui/tabs.tsx
CHANGED
|
@@ -14,7 +14,7 @@ const TabsList = React.forwardRef<
|
|
| 14 |
<TabsPrimitive.List
|
| 15 |
ref={ref}
|
| 16 |
className={cn(
|
| 17 |
-
"inline-flex h-10 items-center justify-center rounded-md bg-
|
| 18 |
className
|
| 19 |
)}
|
| 20 |
{...props}
|
|
@@ -29,7 +29,7 @@ const TabsTrigger = React.forwardRef<
|
|
| 29 |
<TabsPrimitive.Trigger
|
| 30 |
ref={ref}
|
| 31 |
className={cn(
|
| 32 |
-
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-
|
| 33 |
className
|
| 34 |
)}
|
| 35 |
{...props}
|
|
@@ -44,7 +44,7 @@ const TabsContent = React.forwardRef<
|
|
| 44 |
<TabsPrimitive.Content
|
| 45 |
ref={ref}
|
| 46 |
className={cn(
|
| 47 |
-
"mt-2 ring-offset-
|
| 48 |
className
|
| 49 |
)}
|
| 50 |
{...props}
|
|
|
|
| 14 |
<TabsPrimitive.List
|
| 15 |
ref={ref}
|
| 16 |
className={cn(
|
| 17 |
+
"inline-flex h-10 items-center justify-center rounded-md bg-neutral-100 p-1 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400",
|
| 18 |
className
|
| 19 |
)}
|
| 20 |
{...props}
|
|
|
|
| 29 |
<TabsPrimitive.Trigger
|
| 30 |
ref={ref}
|
| 31 |
className={cn(
|
| 32 |
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-neutral-950 data-[state=active]:shadow-sm dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300 dark:data-[state=active]:bg-neutral-950 dark:data-[state=active]:text-neutral-50",
|
| 33 |
className
|
| 34 |
)}
|
| 35 |
{...props}
|
|
|
|
| 44 |
<TabsPrimitive.Content
|
| 45 |
ref={ref}
|
| 46 |
className={cn(
|
| 47 |
+
"mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300",
|
| 48 |
className
|
| 49 |
)}
|
| 50 |
{...props}
|
src/components/ui/textarea.tsx
CHANGED
|
@@ -9,7 +9,7 @@ const Textarea = React.forwardRef<
|
|
| 9 |
return (
|
| 10 |
<textarea
|
| 11 |
className={cn(
|
| 12 |
-
"flex min-h-[80px] w-full rounded-md border border-
|
| 13 |
className
|
| 14 |
)}
|
| 15 |
ref={ref}
|
|
|
|
| 9 |
return (
|
| 10 |
<textarea
|
| 11 |
className={cn(
|
| 12 |
+
"flex min-h-[80px] w-full rounded-md border border-neutral-200 bg-white px-3 py-2 text-base ring-offset-white placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",
|
| 13 |
className
|
| 14 |
)}
|
| 15 |
ref={ref}
|
src/components/ui/toast.tsx
CHANGED
|
@@ -1,129 +1,32 @@
|
|
| 1 |
-
"use client"
|
| 2 |
|
| 3 |
-
import
|
| 4 |
-
import
|
| 5 |
-
import { cva, type VariantProps } from "class-variance-authority"
|
| 6 |
-
import { X } from "lucide-react"
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
-
const
|
|
|
|
| 11 |
|
| 12 |
-
const ToastViewport = React.forwardRef<
|
| 13 |
-
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
| 14 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
| 15 |
-
>(({ className, ...props }, ref) => (
|
| 16 |
-
<ToastPrimitives.Viewport
|
| 17 |
-
ref={ref}
|
| 18 |
-
className={cn(
|
| 19 |
-
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
| 20 |
-
className
|
| 21 |
-
)}
|
| 22 |
-
{...props}
|
| 23 |
-
/>
|
| 24 |
-
))
|
| 25 |
-
ToastViewport.displayName = ToastPrimitives.Viewport.displayName
|
| 26 |
-
|
| 27 |
-
const toastVariants = cva(
|
| 28 |
-
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
| 29 |
-
{
|
| 30 |
-
variants: {
|
| 31 |
-
variant: {
|
| 32 |
-
default: "border bg-background text-foreground",
|
| 33 |
-
destructive:
|
| 34 |
-
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
| 35 |
-
},
|
| 36 |
-
},
|
| 37 |
-
defaultVariants: {
|
| 38 |
-
variant: "default",
|
| 39 |
-
},
|
| 40 |
-
}
|
| 41 |
-
)
|
| 42 |
-
|
| 43 |
-
const Toast = React.forwardRef<
|
| 44 |
-
React.ElementRef<typeof ToastPrimitives.Root>,
|
| 45 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
| 46 |
-
VariantProps<typeof toastVariants>
|
| 47 |
-
>(({ className, variant, ...props }, ref) => {
|
| 48 |
return (
|
| 49 |
-
<
|
| 50 |
-
|
| 51 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
{...props}
|
| 53 |
/>
|
| 54 |
-
)
|
| 55 |
-
}
|
| 56 |
-
Toast.displayName = ToastPrimitives.Root.displayName
|
| 57 |
-
|
| 58 |
-
const ToastAction = React.forwardRef<
|
| 59 |
-
React.ElementRef<typeof ToastPrimitives.Action>,
|
| 60 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
| 61 |
-
>(({ className, ...props }, ref) => (
|
| 62 |
-
<ToastPrimitives.Action
|
| 63 |
-
ref={ref}
|
| 64 |
-
className={cn(
|
| 65 |
-
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
| 66 |
-
className
|
| 67 |
-
)}
|
| 68 |
-
{...props}
|
| 69 |
-
/>
|
| 70 |
-
))
|
| 71 |
-
ToastAction.displayName = ToastPrimitives.Action.displayName
|
| 72 |
-
|
| 73 |
-
const ToastClose = React.forwardRef<
|
| 74 |
-
React.ElementRef<typeof ToastPrimitives.Close>,
|
| 75 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
| 76 |
-
>(({ className, ...props }, ref) => (
|
| 77 |
-
<ToastPrimitives.Close
|
| 78 |
-
ref={ref}
|
| 79 |
-
className={cn(
|
| 80 |
-
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
| 81 |
-
className
|
| 82 |
-
)}
|
| 83 |
-
toast-close=""
|
| 84 |
-
{...props}
|
| 85 |
-
>
|
| 86 |
-
<X className="h-4 w-4" />
|
| 87 |
-
</ToastPrimitives.Close>
|
| 88 |
-
))
|
| 89 |
-
ToastClose.displayName = ToastPrimitives.Close.displayName
|
| 90 |
-
|
| 91 |
-
const ToastTitle = React.forwardRef<
|
| 92 |
-
React.ElementRef<typeof ToastPrimitives.Title>,
|
| 93 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
| 94 |
-
>(({ className, ...props }, ref) => (
|
| 95 |
-
<ToastPrimitives.Title
|
| 96 |
-
ref={ref}
|
| 97 |
-
className={cn("text-sm font-semibold", className)}
|
| 98 |
-
{...props}
|
| 99 |
-
/>
|
| 100 |
-
))
|
| 101 |
-
ToastTitle.displayName = ToastPrimitives.Title.displayName
|
| 102 |
-
|
| 103 |
-
const ToastDescription = React.forwardRef<
|
| 104 |
-
React.ElementRef<typeof ToastPrimitives.Description>,
|
| 105 |
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
| 106 |
-
>(({ className, ...props }, ref) => (
|
| 107 |
-
<ToastPrimitives.Description
|
| 108 |
-
ref={ref}
|
| 109 |
-
className={cn("text-sm opacity-90", className)}
|
| 110 |
-
{...props}
|
| 111 |
-
/>
|
| 112 |
-
))
|
| 113 |
-
ToastDescription.displayName = ToastPrimitives.Description.displayName
|
| 114 |
-
|
| 115 |
-
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
|
| 116 |
-
|
| 117 |
-
type ToastActionElement = React.ReactElement<typeof ToastAction>
|
| 118 |
|
| 119 |
-
export {
|
| 120 |
-
type ToastProps,
|
| 121 |
-
type ToastActionElement,
|
| 122 |
-
ToastProvider,
|
| 123 |
-
ToastViewport,
|
| 124 |
-
Toast,
|
| 125 |
-
ToastTitle,
|
| 126 |
-
ToastDescription,
|
| 127 |
-
ToastClose,
|
| 128 |
-
ToastAction,
|
| 129 |
-
}
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
|
| 3 |
+
import { useTheme } from "next-themes";
|
| 4 |
+
import { Toaster as Sonner } from "sonner";
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
| 7 |
|
| 8 |
+
const Toaster = ({ ...props }: ToasterProps) => {
|
| 9 |
+
const { theme = "system" } = useTheme();
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
return (
|
| 12 |
+
<Sonner
|
| 13 |
+
theme={theme as ToasterProps["theme"]}
|
| 14 |
+
className="toaster group"
|
| 15 |
+
toastOptions={{
|
| 16 |
+
classNames: {
|
| 17 |
+
toast:
|
| 18 |
+
"group toast group-[.toaster]:bg-white group-[.toaster]:text-neutral-950 group-[.toaster]:border-neutral-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-neutral-950 dark:group-[.toaster]:text-neutral-50 dark:group-[.toaster]:border-neutral-800",
|
| 19 |
+
description:
|
| 20 |
+
"group-[.toast]:text-neutral-500 dark:group-[.toast]:text-neutral-400",
|
| 21 |
+
actionButton:
|
| 22 |
+
"group-[.toast]:bg-neutral-900 group-[.toast]:text-neutral-50 dark:group-[.toast]:bg-neutral-50 dark:group-[.toast]:text-neutral-900",
|
| 23 |
+
cancelButton:
|
| 24 |
+
"group-[.toast]:bg-neutral-100 group-[.toast]:text-neutral-500 dark:group-[.toast]:bg-neutral-800 dark:group-[.toast]:text-neutral-400",
|
| 25 |
+
},
|
| 26 |
+
}}
|
| 27 |
{...props}
|
| 28 |
/>
|
| 29 |
+
);
|
| 30 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
export { Toaster };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/components/ui/toaster.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
"use client"
|
| 2 |
-
|
| 3 |
-
import { useToast } from "@/hooks/use-toast"
|
| 4 |
-
import {
|
| 5 |
-
Toast,
|
| 6 |
-
ToastClose,
|
| 7 |
-
ToastDescription,
|
| 8 |
-
ToastProvider,
|
| 9 |
-
ToastTitle,
|
| 10 |
-
ToastViewport,
|
| 11 |
-
} from "@/components/ui/toast"
|
| 12 |
-
|
| 13 |
-
export function Toaster() {
|
| 14 |
-
const { toasts } = useToast()
|
| 15 |
-
|
| 16 |
-
return (
|
| 17 |
-
<ToastProvider>
|
| 18 |
-
{toasts.map(function ({ id, title, description, action, ...props }) {
|
| 19 |
-
return (
|
| 20 |
-
<Toast key={id} {...props}>
|
| 21 |
-
<div className="grid gap-1">
|
| 22 |
-
{title && <ToastTitle>{title}</ToastTitle>}
|
| 23 |
-
{description && (
|
| 24 |
-
<ToastDescription>{description}</ToastDescription>
|
| 25 |
-
)}
|
| 26 |
-
</div>
|
| 27 |
-
{action}
|
| 28 |
-
<ToastClose />
|
| 29 |
-
</Toast>
|
| 30 |
-
)
|
| 31 |
-
})}
|
| 32 |
-
<ToastViewport />
|
| 33 |
-
</ToastProvider>
|
| 34 |
-
)
|
| 35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/components/ui/toggle.tsx
CHANGED
|
@@ -7,13 +7,13 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
| 7 |
import { cn } from "@/lib/utils"
|
| 8 |
|
| 9 |
const toggleVariants = cva(
|
| 10 |
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-
|
| 11 |
{
|
| 12 |
variants: {
|
| 13 |
variant: {
|
| 14 |
default: "bg-transparent",
|
| 15 |
outline:
|
| 16 |
-
"border border-
|
| 17 |
},
|
| 18 |
size: {
|
| 19 |
default: "h-10 px-3 min-w-10",
|
|
|
|
| 7 |
import { cn } from "@/lib/utils"
|
| 8 |
|
| 9 |
const toggleVariants = cva(
|
| 10 |
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors hover:bg-neutral-100 hover:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-neutral-100 data-[state=on]:text-neutral-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2 dark:ring-offset-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-400 dark:focus-visible:ring-neutral-300 dark:data-[state=on]:bg-neutral-800 dark:data-[state=on]:text-neutral-50",
|
| 11 |
{
|
| 12 |
variants: {
|
| 13 |
variant: {
|
| 14 |
default: "bg-transparent",
|
| 15 |
outline:
|
| 16 |
+
"border border-neutral-200 bg-transparent hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
| 17 |
},
|
| 18 |
size: {
|
| 19 |
default: "h-10 px-3 min-w-10",
|
src/components/ui/tooltip.tsx
CHANGED
|
@@ -19,7 +19,7 @@ const TooltipContent = React.forwardRef<
|
|
| 19 |
ref={ref}
|
| 20 |
sideOffset={sideOffset}
|
| 21 |
className={cn(
|
| 22 |
-
"z-50 overflow-hidden rounded-md border bg-
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
|
|
|
| 19 |
ref={ref}
|
| 20 |
sideOffset={sideOffset}
|
| 21 |
className={cn(
|
| 22 |
+
"z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
| 23 |
className
|
| 24 |
)}
|
| 25 |
{...props}
|
src/hooks/use-toast.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
| 1 |
-
"use client"
|
| 2 |
-
|
| 3 |
-
// Inspired by react-hot-toast library
|
| 4 |
-
import * as React from "react"
|
| 5 |
-
|
| 6 |
-
import type {
|
| 7 |
-
ToastActionElement,
|
| 8 |
-
ToastProps,
|
| 9 |
-
} from "@/components/ui/toast"
|
| 10 |
-
|
| 11 |
-
const TOAST_LIMIT = 1
|
| 12 |
-
const TOAST_REMOVE_DELAY = 1000000
|
| 13 |
-
|
| 14 |
-
type ToasterToast = ToastProps & {
|
| 15 |
-
id: string
|
| 16 |
-
title?: React.ReactNode
|
| 17 |
-
description?: React.ReactNode
|
| 18 |
-
action?: ToastActionElement
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
const actionTypes = {
|
| 22 |
-
ADD_TOAST: "ADD_TOAST",
|
| 23 |
-
UPDATE_TOAST: "UPDATE_TOAST",
|
| 24 |
-
DISMISS_TOAST: "DISMISS_TOAST",
|
| 25 |
-
REMOVE_TOAST: "REMOVE_TOAST",
|
| 26 |
-
} as const
|
| 27 |
-
|
| 28 |
-
let count = 0
|
| 29 |
-
|
| 30 |
-
function genId() {
|
| 31 |
-
count = (count + 1) % Number.MAX_SAFE_INTEGER
|
| 32 |
-
return count.toString()
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
type ActionType = typeof actionTypes
|
| 36 |
-
|
| 37 |
-
type Action =
|
| 38 |
-
| {
|
| 39 |
-
type: ActionType["ADD_TOAST"]
|
| 40 |
-
toast: ToasterToast
|
| 41 |
-
}
|
| 42 |
-
| {
|
| 43 |
-
type: ActionType["UPDATE_TOAST"]
|
| 44 |
-
toast: Partial<ToasterToast>
|
| 45 |
-
}
|
| 46 |
-
| {
|
| 47 |
-
type: ActionType["DISMISS_TOAST"]
|
| 48 |
-
toastId?: ToasterToast["id"]
|
| 49 |
-
}
|
| 50 |
-
| {
|
| 51 |
-
type: ActionType["REMOVE_TOAST"]
|
| 52 |
-
toastId?: ToasterToast["id"]
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
interface State {
|
| 56 |
-
toasts: ToasterToast[]
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()
|
| 60 |
-
|
| 61 |
-
const addToRemoveQueue = (toastId: string) => {
|
| 62 |
-
if (toastTimeouts.has(toastId)) {
|
| 63 |
-
return
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
const timeout = setTimeout(() => {
|
| 67 |
-
toastTimeouts.delete(toastId)
|
| 68 |
-
dispatch({
|
| 69 |
-
type: "REMOVE_TOAST",
|
| 70 |
-
toastId: toastId,
|
| 71 |
-
})
|
| 72 |
-
}, TOAST_REMOVE_DELAY)
|
| 73 |
-
|
| 74 |
-
toastTimeouts.set(toastId, timeout)
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
export const reducer = (state: State, action: Action): State => {
|
| 78 |
-
switch (action.type) {
|
| 79 |
-
case "ADD_TOAST":
|
| 80 |
-
return {
|
| 81 |
-
...state,
|
| 82 |
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
| 83 |
-
}
|
| 84 |
-
|
| 85 |
-
case "UPDATE_TOAST":
|
| 86 |
-
return {
|
| 87 |
-
...state,
|
| 88 |
-
toasts: state.toasts.map((t) =>
|
| 89 |
-
t.id === action.toast.id ? { ...t, ...action.toast } : t
|
| 90 |
-
),
|
| 91 |
-
}
|
| 92 |
-
|
| 93 |
-
case "DISMISS_TOAST": {
|
| 94 |
-
const { toastId } = action
|
| 95 |
-
|
| 96 |
-
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
| 97 |
-
// but I'll keep it here for simplicity
|
| 98 |
-
if (toastId) {
|
| 99 |
-
addToRemoveQueue(toastId)
|
| 100 |
-
} else {
|
| 101 |
-
state.toasts.forEach((toast) => {
|
| 102 |
-
addToRemoveQueue(toast.id)
|
| 103 |
-
})
|
| 104 |
-
}
|
| 105 |
-
|
| 106 |
-
return {
|
| 107 |
-
...state,
|
| 108 |
-
toasts: state.toasts.map((t) =>
|
| 109 |
-
t.id === toastId || toastId === undefined
|
| 110 |
-
? {
|
| 111 |
-
...t,
|
| 112 |
-
open: false,
|
| 113 |
-
}
|
| 114 |
-
: t
|
| 115 |
-
),
|
| 116 |
-
}
|
| 117 |
-
}
|
| 118 |
-
case "REMOVE_TOAST":
|
| 119 |
-
if (action.toastId === undefined) {
|
| 120 |
-
return {
|
| 121 |
-
...state,
|
| 122 |
-
toasts: [],
|
| 123 |
-
}
|
| 124 |
-
}
|
| 125 |
-
return {
|
| 126 |
-
...state,
|
| 127 |
-
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
| 128 |
-
}
|
| 129 |
-
}
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
const listeners: Array<(state: State) => void> = []
|
| 133 |
-
|
| 134 |
-
let memoryState: State = { toasts: [] }
|
| 135 |
-
|
| 136 |
-
function dispatch(action: Action) {
|
| 137 |
-
memoryState = reducer(memoryState, action)
|
| 138 |
-
listeners.forEach((listener) => {
|
| 139 |
-
listener(memoryState)
|
| 140 |
-
})
|
| 141 |
-
}
|
| 142 |
-
|
| 143 |
-
type Toast = Omit<ToasterToast, "id">
|
| 144 |
-
|
| 145 |
-
function toast({ ...props }: Toast) {
|
| 146 |
-
const id = genId()
|
| 147 |
-
|
| 148 |
-
const update = (props: ToasterToast) =>
|
| 149 |
-
dispatch({
|
| 150 |
-
type: "UPDATE_TOAST",
|
| 151 |
-
toast: { ...props, id },
|
| 152 |
-
})
|
| 153 |
-
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
|
| 154 |
-
|
| 155 |
-
dispatch({
|
| 156 |
-
type: "ADD_TOAST",
|
| 157 |
-
toast: {
|
| 158 |
-
...props,
|
| 159 |
-
id,
|
| 160 |
-
open: true,
|
| 161 |
-
onOpenChange: (open) => {
|
| 162 |
-
if (!open) dismiss()
|
| 163 |
-
},
|
| 164 |
-
},
|
| 165 |
-
})
|
| 166 |
-
|
| 167 |
-
return {
|
| 168 |
-
id: id,
|
| 169 |
-
dismiss,
|
| 170 |
-
update,
|
| 171 |
-
}
|
| 172 |
-
}
|
| 173 |
-
|
| 174 |
-
function useToast() {
|
| 175 |
-
const [state, setState] = React.useState<State>(memoryState)
|
| 176 |
-
|
| 177 |
-
React.useEffect(() => {
|
| 178 |
-
listeners.push(setState)
|
| 179 |
-
return () => {
|
| 180 |
-
const index = listeners.indexOf(setState)
|
| 181 |
-
if (index > -1) {
|
| 182 |
-
listeners.splice(index, 1)
|
| 183 |
-
}
|
| 184 |
-
}
|
| 185 |
-
}, [state])
|
| 186 |
-
|
| 187 |
-
return {
|
| 188 |
-
...state,
|
| 189 |
-
toast,
|
| 190 |
-
dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
| 191 |
-
}
|
| 192 |
-
}
|
| 193 |
-
|
| 194 |
-
export { useToast, toast }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/webzero/preview.tsx
CHANGED
|
@@ -5,18 +5,22 @@ interface DynamicFileProps {
|
|
| 5 |
}
|
| 6 |
|
| 7 |
const DynamicFileRenderer: React.FC<DynamicFileProps> = ({ id }) => {
|
| 8 |
-
const filepath = `
|
| 9 |
const [DynamicComponent, setDynamicComponent] =
|
| 10 |
useState<React.ComponentType | null>(null);
|
| 11 |
|
| 12 |
useEffect(() => {
|
| 13 |
const importComponent = async () => {
|
| 14 |
try {
|
| 15 |
-
const
|
| 16 |
-
setDynamicComponent(() =>
|
| 17 |
} catch (error) {
|
| 18 |
console.error("Error loading component:", error);
|
| 19 |
-
setDynamicComponent(() =>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
};
|
| 22 |
|
|
@@ -30,4 +34,3 @@ const DynamicFileRenderer: React.FC<DynamicFileProps> = ({ id }) => {
|
|
| 30 |
};
|
| 31 |
|
| 32 |
export default DynamicFileRenderer;
|
| 33 |
-
|
|
|
|
| 5 |
}
|
| 6 |
|
| 7 |
const DynamicFileRenderer: React.FC<DynamicFileProps> = ({ id }) => {
|
| 8 |
+
const filepath = `@/components/generated/${id}.tsx`;
|
| 9 |
const [DynamicComponent, setDynamicComponent] =
|
| 10 |
useState<React.ComponentType | null>(null);
|
| 11 |
|
| 12 |
useEffect(() => {
|
| 13 |
const importComponent = async () => {
|
| 14 |
try {
|
| 15 |
+
const myModule = await import(filepath);
|
| 16 |
+
setDynamicComponent(() => myModule.default);
|
| 17 |
} catch (error) {
|
| 18 |
console.error("Error loading component:", error);
|
| 19 |
+
setDynamicComponent(() => {
|
| 20 |
+
const FallbackComponent = () => <div>Failed to load component</div>;
|
| 21 |
+
FallbackComponent.displayName = "FallbackComponent";
|
| 22 |
+
return FallbackComponent;
|
| 23 |
+
});
|
| 24 |
}
|
| 25 |
};
|
| 26 |
|
|
|
|
| 34 |
};
|
| 35 |
|
| 36 |
export default DynamicFileRenderer;
|
|
|