@nocturnium/svelte-ide 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/components/agents/AgentActivityPanel.svelte +565 -0
- package/dist/components/agents/AgentActivityPanel.svelte.d.ts +24 -0
- package/dist/components/agents/AgentAvatar.svelte +417 -0
- package/dist/components/agents/AgentAvatar.svelte.d.ts +23 -0
- package/dist/components/agents/AgentCursor.svelte +224 -0
- package/dist/components/agents/AgentCursor.svelte.d.ts +35 -0
- package/dist/components/agents/AgentPresenceBar.svelte +261 -0
- package/dist/components/agents/AgentPresenceBar.svelte.d.ts +20 -0
- package/dist/components/agents/index.d.ts +4 -0
- package/dist/components/agents/index.js +5 -0
- package/dist/components/ai/AIConversationList.svelte +524 -0
- package/dist/components/ai/AIConversationList.svelte.d.ts +17 -0
- package/dist/components/ai/AIEditPreview.svelte +132 -0
- package/dist/components/ai/AIEditPreview.svelte.d.ts +8 -0
- package/dist/components/ai/AIInlineEdit.svelte +155 -0
- package/dist/components/ai/AIInlineEdit.svelte.d.ts +10 -0
- package/dist/components/ai/AIMessage.svelte +239 -0
- package/dist/components/ai/AIMessage.svelte.d.ts +13 -0
- package/dist/components/ai/AIMessageActions.svelte +176 -0
- package/dist/components/ai/AIMessageActions.svelte.d.ts +12 -0
- package/dist/components/ai/AIMessageContent.svelte +355 -0
- package/dist/components/ai/AIMessageContent.svelte.d.ts +7 -0
- package/dist/components/ai/AIPanel.svelte +561 -0
- package/dist/components/ai/AIPanel.svelte.d.ts +7 -0
- package/dist/components/ai/AISuggestionWidget.svelte +132 -0
- package/dist/components/ai/AISuggestionWidget.svelte.d.ts +10 -0
- package/dist/components/ai/AIToolCallDisplay.svelte +317 -0
- package/dist/components/ai/AIToolCallDisplay.svelte.d.ts +12 -0
- package/dist/components/ai/index.d.ts +9 -0
- package/dist/components/ai/index.js +10 -0
- package/dist/components/core/Avatar.svelte +110 -0
- package/dist/components/core/Avatar.svelte.d.ts +12 -0
- package/dist/components/core/Badge.svelte +98 -0
- package/dist/components/core/Badge.svelte.d.ts +11 -0
- package/dist/components/core/Button.svelte +175 -0
- package/dist/components/core/Button.svelte.d.ts +18 -0
- package/dist/components/core/ConnectionStatus.svelte +294 -0
- package/dist/components/core/ConnectionStatus.svelte.d.ts +20 -0
- package/dist/components/core/ContextMenu.svelte +176 -0
- package/dist/components/core/ContextMenu.svelte.d.ts +19 -0
- package/dist/components/core/ErrorBoundary.svelte +277 -0
- package/dist/components/core/ErrorBoundary.svelte.d.ts +23 -0
- package/dist/components/core/Icon.svelte +107 -0
- package/dist/components/core/Icon.svelte.d.ts +8 -0
- package/dist/components/core/Input.svelte +138 -0
- package/dist/components/core/Input.svelte.d.ts +20 -0
- package/dist/components/core/Kbd.svelte +34 -0
- package/dist/components/core/Kbd.svelte.d.ts +7 -0
- package/dist/components/core/ResizeHandle.svelte +200 -0
- package/dist/components/core/ResizeHandle.svelte.d.ts +23 -0
- package/dist/components/core/Spinner.svelte +35 -0
- package/dist/components/core/Spinner.svelte.d.ts +7 -0
- package/dist/components/core/Textarea.svelte +112 -0
- package/dist/components/core/Textarea.svelte.d.ts +18 -0
- package/dist/components/core/Tooltip.svelte +103 -0
- package/dist/components/core/Tooltip.svelte.d.ts +11 -0
- package/dist/components/core/index.d.ts +13 -0
- package/dist/components/core/index.js +14 -0
- package/dist/components/editor/AIFocusLayer.svelte +430 -0
- package/dist/components/editor/AIFocusLayer.svelte.d.ts +32 -0
- package/dist/components/editor/Breadcrumbs.svelte +435 -0
- package/dist/components/editor/Breadcrumbs.svelte.d.ts +33 -0
- package/dist/components/editor/BreakpointLayer.svelte +642 -0
- package/dist/components/editor/BreakpointLayer.svelte.d.ts +20 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte +324 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte.d.ts +18 -0
- package/dist/components/editor/CollaborativeEditor.svelte +218 -0
- package/dist/components/editor/CollaborativeEditor.svelte.d.ts +32 -0
- package/dist/components/editor/CommandPalette.svelte +434 -0
- package/dist/components/editor/CommandPalette.svelte.d.ts +11 -0
- package/dist/components/editor/ComplexityLayer.svelte +293 -0
- package/dist/components/editor/ComplexityLayer.svelte.d.ts +23 -0
- package/dist/components/editor/ConflictZoneLayer.svelte +441 -0
- package/dist/components/editor/ConflictZoneLayer.svelte.d.ts +25 -0
- package/dist/components/editor/ContextLens.svelte +262 -0
- package/dist/components/editor/ContextLens.svelte.d.ts +27 -0
- package/dist/components/editor/CustomEditor.svelte +1242 -0
- package/dist/components/editor/CustomEditor.svelte.d.ts +37 -0
- package/dist/components/editor/DebugConsole.svelte +646 -0
- package/dist/components/editor/DebugConsole.svelte.d.ts +41 -0
- package/dist/components/editor/EchoCursorLayer.svelte +363 -0
- package/dist/components/editor/EchoCursorLayer.svelte.d.ts +24 -0
- package/dist/components/editor/Editor.svelte +61 -0
- package/dist/components/editor/Editor.svelte.d.ts +22 -0
- package/dist/components/editor/EditorGutter.svelte +119 -0
- package/dist/components/editor/EditorGutter.svelte.d.ts +19 -0
- package/dist/components/editor/EditorLines.svelte +182 -0
- package/dist/components/editor/EditorLines.svelte.d.ts +43 -0
- package/dist/components/editor/EditorPane.svelte +134 -0
- package/dist/components/editor/EditorPane.svelte.d.ts +9 -0
- package/dist/components/editor/EditorSelections.svelte +186 -0
- package/dist/components/editor/EditorSelections.svelte.d.ts +25 -0
- package/dist/components/editor/EditorTabs.svelte +170 -0
- package/dist/components/editor/EditorTabs.svelte.d.ts +12 -0
- package/dist/components/editor/FileExplorer.svelte +811 -0
- package/dist/components/editor/FileExplorer.svelte.d.ts +67 -0
- package/dist/components/editor/FileIcon.svelte +110 -0
- package/dist/components/editor/FileIcon.svelte.d.ts +10 -0
- package/dist/components/editor/FindReplace.svelte +448 -0
- package/dist/components/editor/FindReplace.svelte.d.ts +40 -0
- package/dist/components/editor/GhostBracketLayer.svelte +391 -0
- package/dist/components/editor/GhostBracketLayer.svelte.d.ts +24 -0
- package/dist/components/editor/GitBlameLayer.svelte +436 -0
- package/dist/components/editor/GitBlameLayer.svelte.d.ts +18 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte +540 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte.d.ts +35 -0
- package/dist/components/editor/InlineDiffLayer.svelte +337 -0
- package/dist/components/editor/InlineDiffLayer.svelte.d.ts +31 -0
- package/dist/components/editor/MinimalEditor.svelte +75 -0
- package/dist/components/editor/MinimalEditor.svelte.d.ts +6 -0
- package/dist/components/editor/MinimalEditor2.svelte +84 -0
- package/dist/components/editor/MinimalEditor2.svelte.d.ts +6 -0
- package/dist/components/editor/Minimap.svelte +327 -0
- package/dist/components/editor/Minimap.svelte.d.ts +34 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte +793 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte.d.ts +49 -0
- package/dist/components/editor/ProblemsPanel.svelte +628 -0
- package/dist/components/editor/ProblemsPanel.svelte.d.ts +25 -0
- package/dist/components/editor/QuickActionsMenu.svelte +403 -0
- package/dist/components/editor/QuickActionsMenu.svelte.d.ts +18 -0
- package/dist/components/editor/SnippetPalette.svelte +530 -0
- package/dist/components/editor/SnippetPalette.svelte.d.ts +16 -0
- package/dist/components/editor/StructureMap.svelte +431 -0
- package/dist/components/editor/StructureMap.svelte.d.ts +37 -0
- package/dist/components/editor/SymbolOutline.svelte +722 -0
- package/dist/components/editor/SymbolOutline.svelte.d.ts +44 -0
- package/dist/components/editor/TimelineScrubber.svelte +470 -0
- package/dist/components/editor/TimelineScrubber.svelte.d.ts +40 -0
- package/dist/components/editor/TokenRenderer.svelte +69 -0
- package/dist/components/editor/TokenRenderer.svelte.d.ts +15 -0
- package/dist/components/editor/constants.d.ts +32 -0
- package/dist/components/editor/constants.js +36 -0
- package/dist/components/editor/core/ai-awareness.d.ts +176 -0
- package/dist/components/editor/core/ai-awareness.js +210 -0
- package/dist/components/editor/core/bracket-healer.d.ts +189 -0
- package/dist/components/editor/core/bracket-healer.js +406 -0
- package/dist/components/editor/core/breakpoints.d.ts +203 -0
- package/dist/components/editor/core/breakpoints.js +414 -0
- package/dist/components/editor/core/commands.d.ts +108 -0
- package/dist/components/editor/core/commands.js +246 -0
- package/dist/components/editor/core/complexity-analyzer.d.ts +123 -0
- package/dist/components/editor/core/complexity-analyzer.js +376 -0
- package/dist/components/editor/core/conflict-predictor.d.ts +135 -0
- package/dist/components/editor/core/conflict-predictor.js +316 -0
- package/dist/components/editor/core/crdt-binding.d.ts +118 -0
- package/dist/components/editor/core/crdt-binding.js +286 -0
- package/dist/components/editor/core/diagnostics.d.ts +210 -0
- package/dist/components/editor/core/diagnostics.js +335 -0
- package/dist/components/editor/core/echo-cursor.d.ts +201 -0
- package/dist/components/editor/core/echo-cursor.js +267 -0
- package/dist/components/editor/core/folding.d.ts +124 -0
- package/dist/components/editor/core/folding.js +672 -0
- package/dist/components/editor/core/ghost-pair.d.ts +122 -0
- package/dist/components/editor/core/ghost-pair.js +221 -0
- package/dist/components/editor/core/git-blame.d.ts +170 -0
- package/dist/components/editor/core/git-blame.js +324 -0
- package/dist/components/editor/core/index.d.ts +26 -0
- package/dist/components/editor/core/index.js +24 -0
- package/dist/components/editor/core/keybindings.d.ts +79 -0
- package/dist/components/editor/core/keybindings.js +357 -0
- package/dist/components/editor/core/multi-cursor.d.ts +196 -0
- package/dist/components/editor/core/multi-cursor.js +521 -0
- package/dist/components/editor/core/navigation.d.ts +107 -0
- package/dist/components/editor/core/navigation.js +408 -0
- package/dist/components/editor/core/quick-actions.d.ts +189 -0
- package/dist/components/editor/core/quick-actions.js +427 -0
- package/dist/components/editor/core/search.d.ts +88 -0
- package/dist/components/editor/core/search.js +192 -0
- package/dist/components/editor/core/semantic-analyzer.d.ts +77 -0
- package/dist/components/editor/core/semantic-analyzer.js +424 -0
- package/dist/components/editor/core/snippet-manager.d.ts +202 -0
- package/dist/components/editor/core/snippet-manager.js +565 -0
- package/dist/components/editor/core/state.d.ts +367 -0
- package/dist/components/editor/core/state.js +900 -0
- package/dist/components/editor/core/timeline.d.ts +204 -0
- package/dist/components/editor/core/timeline.js +349 -0
- package/dist/components/editor/editor-find.d.ts +56 -0
- package/dist/components/editor/editor-find.js +148 -0
- package/dist/components/editor/editor-input.d.ts +77 -0
- package/dist/components/editor/editor-input.js +445 -0
- package/dist/components/editor/editor-multicursor.d.ts +21 -0
- package/dist/components/editor/editor-multicursor.js +196 -0
- package/dist/components/editor/editor-scroll.d.ts +14 -0
- package/dist/components/editor/editor-scroll.js +34 -0
- package/dist/components/editor/index.d.ts +15 -0
- package/dist/components/editor/index.js +21 -0
- package/dist/components/editor/languages.d.ts +62 -0
- package/dist/components/editor/languages.js +285 -0
- package/dist/components/editor/theme.d.ts +88 -0
- package/dist/components/editor/theme.js +139 -0
- package/dist/components/editor/tokenizer/base.d.ts +40 -0
- package/dist/components/editor/tokenizer/base.js +203 -0
- package/dist/components/editor/tokenizer/index.d.ts +56 -0
- package/dist/components/editor/tokenizer/index.js +215 -0
- package/dist/components/editor/tokenizer/languages/css.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/css.js +194 -0
- package/dist/components/editor/tokenizer/languages/go.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/go.js +220 -0
- package/dist/components/editor/tokenizer/languages/html.d.ts +24 -0
- package/dist/components/editor/tokenizer/languages/html.js +145 -0
- package/dist/components/editor/tokenizer/languages/javascript.d.ts +56 -0
- package/dist/components/editor/tokenizer/languages/javascript.js +452 -0
- package/dist/components/editor/tokenizer/languages/json.d.ts +12 -0
- package/dist/components/editor/tokenizer/languages/json.js +91 -0
- package/dist/components/editor/tokenizer/languages/markdown.d.ts +16 -0
- package/dist/components/editor/tokenizer/languages/markdown.js +156 -0
- package/dist/components/editor/tokenizer/languages/python.d.ts +20 -0
- package/dist/components/editor/tokenizer/languages/python.js +227 -0
- package/dist/components/editor/tokenizer/languages/svelte.d.ts +40 -0
- package/dist/components/editor/tokenizer/languages/svelte.js +326 -0
- package/dist/components/editor/tokenizer/types.d.ts +86 -0
- package/dist/components/editor/tokenizer/types.js +4 -0
- package/dist/components/layout/IDELayout.svelte +274 -0
- package/dist/components/layout/IDELayout.svelte.d.ts +29 -0
- package/dist/components/layout/StatusBar.svelte +511 -0
- package/dist/components/layout/StatusBar.svelte.d.ts +47 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +3 -0
- package/dist/components/lsp/AutocompleteWidget.svelte +364 -0
- package/dist/components/lsp/AutocompleteWidget.svelte.d.ts +33 -0
- package/dist/components/lsp/DiagnosticMarker.svelte +166 -0
- package/dist/components/lsp/DiagnosticMarker.svelte.d.ts +19 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte +388 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte.d.ts +21 -0
- package/dist/components/lsp/HoverTooltip.svelte +274 -0
- package/dist/components/lsp/HoverTooltip.svelte.d.ts +24 -0
- package/dist/components/lsp/LSPEditor.svelte +486 -0
- package/dist/components/lsp/LSPEditor.svelte.d.ts +39 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte +216 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte.d.ts +22 -0
- package/dist/components/lsp/index.d.ts +6 -0
- package/dist/components/lsp/index.js +7 -0
- package/dist/components/plugins/PluginCard.svelte +153 -0
- package/dist/components/plugins/PluginCard.svelte.d.ts +19 -0
- package/dist/components/plugins/PluginPanel.svelte +280 -0
- package/dist/components/plugins/PluginPanel.svelte.d.ts +8 -0
- package/dist/components/plugins/PluginProposalForm.svelte +250 -0
- package/dist/components/plugins/PluginProposalForm.svelte.d.ts +6 -0
- package/dist/components/plugins/PluginStatusBadge.svelte +14 -0
- package/dist/components/plugins/PluginStatusBadge.svelte.d.ts +8 -0
- package/dist/components/plugins/index.d.ts +4 -0
- package/dist/components/plugins/index.js +5 -0
- package/dist/components/vfs/LockConflictDialog.svelte +705 -0
- package/dist/components/vfs/LockConflictDialog.svelte.d.ts +21 -0
- package/dist/components/vfs/LockIndicator.svelte +194 -0
- package/dist/components/vfs/LockIndicator.svelte.d.ts +29 -0
- package/dist/components/vfs/LockOverlay.svelte +344 -0
- package/dist/components/vfs/LockOverlay.svelte.d.ts +17 -0
- package/dist/components/vfs/VersionConflictDialog.svelte +549 -0
- package/dist/components/vfs/VersionConflictDialog.svelte.d.ts +24 -0
- package/dist/components/vfs/index.d.ts +4 -0
- package/dist/components/vfs/index.js +5 -0
- package/dist/crdt/awareness.d.ts +42 -0
- package/dist/crdt/awareness.js +109 -0
- package/dist/crdt/document.d.ts +101 -0
- package/dist/crdt/document.js +187 -0
- package/dist/crdt/index.d.ts +9 -0
- package/dist/crdt/index.js +8 -0
- package/dist/crdt/provider.d.ts +85 -0
- package/dist/crdt/provider.js +150 -0
- package/dist/crdt/types.d.ts +61 -0
- package/dist/crdt/types.js +4 -0
- package/dist/crdt/undo.d.ts +34 -0
- package/dist/crdt/undo.js +70 -0
- package/dist/index.d.ts +277 -0
- package/dist/index.js +280 -0
- package/dist/plugins/index.d.ts +103 -0
- package/dist/plugins/index.js +153 -0
- package/dist/services/error-handling.d.ts +95 -0
- package/dist/services/error-handling.js +413 -0
- package/dist/services/ide-integration.d.ts +83 -0
- package/dist/services/ide-integration.js +367 -0
- package/dist/services/lsp-client.d.ts +69 -0
- package/dist/services/lsp-client.js +667 -0
- package/dist/services/mock-ai.d.ts +37 -0
- package/dist/services/mock-ai.js +318 -0
- package/dist/services/optimistic.d.ts +141 -0
- package/dist/services/optimistic.js +367 -0
- package/dist/services/vfs-client.d.ts +81 -0
- package/dist/services/vfs-client.js +348 -0
- package/dist/stores/agents.svelte.d.ts +85 -0
- package/dist/stores/agents.svelte.js +459 -0
- package/dist/stores/ai-persistence.svelte.d.ts +76 -0
- package/dist/stores/ai-persistence.svelte.js +334 -0
- package/dist/stores/ai.svelte.d.ts +140 -0
- package/dist/stores/ai.svelte.js +383 -0
- package/dist/stores/collaboration.svelte.d.ts +164 -0
- package/dist/stores/collaboration.svelte.js +334 -0
- package/dist/stores/editor.svelte.d.ts +131 -0
- package/dist/stores/editor.svelte.js +250 -0
- package/dist/stores/index.d.ts +10 -0
- package/dist/stores/index.js +29 -0
- package/dist/stores/layout.svelte.d.ts +171 -0
- package/dist/stores/layout.svelte.js +351 -0
- package/dist/stores/plugin.svelte.d.ts +121 -0
- package/dist/stores/plugin.svelte.js +410 -0
- package/dist/stores/vfs.svelte.d.ts +123 -0
- package/dist/stores/vfs.svelte.js +680 -0
- package/dist/styles/theme.css +623 -0
- package/dist/types/agents.d.ts +127 -0
- package/dist/types/agents.js +5 -0
- package/dist/types/ai.d.ts +137 -0
- package/dist/types/ai.js +4 -0
- package/dist/types/crdt.d.ts +222 -0
- package/dist/types/crdt.js +5 -0
- package/dist/types/editor.d.ts +52 -0
- package/dist/types/editor.js +18 -0
- package/dist/types/events.d.ts +133 -0
- package/dist/types/events.js +4 -0
- package/dist/types/filesystem.d.ts +77 -0
- package/dist/types/filesystem.js +4 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +12 -0
- package/dist/types/lsp.d.ts +691 -0
- package/dist/types/lsp.js +108 -0
- package/dist/types/plugin.d.ts +239 -0
- package/dist/types/plugin.js +5 -0
- package/dist/types/vfs.d.ts +191 -0
- package/dist/types/vfs.js +18 -0
- package/dist/utils/format.d.ts +55 -0
- package/dist/utils/format.js +152 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/keybindings.d.ts +33 -0
- package/dist/utils/keybindings.js +171 -0
- package/dist/utils/language.d.ts +27 -0
- package/dist/utils/language.js +222 -0
- package/package.json +178 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon, Badge, Spinner } from '../core';
|
|
3
|
+
import type { AIToolCall } from '../../types';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
toolCall: AIToolCall;
|
|
7
|
+
status?: 'pending' | 'running' | 'completed' | 'error';
|
|
8
|
+
result?: unknown;
|
|
9
|
+
error?: string;
|
|
10
|
+
duration?: number;
|
|
11
|
+
startedAt?: Date;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
toolCall,
|
|
16
|
+
status = 'completed',
|
|
17
|
+
result,
|
|
18
|
+
error,
|
|
19
|
+
duration,
|
|
20
|
+
startedAt
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
let expanded = $state(false);
|
|
24
|
+
let showResult = $state(false);
|
|
25
|
+
|
|
26
|
+
// Format duration nicely
|
|
27
|
+
function formatDuration(ms: number): string {
|
|
28
|
+
if (ms < 1000) return `${ms}ms`;
|
|
29
|
+
if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
|
|
30
|
+
return `${Math.floor(ms / 60000)}m ${Math.floor((ms % 60000) / 1000)}s`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Get status badge variant
|
|
34
|
+
function getStatusVariant(s: string): 'info' | 'warning' | 'success' | 'danger' {
|
|
35
|
+
switch (s) {
|
|
36
|
+
case 'pending':
|
|
37
|
+
return 'info';
|
|
38
|
+
case 'running':
|
|
39
|
+
return 'warning';
|
|
40
|
+
case 'completed':
|
|
41
|
+
return 'success';
|
|
42
|
+
case 'error':
|
|
43
|
+
return 'danger';
|
|
44
|
+
default:
|
|
45
|
+
return 'info';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Get status icon
|
|
50
|
+
function getStatusIcon(s: string): string {
|
|
51
|
+
switch (s) {
|
|
52
|
+
case 'pending':
|
|
53
|
+
return 'clock';
|
|
54
|
+
case 'running':
|
|
55
|
+
return 'loader';
|
|
56
|
+
case 'completed':
|
|
57
|
+
return 'check';
|
|
58
|
+
case 'error':
|
|
59
|
+
return 'x';
|
|
60
|
+
default:
|
|
61
|
+
return 'zap';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Format result for display
|
|
66
|
+
function formatResult(r: unknown): string {
|
|
67
|
+
if (r === undefined || r === null) return 'null';
|
|
68
|
+
if (typeof r === 'string') return r;
|
|
69
|
+
try {
|
|
70
|
+
return JSON.stringify(r, null, 2);
|
|
71
|
+
} catch {
|
|
72
|
+
return String(r);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Truncate long results
|
|
77
|
+
function truncateResult(r: string, maxLength: number = 500): { text: string; truncated: boolean } {
|
|
78
|
+
if (r.length <= maxLength) return { text: r, truncated: false };
|
|
79
|
+
return { text: r.slice(0, maxLength), truncated: true };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const formattedResult = $derived(result !== undefined ? formatResult(result) : null);
|
|
83
|
+
const truncatedResult = $derived(formattedResult ? truncateResult(formattedResult) : null);
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<div class="tool-call" class:tool-call--error={status === 'error'}>
|
|
87
|
+
<button
|
|
88
|
+
class="tool-call__header"
|
|
89
|
+
onclick={() => (expanded = !expanded)}
|
|
90
|
+
aria-expanded={expanded}
|
|
91
|
+
aria-label={`${toolCall.name} tool call, ${status}. ${expanded ? 'Click to collapse' : 'Click to expand'}`}
|
|
92
|
+
>
|
|
93
|
+
<span class="tool-call__expand" aria-hidden="true">
|
|
94
|
+
<Icon name={expanded ? 'chevron-down' : 'chevron-right'} size={12} />
|
|
95
|
+
</span>
|
|
96
|
+
|
|
97
|
+
<span class="tool-call__icon">
|
|
98
|
+
{#if status === 'running'}
|
|
99
|
+
<Spinner size="sm" />
|
|
100
|
+
{:else}
|
|
101
|
+
<Icon name="zap" size={14} />
|
|
102
|
+
{/if}
|
|
103
|
+
</span>
|
|
104
|
+
|
|
105
|
+
<span class="tool-call__name">{toolCall.name}</span>
|
|
106
|
+
|
|
107
|
+
<div class="tool-call__badges">
|
|
108
|
+
<Badge variant={getStatusVariant(status)} size="sm">
|
|
109
|
+
{#if status !== 'running'}
|
|
110
|
+
<Icon name={getStatusIcon(status)} size={10} />
|
|
111
|
+
{/if}
|
|
112
|
+
{status}
|
|
113
|
+
</Badge>
|
|
114
|
+
|
|
115
|
+
{#if duration !== undefined}
|
|
116
|
+
<Badge variant="default" size="sm">
|
|
117
|
+
<Icon name="clock" size={10} />
|
|
118
|
+
{formatDuration(duration)}
|
|
119
|
+
</Badge>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
122
|
+
</button>
|
|
123
|
+
|
|
124
|
+
{#if expanded}
|
|
125
|
+
<div class="tool-call__content">
|
|
126
|
+
<!-- Arguments Section -->
|
|
127
|
+
<div class="tool-call__section">
|
|
128
|
+
<div class="tool-call__section-header">
|
|
129
|
+
<Icon name="arrow-right" size={12} />
|
|
130
|
+
<span>Arguments</span>
|
|
131
|
+
</div>
|
|
132
|
+
<pre class="tool-call__code">{JSON.stringify(toolCall.arguments, null, 2)}</pre>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- Result Section -->
|
|
136
|
+
{#if status === 'completed' && formattedResult}
|
|
137
|
+
<div class="tool-call__section">
|
|
138
|
+
<div class="tool-call__section-header">
|
|
139
|
+
<Icon name="arrow-left" size={12} />
|
|
140
|
+
<span>Result</span>
|
|
141
|
+
{#if truncatedResult?.truncated}
|
|
142
|
+
<button
|
|
143
|
+
class="tool-call__toggle"
|
|
144
|
+
onclick={() => (showResult = !showResult)}
|
|
145
|
+
>
|
|
146
|
+
{showResult ? 'Show less' : 'Show full'}
|
|
147
|
+
</button>
|
|
148
|
+
{/if}
|
|
149
|
+
</div>
|
|
150
|
+
<pre class="tool-call__code tool-call__code--result">{showResult || !truncatedResult?.truncated ? formattedResult : truncatedResult?.text + '...'}</pre>
|
|
151
|
+
</div>
|
|
152
|
+
{/if}
|
|
153
|
+
|
|
154
|
+
<!-- Error Section -->
|
|
155
|
+
{#if status === 'error' && error}
|
|
156
|
+
<div class="tool-call__section tool-call__section--error">
|
|
157
|
+
<div class="tool-call__section-header">
|
|
158
|
+
<Icon name="alert-triangle" size={12} />
|
|
159
|
+
<span>Error</span>
|
|
160
|
+
</div>
|
|
161
|
+
<pre class="tool-call__code tool-call__code--error">{error}</pre>
|
|
162
|
+
</div>
|
|
163
|
+
{/if}
|
|
164
|
+
|
|
165
|
+
<!-- Timing Info -->
|
|
166
|
+
{#if startedAt}
|
|
167
|
+
<div class="tool-call__timing">
|
|
168
|
+
<span>Started: {startedAt.toLocaleTimeString()}</span>
|
|
169
|
+
{#if duration}
|
|
170
|
+
<span>Duration: {formatDuration(duration)}</span>
|
|
171
|
+
{/if}
|
|
172
|
+
</div>
|
|
173
|
+
{/if}
|
|
174
|
+
</div>
|
|
175
|
+
{/if}
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<style>
|
|
179
|
+
.tool-call {
|
|
180
|
+
border: 1px solid var(--ide-border);
|
|
181
|
+
border-radius: var(--ide-radius-md);
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
transition: border-color 0.15s ease;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.tool-call:hover {
|
|
187
|
+
border-color: color-mix(in srgb, var(--ide-border) 70%, var(--color-nocturnium-wave));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.tool-call--error {
|
|
191
|
+
border-color: color-mix(in srgb, var(--ide-error) 50%, transparent);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.tool-call__header {
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
gap: var(--ide-spacing-sm);
|
|
198
|
+
width: 100%;
|
|
199
|
+
padding: var(--ide-spacing-sm) var(--ide-spacing-md);
|
|
200
|
+
background: var(--ide-bg-secondary);
|
|
201
|
+
border: none;
|
|
202
|
+
color: var(--ide-text-primary);
|
|
203
|
+
font-family: var(--ide-font-sans);
|
|
204
|
+
font-size: var(--ide-font-size-sm);
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
text-align: left;
|
|
207
|
+
transition: background 0.15s ease;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.tool-call__header:hover {
|
|
211
|
+
background: var(--ide-bg-hover);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.tool-call__header:focus-visible {
|
|
215
|
+
outline: 2px solid var(--color-nocturnium-wave);
|
|
216
|
+
outline-offset: -2px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.tool-call__expand {
|
|
220
|
+
color: var(--ide-text-muted);
|
|
221
|
+
transition: transform 0.15s ease;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.tool-call__icon {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
color: var(--color-nocturnium-wave);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.tool-call__name {
|
|
231
|
+
flex: 1;
|
|
232
|
+
font-family: var(--ide-font-mono);
|
|
233
|
+
font-weight: 500;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.tool-call__badges {
|
|
237
|
+
display: flex;
|
|
238
|
+
gap: var(--ide-spacing-xs);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.tool-call__content {
|
|
242
|
+
padding: var(--ide-spacing-md);
|
|
243
|
+
background: var(--ide-bg-primary);
|
|
244
|
+
border-top: 1px solid var(--ide-border);
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
gap: var(--ide-spacing-md);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.tool-call__section {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: column;
|
|
253
|
+
gap: var(--ide-spacing-xs);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.tool-call__section--error {
|
|
257
|
+
background: color-mix(in srgb, var(--ide-error) 10%, transparent);
|
|
258
|
+
padding: var(--ide-spacing-sm);
|
|
259
|
+
border-radius: var(--ide-radius-sm);
|
|
260
|
+
margin: calc(-1 * var(--ide-spacing-xs));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.tool-call__section-header {
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
gap: var(--ide-spacing-xs);
|
|
267
|
+
font-size: var(--ide-font-size-xs);
|
|
268
|
+
font-weight: 600;
|
|
269
|
+
color: var(--ide-text-secondary);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.tool-call__toggle {
|
|
273
|
+
margin-left: auto;
|
|
274
|
+
padding: 0.125rem 0.375rem;
|
|
275
|
+
background: var(--ide-bg-secondary);
|
|
276
|
+
border: 1px solid var(--ide-border);
|
|
277
|
+
border-radius: var(--ide-radius-sm);
|
|
278
|
+
font-size: 10px;
|
|
279
|
+
color: var(--ide-text-muted);
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.tool-call__toggle:hover {
|
|
284
|
+
background: var(--ide-bg-hover);
|
|
285
|
+
color: var(--ide-text-primary);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.tool-call__code {
|
|
289
|
+
margin: 0;
|
|
290
|
+
padding: var(--ide-spacing-sm);
|
|
291
|
+
font-family: var(--ide-font-mono);
|
|
292
|
+
font-size: var(--ide-font-size-xs);
|
|
293
|
+
background: var(--ide-bg-secondary);
|
|
294
|
+
border-radius: var(--ide-radius-sm);
|
|
295
|
+
overflow-x: auto;
|
|
296
|
+
max-height: 200px;
|
|
297
|
+
overflow-y: auto;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.tool-call__code--result {
|
|
301
|
+
background: color-mix(in srgb, var(--ide-success) 10%, var(--ide-bg-secondary));
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.tool-call__code--error {
|
|
305
|
+
background: transparent;
|
|
306
|
+
color: var(--ide-error);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.tool-call__timing {
|
|
310
|
+
display: flex;
|
|
311
|
+
gap: var(--ide-spacing-md);
|
|
312
|
+
padding-top: var(--ide-spacing-sm);
|
|
313
|
+
border-top: 1px solid var(--ide-border);
|
|
314
|
+
font-size: 10px;
|
|
315
|
+
color: var(--ide-text-muted);
|
|
316
|
+
}
|
|
317
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AIToolCall } from '../../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
toolCall: AIToolCall;
|
|
4
|
+
status?: 'pending' | 'running' | 'completed' | 'error';
|
|
5
|
+
result?: unknown;
|
|
6
|
+
error?: string;
|
|
7
|
+
duration?: number;
|
|
8
|
+
startedAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
declare const AIToolCallDisplay: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type AIToolCallDisplay = ReturnType<typeof AIToolCallDisplay>;
|
|
12
|
+
export default AIToolCallDisplay;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as AIPanel } from './AIPanel.svelte';
|
|
2
|
+
export { default as AIMessage } from './AIMessage.svelte';
|
|
3
|
+
export { default as AIMessageContent } from './AIMessageContent.svelte';
|
|
4
|
+
export { default as AIMessageActions } from './AIMessageActions.svelte';
|
|
5
|
+
export { default as AIToolCallDisplay } from './AIToolCallDisplay.svelte';
|
|
6
|
+
export { default as AIEditPreview } from './AIEditPreview.svelte';
|
|
7
|
+
export { default as AIInlineEdit } from './AIInlineEdit.svelte';
|
|
8
|
+
export { default as AISuggestionWidget } from './AISuggestionWidget.svelte';
|
|
9
|
+
export { default as AIConversationList } from './AIConversationList.svelte';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// AI components
|
|
2
|
+
export { default as AIPanel } from './AIPanel.svelte';
|
|
3
|
+
export { default as AIMessage } from './AIMessage.svelte';
|
|
4
|
+
export { default as AIMessageContent } from './AIMessageContent.svelte';
|
|
5
|
+
export { default as AIMessageActions } from './AIMessageActions.svelte';
|
|
6
|
+
export { default as AIToolCallDisplay } from './AIToolCallDisplay.svelte';
|
|
7
|
+
export { default as AIEditPreview } from './AIEditPreview.svelte';
|
|
8
|
+
export { default as AIInlineEdit } from './AIInlineEdit.svelte';
|
|
9
|
+
export { default as AISuggestionWidget } from './AISuggestionWidget.svelte';
|
|
10
|
+
export { default as AIConversationList } from './AIConversationList.svelte';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
color?: string;
|
|
7
|
+
isAI?: boolean;
|
|
8
|
+
status?: 'online' | 'offline' | 'busy' | 'error' | 'stalled';
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
name,
|
|
14
|
+
src,
|
|
15
|
+
size = 'md',
|
|
16
|
+
color,
|
|
17
|
+
isAI = false,
|
|
18
|
+
status,
|
|
19
|
+
class: className = ''
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
const sizeMap = {
|
|
23
|
+
xs: '20px',
|
|
24
|
+
sm: '24px',
|
|
25
|
+
md: '32px',
|
|
26
|
+
lg: '40px',
|
|
27
|
+
xl: '48px'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const fontSizeMap = {
|
|
31
|
+
xs: '8px',
|
|
32
|
+
sm: '10px',
|
|
33
|
+
md: '12px',
|
|
34
|
+
lg: '14px',
|
|
35
|
+
xl: '16px'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function getInitials(name: string): string {
|
|
39
|
+
return name
|
|
40
|
+
.split(' ')
|
|
41
|
+
.map((part) => part[0])
|
|
42
|
+
.join('')
|
|
43
|
+
.toUpperCase()
|
|
44
|
+
.slice(0, 2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const initials = $derived(getInitials(name));
|
|
48
|
+
const bgColor = $derived(color ?? (isAI ? 'var(--ide-collab-ai)' : 'var(--ide-interactive)'));
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
class="ide-avatar {className}"
|
|
53
|
+
class:ide-avatar--ai={isAI}
|
|
54
|
+
style="
|
|
55
|
+
--avatar-size: {sizeMap[size]};
|
|
56
|
+
--avatar-font-size: {fontSizeMap[size]};
|
|
57
|
+
--avatar-color: {bgColor};
|
|
58
|
+
"
|
|
59
|
+
title={name}
|
|
60
|
+
>
|
|
61
|
+
{#if src}
|
|
62
|
+
<img class="ide-avatar__img" {src} alt={name} />
|
|
63
|
+
{:else}
|
|
64
|
+
<span class="ide-avatar__initials">{initials}</span>
|
|
65
|
+
{/if}
|
|
66
|
+
{#if isAI}
|
|
67
|
+
<span class="ide-avatar__ai-badge">AI</span>
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
.ide-avatar {
|
|
73
|
+
position: relative;
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
width: var(--avatar-size);
|
|
78
|
+
height: var(--avatar-size);
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
background: var(--avatar-color);
|
|
81
|
+
color: white;
|
|
82
|
+
font-family: var(--ide-font-sans);
|
|
83
|
+
font-size: var(--avatar-font-size);
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ide-avatar__img {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
object-fit: cover;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ide-avatar__initials {
|
|
96
|
+
line-height: 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ide-avatar__ai-badge {
|
|
100
|
+
position: absolute;
|
|
101
|
+
bottom: -2px;
|
|
102
|
+
right: -2px;
|
|
103
|
+
padding: 1px 3px;
|
|
104
|
+
font-size: 7px;
|
|
105
|
+
font-weight: 700;
|
|
106
|
+
background: var(--ide-collab-ai);
|
|
107
|
+
border-radius: var(--ide-radius-sm);
|
|
108
|
+
border: 1px solid var(--ide-bg-primary);
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
name: string;
|
|
3
|
+
src?: string;
|
|
4
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
color?: string;
|
|
6
|
+
isAI?: boolean;
|
|
7
|
+
status?: 'online' | 'offline' | 'busy' | 'error' | 'stalled';
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Avatar: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Avatar = ReturnType<typeof Avatar>;
|
|
12
|
+
export default Avatar;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
variant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'danger' | 'info';
|
|
6
|
+
size?: 'sm' | 'md';
|
|
7
|
+
dot?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
variant = 'default',
|
|
14
|
+
size = 'md',
|
|
15
|
+
dot = false,
|
|
16
|
+
class: className = '',
|
|
17
|
+
children
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<span class="ide-badge ide-badge--{variant} ide-badge--{size} {className}">
|
|
22
|
+
{#if dot}
|
|
23
|
+
<span class="ide-badge__dot"></span>
|
|
24
|
+
{/if}
|
|
25
|
+
{@render children()}
|
|
26
|
+
</span>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.ide-badge {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--ide-spacing-xs);
|
|
33
|
+
font-family: var(--ide-font-sans);
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
border-radius: var(--ide-radius-full);
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Sizes */
|
|
40
|
+
.ide-badge--sm {
|
|
41
|
+
padding: 1px 6px;
|
|
42
|
+
font-size: 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ide-badge--md {
|
|
46
|
+
padding: 2px 8px;
|
|
47
|
+
font-size: var(--ide-font-size-xs);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Variants */
|
|
51
|
+
.ide-badge--default {
|
|
52
|
+
background: color-mix(in srgb, var(--ide-text-secondary) 12%, transparent);
|
|
53
|
+
color: var(--ide-text-secondary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ide-badge--primary {
|
|
57
|
+
background: color-mix(in srgb, var(--ide-interactive) 20%, transparent);
|
|
58
|
+
color: var(--ide-interactive);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ide-badge--success {
|
|
62
|
+
background: color-mix(in srgb, var(--ide-success) 20%, transparent);
|
|
63
|
+
color: var(--ide-success);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ide-badge--warning {
|
|
67
|
+
background: color-mix(in srgb, var(--ide-warning) 20%, transparent);
|
|
68
|
+
color: var(--ide-warning);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ide-badge--error {
|
|
72
|
+
background: color-mix(in srgb, var(--ide-error) 20%, transparent);
|
|
73
|
+
color: var(--ide-error);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ide-badge--info {
|
|
77
|
+
background: color-mix(in srgb, var(--ide-info) 20%, transparent);
|
|
78
|
+
color: var(--ide-info);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ide-badge--secondary {
|
|
82
|
+
background: var(--ide-bg-secondary);
|
|
83
|
+
color: var(--ide-text-muted);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ide-badge--danger {
|
|
87
|
+
background: color-mix(in srgb, var(--ide-error) 20%, transparent);
|
|
88
|
+
color: var(--ide-error);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Dot */
|
|
92
|
+
.ide-badge__dot {
|
|
93
|
+
width: 6px;
|
|
94
|
+
height: 6px;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
background: currentColor;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
variant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'danger' | 'info';
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
dot?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
children: Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const Badge: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type Badge = ReturnType<typeof Badge>;
|
|
11
|
+
export default Badge;
|