{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "animated-copy-button",
  "title": "Animated Copy Button",
  "description": "A copy button that animates between idle and copied states.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/corr/components/animated-copy-button.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Check, Copy } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { cn } from \"@/lib/utils\"\n\nexport function AnimatedCopyButton({\n  value,\n  label = \"Copy\",\n  copiedLabel = \"Copied\",\n  resetDelay = 1200,\n  icon,\n  onCopy,\n  className,\n  variant = \"outline\",\n  ...props\n}: {\n  value: string\n  label?: string\n  copiedLabel?: string\n  resetDelay?: number\n  icon?: React.ReactNode\n  onCopy?: () => void\n} & Omit<\n  React.ComponentProps<typeof Button>,\n  \"children\" | \"onClick\" | \"type\"\n>) {\n  const [copied, setCopied] = React.useState(false)\n\n  async function copy() {\n    await navigator.clipboard.writeText(value)\n    setCopied(true)\n    onCopy?.()\n    window.setTimeout(() => setCopied(false), resetDelay)\n  }\n\n  return (\n    <Button\n      type=\"button\"\n      variant={variant}\n      onClick={copy}\n      className={cn(\"min-w-24\", className)}\n      {...props}\n    >\n      <span className=\"inline-flex items-center gap-1.5\">\n        <span\n          className=\"t-icon-swap inline-grid size-3.5 shrink-0 place-items-center\"\n          data-state={copied ? \"b\" : \"a\"}\n          aria-hidden=\"true\"\n        >\n          <span className=\"t-icon inline-flex size-3.5 items-center justify-center\" data-icon=\"a\">\n            {icon ?? <Copy className=\"size-3.5\" />}\n          </span>\n          <span className=\"t-icon inline-flex size-3.5 items-center justify-center\" data-icon=\"b\">\n            <Check className=\"size-3.5\" />\n          </span>\n        </span>\n        {copied ? copiedLabel : label}\n      </span>\n    </Button>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}