mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-06-27 17:05:42 -04:00
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { cn } from "@/lib/utils";
|
|
|
|
const Card = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return (
|
|
<div
|
|
data-slot="card"
|
|
className={cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)}
|
|
{...rest}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const CardHeader = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return (
|
|
<div
|
|
data-slot="card-header"
|
|
className={cn(
|
|
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
className
|
|
)}
|
|
{...rest}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const CardTitle = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return <div data-slot="card-title" className={cn("leading-none font-semibold", className)} {...rest} />;
|
|
};
|
|
|
|
const CardDescription = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return <div data-slot="card-description" className={cn("text-muted-foreground text-sm", className)} {...rest} />;
|
|
};
|
|
|
|
const CardAction = ({ className, ...rest }: 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)}
|
|
{...rest}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const CardContent = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return <div data-slot="card-content" className={cn("px-6", className)} {...rest} />;
|
|
};
|
|
|
|
const CardFooter = ({ className, ...rest }: React.ComponentProps<"div">) => {
|
|
return <div data-slot="card-footer" className={cn("flex items-center px-6 [.border-t]:pt-6", className)} {...rest} />;
|
|
};
|
|
|
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|