"use client"; import { useId, type CSSProperties, type InputHTMLAttributes } from "react"; type FloatInputProps = Omit, "placeholder" | "className"> & { /** Field name shown inside the box. It floats up once you type or focus. */ label: string; /** Small help text under the field. */ hint?: string; /** Error text under the field. Turns the field red and sets aria-invalid. */ error?: string; /** Colour of the floated label and focus line. */ accent?: string; /** Wrapper look (width etc.). */ className?: string; }; /* FloatInput: the label sits inside the box like a placeholder, then floats up and shrinks when you focus or type. A line grows from the middle on focus. */ export function FloatInput({ label, hint, error, accent = "#a78bfa", className = "w-full max-w-sm", id, type = "text", ...rest }: FloatInputProps) { const autoId = useId(); const inputId = id ?? autoId; const noteId = `${inputId}-note`; const note = error ?? hint; return (
{note && (

{note}

)}
); }