@townco/ui 0.1.0 → 0.1.6

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