import * as React from "react" import { cn } from "@/lib/utils" import { useMaterial } from "@/contexts/material-context" /* ---------------------------------- Types ---------------------------------- */ export interface CardSystemProps extends React.HTMLAttributes { variant?: "default" | "interactive" | "outline" | "glass" size?: "sm" | "md" | "lg" withHover?: boolean withShadow?: boolean } /* ---------------------------------- Card ---------------------------------- */ export const Card = React.forwardRef( ({ className, variant = "default", size = "md", withHover, withShadow, ...props }, ref) => { const { selectedMaterial, getThemeAwareClass } = useMaterial() const materialClass = selectedMaterial ? getThemeAwareClass(selectedMaterial) : "" // Calculate border radius based on padding to perfectly encapsulate inner rounded elements const getBorderRadius = () => { switch (size) { case "sm": // p-3 (12px) + typical inner element radius (8px) = 20px return "rounded-[20px]" case "md": // p-4 (16px) + typical inner element radius (8px) = 24px return "rounded-[24px]" case "lg": // p-6 (24px) + typical inner element radius (8px) = 32px return "rounded-[32px]" default: return "rounded-[24px]" } } return (
) }, ) Card.displayName = "Card" /* ---------------------------------- CardHeader ---------------------------------- */ export interface CardHeaderProps extends React.HTMLAttributes { compact?: boolean } export const CardHeader = React.forwardRef(({ className, compact, ...props }, ref) => (
)) CardHeader.displayName = "CardHeader" /* ---------------------------------- CardTitle ---------------------------------- */ export interface CardTitleProps extends React.HTMLAttributes { as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" size?: "sm" | "md" | "lg" | "xl" } export const CardTitle = React.forwardRef( ({ className, as: Component = "h3", size = "md", ...props }, ref) => { const sizeClasses = { sm: "text-sm font-medium", md: "text-lg font-semibold", lg: "text-xl font-semibold", xl: "text-2xl font-semibold", } return ( ) }, ) CardTitle.displayName = "CardTitle" /* ---------------------------------- CardDescription ---------------------------------- */ export const CardDescription = React.forwardRef>( ({ className, ...props }, ref) => (

), ) CardDescription.displayName = "CardDescription" /* ---------------------------------- CardContent ---------------------------------- */ export interface CardContentProps extends React.HTMLAttributes { padded?: boolean } export const CardContent = React.forwardRef( ({ className, padded = true, ...props }, ref) => (

), ) CardContent.displayName = "CardContent" /* ---------------------------------- CardFooter ---------------------------------- */ export interface CardFooterProps extends React.HTMLAttributes { align?: "start" | "center" | "end" | "between" } export const CardFooter = React.forwardRef( ({ className, align = "between", ...props }, ref) => { const alignClasses = { start: "justify-start", center: "justify-center", end: "justify-end", between: "justify-between", } return
}, ) CardFooter.displayName = "CardFooter"