{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "arrows-up-down",
  "title": "arrows-up-down",
  "description": "Animated arrows-up-down icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "arrows-up-down.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 ArrowsUpDownIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface ArrowsUpDownIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst UP_ARROW_VARIANTS: Variants = {\n  normal: { translateY: 0 },\n  animate: {\n    translateY: [0, -2, 0],\n    transition: {\n      duration: 0.5,\n      times: [0, 0.4, 1],\n    },\n  },\n};\n\nconst DOWN_ARROW_VARIANTS: Variants = {\n  normal: { translateY: 0 },\n  animate: {\n    translateY: [0, 2, 0],\n    transition: {\n      duration: 0.5,\n      times: [0, 0.4, 1],\n    },\n  },\n};\n\nconst ArrowsUpDownIcon = forwardRef<\n  ArrowsUpDownIconHandle,\n  ArrowsUpDownIconProps\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) controls.start(\"animate\");\n      onMouseEnter?.(e);\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.g animate={controls} variants={UP_ARROW_VARIANTS}>\n          <path d=\"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5\" />\n        </motion.g>\n        <motion.g animate={controls} variants={DOWN_ARROW_VARIANTS}>\n          <path d=\"M21 16.5L16.5 21m0 0L12 16.5m4.5 4.5V7.5\" />\n        </motion.g>\n      </svg>\n    </div>\n  );\n});\n\nArrowsUpDownIcon.displayName = \"ArrowsUpDownIcon\";\n\nexport { ArrowsUpDownIcon };\n",
      "type": "registry:ui"
    }
  ]
}
