"use client"; /* * Documentation: * Input OTP — https://app.subframe.com/f023064a5ca0/library?component=Input+OTP_1a223fbe-dca0-4e44-a383-44bbc7db975d */ import React from "react"; import * as SubframeUtils from "../../utils"; export interface InputProps extends Omit, "placeholder"> { placeholder?: React.ReactNode; className?: string; } const Input = React.forwardRef(function Input( { placeholder, className, ...otherProps }: InputProps, ref ) { return ( ); }); export interface OtpInputItemProps extends React.HTMLAttributes { success?: boolean; error?: boolean; disabled?: boolean; children?: React.ReactNode; className?: string; } const OtpInputItem = React.forwardRef( function OtpInputItem( { success = false, error = false, disabled = false, children, className, ...otherProps }: OtpInputItemProps, ref ) { return (
{children ? (
{children}
) : null}
); } ); export interface InputOtpRootProps extends Omit, "title"> { state?: "default" | "error" | "disabled"; title?: React.ReactNode; helperText?: React.ReactNode; children?: React.ReactNode; className?: string; } const InputOtpRoot = React.forwardRef( function InputOtpRoot( { state = "default", title, helperText, children, className, ...otherProps }: InputOtpRootProps, ref ) { return (
{title ? ( {title} ) : null} {children ? (
{children}
) : null} {helperText ? ( {helperText} ) : null}
); } ); export const InputOtp = Object.assign(InputOtpRoot, { Input, OtpInputItem, });