{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "chat-composer", "type": "registry:component", "title": "Chat", "description": "Tabbed chat panel with reasoning replies and a composer.", "registryDependencies": [ "https://www.beautifului.dev/r/foundation.json" ], "files": [ { "path": "components/primitives/ChatComposer.tsx", "content": "\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\n\n/* ─────────────────────────────────────────────────────────\n * CHAT — interactive panel with tabs, replies, and composer.\n * The reply sequence begins only after the user sends.\n * ───────────────────────────────────────────────────────── */\n\ntype Phase = \"idle\" | \"sent\" | \"reply1\" | \"reply2\" | \"done\";\n\n/* one scripted agent reply in the thread */\nexport type ChatMessage = {\n label: string;\n sub: string;\n time: string;\n body: string;\n};\n\nconst MESSAGES: ChatMessage[] = [\n {\n label: \"Sales History\",\n sub: \"Flavor Data\",\n time: \"4s\",\n body: \"Pulled 3 summers of mint chip sales for comparison.\",\n },\n {\n label: \"Comparison\",\n sub: \"Trend Detection\",\n time: \"2s\",\n body: \"Mint chip is up 12% with stronger weekend peaks.\",\n },\n];\n\nconst SUGGESTIONS = [\"Flavors\", \"Suppliers\"];\n\nexport type ChatComposerLabels = {\n /** the pre-filled prompt shown in the first user bubble */\n initialPrompt: string;\n /** composer input placeholder */\n placeholder: string;\n};\n\nconst DEFAULT_LABELS: ChatComposerLabels = {\n initialPrompt: \"Compare mint chip to last summer\",\n placeholder: \"Prompt or tag a flavor with @\",\n};\n\nfunction Section({\n label,\n sub,\n time,\n body,\n resolving,\n}: {\n label: string;\n sub: string;\n time: string;\n body: string;\n resolving?: boolean;\n}) {\n return (\n
{body}
\n