{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "connection-beam-demo",
  "title": "Connection Beam Demo",
  "description": "A worked example of Connection Beam: A line between two elements with something travelling along it, measured from the elements rather than given as coordinates.",
  "dependencies": [
    "lucide-react@^1.31.0"
  ],
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/connection-beam.json"
  ],
  "files": [
    {
      "path": "components/demos/connection-beam-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Braces, Bot, Database, FileText, Globe } from \"lucide-react\"\n\nimport { ConnectionBeam } from \"@/registry/default/connection-beam/connection-beam\"\n\nfunction Node({\n  icon,\n  label,\n  ref: nodeRef,\n}: {\n  icon: React.ReactNode\n  label: string\n  ref: React.RefObject<HTMLDivElement | null>\n}) {\n  return (\n    <div\n      ref={nodeRef}\n      className=\"border-border bg-background text-muted-foreground z-10 flex size-11 items-center justify-center rounded-full border shadow-sm\"\n      title={label}\n    >\n      {icon}\n      <span className=\"sr-only\">{label}</span>\n    </div>\n  )\n}\n\nexport function ConnectionBeamDemo() {\n  const container = React.useRef<HTMLDivElement>(null)\n  const agent = React.useRef<HTMLDivElement>(null)\n  const docs = React.useRef<HTMLDivElement>(null)\n  const db = React.useRef<HTMLDivElement>(null)\n  const web = React.useRef<HTMLDivElement>(null)\n  const out = React.useRef<HTMLDivElement>(null)\n\n  return (\n    <div\n      ref={container}\n      className=\"relative flex w-full max-w-lg items-center justify-between gap-6 p-6\"\n    >\n      <div className=\"flex flex-col gap-6\">\n        <Node ref={docs} icon={<FileText size={17} />} label=\"Documents\" />\n        <Node ref={db} icon={<Database size={17} />} label=\"Database\" />\n        <Node ref={web} icon={<Globe size={17} />} label=\"Web search\" />\n      </div>\n\n      <Node ref={agent} icon={<Bot size={19} />} label=\"Agent\" />\n\n      <Node ref={out} icon={<Braces size={17} />} label=\"Structured output\" />\n\n      <ConnectionBeam\n        containerRef={container}\n        fromRef={docs}\n        toRef={agent}\n        curvature={-24}\n      />\n      <ConnectionBeam\n        containerRef={container}\n        fromRef={db}\n        toRef={agent}\n        curvature={0}\n        delay={0.6}\n      />\n      <ConnectionBeam\n        containerRef={container}\n        fromRef={web}\n        toRef={agent}\n        curvature={24}\n        delay={1.2}\n      />\n      <ConnectionBeam\n        containerRef={container}\n        fromRef={agent}\n        toRef={out}\n        curvature={0}\n        delay={1.8}\n        beamColor=\"--chart-2\"\n      />\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}