{
  "name": "staircase",
  "title": "Staircase",
  "type": "registry:component",
  "description": "Stepped staircase with per-step colliders.",
  "dependencies": [
    "@react-three/rapier@^2.2.0",
    "@runek/core@^0.12.0"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "Staircase.tsx",
      "content": "import { RigidBody } from '@react-three/rapier'\nimport { useWorld, type Vec3 } from '@runek/core'\n\nexport interface StaircaseProps {\n  position?: Vec3\n  rotation?: Vec3\n  steps?: number\n  /** Total rise, in units. Ascends along +y and +z from the origin. */\n  totalHeight?: number\n  width?: number\n  /** Total run (depth), in units. */\n  depth?: number\n  /** Defaults to the world palette's `stone` slot. */\n  color?: string\n}\n\nexport function Staircase({\n  position = [0, 0, 0],\n  rotation = [0, 0, 0],\n  steps = 6,\n  totalHeight = 1.5,\n  width = 1.2,\n  depth = 2.4,\n  color,\n}: StaircaseProps) {\n  const { unit, palette } = useWorld()\n  const stoneColor = color ?? palette.stone\n  const w = width * unit\n  const rise = (totalHeight * unit) / steps\n  const run = (depth * unit) / steps\n\n  return (\n    <RigidBody type=\"fixed\" colliders=\"cuboid\" position={position} rotation={rotation}>\n      {Array.from({ length: steps }, (_, i) => {\n        const h = rise * (i + 1)\n        return (\n          <mesh\n            key={`step-${h.toFixed(4)}`}\n            castShadow\n            receiveShadow\n            position={[0, h / 2, run * (i + 0.5)]}\n          >\n            <boxGeometry args={[w, h, run]} />\n            <meshStandardMaterial color={stoneColor} />\n          </mesh>\n        )\n      })}\n    </RigidBody>\n  )\n}\n",
      "type": "registry:component"
    }
  ]
}
