import { Button } from '@components/common/ui/Button.js'; import React from 'react'; import { UseFormProps, FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form'; interface FormProps extends Omit, 'onSubmit' | 'onError'> { form?: UseFormReturn; action?: string; method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; formOptions?: UseFormProps; onSubmit?: SubmitHandler; onSuccess?: (response: any, data: T) => void; onError?: (error: string, data: T) => void; successMessage?: string; errorMessage?: string; submitBtn?: boolean; submitBtnText?: string; /** * Size of the submit button (the shared Button's sizes). A form that sits inside * a widget passes `lg` so its button matches the 40px call-to-action buttons * around it; admin forms keep the default. */ submitBtnSize?: React.ComponentProps['size']; loading?: boolean; children: React.ReactNode; } export declare function Form({ form: externalForm, action, method, formOptions, onSubmit, onSuccess, onError, successMessage, errorMessage, submitBtn, submitBtnText, submitBtnSize, loading, children, className, noValidate, ...props }: FormProps): React.JSX.Element; export { useFormContext } from 'react-hook-form'; export { Controller } from 'react-hook-form'; export type { Control, FieldPath, FieldValues } from 'react-hook-form';