import React from 'react'; import { clsx } from 'clsx'; import { Label } from './Typography'; interface InputProps extends Omit, 'size'> { label?: string; error?: string; helperText?: string; inputSize?: 'sm' | 'md' | 'lg'; icon?: React.ComponentType<{ className?: string }>; } export const Input = React.forwardRef( ({ label, error, helperText, inputSize = 'md', className, id, ...props }, ref) => { const sizeClasses = { sm: 'px-3 py-2 text-sm', md: 'px-3 py-3 text-base', lg: 'px-4 py-4 text-lg' }; const inputClasses = clsx( 'w-full border rounded-lg transition-all duration-200 focus:outline-none focus:ring-2', sizeClasses[inputSize], error ? 'border-red-300 focus:border-red-500 focus:ring-red-500' : 'border-gray-300 dark:border-gray-600 focus:border-primary-500 focus:ring-primary-500', 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100', 'placeholder-gray-500 dark:placeholder-gray-400', className ); return (
{label && } {helperText && !error && (

{helperText}

)} {error && (

{error}

)}
); } );