import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'; type CardVariant = 'default' | 'elevated' | 'bordered' | 'ghost' | 'glass'; type CardProps = HTMLAttributes & { variant?: CardVariant; padding?: 'none' | 'sm' | 'md' | 'lg'; header?: ReactNode; footer?: ReactNode; hoverable?: boolean; }; const variantStyles: Record = { default: 'bg-[var(--surface-card)] border border-[var(--border-subtle)]', elevated: 'bg-[var(--surface-card)] shadow-lg shadow-black/40', bordered: 'bg-transparent border border-[var(--border-default)]', ghost: 'bg-[var(--surface-muted)]/50', glass: 'bg-[var(--surface-card)]/80 backdrop-blur-xl border border-[var(--border-subtle)]', }; const paddingStyles: Record<'none' | 'sm' | 'md' | 'lg', string> = { none: '', sm: 'p-3', md: 'p-4 md:p-5', lg: 'p-6 md:p-8', }; export const Card = forwardRef( ( { variant = 'default', padding = 'md', header, footer, hoverable = false, className = '', children, ...props }, ref ) => { return (
{header && (
{header}
)} {children} {footer && (
{footer}
)}
); } ); Card.displayName = 'Card'; type CardHeaderProps = HTMLAttributes & { title: string; description?: string; icon?: ReactNode; action?: ReactNode; }; export function CardHeader({ title, description, icon, action, className = '', ...props }: CardHeaderProps) { return (
{icon && (
{icon}
)}

{title}

{description && (

{description}

)}
{action &&
{action}
}
); }