"use client"; import { forwardRef, InputHTMLAttributes, useState } from "react"; interface InputProps extends InputHTMLAttributes { label?: string; error?: string; hint?: string; } export const Input = forwardRef( ({ label, error, hint, className = "", ...props }, ref) => { const [isFocused, setIsFocused] = useState(false); return ( {label && ( {label} )} setIsFocused(true)} onBlur={() => setIsFocused(false)} className={` brutal-input ${isFocused ? "border-neon-violet shadow-[0_0_0_4px_rgba(139,92,246,0.12)]" : "border-border-subtle" } ${error ? "!border-neon-orange !shadow-[0_0_0_4px_rgba(249,115,22,0.12)]" : ""} ${className} `} {...props} /> {hint && !error && ( {hint} )} {error && ( ⚠ {error} )} ); } ); Input.displayName = "Input";
{hint}
⚠ {error}