{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "otp-field",
  "title": "OTP Field",
  "description": "Soft-rect OTP digit slots with whileFocus settle (~160ms easeOutExpo) on Base UI.",
  "dependencies": [
    "@base-ui/react",
    "motion"
  ],
  "registryDependencies": [
    "@atroui/utils",
    "@atroui/motion"
  ],
  "files": [
    {
      "path": "registry/default/ui/otp-field.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\nimport { OTPField as OTPFieldPrimitive } from \"@base-ui/react/otp-field\"\nimport { motion, useReducedMotion } from \"motion/react\"\n\nimport { easeOutExpo } from \"@/lib/motion\"\nimport { cn } from \"@/lib/utils\"\n\n/** Drop DOM animation handlers that clash with Motion's identically named props. */\nfunction withoutDomAnimationHandlers<T extends Record<string, unknown>>(\n  props: T\n) {\n  const {\n    onAnimationStart: _onAnimationStart,\n    onDrag: _onDrag,\n    onDragStart: _onDragStart,\n    onDragEnd: _onDragEnd,\n    ...rest\n  } = props\n  return rest\n}\n\n/** Active digit settle — ~160ms easeOutExpo, no spring. */\nconst digitFocusTween = {\n  duration: 0.16,\n  ease: easeOutExpo,\n} as const\n\n/**\n * OTP field — soft-rect digit slots + focus settle (Family Values: careful delight).\n * Ring caret via `.atro-field-type`; Motion only on the focused slot scale.\n */\nfunction OTPField({ className, ...props }: OTPFieldPrimitive.Root.Props) {\n  return (\n    <OTPFieldPrimitive.Root\n      data-slot=\"otp-field\"\n      className={cn(\n        \"flex w-full items-center justify-center gap-2 data-disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction OTPFieldInput({\n  className,\n  ...props\n}: OTPFieldPrimitive.Input.Props) {\n  const reduce = useReducedMotion()\n\n  return (\n    <OTPFieldPrimitive.Input\n      data-slot=\"otp-field-input\"\n      className={cn(\n        \"atro-field-type h-[var(--atro-control-height,2.25rem)] w-[var(--atro-control-height,2.25rem)] shrink-0 rounded-[var(--atro-control-radius,var(--radius))] border border-border-subtle bg-background text-center text-base text-foreground tabular-nums outline-none transition-[border-color,box-shadow,background-color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] sm:text-sm\",\n        \"placeholder:text-muted-foreground\",\n        \"focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/20\",\n        \"data-filled:border-border\",\n        \"disabled:cursor-not-allowed disabled:opacity-50\",\n        \"aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20\",\n        \"data-invalid:border-destructive data-invalid:ring-2 data-invalid:ring-destructive/20\",\n        \"motion-reduce:transition-none\",\n        className\n      )}\n      render={\n        reduce\n          ? undefined\n          : (htmlProps) => (\n              <motion.input\n                {...withoutDomAnimationHandlers(\n                  htmlProps as Record<string, unknown>\n                )}\n                whileFocus={{ scale: 1.04 }}\n                transition={digitFocusTween}\n              />\n            )\n      }\n      {...props}\n    />\n  )\n}\n\nfunction OTPFieldSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof OTPFieldPrimitive.Separator>) {\n  return (\n    <OTPFieldPrimitive.Separator\n      data-slot=\"otp-field-separator\"\n      className={cn(\n        \"h-px w-2 shrink-0 bg-border-subtle data-[orientation=vertical]:h-4 data-[orientation=vertical]:w-px\",\n        className\n      )}\n      orientation=\"vertical\"\n      {...props}\n    />\n  )\n}\n\nexport { OTPField, OTPFieldInput, OTPFieldSeparator }\n",
      "type": "registry:ui",
      "target": "components/ui/otp-field.tsx"
    }
  ],
  "type": "registry:ui"
}