UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

58 lines (57 loc) 1.86 kB
import { Dict } from "../../utils/index.js"; import { FieldContext, FieldProps } from "./field.js"; import * as react881 from "react"; import { FocusEventHandler } from "react"; //#region src/components/field/use-field-props.d.ts interface UseFieldProps<Y extends HTMLElement> extends FieldProps { id?: string; notSupportReadOnly?: boolean; onBlur?: FocusEventHandler<Y>; onFocus?: FocusEventHandler<Y>; } declare const useFieldProps: <Y extends HTMLElement, M extends Dict>({ id, "aria-describedby": ariaDescribedby, disabled, invalid, notSupportReadOnly, readOnly, required, onBlur, onFocus, ...rest }?: M & UseFieldProps<Y>) => { context: FieldContext | undefined; props: { id: string | undefined; disabled: boolean | undefined; readOnly: boolean | undefined; required: boolean | undefined; } & Omit<M & UseFieldProps<Y>, "disabled" | "readOnly" | "invalid" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "required" | "notSupportReadOnly">; ariaProps: { "aria-describedby": string; "aria-disabled": (boolean | "true" | "false") | undefined; "aria-invalid": (boolean | "true" | "false") | undefined; "aria-readonly": (boolean | "true" | "false") | undefined; "aria-required": (boolean | "true" | "false") | undefined; }; dataProps: { "data-disabled": string | undefined; "data-invalid": string | undefined; "data-readonly": string | undefined; "data-required": string | undefined; }; eventProps: { onBlur: (ev: react881.FocusEvent<Y, Element>) => void; onFocus: (ev: react881.FocusEvent<Y, Element>) => void; }; }; declare const resetFieldProps: { disabled: boolean; invalid: boolean; readOnly: boolean; required: boolean; }; //#endregion export { UseFieldProps, resetFieldProps, useFieldProps }; //# sourceMappingURL=use-field-props.d.ts.map