{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "presence-field-demo",
  "title": "Presence Field Demo",
  "description": "A worked example of Presence Field: An ambient backdrop that carries what the assistant is doing. It changes colour and pace with the state, and settles into each one rather than snapping to it.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/presence-field.json"
  ],
  "files": [
    {
      "path": "components/demos/presence-field-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  PresenceField,\n  type AgentPresence,\n} from \"@/registry/default/presence-field/presence-field\"\n\nconst states: AgentPresence[] = [\n  \"idle\",\n  \"thinking\",\n  \"streaming\",\n  \"done\",\n  \"error\",\n]\n\nexport function PresenceFieldDemo() {\n  const [state, setState] = React.useState<AgentPresence>(\"thinking\")\n\n  return (\n    <div className=\"grid w-full max-w-xl gap-4\">\n      <PresenceField\n        state={state}\n        className=\"border-border rounded-[var(--radius)] border\"\n      >\n        <div className=\"px-8 py-16 text-center\">\n          <p className=\"text-sm font-semibold capitalize\">{state}</p>\n          <p className=\"text-muted-foreground mt-1 text-xs\">\n            The room changes with the assistant, and settles rather than snaps.\n          </p>\n        </div>\n      </PresenceField>\n\n      <div\n        role=\"group\"\n        aria-label=\"Assistant state\"\n        className=\"border-border bg-background/70 mx-auto inline-flex flex-wrap justify-center gap-1 rounded-full border p-1\"\n      >\n        {states.map((option) => (\n          <button\n            key={option}\n            type=\"button\"\n            aria-pressed={state === option}\n            className={\n              state === option\n                ? \"bg-foreground text-background rounded-full px-3 py-1.5 text-xs font-semibold capitalize\"\n                : \"text-muted-foreground hover:text-foreground rounded-full px-3 py-1.5 text-xs font-semibold capitalize\"\n            }\n            onClick={() => setState(option)}\n          >\n            {option}\n          </button>\n        ))}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}