{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "building-office-2",
  "title": "building-office-2",
  "description": "Animated building-office-2 icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "building-office-2.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 BuildingOffice2IconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface BuildingOffice2IconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst WINDOW_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n  },\n  animate: (custom: number) => ({\n    opacity: [0, 1],\n    transition: {\n      duration: 0.3,\n      ease: \"linear\",\n      delay: 0.1 + custom * 0.15,\n    },\n  }),\n};\n\nconst WINDOWS = [\n  { path: \"M6.75 12.75h.75\", index: 0 },\n  { path: \"M6.75 9.75h.75\", index: 1 },\n  { path: \"M6.75 6.75h.75\", index: 2 },\n  { path: \"M10.5 12.75h.75\", index: 0 },\n  { path: \"M10.5 9.75h.75\", index: 1 },\n  { path: \"M10.5 6.75h.75\", index: 2 },\n  { path: \"M17.25 17h.008v.008h-.008v-.008Z\", index: 0 },\n  { path: \"M17.25 14h.008v.008h-.008v-.008Z\", index: 1 },\n  { path: \"M17.25 11h.008v.008h-.008v-.008Z\", index: 2 },\n] as const;\n\nconst BuildingOffice2Icon = forwardRef<\n  BuildingOffice2IconHandle,\n  BuildingOffice2IconProps\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        <path d=\"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21\" />\n        {WINDOWS.map((window, index) => {\n          return (\n            <motion.path\n              animate={controls}\n              custom={window.index}\n              d={window.path}\n              initial=\"normal\"\n              key={`${window.path}-${index}`}\n              variants={WINDOW_VARIANTS}\n            />\n          );\n        })}\n      </svg>\n    </div>\n  );\n});\n\nBuildingOffice2Icon.displayName = \"BuildingOffice2Icon\";\n\nexport { BuildingOffice2Icon };\n",
      "type": "registry:ui"
    }
  ]
}
