{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-bar",
  "title": "chart-bar",
  "description": "Animated chart-bar icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "chart-bar.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 ChartBarIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ChartBarIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst CREATE_BAR_VARIANTS = (delay: number): Variants => ({\n  normal: {\n    scaleY: 1,\n    opacity: 1,\n  },\n  animate: {\n    scaleY: [0, 1.1, 1],\n    opacity: [0, 1, 1],\n    transition: {\n      delay,\n      duration: 0.4,\n      ease: \"easeOut\",\n      opacity: { duration: 0.1, delay },\n    },\n  },\n});\n\nconst ChartBarIcon = forwardRef<ChartBarIconHandle, ChartBarIconProps>(\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=\"M3 13.125C3 12.5037 3.50368 12 4.125 12H6.375C6.99632 12 7.5 12.5037 7.5 13.125V19.875C7.5 20.4963 6.99632 21 6.375 21H4.125C3.50368 21 3 20.4963 3 19.875V13.125Z\"\n            initial=\"normal\"\n            style={{ originX: \"50%\", originY: \"100%\" }}\n            variants={CREATE_BAR_VARIANTS(0)}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M9.75 8.625C9.75 8.00368 10.2537 7.5 10.875 7.5H13.125C13.7463 7.5 14.25 8.00368 14.25 8.625V19.875C14.25 20.4963 13.7463 21 13.125 21H10.875C10.2537 21 9.75 20.4963 9.75 19.875V8.625Z\"\n            initial=\"normal\"\n            style={{ originX: \"50%\", originY: \"100%\" }}\n            variants={CREATE_BAR_VARIANTS(0.1)}\n          />\n          <motion.path\n            animate={controls}\n            d=\"M16.5 4.125C16.5 3.50368 17.0037 3 17.625 3H19.875C20.4963 3 21 3.50368 21 4.125V19.875C21 20.4963 20.4963 21 19.875 21H17.625C17.0037 21 16.5 20.4963 16.5 19.875V4.125Z\"\n            initial=\"normal\"\n            style={{ originX: \"50%\", originY: \"100%\" }}\n            variants={CREATE_BAR_VARIANTS(0.2)}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nChartBarIcon.displayName = \"ChartBarIcon\";\n\nexport { ChartBarIcon };\n",
      "type": "registry:ui"
    }
  ]
}
