@baseplate-dev/ui-components
Version:
Shared UI component library
17 lines • 1.27 kB
TypeScript
import type { ComponentPropsWithRef } from 'react';
import type { Control, FieldPath, FieldValues, RegisterOptions, UseFormRegisterReturn } from 'react-hook-form';
import type { FormFieldProps } from '#src/types/form.js';
export interface TextareaFieldProps extends Omit<ComponentPropsWithRef<'textarea'>, 'onChange' | 'value'>, FormFieldProps {
onChange?: (value: string) => void;
value?: string;
register?: UseFormRegisterReturn;
}
declare function TextareaField({ label, description, error, onChange, register, ...props }: TextareaFieldProps): React.ReactElement;
export interface TextareaFieldControllerProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends TextareaFieldProps {
control: Control<TFieldValues>;
name: TFieldName;
registerOptions?: RegisterOptions<TFieldValues, TFieldName>;
}
declare function TextareaFieldController<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, registerOptions, ...rest }: TextareaFieldControllerProps<TFieldValues, TFieldName>): React.ReactElement;
export { TextareaField, TextareaFieldController };
//# sourceMappingURL=textarea-field.d.ts.map