import type { ExampleUsage, StoryUsage } from './types'; /** * ChatGPT Style — compact vertical panel with avatar-led assistant rows * and right-aligned user bubbles, scaled to embed inside a larger page. */ const chatGptStyle: StoryUsage = { intro: 'Use **Chat Panel Layout** when the chat lives *inside* a larger page — a sidebar, a drawer, or a companion panel (e.g. ChatGPT-style). The panel is a fixed-size flex column: a header strip, a scrollable `ChatContainer` for the thread, and a `PromptInput` footer. Assistant messages lead with an avatar and use transparent-background markdown prose; user messages are right-aligned pills. Contrast with **Centered Conversation** (the chat *is* the page) and **Docked Widget** (a floating overlay).', snippets: { html: `
Chat Panel GPT-4o Mini
Hi there! How can I help?
What is this about?
`, react: `import { useState } from 'react'; import { ChatConfig, ChatContainer, Message, MessageAvatar, MessageContent, MessageActions, PromptInput, PromptInputTextarea, PromptInputActions, Button, } from '@kitn.ai/chat/react'; /** * Chat Panel Layout — compact vertical panel for embedding inside a page. * Avatar-led assistant rows, right-aligned user bubbles, composer footer. */ export function ChatPanel() { const [input, setInput] = useState(''); return (
{/* Panel header */}
Chat Panel GPT-4o Mini
{/* Scrollable thread */} {/* Assistant message — avatar + transparent prose */}
Hi there! How can I help?
{/* User message — right-aligned pill */} What is this about?
{/* Composer footer */}
setInput('')}>
); }`, vue: ` `, svelte: `
Chat Panel GPT-4o Mini
Hi there! How can I help?
What is this about?
(input = e.detail.value)} on:kc-submit={() => (input = '')} >
`, angular: `// main.ts: import '@kitn.ai/chat/elements' before bootstrapApplication, // and add CUSTOM_ELEMENTS_SCHEMA to the component. import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; /** * Chat Panel Layout — compact vertical panel for embedding inside a page. * Avatar-led assistant rows, right-aligned user bubbles, composer footer. */ @Component({ selector: 'app-chat-panel', standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA], styles: [':host { display: contents; }'], template: \`
Chat Panel GPT-4o Mini
Hi there! How can I help?
What is this about?
\`, }) export class ChatPanelComponent { input = ''; }`, solid: `import { createSignal } from 'solid-js'; import { ChatConfig, ChatContainer, Message, MessageAvatar, MessageContent, MessageActions, PromptInput, PromptInputTextarea, PromptInputActions, ScrollButton, Button, } from '@kitn.ai/chat'; import { Copy, ArrowUp } from 'lucide-solid'; /** * Chat Panel Layout — compact vertical panel for embedding inside a page. * Avatar-led assistant rows, right-aligned user bubbles, composer footer. * Typical sizing: 360-480 px wide, full container height. */ export function ChatPanel() { const [input, setInput] = createSignal(''); return (
{/* Panel header */}
Chat Panel GPT-4o Mini
{/* Scrollable thread */} {/* Assistant message — avatar + transparent prose */}
Hi there! How can I help?
{/* User message — right-aligned pill */} What is this about?
{/* Composer footer */}
setInput('')}>
); }`, }, }; /** * Pattern: Chat Panel Layout — compact vertical panel intended to embed inside * a larger page. `ChatContainer` handles scroll; `MessageAvatar` leads each * assistant row; user messages right-align as pill bubbles; `PromptInput` pins * to the bottom. Per-story: the Usage tab shows the snippet for the story you're * on; the example-level fields below are the fallback. */ const chatPanelLayout: ExampleUsage = { title: 'Patterns/Chat Panel Layout', ...chatGptStyle, stories: { 'ChatGPT Style': chatGptStyle, }, }; export default chatPanelLayout;