import { ClerkAPIError, Autocomplete, PasswordSettingsData, OAuthProvider, Web3Provider, SamlStrategy, EnterpriseSSOStrategy } from '@clerk/types'; import * as _radix_ui_react_form from '@radix-ui/react-form'; import { FormFieldProps as FormFieldProps$1, FormMessageProps, FormControlProps } from '@radix-ui/react-form'; import * as React$1 from 'react'; import React__default from 'react'; import { MetamaskError } from '@clerk/shared'; export { a as FormProps, F as FormSubmitProps, S as Submit } from '../../submit-gXm55DfO.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { T as TSignInStep } from '../../step-MsK0UT__.js'; import { T as TSignUpStep } from '../../step-CT_Bsp8r.js'; import 'xstate'; import 'type-fest'; declare abstract class ClerkElementsErrorBase extends Error { readonly code: string; clerkError: boolean; clerkElementsError: boolean; rawMessage: string; constructor(code: string, message: string); toString(): string; } declare class ClerkElementsError extends ClerkElementsErrorBase { static fromAPIError(error: ClerkAPIError | MetamaskError): ClerkElementsError; constructor(code: string, message: string); } /** Extracted relevant fields from @clerk/types */ type ClerkFieldId = 'code' | 'confirmPassword' | 'currentPassword' | 'backup_code' | 'emailAddress' | 'firstName' | 'identifier' | 'lastName' | 'name' | 'newPassword' | 'password' | 'phoneNumber' | 'username' | 'legalAccepted'; declare const FIELD_STATES: { readonly success: "success"; readonly error: "error"; readonly idle: "idle"; readonly warning: "warning"; readonly info: "info"; }; type FieldStates = (typeof FIELD_STATES)[keyof typeof FIELD_STATES]; type FormErrorRenderProps = Pick; type FormErrorPropsAsChild = { asChild?: true | never; children?: React.ReactElement | ((error: FormErrorRenderProps) => React.ReactNode); code?: string; }; type FormErrorPropsStd = { asChild?: false; children: React.ReactNode; code: string; }; type FormErrorProps = Omit & (FormErrorPropsStd | FormErrorPropsAsChild); type FormFieldProps = Omit & { name: Autocomplete; alwaysShow?: boolean; children: React$1.ReactNode | ((state: FieldStates) => React$1.ReactNode); }; /** * Field is used to associate its child elements with a specific input. It automatically handles unique ID generation and associating the contained label and input elements. * * @param name - Give your `` a unique name inside the current form. If you choose one of the following names Clerk Elements will automatically set the correct type on the `` element: `emailAddress`, `password`, `phoneNumber`, and `code`. * @param alwaysShow - Optional. When `true`, the field will always be renydered, regardless of its state. By default, a field is hidden if it's optional or if it's a filled-out required field. * @param {Function} children - A function that receives `state` as an argument. `state` is a union of `"success" | "error" | "idle" | "warning" | "info"`. * * @example * * Email * * * * @example * * {(fieldState) => ( * Email * * )} * */ declare const Field: React$1.ForwardRefExoticComponent & { name: Autocomplete; alwaysShow?: boolean; children: React$1.ReactNode | ((state: FieldStates) => React$1.ReactNode); } & React$1.RefAttributes>; type FormFieldErrorProps = FormErrorProps; /** * FieldError renders error messages associated with a specific field. By default, the error's message will be rendered in an unstyled ``. Optionally, the `children` prop accepts a function to completely customize rendering. * * @param {string} [name] - Used to target a specific field by name when rendering outside of a `` component. * @param {Function} [children] - A function that receives `message` and `code` as arguments. * * @example * * * * * @example * * * {({ message, code }) => ( * {message} * )} * * */ declare const FieldError: React$1.ForwardRefExoticComponent>; type ComplexityErrors = { [key in keyof Partial>]?: boolean; }; declare const errorMessages: Record, [string, string] | string>; type ErrorMessagesKey = Autocomplete; type ErrorCodeOrTuple = ErrorMessagesKey | [ErrorMessagesKey, Record]; type FieldStateRenderFn = { children: (state: { state: FieldStates; message: string | undefined; codes: ErrorCodeOrTuple[] | undefined; }) => React.ReactNode; }; /** * Programmatically access the state of the wrapping ``. Useful for implementing animations when direct access to the state value is necessary. * * @param {Function} children - A function that receives `state`, `message`, and `codes` as an argument. `state` will is a union of `"success" | "error" | "idle" | "warning" | "info"`. `message` will be the corresponding message, e.g. error message. `codes` will be an array of keys that were used to generate the password validation messages. This prop is only available when the field is of type `password` and has `validatePassword` set to `true`. * * @example * * Email * * {({ state }) => ( * * )} * * * * @example * * Password * * * {({ state, message, codes }) => ( *
Field state: {state}
*
Field msg: {message}
*
Pwd keys: {codes.join(', ')}
* )} *
*
*/ declare function FieldState({ children }: FieldStateRenderFn): React$1.ReactNode; declare namespace FieldState { var displayName: string; } type FormGlobalErrorProps = FormErrorProps>; /** * Used to render errors that are returned from Clerk's API, but that are not associated with a specific form field. By default, will render the error's message wrapped in a `
`. Optionally, the `children` prop accepts a function to completely customize rendering. Must be placed **inside** components like ``/`` to have access to the underlying form state. * * @param {string} [code] - Forces the message with the matching code to be shown. This is useful when using server-side validation. * @param {Function} [children] - A function that receives `message` and `code` as arguments. * @param {boolean} [asChild] - If `true`, `` will render as its child element, passing along any necessary props. * * @example * * * * * @example * * Your custom error message. * * * @example * * * {({ message, code }) => ( * {message} * )} * * */ declare const GlobalError: React$1.ForwardRefExoticComponent>; type OTPInputProps = Exclude & { render?: (props: { value: string; status: OTPInputSegmentStatus; index: number; }) => React$1.ReactNode; length?: number; autoSubmit?: boolean; passwordManagerOffset?: number; }; /** * The status of a single segment element in the OTP input */ type OTPInputSegmentStatus = 'none' | 'cursor' | 'selected' | 'hovered'; type PasswordInputProps = Exclude & { validatePassword?: boolean; }; type FormInputProps = FormControlProps | ({ type: 'otp'; render: OTPInputProps['render']; } & Omit) | ({ type: 'otp'; render?: undefined; } & OTPInputProps) | ({ type: 'password' | 'text'; } & PasswordInputProps); /** * Handles rendering of `` elements within Clerk's flows. Supports special `type` prop values to render input types that are unique to authentication and user management flows. Additional props will be passed through to the `` element. * * @param {boolean} [asChild] - If true, `` will render as its child element, passing along any necessary props. * @param {string} [name] - Used to target a specific field by name when rendering outside of a `` component. * * @example * * Email * * * * @param {Number} [length] - The length of the OTP input. Defaults to 6. * @param {Number} [passwordManagerOffset] - Password managers place their icon inside an ``. This default behaviour is not desirable when you use the render prop to display N distinct element. With this prop you can increase the width of the `` so that the icon is rendered outside the OTP inputs. * @param {string} [type] - Type of control to render. Supports a special `'otp'` type for one-time password inputs. If the wrapping `` component has `name='code'`, the type will default to `'otp'`. With the `'otp'` type, the input will have a pattern and length set to 6 by default and render a single `` element. * * @example * * Email code * * * * @param {Function} [render] - Optionally, you can use a render prop that controls how each individual character is rendered. If no `render` prop is provided, a single text `` will be rendered. * * @example * * Email code * {value}} * /> * */ declare const Input: React$1.ForwardRefExoticComponent>; /** * Renders a `