{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "banana",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "banana.tsx",
      "content": "\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface BananaIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface BananaIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst TRANSITION: Transition = {\n  duration: 0.3,\n  delay: 0.1,\n  opacity: { delay: 0.15 },\n};\n\nconst VARIANTS: Variants = {\n  normal: {\n    pathLength: 1,\n    opacity: 1,\n  },\n  animate: (custom: number) => ({\n    pathLength: [0, 1],\n    opacity: [0, 1],\n    transition: {\n      delay: custom * 0.1,\n    },\n  }),\n};\n\nconst BananaIcon = forwardRef<BananaIconHandle, BananaIconProps>(\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=\"2\"\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            custom={2}\n            d=\"M4 13c3.5-2 8-2 10 2a5.5 5.5 0 0 1 8 5\"\n            transition={TRANSITION}\n            variants={VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            custom={0}\n            d=\"M5.15 17.89c5.52-1.52 8.65-6.89 7-12C11.55 4 11.5 2 13 2c3.22 0 5 5.5 5 8 0 6.5-4.2 12-10.49 12C5.11 22 2 22 2 20c0-1.5 1.14-1.55 3.15-2.11Z\"\n            transition={TRANSITION}\n            variants={VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nBananaIcon.displayName = \"BananaIcon\";\n\nexport { BananaIcon };\n",
      "type": "registry:ui"
    }
  ]
}
