import { OTPInputProps } from 'input-otp'; import * as React from "react"; export declare const inputVariants: (props?: ({ error?: boolean | null | undefined; } & import('class-variance-authority/types').ClassProp) | undefined) => string; declare const patternDictionary: { digits: string; chars: string; digitsAndChars: string; }; type OTPFieldProps = Omit & { /** * The number of input slots/characters in the OTP field. * Defaults to 6 if not specified. */ maxLength?: number; /** * Whether the OTP field is in an error state. * When true, displays error styling. */ error?: boolean; /** * Custom regex pattern to validate the input. * If not provided, uses the pattern from the selected mode. */ pattern?: string; /** * The input mode that determines allowed characters. * - digits: Only numbers 0-9 * - chars: Only letters A-Z * - digitsAndChars: Both numbers and letters * Defaults to "digits" if not specified. */ mode?: keyof typeof patternDictionary; /** * The current value of the OTP input. * Used for controlled component behavior. */ value?: string; /** * Callback fired when the input value changes. * @param newValue The new input value */ onChange?: (newValue: string) => unknown; /** * Callback fired when all slots are filled. * Called with the complete OTP value. */ onComplete?: (...args: any[]) => unknown; /** * Function to transform pasted text before inserting. * Useful for handling formatted strings, e.g. "123-456" -> "123456" * @param pastedText The text being pasted * @returns The transformed text to insert */ pasteTransformer?: (pastedText: string) => string; }; declare const OTPField: React.ForwardRefExoticComponent & { /** * The number of input slots/characters in the OTP field. * Defaults to 6 if not specified. */ maxLength?: number; /** * Whether the OTP field is in an error state. * When true, displays error styling. */ error?: boolean; /** * Custom regex pattern to validate the input. * If not provided, uses the pattern from the selected mode. */ pattern?: string; /** * The input mode that determines allowed characters. * - digits: Only numbers 0-9 * - chars: Only letters A-Z * - digitsAndChars: Both numbers and letters * Defaults to "digits" if not specified. */ mode?: keyof typeof patternDictionary; /** * The current value of the OTP input. * Used for controlled component behavior. */ value?: string; /** * Callback fired when the input value changes. * @param newValue The new input value */ onChange?: (newValue: string) => unknown; /** * Callback fired when all slots are filled. * Called with the complete OTP value. */ onComplete?: (...args: any[]) => unknown; /** * Function to transform pasted text before inserting. * Useful for handling formatted strings, e.g. "123-456" -> "123456" * @param pastedText The text being pasted * @returns The transformed text to insert */ pasteTransformer?: (pastedText: string) => string; } & React.RefAttributes>; export { OTPField }; export type { OTPFieldProps };