mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-02 11:46:03 +02:00
92 lines
2 KiB
TypeScript
92 lines
2 KiB
TypeScript
import * as React from "react";
|
|
|
|
import { cn } from "./lib/utils";
|
|
|
|
const Card = React.forwardRef<
|
|
HTMLDivElement,
|
|
React.HTMLAttributes<HTMLDivElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn(
|
|
"bg-card text-card-foreground overflow-hidden rounded-lg border shadow-sm",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
));
|
|
Card.displayName = "Card";
|
|
|
|
const CardHeader = React.forwardRef<
|
|
HTMLDivElement,
|
|
React.HTMLAttributes<HTMLDivElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn(
|
|
"grid border-b border-gray-100 p-3 sm:px-5 sm:py-4",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
));
|
|
CardHeader.displayName = "CardHeader";
|
|
|
|
const CardTitle = React.forwardRef<
|
|
HTMLParagraphElement,
|
|
React.HTMLAttributes<HTMLHeadingElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<h3
|
|
ref={ref}
|
|
className={cn(
|
|
"font-semibold tracking-tight sm:text-lg sm:leading-tight",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
));
|
|
CardTitle.displayName = "CardTitle";
|
|
|
|
const CardDescription = React.forwardRef<
|
|
HTMLParagraphElement,
|
|
React.HTMLAttributes<HTMLParagraphElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<p
|
|
ref={ref}
|
|
className={cn("text-muted-foreground text-sm", className)}
|
|
{...props}
|
|
/>
|
|
));
|
|
CardDescription.displayName = "CardDescription";
|
|
|
|
const CardContent = React.forwardRef<
|
|
HTMLDivElement,
|
|
React.HTMLAttributes<HTMLDivElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<div ref={ref} className={cn("p-3 sm:px-5 sm:py-4", className)} {...props} />
|
|
));
|
|
CardContent.displayName = "CardContent";
|
|
|
|
const CardFooter = React.forwardRef<
|
|
HTMLDivElement,
|
|
React.HTMLAttributes<HTMLDivElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn(
|
|
"flex items-center gap-x-2 rounded-b-md border-t bg-gray-50 p-3 sm:px-5",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
));
|
|
CardFooter.displayName = "CardFooter";
|
|
|
|
export {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardFooter,
|
|
CardHeader,
|
|
CardTitle,
|
|
};
|