import type { AriaRole, InputHTMLAttributes } from "react"; import type { UseLabelProps, UseLabelReturn } from "../useLabel/useLabel"; import type { FocusEvents, Validation } from "../../types"; export type UseTextFieldProps = UseLabelProps & FocusEvents & Validation & Pick< InputHTMLAttributes, | "defaultValue" | "value" | "onChange" | "autoComplete" | "maxLength" | "minLength" | "name" | "placeholder" | "inputMode" | "type" | "pattern" // Clipboard events | "onCopy" | "onCut" | "onPaste" // Keyboard events | "onKeyDown" | "onKeyUp" | "onKeyPress" // Composition events | "onCompositionEnd" | "onCompositionStart" | "onCompositionUpdate" // Selection events | "onSelect" // Input events | "onBeforeInput" | "onInput" // Number types | "min" | "max" | "step" > & { inputElementType?: "input" | "textarea" | undefined; defaultValue?: string | undefined; value?: string | undefined; isDisabled?: boolean | undefined; isReadOnly?: boolean | undefined; isRequired?: boolean | undefined; description?: string | undefined; errorMessage?: string | undefined; "aria-describedby"?: string | undefined; "aria-errormessage"?: string | undefined; role?: AriaRole | undefined; }; export type UseTextFieldReturn = { labelProps: UseLabelReturn["labelProps"]; inputProps: InputHTMLAttributes; descriptionProps: { id?: string | undefined }; errorMessageProps: { id?: string | undefined }; };