{
  "component": {
    "id": "chat-thread",
    "name": "Chat thread",
    "tier": "pro",
    "exampleId": "chat-thread",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/chat-thread-demo.tsx",
    "exportName": "ChatThreadDemo",
    "sha256": "d666f53f90ac11e5383c7bc2025d7402e172efeb8e09405d05be22d9784c7eb9",
    "helperImports": [],
    "directComponentImports": [
      "chat-thread"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/chat-thread",
    "registryUrl": "https://tidalui.com/r/pro/chat-thread.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/chat-thread",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/chat-thread",
      "registryUrl": "https://tidalui.com/r/pro/chat-thread.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/chat-thread.tsx",
    "exports": [
      "TidalChatMessage",
      "TidalChatThread"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/chat-thread.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "https://tidalui.com/r/tidal-button.json"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "chat-thread",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/chat-thread.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/chat-thread.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/chat-thread-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalChatThread, type TidalChatMessage } from \"./components/ui/chat-thread\";\n\nimport \"./components/ui/chat-thread.css\";\n\nfunction tidalExampleAvatarDataUri(seed: unknown) {\n  const text = String(seed).replace(/[^a-z0-9]/gi, \"\").slice(-2) || \"UI\";\n  const palette = [\"#333333\", \"#555555\", \"#777777\", \"#999999\", \"#bbbbbb\"];\n  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\"><rect width=\"96\" height=\"96\" rx=\"48\" fill=\"${color}\"/><circle cx=\"48\" cy=\"38\" r=\"17\" fill=\"white\" fill-opacity=\".92\"/><path d=\"M18 92c3-22 15-34 30-34s27 12 30 34\" fill=\"white\" fill-opacity=\".92\"/></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nfunction tidalExampleImageDataUri(label: string) {\n  const safeLabel = label.replace(/[<>&]/g, \"\").slice(0, 28) || \"Sample image\";\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1200 675\"><defs><linearGradient id=\"g\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\"><stop stop-color=\"#171717\"/><stop offset=\"1\" stop-color=\"#555555\"/></linearGradient></defs><rect width=\"1200\" height=\"675\" fill=\"url(#g)\"/><circle cx=\"950\" cy=\"100\" r=\"260\" fill=\"white\" fill-opacity=\".08\"/><text x=\"80\" y=\"570\" fill=\"white\" font-family=\"system-ui,sans-serif\" font-size=\"64\" font-weight=\"700\">${safeLabel}</text></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nconst tidalExampleStyles = \".tidal-scope .chat-thread-demo {\\n  width: min(100%, 660px);\\n  min-width: 0;\\n}\\n.tidal-scope .chat-thread-demo-controls {\\n  display: flex;\\n  flex-wrap: wrap;\\n  gap: 8px;\\n  margin-bottom: 14px;\\n}\\n.tidal-scope .chat-thread-demo-controls > button {\\n  min-height: 44px;\\n  padding: 9px 13px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  border: 1px solid var(--t-border);\\n  border-radius: 9px;\\n  font: inherit;\\n  font-size: 12px;\\n}\\n.tidal-scope .chat-thread-demo > p {\\n  margin: 14px 2px 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.6;\\n}\";\n\nconst initial: TidalChatMessage[] = [\n  {\n    id: \"one\",\n    author: \"Avery\",\n    outgoing: true,\n    timestamp: \"9:41 AM\",\n    avatar: <img src={tidalExampleAvatarDataUri(\"01\")} alt=\"\" />,\n    content: \"Could you check the new account settings before launch?\",\n    deliveryText: \"Read\",\n  },\n  {\n    id: \"two\",\n    author: \"Mila\",\n    timestamp: \"9:42 AM\",\n    avatar: <img src={tidalExampleAvatarDataUri(\"03\")} alt=\"\" />,\n    content:\n      \"The form looks good. I checked the mobile layout and keyboard controls.\",\n  },\n  {\n    id: \"three\",\n    author: \"Avery\",\n    outgoing: true,\n    timestamp: \"9:43 AM\",\n    avatar: <img src={tidalExampleAvatarDataUri(\"01\")} alt=\"\" />,\n    content: \"Thanks. I'll add those checks to the release notes.\",\n    deliveryText: \"Delivered\",\n  },\n];\n\nexport function ChatThreadDemo() {\n  const [messages, setMessages] = useState(initial);\n  return (\n    <div className=\"chat-thread-demo\">\n      <div className=\"chat-thread-demo-controls\">\n        <button\n          type=\"button\"\n          onClick={() =>\n            setMessages((old) => [\n              ...old,\n              {\n                id: `reply-${old.length}`,\n                author: \"Mila\",\n                timestamp: \"9:44 AM\",\n                content: \"The updated release notes are ready for review.\",\n              },\n            ])\n          }\n        >\n          Add sample reply\n        </button>\n        <button type=\"button\" onClick={() => setMessages(initial)}>\n          Reset\n        </button>\n      </div>\n      <TidalChatThread\n        label=\"Project conversation\"\n        messages={messages}\n        maxHeight={420}\n      />\n      <p>Local sample messages. Nothing is sent.</p>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <ChatThreadDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/chat-thread.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "messages",
      "type": "inferred-from-existing-demo",
      "initial": "initial",
      "setter": "setMessages",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
