/** * InputOTP — shadcn/WealthX * Base: npx shadcn\@latest add input-otp * Figma: https://www.figma.com/design/9V9F0NGVsif8LGmEhVjOcT/Design-System---shadcn?node-id=101-698 * * WealthX overrides: * - InputOTPSlot: removed first:rounded-l-md last:rounded-r-md — sharp corners (radius-none) */ import { type ReactElement } from "react"; import * as React from "react"; import { OTPInput, OTPInputContext } from "input-otp"; import { MinusIcon } from "lucide-react"; import { cn } from "@/lib/utils"; export type InputOTPProps = React.ComponentProps & { containerClassName?: string; }; function InputOTP({ className, containerClassName, ...props }: InputOTPProps): ReactElement { return ( ); } export type InputOTPGroupProps = React.ComponentProps<"div">; function InputOTPGroup({ className, ...props }: InputOTPGroupProps): ReactElement { return (
); } export type InputOTPSlotProps = React.ComponentProps<"div"> & { index: number; }; function InputOTPSlot({ index, className, ...props }: InputOTPSlotProps): ReactElement { const inputOTPContext = React.useContext(OTPInputContext); const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {}; return (
{char} {hasFakeCaret ? (
) : null}
); } export type InputOTPSeparatorProps = React.ComponentProps<"div">; function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): ReactElement { return (
); } export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };