"use client"
import { Separator } from "@/registry/ui/separator"
import { cn } from "@/lib/utils"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react"
function ListItemGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
)
}
function ListItemSeparator({
className,
...props
}: React.ComponentProps) {
return (
)
}
const listItemVariants = cva(
"group/list-item relative flex items-center rounded-xl border border-transparent bg-transparent text-sm transition-all duration-200 outline-none hover:bg-accent/30 hover:border-accent/50 hover:shadow-sm focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/20 focus-visible:shadow-md [a]:transition-all [a]:duration-200",
{
variants: {
variant: {
default: "bg-transparent",
outline:
"border-border/60 bg-background shadow-sm hover:shadow-md",
elevated:
"border-transparent bg-background shadow-sm hover:shadow-lg hover:border-border/40",
filled: "bg-muted/40 border-transparent hover:bg-muted/60",
},
size: {
default: "px-5 py-4 gap-4",
sm: "px-4 py-3 gap-3",
lg: "px-6 py-5 gap-5",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
interface ListItemProps
extends React.ComponentProps<"div">,
VariantProps {
asChild?: boolean
}
function ListItem({
className,
variant = "default",
size = "default",
asChild = false,
...props
}: ListItemProps) {
const Comp = asChild ? Slot : "div"
return (
)
}
const listItemMediaVariants = cva(
"flex shrink-0 items-center justify-center group-has-[[data-slot=list-item-description]]/list-item:self-start group-has-[[data-slot=list-item-description]]/list-item:translate-y-0.5 [&_svg]:pointer-events-none transition-transform duration-200",
{
variants: {
variant: {
default: "bg-transparent",
icon: "size-10 rounded-xl border border-border/40 bg-muted/30 [&_svg:not([class*='size-'])]:size-5 shadow-sm",
image:
"size-12 rounded-xl overflow-hidden ring-1 ring-border/40 [&_img]:size-full [&_img]:object-cover shadow-sm",
avatar:
"size-10 rounded-full overflow-hidden ring-2 ring-background [&_img]:size-full [&_img]:object-cover shadow-sm",
},
},
defaultVariants: {
variant: "default",
},
}
)
interface ListItemMediaProps
extends React.ComponentProps<"div">,
VariantProps {}
function ListItemMedia({
className,
variant = "default",
...props
}: ListItemMediaProps) {
return (
)
}
function ListItemContent({
className,
...props
}: React.ComponentProps<"div">) {
return (
)
}
function ListItemTitle({
className,
...props
}: React.ComponentProps<"div">) {
return (
)
}
function ListItemDescription({
className,
...props
}: React.ComponentProps<"p">) {
return (
a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-2 [&>a]:transition-colors",
className
)}
{...props}
/>
)
}
function ListItemActions({
className,
...props
}: React.ComponentProps<"div">) {
return (
)
}
function ListItemHeader({
className,
...props
}: React.ComponentProps<"div">) {
return (
)
}
function ListItemFooter({
className,
...props
}: React.ComponentProps<"div">) {
return (
)
}
export {
ListItem,
ListItemActions,
ListItemContent,
ListItemDescription,
ListItemFooter,
ListItemGroup,
ListItemHeader,
ListItemMedia,
ListItemSeparator,
ListItemTitle,
}