{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "building-office",
  "title": "building-office",
  "description": "Animated building-office icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "building-office.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 BuildingOfficeIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface BuildingOfficeIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst FLOOR_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 FLOOR_LINES = [\n  { path: \"M9 12.75h1.5\", y: 12.75, index: 0 },\n  { path: \"M13.5 12.75H15\", y: 12.75, index: 0 },\n  { path: \"M9 9.75h1.5\", y: 9.75, index: 1 },\n  { path: \"M13.5 9.75H15\", y: 9.75, index: 1 },\n  { path: \"M9 6.75h1.5\", y: 6.75, index: 2 },\n  { path: \"M13.5 6.75H15\", y: 6.75, index: 2 },\n] as const;\n\nconst BuildingOfficeIcon = forwardRef<\n  BuildingOfficeIconHandle,\n  BuildingOfficeIconProps\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=\"M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21\" />\n        {FLOOR_LINES.map((floorLine, index) => {\n          return (\n            <motion.path\n              animate={controls}\n              custom={floorLine.index}\n              d={floorLine.path}\n              initial=\"normal\"\n              key={`${floorLine.y}-${index}`}\n              variants={FLOOR_VARIANTS}\n            />\n          );\n        })}\n      </svg>\n    </div>\n  );\n});\n\nBuildingOfficeIcon.displayName = \"BuildingOfficeIcon\";\n\nexport { BuildingOfficeIcon };\n",
      "type": "registry:ui"
    }
  ]
}
