@@ -116,17 +107,14 @@ const components = {
),
tr: ({ className, ...props }: React.HTMLAttributes
) => (
),
th: ({ className, ...props }) => (
(
(
(
-}
-
-export default function MdxHead({ params, og }: MdxHeadProps) {
- const slug = params?.slug?.join("/") || ""
- const mdxDoc = allDocuments.find((doc) => doc.slugAsParams === slug)
-
- if (!mdxDoc) {
- return null
- }
-
- const title = `${mdxDoc.title} - Taxonomy`
- const url = process.env.NEXT_PUBLIC_APP_URL
- let ogUrl = new URL(`${url}/og.jpg`)
-
- const ogTitle = og?.heading || mdxDoc.title
- const ogDescription = mdxDoc.description
-
- if (og?.type) {
- ogUrl = new URL(`${url}/api/og`)
- ogUrl.searchParams.set("heading", ogTitle)
- ogUrl.searchParams.set("type", og.type)
- ogUrl.searchParams.set("mode", og.mode || "dark")
- }
-
- return (
- <>
- {title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- )
-}
diff --git a/components/mobile-nav.tsx b/components/mobile-nav.tsx
index eaa02e1..a14031e 100644
--- a/components/mobile-nav.tsx
+++ b/components/mobile-nav.tsx
@@ -1,10 +1,10 @@
import * as React from "react"
import Link from "next/link"
-import { useLockBody } from "@/hooks/use-lock-body"
import { MainNavItem } from "types"
import { siteConfig } from "@/config/site"
import { cn } from "@/lib/utils"
+import { useLockBody } from "@/hooks/use-lock-body"
import { Icons } from "@/components/icons"
interface MobileNavProps {
diff --git a/components/mode-toggle.tsx b/components/mode-toggle.tsx
new file mode 100644
index 0000000..93654e8
--- /dev/null
+++ b/components/mode-toggle.tsx
@@ -0,0 +1,43 @@
+"use client"
+
+import * as React from "react"
+import { useTheme } from "next-themes"
+
+import { Button } from "@/components/ui/button"
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu"
+import { Icons } from "@/components/icons"
+
+export function ModeToggle() {
+ const { setTheme } = useTheme()
+
+ return (
+
+
+
+
+
+ Toggle theme
+
+
+
+ setTheme("light")}>
+
+ Light
+
+ setTheme("dark")}>
+
+ Dark
+
+ setTheme("system")}>
+
+ System
+
+
+
+ )
+}
diff --git a/components/nav.tsx b/components/nav.tsx
index c9006d5..985f32e 100644
--- a/components/nav.tsx
+++ b/components/nav.tsx
@@ -27,8 +27,8 @@ export function DashboardNav({ items }: DashboardNavProps) {
diff --git a/components/page-header.tsx b/components/page-header.tsx
index fa766d9..6059ea7 100644
--- a/components/page-header.tsx
+++ b/components/page-header.tsx
@@ -14,12 +14,12 @@ export function DocsPageHeader({
return (
<>
-
+
{heading}
- {text && {text}
}
+ {text &&
{text}
}
-
+
>
)
}
diff --git a/components/pager.tsx b/components/pager.tsx
index 6fbef0c..0f93afd 100644
--- a/components/pager.tsx
+++ b/components/pager.tsx
@@ -2,6 +2,8 @@ import Link from "next/link"
import { Doc } from "contentlayer/generated"
import { docsConfig } from "@/config/docs"
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
import { Icons } from "@/components/icons"
interface DocsPagerProps {
@@ -20,7 +22,7 @@ export function DocsPager({ doc }: DocsPagerProps) {
{pager?.prev && (
{pager.prev.title}
@@ -29,7 +31,7 @@ export function DocsPager({ doc }: DocsPagerProps) {
{pager?.next && (
{pager.next.title}
diff --git a/components/post-create-button.tsx b/components/post-create-button.tsx
index ad82ca6..94cbee4 100644
--- a/components/post-create-button.tsx
+++ b/components/post-create-button.tsx
@@ -2,17 +2,17 @@
import * as React from "react"
import { useRouter } from "next/navigation"
-import { toast } from "@/hooks/use-toast"
import { cn } from "@/lib/utils"
+import { ButtonProps, buttonVariants } from "@/components/ui/button"
+import { toast } from "@/components/ui/use-toast"
import { Icons } from "@/components/icons"
-import { buttonVariants } from "@/components/ui/button"
-interface PostCreateButtonProps
- extends React.HTMLAttributes {}
+interface PostCreateButtonProps extends ButtonProps {}
export function PostCreateButton({
className,
+ variant,
...props
}: PostCreateButtonProps) {
const router = useRouter()
@@ -61,7 +61,7 @@ export function PostCreateButton({
@@ -20,13 +20,12 @@ export function PostItem({ post }: PostItemProps) {
{post.title}
-
+
{formatDate(post.createdAt?.toDateString())}
- {/* */}
)
}
diff --git a/components/post-operations.tsx b/components/post-operations.tsx
index 36326c4..9cdaa4a 100644
--- a/components/post-operations.tsx
+++ b/components/post-operations.tsx
@@ -3,10 +3,8 @@
import * as React from "react"
import Link from "next/link"
import { useRouter } from "next/navigation"
-import { toast } from "@/hooks/use-toast"
import { Post } from "@prisma/client"
-import { Icons } from "@/components/icons"
import {
AlertDialog,
AlertDialogAction,
@@ -24,6 +22,8 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
+import { toast } from "@/components/ui/use-toast"
+import { Icons } from "@/components/icons"
async function deletePost(postId: string) {
const response = await fetch(`/api/posts/${postId}`, {
@@ -53,7 +53,7 @@ export function PostOperations({ post }: PostOperationsProps) {
return (
<>
-
+
Open
@@ -65,7 +65,7 @@ export function PostOperations({ post }: PostOperationsProps) {
setShowDeleteAlert(true)}
>
Delete
diff --git a/components/search.tsx b/components/search.tsx
index bd425af..1557f87 100644
--- a/components/search.tsx
+++ b/components/search.tsx
@@ -1,9 +1,10 @@
"use client"
import * as React from "react"
-import { toast } from "@/hooks/use-toast"
import { cn } from "@/lib/utils"
+import { Input } from "@/components/ui/input"
+import { toast } from "@/components/ui/use-toast"
interface DocsSearchProps extends React.HTMLAttributes {}
@@ -23,12 +24,12 @@ export function DocsSearch({ className, ...props }: DocsSearchProps) {
className={cn("relative w-full", className)}
{...props}
>
-
-
+
⌘ K
diff --git a/components/sidebar-nav.tsx b/components/sidebar-nav.tsx
index 3a93d03..a8c844c 100644
--- a/components/sidebar-nav.tsx
+++ b/components/sidebar-nav.tsx
@@ -41,15 +41,14 @@ export function DocsSidebarNavItems({
return items?.length ? (
{items.map((item, index) =>
- item.href ? (
+ !item.disabled && item.href ? (
{item.title}
- ) : null
+ ) : (
+
+ {item.title}
+
+ )
)}
) : null
diff --git a/components/site-footer.tsx b/components/site-footer.tsx
index e635411..fc6a5b8 100644
--- a/components/site-footer.tsx
+++ b/components/site-footer.tsx
@@ -1,10 +1,14 @@
-import { siteConfig } from "@/config/site"
-import { Icons } from "@/components/icons"
+import * as React from "react"
-export function SiteFooter() {
+import { siteConfig } from "@/config/site"
+import { cn } from "@/lib/utils"
+import { Icons } from "@/components/icons"
+import { ModeToggle } from "@/components/mode-toggle"
+
+export function SiteFooter({ className }: React.HTMLAttributes) {
return (
-
-
+
)
diff --git a/components/theme-provider.tsx b/components/theme-provider.tsx
new file mode 100644
index 0000000..691554d
--- /dev/null
+++ b/components/theme-provider.tsx
@@ -0,0 +1,9 @@
+"use client"
+
+import * as React from "react"
+import { ThemeProvider as NextThemesProvider } from "next-themes"
+import { ThemeProviderProps } from "next-themes/dist/types"
+
+export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
+ return
{children}
+}
diff --git a/components/toc.tsx b/components/toc.tsx
index 5ef8f6f..8dd3ff2 100644
--- a/components/toc.tsx
+++ b/components/toc.tsx
@@ -1,10 +1,10 @@
"use client"
import * as React from "react"
-import { useMounted } from "@/hooks/use-mounted"
import { TableOfContents } from "@/lib/toc"
import { cn } from "@/lib/utils"
+import { useMounted } from "@/hooks/use-mounted"
interface TocProps {
toc: TableOfContents
@@ -97,8 +97,8 @@ function Tree({ tree, level = 1, activeItem }: TreeProps) {
className={cn(
"inline-block no-underline",
item.url === `#${activeItem}`
- ? "text-state-900 font-medium"
- : "text-sm text-slate-600 hover:text-slate-900"
+ ? "font-medium text-primary"
+ : "text-sm text-muted-foreground"
)}
>
{item.title}
diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx
index 80c278b..a6583d9 100644
--- a/components/ui/accordion.tsx
+++ b/components/ui/accordion.tsx
@@ -14,10 +14,7 @@ const AccordionItem = React.forwardRef<
>(({ className, ...props }, ref) => (
))
@@ -50,12 +47,12 @@ const AccordionContent = React.forwardRef<
- {children}
+ {children}
))
AccordionContent.displayName = AccordionPrimitive.Content.displayName
diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx
index 909dd74..8e03ce5 100644
--- a/components/ui/alert-dialog.tsx
+++ b/components/ui/alert-dialog.tsx
@@ -4,6 +4,7 @@ import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
const AlertDialog = AlertDialogPrimitive.Root
@@ -28,7 +29,7 @@ const AlertDialogOverlay = React.forwardRef<
>(({ className, children, ...props }, ref) => (
(({ className, ...props }, ref) => (
))
@@ -106,7 +102,7 @@ const AlertDialogDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
))
@@ -119,10 +115,7 @@ const AlertDialogAction = React.forwardRef<
>(({ className, ...props }, ref) => (
))
@@ -135,7 +128,8 @@ const AlertDialogCancel = React.forwardRef<
svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11",
+ {
+ variants: {
+ variant: {
+ default: "bg-background text-foreground",
+ destructive:
+ "text-destructive border-destructive/50 dark:border-destructive [&>svg]:text-destructive text-destructive",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+const Alert = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes & VariantProps
+>(({ className, variant, ...props }, ref) => (
+
+))
+Alert.displayName = "Alert"
+
+const AlertTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertTitle.displayName = "AlertTitle"
+
+const AlertDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertDescription.displayName = "AlertDescription"
+
+export { Alert, AlertTitle, AlertDescription }
diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx
index f06eb32..51e507b 100644
--- a/components/ui/avatar.tsx
+++ b/components/ui/avatar.tsx
@@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef<
,
+ VariantProps {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index 22914e0..89f2d3c 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -4,25 +4,23 @@ import { VariantProps, cva } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
- "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 dark:hover:bg-slate-800 dark:hover:text-slate-100 disabled:opacity-50 dark:focus:ring-slate-400 disabled:pointer-events-none dark:focus:ring-offset-slate-900 data-[state=open]:bg-slate-100 dark:data-[state=open]:bg-slate-800",
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",
{
variants: {
variant: {
- default:
- "bg-slate-900 text-white hover:bg-slate-700 dark:bg-slate-50 dark:text-slate-900",
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
- "bg-red-500 text-white hover:bg-red-600 dark:hover:bg-red-600",
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
- "bg-transparent border border-slate-200 hover:bg-slate-100 dark:border-slate-700 dark:text-slate-100",
- subtle:
- "bg-slate-100 text-slate-900 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-100",
- ghost:
- "bg-transparent hover:bg-slate-100 dark:hover:bg-slate-800 dark:text-slate-100 dark:hover:text-slate-100 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent",
- link: "bg-transparent underline-offset-4 hover:underline text-slate-900 dark:text-slate-100 hover:bg-transparent dark:hover:bg-transparent",
+ "border border-input hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "underline-offset-4 hover:underline text-primary",
},
size: {
default: "h-10 py-2 px-4",
- sm: "h-9 px-2 rounded-md",
+ sm: "h-9 px-3 rounded-md",
lg: "h-11 px-8 rounded-md",
},
},
diff --git a/components/ui/calendar.tsx b/components/ui/calendar.tsx
new file mode 100644
index 0000000..6af8f10
--- /dev/null
+++ b/components/ui/calendar.tsx
@@ -0,0 +1,64 @@
+"use client"
+
+import * as React from "react"
+import { ChevronLeft, ChevronRight } from "lucide-react"
+import { DayPicker } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+export type CalendarProps = React.ComponentProps
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ ,
+ IconRight: ({ ...props }) => ,
+ }}
+ {...props}
+ />
+ )
+}
+Calendar.displayName = "Calendar"
+
+export { Calendar }
diff --git a/components/ui/card.tsx b/components/ui/card.tsx
index 43164c7..dff04b6 100644
--- a/components/ui/card.tsx
+++ b/components/ui/card.tsx
@@ -1,67 +1,79 @@
+import * as React from "react"
+
import { cn } from "@/lib/utils"
-import { Skeleton } from "@/components/ui/skeleton"
-interface CardProps extends React.HTMLAttributes {}
+const Card = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+Card.displayName = "Card"
-export function Card({ className, ...props }: CardProps) {
- return (
-
- )
-}
+const CardHeader = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardHeader.displayName = "CardHeader"
-interface CardHeaderProps extends React.HTMLAttributes {}
+const CardTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardTitle.displayName = "CardTitle"
-Card.Header = function CardHeader({ className, ...props }: CardHeaderProps) {
- return
-}
+const CardDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardDescription.displayName = "CardDescription"
-interface CardContentProps extends React.HTMLAttributes {}
+const CardContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardContent.displayName = "CardContent"
-Card.Content = function CardContent({ className, ...props }: CardContentProps) {
- return
-}
+const CardFooter = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardFooter.displayName = "CardFooter"
-interface CardFooterProps extends React.HTMLAttributes {}
-
-Card.Footer = function CardFooter({ className, ...props }: CardFooterProps) {
- return (
-
- )
-}
-
-interface CardTitleProps extends React.HTMLAttributes {}
-
-Card.Title = function CardTitle({ className, ...props }: CardTitleProps) {
- return
-}
-
-interface CardDescriptionProps
- extends React.HTMLAttributes {}
-
-Card.Description = function CardDescription({
- className,
- ...props
-}: CardDescriptionProps) {
- return
-}
-
-Card.Skeleton = function CardSeleton() {
- return (
-
-
-
-
-
-
-
-
-
-
- )
-}
+export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx
index 3d395ea..d16e4ea 100644
--- a/components/ui/checkbox.tsx
+++ b/components/ui/checkbox.tsx
@@ -13,13 +13,13 @@ const Checkbox = React.forwardRef<
diff --git a/components/ui/command.tsx b/components/ui/command.tsx
index 2eebfb6..2fdc30e 100644
--- a/components/ui/command.tsx
+++ b/components/ui/command.tsx
@@ -2,8 +2,8 @@
import * as React from "react"
import { DialogProps } from "@radix-ui/react-dialog"
-import { Command as CommandPrimitive, useCommandState } from "cmdk"
-import { ChevronsUpDown, Search } from "lucide-react"
+import { Command as CommandPrimitive } from "cmdk"
+import { Search } from "lucide-react"
import { cn } from "@/lib/utils"
import { Dialog, DialogContent } from "@/components/ui/dialog"
@@ -15,7 +15,7 @@ const Command = React.forwardRef<
{
return (
-
-
+
+
{children}
@@ -41,15 +41,12 @@ const CommandInput = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
-
+
(({ className, ...props }, ref) => (
))
@@ -120,7 +117,7 @@ const CommandItem = React.forwardRef<
(({ className, ...props }, ref) => (
))
@@ -172,7 +172,7 @@ const ContextMenuShortcut = ({
return (
,
React.ComponentPropsWithoutRef
->(({ className, children, ...props }, ref) => (
+>(({ className, ...props }, ref) => (
))
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
@@ -47,14 +47,13 @@ const DialogContent = React.forwardRef<
{children}
-
+
Close
@@ -69,7 +68,7 @@ const DialogHeader = ({
}: React.HTMLAttributes) => (
(({ className, ...props }, ref) => (
))
diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx
index 03cba5d..c03f1a7 100644
--- a/components/ui/dropdown-menu.tsx
+++ b/components/ui/dropdown-menu.tsx
@@ -27,7 +27,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
(({ className, ...props }, ref) => (
))
@@ -174,10 +174,7 @@ const DropdownMenuShortcut = ({
}: React.HTMLAttributes) => {
return (
)
diff --git a/components/ui/hover-card.tsx b/components/ui/hover-card.tsx
index 5086a53..8abff5a 100644
--- a/components/ui/hover-card.tsx
+++ b/components/ui/hover-card.tsx
@@ -18,7 +18,7 @@ const HoverCardContent = React.forwardRef<
align={align}
sideOffset={sideOffset}
className={cn(
- "z-50 w-64 rounded-md border border-slate-100 bg-white p-4 shadow-md outline-none animate-in zoom-in-90 dark:border-slate-800 dark:bg-slate-800",
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in zoom-in-90",
className
)}
{...props}
diff --git a/components/ui/input.tsx b/components/ui/input.tsx
index c574137..929e05f 100644
--- a/components/ui/input.tsx
+++ b/components/ui/input.tsx
@@ -6,11 +6,12 @@ export interface InputProps
extends React.InputHTMLAttributes {}
const Input = React.forwardRef(
- ({ className, ...props }, ref) => {
+ ({ className, type, ...props }, ref) => {
return (
,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef &
+ VariantProps
>(({ className, ...props }, ref) => (
))
diff --git a/components/ui/menubar.tsx b/components/ui/menubar.tsx
index 1a828bf..27d4c0d 100644
--- a/components/ui/menubar.tsx
+++ b/components/ui/menubar.tsx
@@ -23,7 +23,7 @@ const Menubar = React.forwardRef<
(({ className, ...props }, ref) => (
))
@@ -207,7 +207,7 @@ const MenubarShortcut = ({
return (
-
+
))
NavigationMenuIndicator.displayName =
diff --git a/components/ui/popover.tsx b/components/ui/popover.tsx
index e1f1328..ceee78f 100644
--- a/components/ui/popover.tsx
+++ b/components/ui/popover.tsx
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
align={align}
sideOffset={sideOffset}
className={cn(
- "z-50 w-72 rounded-md border border-slate-100 bg-white p-4 shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2 data-[side=left]:slide-in-from-right-2 dark:border-slate-800 dark:bg-slate-800",
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in 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",
className
)}
{...props}
diff --git a/components/ui/progress.tsx b/components/ui/progress.tsx
index 9edfb4b..5c87ea4 100644
--- a/components/ui/progress.tsx
+++ b/components/ui/progress.tsx
@@ -12,13 +12,13 @@ const Progress = React.forwardRef<
diff --git a/components/ui/radio-group.tsx b/components/ui/radio-group.tsx
index 6c15b1f..c4bebe4 100644
--- a/components/ui/radio-group.tsx
+++ b/components/ui/radio-group.tsx
@@ -28,13 +28,13 @@ const RadioGroupItem = React.forwardRef<
-
+
)
diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx
index 9e92611..54b87cd 100644
--- a/components/ui/scroll-area.tsx
+++ b/components/ui/scroll-area.tsx
@@ -40,7 +40,7 @@ const ScrollBar = React.forwardRef<
)}
{...props}
>
-
+
))
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
diff --git a/components/ui/select.tsx b/components/ui/select.tsx
index d41fea3..0d23fc4 100644
--- a/components/ui/select.tsx
+++ b/components/ui/select.tsx
@@ -19,13 +19,15 @@ const SelectTrigger = React.forwardRef<
{children}
-
+
+
+
))
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
@@ -33,17 +35,25 @@ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
const SelectContent = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
->(({ className, children, ...props }, ref) => (
+>(({ className, children, position = "popper", ...props }, ref) => (
-
+
{children}
@@ -57,10 +67,7 @@ const SelectLabel = React.forwardRef<
>(({ className, ...props }, ref) => (
))
@@ -73,7 +80,7 @@ const SelectItem = React.forwardRef<
(({ className, ...props }, ref) => (
))
diff --git a/components/ui/separator.tsx b/components/ui/separator.tsx
index 0ae7e3d..12d81c4 100644
--- a/components/ui/separator.tsx
+++ b/components/ui/separator.tsx
@@ -18,7 +18,7 @@ const Separator = React.forwardRef<
decorative={decorative}
orientation={orientation}
className={cn(
- "bg-slate-200 dark:bg-slate-700",
+ "shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
className
)}
diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx
new file mode 100644
index 0000000..ccdaf02
--- /dev/null
+++ b/components/ui/sheet.tsx
@@ -0,0 +1,230 @@
+"use client"
+
+import * as React from "react"
+import * as SheetPrimitive from "@radix-ui/react-dialog"
+import { VariantProps, cva } from "class-variance-authority"
+import { X } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Sheet = SheetPrimitive.Root
+
+const SheetTrigger = SheetPrimitive.Trigger
+
+const portalVariants = cva("fixed inset-0 z-50 flex", {
+ variants: {
+ position: {
+ top: "items-start",
+ bottom: "items-end",
+ left: "justify-start",
+ right: "justify-end",
+ },
+ },
+ defaultVariants: { position: "right" },
+})
+
+interface SheetPortalProps
+ extends SheetPrimitive.DialogPortalProps,
+ VariantProps {}
+
+const SheetPortal = ({
+ position,
+ className,
+ children,
+ ...props
+}: SheetPortalProps) => (
+
+ {children}
+
+)
+SheetPortal.displayName = SheetPrimitive.Portal.displayName
+
+const SheetOverlay = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+))
+SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
+
+const sheetVariants = cva(
+ "fixed z-50 scale-100 gap-4 bg-background p-6 opacity-100 shadow-lg border",
+ {
+ variants: {
+ position: {
+ top: "animate-in slide-in-from-top w-full duration-300",
+ bottom: "animate-in slide-in-from-bottom w-full duration-300",
+ left: "animate-in slide-in-from-left h-full duration-300",
+ right: "animate-in slide-in-from-right h-full duration-300",
+ },
+ size: {
+ content: "",
+ default: "",
+ sm: "",
+ lg: "",
+ xl: "",
+ full: "",
+ },
+ },
+ compoundVariants: [
+ {
+ position: ["top", "bottom"],
+ size: "content",
+ class: "max-h-screen",
+ },
+ {
+ position: ["top", "bottom"],
+ size: "default",
+ class: "h-1/3",
+ },
+ {
+ position: ["top", "bottom"],
+ size: "sm",
+ class: "h-1/4",
+ },
+ {
+ position: ["top", "bottom"],
+ size: "lg",
+ class: "h-1/2",
+ },
+ {
+ position: ["top", "bottom"],
+ size: "xl",
+ class: "h-5/6",
+ },
+ {
+ position: ["top", "bottom"],
+ size: "full",
+ class: "h-screen",
+ },
+ {
+ position: ["right", "left"],
+ size: "content",
+ class: "max-w-screen",
+ },
+ {
+ position: ["right", "left"],
+ size: "default",
+ class: "w-1/3",
+ },
+ {
+ position: ["right", "left"],
+ size: "sm",
+ class: "w-1/4",
+ },
+ {
+ position: ["right", "left"],
+ size: "lg",
+ class: "w-1/2",
+ },
+ {
+ position: ["right", "left"],
+ size: "xl",
+ class: "w-5/6",
+ },
+ {
+ position: ["right", "left"],
+ size: "full",
+ class: "w-screen",
+ },
+ ],
+ defaultVariants: {
+ position: "right",
+ size: "default",
+ },
+ }
+)
+
+export interface DialogContentProps
+ extends React.ComponentPropsWithoutRef,
+ VariantProps {}
+
+const SheetContent = React.forwardRef<
+ React.ElementRef,
+ DialogContentProps
+>(({ position, size, className, children, ...props }, ref) => (
+
+
+
+ {children}
+
+
+ Close
+
+
+
+))
+SheetContent.displayName = SheetPrimitive.Content.displayName
+
+const SheetHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes) => (
+
+)
+SheetHeader.displayName = "SheetHeader"
+
+const SheetFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes) => (
+
+)
+SheetFooter.displayName = "SheetFooter"
+
+const SheetTitle = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+SheetTitle.displayName = SheetPrimitive.Title.displayName
+
+const SheetDescription = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+SheetDescription.displayName = SheetPrimitive.Description.displayName
+
+export {
+ Sheet,
+ SheetTrigger,
+ SheetContent,
+ SheetHeader,
+ SheetFooter,
+ SheetTitle,
+ SheetDescription,
+}
diff --git a/components/ui/skeleton.tsx b/components/ui/skeleton.tsx
index e70f102..01b8b6d 100644
--- a/components/ui/skeleton.tsx
+++ b/components/ui/skeleton.tsx
@@ -1,15 +1,15 @@
import { cn } from "@/lib/utils"
-interface SkeletonProps extends React.HTMLAttributes {}
-
-export function Skeleton({ className, ...props }: SkeletonProps) {
+function Skeleton({
+ className,
+ ...props
+}: React.HTMLAttributes) {
return (
)
}
+
+export { Skeleton }
diff --git a/components/ui/slider.tsx b/components/ui/slider.tsx
index d80363b..c31c2b3 100644
--- a/components/ui/slider.tsx
+++ b/components/ui/slider.tsx
@@ -17,10 +17,10 @@ const Slider = React.forwardRef<
)}
{...props}
>
-
-
+
+
-
+
))
Slider.displayName = SliderPrimitive.Root.displayName
diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx
index 3191c44..191ef52 100644
--- a/components/ui/switch.tsx
+++ b/components/ui/switch.tsx
@@ -11,7 +11,7 @@ const Switch = React.forwardRef<
>(({ className, ...props }, ref) => (
diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx
index cc8f7e5..26eb109 100644
--- a/components/ui/tabs.tsx
+++ b/components/ui/tabs.tsx
@@ -14,7 +14,7 @@ const TabsList = React.forwardRef<
>(({ className, ...props }, ref) => (
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
@@ -42,12 +42,12 @@ const TabsContent = React.forwardRef<
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
))
TabsContent.displayName = TabsPrimitive.Content.displayName
diff --git a/components/ui/textarea.tsx b/components/ui/textarea.tsx
index da25dcf..e7c13a6 100644
--- a/components/ui/textarea.tsx
+++ b/components/ui/textarea.tsx
@@ -10,7 +10,7 @@ const Textarea = React.forwardRef(
return (