import { useId } from "react";
import type { ComponentPropsWithRef, ReactNode } from "react";
import "./Input.css";
/** Everything the label / hint / error scaffolding needs, shared by both controls. */
type FieldShellProps = {
/** Visible, always-present label. Never omit it - a placeholder is not a label. */
label: ReactNode;
/** Helper text under the control. Announced through `aria-describedby`. */
hint?: ReactNode;
/** Validation message. Turns the field red and is announced via `role="alert"`. */
error?: ReactNode;
required?: boolean;
/** Auto-generated from `useId()` when omitted, so SSR and hydration agree. */
id?: string;
/** Applied to the field group (label + control + messages). */
className?: string;
/** Applied to the `` / `