'use client'; import { forwardRef, useState, useId, type InputHTMLAttributes, type TextareaHTMLAttributes, } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { clsx } from 'clsx'; import { Search, Eye, EyeOff } from 'lucide-react'; type InputType = 'text' | 'email' | 'phone' | 'password' | 'search' | 'textarea'; interface InputProps extends Omit, 'type' | 'size'> { inputType?: InputType; label?: string; error?: string; rows?: number; } const baseStyles = clsx( 'w-full bg-white/5 backdrop-blur-sm text-white placeholder-transparent', 'border border-white/10 rounded-lg', 'transition-all duration-200', 'focus:outline-none focus:ring-2 focus:ring-teal-400/50 focus:border-teal-400', 'disabled:opacity-50 disabled:cursor-not-allowed', 'text-base ps-4 pe-4 pt-5 pb-2', 'peer', ); const labelStyles = clsx( 'absolute text-sm text-slate-400 duration-200 transform', 'top-4 start-4 z-10 origin-[right]', 'peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0', 'peer-focus:scale-75 peer-focus:-translate-y-2.5', 'peer-[:not(:placeholder-shown)]:scale-75 peer-[:not(:placeholder-shown)]:-translate-y-2.5', 'pointer-events-none', ); const errorLabelStyles = 'text-red-400'; const DealixInput = forwardRef( ({ inputType = 'text', label, error, className, rows = 4, id, ...props }, ref) => { const generatedId = useId(); const inputId = id ?? generatedId; const [showPassword, setShowPassword] = useState(false); const errorId = error ? `${inputId}-error` : undefined; const wrapperClass = 'relative w-full'; if (inputType === 'textarea') { return (