{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input-otp",
  "title": "Input OTP",
  "description": "One-time code input drawn as separate slots, with paste and autofill support.",
  "dependencies": [
    "input-otp@^1.5.0",
    "lucide-react"
  ],
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/input-otp.tsx",
      "content": "\"use client\";\n\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide-react\";\nimport { useContext, type ComponentProps } from \"react\";\n\nimport { cn } from \"@/registry/default/lib/utils\";\n\n/**\n * One-time code input: a single real input drawn as separate slots, so paste,\n * autofill (`autoComplete=\"one-time-code\"`) and screen readers treat it as one\n * field. Set `maxLength` to the number of slots.\n */\nfunction InputOTP({\n  className,\n  containerClassName,\n  ...props\n}: ComponentProps<typeof OTPInput> & { containerClassName?: string }) {\n  return (\n    <OTPInput\n      data-slot=\"input-otp\"\n      containerClassName={cn(\n        \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n        // aria-invalid sits on the real input; paint every slot with it.\n        \"[&:has(input[aria-invalid=true])_[data-slot=input-otp-slot]]:border-destructive\",\n        containerClassName\n      )}\n      className={cn(\"disabled:cursor-not-allowed\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction InputOTPGroup({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div data-slot=\"input-otp-group\" className={cn(\"flex items-center\", className)} {...props} />\n  );\n}\n\n/** The character at `index`, with a blinking caret while it is the active slot. */\nfunction InputOTPSlot({ index, className, ...props }: ComponentProps<\"div\"> & { index: number }) {\n  const context = useContext(OTPInputContext);\n  const { char, hasFakeCaret, isActive } = context?.slots[index] ?? {};\n\n  return (\n    <div\n      data-slot=\"input-otp-slot\"\n      data-active={isActive || undefined}\n      className={cn(\n        \"border-input bg-field relative flex size-9 items-center justify-center border-y border-r text-sm\",\n        \"transition-[color,border-color,box-shadow] outline-none motion-reduce:transition-none\",\n        \"first:rounded-l-md first:border-l last:rounded-r-md\",\n        \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n        className\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-foreground h-4 w-px motion-reduce:animate-none\" />\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\nfunction InputOTPSeparator(props: ComponentProps<\"div\">) {\n  return (\n    <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n      <MinusIcon aria-hidden=\"true\" className=\"text-muted-foreground size-4\" />\n    </div>\n  );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };\n",
      "type": "registry:ui"
    }
  ],
  "tailwind": {
    "config": {
      "theme": {
        "extend": {
          "keyframes": {
            "caret-blink": {
              "0%, 70%, 100%": {
                "opacity": "1"
              },
              "20%, 50%": {
                "opacity": "0"
              }
            }
          },
          "animation": {
            "caret-blink": "caret-blink 1.25s ease-out infinite"
          }
        }
      }
    }
  },
  "cssVars": {
    "theme": {
      "animate-caret-blink": "caret-blink 1.25s ease-out infinite"
    }
  },
  "css": {
    "@keyframes caret-blink": {
      "0%, 70%, 100%": {
        "opacity": "1"
      },
      "20%, 50%": {
        "opacity": "0"
      }
    }
  },
  "type": "registry:ui"
}