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
108
clients/web/src/components/molecules/RootsTable/RootsTable.tsx
Normal file
108
clients/web/src/components/molecules/RootsTable/RootsTable.tsx
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
import {
|
||||
ActionIcon,
|
||||
Alert,
|
||||
Button,
|
||||
Divider,
|
||||
Group,
|
||||
Stack,
|
||||
Table,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
} from '@mantine/core';
|
||||
|
||||
export interface RootEntry {
|
||||
name: string;
|
||||
uri: string;
|
||||
}
|
||||
|
||||
export interface RootsTableProps {
|
||||
roots: RootEntry[];
|
||||
newRootName: string;
|
||||
newRootPath: string;
|
||||
onRemoveRoot: (uri: string) => void;
|
||||
onNewRootNameChange: (name: string) => void;
|
||||
onNewRootPathChange: (path: string) => void;
|
||||
onAddRoot: () => void;
|
||||
onBrowse: () => void;
|
||||
}
|
||||
|
||||
export function RootsTable({
|
||||
roots,
|
||||
newRootName,
|
||||
newRootPath,
|
||||
onRemoveRoot,
|
||||
onNewRootNameChange,
|
||||
onNewRootPathChange,
|
||||
onAddRoot,
|
||||
onBrowse,
|
||||
}: RootsTableProps) {
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<Title order={4}>Roots Configuration</Title>
|
||||
<Text size="sm" c="dimmed">
|
||||
Filesystem roots exposed to the connected server:
|
||||
</Text>
|
||||
|
||||
{roots.length > 0 && (
|
||||
<Table>
|
||||
<Table.Thead>
|
||||
<Table.Tr>
|
||||
<Table.Th>Name</Table.Th>
|
||||
<Table.Th>URI</Table.Th>
|
||||
<Table.Th>Actions</Table.Th>
|
||||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
{roots.map((root) => (
|
||||
<Table.Tr key={root.uri}>
|
||||
<Table.Td>{root.name}</Table.Td>
|
||||
<Table.Td>{root.uri}</Table.Td>
|
||||
<Table.Td>
|
||||
<ActionIcon
|
||||
color="red"
|
||||
variant="subtle"
|
||||
onClick={() => onRemoveRoot(root.uri)}
|
||||
>
|
||||
X
|
||||
</ActionIcon>
|
||||
</Table.Td>
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
</Table>
|
||||
)}
|
||||
|
||||
<Button variant="light" fullWidth onClick={onAddRoot}>
|
||||
+ Add Root
|
||||
</Button>
|
||||
|
||||
<Divider />
|
||||
|
||||
<Title order={5}>Add New Root:</Title>
|
||||
<TextInput
|
||||
label="Name"
|
||||
value={newRootName}
|
||||
onChange={(e) => onNewRootNameChange(e.currentTarget.value)}
|
||||
/>
|
||||
<TextInput
|
||||
label="Path"
|
||||
value={newRootPath}
|
||||
onChange={(e) => onNewRootPathChange(e.currentTarget.value)}
|
||||
/>
|
||||
<Group justify="flex-end">
|
||||
<Button variant="light" onClick={onBrowse}>
|
||||
Browse
|
||||
</Button>
|
||||
<Button onClick={onAddRoot}>
|
||||
Add
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Alert color="yellow" title="Warning">
|
||||
Roots give the server access to these directories. Only add directories you trust the server
|
||||
to access.
|
||||
</Alert>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue