import React from 'react'; import { motion, type HTMLMotionProps } from 'motion/react'; export interface ButtonProps extends Omit, "size"> { variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'outline'; size?: 'sm' | 'md' | 'lg' | 'icon'; fullWidth?: boolean; loading?: boolean; } export const Button = React.forwardRef(({ children, variant = 'primary', size = 'md', className = '', fullWidth = false, asChild, loading = false, ...props }, ref) => { const baseClasses = "relative flex items-center justify-center font-bold tracking-wide transition-all duration-300 overflow-hidden outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-background disabled:opacity-50 disabled:cursor-not-allowed"; const sizeClasses = { sm: "px-4 py-2 text-xs rounded-lg", md: "px-6 py-2.5 text-sm rounded-xl", lg: "px-8 py-3.5 text-base rounded-2xl", icon: "p-2 rounded-lg", }; const variantClasses = { primary: "bg-primary text-white shadow-[0_0_20px_color-mix(in_oklab,var(--colors-primary)_40%,transparent)] hover:shadow-[0_0_30px_color-mix(in_oklab,var(--colors-primary)_60%,transparent)] border border-primary/50", secondary: "bg-surface-hover text-text border border-border shadow-lg hover:border-primary/50 hover:bg-surface", danger: "bg-error text-white shadow-[0_0_20px_color-mix(in_oklab,var(--colors-error)_40%,transparent)] border border-error/50", ghost: "bg-transparent text-text hover:bg-surface-hover", outline: "bg-transparent text-text border border-border hover:border-primary hover:text-primary", }; return (
{loading && ( )} {children as any} ); }); Button.displayName = 'Button';