import type { VNode } from 'vue'; import type { AppConfig } from '@nuxt/schema'; import theme from '#build/ui/auth-form'; import type { ButtonProps } from './Button.vue'; import type { FormProps } from './Form.vue'; import type { FormFieldProps } from './FormField.vue'; import type { SeparatorProps } from './Separator.vue'; import type { InputProps } from './Input.vue'; import type { CheckboxProps } from './Checkbox.vue'; import type { SelectMenuProps } from './SelectMenu.vue'; import type { PinInputProps } from './PinInput.vue'; import type { IconProps } from './Icon.vue'; import type { LinkPropsKeys } from './Link.vue'; import type { FormData, FormSchema, FormSubmitEvent, InferInput } from '../types/form'; import type { FormHTMLAttributes } from '../types/html'; import type { NonUnion } from '../types/utils'; import type { ComponentConfig } from '../types/tv'; type AuthForm = ComponentConfig; export type AuthFormCheckboxField = Omit & CheckboxProps & { name: string; type: 'checkbox'; }; export type AuthFormSelectField = Omit & SelectMenuProps & { name: string; type: 'select'; }; export type AuthFormOtpField = Omit & Omit & { name: string; type: 'otp'; /** * @deprecated Bind props directly in the field object. * The optional props for the `otp` type. * `{ otp: true }`{lang="ts-type"} */ otp?: boolean | PinInputProps; }; export type AuthFormInputFieldType = Required['type']; export type AuthFormInputField = 'text'> = Omit & Omit & { name: string; type: T; }; export type AuthFormField = AuthFormCheckboxField | AuthFormSelectField | AuthFormOtpField | AuthFormInputField; export interface AuthFormProps, F extends AuthFormField = AuthFormField> extends /** @vue-ignore */ FormHTMLAttributes { /** * The element or component this component should render as. * @defaultValue 'div' */ as?: any; /** * The icon displayed above the title. * @IconifyIcon */ icon?: IconProps['name']; title?: string; description?: string; fields?: F[]; /** * Display a list of Button under the description. * `{ color: 'neutral', variant: 'subtle', block: true }`{lang="ts-type"} */ providers?: ButtonProps[]; /** * The text displayed in the separator. * @defaultValue 'or' */ separator?: string | SeparatorProps; /** * Display a submit button at the bottom of the form. * `{ label: 'Continue', block: true }`{lang="ts-type"} */ submit?: Omit; schema?: T; validate?: FormProps['validate']; validateOn?: FormProps['validateOn']; validateOnInputDelay?: FormProps['validateOnInputDelay']; disabled?: FormProps['disabled']; loading?: ButtonProps['loading']; loadingAuto?: FormProps['loadingAuto']; class?: any; onSubmit?: FormProps['onSubmit']; ui?: AuthForm['slots']; } export type AuthFormEmits = { submit: [payload: FormSubmitEvent]; }; type DynamicFieldSlots = Record<`${keyof T extends string ? keyof T : never}-field` | (string & {}), (props: SlotProps) => VNode[]>; type DynamicFormFieldSlots = Record<`${keyof T extends string ? keyof T : never}-${'label' | 'description' | 'hint' | 'help' | 'error'}` | (string & {}), (props?: {}) => VNode[]>; export type AuthFormSlots = { header?(props?: {}): VNode[]; leading?(props: { ui: AuthForm['ui']; }): VNode[]; title?(props?: {}): VNode[]; description?(props?: {}): VNode[]; providers?(props?: {}): VNode[]; separator?(props?: {}): VNode[]; validation?(props?: {}): VNode[]; submit?(props: { loading: boolean; }): VNode[]; footer?(props?: {}): VNode[]; } & DynamicFieldSlots & DynamicFormFieldSlots; declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal & { onSubmit?: ((payload: FormSubmitEvent>) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: import("vue").ShallowUnwrapRef<{ formRef: Readonly(opts: { name?: keyof InferInput | (keyof InferInput)[] | undefined; silent?: false | undefined; nested?: boolean; transform?: T_1 | undefined; isCurrent?: (() => boolean) | undefined; }): Promise>; (opts: { name?: keyof InferInput | (keyof InferInput)[] | undefined; silent?: true | undefined; nested?: boolean; transform?: T_1 | undefined; isCurrent?: (() => boolean) | undefined; }): Promise>; }; errors: { id?: string | undefined; name?: string | undefined; message: string; }[]; setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput | undefined) => void; submit: () => Promise; getErrors: (name?: string | RegExp | keyof InferInput | undefined) => { id?: string | undefined; name?: string | undefined; message: string; }[]; clear: (name?: string | RegExp | keyof InferInput | undefined) => void; disabled: boolean; loading: boolean; dirty: boolean; dirtyFields: ReadonlySet>>>; blurredFields: ReadonlySet>>>; touchedFields: ReadonlySet>>>; } | null, { validate: { (opts: { name?: keyof InferInput | (keyof InferInput)[] | undefined; silent?: false | undefined; nested?: boolean; transform?: T_1 | undefined; isCurrent?: (() => boolean) | undefined; }): Promise>; (opts: { name?: keyof InferInput | (keyof InferInput)[] | undefined; silent?: true | undefined; nested?: boolean; transform?: T_1 | undefined; isCurrent?: (() => boolean) | undefined; }): Promise>; }; errors: { id?: string | undefined; name?: string | undefined; message: string; }[]; setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput | undefined) => void; submit: () => Promise; getErrors: (name?: string | RegExp | keyof InferInput | undefined) => { id?: string | undefined; name?: string | undefined; message: string; }[]; clear: (name?: string | RegExp | keyof InferInput | undefined) => void; disabled: boolean; loading: boolean; dirty: boolean; dirtyFields: ReadonlySet>>>; blurredFields: ReadonlySet>>>; touchedFields: ReadonlySet>>>; } | null>>; state: import("vue").Reactive>; }>) => void; attrs: any; slots: AuthFormSlots>, F>; emit: (evt: "submit", payload: FormSubmitEvent>) => void; }>) => import("vue").VNode & { __ctx?: NonNullable>; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};