{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "party-popper",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "party-popper.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 PartyPopperIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface PartyPopperIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst LINES_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    pathLength: 1,\n    scale: 1,\n    translateX: 0,\n    translateY: 0,\n  },\n  animate: {\n    opacity: [0, 1],\n    scale: [0.3, 0.8, 1, 1.1, 1],\n    pathLength: [0, 0.5, 1],\n    translateX: [-5, 0],\n    translateY: [5, 0],\n    transition: {\n      duration: 0.7,\n      velocity: 0.3,\n    },\n  },\n};\n\nconst DOTS_VARIANTS: Variants = {\n  normal: { opacity: 1, scale: 1, translateX: 0, translateY: 0 },\n  animate: {\n    opacity: [0, 1],\n    translateX: [-5, 0],\n    translateY: [5, 0],\n    scale: [0.5, 0.8, 1, 1.1, 1],\n    transition: {\n      duration: 0.7,\n    },\n  },\n};\n\nconst POPPER_VARIANTS: Variants = {\n  normal: { translateX: 0, translateY: 0 },\n  animate: {\n    translateX: [-1.5, 0],\n    translateY: [1.5, 0],\n    transition: {\n      velocity: 0.3,\n    },\n  },\n};\n\nconst PartyPopperIcon = forwardRef<PartyPopperIconHandle, PartyPopperIconProps>(\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            d=\"M5.8 11.3 2 22l10.7-3.79\"\n            variants={POPPER_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\"\n            variants={POPPER_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M4 3h.01\"\n            variants={DOTS_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M22 8h.01\"\n            variants={DOTS_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M15 2h.01\"\n            variants={DOTS_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M22 20h.01\"\n            variants={DOTS_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"m14 10 1.21-1.06c0.16-0.84 0.9-1.44 1.76-1.44h0.38c0.88 0 1.55-0.77 1.45-1.63a2.9 2.9 0 0 1 1.96-3.12L22 2\"\n            variants={LINES_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M17 15h0.77c0.71 0 1.32-0.52 1.43-1.22c0.16-0.91 1.12-1.45 1.98-1.11L22 13\"\n            variants={LINES_VARIANTS}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M9 7V6.23c0-0.71 0.52-1.33 1.22-1.43c0.91-0.16 1.45-1.12 1.11-1.98L11 2\"\n            variants={LINES_VARIANTS}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nPartyPopperIcon.displayName = \"PartyPopperIcon\";\n\nexport { PartyPopperIcon };\n",
      "type": "registry:ui"
    }
  ]
}
