From 8d9f45efeb3185bb2976097197bfe2fc4a2454df Mon Sep 17 00:00:00 2001 From: Mark McLaughlin Date: Tue, 10 Feb 2026 11:35:29 -0800 Subject: [PATCH] feat: Add CardDemo example showcasing various Card component states and configurations --- packages/cli/examples/card-demo.tsx | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 packages/cli/examples/card-demo.tsx diff --git a/packages/cli/examples/card-demo.tsx b/packages/cli/examples/card-demo.tsx new file mode 100644 index 0000000000..127aebeb2c --- /dev/null +++ b/packages/cli/examples/card-demo.tsx @@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2026 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { render, Box, Text } from 'ink'; +import { Card } from '../src/ui/components/shared/Card.js'; +import { ToolCallStatus, StreamingState } from '../src/ui/types.js'; +import { StreamingContext } from '../src/ui/contexts/StreamingContext.js'; + +const CardDemo = () => { + return ( + + + Card Component Demo + + + Default (100% width, Pending status): + + + This is a standard card that takes up the full width of the + terminal container by default. + + + + Fixed Width (40 characters, Success status): + + This card has a fixed width of 40 characters. + + + Error Status with Prefix: + + + Failed to connect to the production database after 3 attempts. + + + + Canceled Status without Prefix: + + The user canceled the long-running task. + + + Executing Status: + + + Refactoring the codebase to use the new Card component... + + + + + + Press Ctrl+C to exit + + + + ); +}; + +render();