{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "document-duplicate",
  "title": "document-duplicate",
  "description": "Animated document-duplicate icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "document-duplicate.tsx",
      "content": "\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface DocumentDuplicateIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface DocumentDuplicateIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst BACK_DOC_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    x: 0,\n    y: 0,\n  },\n  animate: {\n    opacity: [0, 1],\n    x: [-4, 0],\n    y: [4, 0],\n    transition: {\n      duration: 0.3,\n      ease: \"easeOut\",\n    },\n  },\n};\n\nconst DocumentDuplicateIcon = forwardRef<\n  DocumentDuplicateIconHandle,\n  DocumentDuplicateIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n  const controls = useAnimation();\n  const isControlledRef = useRef(false);\n\n  useImperativeHandle(ref, () => {\n    isControlledRef.current = true;\n\n    return {\n      startAnimation: () => controls.start(\"animate\"),\n      stopAnimation: () => controls.start(\"normal\"),\n    };\n  });\n\n  const handleMouseEnter = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseEnter?.(e);\n      } else {\n        controls.start(\"animate\");\n      }\n    },\n    [controls, onMouseEnter]\n  );\n\n  const handleMouseLeave = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseLeave?.(e);\n      } else {\n        controls.start(\"normal\");\n      }\n    },\n    [controls, onMouseLeave]\n  );\n\n  return (\n    <div\n      className={cn(className)}\n      onMouseEnter={handleMouseEnter}\n      onMouseLeave={handleMouseLeave}\n      {...props}\n    >\n      <svg\n        fill=\"none\"\n        height={size}\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.5\"\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <motion.path\n          animate={controls}\n          d=\"M15.75 17.25V20.625C15.75 21.2463 15.2463 21.75 14.625 21.75H4.875C4.25368 21.75 3.75 21.2463 3.75 20.625V7.875C3.75 7.25368 4.25368 6.75 4.875 6.75H6.75C7.26107 6.75 7.76219 6.7926 8.25 6.87444\"\n          initial=\"normal\"\n          variants={BACK_DOC_VARIANTS}\n        />\n        <path d=\"M15.75 17.25H19.125C19.7463 17.25 20.25 16.7463 20.25 16.125V11.25C20.25 6.79051 17.0066 3.08855 12.75 2.37444C12.2622 2.2926 11.7611 2.25 11.25 2.25H9.375C8.75368 2.25 8.25 2.75368 8.25 3.375V6.87444M15.75 17.25H9.375C8.75368 17.25 8.25 16.7463 8.25 16.125V6.87444\" />\n        <path d=\"M20.25 13.5V11.625C20.25 9.76104 18.739 8.25 16.875 8.25H15.375C14.7537 8.25 14.25 7.74632 14.25 7.125V5.625C14.25 3.76104 12.739 2.25 10.875 2.25H9.75\" />\n      </svg>\n    </div>\n  );\n});\n\nDocumentDuplicateIcon.displayName = \"DocumentDuplicateIcon\";\n\nexport { DocumentDuplicateIcon };\n",
      "type": "registry:ui"
    }
  ]
}
