import { forwardRef } from 'react'; import { motion, HTMLMotionProps } from 'framer-motion'; import { cn } from '../../lib/utils'; import { Loader2 } from 'lucide-react'; export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'outline'; export type ButtonSize = 'sm' | 'md' | 'lg'; export interface ButtonProps extends Omit, 'children'> { variant?: ButtonVariant; size?: ButtonSize; loading?: boolean; children?: React.ReactNode; } const variantStyles: Record = { primary: 'bg-primary text-white hover:bg-primary-hover', secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-100 dark:hover:bg-gray-600', ghost: 'text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700', danger: 'bg-red-500 text-white hover:bg-red-600', outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800', }; const sizeStyles: Record = { sm: 'px-3 py-1.5 text-xs rounded-md', md: 'px-4 py-2 text-sm rounded-lg', lg: 'px-6 py-3 text-base rounded-lg', }; export const Button = forwardRef( ({ className, variant = 'primary', size = 'md', loading, disabled, children, ...props }, ref) => { return ( {loading && } {children} ); } ); Button.displayName = 'Button';