import { forwardRef, useId } from "react"; import { cn } from "~/utils/cn"; const CONTROL = "w-full rounded-md border border-gray-700 bg-gray-900/80 px-3 text-sm text-gray-100 placeholder:text-gray-600 focus:border-accent-500 focus:ring-1 focus:ring-accent-500 focus:outline-none disabled:opacity-60"; type FieldShellProps = { label: string; hint?: string; error?: string | null; id: string; children: React.ReactNode; }; function FieldShell({ label, hint, error, id, children }: FieldShellProps) { return (
{children} {hint && !error &&

{hint}

} {error && ( )}
); } type InputProps = Omit, "id"> & { label: string; hint?: string; error?: string | null; }; export const TextField = forwardRef(function TextField( { label, hint, error, className, ...rest }, ref, ) { const id = useId(); return ( ); }); TextField.displayName = "TextField"; type TextAreaProps = Omit, "id"> & { label: string; hint?: string; error?: string | null; }; export const TextAreaField = forwardRef(function TextAreaField( { label, hint, error, className, ...rest }, ref, ) { const id = useId(); return (