{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "divide",
  "title": "divide",
  "description": "Animated divide icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "divide.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\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface DivideIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface DivideIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst LINE_VARIANTS: Variants = {\n  normal: { scaleX: 1 },\n  animate: {\n    scaleX: [1, 1.1, 1],\n    transition: {\n      duration: 0.4,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst TOP_DOT_VARIANTS: Variants = {\n  normal: { y: 0 },\n  animate: {\n    y: [0, -2, 0],\n    transition: {\n      duration: 0.4,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst BOTTOM_DOT_VARIANTS: Variants = {\n  normal: { y: 0 },\n  animate: {\n    y: [0, 2, 0],\n    transition: {\n      duration: 0.4,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst DivideIcon = forwardRef<DivideIconHandle, DivideIconProps>(\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=\"1.5\"\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=\"M4.49902 11.9983H19.4987\"\n            initial=\"normal\"\n            variants={LINE_VARIANTS}\n          />\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            variants={TOP_DOT_VARIANTS}\n          >\n            <path d=\"M11.9992 5.24808H12.0067V5.25558H11.9992V5.24808Z\" />\n            <path d=\"M12.3742 5.24808C12.3742 5.45521 12.2063 5.62312 11.9992 5.62312C11.7921 5.62312 11.6242 5.45521 11.6242 5.24808C11.6242 5.04096 11.7921 4.87305 11.9992 4.87305C12.2063 4.87305 12.3742 5.04096 12.3742 5.24808Z\" />\n          </motion.g>\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            variants={BOTTOM_DOT_VARIANTS}\n          >\n            <path d=\"M11.9998 18.7509H12.0073V18.7584H11.9998V18.7509Z\" />\n            <path d=\"M12.3748 18.7509C12.3748 18.9581 12.2069 19.126 11.9998 19.126C11.7927 19.126 11.6248 18.9581 11.6248 18.7509C11.6248 18.5438 11.7927 18.3759 11.9998 18.3759C12.2069 18.3759 12.3748 18.5438 12.3748 18.7509Z\" />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nDivideIcon.displayName = \"DivideIcon\";\n\nexport { DivideIcon };\n",
      "type": "registry:ui"
    }
  ]
}
