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,96 @@
|
|||
import { Button, Checkbox, Group, Select, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||
|
||||
const LOG_LEVELS = [
|
||||
'debug',
|
||||
'info',
|
||||
'notice',
|
||||
'warning',
|
||||
'error',
|
||||
'critical',
|
||||
'alert',
|
||||
'emergency',
|
||||
] as const;
|
||||
|
||||
const LEVEL_COLORS: Record<string, { c: string; fw?: number }> = {
|
||||
debug: { c: 'dimmed' },
|
||||
info: { c: 'blue' },
|
||||
notice: { c: 'teal' },
|
||||
warning: { c: 'yellow' },
|
||||
error: { c: 'red' },
|
||||
critical: { c: 'red', fw: 700 },
|
||||
alert: { c: 'red', fw: 700 },
|
||||
emergency: { c: 'red', fw: 900 },
|
||||
};
|
||||
|
||||
export interface LogControlsProps {
|
||||
currentLevel: string;
|
||||
filterText: string;
|
||||
visibleLevels: Record<string, boolean>;
|
||||
onSetLevel: (level: string) => void;
|
||||
onFilterChange: (text: string) => void;
|
||||
onToggleLevel: (level: string, visible: boolean) => void;
|
||||
onClear: () => void;
|
||||
onExport: () => void;
|
||||
}
|
||||
|
||||
export function LogControls({
|
||||
currentLevel,
|
||||
filterText,
|
||||
visibleLevels,
|
||||
onSetLevel,
|
||||
onFilterChange,
|
||||
onToggleLevel,
|
||||
onClear,
|
||||
onExport,
|
||||
}: LogControlsProps) {
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<Title order={5}>Log Level</Title>
|
||||
<Group>
|
||||
<Select
|
||||
data={LOG_LEVELS.map((level) => ({ value: level, label: level }))}
|
||||
value={currentLevel}
|
||||
onChange={(value) => {
|
||||
if (value) onSetLevel(value);
|
||||
}}
|
||||
/>
|
||||
<Button size="sm" onClick={() => onSetLevel(currentLevel)}>
|
||||
Set Level
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Title order={5}>Filter</Title>
|
||||
<TextInput
|
||||
placeholder="Search logs..."
|
||||
value={filterText}
|
||||
onChange={(e) => onFilterChange(e.currentTarget.value)}
|
||||
/>
|
||||
|
||||
<Title order={5}>Show Levels</Title>
|
||||
{LOG_LEVELS.map((level) => {
|
||||
const style = LEVEL_COLORS[level];
|
||||
return (
|
||||
<Checkbox
|
||||
key={level}
|
||||
checked={!!visibleLevels[level]}
|
||||
onChange={(e) => onToggleLevel(level, e.currentTarget.checked)}
|
||||
label={
|
||||
<Text c={style.c} fw={style.fw}>
|
||||
{level}
|
||||
</Text>
|
||||
}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
||||
<Group>
|
||||
<Button variant="light" size="sm" onClick={onClear}>
|
||||
Clear
|
||||
</Button>
|
||||
<Button variant="light" size="sm" onClick={onExport}>
|
||||
Export
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue