{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cup-soda",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "cup-soda.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\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface CupSodaIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CupSodaIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst STRAW_VARIANTS: Variants = {\n  normal: {\n    y: 0,\n    scaleY: 1,\n    transition: {\n      duration: 0.25,\n      ease: \"easeOut\",\n    },\n  },\n  animate: {\n    y: [0, -0.85, 0.15, 0],\n    scaleY: [1, 1.06, 0.99, 1],\n    transition: {\n      duration: 0.5,\n      ease: [0.34, 1.56, 0.64, 1],\n      times: [0, 0.35, 0.65, 1],\n    },\n  },\n};\n\nconst WAVE_VARIANTS: Variants = {\n  normal: {\n    y: 0,\n    transition: {\n      duration: 0.25,\n      ease: \"easeOut\",\n    },\n  },\n  animate: {\n    y: [0, -1, 0],\n    transition: {\n      duration: 1.8,\n      repeat: Number.POSITIVE_INFINITY,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst BUBBLE_VARIANTS: Variants = {\n  normal: { opacity: 0, y: 0, scale: 1 },\n  animate: (delay: number) => ({\n    opacity: [0, 0.9, 0.4, 0],\n    y: [0, -3, -10, -14],\n    scale: [1, 1, 0.85, 0.6],\n    transition: {\n      duration: 1.5,\n      ease: \"easeIn\",\n      delay,\n      repeat: Number.POSITIVE_INFINITY,\n      repeatDelay: 0,\n      times: [0, 0.08, 0.7, 1],\n    },\n  }),\n};\n\nconst BUBBLES = [\n  { delay: 0, cx: 8.25, cy: 20.5, r: 0.75 },\n  { delay: 0.35, cx: 11.25, cy: 19.5, r: 0.6 },\n  { delay: 0.7, cx: 14, cy: 20.75, r: 0.6 },\n  { delay: 1.05, cx: 9.75, cy: 19, r: 0.75 },\n  { delay: 0.55, cx: 12.5, cy: 20, r: 0.45 },\n] as const;\n\nconst CupSodaIcon = forwardRef<CupSodaIconHandle, CupSodaIconProps>(\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(\"relative\", 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          <path d=\"m6 8 1.75 12.28a2 2 0 0 0 2 1.72h4.54a2 2 0 0 0 2-1.72L18 8\" />\n          <path d=\"M5 8h14\" />\n          <motion.path\n            animate={controls}\n            d=\"M7 15a6.47 6.47 0 0 1 5 0 6.47 6.47 0 0 0 5 0\"\n            variants={WAVE_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"m12 8 1-6h2\"\n            style={{\n              transformBox: \"fill-box\",\n              originX: \"50%\",\n              originY: \"100%\",\n            }}\n            variants={STRAW_VARIANTS}\n          />\n          {BUBBLES.map((b, i) => (\n            <motion.circle\n              animate={controls}\n              custom={b.delay}\n              cx={b.cx}\n              cy={b.cy}\n              fill=\"currentColor\"\n              initial=\"normal\"\n              key={i}\n              r={b.r}\n              stroke=\"none\"\n              style={{\n                transformBox: \"fill-box\",\n                originX: \"50%\",\n                originY: \"50%\",\n              }}\n              variants={BUBBLE_VARIANTS}\n            />\n          ))}\n        </svg>\n      </div>\n    );\n  }\n);\n\nCupSodaIcon.displayName = \"CupSodaIcon\";\n\nexport { CupSodaIcon };\n",
      "type": "registry:ui"
    }
  ]
}
