{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "airplane",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "airplane.tsx",
      "content": "\"use client\";\n\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 AirplaneIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface AirplaneIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst SPEED_LINES = [\n  { x1: 5, y1: 15, x2: 1, y2: 19, delay: 0.1 },\n  { x1: 7, y1: 17, x2: 3, y2: 21, delay: 0.2 },\n  { x1: 9, y1: 19, x2: 5, y2: 23, delay: 0.3 },\n];\n\nconst AirplaneIcon = forwardRef<AirplaneIconHandle, AirplaneIconProps>(\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          className=\"overflow-visible\"\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=\"M17.8 19.2L16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z\"\n            transition={{\n              duration: 0.5,\n            }}\n            variants={{\n              normal: { x: 0, y: 0, scale: 1 },\n              animate: {\n                x: 3,\n                y: -3,\n                scale: 0.8,\n              },\n            }}\n          />\n          {SPEED_LINES.map((line, index) => (\n            <motion.line\n              animate={controls}\n              initial={{ opacity: 0, pathLength: 1, pathSpacing: 1 }}\n              key={index}\n              stroke=\"currentColor\"\n              strokeWidth=\"1\"\n              transition={{ duration: 0.15, delay: line.delay }}\n              variants={{\n                normal: {\n                  pathOffset: [0, 1],\n                  translateX: -3,\n                  translateY: 3,\n                  opacity: 0,\n                  transition: {\n                    duration: 0.3,\n                    times: [0, 0.6, 1],\n                  },\n                },\n                animate: {\n                  pathOffset: [1, 2],\n                  translateX: [0, 0],\n                  translateY: [0, 0],\n                  opacity: 1,\n                },\n              }}\n              x1={line.x1}\n              x2={line.x2}\n              y1={line.y1}\n              y2={line.y2}\n            />\n          ))}\n        </svg>\n      </div>\n    );\n  }\n);\n\nAirplaneIcon.displayName = \"AirplaneIcon\";\n\nexport { AirplaneIcon };\n",
      "type": "registry:ui"
    }
  ]
}
