diff --git a/app/components/Input.tsx b/app/components/Input.tsx index 4422a53..804062a 100644 --- a/app/components/Input.tsx +++ b/app/components/Input.tsx @@ -3,12 +3,14 @@ import { type AriaTextFieldProps, useId, useTextField } from 'react-aria'; import cn from '~/utils/cn'; export interface InputProps extends AriaTextFieldProps { + label: string; + labelHidden?: boolean; isRequired?: boolean; className?: string; } export default function Input(props: InputProps) { - const { label, className } = props; + const { label, labelHidden, className } = props; const ref = useRef(null); const id = useId(props.id); @@ -19,16 +21,24 @@ export default function Input(props: InputProps) { errorMessageProps, isInvalid, validationErrors, - } = useTextField(props, ref); + } = useTextField( + { + ...props, + label, + 'aria-label': label, + }, + ref, + ); return ( -
+