import type { Icon } from '@tabler/icons-react' import { forwardRef, type InputHTMLAttributes, type ReactNode, useId } from 'react' export interface TextFieldProps extends Omit, 'className'> { label: string icon?: Icon /** Right-side element in the label row (link, badge, timer, ...). */ aside?: ReactNode /** Trailing interactive element inside the input box (reveal toggle, ...). */ trailing?: ReactNode error?: string } /** Labelled input row matching the auth design: 10px mono label, 46px field. */ export const TextField = forwardRef(function TextField( { label, icon: Icon, aside, trailing, error, id, ...props }, ref, ) { const autoId = useId() const inputId = id ?? autoId return (
{aside}
{Icon && } {trailing}
{error && (

{error}

)}
) })