{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rectangle-group",
  "title": "rectangle-group",
  "description": "Animated rectangle-group icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "rectangle-group.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 RectangleGroupIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface RectangleGroupIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst RECT_VARIANTS = (delay: number): Variants => ({\n  normal: {\n    scale: 1,\n    opacity: 1,\n  },\n  animate: {\n    scale: [0.9, 1.05, 1],\n    opacity: [0.5, 1, 1],\n    transition: {\n      delay,\n      duration: 0.3,\n      ease: \"easeOut\",\n    },\n  },\n});\n\nconst RectangleGroupIcon = forwardRef<\n  RectangleGroupIconHandle,\n  RectangleGroupIconProps\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=\"M2.25 7.125C2.25 6.50368 2.75368 6 3.375 6H9.375C9.99632 6 10.5 6.50368 10.5 7.125V10.875C10.5 11.4963 9.99632 12 9.375 12H3.375C2.75368 12 2.25 11.4963 2.25 10.875V7.125Z\"\n          initial=\"normal\"\n          variants={RECT_VARIANTS(0)}\n        />\n        <motion.path\n          animate={controls}\n          d=\"M14.25 8.625C14.25 8.00368 14.7537 7.5 15.375 7.5H20.625C21.2463 7.5 21.75 8.00368 21.75 8.625V16.875C21.75 17.4963 21.2463 18 20.625 18H15.375C14.7537 18 14.25 17.4963 14.25 16.875V8.625Z\"\n          initial=\"normal\"\n          variants={RECT_VARIANTS(0.1)}\n        />\n        <motion.path\n          animate={controls}\n          d=\"M3.75 16.125C3.75 15.5037 4.25368 15 4.875 15H10.125C10.7463 15 11.25 15.5037 11.25 16.125V18.375C11.25 18.9963 10.7463 19.5 10.125 19.5H4.875C4.25368 19.5 3.75 18.9963 3.75 18.375V16.125Z\"\n          initial=\"normal\"\n          variants={RECT_VARIANTS(0.2)}\n        />\n      </svg>\n    </div>\n  );\n});\n\nRectangleGroupIcon.displayName = \"RectangleGroupIcon\";\n\nexport { RectangleGroupIcon };\n",
      "type": "registry:ui"
    }
  ]
}
