@townco/ui 0.1.8 → 0.1.9
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/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-input.js +64 -55
- package/dist/core/hooks/use-chat-input.js.map +1 -0
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-messages.js +121 -114
- package/dist/core/hooks/use-chat-messages.js.map +1 -0
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-session.js +78 -80
- package/dist/core/hooks/use-chat-session.js.map +1 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/schemas/chat.d.ts +83 -56
- package/dist/core/schemas/chat.d.ts.map +1 -0
- package/dist/core/schemas/chat.js +27 -25
- package/dist/core/schemas/chat.js.map +1 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/store/chat-store.d.ts +28 -22
- package/dist/core/store/chat-store.d.ts.map +1 -0
- package/dist/core/store/chat-store.js +59 -50
- package/dist/core/store/chat-store.js.map +1 -0
- package/dist/gui/components/Button.d.ts +23 -7
- package/dist/gui/components/Button.d.ts.map +1 -0
- package/dist/gui/components/Button.js +40 -27
- package/dist/gui/components/Button.js.map +1 -0
- package/dist/gui/components/Card.d.ts +26 -7
- package/dist/gui/components/Card.d.ts.map +1 -0
- package/dist/gui/components/Card.js +54 -8
- package/dist/gui/components/Card.js.map +1 -0
- package/dist/gui/components/ChatInput.d.ts.map +1 -0
- package/dist/gui/components/ChatInput.js.map +1 -0
- package/dist/gui/components/ChatInterface.d.ts +12 -0
- package/dist/gui/components/ChatInterface.d.ts.map +1 -0
- package/dist/gui/components/ChatInterface.js +204 -0
- package/dist/gui/components/ChatInterface.js.map +1 -0
- package/dist/gui/components/ChatPreview.d.ts +12 -0
- package/dist/gui/components/ChatPreview.d.ts.map +1 -0
- package/dist/gui/components/ChatPreview.js +214 -0
- package/dist/gui/components/ChatPreview.js.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.js +115 -38
- package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
- package/dist/gui/components/ChatStatus.d.ts +4 -2
- package/dist/gui/components/ChatStatus.d.ts.map +1 -0
- package/dist/gui/components/ChatStatus.js +45 -34
- package/dist/gui/components/ChatStatus.js.map +1 -0
- package/dist/gui/components/ChatView.d.ts +8 -0
- package/dist/gui/components/ChatView.d.ts.map +1 -0
- package/dist/gui/components/ChatView.js +42 -0
- package/dist/gui/components/ChatView.js.map +1 -0
- package/dist/gui/components/ConfigPanel.d.ts +20 -0
- package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
- package/dist/gui/components/ConfigPanel.js +225 -0
- package/dist/gui/components/ConfigPanel.js.map +1 -0
- package/dist/gui/components/Conversation.d.ts +17 -14
- package/dist/gui/components/Conversation.d.ts.map +1 -0
- package/dist/gui/components/Conversation.js +143 -83
- package/dist/gui/components/Conversation.js.map +1 -0
- package/dist/gui/components/Dialog.d.ts +57 -11
- package/dist/gui/components/Dialog.d.ts.map +1 -0
- package/dist/gui/components/Dialog.js +84 -8
- package/dist/gui/components/Dialog.js.map +1 -0
- package/dist/gui/components/HeightTransition.d.ts +12 -7
- package/dist/gui/components/HeightTransition.d.ts.map +1 -0
- package/dist/gui/components/HeightTransition.js +88 -77
- package/dist/gui/components/HeightTransition.js.map +1 -0
- package/dist/gui/components/Input.d.ts +13 -6
- package/dist/gui/components/Input.d.ts.map +1 -0
- package/dist/gui/components/Input.js +27 -16
- package/dist/gui/components/Input.js.map +1 -0
- package/dist/gui/components/InputBox.d.ts +21 -0
- package/dist/gui/components/InputBox.d.ts.map +1 -0
- package/dist/gui/components/InputBox.js +90 -0
- package/dist/gui/components/InputBox.js.map +1 -0
- package/dist/gui/components/Label.d.ts +7 -1
- package/dist/gui/components/Label.d.ts.map +1 -0
- package/dist/gui/components/Label.js +12 -2
- package/dist/gui/components/Label.js.map +1 -0
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
- package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/gui/components/MarkdownRenderer.js +178 -81
- package/dist/gui/components/MarkdownRenderer.js.map +1 -0
- package/dist/gui/components/Message.d.ts.map +1 -0
- package/dist/gui/components/Message.js.map +1 -0
- package/dist/gui/components/MessageContent.d.ts +29 -22
- package/dist/gui/components/MessageContent.d.ts.map +1 -0
- package/dist/gui/components/MessageContent.js.map +1 -0
- package/dist/gui/components/MessageList.d.ts.map +1 -0
- package/dist/gui/components/MessageList.js.map +1 -0
- package/dist/gui/components/PlaygroundLayout.d.ts +14 -0
- package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
- package/dist/gui/components/PlaygroundLayout.js +49 -0
- package/dist/gui/components/PlaygroundLayout.js.map +1 -0
- package/dist/gui/components/Reasoning.d.ts +30 -24
- package/dist/gui/components/Reasoning.d.ts.map +1 -0
- package/dist/gui/components/Reasoning.js +187 -60
- package/dist/gui/components/Reasoning.js.map +1 -0
- package/dist/gui/components/Response.d.ts +11 -9
- package/dist/gui/components/Response.d.ts.map +1 -0
- package/dist/gui/components/Response.js +229 -90
- package/dist/gui/components/Response.js.map +1 -0
- package/dist/gui/components/Select.d.ts +69 -10
- package/dist/gui/components/Select.d.ts.map +1 -0
- package/dist/gui/components/Select.js +118 -12
- package/dist/gui/components/Select.js.map +1 -0
- package/dist/gui/components/StatusBar.d.ts +12 -0
- package/dist/gui/components/StatusBar.d.ts.map +1 -0
- package/dist/gui/components/StatusBar.js +58 -0
- package/dist/gui/components/StatusBar.js.map +1 -0
- package/dist/gui/components/Tabs.d.ts +24 -4
- package/dist/gui/components/Tabs.d.ts.map +1 -0
- package/dist/gui/components/Tabs.js +32 -4
- package/dist/gui/components/Tabs.js.map +1 -0
- package/dist/gui/components/Task.d.ts +28 -24
- package/dist/gui/components/Task.d.ts.map +1 -0
- package/dist/gui/components/Task.js +164 -31
- package/dist/gui/components/Task.js.map +1 -0
- package/dist/gui/components/Textarea.d.ts +15 -7
- package/dist/gui/components/Textarea.d.ts.map +1 -0
- package/dist/gui/components/Textarea.js +63 -46
- package/dist/gui/components/Textarea.js.map +1 -0
- package/dist/gui/components/ThinkingBlock.d.ts +20 -10
- package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/gui/components/ThinkingBlock.js +134 -35
- package/dist/gui/components/ThinkingBlock.js.map +1 -0
- package/dist/gui/components/TodoList.d.ts +12 -10
- package/dist/gui/components/TodoList.d.ts.map +1 -0
- package/dist/gui/components/TodoList.js +22 -7
- package/dist/gui/components/TodoList.js.map +1 -0
- package/dist/gui/components/TodoListItem.d.ts +9 -6
- package/dist/gui/components/TodoListItem.d.ts.map +1 -0
- package/dist/gui/components/TodoListItem.js +18 -4
- package/dist/gui/components/TodoListItem.js.map +1 -0
- package/dist/gui/components/index.d.ts.map +1 -0
- package/dist/gui/components/index.js.map +1 -0
- package/dist/gui/index.d.ts.map +1 -0
- package/dist/gui/index.js.map +1 -0
- package/dist/gui/lib/utils.d.ts.map +1 -0
- package/dist/gui/lib/utils.js +1 -1
- package/dist/gui/lib/utils.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.js +0 -1
- package/dist/sdk/client/acp-client.d.ts +88 -76
- package/dist/sdk/client/acp-client.d.ts.map +1 -0
- package/dist/sdk/client/acp-client.js +215 -217
- package/dist/sdk/client/acp-client.js.map +1 -0
- package/dist/sdk/client/index.d.ts.map +1 -0
- package/dist/sdk/client/index.js.map +1 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/schemas/agent.d.ts +111 -64
- package/dist/sdk/schemas/agent.d.ts.map +1 -0
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/agent.js.map +1 -0
- package/dist/sdk/schemas/index.d.ts.map +1 -0
- package/dist/sdk/schemas/index.js.map +1 -0
- package/dist/sdk/schemas/message.d.ts +245 -147
- package/dist/sdk/schemas/message.d.ts.map +1 -0
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/message.js.map +1 -0
- package/dist/sdk/schemas/session.d.ts +219 -135
- package/dist/sdk/schemas/session.d.ts.map +1 -0
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/schemas/session.js.map +1 -0
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.d.ts.map +1 -0
- package/dist/sdk/transports/http.js +472 -469
- package/dist/sdk/transports/http.js.map +1 -0
- package/dist/sdk/transports/index.d.ts.map +1 -0
- package/dist/sdk/transports/index.js.map +1 -0
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.d.ts.map +1 -0
- package/dist/sdk/transports/stdio.js.map +1 -0
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/types.d.ts.map +1 -0
- package/dist/sdk/transports/types.js.map +1 -0
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.d.ts.map +1 -0
- package/dist/sdk/transports/websocket.js +52 -46
- package/dist/sdk/transports/websocket.js.map +1 -0
- package/dist/tui/components/ChatView.d.ts +4 -2
- package/dist/tui/components/ChatView.d.ts.map +1 -0
- package/dist/tui/components/ChatView.js +51 -18
- package/dist/tui/components/ChatView.js.map +1 -0
- package/dist/tui/components/GameOfLife.d.ts.map +1 -0
- package/dist/tui/components/GameOfLife.js +64 -35
- package/dist/tui/components/GameOfLife.js.map +1 -0
- package/dist/tui/components/InputBox.d.ts +18 -11
- package/dist/tui/components/InputBox.d.ts.map +1 -0
- package/dist/tui/components/InputBox.js +70 -10
- package/dist/tui/components/InputBox.js.map +1 -0
- package/dist/tui/components/MessageList.d.ts +4 -2
- package/dist/tui/components/MessageList.d.ts.map +1 -0
- package/dist/tui/components/MessageList.js +37 -10
- package/dist/tui/components/MessageList.js.map +1 -0
- package/dist/tui/components/ReadlineInput.d.ts +12 -6
- package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
- package/dist/tui/components/ReadlineInput.js +252 -237
- package/dist/tui/components/ReadlineInput.js.map +1 -0
- 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.d.ts.map +1 -0
- package/dist/tui/components/StatusBar.js +102 -67
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,37 +1,170 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { CheckCircle2, ChevronDown, Circle, Loader2 } from "lucide-react";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { useState } from "react";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
export const Task = React.forwardRef(
|
|
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
|
-
|
|
6
|
+
export const Task = React.forwardRef(
|
|
7
|
+
(
|
|
8
|
+
{
|
|
9
|
+
task,
|
|
10
|
+
collapsible = true,
|
|
11
|
+
defaultExpanded = false,
|
|
12
|
+
onTaskClick,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
},
|
|
16
|
+
ref,
|
|
17
|
+
) => {
|
|
18
|
+
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
|
|
19
|
+
const hasDetails = !!(
|
|
20
|
+
task.details ||
|
|
21
|
+
(task.files && task.files.length > 0)
|
|
22
|
+
);
|
|
23
|
+
const StatusIcon = {
|
|
24
|
+
pending: Circle,
|
|
25
|
+
in_progress: Loader2,
|
|
26
|
+
completed: CheckCircle2,
|
|
27
|
+
}[task.status];
|
|
28
|
+
const getStatusColor = () => {
|
|
29
|
+
switch (task.status) {
|
|
30
|
+
case "completed":
|
|
31
|
+
return "text-green-500";
|
|
32
|
+
case "in_progress":
|
|
33
|
+
return "text-primary";
|
|
34
|
+
default:
|
|
35
|
+
return "text-foreground opacity-40";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleClick = () => {
|
|
39
|
+
if (hasDetails && collapsible) {
|
|
40
|
+
setIsExpanded(!isExpanded);
|
|
41
|
+
}
|
|
42
|
+
onTaskClick?.(task);
|
|
43
|
+
};
|
|
44
|
+
return _jsxs("div", {
|
|
45
|
+
ref: ref,
|
|
46
|
+
className: cn(
|
|
47
|
+
"rounded-lg border border-border bg-card transition-all",
|
|
48
|
+
"hover:shadow-sm hover:border-border/80",
|
|
49
|
+
className,
|
|
50
|
+
),
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
_jsxs("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: handleClick,
|
|
56
|
+
className: cn(
|
|
57
|
+
"w-full flex items-center gap-3 px-3 py-2.5 text-left",
|
|
58
|
+
hasDetails && collapsible && "cursor-pointer",
|
|
59
|
+
),
|
|
60
|
+
disabled: !hasDetails && !collapsible,
|
|
61
|
+
children: [
|
|
62
|
+
_jsx(StatusIcon, {
|
|
63
|
+
className: cn(
|
|
64
|
+
"w-4 h-4 shrink-0",
|
|
65
|
+
getStatusColor(),
|
|
66
|
+
task.status === "in_progress" && "animate-spin",
|
|
67
|
+
),
|
|
68
|
+
}),
|
|
69
|
+
_jsx("span", {
|
|
70
|
+
className: cn(
|
|
71
|
+
"flex-1 text-sm font-[var(--font-family)]",
|
|
72
|
+
task.status === "completed" && "line-through opacity-60",
|
|
73
|
+
task.status === "in_progress" && "font-medium",
|
|
74
|
+
),
|
|
75
|
+
children: task.text,
|
|
76
|
+
}),
|
|
77
|
+
hasDetails &&
|
|
78
|
+
collapsible &&
|
|
79
|
+
_jsx(ChevronDown, {
|
|
80
|
+
className: cn(
|
|
81
|
+
"w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",
|
|
82
|
+
isExpanded && "rotate-180",
|
|
83
|
+
),
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
}),
|
|
88
|
+
hasDetails &&
|
|
89
|
+
isExpanded &&
|
|
90
|
+
_jsxs("div", {
|
|
91
|
+
className:
|
|
92
|
+
"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",
|
|
93
|
+
children: [
|
|
94
|
+
task.details &&
|
|
95
|
+
_jsx("p", {
|
|
96
|
+
className:
|
|
97
|
+
"text-sm text-foreground opacity-80 leading-relaxed mb-2",
|
|
98
|
+
children: task.details,
|
|
99
|
+
}),
|
|
100
|
+
task.files &&
|
|
101
|
+
task.files.length > 0 &&
|
|
102
|
+
_jsxs("div", {
|
|
103
|
+
className: "space-y-1",
|
|
104
|
+
children: [
|
|
105
|
+
_jsx("span", {
|
|
106
|
+
className:
|
|
107
|
+
"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",
|
|
108
|
+
children: "Files:",
|
|
109
|
+
}),
|
|
110
|
+
_jsx("div", {
|
|
111
|
+
className: "space-y-1",
|
|
112
|
+
children: task.files.map((file) =>
|
|
113
|
+
_jsx(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className:
|
|
117
|
+
"text-xs font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",
|
|
118
|
+
children: file,
|
|
119
|
+
},
|
|
120
|
+
file,
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
}),
|
|
126
|
+
],
|
|
127
|
+
}),
|
|
128
|
+
],
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
);
|
|
33
132
|
Task.displayName = "Task";
|
|
34
|
-
export const TaskList = React.forwardRef(
|
|
35
|
-
|
|
36
|
-
|
|
133
|
+
export const TaskList = React.forwardRef(
|
|
134
|
+
(
|
|
135
|
+
{
|
|
136
|
+
tasks,
|
|
137
|
+
collapsible = true,
|
|
138
|
+
onTaskClick,
|
|
139
|
+
emptyMessage = "No tasks yet.",
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
},
|
|
143
|
+
ref,
|
|
144
|
+
) => {
|
|
145
|
+
return _jsx("div", {
|
|
146
|
+
ref: ref,
|
|
147
|
+
className: cn("space-y-2 max-h-96 overflow-y-auto", className),
|
|
148
|
+
...props,
|
|
149
|
+
children:
|
|
150
|
+
tasks.length === 0
|
|
151
|
+
? _jsx("p", {
|
|
152
|
+
className:
|
|
153
|
+
"text-sm text-foreground opacity-60 italic py-4 text-center",
|
|
154
|
+
children: emptyMessage,
|
|
155
|
+
})
|
|
156
|
+
: tasks.map((task) =>
|
|
157
|
+
_jsx(
|
|
158
|
+
Task,
|
|
159
|
+
{
|
|
160
|
+
task: task,
|
|
161
|
+
collapsible: collapsible,
|
|
162
|
+
...(onTaskClick ? { onTaskClick } : {}),
|
|
163
|
+
},
|
|
164
|
+
task.id,
|
|
165
|
+
),
|
|
166
|
+
),
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
);
|
|
37
170
|
TaskList.displayName = "TaskList";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/gui/components/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA4B1E,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,IAAI,EACJ,WAAW,GAAG,IAAI,EAClB,eAAe,GAAG,KAAK,EACvB,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAE7E,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE,YAAY;KACxB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,WAAW;gBACd,OAAO,gBAAgB,CAAC;YAC1B,KAAK,aAAa;gBAChB,OAAO,4BAA4B,CAAC;YACtC;gBACE,OAAO,qCAAqC,CAAC;QACjD,CAAC;IACH,CAAC,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E1F,EACP,cAAK,SAAS,EAAC,WAAW,YACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,cAEE,SAAS,EAAC,qIAAqI,YAE9I,IAAI,IAHA,KAAK,CAIN,CACP,CAAC,GACE,IACF,CACP,IACG,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAgB1B,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CACE,EACE,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,YAAY,GAAG,eAAe,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,KAC1D,KAAK,YAER,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACpB,YAAG,SAAS,EAAC,qEAAqE,YAC/E,YAAY,GACX,CACL,CAAC,CAAC,CAAC,CACF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAClB,KAAC,IAAI,IAEH,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,IAHnB,IAAI,CAAC,EAAE,CAIZ,CACH,CAAC,CACH,GACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
declare const textareaVariants: (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
declare const textareaVariants: (
|
|
4
|
+
props?:
|
|
5
|
+
| ({
|
|
6
|
+
variant?: "default" | "error" | "success" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp)
|
|
8
|
+
| undefined,
|
|
9
|
+
) => string;
|
|
10
|
+
export interface TextareaProps
|
|
11
|
+
extends React.TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
12
|
+
VariantProps<typeof textareaVariants> {
|
|
13
|
+
autoResize?: boolean;
|
|
14
|
+
maxHeight?: number;
|
|
9
15
|
}
|
|
10
|
-
declare const Textarea: React.ForwardRefExoticComponent<
|
|
16
|
+
declare const Textarea: React.ForwardRefExoticComponent<
|
|
17
|
+
TextareaProps & React.RefAttributes<HTMLTextAreaElement>
|
|
18
|
+
>;
|
|
11
19
|
export { Textarea, textareaVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EAcrB,CAAC;AAEF,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EACvD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,2FAmDb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,51 +1,68 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import * as React from "react";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
5
|
+
|
|
6
|
+
const textareaVariants = cva(
|
|
7
|
+
"flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "border-input focus-visible:ring-ring",
|
|
12
|
+
error: "border-destructive focus-visible:ring-destructive",
|
|
13
|
+
success: "border-green-500 focus-visible:ring-green-500",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
const Textarea = React.forwardRef(
|
|
22
|
+
(
|
|
23
|
+
{ className, autoResize = false, maxHeight = 200, variant, ...props },
|
|
24
|
+
ref,
|
|
25
|
+
) => {
|
|
26
|
+
const textareaRef = React.useRef(null);
|
|
27
|
+
const handleRef = React.useCallback(
|
|
28
|
+
(node) => {
|
|
29
|
+
textareaRef.current = node;
|
|
30
|
+
if (typeof ref === "function") {
|
|
31
|
+
ref(node);
|
|
32
|
+
} else if (ref) {
|
|
33
|
+
ref.current = node;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
[ref],
|
|
37
|
+
);
|
|
38
|
+
const adjustHeight = React.useCallback(() => {
|
|
39
|
+
const textarea = textareaRef.current;
|
|
40
|
+
if (!textarea || !autoResize) return;
|
|
41
|
+
// Reset height to auto to get the correct scrollHeight
|
|
42
|
+
textarea.style.height = "auto";
|
|
43
|
+
// Set new height based on content, respecting maxHeight
|
|
44
|
+
const newHeight = Math.min(textarea.scrollHeight, maxHeight);
|
|
45
|
+
textarea.style.height = `${newHeight}px`;
|
|
46
|
+
// Enable scrollbar if content exceeds maxHeight
|
|
47
|
+
if (textarea.scrollHeight > maxHeight) {
|
|
48
|
+
textarea.style.overflowY = "auto";
|
|
49
|
+
} else {
|
|
50
|
+
textarea.style.overflowY = "hidden";
|
|
51
|
+
}
|
|
52
|
+
}, [autoResize, maxHeight]);
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
adjustHeight();
|
|
55
|
+
}, [adjustHeight]);
|
|
56
|
+
return _jsx("textarea", {
|
|
57
|
+
className: cn(
|
|
58
|
+
textareaVariants({ variant }),
|
|
59
|
+
autoResize && "overflow-y-hidden",
|
|
60
|
+
className,
|
|
61
|
+
),
|
|
62
|
+
ref: handleRef,
|
|
63
|
+
...props,
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
);
|
|
50
67
|
Textarea.displayName = "Textarea";
|
|
51
68
|
export { Textarea, textareaVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/gui/components/Textarea.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;AAErC,MAAM,gBA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zC,gDAAgD;QAChD,IAAI,QAAQ,CAAC,YAAY,GAAG,SAAS,EAAE,CAAC;YACtC,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC;QACtC,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAEhC,OAAO,CACL,mBACE,SAAS,EAAE,EAAE,CACX,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,EAC7B,UAAU,IAAI,mBAAmB,EACjC,SAAS,CACV,EACD,GAAG,EAAE,SAAS,KACV,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
|
-
declare const thinkingBlockVariants: (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
declare const thinkingBlockVariants: (
|
|
3
|
+
props?:
|
|
4
|
+
| ({
|
|
5
|
+
variant?: "default" | "subtle" | "prominent" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp)
|
|
7
|
+
| undefined,
|
|
8
|
+
) => string;
|
|
9
|
+
export interface ThinkingBlockProps
|
|
10
|
+
extends VariantProps<typeof thinkingBlockVariants> {
|
|
11
|
+
thinking?: string;
|
|
12
|
+
isStreaming?: boolean;
|
|
13
|
+
displayMode?: "collapsible" | "inline";
|
|
14
|
+
className?: string;
|
|
10
15
|
}
|
|
11
|
-
export declare function ThinkingBlock({
|
|
12
|
-
|
|
16
|
+
export declare function ThinkingBlock({
|
|
17
|
+
thinking,
|
|
18
|
+
isStreaming,
|
|
19
|
+
displayMode,
|
|
20
|
+
variant,
|
|
21
|
+
className,
|
|
22
|
+
}: ThinkingBlockProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThinkingBlock.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ThinkingBlock.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,qBAAqB;;8EAc1B,CAAC;AAiBF,MAAM,WAAW,kBACf,SAAQ,YAAY,CAAC,OAAO,qBAAqB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,WAA2B,EAC3B,OAAO,EACP,SAAS,GACV,EAAE,kBAAkB,kDA+DpB"}
|
|
@@ -1,40 +1,139 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { ChevronDown } from "lucide-react";
|
|
4
3
|
import { useState } from "react";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
6
|
+
|
|
7
|
+
const thinkingBlockVariants = cva(
|
|
8
|
+
"mb-3 p-3 rounded-lg bg-card border border-border",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "opacity-70",
|
|
13
|
+
subtle: "opacity-50",
|
|
14
|
+
prominent: "opacity-90",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
const thinkingIconVariants = cva(
|
|
23
|
+
"w-4 h-4 text-foreground opacity-60 transition-transform",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
expanded: {
|
|
27
|
+
true: "rotate-180",
|
|
28
|
+
false: "",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
expanded: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
export function ThinkingBlock({
|
|
37
|
+
thinking,
|
|
38
|
+
isStreaming,
|
|
39
|
+
displayMode = "collapsible",
|
|
40
|
+
variant,
|
|
41
|
+
className,
|
|
42
|
+
}) {
|
|
43
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
44
|
+
if (!thinking && !isStreaming) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
// Inline mode - always visible
|
|
48
|
+
if (displayMode === "inline") {
|
|
49
|
+
return _jsxs("div", {
|
|
50
|
+
className: cn(thinkingBlockVariants({ variant }), className),
|
|
51
|
+
children: [
|
|
52
|
+
_jsxs("div", {
|
|
53
|
+
className: "flex items-start gap-2",
|
|
54
|
+
children: [
|
|
55
|
+
_jsx("span", {
|
|
56
|
+
className:
|
|
57
|
+
"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",
|
|
58
|
+
children: "Thinking",
|
|
59
|
+
}),
|
|
60
|
+
isStreaming &&
|
|
61
|
+
_jsx("span", {
|
|
62
|
+
className:
|
|
63
|
+
"inline-block w-2 h-2 bg-primary rounded-full animate-pulse",
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
}),
|
|
67
|
+
_jsxs("div", {
|
|
68
|
+
className:
|
|
69
|
+
"mt-2 text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",
|
|
70
|
+
children: [
|
|
71
|
+
thinking,
|
|
72
|
+
isStreaming &&
|
|
73
|
+
thinking &&
|
|
74
|
+
_jsx("span", {
|
|
75
|
+
className: "inline-block animate-typing",
|
|
76
|
+
children: "...",
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Collapsible mode
|
|
84
|
+
return _jsxs("div", {
|
|
85
|
+
className: cn("mb-3", className),
|
|
86
|
+
children: [
|
|
87
|
+
_jsxs("button", {
|
|
88
|
+
type: "button",
|
|
89
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
90
|
+
className:
|
|
91
|
+
"w-full flex items-center justify-between p-2 rounded-lg bg-card border border-border hover:bg-card transition-colors text-left",
|
|
92
|
+
children: [
|
|
93
|
+
_jsxs("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [
|
|
96
|
+
_jsx("span", {
|
|
97
|
+
className:
|
|
98
|
+
"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",
|
|
99
|
+
children: "Thinking",
|
|
100
|
+
}),
|
|
101
|
+
isStreaming &&
|
|
102
|
+
_jsx("span", {
|
|
103
|
+
className:
|
|
104
|
+
"inline-block w-2 h-2 bg-primary rounded-full animate-pulse",
|
|
105
|
+
}),
|
|
106
|
+
!isExpanded &&
|
|
107
|
+
thinking &&
|
|
108
|
+
_jsxs("span", {
|
|
109
|
+
className:
|
|
110
|
+
"text-xs text-foreground opacity-50 truncate max-w-[200px]",
|
|
111
|
+
children: [thinking.substring(0, 50), "..."],
|
|
112
|
+
}),
|
|
113
|
+
],
|
|
114
|
+
}),
|
|
115
|
+
_jsx(ChevronDown, {
|
|
116
|
+
className: thinkingIconVariants({ expanded: isExpanded }),
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
}),
|
|
120
|
+
isExpanded &&
|
|
121
|
+
_jsx("div", {
|
|
122
|
+
className: cn(thinkingBlockVariants({ variant }), "mt-2"),
|
|
123
|
+
children: _jsxs("div", {
|
|
124
|
+
className:
|
|
125
|
+
"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",
|
|
126
|
+
children: [
|
|
127
|
+
thinking,
|
|
128
|
+
isStreaming &&
|
|
129
|
+
thinking &&
|
|
130
|
+
_jsx("span", {
|
|
131
|
+
className: "inline-block animate-typing",
|
|
132
|
+
children: "...",
|
|
133
|
+
}),
|
|
134
|
+
],
|
|
135
|
+
}),
|
|
136
|
+
}),
|
|
137
|
+
],
|
|
138
|
+
});
|
|
40
139
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThinkingBlock.js","sourceRoot":"","sources":["../../../src/gui/components/ThinkingBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,qBAAqB,GAAG,GAAG,CAC/B,mFAAmF,EACnF;IACE,QAAQ,EAAE;QACR,OA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AAC,CAAC,UAAU,CAAC,EACzC,SAAS,EAAC,mLAAmL,aAE7L,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAM,SAAS,EAAC,iFAAiF,yBAE1F,EACN,WAAW,IAAI,CACd,eAAM,SAAS,EAAC,0EAA0E,GAAG,CAC9F,EACA,CAAC,UAAU,IAAI,QAAQ,IAAI,CAC1B,gBAAM,SAAS,EAAC,oEAAoE,aACjF,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,WACrB,CACR,IACG,EACN,KAAC,WAAW,IAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAI,IACnE,EACR,UAAU,IAAI,CACb,cAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,YAC5D,eAAK,SAAS,EAAC,wFAAwF,aACpG,QAAQ,EACR,WAAW,IAAI,QAAQ,IAAI,CAC1B,eAAM,SAAS,EAAC,6BAA6B,oBAAW,CACzD,IACG,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -7,14 +7,16 @@ import { type TodoItem } from "./TodoListItem.js";
|
|
|
7
7
|
* 2. Prop-based: Pass `todos` prop directly
|
|
8
8
|
*/
|
|
9
9
|
export interface TodoListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
/**
|
|
11
|
+
* ACP Client for hook-based todo fetching (future support)
|
|
12
|
+
*/
|
|
13
|
+
client?: AcpClient | null;
|
|
14
|
+
/**
|
|
15
|
+
* Todos to display (prop-based pattern)
|
|
16
|
+
* Either client or todos should be provided
|
|
17
|
+
*/
|
|
18
|
+
todos?: TodoItem[];
|
|
19
19
|
}
|
|
20
|
-
export declare const TodoList: React.ForwardRefExoticComponent<
|
|
20
|
+
export declare const TodoList: React.ForwardRefExoticComponent<
|
|
21
|
+
TodoListProps & React.RefAttributes<HTMLDivElement>
|
|
22
|
+
>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TodoList.d.ts","sourceRoot":"","sources":["../../../src/gui/components/TodoList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,sFAsBpB,CAAC"}
|
|
@@ -1,11 +1,26 @@
|
|
|
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
4
|
import { TodoListItem } from "./TodoListItem.js";
|
|
5
|
-
export const TodoList = React.forwardRef(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const TodoList = React.forwardRef(
|
|
6
|
+
({ client, todos, className, ...props }, ref) => {
|
|
7
|
+
// For now, just use prop-based todos
|
|
8
|
+
// Future: Add hook to get todos from store when available
|
|
9
|
+
const todosToDisplay = todos || [];
|
|
10
|
+
return _jsx("div", {
|
|
11
|
+
ref: ref,
|
|
12
|
+
className: cn("space-y-2 max-h-64 overflow-y-auto", className),
|
|
13
|
+
...props,
|
|
14
|
+
children:
|
|
15
|
+
todosToDisplay.length === 0
|
|
16
|
+
? _jsx("p", {
|
|
17
|
+
className: "text-sm text-foreground opacity-60 italic",
|
|
18
|
+
children: "No tasks yet.",
|
|
19
|
+
})
|
|
20
|
+
: todosToDisplay.map((todo) =>
|
|
21
|
+
_jsx(TodoListItem, { todo: todo }, todo.id),
|
|
22
|
+
),
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
);
|
|
11
26
|
TodoList.displayName = "TodoList";
|