@townco/ui 0.1.0
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/README.md +175 -0
- package/dist/core/hooks/index.d.ts +6 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js +6 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/use-chat-input.d.ts +23 -0
- package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-input.js +63 -0
- package/dist/core/hooks/use-chat-input.js.map +1 -0
- package/dist/core/hooks/use-chat-messages.d.ts +17 -0
- package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-messages.js +121 -0
- package/dist/core/hooks/use-chat-messages.js.map +1 -0
- package/dist/core/hooks/use-chat-session.d.ts +11 -0
- package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-session.js +87 -0
- package/dist/core/hooks/use-chat-session.js.map +1 -0
- package/dist/core/hooks/use-media-query.d.ts +39 -0
- package/dist/core/hooks/use-media-query.js +80 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/schemas/chat.d.ts +78 -0
- package/dist/core/schemas/chat.d.ts.map +1 -0
- package/dist/core/schemas/chat.js +49 -0
- package/dist/core/schemas/chat.js.map +1 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/store/chat-store.d.ts +30 -0
- package/dist/core/store/chat-store.d.ts.map +1 -0
- package/dist/core/store/chat-store.js +56 -0
- package/dist/core/store/chat-store.js.map +1 -0
- package/dist/gui/components/Button.d.ts +11 -0
- package/dist/gui/components/Button.d.ts.map +1 -0
- package/dist/gui/components/Button.js +33 -0
- package/dist/gui/components/Button.js.map +1 -0
- package/dist/gui/components/Card.d.ts +8 -0
- package/dist/gui/components/Card.d.ts.map +1 -0
- package/dist/gui/components/Card.js +16 -0
- package/dist/gui/components/Card.js.map +1 -0
- package/dist/gui/components/ChatHeader.d.ts +38 -0
- package/dist/gui/components/ChatHeader.js +84 -0
- package/dist/gui/components/ChatInput.d.ts +42 -0
- package/dist/gui/components/ChatInput.d.ts.map +1 -0
- package/dist/gui/components/ChatInput.js +137 -0
- package/dist/gui/components/ChatInput.js.map +1 -0
- package/dist/gui/components/ChatInterface.d.ts +9 -0
- package/dist/gui/components/ChatInterface.d.ts.map +1 -0
- package/dist/gui/components/ChatInterface.js +132 -0
- package/dist/gui/components/ChatInterface.js.map +1 -0
- package/dist/gui/components/ChatLayout.d.ts +52 -0
- package/dist/gui/components/ChatLayout.js +105 -0
- package/dist/gui/components/ChatPanelTabContent.d.ts +18 -0
- package/dist/gui/components/ChatPanelTabContent.js +15 -0
- package/dist/gui/components/ChatPreview.d.ts +9 -0
- package/dist/gui/components/ChatPreview.d.ts.map +1 -0
- package/dist/gui/components/ChatPreview.js +164 -0
- package/dist/gui/components/ChatPreview.js.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.d.ts +20 -0
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.js +44 -0
- package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
- package/dist/gui/components/ChatSidebar.d.ts +14 -0
- package/dist/gui/components/ChatSidebar.js +23 -0
- package/dist/gui/components/ChatStatus.d.ts +6 -0
- package/dist/gui/components/ChatStatus.d.ts.map +1 -0
- package/dist/gui/components/ChatStatus.js +38 -0
- package/dist/gui/components/ChatStatus.js.map +1 -0
- package/dist/gui/components/ChatView.d.ts +6 -0
- package/dist/gui/components/ChatView.d.ts.map +1 -0
- package/dist/gui/components/ChatView.js +13 -0
- package/dist/gui/components/ChatView.js.map +1 -0
- package/dist/gui/components/ConfigPanel.d.ts +16 -0
- package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
- package/dist/gui/components/ConfigPanel.js +48 -0
- package/dist/gui/components/ConfigPanel.js.map +1 -0
- package/dist/gui/components/Conversation.d.ts +20 -0
- package/dist/gui/components/Conversation.d.ts.map +1 -0
- package/dist/gui/components/Conversation.js +87 -0
- package/dist/gui/components/Conversation.js.map +1 -0
- package/dist/gui/components/Dialog.d.ts +19 -0
- package/dist/gui/components/Dialog.d.ts.map +1 -0
- package/dist/gui/components/Dialog.js +22 -0
- package/dist/gui/components/Dialog.js.map +1 -0
- package/dist/gui/components/DropdownMenu.d.ts +27 -0
- package/dist/gui/components/DropdownMenu.js +68 -0
- package/dist/gui/components/HeightTransition.d.ts +10 -0
- package/dist/gui/components/HeightTransition.d.ts.map +1 -0
- package/dist/gui/components/HeightTransition.js +80 -0
- package/dist/gui/components/HeightTransition.js.map +1 -0
- package/dist/gui/components/Input.d.ts +9 -0
- package/dist/gui/components/Input.d.ts.map +1 -0
- package/dist/gui/components/Input.js +21 -0
- package/dist/gui/components/Input.js.map +1 -0
- package/dist/gui/components/InputBox.d.ts +14 -0
- package/dist/gui/components/InputBox.d.ts.map +1 -0
- package/dist/gui/components/InputBox.js +18 -0
- package/dist/gui/components/InputBox.js.map +1 -0
- package/dist/gui/components/Label.d.ts +4 -0
- package/dist/gui/components/Label.d.ts.map +1 -0
- package/dist/gui/components/Label.js +7 -0
- package/dist/gui/components/Label.js.map +1 -0
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -0
- package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/gui/components/MarkdownRenderer.js +86 -0
- package/dist/gui/components/MarkdownRenderer.js.map +1 -0
- package/dist/gui/components/Message.d.ts +26 -0
- package/dist/gui/components/Message.d.ts.map +1 -0
- package/dist/gui/components/Message.js +33 -0
- package/dist/gui/components/Message.js.map +1 -0
- package/dist/gui/components/MessageContent.d.ts +26 -0
- package/dist/gui/components/MessageContent.d.ts.map +1 -0
- package/dist/gui/components/MessageContent.js +104 -0
- package/dist/gui/components/MessageContent.js.map +1 -0
- package/dist/gui/components/MessageList.d.ts +6 -0
- package/dist/gui/components/MessageList.d.ts.map +1 -0
- package/dist/gui/components/MessageList.js +1 -0
- package/dist/gui/components/MessageList.js.map +1 -0
- package/dist/gui/components/PlaygroundLayout.d.ts +10 -0
- package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
- package/dist/gui/components/PlaygroundLayout.js +18 -0
- package/dist/gui/components/PlaygroundLayout.js.map +1 -0
- package/dist/gui/components/Reasoning.d.ts +31 -0
- package/dist/gui/components/Reasoning.d.ts.map +1 -0
- package/dist/gui/components/Reasoning.js +70 -0
- package/dist/gui/components/Reasoning.js.map +1 -0
- package/dist/gui/components/Response.d.ts +16 -0
- package/dist/gui/components/Response.d.ts.map +1 -0
- package/dist/gui/components/Response.js +95 -0
- package/dist/gui/components/Response.js.map +1 -0
- package/dist/gui/components/Select.d.ts +13 -0
- package/dist/gui/components/Select.d.ts.map +1 -0
- package/dist/gui/components/Select.js +26 -0
- package/dist/gui/components/Select.js.map +1 -0
- package/dist/gui/components/Sonner.d.ts +5 -0
- package/dist/gui/components/Sonner.js +23 -0
- package/dist/gui/components/StatusBar.d.ts +8 -0
- package/dist/gui/components/StatusBar.d.ts.map +1 -0
- package/dist/gui/components/StatusBar.js +11 -0
- package/dist/gui/components/StatusBar.js.map +1 -0
- package/dist/gui/components/Tabs.d.ts +7 -0
- package/dist/gui/components/Tabs.d.ts.map +1 -0
- package/dist/gui/components/Tabs.js +12 -0
- package/dist/gui/components/Tabs.js.map +1 -0
- package/dist/gui/components/Task.d.ts +35 -0
- package/dist/gui/components/Task.d.ts.map +1 -0
- package/dist/gui/components/Task.js +37 -0
- package/dist/gui/components/Task.js.map +1 -0
- package/dist/gui/components/Textarea.d.ts +11 -0
- package/dist/gui/components/Textarea.d.ts.map +1 -0
- package/dist/gui/components/Textarea.js +51 -0
- package/dist/gui/components/Textarea.js.map +1 -0
- package/dist/gui/components/ThinkingBlock.d.ts +12 -0
- package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/gui/components/ThinkingBlock.js +40 -0
- package/dist/gui/components/ThinkingBlock.js.map +1 -0
- package/dist/gui/components/TodoList.d.ts +20 -0
- package/dist/gui/components/TodoList.d.ts.map +1 -0
- package/dist/gui/components/TodoList.js +11 -0
- package/dist/gui/components/TodoList.js.map +1 -0
- package/dist/gui/components/TodoListItem.d.ts +10 -0
- package/dist/gui/components/TodoListItem.d.ts.map +1 -0
- package/dist/gui/components/TodoListItem.js +7 -0
- package/dist/gui/components/TodoListItem.js.map +1 -0
- package/dist/gui/components/index.d.ts +23 -0
- package/dist/gui/components/index.d.ts.map +1 -0
- package/dist/gui/components/index.js +28 -0
- package/dist/gui/components/index.js.map +1 -0
- package/dist/gui/index.d.ts +2 -0
- package/dist/gui/index.d.ts.map +1 -0
- package/dist/gui/index.js +4 -0
- package/dist/gui/index.js.map +1 -0
- package/dist/gui/lib/utils.d.ts +2 -0
- package/dist/gui/lib/utils.d.ts.map +1 -0
- package/dist/gui/lib/utils.js +5 -0
- package/dist/gui/lib/utils.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +0 -0
- package/dist/index.test.js +1 -0
- package/dist/sdk/client/acp-client.d.ts +84 -0
- package/dist/sdk/client/acp-client.d.ts.map +1 -0
- package/dist/sdk/client/acp-client.js +225 -0
- package/dist/sdk/client/acp-client.js.map +1 -0
- package/dist/sdk/client/index.d.ts +4 -0
- package/dist/sdk/client/index.d.ts.map +1 -0
- package/dist/sdk/client/index.js +4 -0
- package/dist/sdk/client/index.js.map +1 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +9 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/schemas/agent.d.ts +87 -0
- package/dist/sdk/schemas/agent.d.ts.map +1 -0
- package/dist/sdk/schemas/agent.js +50 -0
- package/dist/sdk/schemas/agent.js.map +1 -0
- package/dist/sdk/schemas/index.d.ts +6 -0
- package/dist/sdk/schemas/index.d.ts.map +1 -0
- package/dist/sdk/schemas/index.js +6 -0
- package/dist/sdk/schemas/index.js.map +1 -0
- package/dist/sdk/schemas/message.d.ts +195 -0
- package/dist/sdk/schemas/message.d.ts.map +1 -0
- package/dist/sdk/schemas/message.js +95 -0
- package/dist/sdk/schemas/message.js.map +1 -0
- package/dist/sdk/schemas/session.d.ts +158 -0
- package/dist/sdk/schemas/session.d.ts.map +1 -0
- package/dist/sdk/schemas/session.js +54 -0
- package/dist/sdk/schemas/session.js.map +1 -0
- package/dist/sdk/transports/http.d.ts +63 -0
- package/dist/sdk/transports/http.d.ts.map +1 -0
- package/dist/sdk/transports/http.js +476 -0
- package/dist/sdk/transports/http.js.map +1 -0
- package/dist/sdk/transports/index.d.ts +7 -0
- package/dist/sdk/transports/index.d.ts.map +1 -0
- package/dist/sdk/transports/index.js +7 -0
- package/dist/sdk/transports/index.js.map +1 -0
- package/dist/sdk/transports/stdio.d.ts +28 -0
- package/dist/sdk/transports/stdio.d.ts.map +1 -0
- package/dist/sdk/transports/stdio.js +294 -0
- package/dist/sdk/transports/stdio.js.map +1 -0
- package/dist/sdk/transports/types.d.ts +63 -0
- package/dist/sdk/transports/types.d.ts.map +1 -0
- package/dist/sdk/transports/types.js +1 -0
- package/dist/sdk/transports/types.js.map +1 -0
- package/dist/sdk/transports/websocket.d.ts +20 -0
- package/dist/sdk/transports/websocket.d.ts.map +1 -0
- package/dist/sdk/transports/websocket.js +52 -0
- package/dist/sdk/transports/websocket.js.map +1 -0
- package/dist/tui/components/ChatView.d.ts +5 -0
- package/dist/tui/components/ChatView.d.ts.map +1 -0
- package/dist/tui/components/ChatView.js +24 -0
- package/dist/tui/components/ChatView.js.map +1 -0
- package/dist/tui/components/GameOfLife.d.ts +1 -0
- package/dist/tui/components/GameOfLife.d.ts.map +1 -0
- package/dist/tui/components/GameOfLife.js +50 -0
- package/dist/tui/components/GameOfLife.js.map +1 -0
- package/dist/tui/components/InputBox.d.ts +13 -0
- package/dist/tui/components/InputBox.d.ts.map +1 -0
- package/dist/tui/components/InputBox.js +15 -0
- package/dist/tui/components/InputBox.js.map +1 -0
- package/dist/tui/components/MessageList.d.ts +5 -0
- package/dist/tui/components/MessageList.d.ts.map +1 -0
- package/dist/tui/components/MessageList.js +16 -0
- package/dist/tui/components/MessageList.js.map +1 -0
- package/dist/tui/components/MultiSelect.d.ts +13 -0
- package/dist/tui/components/MultiSelect.js +72 -0
- package/dist/tui/components/ReadlineInput.d.ts +8 -0
- package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
- package/dist/tui/components/ReadlineInput.js +240 -0
- package/dist/tui/components/ReadlineInput.js.map +1 -0
- package/dist/tui/components/SingleSelect.d.ts +13 -0
- package/dist/tui/components/SingleSelect.js +46 -0
- package/dist/tui/components/StatusBar.d.ts +9 -0
- package/dist/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/tui/components/StatusBar.js +82 -0
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/tui/components/index.d.ts +11 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js +11 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +7 -0
- package/dist/tui/index.js.map +1 -0
- package/package.json +86 -0
- package/src/styles/global.css +152 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Loader2Icon } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useChatStore } from "../../core/store/chat-store.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Reasoning } from "./Reasoning.js";
|
|
8
|
+
import { Response } from "./Response.js";
|
|
9
|
+
/**
|
|
10
|
+
* MessageContent component inspired by shadcn.io/ai
|
|
11
|
+
* Provides the content container with role-based styling
|
|
12
|
+
* Handles automatic rendering of thinking, waiting states, and content
|
|
13
|
+
*/
|
|
14
|
+
// Synonyms of "thinking" in multiple languages
|
|
15
|
+
const THINKING_WORDS = [
|
|
16
|
+
"Thinking",
|
|
17
|
+
"Pensando",
|
|
18
|
+
"Pensant",
|
|
19
|
+
"Denkend",
|
|
20
|
+
"Pensando",
|
|
21
|
+
"考えている",
|
|
22
|
+
"생각 중",
|
|
23
|
+
"思考中",
|
|
24
|
+
"Размышляя",
|
|
25
|
+
"Düşünüyor",
|
|
26
|
+
"Myślący",
|
|
27
|
+
"Tänkande",
|
|
28
|
+
"Pensando",
|
|
29
|
+
"Ajatellen",
|
|
30
|
+
"Σκεπτόμενος",
|
|
31
|
+
"חושב",
|
|
32
|
+
"सोच रहा है",
|
|
33
|
+
"Berpikir",
|
|
34
|
+
];
|
|
35
|
+
const DOT_ANIMATIONS = ["...", "·..", ".·.", "..·", ".·.", "·.."];
|
|
36
|
+
function WaitingElapsedTime({ startTime }) {
|
|
37
|
+
const [elapsed, setElapsed] = React.useState(0);
|
|
38
|
+
const [thinkingWord, setThinkingWord] = React.useState(() => THINKING_WORDS[Math.floor(Math.random() * THINKING_WORDS.length)]);
|
|
39
|
+
const [dotIndex, setDotIndex] = React.useState(0);
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
const interval = setInterval(() => {
|
|
42
|
+
const now = Date.now();
|
|
43
|
+
const elapsedMs = now - startTime;
|
|
44
|
+
setElapsed(elapsedMs);
|
|
45
|
+
}, 100);
|
|
46
|
+
return () => clearInterval(interval);
|
|
47
|
+
}, [startTime]);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
const wordInterval = setInterval(() => {
|
|
50
|
+
const randomIndex = Math.floor(Math.random() * THINKING_WORDS.length);
|
|
51
|
+
setThinkingWord(THINKING_WORDS[randomIndex]);
|
|
52
|
+
}, 1500);
|
|
53
|
+
return () => clearInterval(wordInterval);
|
|
54
|
+
}, []);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
const dotInterval = setInterval(() => {
|
|
57
|
+
setDotIndex((prev) => (prev + 1) % DOT_ANIMATIONS.length);
|
|
58
|
+
}, 100);
|
|
59
|
+
return () => clearInterval(dotInterval);
|
|
60
|
+
}, []);
|
|
61
|
+
const seconds = (elapsed / 1000).toFixed(1);
|
|
62
|
+
const animatedDots = DOT_ANIMATIONS[dotIndex];
|
|
63
|
+
return (_jsxs("span", { className: "text-muted-foreground text-sm", children: [thinkingWord, animatedDots, " ", seconds, "s"] }));
|
|
64
|
+
}
|
|
65
|
+
const messageContentVariants = cva("w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors", {
|
|
66
|
+
variants: {
|
|
67
|
+
role: {
|
|
68
|
+
user: "bg-primary text-primary-foreground shadow-sm",
|
|
69
|
+
assistant: "bg-muted text-foreground",
|
|
70
|
+
system: "bg-card border border-border text-foreground opacity-80 text-sm",
|
|
71
|
+
},
|
|
72
|
+
variant: {
|
|
73
|
+
default: "",
|
|
74
|
+
outline: "border border-border",
|
|
75
|
+
ghost: "bg-transparent",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
role: "assistant",
|
|
80
|
+
variant: "default",
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
export const MessageContent = React.forwardRef(({ role: roleProp, variant, isStreaming: isStreamingProp, message, thinkingDisplayStyle = "collapsible", className, children, ...props }, ref) => {
|
|
84
|
+
// Get streaming start time from store (when using smart rendering)
|
|
85
|
+
const streamingStartTime = useChatStore((state) => state.streamingStartTime);
|
|
86
|
+
// Use smart rendering if message is provided and no custom children
|
|
87
|
+
const useSmartRendering = message && !children;
|
|
88
|
+
// Derive props from message if using smart rendering
|
|
89
|
+
const role = useSmartRendering ? message.role : roleProp || "assistant";
|
|
90
|
+
const isStreaming = useSmartRendering
|
|
91
|
+
? message.isStreaming
|
|
92
|
+
: isStreamingProp;
|
|
93
|
+
let content = children;
|
|
94
|
+
if (useSmartRendering) {
|
|
95
|
+
// Extract thinking from metadata
|
|
96
|
+
const thinking = message.metadata?.thinking;
|
|
97
|
+
const hasThinking = !!thinking;
|
|
98
|
+
// Check if waiting (streaming but no content yet)
|
|
99
|
+
const isWaiting = message.isStreaming && !message.content && message.role === "assistant";
|
|
100
|
+
content = (_jsxs(_Fragment, { children: [message.role === "assistant" && hasThinking && (_jsx(Reasoning, { content: thinking, isStreaming: message.isStreaming, mode: thinkingDisplayStyle, autoCollapse: true })), isWaiting && streamingStartTime && (_jsxs("div", { className: "flex items-center gap-2 opacity-50", children: [_jsx(Loader2Icon, { className: "size-4 animate-spin text-muted-foreground" }), _jsx(WaitingElapsedTime, { startTime: streamingStartTime })] })), message.role === "user" ? (_jsx("div", { className: "whitespace-pre-wrap", children: message.content })) : (_jsx(Response, { content: message.content, isStreaming: message.isStreaming, showEmpty: false }))] }));
|
|
101
|
+
}
|
|
102
|
+
return (_jsx("div", { ref: ref, className: cn(messageContentVariants({ role, variant }), isStreaming && "animate-pulse-subtle", className), ...props, children: content }));
|
|
103
|
+
});
|
|
104
|
+
MessageContent.displayName = "MessageContent";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageContent.js","sourceRoot":"","sources":["../../../src/gui/components/MessageContent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,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,CAC9C,KAAC,SAAS,IACR,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,IAAI,EAAE,oBAAoB,EAC1B,YAAY,EAAE,IAAI,GAClB,CACH,EAGA,SAAS,IAAI,kBAAkB,IAAI,CAClC,eAAK,SAAS,EAAC,oCAAoC,aACjD,KAAC,WAAW,IAAC,SAAS,EAAC,wDAAwD,GAAG,EAClF,KAAC,kBAAkB,IAAC,SAAS,EAAE,kBAAkB,GAAI,IACjD,CACP,EAGA,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CACzB,cAAK,SAAS,EAAC,qBAAqB,YAAE,OAAO,CAAC,OAAO,GAAO,CAC7D,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IACP,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,SAAS,EAAE,KAAK,GAChB,CACH,IACA,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EACzC,WAAW,IAAI,sBAAsB,EACrC,SAAS,CACV,KACG,KAAK,YAER,OAAO,GACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DisplayMessage as CoreDisplayMessage } from "../../core/schemas/chat.js";
|
|
2
|
+
/**
|
|
3
|
+
* MessageList type exports
|
|
4
|
+
* Apps should compose their own MessageList using Message, MessageContent, Response, and Reasoning primitives
|
|
5
|
+
*/
|
|
6
|
+
export type DisplayMessage = CoreDisplayMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/gui/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEvF;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.js","sourceRoot":"","sources":["../../../src/gui/components/MessageList.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ThemeConfig } from "./ConfigPanel.js";
|
|
2
|
+
declare const DEFAULT_CONFIG: ThemeConfig;
|
|
3
|
+
interface PlaygroundLayoutProps {
|
|
4
|
+
initialConfig?: ThemeConfig;
|
|
5
|
+
initialStatus?: string;
|
|
6
|
+
iframeSrc?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function PlaygroundLayout({ initialConfig, initialStatus, iframeSrc, }: PlaygroundLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { DEFAULT_CONFIG };
|
|
10
|
+
//# sourceMappingURL=PlaygroundLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaygroundLayout.d.ts","sourceRoot":"","sources":["../../../src/gui/components/PlaygroundLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGjE,QAAA,MAAM,cAAc,EAAE,WAMrB,CAAC;AAEF,UAAU,qBAAqB;IAC7B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAA8B,EAC9B,aAAwB,EACxB,SAAS,GACV,EAAE,qBAAqB,2CAwBvB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { ConfigPanel } from "./ConfigPanel.js";
|
|
4
|
+
import { ChatPreview } from "./ChatPreview.js";
|
|
5
|
+
const DEFAULT_CONFIG = {
|
|
6
|
+
colorScheme: "light",
|
|
7
|
+
accentColor: "#646cff",
|
|
8
|
+
typography: "Inter",
|
|
9
|
+
fontSize: 16,
|
|
10
|
+
thinkingDisplayStyle: "collapsible",
|
|
11
|
+
};
|
|
12
|
+
export function PlaygroundLayout({ initialConfig = DEFAULT_CONFIG, initialStatus = "v0.1.0", iframeSrc, }) {
|
|
13
|
+
const [config, setConfig] = useState(initialConfig);
|
|
14
|
+
const [status, setStatus] = useState(initialStatus);
|
|
15
|
+
return (_jsx("div", { className: "w-full h-screen overflow-hidden", "data-theme": config.colorScheme, children: _jsxs("div", { className: "flex h-full w-full", children: [_jsx("div", { className: "w-[400px] flex-shrink-0 h-full overflow-hidden", children: _jsx(ConfigPanel, { config: config, status: status, onConfigChange: setConfig, onStatusChange: setStatus }) }), _jsx("div", { className: "flex-1 h-full overflow-hidden [background-image:radial-gradient(var(--color-border)_1px,var(--color-bg)_1px)] [background-size:20px_20px] flex items-center justify-center p-5", children: _jsx(ChatPreview, { config: config, status: status, iframeSrc: iframeSrc }) })] }) }));
|
|
16
|
+
}
|
|
17
|
+
export { DEFAULT_CONFIG };
|
|
18
|
+
//# sourceMappingURL=PlaygroundLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaygroundLayout.js","sourceRoot":"","sources":["../../../src/gui/components/PlaygroundLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,cAAc,GAAgB;IAClC,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,OAAO;IACnB,QAAQ,EAAE,EAAE;IACZ,oBAAoB,EAAE,aAAa;CACpC,CAAC;AAQF,MAAM,UAAU,gBAAgB,CAAC,EAC/B,aAAa,GAAG,cAAc,EAC9B,aAAa,GAAG,QAAQ,EACxB,SAAS,GACa;IACtB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAc,aAAa,CAAC,CAAC;IACjE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEpD,OAAO,CACL,cACE,SAAS,EAAC,iCAAiC,gBAC/B,MAAM,CAAC,WAAW,YAE9B,eAAK,SAAS,EAAC,oBAAoB,aACjC,cAAK,SAAS,EAAC,gDAAgD,YAC7D,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,SAAS,EACzB,cAAc,EAAE,SAAS,GACzB,GACE,EACN,cAAK,SAAS,EAAC,gLAAgL,YAC7L,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,GACjE,IACF,GACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Reasoning component inspired by shadcn.io/ai
|
|
5
|
+
* Displays AI thinking/reasoning process with auto-collapse support
|
|
6
|
+
*/
|
|
7
|
+
declare const reasoningContainerVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "subtle" | "prominent" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface ReasoningProps extends VariantProps<typeof reasoningContainerVariants> {
|
|
11
|
+
/** The reasoning/thinking content */
|
|
12
|
+
content?: string;
|
|
13
|
+
/** Whether the content is currently streaming */
|
|
14
|
+
isStreaming?: boolean;
|
|
15
|
+
/** Display mode - collapsible or always visible */
|
|
16
|
+
mode?: "collapsible" | "inline";
|
|
17
|
+
/** Default expanded state (default: false - collapsed by default) */
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
/** Auto-expand when streaming starts (default: false) */
|
|
20
|
+
autoExpand?: boolean;
|
|
21
|
+
/** Auto-collapse after streaming completes */
|
|
22
|
+
autoCollapse?: boolean;
|
|
23
|
+
/** Delay before auto-collapsing (ms) */
|
|
24
|
+
autoCollapseDelay?: number;
|
|
25
|
+
/** Custom label */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Additional CSS class */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const Reasoning: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reasoning.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Reasoning.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;GAGG;AAEH,QAAA,MAAM,0BAA0B;;8EAc/B,CAAC;AAiBF,MAAM,WAAW,cACf,SAAQ,YAAY,CAAC,OAAO,0BAA0B,CAAC;IACvD,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IAChC,qEAAqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,uFA+HrB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { ChevronDown } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* Reasoning component inspired by shadcn.io/ai
|
|
9
|
+
* Displays AI thinking/reasoning process with auto-collapse support
|
|
10
|
+
*/
|
|
11
|
+
const reasoningContainerVariants = cva("mb-3 rounded-lg bg-card border border-border transition-all", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "opacity-70",
|
|
15
|
+
subtle: "opacity-50",
|
|
16
|
+
prominent: "opacity-90 shadow-sm",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const reasoningIconVariants = cva("w-4 h-4 text-foreground opacity-60 transition-transform duration-200", {
|
|
24
|
+
variants: {
|
|
25
|
+
expanded: {
|
|
26
|
+
true: "rotate-180",
|
|
27
|
+
false: "",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
expanded: false,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export const Reasoning = React.forwardRef(({ content, isStreaming = false, mode = "collapsible", defaultExpanded = false, autoExpand = false, autoCollapse = true, autoCollapseDelay = 2000, label = "Thinking", variant, className, }, ref) => {
|
|
35
|
+
const [isExpanded, setIsExpanded] = useState(mode === "inline" ? true : defaultExpanded);
|
|
36
|
+
const [shouldAutoCollapse, setShouldAutoCollapse] = useState(false);
|
|
37
|
+
// Handle auto-collapse after streaming completes
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (autoCollapse && !isStreaming && content && mode === "collapsible") {
|
|
40
|
+
const timer = setTimeout(() => {
|
|
41
|
+
setShouldAutoCollapse(true);
|
|
42
|
+
setIsExpanded(false);
|
|
43
|
+
}, autoCollapseDelay);
|
|
44
|
+
return () => clearTimeout(timer);
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}, [isStreaming, content, autoCollapse, autoCollapseDelay, mode]);
|
|
48
|
+
// Auto-expand when streaming starts (only if autoExpand is enabled)
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (autoExpand &&
|
|
51
|
+
isStreaming &&
|
|
52
|
+
mode === "collapsible" &&
|
|
53
|
+
!shouldAutoCollapse) {
|
|
54
|
+
setIsExpanded(true);
|
|
55
|
+
}
|
|
56
|
+
}, [autoExpand, isStreaming, mode, shouldAutoCollapse]);
|
|
57
|
+
if (!content && !isStreaming) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
// Inline mode - always visible
|
|
61
|
+
if (mode === "inline") {
|
|
62
|
+
return (_jsxs("div", { ref: ref, className: cn(reasoningContainerVariants({ variant }), "p-3", className), children: [_jsxs("div", { className: "flex items-start gap-2 mb-2", children: [_jsx("span", { className: "text-xs font-medium text-foreground opacity-60 uppercase tracking-wide", children: label }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse" }))] }), _jsxs("div", { className: "text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [content, isStreaming && content && (_jsx("span", { className: "inline-block animate-typing text-primary", children: "..." }))] })] }));
|
|
63
|
+
}
|
|
64
|
+
// Collapsible mode
|
|
65
|
+
return (_jsxs("div", { ref: ref, className: cn("mb-3", className), children: [_jsxs("button", { type: "button", onClick: () => {
|
|
66
|
+
setIsExpanded(!isExpanded);
|
|
67
|
+
setShouldAutoCollapse(false); // Disable auto-collapse on manual interaction
|
|
68
|
+
}, className: "w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left", "aria-expanded": isExpanded, "aria-label": `${isExpanded ? "Collapse" : "Expand"} reasoning`, children: [_jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [_jsx("span", { className: "text-xs font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0", children: label }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0" })), !isExpanded && content && (_jsxs("span", { className: "text-xs text-foreground opacity-50 truncate", children: [content.substring(0, 60), content.length > 60 && "..."] }))] }), _jsx(ChevronDown, { className: reasoningIconVariants({ expanded: isExpanded }), "aria-hidden": "true" })] }), isExpanded && (_jsx("div", { className: cn(reasoningContainerVariants({ variant }), "mt-2 p-3 animate-fadeIn"), children: _jsxs("div", { className: "text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [content, isStreaming && content && (_jsx("span", { className: "inline-block animate-typing text-primary", children: "..." }))] }) }))] }));
|
|
69
|
+
});
|
|
70
|
+
Reasoning.displayName = "Reasoning";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reasoning.js","sourceRoot":"","sources":["../../../src/gui/components/Reasoning.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;GAGG;AAEH,MAAM,0BAA0B,G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C,KAAK,CAAC,CAAC,CAAC,8CAA8C;gBAC9E,CAAC,EACD,SAAS,EAAC,qMAAqM,mBAChM,UAAU,gBACb,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,YAAY,aAE7D,eAAK,SAAS,EAAC,wCAAwC,aACrD,eAAM,SAAS,EAAC,0FAA0F,YACvG,KAAK,GACD,EACN,WAAW,IAAI,CACd,eAAM,SAAS,EAAC,mFAAmF,GAAG,CACvG,EACA,CAAC,UAAU,IAAI,OAAO,IAAI,CACzB,gBAAM,SAAS,EAAC,sDAAsD,aACnE,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EACxB,OAAO,CAAC,MAAM,GAAG,EAAE,IAAI,KAAK,IACxB,CACR,IACG,EACN,KAAC,WAAW,IACV,SAAS,EAAE,qBAAqB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,iBAC9C,MAAM,GAClB,IACK,EACR,UAAU,IAAI,CACb,cACE,SAAS,EAAE,EAAE,CACX,0BAA0B,CAAC,EAAE,OAAO,EAAE,CAAC,EACvC,yBAAyB,CAC1B,YAED,eAAK,SAAS,EAAC,wFAAwF,aACpG,OAAO,EACP,WAAW,IAAI,OAAO,IAAI,CACzB,eAAM,SAAS,EAAC,wDAAwD,oBAEjE,CACR,IACG,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Response component inspired by shadcn.io/ai
|
|
4
|
+
* Streaming-optimized markdown renderer for AI-generated content
|
|
5
|
+
*/
|
|
6
|
+
export interface ResponseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** The markdown content to render */
|
|
8
|
+
content: string;
|
|
9
|
+
/** Whether the content is currently streaming */
|
|
10
|
+
isStreaming?: boolean;
|
|
11
|
+
/** Show empty state when no content */
|
|
12
|
+
showEmpty?: boolean;
|
|
13
|
+
/** Custom empty state message */
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Response: React.ForwardRefExoticComponent<ResponseProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Response.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AAEH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,sFA8NpB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import ReactMarkdown from "react-markdown";
|
|
4
|
+
import remarkGfm from "remark-gfm";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
export const Response = React.forwardRef(({ content, isStreaming = false, showEmpty = true, emptyMessage = "", className, ...props }, ref) => {
|
|
7
|
+
// Show empty state during streaming if no content yet
|
|
8
|
+
if (!content && isStreaming && showEmpty) {
|
|
9
|
+
return (_jsx("div", { ref: ref, className: cn("opacity-70 italic text-sm", className), ...props, children: emptyMessage }));
|
|
10
|
+
}
|
|
11
|
+
if (!content) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const components = {
|
|
15
|
+
// Table styling
|
|
16
|
+
table: ({ node, ...props }) => (_jsx("div", { className: "overflow-x-auto my-4", children: _jsx("table", { className: "min-w-full border-collapse border border-border rounded-md", ...props }) })),
|
|
17
|
+
thead: ({ node, ...props }) => (_jsx("thead", { className: "bg-card border-b border-border", ...props })),
|
|
18
|
+
tbody: ({ node, ...props }) => _jsx("tbody", { ...props }),
|
|
19
|
+
tr: ({ node, ...props }) => (_jsx("tr", { className: "border-b border-border hover:bg-card transition-colors", ...props })),
|
|
20
|
+
th: ({ node, ...props }) => (_jsx("th", { className: "px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0", ...props })),
|
|
21
|
+
td: ({ node, ...props }) => (_jsx("td", { className: "px-4 py-2 text-foreground border-r border-border last:border-r-0", ...props })),
|
|
22
|
+
// Task list styling
|
|
23
|
+
input: ({ node, checked, ...props }) => {
|
|
24
|
+
if (props.type === "checkbox") {
|
|
25
|
+
return (_jsx("input", { type: "checkbox", checked: checked || false, disabled: true, readOnly: true, className: "mr-2 w-4 h-4 accent-[primary] cursor-not-allowed", ...props }));
|
|
26
|
+
}
|
|
27
|
+
return _jsx("input", { ...props });
|
|
28
|
+
},
|
|
29
|
+
// Code block styling with enhanced shadows
|
|
30
|
+
code: ({ node, ...props }) => {
|
|
31
|
+
const inline = !props.className?.includes("language-");
|
|
32
|
+
if (inline) {
|
|
33
|
+
return (_jsx("code", { className: "px-1.5 py-0.5 bg-card border border-border rounded text-sm font-mono text-foreground", ...props }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsx("code", { className: "block p-4 bg-card border border-border rounded-md overflow-x-auto text-sm font-mono text-foreground shadow-sm", ...props }));
|
|
36
|
+
},
|
|
37
|
+
pre: ({ node, ...props }) => (_jsx("pre", { className: "my-4 rounded-lg", ...props })),
|
|
38
|
+
// Heading styling with improved hierarchy
|
|
39
|
+
h1: ({ node, ...props }) => (_jsx("h1", { className: "text-2xl font-bold mt-6 mb-4 text-foreground border-b border-border pb-2", ...props })),
|
|
40
|
+
h2: ({ node, ...props }) => (_jsx("h2", { className: "text-xl font-semibold mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5", ...props })),
|
|
41
|
+
h3: ({ node, ...props }) => (_jsx("h3", { className: "text-lg font-semibold mt-4 mb-2 text-foreground", ...props })),
|
|
42
|
+
h4: ({ node, ...props }) => (_jsx("h4", { className: "text-base font-semibold mt-3 mb-2 text-foreground", ...props })),
|
|
43
|
+
// List styling
|
|
44
|
+
ul: ({ node, ...props }) => {
|
|
45
|
+
// Check if this is a task list by looking for checkbox inputs in children
|
|
46
|
+
const isTaskList = node?.children?.some((child) => typeof child === "object" &&
|
|
47
|
+
child !== null &&
|
|
48
|
+
"type" in child &&
|
|
49
|
+
child.type === "element" &&
|
|
50
|
+
"tagName" in child &&
|
|
51
|
+
child.tagName === "li" &&
|
|
52
|
+
"children" in child &&
|
|
53
|
+
Array.isArray(child.children) &&
|
|
54
|
+
child.children.some((grandChild) => typeof grandChild === "object" &&
|
|
55
|
+
grandChild !== null &&
|
|
56
|
+
"type" in grandChild &&
|
|
57
|
+
grandChild.type === "element" &&
|
|
58
|
+
"tagName" in grandChild &&
|
|
59
|
+
grandChild.tagName === "input" &&
|
|
60
|
+
"properties" in grandChild &&
|
|
61
|
+
typeof grandChild.properties === "object" &&
|
|
62
|
+
grandChild.properties !== null &&
|
|
63
|
+
"type" in grandChild.properties &&
|
|
64
|
+
grandChild.properties.type === "checkbox"));
|
|
65
|
+
return (_jsx("ul", { className: cn("my-2 space-y-1 text-foreground", isTaskList ? "list-none space-y-2" : "list-disc list-inside"), ...props }));
|
|
66
|
+
},
|
|
67
|
+
ol: ({ node, ...props }) => (_jsx("ol", { className: "list-decimal list-inside my-2 space-y-1 text-foreground", ...props })),
|
|
68
|
+
// List item styling
|
|
69
|
+
li: ({ node, ...props }) => {
|
|
70
|
+
// Check if this li contains a checkbox (task list item)
|
|
71
|
+
const isTaskListItem = node?.children?.some((child) => typeof child === "object" &&
|
|
72
|
+
child !== null &&
|
|
73
|
+
"type" in child &&
|
|
74
|
+
child.type === "element" &&
|
|
75
|
+
"tagName" in child &&
|
|
76
|
+
child.tagName === "input" &&
|
|
77
|
+
"properties" in child &&
|
|
78
|
+
typeof child.properties === "object" &&
|
|
79
|
+
child.properties !== null &&
|
|
80
|
+
"type" in child.properties &&
|
|
81
|
+
child.properties.type === "checkbox");
|
|
82
|
+
return (_jsx("li", { className: cn("flex items-start", isTaskListItem ? "gap-2" : "ml-2"), ...props }));
|
|
83
|
+
},
|
|
84
|
+
// Link styling with hover effect
|
|
85
|
+
a: ({ node, ...props }) => (_jsx("a", { className: "text-primary hover:underline decoration-2 underline-offset-2 transition-all", target: "_blank", rel: "noopener noreferrer", ...props })),
|
|
86
|
+
// Paragraph styling
|
|
87
|
+
p: ({ node, ...props }) => (_jsx("p", { className: "my-2 text-foreground leading-relaxed", ...props })),
|
|
88
|
+
// Blockquote styling with enhanced visual
|
|
89
|
+
blockquote: ({ node, ...props }) => (_jsx("blockquote", { className: "border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm", ...props })),
|
|
90
|
+
// Horizontal rule
|
|
91
|
+
hr: ({ node, ...props }) => (_jsx("hr", { className: "my-6 border-t border-border opacity-50", ...props })),
|
|
92
|
+
};
|
|
93
|
+
return (_jsxs("div", { ref: ref, className: cn("markdown-content prose prose-sm max-w-none dark:prose-invert", className), ...props, children: [_jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components: components, children: content }), isStreaming && content && (_jsx("span", { className: "inline-block ml-1 animate-typing text-primary", children: "..." }))] }));
|
|
94
|
+
});
|
|
95
|
+
Response.displayName = "Response";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../src/gui/components/Response.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,i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C,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAcxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAc1B,CAAC;AAIH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAoBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
import { Check, ChevronDown, ChevronsUpDown, ChevronUp } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
const Select = SelectPrimitive.Root;
|
|
7
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
8
|
+
const SelectValue = SelectPrimitive.Value;
|
|
9
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronsUpDown, { className: "h-4 w-4 opacity-50" }) })] })));
|
|
10
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
11
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
12
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
13
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronDown, { className: "h-4 w-4" }) })));
|
|
14
|
+
SelectScrollDownButton.displayName =
|
|
15
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
16
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" &&
|
|
17
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
|
|
18
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
|
|
19
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
20
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className), ...props })));
|
|
21
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
22
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
|
|
23
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
24
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
|
|
25
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
26
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/gui/components/Select.t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onner";
|
|
3
|
+
const Toaster = ({ ...props }) => {
|
|
4
|
+
return (_jsx(Sonner, { position: "top-center", className: "toaster group", style: {
|
|
5
|
+
"--top-offset": "16px",
|
|
6
|
+
"--width:": "calc(100% - 2 * var(--top-offset))",
|
|
7
|
+
position: "absolute",
|
|
8
|
+
zIndex: 5,
|
|
9
|
+
top: "var(--top-offset)",
|
|
10
|
+
left: "50%",
|
|
11
|
+
transform: "translateX(-50%)",
|
|
12
|
+
width: "calc(100% - 2 * var(--top-offset))",
|
|
13
|
+
maxWidth: "480px",
|
|
14
|
+
}, offset: 0, toastOptions: {
|
|
15
|
+
classNames: {
|
|
16
|
+
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
17
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
18
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
19
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
20
|
+
},
|
|
21
|
+
}, ...props }));
|
|
22
|
+
};
|
|
23
|
+
export { Toaster };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConnectionStatus } from "../../core/index.js";
|
|
2
|
+
export interface StatusBarProps {
|
|
3
|
+
connectionStatus: ConnectionStatus;
|
|
4
|
+
sessionId: string | null;
|
|
5
|
+
isStreaming: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function StatusBar({ connectionStatus, sessionId, isStreaming, }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=StatusBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../src/gui/components/StatusBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,SAAS,CAAC,EACxB,gBAAgB,EAChB,SAAS,EACT,WAAW,GACZ,EAAE,cAAc,2CAsChB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function StatusBar({ connectionStatus, sessionId, isStreaming, }) {
|
|
3
|
+
const statusStyles = {
|
|
4
|
+
connected: "bg-green-100 text-green-800",
|
|
5
|
+
connecting: "bg-yellow-100 text-yellow-800",
|
|
6
|
+
disconnected: "bg-gray-100 text-gray-800",
|
|
7
|
+
error: "bg-red-100 text-red-800",
|
|
8
|
+
};
|
|
9
|
+
return (_jsx("div", { className: "border-b border-gray-200 px-4 py-3 bg-white", children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-700", children: "Status:" }), _jsx("span", { className: `px-2 py-1 rounded-full text-xs font-medium ${statusStyles[connectionStatus]}`, children: connectionStatus })] }), sessionId && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-700", children: "Session:" }), _jsxs("span", { className: "text-xs font-mono text-cyan-600", children: [sessionId.slice(0, 8), "..."] })] })), isStreaming && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "animate-pulse w-2 h-2 rounded-full bg-yellow-500" }), _jsx("span", { className: "text-xs text-yellow-600", children: "Streaming..." })] }))] }) }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=StatusBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/gui/components/StatusBar.tsx"],"names":[],"mappings":";AASA,MAAM,UAAU,SAAS,CAAC,EACxB,gBAAgB,EAChB,SAAS,EACT,WAAW,GACI;IACf,MAAM,YAAY,GAAG;QACnB,SAAS,EAAE,6BAA6B;QACxC,UAAU,EAAE,+BAA+B;QAC3C,YAAY,EAAE,2BAA2B;QACzC,KAAK,EAAE,yBAAyB;KACjC,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAC,6CAA6C,YAC1D,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAM,SAAS,EAAC,mCAAmC,wBAAe,EAClE,eACE,SAAS,EAAE,8CAA8C,YAAY,CAAC,gBAAgB,CAAC,EAAE,YAExF,gBAAgB,GACZ,IACH,EAEL,SAAS,IAAI,CACZ,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAM,SAAS,EAAC,mCAAmC,yBAAgB,EACnE,gBAAM,SAAS,EAAC,iCAAiC,aAC9C,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,WACjB,IACH,CACP,EAEA,WAAW,IAAI,CACd,eAAK,SAAS,EAAC,yBAAyB,aACtC,cAAK,SAAS,EAAC,kDAAkD,GAAG,EACpE,eAAM,SAAS,EAAC,yBAAyB,6BAAoB,IACzD,CACP,IACG,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAGtD,QAAA,MAAM,IAAI,gGAAqB,CAAC;AAEhC,QAAA,MAAM,QAAQ,uJAYZ,CAAC;AAGH,QAAA,MAAM,WAAW,gKAYf,CAAC;AAGH,QAAA,MAAM,WAAW,0JAYf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
const Tabs = TabsPrimitive.Root;
|
|
6
|
+
const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1", className), ...props })));
|
|
7
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
8
|
+
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", className), ...props })));
|
|
9
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
10
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Content, { ref: ref, className: cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className), ...props })));
|
|
11
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
12
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/gui/components/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AAEhC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,aAAa,CAAC,IAAI,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,mFAAmF,EACnF,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,aAAa,CAAC,OAAO,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,qYAAqY,EACrY,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC,O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