@townco/ui 0.1.0 → 0.1.3
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/dist/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +64 -55
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.js +121 -114
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.js +78 -80
- package/dist/core/hooks/use-media-query.d.ts +5 -5
- package/dist/core/hooks/use-media-query.js +38 -38
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/schemas/chat.d.ts +83 -56
- package/dist/core/schemas/chat.js +27 -25
- package/dist/core/store/chat-store.d.ts +28 -22
- package/dist/core/store/chat-store.js +59 -50
- package/dist/gui/components/Button.d.ts +23 -7
- package/dist/gui/components/Button.js +40 -27
- package/dist/gui/components/Card.d.ts +26 -7
- package/dist/gui/components/Card.js +54 -8
- package/dist/gui/components/ChatHeader.d.ts +58 -31
- package/dist/gui/components/ChatHeader.js +171 -66
- package/dist/gui/components/ChatInput.d.ts +58 -36
- package/dist/gui/components/ChatInput.js +191 -121
- package/dist/gui/components/ChatInterface.d.ts +9 -6
- package/dist/gui/components/ChatInterface.js +162 -90
- package/dist/gui/components/ChatLayout.d.ts +71 -41
- package/dist/gui/components/ChatLayout.js +214 -87
- package/dist/gui/components/ChatPanelTabContent.d.ts +18 -9
- package/dist/gui/components/ChatPanelTabContent.js +88 -10
- package/dist/gui/components/ChatPreview.d.ts +9 -6
- package/dist/gui/components/ChatPreview.js +212 -162
- package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
- package/dist/gui/components/ChatSecondaryPanel.js +115 -38
- package/dist/gui/components/ChatSidebar.d.ts +26 -13
- package/dist/gui/components/ChatSidebar.js +48 -14
- package/dist/gui/components/ChatStatus.d.ts +4 -2
- package/dist/gui/components/ChatStatus.js +45 -34
- package/dist/gui/components/ChatView.d.ts +5 -3
- package/dist/gui/components/ChatView.js +38 -9
- package/dist/gui/components/ConfigPanel.d.ts +16 -12
- package/dist/gui/components/ConfigPanel.js +218 -41
- package/dist/gui/components/Conversation.d.ts +17 -14
- package/dist/gui/components/Conversation.js +143 -83
- package/dist/gui/components/Dialog.d.ts +57 -11
- package/dist/gui/components/Dialog.js +84 -8
- package/dist/gui/components/DropdownMenu.d.ts +101 -20
- package/dist/gui/components/DropdownMenu.js +161 -14
- package/dist/gui/components/HeightTransition.d.ts +12 -7
- package/dist/gui/components/HeightTransition.js +88 -77
- package/dist/gui/components/Input.d.ts +13 -6
- package/dist/gui/components/Input.js +27 -16
- package/dist/gui/components/InputBox.d.ts +19 -12
- package/dist/gui/components/InputBox.js +86 -14
- package/dist/gui/components/Label.d.ts +7 -1
- package/dist/gui/components/Label.js +12 -2
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
- package/dist/gui/components/MarkdownRenderer.js +178 -81
- package/dist/gui/components/Message.d.ts +25 -18
- package/dist/gui/components/Message.js +44 -23
- package/dist/gui/components/MessageContent.d.ts +29 -22
- package/dist/gui/components/MessageContent.js +157 -85
- package/dist/gui/components/PlaygroundLayout.d.ts +9 -5
- package/dist/gui/components/PlaygroundLayout.js +43 -12
- package/dist/gui/components/Reasoning.d.ts +30 -24
- package/dist/gui/components/Reasoning.js +187 -60
- package/dist/gui/components/Response.d.ts +11 -9
- package/dist/gui/components/Response.js +229 -90
- package/dist/gui/components/Select.d.ts +69 -10
- package/dist/gui/components/Select.js +118 -12
- package/dist/gui/components/Sonner.d.ts +3 -1
- package/dist/gui/components/Sonner.js +29 -18
- package/dist/gui/components/StatusBar.d.ts +9 -5
- package/dist/gui/components/StatusBar.js +56 -9
- package/dist/gui/components/Tabs.d.ts +24 -4
- package/dist/gui/components/Tabs.js +32 -4
- package/dist/gui/components/Task.d.ts +28 -24
- package/dist/gui/components/Task.js +164 -31
- package/dist/gui/components/Textarea.d.ts +15 -7
- package/dist/gui/components/Textarea.js +63 -46
- package/dist/gui/components/ThinkingBlock.d.ts +20 -10
- package/dist/gui/components/ThinkingBlock.js +134 -35
- package/dist/gui/components/TodoList.d.ts +12 -10
- package/dist/gui/components/TodoList.js +22 -7
- package/dist/gui/components/TodoListItem.d.ts +9 -6
- package/dist/gui/components/TodoListItem.js +18 -4
- package/dist/gui/components/index.d.ts +59 -8
- package/dist/gui/components/index.js +42 -8
- package/dist/gui/lib/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.test.js +0 -1
- package/dist/sdk/client/acp-client.d.ts +88 -76
- package/dist/sdk/client/acp-client.js +215 -217
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/schemas/agent.d.ts +111 -64
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +245 -147
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +219 -135
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.js +472 -469
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.js +289 -286
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +52 -46
- package/dist/tui/components/ChatView.d.ts +4 -2
- package/dist/tui/components/ChatView.js +51 -18
- package/dist/tui/components/GameOfLife.js +64 -35
- package/dist/tui/components/InputBox.d.ts +18 -11
- package/dist/tui/components/InputBox.js +70 -10
- package/dist/tui/components/MessageList.d.ts +4 -2
- package/dist/tui/components/MessageList.js +37 -10
- package/dist/tui/components/MultiSelect.d.ts +15 -9
- package/dist/tui/components/MultiSelect.js +116 -69
- package/dist/tui/components/ReadlineInput.d.ts +12 -6
- package/dist/tui/components/ReadlineInput.js +252 -237
- package/dist/tui/components/SingleSelect.d.ts +15 -9
- package/dist/tui/components/SingleSelect.js +84 -43
- package/dist/tui/components/StatusBar.d.ts +11 -6
- package/dist/tui/components/StatusBar.js +102 -67
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +2 -3
|
@@ -1,23 +1,57 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
4
|
+
|
|
5
|
+
const ChatSidebarRoot = React.forwardRef(
|
|
6
|
+
({ className, children, ...props }, ref) => {
|
|
7
|
+
return _jsx("div", {
|
|
8
|
+
ref: ref,
|
|
9
|
+
className: cn("flex h-full flex-col", className),
|
|
10
|
+
...props,
|
|
11
|
+
children: children,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
);
|
|
7
15
|
ChatSidebarRoot.displayName = "ChatSidebar.Root";
|
|
8
|
-
const ChatSidebarHeader = React.forwardRef(
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
const ChatSidebarHeader = React.forwardRef(
|
|
17
|
+
({ className, children, ...props }, ref) => {
|
|
18
|
+
return _jsx("div", {
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: cn("border-b border-border px-4 py-3", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: children,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
);
|
|
11
26
|
ChatSidebarHeader.displayName = "ChatSidebar.Header";
|
|
12
|
-
const ChatSidebarContent = React.forwardRef(
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
const ChatSidebarContent = React.forwardRef(
|
|
28
|
+
({ className, children, ...props }, ref) => {
|
|
29
|
+
return _jsx("div", {
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: cn("flex-1 overflow-y-auto p-4", className),
|
|
32
|
+
...props,
|
|
33
|
+
children: children,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
);
|
|
15
37
|
ChatSidebarContent.displayName = "ChatSidebar.Content";
|
|
16
|
-
const ChatSidebarFooter = React.forwardRef(
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
const ChatSidebarFooter = React.forwardRef(
|
|
39
|
+
({ className, children, ...props }, ref) => {
|
|
40
|
+
return _jsx("div", {
|
|
41
|
+
ref: ref,
|
|
42
|
+
className: cn("border-t border-border px-4 py-3", className),
|
|
43
|
+
...props,
|
|
44
|
+
children: children,
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
);
|
|
19
48
|
ChatSidebarFooter.displayName = "ChatSidebar.Footer";
|
|
20
49
|
/* -------------------------------------------------------------------------------------------------
|
|
21
50
|
* Exports
|
|
22
51
|
* -----------------------------------------------------------------------------------------------*/
|
|
23
|
-
export {
|
|
52
|
+
export {
|
|
53
|
+
ChatSidebarRoot as Root,
|
|
54
|
+
ChatSidebarHeader as Header,
|
|
55
|
+
ChatSidebarContent as Content,
|
|
56
|
+
ChatSidebarFooter as Footer,
|
|
57
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
export interface ChatStatusProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
-
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare const ChatStatus: React.ForwardRefExoticComponent<
|
|
6
|
+
export declare const ChatStatus: React.ForwardRefExoticComponent<
|
|
7
|
+
ChatStatusProps & React.RefAttributes<HTMLSpanElement>
|
|
8
|
+
>;
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
export const ChatStatus = React.forwardRef(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
export const ChatStatus = React.forwardRef(
|
|
6
|
+
({ children, className, ...props }, ref) => {
|
|
7
|
+
const [displayContent, setDisplayContent] = useState(children);
|
|
8
|
+
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
9
|
+
const previousContentRef = useRef(children);
|
|
10
|
+
const isInitialMountRef = useRef(true);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
// Skip transition on initial mount
|
|
13
|
+
if (isInitialMountRef.current) {
|
|
14
|
+
isInitialMountRef.current = false;
|
|
15
|
+
previousContentRef.current = children;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// Only transition if content actually changed
|
|
19
|
+
if (previousContentRef.current === children) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Start transition out
|
|
23
|
+
setIsTransitioning(true);
|
|
24
|
+
// After fade out, update content and fade in
|
|
25
|
+
const timeoutId = setTimeout(() => {
|
|
26
|
+
setDisplayContent(children);
|
|
27
|
+
previousContentRef.current = children;
|
|
28
|
+
// Trigger fade in
|
|
29
|
+
requestAnimationFrame(() => {
|
|
30
|
+
setIsTransitioning(false);
|
|
31
|
+
});
|
|
32
|
+
}, 150); // Half of transition duration (300ms total)
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout(timeoutId);
|
|
35
|
+
};
|
|
36
|
+
}, [children]);
|
|
37
|
+
return _jsx("span", {
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: cn(
|
|
40
|
+
"text-sm text-foreground opacity-60 transition-opacity duration-300",
|
|
41
|
+
isTransitioning ? "opacity-0" : "opacity-60",
|
|
42
|
+
className,
|
|
43
|
+
),
|
|
44
|
+
...props,
|
|
45
|
+
children: displayContent,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
);
|
|
38
49
|
ChatStatus.displayName = "ChatStatus";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AcpClient } from "@agent-hub/sdk";
|
|
2
2
|
export interface ChatViewProps {
|
|
3
|
-
|
|
3
|
+
client: AcpClient | null;
|
|
4
4
|
}
|
|
5
|
-
export declare function ChatView({
|
|
6
|
-
|
|
5
|
+
export declare function ChatView({
|
|
6
|
+
client,
|
|
7
|
+
}: ChatViewProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ChatView.d.ts.map
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
useChatInput,
|
|
4
|
+
useChatMessages,
|
|
5
|
+
useChatSession,
|
|
6
|
+
} from "../../core/index.js";
|
|
4
7
|
import { InputBox } from "./InputBox.js";
|
|
5
|
-
import {
|
|
8
|
+
import { MessageList } from "./MessageList.js";
|
|
9
|
+
import { StatusBar } from "./StatusBar.js";
|
|
6
10
|
export function ChatView({ client }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
// Use headless hooks for business logic (same as TUI!)
|
|
12
|
+
const { connectionStatus, sessionId } = useChatSession(client);
|
|
13
|
+
const { messages, isStreaming } = useChatMessages(client);
|
|
14
|
+
const {
|
|
15
|
+
value,
|
|
16
|
+
isSubmitting,
|
|
17
|
+
attachedFiles,
|
|
18
|
+
onChange,
|
|
19
|
+
onSubmit,
|
|
20
|
+
onRemoveFile,
|
|
21
|
+
} = useChatInput(client);
|
|
22
|
+
return _jsxs("div", {
|
|
23
|
+
className: "flex flex-col h-screen bg-gray-50",
|
|
24
|
+
children: [
|
|
25
|
+
_jsx(StatusBar, {
|
|
26
|
+
connectionStatus: connectionStatus,
|
|
27
|
+
sessionId: sessionId,
|
|
28
|
+
isStreaming: isStreaming,
|
|
29
|
+
}),
|
|
30
|
+
_jsx(MessageList, { messages: messages }),
|
|
31
|
+
_jsx(InputBox, {
|
|
32
|
+
value: value,
|
|
33
|
+
isSubmitting: isSubmitting,
|
|
34
|
+
attachedFiles: attachedFiles,
|
|
35
|
+
onChange: onChange,
|
|
36
|
+
onSubmit: onSubmit,
|
|
37
|
+
onRemoveFile: onRemoveFile,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
});
|
|
12
41
|
}
|
|
13
|
-
//# sourceMappingURL=ChatView.js.map
|
|
42
|
+
//# sourceMappingURL=ChatView.js.map
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export interface ThemeConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
colorScheme: "light" | "dark";
|
|
3
|
+
accentColor: string;
|
|
4
|
+
typography: string;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
thinkingDisplayStyle: "collapsible" | "inline";
|
|
7
7
|
}
|
|
8
8
|
interface ConfigPanelProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
config: ThemeConfig;
|
|
10
|
+
status: string;
|
|
11
|
+
onConfigChange: (config: ThemeConfig) => void;
|
|
12
|
+
onStatusChange: (status: string) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function ConfigPanel({
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export declare function ConfigPanel({
|
|
15
|
+
config,
|
|
16
|
+
status,
|
|
17
|
+
onConfigChange,
|
|
18
|
+
onStatusChange,
|
|
19
|
+
}: ConfigPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ConfigPanel.d.ts.map
|
|
@@ -1,48 +1,225 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Label } from "./Label.js";
|
|
3
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "./Select.js";
|
|
4
2
|
import { Input } from "./Input.js";
|
|
3
|
+
import { Label } from "./Label.js";
|
|
4
|
+
import {
|
|
5
|
+
Select,
|
|
6
|
+
SelectContent,
|
|
7
|
+
SelectItem,
|
|
8
|
+
SelectTrigger,
|
|
9
|
+
SelectValue,
|
|
10
|
+
} from "./Select.js";
|
|
11
|
+
|
|
5
12
|
const fontOptions = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
"Inter",
|
|
14
|
+
"Arial",
|
|
15
|
+
"Georgia",
|
|
16
|
+
"Courier New",
|
|
17
|
+
"Times New Roman",
|
|
18
|
+
"Verdana",
|
|
12
19
|
];
|
|
13
20
|
const statusOptions = [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
"v0.1.0",
|
|
22
|
+
"Connected",
|
|
23
|
+
"Syncing...",
|
|
24
|
+
"Ready",
|
|
25
|
+
"Processing",
|
|
26
|
+
"Online",
|
|
20
27
|
];
|
|
21
|
-
export function ConfigPanel({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
export function ConfigPanel({
|
|
29
|
+
config,
|
|
30
|
+
status,
|
|
31
|
+
onConfigChange,
|
|
32
|
+
onStatusChange,
|
|
33
|
+
}) {
|
|
34
|
+
const handleColorSchemeChange = (newScheme) => {
|
|
35
|
+
onConfigChange({ ...config, colorScheme: newScheme });
|
|
36
|
+
};
|
|
37
|
+
const handleAccentColorChange = (e) => {
|
|
38
|
+
const newColor = e.target.value;
|
|
39
|
+
onConfigChange({ ...config, accentColor: newColor });
|
|
40
|
+
};
|
|
41
|
+
const handleTypographyChange = (newTypography) => {
|
|
42
|
+
onConfigChange({ ...config, typography: newTypography });
|
|
43
|
+
};
|
|
44
|
+
const handleFontSizeChange = (e) => {
|
|
45
|
+
const newSize = parseInt(e.target.value, 10);
|
|
46
|
+
if (!isNaN(newSize) && newSize > 0) {
|
|
47
|
+
onConfigChange({ ...config, fontSize: newSize });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleThinkingDisplayStyleChange = (newStyle) => {
|
|
51
|
+
onConfigChange({ ...config, thinkingDisplayStyle: newStyle });
|
|
52
|
+
};
|
|
53
|
+
const handleStatusChange = () => {
|
|
54
|
+
const currentIndex = statusOptions.indexOf(status);
|
|
55
|
+
const nextIndex = (currentIndex + 1) % statusOptions.length;
|
|
56
|
+
onStatusChange(statusOptions[nextIndex]);
|
|
57
|
+
};
|
|
58
|
+
return _jsxs("div", {
|
|
59
|
+
className:
|
|
60
|
+
"h-full p-6 bg-[var(--color-surface)] border-r border-[var(--color-border)] overflow-y-auto",
|
|
61
|
+
children: [
|
|
62
|
+
_jsx("h2", {
|
|
63
|
+
className: "text-2xl font-semibold mb-8 m-0 text-[var(--color-text)]",
|
|
64
|
+
children: "Design Configuration",
|
|
65
|
+
}),
|
|
66
|
+
_jsxs("div", {
|
|
67
|
+
className: "mb-6",
|
|
68
|
+
children: [
|
|
69
|
+
_jsx(Label, {
|
|
70
|
+
htmlFor: "color-scheme",
|
|
71
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
72
|
+
children: "Color Scheme",
|
|
73
|
+
}),
|
|
74
|
+
_jsxs(Select, {
|
|
75
|
+
value: config.colorScheme,
|
|
76
|
+
onValueChange: handleColorSchemeChange,
|
|
77
|
+
children: [
|
|
78
|
+
_jsx(SelectTrigger, {
|
|
79
|
+
id: "color-scheme",
|
|
80
|
+
className:
|
|
81
|
+
"w-full bg-[var(--color-bg)] text-[var(--color-text)] border-[var(--color-border)] focus:border-[var(--color-accent)]",
|
|
82
|
+
children: _jsx(SelectValue, {}),
|
|
83
|
+
}),
|
|
84
|
+
_jsxs(SelectContent, {
|
|
85
|
+
className: "bg-[var(--color-bg)] border-[var(--color-border)]",
|
|
86
|
+
children: [
|
|
87
|
+
_jsx(SelectItem, { value: "light", children: "Light" }),
|
|
88
|
+
_jsx(SelectItem, { value: "dark", children: "Dark" }),
|
|
89
|
+
],
|
|
90
|
+
}),
|
|
91
|
+
],
|
|
92
|
+
}),
|
|
93
|
+
],
|
|
94
|
+
}),
|
|
95
|
+
_jsxs("div", {
|
|
96
|
+
className: "mb-6",
|
|
97
|
+
children: [
|
|
98
|
+
_jsx(Label, {
|
|
99
|
+
htmlFor: "accent-color",
|
|
100
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
101
|
+
children: "Accent Color",
|
|
102
|
+
}),
|
|
103
|
+
_jsxs("div", {
|
|
104
|
+
className: "flex gap-2 items-center",
|
|
105
|
+
children: [
|
|
106
|
+
_jsx("input", {
|
|
107
|
+
type: "color",
|
|
108
|
+
id: "accent-color",
|
|
109
|
+
value: config.accentColor,
|
|
110
|
+
onChange: handleAccentColorChange,
|
|
111
|
+
className:
|
|
112
|
+
"w-[60px] h-10 border border-[var(--color-border)] rounded-md cursor-pointer bg-transparent",
|
|
113
|
+
}),
|
|
114
|
+
_jsx(Input, {
|
|
115
|
+
type: "text",
|
|
116
|
+
value: config.accentColor,
|
|
117
|
+
onChange: handleAccentColorChange,
|
|
118
|
+
pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
|
|
119
|
+
className:
|
|
120
|
+
"flex-1 bg-[var(--color-bg)] text-[var(--color-text)] border-[var(--color-border)] focus:border-[var(--color-accent)]",
|
|
121
|
+
}),
|
|
122
|
+
],
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
}),
|
|
126
|
+
_jsxs("div", {
|
|
127
|
+
className: "mb-6",
|
|
128
|
+
children: [
|
|
129
|
+
_jsx(Label, {
|
|
130
|
+
htmlFor: "typography",
|
|
131
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
132
|
+
children: "Typography",
|
|
133
|
+
}),
|
|
134
|
+
_jsxs(Select, {
|
|
135
|
+
value: config.typography,
|
|
136
|
+
onValueChange: handleTypographyChange,
|
|
137
|
+
children: [
|
|
138
|
+
_jsx(SelectTrigger, {
|
|
139
|
+
id: "typography",
|
|
140
|
+
className:
|
|
141
|
+
"w-full bg-[var(--color-bg)] text-[var(--color-text)] border-[var(--color-border)] focus:border-[var(--color-accent)]",
|
|
142
|
+
children: _jsx(SelectValue, {}),
|
|
143
|
+
}),
|
|
144
|
+
_jsx(SelectContent, {
|
|
145
|
+
className: "bg-[var(--color-bg)] border-[var(--color-border)]",
|
|
146
|
+
children: fontOptions.map((font) =>
|
|
147
|
+
_jsx(SelectItem, { value: font, children: font }, font),
|
|
148
|
+
),
|
|
149
|
+
}),
|
|
150
|
+
],
|
|
151
|
+
}),
|
|
152
|
+
],
|
|
153
|
+
}),
|
|
154
|
+
_jsxs("div", {
|
|
155
|
+
className: "mb-6",
|
|
156
|
+
children: [
|
|
157
|
+
_jsx(Label, {
|
|
158
|
+
htmlFor: "font-size",
|
|
159
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
160
|
+
children: "Font Size (px)",
|
|
161
|
+
}),
|
|
162
|
+
_jsx(Input, {
|
|
163
|
+
type: "number",
|
|
164
|
+
id: "font-size",
|
|
165
|
+
value: config.fontSize,
|
|
166
|
+
onChange: handleFontSizeChange,
|
|
167
|
+
min: "8",
|
|
168
|
+
max: "32",
|
|
169
|
+
className:
|
|
170
|
+
"w-full bg-[var(--color-bg)] text-[var(--color-text)] border-[var(--color-border)] focus:border-[var(--color-accent)]",
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
}),
|
|
174
|
+
_jsxs("div", {
|
|
175
|
+
className: "mb-6",
|
|
176
|
+
children: [
|
|
177
|
+
_jsx(Label, {
|
|
178
|
+
htmlFor: "thinking-display-style",
|
|
179
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
180
|
+
children: "Thinking Display Style",
|
|
181
|
+
}),
|
|
182
|
+
_jsxs(Select, {
|
|
183
|
+
value: config.thinkingDisplayStyle || "collapsible",
|
|
184
|
+
onValueChange: handleThinkingDisplayStyleChange,
|
|
185
|
+
children: [
|
|
186
|
+
_jsx(SelectTrigger, {
|
|
187
|
+
id: "thinking-display-style",
|
|
188
|
+
className:
|
|
189
|
+
"w-full bg-[var(--color-bg)] text-[var(--color-text)] border-[var(--color-border)] focus:border-[var(--color-accent)]",
|
|
190
|
+
children: _jsx(SelectValue, {}),
|
|
191
|
+
}),
|
|
192
|
+
_jsxs(SelectContent, {
|
|
193
|
+
className: "bg-[var(--color-bg)] border-[var(--color-border)]",
|
|
194
|
+
children: [
|
|
195
|
+
_jsx(SelectItem, {
|
|
196
|
+
value: "collapsible",
|
|
197
|
+
children: "Collapsible Section",
|
|
198
|
+
}),
|
|
199
|
+
_jsx(SelectItem, { value: "inline", children: "Inline" }),
|
|
200
|
+
],
|
|
201
|
+
}),
|
|
202
|
+
],
|
|
203
|
+
}),
|
|
204
|
+
],
|
|
205
|
+
}),
|
|
206
|
+
_jsxs("div", {
|
|
207
|
+
className: "mb-6",
|
|
208
|
+
children: [
|
|
209
|
+
_jsx(Label, {
|
|
210
|
+
htmlFor: "status-test",
|
|
211
|
+
className: "mb-2 text-[var(--color-text)]",
|
|
212
|
+
children: "Chat Status",
|
|
213
|
+
}),
|
|
214
|
+
_jsxs("button", {
|
|
215
|
+
onClick: handleStatusChange,
|
|
216
|
+
className:
|
|
217
|
+
"w-full px-4 py-2 rounded-lg bg-[var(--color-accent)] text-white font-medium hover:opacity-90 transition-opacity text-[var(--font-size)] font-[var(--font-family)]",
|
|
218
|
+
children: ["Change Status: ", status],
|
|
219
|
+
}),
|
|
220
|
+
],
|
|
221
|
+
}),
|
|
222
|
+
],
|
|
223
|
+
});
|
|
47
224
|
}
|
|
48
|
-
//# sourceMappingURL=ConfigPanel.js.map
|
|
225
|
+
//# sourceMappingURL=ConfigPanel.js.map
|
|
@@ -3,18 +3,21 @@ import * as React from "react";
|
|
|
3
3
|
* Conversation component inspired by shadcn.io/ai
|
|
4
4
|
* Auto-scrolling chat container that maintains scroll position during streaming
|
|
5
5
|
*/
|
|
6
|
-
export interface ConversationProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export interface ConversationProps
|
|
7
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** Whether to auto-scroll to bottom on new messages */
|
|
9
|
+
autoScroll?: boolean;
|
|
10
|
+
/** Whether content is currently streaming */
|
|
11
|
+
isStreaming?: boolean;
|
|
12
|
+
/** Scroll behavior type */
|
|
13
|
+
scrollBehavior?: ScrollBehavior;
|
|
14
|
+
/** Threshold for considering user at bottom (px from bottom) */
|
|
15
|
+
scrollThreshold?: number;
|
|
16
|
+
/** Show scroll-to-bottom button when not at bottom */
|
|
17
|
+
showScrollButton?: boolean;
|
|
18
|
+
/** Custom scroll button */
|
|
19
|
+
scrollButton?: React.ReactNode;
|
|
19
20
|
}
|
|
20
|
-
export declare const Conversation: React.ForwardRefExoticComponent<
|
|
21
|
+
export declare const Conversation: React.ForwardRefExoticComponent<
|
|
22
|
+
ConversationProps & React.RefAttributes<HTMLDivElement>
|
|
23
|
+
>;
|