import type { ExampleUsage, StoryUsage } from './types'; /** New Chat — a centered greeting (icon + title + description), starter suggestion chips, and a composer. */ const newChat: StoryUsage = { intro: "The new-chat zero state. `` renders the centered greeting from two scalar props — `emptyTitle` (DOM attribute `empty-title`, since `title` is a global HTML attribute) and `description`. The icon, the starter suggestion chips, and the composer below aren't part of `` — compose those with the SolidJS `Empty` + `PromptSuggestion` + `PromptInput` primitives (see the Solid tab).", snippets: { html: ` `, react: `import { Empty } from '@kitn.ai/chat/react'; export function NewChat() { // Icon, suggestion chips, and composer aren't props on — // compose them yourself (see the Solid tab). return ( ); }`, vue: ` `, svelte: ` `, 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'; @Component({ selector: 'app-new-chat', standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA], // empty-title is kebab-case; both props are scalar strings. template: \` \`, }) export class NewChatComponent {}`, solid: `import { createSignal } from 'solid-js'; import { ChatConfig, Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent, PromptSuggestion, PromptInput, PromptInputTextarea, PromptInputActions, Button, } from '@kitn.ai/chat'; import { Sparkles, Plus, Globe, ArrowUp } from 'lucide-solid'; const SUGGESTIONS = [ 'Summarize a document', 'Draft a product update', 'Explain a code snippet', 'Plan my week', ]; export function NewChat() { const [input, setInput] = createSignal(''); return ( How can I help today? Ask anything, or start from one of these.
{SUGGESTIONS.map((s) => ( setInput(s)}>{s} ))}
{/* Composer fills from a clicked suggestion. */} setInput('')}>
); }`, }, }; /** * Pattern: Empty State — the new-chat zero state. `` covers the * centered greeting (`emptyTitle` + `description`); the icon, starter * suggestion chips, and composer are SolidJS primitive composition. Per-story: * the Usage tab shows the snippet for the story you're on; the example-level * fields below are the fallback. */ const emptyState: ExampleUsage = { title: 'Patterns/Empty State', ...newChat, // example-level fallback = the primary "New Chat" story stories: { 'New Chat': newChat, }, }; export default emptyState;