import * as React from "react"; import { UploadIcon } from "lucide-react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; /** * UploadCard — WealthX DS * * A dashed-border upload zone used in forms that accept file input. * Comes in two sizes: * - `sm` — compact, fixed max-width (e.g. logo / photo uploads) * - `lg` — full-width, taller drop zone (e.g. bulk CSV upload) * * WealthX overrides: * - No border-radius — sharp corners per WealthX DS */ const uploadCardVariants = cva( [ "flex flex-col items-center justify-center gap-2", "border border-dashed border-border", "cursor-pointer text-muted-foreground", "hover:bg-muted/50 bg-muted/20 transition-colors", ], { variants: { size: { sm: "w-[200px] py-4 px-3", lg: "w-full py-8 px-6", }, }, defaultVariants: { size: "sm", }, }, ); export type UploadCardProps = React.ComponentProps<"label"> & VariantProps & { /** Label text shown below the upload icon */ label?: string; /** Helper text shown below the label */ description?: string; /** File types to accept, passed to the hidden */ accept?: string; /** Called when the user selects a file */ onFileChange?: (file: File | null) => void; }; function UploadCard({ label = "Upload image", description, accept = ".png,.jpg,.jpeg", size, onFileChange, className, ...props }: UploadCardProps) { const handleChange = (e: React.ChangeEvent) => { onFileChange?.(e.target.files?.[0] ?? null); }; return ( ); } export { UploadCard, uploadCardVariants };