{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "morphing-download-icon",
  "title": "Morphing Download Icon",
  "author": "STARCK",
  "description": "An Apple-to-download icon transition for Mac download actions.",
  "dependencies": [
    "framer-motion@^11.0.0",
    "flubber@^0.4.2",
    "@types/flubber@^0.4.0"
  ],
  "files": [
    {
      "path": "registry/default/morphing-download-icon.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useMemo } from \"react\"\nimport { animate, motion, useMotionValue, useTransform } from \"framer-motion\"\nimport { interpolateAll as flubberInterpolateAll } from \"flubber\"\n\nconst APPLE_BODY =\n  \"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09z\"\nconst APPLE_LEAF =\n  \"M12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z\"\nconst DOWNLOAD_ARROW = \"M10 3 L14 3 L14 11 L17 11 L12 17 L7 11 L10 11 Z\"\nconst DOWNLOAD_TRAY = \"M4 19 L20 19 L20 21 L4 21 Z\"\n\ntype MorphingDownloadIconProps = {\n  className?: string\n  hover: boolean\n}\n\nfunction MorphingDownloadIcon({\n  className = \"size-4\",\n  hover,\n}: MorphingDownloadIconProps) {\n  const [arrowInterpolator, trayInterpolator] = useMemo(\n    () =>\n      flubberInterpolateAll(\n        [APPLE_BODY, APPLE_LEAF],\n        [DOWNLOAD_ARROW, DOWNLOAD_TRAY],\n        { maxSegmentLength: 2 }\n      ) as unknown as [(value: number) => string, (value: number) => string],\n    []\n  )\n  const progress = useMotionValue(0)\n  const arrowPath = useTransform(progress, (value) => arrowInterpolator(value))\n  const trayPath = useTransform(progress, (value) => trayInterpolator(value))\n  const y = useTransform(progress, (value) => value * 1.5)\n\n  useEffect(() => {\n    const controls = animate(progress, hover ? 1 : 0, {\n      duration: 0.32,\n      ease: [0.22, 1, 0.36, 1],\n    })\n    return () => controls.stop()\n  }, [hover, progress])\n\n  return (\n    <motion.svg\n      viewBox=\"0 0 24 24\"\n      fill=\"currentColor\"\n      className={className}\n      style={{ y }}\n      aria-hidden=\"true\"\n    >\n      <motion.path d={arrowPath} />\n      <motion.path d={trayPath} />\n    </motion.svg>\n  )\n}\n\nexport { MorphingDownloadIcon }\nexport type { MorphingDownloadIconProps }\n",
      "type": "registry:component",
      "target": "components/morphing-download-icon.tsx"
    }
  ],
  "type": "registry:component"
}