{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "otp-input",
  "title": "OTP Input",
  "description": "An OTP (One-Time Password) input component.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/components/ui/OTPinput.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { cn } from \"@/stories/lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\n// Variant classes for OTP input slots\nconst inputOTPSlotVariants = cva(\n  \"border border-input rounded-md relative flex items-center justify-center outline-none text-lg font-medium text-black dark:text-white border-b border-gray-300 transition-colors duration-200 underline decoration-cyan-400 underline-offset-4\", // base styles\n\n  {\n    variants: {\n      Otpvariant: {\n        sm: \"w-8 h-8 text-sm\",\n        md: \"w-10 h-10 text-base\",\n        lg: \"w-12 h-12 text-lg\",\n        xl: \"w-14 h-14 text-xl\",\n      },\n    },\n    defaultVariants: {\n      Otpvariant: \"md\",\n    },\n  },\n);\n\n// Wrapper around OTPInput to apply common classes\nfunction InputOTP({\n  className,\n  containerClassName,\n  ...props\n}: React.ComponentProps<typeof OTPInput> & {\n  containerClassName?: string;\n}) {\n  return (\n    <OTPInput\n      data-slot=\"input-otp\"\n      containerClassName={cn(\n        \"flex items-center gap-2 has-disabled:opacity-50\",\n        containerClassName,\n      )}\n      className={cn(\"disabled:cursor-not-allowed\", className)}\n      {...props}\n    />\n  );\n}\n\n// Group wrapper for slots\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"input-otp-group\"\n      className={cn(\"flex items-center space-x-2\", className)}\n      {...props}\n    />\n  );\n}\n\n// Slot component with support for variants\ntype InputOTPSlotProps = React.ComponentProps<\"div\"> &\n  VariantProps<typeof inputOTPSlotVariants> & {\n    index: number;\n  };\n\nfunction InputOTPSlot({\n  index,\n  className,\n  Otpvariant,\n  ...props\n}: InputOTPSlotProps) {\n  const inputOTPContext = React.useContext(OTPInputContext);\n  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};\n  const hasValue = !!char;\n  return (\n    <div\n      data-slot=\"input-otp-slot\"\n      data-active={isActive}\n      className={cn(\n        inputOTPSlotVariants({ Otpvariant }),\n        className,\n        // Always apply base underline style\n        \"border-b border-gray-300\",\n        hasValue ? \"border-b-1 border-cyan-400\" : \"border-b border-gray-300\",\n\n        // Apply active underline when focused/active\n        isActive && \"border-b-[1.5px] border-cyan-400\",\n      )}\n      {...props}\n    >\n      {char}\n      {hasFakeCaret && (\n        <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center \">\n          <div className=\"animate-caret-blink bg-black h-4 w-px \" />\n        </div>\n      )}\n    </div>\n  );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot };\n",
      "type": "registry:ui",
      "target": "components/ui/OTPinput.tsx"
    }
  ],
  "type": "registry:ui"
}