2026-02-13 15:52:13 +07:00
|
|
|
import type * as React from "react";
|
|
|
|
|
|
2026-02-17 18:12:02 +07:00
|
|
|
import { cn } from "@/lib/cn";
|
2026-02-13 15:52:13 +07:00
|
|
|
|
|
|
|
|
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card"
|
|
|
|
|
className={cn(
|
2026-08-13 01:58:09 +07:00
|
|
|
"bg-card text-card-foreground flex flex-col gap-5 rounded-sm border py-5 shadow-[3px_3px_0_color-mix(in_oklch,var(--foreground)_8%,transparent)]",
|
2026-02-13 15:52:13 +07:00
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card-header"
|
|
|
|
|
className={cn(
|
2026-08-13 01:58:09 +07:00
|
|
|
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-5 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-5 sm:px-6",
|
2026-02-13 15:52:13 +07:00
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card-title"
|
2026-08-13 01:58:09 +07:00
|
|
|
className={cn("text-base font-black leading-none tracking-[-0.015em]", className)}
|
2026-02-13 15:52:13 +07:00
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card-description"
|
|
|
|
|
className={cn("text-muted-foreground text-sm", className)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card-action"
|
|
|
|
|
className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
2026-08-13 01:58:09 +07:00
|
|
|
return <div data-slot="card-content" className={cn("px-5 sm:px-6", className)} {...props} />;
|
2026-02-13 15:52:13 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
data-slot="card-footer"
|
|
|
|
|
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-13 01:58:09 +07:00
|
|
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|