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
72
clients/web/src/components/atoms/LogEntry/LogEntry.tsx
Normal file
72
clients/web/src/components/atoms/LogEntry/LogEntry.tsx
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
import { Badge, Group, Text } from '@mantine/core';
|
||||
|
||||
export type LogLevel = 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical' | 'alert' | 'emergency';
|
||||
|
||||
export interface LogEntryProps {
|
||||
timestamp: string;
|
||||
level: LogLevel;
|
||||
message: string;
|
||||
logger?: string;
|
||||
}
|
||||
|
||||
const levelBadgeColor: Record<LogLevel, string> = {
|
||||
debug: 'gray',
|
||||
info: 'blue',
|
||||
notice: 'teal',
|
||||
warning: 'yellow',
|
||||
error: 'red',
|
||||
critical: 'red',
|
||||
alert: 'red',
|
||||
emergency: 'red',
|
||||
};
|
||||
|
||||
const levelBadgeVariant: Record<LogLevel, string> = {
|
||||
debug: 'light',
|
||||
info: 'light',
|
||||
notice: 'light',
|
||||
warning: 'light',
|
||||
error: 'light',
|
||||
critical: 'filled',
|
||||
alert: 'filled',
|
||||
emergency: 'filled',
|
||||
};
|
||||
|
||||
const levelMessageColor: Record<LogLevel, string | undefined> = {
|
||||
debug: 'dimmed',
|
||||
info: 'blue',
|
||||
notice: undefined,
|
||||
warning: 'yellow',
|
||||
error: 'red',
|
||||
critical: 'red',
|
||||
alert: 'red',
|
||||
emergency: 'red',
|
||||
};
|
||||
|
||||
function isBoldLevel(level: LogLevel): boolean {
|
||||
return level === 'alert' || level === 'emergency';
|
||||
}
|
||||
|
||||
export function LogEntry({ timestamp, level, message, logger }: LogEntryProps) {
|
||||
return (
|
||||
<Group gap="sm" wrap="nowrap">
|
||||
<Text size="sm" ff="monospace" c="dimmed">
|
||||
{timestamp}
|
||||
</Text>
|
||||
<Badge
|
||||
color={levelBadgeColor[level]}
|
||||
variant={levelBadgeVariant[level]}
|
||||
fw={isBoldLevel(level) ? 700 : undefined}
|
||||
>
|
||||
{level}
|
||||
</Badge>
|
||||
{logger && (
|
||||
<Text size="xs" c="dimmed">
|
||||
[{logger}]
|
||||
</Text>
|
||||
)}
|
||||
<Text size="sm" c={levelMessageColor[level]}>
|
||||
{message}
|
||||
</Text>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue