{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "archive-box",
  "title": "archive-box",
  "description": "Animated archive-box icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "archive-box.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 ArchiveBoxIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ArchiveBoxIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst LID_VARIANTS: Variants = {\n  normal: {\n    translateY: 0,\n    transition: {\n      duration: 0.2,\n      type: \"spring\",\n      stiffness: 200,\n      damping: 25,\n    },\n  },\n  animate: {\n    translateY: -1.5,\n    transition: {\n      duration: 0.2,\n      type: \"spring\",\n      stiffness: 200,\n      damping: 25,\n    },\n  },\n};\n\nconst PATH_VARIANTS: Variants = {\n  normal: {\n    translateY: 0,\n    transition: {\n      duration: 0.2,\n      type: \"spring\",\n      stiffness: 200,\n      damping: 25,\n    },\n  },\n  animate: {\n    translateY: 1,\n    transition: {\n      duration: 0.2,\n      type: \"spring\",\n      stiffness: 200,\n      damping: 25,\n    },\n  },\n};\n\nconst ArchiveBoxIcon = forwardRef<ArchiveBoxIconHandle, ArchiveBoxIconProps>(\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=\"M19.6246 18.1321C19.5546 19.3214 18.5698 20.25 17.3785 20.25H6.62154C5.43022 20.25 4.44538 19.3214 4.37542 18.1321\"\n            initial=\"normal\"\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M20.25 7.5L19.6246 18.1321\"\n            initial=\"normal\"\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M3.75 7.5L4.37542 18.1321\"\n            initial=\"normal\"\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M9.99976 11.25H13.9998\"\n            initial=\"normal\"\n            variants={PATH_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M3.375 7.5H20.625C21.2463 7.5 21.75 6.99632 21.75 6.375V4.875C21.75 4.25368 21.2463 3.75 20.625 3.75H3.375C2.75368 3.75 2.25 4.25368 2.25 4.875V6.375C2.25 6.99632 2.75368 7.5 3.375 7.5Z\"\n            initial=\"normal\"\n            variants={LID_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nArchiveBoxIcon.displayName = \"ArchiveBoxIcon\";\n\nexport { ArchiveBoxIcon };\n",
      "type": "registry:ui"
    }
  ]
}
