import type { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react"; /** * The one field style used by every form on the site (previously each form * declared its own near-identical `fieldClass` constant with small drifts in * padding/size/background - see ContactForm, auth/*, meeting/* history). * Functionality is untouched: both components just spread the native * input/textarea props through, so controlled and uncontrolled forms, * validation attributes, autoComplete, etc. all keep working exactly as * before. */ export const fieldClass = "w-full rounded-2xl border border-anouma-taupe/30 bg-white px-5 py-3.5 text-base text-anouma-plum placeholder:text-anouma-plum/50 focus:border-anouma-mauve-dark focus:outline-none"; function FieldLabel({ label, htmlFor, hidden = false }: { label: string; htmlFor: string; hidden?: boolean }) { return ( ); } type TextFieldProps = InputHTMLAttributes & { label: string; id: string; /** Keeps the label for screen readers only - for compact inline fields identified by a placeholder instead (e.g. ResendVerificationButton's email prompt). */ hideLabel?: boolean; wrapperClassName?: string; }; export function TextField({ label, id, hideLabel = false, className = "", wrapperClassName = "", ...inputProps }: TextFieldProps) { return (
); } type TextAreaFieldProps = TextareaHTMLAttributes & { label: string; id: string; wrapperClassName?: string; }; export function TextAreaField({ label, id, className = "", wrapperClassName = "", ...textareaProps }: TextAreaFieldProps) { return (