diff --git a/app/components/ui/card.tsx b/app/components/ui/card.tsx index 98fc819..ad9cb91 100644 --- a/app/components/ui/card.tsx +++ b/app/components/ui/card.tsx @@ -1,78 +1,28 @@ -import * as React from 'react'; +import type { ComponentProps } from 'react'; +import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '~/lib/utils'; -const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); -Card.displayName = 'Card'; +const cardVariants = cva('text-text-primary ring-1 ring-inset', { + variants: { + surface: { + default: 'bg-surface ring-border-subtle', + well: 'bg-surface-well ring-border-divider', + }, + size: { + sm: 'rounded-card-sm', + md: 'rounded-card', + lg: 'rounded-panel', + }, + interactive: { + true: 'cursor-pointer transition-shadow duration-150 hover:ring-border-strong', + false: '', + }, + }, + defaultVariants: { surface: 'default', size: 'md', interactive: false }, +}); -const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); -CardHeader.displayName = 'CardHeader'; +export interface CardProps extends ComponentProps<'div'>, VariantProps {} -const CardTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)); -CardTitle.displayName = 'CardTitle'; - -const CardDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)); -CardDescription.displayName = 'CardDescription'; - -const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)); -CardContent.displayName = 'CardContent'; - -const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); -CardFooter.displayName = 'CardFooter'; - -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }; +export function Card({ className, surface, size, interactive, ...props }: CardProps) { + return
; +}