@townco/ui 0.1.6 → 0.1.8
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 +11 -11
- package/dist/core/hooks/index.d.ts +1 -0
- package/dist/core/hooks/index.js +1 -0
- package/dist/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +55 -64
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.js +114 -121
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.js +80 -78
- package/dist/core/hooks/use-media-query.d.ts +5 -5
- package/dist/core/hooks/use-media-query.js +42 -38
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/schemas/chat.d.ts +56 -83
- package/dist/core/schemas/chat.js +25 -27
- package/dist/core/store/chat-store.d.ts +22 -28
- package/dist/core/store/chat-store.js +50 -59
- package/dist/gui/components/Button.d.ts +7 -23
- package/dist/gui/components/Button.js +27 -40
- package/dist/gui/components/Card.d.ts +7 -26
- package/dist/gui/components/Card.js +8 -54
- package/dist/gui/components/ChatHeader.d.ts +31 -58
- package/dist/gui/components/ChatHeader.js +68 -171
- package/dist/gui/components/ChatInput.d.ts +54 -58
- package/dist/gui/components/ChatInput.js +207 -194
- package/dist/gui/components/ChatInputCommandMenu.d.ts +20 -0
- package/dist/gui/components/ChatInputCommandMenu.js +62 -0
- package/dist/gui/components/ChatLayout.d.ts +41 -71
- package/dist/gui/components/ChatLayout.js +87 -214
- package/dist/gui/components/ChatPanelTabContent.d.ts +9 -18
- package/dist/gui/components/ChatPanelTabContent.js +10 -88
- package/dist/gui/components/ChatSecondaryPanel.d.ts +11 -14
- package/dist/gui/components/ChatSecondaryPanel.js +38 -115
- package/dist/gui/components/ChatSidebar.d.ts +13 -26
- package/dist/gui/components/ChatSidebar.js +14 -48
- package/dist/gui/components/ChatStatus.d.ts +2 -4
- package/dist/gui/components/ChatStatus.js +34 -45
- package/dist/gui/components/Conversation.d.ts +14 -17
- package/dist/gui/components/Conversation.js +83 -143
- package/dist/gui/components/Dialog.d.ts +11 -57
- package/dist/gui/components/Dialog.js +8 -84
- package/dist/gui/components/DropdownMenu.d.ts +20 -101
- package/dist/gui/components/DropdownMenu.js +14 -161
- package/dist/gui/components/HeightTransition.d.ts +7 -12
- package/dist/gui/components/HeightTransition.js +77 -88
- package/dist/gui/components/Input.d.ts +6 -13
- package/dist/gui/components/Input.js +16 -27
- package/dist/gui/components/Label.d.ts +1 -7
- package/dist/gui/components/Label.js +2 -12
- package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
- package/dist/gui/components/MarkdownRenderer.js +81 -178
- package/dist/gui/components/Message.d.ts +22 -25
- package/dist/gui/components/Message.js +97 -44
- package/dist/gui/components/MessageContent.d.ts +22 -29
- package/dist/gui/components/MessageContent.js +85 -157
- package/dist/gui/components/Reasoning.d.ts +24 -30
- package/dist/gui/components/Reasoning.js +60 -187
- package/dist/gui/components/Response.d.ts +9 -11
- package/dist/gui/components/Response.js +90 -229
- package/dist/gui/components/Select.d.ts +10 -69
- package/dist/gui/components/Select.js +12 -118
- package/dist/gui/components/Sonner.d.ts +1 -3
- package/dist/gui/components/Sonner.js +18 -29
- package/dist/gui/components/Tabs.d.ts +4 -24
- package/dist/gui/components/Tabs.js +4 -32
- package/dist/gui/components/Task.d.ts +24 -28
- package/dist/gui/components/Task.js +31 -164
- package/dist/gui/components/Textarea.d.ts +7 -15
- package/dist/gui/components/Textarea.js +46 -63
- package/dist/gui/components/ThinkingBlock.d.ts +10 -20
- package/dist/gui/components/ThinkingBlock.js +35 -134
- package/dist/gui/components/TodoList.d.ts +10 -12
- package/dist/gui/components/TodoList.js +7 -22
- package/dist/gui/components/TodoListItem.d.ts +6 -9
- package/dist/gui/components/TodoListItem.js +4 -18
- package/dist/gui/components/index.d.ts +16 -59
- package/dist/gui/components/index.js +18 -42
- 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 +1 -0
- package/dist/sdk/client/acp-client.d.ts +76 -88
- package/dist/sdk/client/acp-client.js +217 -215
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/schemas/agent.d.ts +64 -111
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +147 -245
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +135 -219
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.js +469 -472
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.js +286 -289
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +46 -52
- package/dist/tui/components/ChatView.d.ts +2 -4
- package/dist/tui/components/ChatView.js +18 -51
- package/dist/tui/components/GameOfLife.js +35 -64
- package/dist/tui/components/InputBox.d.ts +11 -18
- package/dist/tui/components/InputBox.js +10 -70
- package/dist/tui/components/MessageList.d.ts +2 -4
- package/dist/tui/components/MessageList.js +10 -37
- package/dist/tui/components/MultiSelect.d.ts +10 -15
- package/dist/tui/components/MultiSelect.js +73 -116
- package/dist/tui/components/ReadlineInput.d.ts +6 -12
- package/dist/tui/components/ReadlineInput.js +237 -252
- package/dist/tui/components/SingleSelect.d.ts +9 -15
- package/dist/tui/components/SingleSelect.js +43 -84
- package/dist/tui/components/StatusBar.d.ts +6 -11
- package/dist/tui/components/StatusBar.js +67 -102
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +6 -4
- package/src/styles/global.css +2 -0
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/index.js.map +0 -1
- package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-input.js.map +0 -1
- package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-messages.js.map +0 -1
- package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-session.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/schemas/chat.d.ts.map +0 -1
- package/dist/core/schemas/chat.js.map +0 -1
- package/dist/core/schemas/index.d.ts.map +0 -1
- package/dist/core/schemas/index.js.map +0 -1
- package/dist/core/store/chat-store.d.ts.map +0 -1
- package/dist/core/store/chat-store.js.map +0 -1
- package/dist/gui/components/Button.d.ts.map +0 -1
- package/dist/gui/components/Button.js.map +0 -1
- package/dist/gui/components/Card.d.ts.map +0 -1
- package/dist/gui/components/Card.js.map +0 -1
- package/dist/gui/components/ChatInput.d.ts.map +0 -1
- package/dist/gui/components/ChatInput.js.map +0 -1
- package/dist/gui/components/ChatInterface.d.ts +0 -12
- package/dist/gui/components/ChatInterface.d.ts.map +0 -1
- package/dist/gui/components/ChatInterface.js +0 -204
- package/dist/gui/components/ChatInterface.js.map +0 -1
- package/dist/gui/components/ChatPreview.d.ts +0 -12
- package/dist/gui/components/ChatPreview.d.ts.map +0 -1
- package/dist/gui/components/ChatPreview.js +0 -214
- package/dist/gui/components/ChatPreview.js.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
- package/dist/gui/components/ChatStatus.d.ts.map +0 -1
- package/dist/gui/components/ChatStatus.js.map +0 -1
- package/dist/gui/components/ChatView.d.ts +0 -8
- package/dist/gui/components/ChatView.d.ts.map +0 -1
- package/dist/gui/components/ChatView.js +0 -42
- package/dist/gui/components/ChatView.js.map +0 -1
- package/dist/gui/components/ConfigPanel.d.ts +0 -20
- package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
- package/dist/gui/components/ConfigPanel.js +0 -225
- package/dist/gui/components/ConfigPanel.js.map +0 -1
- package/dist/gui/components/Conversation.d.ts.map +0 -1
- package/dist/gui/components/Conversation.js.map +0 -1
- package/dist/gui/components/Dialog.d.ts.map +0 -1
- package/dist/gui/components/Dialog.js.map +0 -1
- package/dist/gui/components/HeightTransition.d.ts.map +0 -1
- package/dist/gui/components/HeightTransition.js.map +0 -1
- package/dist/gui/components/Input.d.ts.map +0 -1
- package/dist/gui/components/Input.js.map +0 -1
- package/dist/gui/components/InputBox.d.ts +0 -21
- package/dist/gui/components/InputBox.d.ts.map +0 -1
- package/dist/gui/components/InputBox.js +0 -90
- package/dist/gui/components/InputBox.js.map +0 -1
- package/dist/gui/components/Label.d.ts.map +0 -1
- package/dist/gui/components/Label.js.map +0 -1
- package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/gui/components/MarkdownRenderer.js.map +0 -1
- package/dist/gui/components/Message.d.ts.map +0 -1
- package/dist/gui/components/Message.js.map +0 -1
- package/dist/gui/components/MessageContent.d.ts.map +0 -1
- package/dist/gui/components/MessageContent.js.map +0 -1
- package/dist/gui/components/MessageList.d.ts.map +0 -1
- package/dist/gui/components/MessageList.js.map +0 -1
- package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
- package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
- package/dist/gui/components/PlaygroundLayout.js +0 -49
- package/dist/gui/components/PlaygroundLayout.js.map +0 -1
- package/dist/gui/components/Reasoning.d.ts.map +0 -1
- package/dist/gui/components/Reasoning.js.map +0 -1
- package/dist/gui/components/Response.d.ts.map +0 -1
- package/dist/gui/components/Response.js.map +0 -1
- package/dist/gui/components/Select.d.ts.map +0 -1
- package/dist/gui/components/Select.js.map +0 -1
- package/dist/gui/components/StatusBar.d.ts +0 -12
- package/dist/gui/components/StatusBar.d.ts.map +0 -1
- package/dist/gui/components/StatusBar.js +0 -58
- package/dist/gui/components/StatusBar.js.map +0 -1
- package/dist/gui/components/Tabs.d.ts.map +0 -1
- package/dist/gui/components/Tabs.js.map +0 -1
- package/dist/gui/components/Task.d.ts.map +0 -1
- package/dist/gui/components/Task.js.map +0 -1
- package/dist/gui/components/Textarea.d.ts.map +0 -1
- package/dist/gui/components/Textarea.js.map +0 -1
- package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
- package/dist/gui/components/ThinkingBlock.js.map +0 -1
- package/dist/gui/components/TodoList.d.ts.map +0 -1
- package/dist/gui/components/TodoList.js.map +0 -1
- package/dist/gui/components/TodoListItem.d.ts.map +0 -1
- package/dist/gui/components/TodoListItem.js.map +0 -1
- package/dist/gui/components/index.d.ts.map +0 -1
- package/dist/gui/components/index.js.map +0 -1
- package/dist/gui/index.d.ts.map +0 -1
- package/dist/gui/index.js.map +0 -1
- package/dist/gui/lib/utils.d.ts.map +0 -1
- package/dist/gui/lib/utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/sdk/client/acp-client.d.ts.map +0 -1
- package/dist/sdk/client/acp-client.js.map +0 -1
- package/dist/sdk/client/index.d.ts.map +0 -1
- package/dist/sdk/client/index.js.map +0 -1
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/schemas/agent.d.ts.map +0 -1
- package/dist/sdk/schemas/agent.js.map +0 -1
- package/dist/sdk/schemas/index.d.ts.map +0 -1
- package/dist/sdk/schemas/index.js.map +0 -1
- package/dist/sdk/schemas/message.d.ts.map +0 -1
- package/dist/sdk/schemas/message.js.map +0 -1
- package/dist/sdk/schemas/session.d.ts.map +0 -1
- package/dist/sdk/schemas/session.js.map +0 -1
- package/dist/sdk/transports/http.d.ts.map +0 -1
- package/dist/sdk/transports/http.js.map +0 -1
- package/dist/sdk/transports/index.d.ts.map +0 -1
- package/dist/sdk/transports/index.js.map +0 -1
- package/dist/sdk/transports/stdio.d.ts.map +0 -1
- package/dist/sdk/transports/stdio.js.map +0 -1
- package/dist/sdk/transports/types.d.ts.map +0 -1
- package/dist/sdk/transports/types.js.map +0 -1
- package/dist/sdk/transports/websocket.d.ts.map +0 -1
- package/dist/sdk/transports/websocket.js.map +0 -1
- package/dist/tui/components/ChatView.d.ts.map +0 -1
- package/dist/tui/components/ChatView.js.map +0 -1
- package/dist/tui/components/GameOfLife.d.ts.map +0 -1
- package/dist/tui/components/GameOfLife.js.map +0 -1
- package/dist/tui/components/InputBox.d.ts.map +0 -1
- package/dist/tui/components/InputBox.js.map +0 -1
- package/dist/tui/components/MessageList.d.ts.map +0 -1
- package/dist/tui/components/MessageList.js.map +0 -1
- package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
- package/dist/tui/components/ReadlineInput.js.map +0 -1
- package/dist/tui/components/StatusBar.d.ts.map +0 -1
- package/dist/tui/components/StatusBar.js.map +0 -1
- package/dist/tui/components/index.d.ts.map +0 -1
- package/dist/tui/components/index.js.map +0 -1
- package/dist/tui/index.d.ts.map +0 -1
- package/dist/tui/index.js.map +0 -1
|
@@ -3,63 +3,54 @@ import { create } from "zustand";
|
|
|
3
3
|
* Create chat store
|
|
4
4
|
*/
|
|
5
5
|
export const useChatStore = create((set) => ({
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})),
|
|
57
|
-
clearInput: () =>
|
|
58
|
-
set((_state) => ({
|
|
59
|
-
input: {
|
|
60
|
-
value: "",
|
|
61
|
-
isSubmitting: false,
|
|
62
|
-
attachedFiles: [],
|
|
63
|
-
},
|
|
64
|
-
})),
|
|
6
|
+
// Initial state
|
|
7
|
+
connectionStatus: "disconnected",
|
|
8
|
+
sessionId: null,
|
|
9
|
+
error: null,
|
|
10
|
+
messages: [],
|
|
11
|
+
isStreaming: false,
|
|
12
|
+
streamingStartTime: null,
|
|
13
|
+
input: {
|
|
14
|
+
value: "",
|
|
15
|
+
isSubmitting: false,
|
|
16
|
+
attachedFiles: [],
|
|
17
|
+
},
|
|
18
|
+
// Actions
|
|
19
|
+
setConnectionStatus: (status) => set({ connectionStatus: status }),
|
|
20
|
+
setSessionId: (id) => set({ sessionId: id }),
|
|
21
|
+
setError: (error) => set({ error }),
|
|
22
|
+
addMessage: (message) => set((state) => ({
|
|
23
|
+
messages: [...state.messages, message],
|
|
24
|
+
})),
|
|
25
|
+
updateMessage: (id, updates) => set((state) => ({
|
|
26
|
+
messages: state.messages.map((msg) => msg.id === id ? { ...msg, ...updates } : msg),
|
|
27
|
+
})),
|
|
28
|
+
clearMessages: () => set({ messages: [] }),
|
|
29
|
+
setIsStreaming: (streaming) => set({ isStreaming: streaming }),
|
|
30
|
+
setStreamingStartTime: (time) => set({ streamingStartTime: time }),
|
|
31
|
+
setInputValue: (value) => set((state) => ({
|
|
32
|
+
input: { ...state.input, value },
|
|
33
|
+
})),
|
|
34
|
+
setInputSubmitting: (submitting) => set((state) => ({
|
|
35
|
+
input: { ...state.input, isSubmitting: submitting },
|
|
36
|
+
})),
|
|
37
|
+
addFileAttachment: (file) => set((state) => ({
|
|
38
|
+
input: {
|
|
39
|
+
...state.input,
|
|
40
|
+
attachedFiles: [...state.input.attachedFiles, file],
|
|
41
|
+
},
|
|
42
|
+
})),
|
|
43
|
+
removeFileAttachment: (index) => set((state) => ({
|
|
44
|
+
input: {
|
|
45
|
+
...state.input,
|
|
46
|
+
attachedFiles: state.input.attachedFiles.filter((_, i) => i !== index),
|
|
47
|
+
},
|
|
48
|
+
})),
|
|
49
|
+
clearInput: () => set((_state) => ({
|
|
50
|
+
input: {
|
|
51
|
+
value: "",
|
|
52
|
+
isSubmitting: false,
|
|
53
|
+
attachedFiles: [],
|
|
54
|
+
},
|
|
55
|
+
})),
|
|
65
56
|
}));
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
declare const buttonVariants: (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
| "outline"
|
|
10
|
-
| "secondary"
|
|
11
|
-
| "ghost"
|
|
12
|
-
| "link"
|
|
13
|
-
| null
|
|
14
|
-
| undefined;
|
|
15
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
16
|
-
} & import("class-variance-authority/types").ClassProp)
|
|
17
|
-
| undefined,
|
|
18
|
-
) => string;
|
|
19
|
-
export interface ButtonProps
|
|
20
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
21
|
-
VariantProps<typeof buttonVariants> {
|
|
22
|
-
asChild?: boolean;
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
23
9
|
}
|
|
24
|
-
declare const Button: React.ForwardRefExoticComponent<
|
|
25
|
-
ButtonProps & React.RefAttributes<HTMLButtonElement>
|
|
26
|
-
>;
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
27
11
|
export { Button, buttonVariants };
|
|
@@ -1,46 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
2
3
|
import { cva } from "class-variance-authority";
|
|
3
4
|
import * as React from "react";
|
|
4
|
-
import { jsx as _jsx } 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
|
-
const Button = React.forwardRef(
|
|
36
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
37
|
-
const Comp = asChild ? Slot : "button";
|
|
38
|
-
return _jsx(Comp, {
|
|
39
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
40
|
-
ref: ref,
|
|
41
|
-
...props,
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
);
|
|
6
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
10
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
11
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-10 px-4 py-2",
|
|
18
|
+
sm: "h-9 rounded-md px-3",
|
|
19
|
+
lg: "h-11 rounded-md px-8",
|
|
20
|
+
icon: "h-10 w-10",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default",
|
|
25
|
+
size: "default",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
29
|
+
const Comp = asChild ? Slot : "button";
|
|
30
|
+
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
|
|
31
|
+
});
|
|
45
32
|
Button.displayName = "Button";
|
|
46
33
|
export { Button, buttonVariants };
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Card: React.ForwardRefExoticComponent<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
|
|
10
|
-
>;
|
|
11
|
-
declare const CardDescription: React.ForwardRefExoticComponent<
|
|
12
|
-
React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
|
|
13
|
-
>;
|
|
14
|
-
declare const CardContent: React.ForwardRefExoticComponent<
|
|
15
|
-
React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
|
|
16
|
-
>;
|
|
17
|
-
declare const CardFooter: React.ForwardRefExoticComponent<
|
|
18
|
-
React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
|
|
19
|
-
>;
|
|
20
|
-
export {
|
|
21
|
-
Card,
|
|
22
|
-
CardHeader,
|
|
23
|
-
CardFooter,
|
|
24
|
-
CardTitle,
|
|
25
|
-
CardDescription,
|
|
26
|
-
CardContent,
|
|
27
|
-
};
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
@@ -1,62 +1,16 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
|
|
5
|
-
const Card = React.forwardRef(({ className, ...props }, ref) =>
|
|
6
|
-
_jsx("div", {
|
|
7
|
-
ref: ref,
|
|
8
|
-
className: cn(
|
|
9
|
-
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
10
|
-
className,
|
|
11
|
-
),
|
|
12
|
-
...props,
|
|
13
|
-
}),
|
|
14
|
-
);
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
15
5
|
Card.displayName = "Card";
|
|
16
|
-
const CardHeader = React.forwardRef(({ className, ...props }, ref) =>
|
|
17
|
-
_jsx("div", {
|
|
18
|
-
ref: ref,
|
|
19
|
-
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
20
|
-
...props,
|
|
21
|
-
}),
|
|
22
|
-
);
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
23
7
|
CardHeader.displayName = "CardHeader";
|
|
24
|
-
const CardTitle = React.forwardRef(({ className, ...props }, ref) =>
|
|
25
|
-
_jsx("div", {
|
|
26
|
-
ref: ref,
|
|
27
|
-
className: cn(
|
|
28
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
29
|
-
className,
|
|
30
|
-
),
|
|
31
|
-
...props,
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
|
|
34
9
|
CardTitle.displayName = "CardTitle";
|
|
35
|
-
const CardDescription = React.forwardRef(({ className, ...props }, ref) =>
|
|
36
|
-
_jsx("div", {
|
|
37
|
-
ref: ref,
|
|
38
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
39
|
-
...props,
|
|
40
|
-
}),
|
|
41
|
-
);
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
42
11
|
CardDescription.displayName = "CardDescription";
|
|
43
|
-
const CardContent = React.forwardRef(({ className, ...props }, ref) =>
|
|
44
|
-
_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props }),
|
|
45
|
-
);
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
|
|
46
13
|
CardContent.displayName = "CardContent";
|
|
47
|
-
const CardFooter = React.forwardRef(({ className, ...props }, ref) =>
|
|
48
|
-
_jsx("div", {
|
|
49
|
-
ref: ref,
|
|
50
|
-
className: cn("flex items-center p-6 pt-0", className),
|
|
51
|
-
...props,
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
|
|
54
15
|
CardFooter.displayName = "CardFooter";
|
|
55
|
-
export {
|
|
56
|
-
Card,
|
|
57
|
-
CardHeader,
|
|
58
|
-
CardFooter,
|
|
59
|
-
CardTitle,
|
|
60
|
-
CardDescription,
|
|
61
|
-
CardContent,
|
|
62
|
-
};
|
|
16
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
@@ -1,65 +1,38 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
interface ChatHeaderContextValue {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
isExpanded: boolean;
|
|
4
|
+
setIsExpanded: (expanded: boolean) => void;
|
|
5
5
|
}
|
|
6
6
|
declare const useChatHeaderContext: () => ChatHeaderContextValue;
|
|
7
|
-
export interface ChatHeaderRootProps
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
7
|
+
export interface ChatHeaderRootProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** Initial expanded state */
|
|
9
|
+
defaultExpanded?: boolean;
|
|
10
|
+
/** Controlled expanded state */
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
/** Callback when expanded state changes */
|
|
13
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
15
14
|
}
|
|
16
|
-
declare const ChatHeaderRoot: React.ForwardRefExoticComponent<
|
|
17
|
-
|
|
18
|
-
>;
|
|
19
|
-
export interface ChatHeaderTitleProps
|
|
20
|
-
extends React.HTMLAttributes<HTMLHeadingElement> {}
|
|
21
|
-
declare const ChatHeaderTitle: React.ForwardRefExoticComponent<
|
|
22
|
-
ChatHeaderTitleProps & React.RefAttributes<HTMLHeadingElement>
|
|
23
|
-
>;
|
|
24
|
-
export interface ChatHeaderActionsProps
|
|
25
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
26
|
-
declare const ChatHeaderActions: React.ForwardRefExoticComponent<
|
|
27
|
-
ChatHeaderActionsProps & React.RefAttributes<HTMLDivElement>
|
|
28
|
-
>;
|
|
29
|
-
export type ConnectionStatus =
|
|
30
|
-
| "connected"
|
|
31
|
-
| "connecting"
|
|
32
|
-
| "error"
|
|
33
|
-
| "disconnected";
|
|
34
|
-
export interface ChatHeaderStatusIndicatorProps
|
|
35
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
36
|
-
/** Connection status */
|
|
37
|
-
status: ConnectionStatus;
|
|
38
|
-
/** Optional status text override */
|
|
39
|
-
statusText?: string;
|
|
15
|
+
declare const ChatHeaderRoot: React.ForwardRefExoticComponent<ChatHeaderRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export interface ChatHeaderTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
40
17
|
}
|
|
41
|
-
declare const
|
|
42
|
-
|
|
43
|
-
>;
|
|
44
|
-
export interface ChatHeaderToggleProps
|
|
45
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
46
|
-
/** Icon to display (should rotate based on expanded state) */
|
|
47
|
-
icon?: React.ReactNode;
|
|
18
|
+
declare const ChatHeaderTitle: React.ForwardRefExoticComponent<ChatHeaderTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
19
|
+
export interface ChatHeaderActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
48
20
|
}
|
|
49
|
-
declare const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
21
|
+
declare const ChatHeaderActions: React.ForwardRefExoticComponent<ChatHeaderActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export type ConnectionStatus = "connected" | "connecting" | "error" | "disconnected";
|
|
23
|
+
export interface ChatHeaderStatusIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
24
|
+
/** Connection status */
|
|
25
|
+
status: ConnectionStatus;
|
|
26
|
+
/** Optional status text override */
|
|
27
|
+
statusText?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const ChatHeaderStatusIndicator: React.ForwardRefExoticComponent<ChatHeaderStatusIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export interface ChatHeaderToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
31
|
+
/** Icon to display (should rotate based on expanded state) */
|
|
32
|
+
icon?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
declare const ChatHeaderToggle: React.ForwardRefExoticComponent<ChatHeaderToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
export interface ChatHeaderExpandablePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
36
|
+
}
|
|
37
|
+
declare const ChatHeaderExpandablePanel: React.ForwardRefExoticComponent<ChatHeaderExpandablePanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export { ChatHeaderRoot as Root, ChatHeaderTitle as Title, ChatHeaderActions as Actions, ChatHeaderStatusIndicator as StatusIndicator, ChatHeaderToggle as Toggle, ChatHeaderExpandablePanel as ExpandablePanel, useChatHeaderContext, };
|