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>
This commit is contained in:
parent
fcd0d156f4
commit
39ef184b53
1 changed files with 5895 additions and 102158 deletions
|
|
@ -0,0 +1,80 @@
|
|||
import { Badge, Button, Code, Group, Loader, Paper, Stack, Text } from '@mantine/core'
|
||||
import type { JsonSchema } from '../SchemaForm/SchemaForm'
|
||||
import { SchemaForm } from '../SchemaForm/SchemaForm'
|
||||
|
||||
export interface InlineElicitationRequestProps {
|
||||
mode: 'form' | 'url'
|
||||
message: string
|
||||
queuePosition: string
|
||||
schema?: JsonSchema
|
||||
values?: Record<string, unknown>
|
||||
url?: string
|
||||
isWaiting?: boolean
|
||||
onChange: (values: Record<string, unknown>) => void
|
||||
onSubmit: () => void
|
||||
onCancel: () => void
|
||||
}
|
||||
|
||||
export function InlineElicitationRequest({
|
||||
mode,
|
||||
message,
|
||||
queuePosition,
|
||||
schema,
|
||||
values,
|
||||
url,
|
||||
isWaiting,
|
||||
onChange,
|
||||
onSubmit,
|
||||
onCancel,
|
||||
}: InlineElicitationRequestProps) {
|
||||
const badgeLabel =
|
||||
mode === 'form' ? 'elicitation/create (form)' : 'elicitation/create (url)'
|
||||
|
||||
return (
|
||||
<Paper p="md" withBorder>
|
||||
<Stack gap="sm">
|
||||
<Group justify="space-between">
|
||||
<Badge color="violet">{badgeLabel}</Badge>
|
||||
<Text size="xs" c="dimmed">
|
||||
{queuePosition}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
<Text size="sm" fs="italic">
|
||||
{message}
|
||||
</Text>
|
||||
|
||||
{mode === 'form' && schema && (
|
||||
<SchemaForm
|
||||
schema={schema}
|
||||
values={values ?? {}}
|
||||
onChange={onChange}
|
||||
/>
|
||||
)}
|
||||
|
||||
{mode === 'url' && url && (
|
||||
<>
|
||||
<Code block>{url}</Code>
|
||||
{isWaiting && (
|
||||
<Group>
|
||||
<Loader size="xs" />
|
||||
<Text size="xs">Waiting...</Text>
|
||||
</Group>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<Group justify="flex-end" gap="xs">
|
||||
<Button size="xs" variant="light" onClick={onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
{mode === 'form' && (
|
||||
<Button size="xs" onClick={onSubmit}>
|
||||
Submit
|
||||
</Button>
|
||||
)}
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
Loading…
Reference in a new issue