{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "otp-input",
  "type": "registry:ui",
  "title": "OTP input",
  "description": "Segmented code boxes.",
  "dependencies": [],
  "registryDependencies": [
    "bricked-css",
    "pixel-icon"
  ],
  "files": [
    {
      "path": "registry/bricked-ui/otp-input.tsx",
      "content": "import * as React from \"react\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { PixelIcon, type PixelIconInput } from \"./pixel-icon\";\r\n\r\nconst s = cva(\"bk-otp\", {\r\n  variants: {\r\n    size: { sm: \"[--px:4px] [--cut:1.5px] [--icon:3px] text-[11px]\", md: \"[--px:6px] [--cut:2px] [--icon:4px] text-[14px]\", lg: \"[--px:8px] [--cut:3px] [--icon:5px] text-[18px]\" },\r\n    variant: { primary: \"bg-brick text-ink\", dark: \"bg-ink text-on-dark\" },\r\n  },\r\n  defaultVariants: { size: \"md\", variant: \"primary\" },\r\n});\r\nexport interface OtpInputProps extends Omit<React.ComponentProps<\"div\">, \"onChange\">, VariantProps<typeof s> { length?: number; value: string; onChange: (v: string) => void; icon?: PixelIconInput; }\r\nexport function OtpInput({ className, size, variant, length = 4, value, onChange, ...props }: OtpInputProps) {\r\n  return (<div className={cn(s({ size, variant }), \"flex gap-2\", className)} {...props}>{Array.from({ length }, (_, i) => (<input key={i} className=\"bk-input bk-cut w-12 text-center\" maxLength={1} value={value[i] ?? \"\"} onChange={e => onChange(value.slice(0, i) + e.target.value.slice(-1) + value.slice(i + 1))} aria-label={\"Digit \" + (i + 1)} />))}</div>);\r\n}\r\n",
      "type": "registry:ui",
      "target": "components/ui/otp-input.tsx"
    }
  ]
}