import React, { forwardRef, InputHTMLAttributes } from 'react'; import { Text } from './Text'; import { Box } from './primitives/Box'; import { Stack } from './primitives/Stack'; interface InputProps extends InputHTMLAttributes { variant?: 'default' | 'error'; errorMessage?: string; icon?: React.ReactNode; label?: React.ReactNode; } export const Input = forwardRef( ({ className = '', variant = 'default', errorMessage, icon, label, ...props }, ref) => { const baseClasses = 'px-3 py-2 border rounded-sm text-white bg-graphite-black focus:outline-none focus:border-primary-accent transition-all duration-150 ease-smooth w-full text-sm placeholder:text-gray-600'; const variantClasses = (variant === 'error' || errorMessage) ? 'border-critical-red' : 'border-border-gray'; const iconClasses = icon ? 'pl-10' : ''; const classes = `${baseClasses} ${variantClasses} ${iconClasses} ${className}`; return ( {label && ( {label} )} {icon && ( {icon} )} {errorMessage && ( {errorMessage} )} ); } ); Input.displayName = 'Input';