inspector/clients/web/src/components/molecules/ToolDetailPanel/ToolDetailPanel.stories.tsx
cliffhall 39ef184b53 feat: Add Mantine theme, 12 atom components, and 25 molecule components with Storybook stories
- Mantine theme with component extensions (Badge, Card, Paper, Button, etc.)
- CSS custom properties for design tokens (--inspector-* vars)
- Dark/light mode support with auto detection
- 12 atoms: StatusIndicator, AnnotationBadge, CapabilityItem, LogEntry,
  ProgressDisplay, ContentViewer, ListChangedIndicator, CopyButton,
  ConnectionToggle, TransportBadge, InlineError, MessageBubble
- 25 molecules: ServerCard, AddServerMenu, SchemaForm, ToolListItem,
  ToolDetailPanel, ResultPanel, ResourceListItem, ResourcePreviewPanel,
  ResourceTemplateInput, PromptArgumentsForm, PromptMessagesDisplay,
  LogControls, TaskCard, HistoryEntry, ServerInfoContent, ServerSettingsForm,
  RootsTable, SamplingRequestPanel, ElicitationFormPanel, ElicitationUrlPanel,
  InlineSamplingRequest, InlineElicitationRequest, PendingClientRequests,
  ImportServerJsonPanel, ExperimentalFeaturesPanel
- Exclude storybook-static from version control
- Exclude .stories.tsx from app tsconfig (Storybook-only modules)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:23:56 -04:00

96 lines
2.3 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react-vite'
import { fn } from 'storybook/test'
import { ToolDetailPanel } from './ToolDetailPanel'
const meta: Meta<typeof ToolDetailPanel> = {
title: 'Molecules/ToolDetailPanel',
component: ToolDetailPanel,
args: {
onFormChange: fn(),
onExecute: fn(),
onCancel: fn(),
formValues: {},
isExecuting: false,
},
}
export default meta
type Story = StoryObj<typeof ToolDetailPanel>
export const SimpleStringParam: Story = {
args: {
name: 'send_message',
schema: {
type: 'object',
properties: {
message: { type: 'string', description: 'The message to send' },
},
required: ['message'],
},
},
}
export const MultipleParams: Story = {
args: {
name: 'create_record',
description: 'Creates a new record with the given parameters',
schema: {
type: 'object',
properties: {
title: { type: 'string', description: 'Record title' },
count: { type: 'number', description: 'Number of items' },
enabled: { type: 'boolean', description: 'Whether the record is active' },
},
required: ['title'],
},
},
}
export const WithAnnotations: Story = {
args: {
name: 'delete_records',
description: 'Deletes records matching the given criteria',
annotations: {
audience: 'admin',
readOnly: true,
destructive: true,
},
schema: {
type: 'object',
properties: {
pattern: { type: 'string', description: 'Pattern to match records' },
},
},
},
}
export const Executing: Story = {
args: {
name: 'long_query',
description: 'Runs a long database query',
isExecuting: true,
schema: {
type: 'object',
properties: {
query: { type: 'string', description: 'SQL query to execute' },
},
},
formValues: { query: 'SELECT * FROM users' },
},
}
export const WithProgress: Story = {
args: {
name: 'batch_process',
description: 'Processes items in batch',
isExecuting: true,
progress: { percent: 60, description: 'Processing step 3 of 5' },
schema: {
type: 'object',
properties: {
batchSize: { type: 'number', description: 'Number of items per batch' },
},
},
formValues: { batchSize: 100 },
},
}