@arcadeai/design-system 3.33.2 → 3.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +595 -567
- package/dist/components/ui/atoms/avatar-notification-badge.d.ts +34 -0
- package/dist/components/ui/atoms/avatar-notification-badge.d.ts.map +1 -0
- package/dist/components/ui/atoms/avatar-notification-badge.js +78 -0
- package/dist/components/ui/atoms/index.d.ts +3 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +512 -504
- package/dist/components/ui/atoms/json-highlight.d.ts +60 -0
- package/dist/components/ui/atoms/json-highlight.d.ts.map +1 -0
- package/dist/components/ui/atoms/json-highlight.js +77 -0
- package/dist/components/ui/atoms/scroll-button.js +8 -8
- package/dist/components/ui/atoms/view-tools-control.d.ts +1 -1
- package/dist/components/ui/atoms/view-tools-control.d.ts.map +1 -1
- package/dist/components/ui/atoms/view-tools-control.js +20 -19
- package/dist/components/ui/index.js +595 -567
- package/dist/components/ui/molecules/chat-message-list.d.ts +5 -2
- package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
- package/dist/components/ui/molecules/chat-message-list.js +2 -2
- package/dist/components/ui/molecules/index.d.ts +8 -0
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +48 -28
- package/dist/components/ui/molecules/prompt-input.js +20 -20
- package/dist/components/ui/molecules/requirement-badges.js +8 -4
- package/dist/components/ui/molecules/switcher.d.ts +83 -0
- package/dist/components/ui/molecules/switcher.d.ts.map +1 -0
- package/dist/components/ui/molecules/switcher.js +164 -0
- package/dist/components/ui/molecules/tool-authorization.d.ts +56 -0
- package/dist/components/ui/molecules/tool-authorization.d.ts.map +1 -0
- package/dist/components/ui/molecules/tool-authorization.js +160 -0
- package/dist/components/ui/molecules/tool-call-accordion.d.ts +36 -0
- package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -0
- package/dist/components/ui/molecules/tool-call-accordion.js +301 -0
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/molecules/user-nav.d.ts +65 -0
- package/dist/components/ui/molecules/user-nav.d.ts.map +1 -0
- package/dist/components/ui/molecules/user-nav.js +154 -0
- package/dist/components/ui/pages/chat-page.d.ts +18 -10
- package/dist/components/ui/pages/chat-page.d.ts.map +1 -1
- package/dist/components/ui/pages/chat-page.js +328 -243
- package/dist/components/ui/templates/chat-template.d.ts +1 -1
- package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
- package/dist/components/ui/templates/chat-template.js +11 -11
- package/dist/main.js +621 -593
- package/dist/{toolkit-card-k8jio69G.js → toolkit-card-DAgQXF93.js} +13 -10
- package/package.json +1 -1
|
@@ -1,238 +1,320 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { PlusIcon as X, SquareIcon as Y, ArrowUpIcon as Z, SquarePenIcon as L, LogOutIcon as ee, ChevronsUpDownIcon as re, Trash2Icon as G } from "lucide-react";
|
|
3
|
+
import { useState as w, useRef as te } from "react";
|
|
4
|
+
import { ArcadeLogo as ne } from "../../../assets/images/arcade-logo.js";
|
|
4
5
|
import { Button as o } from "../atoms/button.js";
|
|
5
|
-
import { ChatContainerRoot as
|
|
6
|
-
import { DropdownMenu as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { ChatContainerRoot as ae, ChatContainerContent as ie, ChatContainerScrollAnchor as le } from "../atoms/chat-container.js";
|
|
7
|
+
import { DropdownMenuItem as oe, DropdownMenu as ce, DropdownMenuTrigger as se, DropdownMenuContent as de, DropdownMenuRadioGroup as he, DropdownMenuRadioItem as me } from "../atoms/dropdown-menu.js";
|
|
8
|
+
import { Loader as pe } from "../atoms/loader.js";
|
|
9
|
+
import { Popover as B, PopoverTrigger as R, PopoverContent as U } from "../atoms/popover.js";
|
|
10
|
+
import { ScrollButton as ue } from "../atoms/scroll-button.js";
|
|
11
|
+
import { SidebarTrigger as fe, SidebarProvider as ve, Sidebar as ge, SidebarHeader as Ce, SidebarContent as Ne, SidebarGroup as P, SidebarGroupLabel as H, SidebarGroupContent as _, SidebarMenu as xe, SidebarFooter as be, SidebarInset as Se, SidebarMenuItem as Te, SidebarMenuButton as we, SidebarMenuAction as j } from "../atoms/sidebar.js";
|
|
12
|
+
import { Tooltip as C, TooltipTrigger as N, TooltipContent as x } from "../atoms/tooltip.js";
|
|
13
|
+
import { ChatMessageList as ke } from "../molecules/chat-message-list.js";
|
|
14
|
+
import { PromptInput as ye, PromptInputTextarea as ze, PromptInputActions as Ie, PromptInputAction as Oe } from "../molecules/prompt-input.js";
|
|
15
|
+
import { SuggestionCard as De } from "../molecules/suggestion-card.js";
|
|
16
|
+
import { UserNav as Me } from "../molecules/user-nav.js";
|
|
17
|
+
import { ChatTemplate as Pe, ChatTemplateHeader as He, ChatTemplateHeaderGroup as A, ChatTemplateOverview as _e, ChatTemplateOverviewTitle as je, ChatTemplateOverviewSubtitle as Ae, ChatTemplateFooter as Ge, ChatTemplateSuggestions as Be } from "../templates/chat-template.js";
|
|
18
|
+
import { cn as q } from "../../../lib/utils.js";
|
|
19
|
+
function Re() {
|
|
20
|
+
return /* @__PURE__ */ e(ne, { className: "h-5 w-auto text-foreground" });
|
|
21
|
+
}
|
|
22
|
+
function Ue(t, a) {
|
|
23
|
+
if (t.onClick)
|
|
24
|
+
return t.onClick;
|
|
25
|
+
if (!(t.action && a))
|
|
26
|
+
return;
|
|
27
|
+
const n = t.action;
|
|
28
|
+
return () => a(n);
|
|
29
|
+
}
|
|
30
|
+
function qe({
|
|
31
|
+
models: t,
|
|
32
|
+
selectedModelId: a,
|
|
33
|
+
onModelChange: n
|
|
19
34
|
}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
return !t || t.length === 0 ? null : /* @__PURE__ */ r(ce, { children: [
|
|
36
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ r(o, { className: "h-[34px] gap-1 px-2", variant: "outline", children: [
|
|
37
|
+
t.find((i) => i.id === a)?.name ?? "Select model",
|
|
38
|
+
/* @__PURE__ */ e(re, { className: "size-3" })
|
|
39
|
+
] }) }),
|
|
40
|
+
/* @__PURE__ */ e(de, { align: "start", className: "min-w-[300px]", children: /* @__PURE__ */ e(
|
|
41
|
+
he,
|
|
24
42
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
] }),
|
|
32
|
-
/* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
33
|
-
/* @__PURE__ */ e("span", { className: "truncate font-medium", children: r?.name ?? "User" }),
|
|
34
|
-
r?.email && /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground text-xs", children: r.email })
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ e(T, { className: "ml-auto size-4" })
|
|
37
|
-
]
|
|
43
|
+
onValueChange: n,
|
|
44
|
+
value: a,
|
|
45
|
+
children: t.map((i) => /* @__PURE__ */ e(me, { value: i.id, children: /* @__PURE__ */ r("div", { className: "flex flex-col items-start gap-1", children: [
|
|
46
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: i.name }),
|
|
47
|
+
i.description && /* @__PURE__ */ e("div", { className: "text-muted-foreground text-xs", children: i.description })
|
|
48
|
+
] }) }, i.id))
|
|
38
49
|
}
|
|
39
|
-
) })
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ a(p, { value: "light", children: [
|
|
59
|
-
/* @__PURE__ */ e(ee, { className: "size-4" }),
|
|
60
|
-
"Light"
|
|
61
|
-
] }),
|
|
62
|
-
/* @__PURE__ */ a(p, { value: "dark", children: [
|
|
63
|
-
/* @__PURE__ */ e(ae, { className: "size-4" }),
|
|
64
|
-
"Dark"
|
|
65
|
-
] }),
|
|
66
|
-
/* @__PURE__ */ a(p, { value: "system", children: [
|
|
67
|
-
/* @__PURE__ */ e(re, { className: "size-4" }),
|
|
68
|
-
"System"
|
|
69
|
-
] })
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
/* @__PURE__ */ e(U, {})
|
|
74
|
-
] }),
|
|
75
|
-
t && /* @__PURE__ */ a(ce, { onClick: t, children: [
|
|
76
|
-
/* @__PURE__ */ e(te, { className: "size-4" }),
|
|
77
|
-
"Sign out"
|
|
78
|
-
] })
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] }) }) }) : /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ a(v, { className: "cursor-default", size: "lg", children: [
|
|
83
|
-
/* @__PURE__ */ a(w, { className: "size-8 rounded-lg", children: [
|
|
84
|
-
r?.avatarUrl && /* @__PURE__ */ e(I, { alt: r.name ?? "User", src: r.avatarUrl }),
|
|
85
|
-
/* @__PURE__ */ e(M, { className: "rounded-lg", children: m ?? "U" })
|
|
50
|
+
) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function Fe({ onDeleteAll: t }) {
|
|
54
|
+
const [a, n] = w(!1);
|
|
55
|
+
return /* @__PURE__ */ r(B, { onOpenChange: n, open: a, children: [
|
|
56
|
+
/* @__PURE__ */ r(C, { children: [
|
|
57
|
+
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e(
|
|
58
|
+
o,
|
|
59
|
+
{
|
|
60
|
+
"aria-label": "Delete all chats",
|
|
61
|
+
className: "size-8 text-muted-foreground",
|
|
62
|
+
size: "icon",
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
children: /* @__PURE__ */ e(G, { className: "size-4" })
|
|
65
|
+
}
|
|
66
|
+
) }) }),
|
|
67
|
+
/* @__PURE__ */ e(x, { side: "bottom", children: "Delete all chats" })
|
|
86
68
|
] }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */ e("
|
|
89
|
-
|
|
69
|
+
/* @__PURE__ */ r(U, { className: "w-auto max-w-64 space-y-3 p-4", side: "bottom", children: [
|
|
70
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-sm", children: "Delete all chats?" }),
|
|
71
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground text-xs", children: "This action cannot be undone." }),
|
|
72
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end gap-2", children: [
|
|
73
|
+
/* @__PURE__ */ e(o, { onClick: () => n(!1), size: "sm", variant: "outline", children: "Cancel" }),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
o,
|
|
76
|
+
{
|
|
77
|
+
onClick: () => {
|
|
78
|
+
t(), n(!1);
|
|
79
|
+
},
|
|
80
|
+
size: "sm",
|
|
81
|
+
variant: "destructive",
|
|
82
|
+
children: "Delete all"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] })
|
|
90
86
|
] })
|
|
91
|
-
] })
|
|
87
|
+
] });
|
|
92
88
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
function We({
|
|
90
|
+
title: t,
|
|
91
|
+
isActive: a,
|
|
92
|
+
isStreaming: n = !1,
|
|
93
|
+
onSelect: i,
|
|
94
|
+
onDelete: h
|
|
97
95
|
}) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
const [b, u] = w(!1), [f, m] = w(!1), s = te(null);
|
|
97
|
+
return /* @__PURE__ */ r(Te, { children: [
|
|
98
|
+
/* @__PURE__ */ r(C, { onOpenChange: (l) => {
|
|
99
|
+
if (!l) {
|
|
100
|
+
u(!1);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
s.current && s.current.scrollWidth > s.current.offsetWidth && u(!0);
|
|
104
|
+
}, open: b, children: [
|
|
105
|
+
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
|
|
106
|
+
we,
|
|
107
|
+
{
|
|
108
|
+
className: q(
|
|
109
|
+
"py-2.5 group-hover/menu-item:bg-sidebar-accent group-hover/menu-item:text-sidebar-accent-foreground",
|
|
110
|
+
(h || n) && "pr-8"
|
|
111
|
+
),
|
|
112
|
+
isActive: a,
|
|
113
|
+
onClick: i,
|
|
114
|
+
children: /* @__PURE__ */ e("span", { className: "truncate", ref: s, children: t })
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ e(x, { side: "right", children: t })
|
|
118
|
+
] }),
|
|
119
|
+
n ? /* @__PURE__ */ e(
|
|
120
|
+
j,
|
|
105
121
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
className: "pointer-events-none",
|
|
124
|
+
tabIndex: -1,
|
|
125
|
+
children: /* @__PURE__ */ e(
|
|
126
|
+
pe,
|
|
127
|
+
{
|
|
128
|
+
className: "border-sidebar-foreground/25 border-t-sidebar-foreground",
|
|
129
|
+
size: "sm",
|
|
130
|
+
variant: "circular"
|
|
131
|
+
}
|
|
132
|
+
)
|
|
112
133
|
}
|
|
113
|
-
)
|
|
134
|
+
) : h && /* @__PURE__ */ r(B, { onOpenChange: m, open: f, children: [
|
|
135
|
+
/* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e(
|
|
136
|
+
j,
|
|
137
|
+
{
|
|
138
|
+
"aria-label": `Delete "${t}"`,
|
|
139
|
+
className: "hover:bg-secondary hover:text-secondary-foreground",
|
|
140
|
+
showOnHover: !0,
|
|
141
|
+
children: /* @__PURE__ */ e(G, { className: "size-3.5" })
|
|
142
|
+
}
|
|
143
|
+
) }),
|
|
144
|
+
/* @__PURE__ */ r(
|
|
145
|
+
U,
|
|
146
|
+
{
|
|
147
|
+
className: "w-auto max-w-64 space-y-3 p-4",
|
|
148
|
+
side: "right",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-sm", children: "Delete this chat?" }),
|
|
151
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground text-xs", children: "This action cannot be undone." }),
|
|
152
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end gap-2", children: [
|
|
153
|
+
/* @__PURE__ */ e(
|
|
154
|
+
o,
|
|
155
|
+
{
|
|
156
|
+
onClick: () => m(!1),
|
|
157
|
+
size: "sm",
|
|
158
|
+
variant: "outline",
|
|
159
|
+
children: "Cancel"
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ e(
|
|
163
|
+
o,
|
|
164
|
+
{
|
|
165
|
+
onClick: () => {
|
|
166
|
+
h(), m(!1);
|
|
167
|
+
},
|
|
168
|
+
size: "sm",
|
|
169
|
+
variant: "destructive",
|
|
170
|
+
children: "Delete"
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] })
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] })
|
|
114
178
|
] });
|
|
115
179
|
}
|
|
116
|
-
function
|
|
117
|
-
user:
|
|
118
|
-
logo:
|
|
119
|
-
suggestedActions:
|
|
120
|
-
onSuggestionAction:
|
|
121
|
-
models:
|
|
122
|
-
selectedModelId:
|
|
123
|
-
onModelChange:
|
|
124
|
-
inputValue:
|
|
125
|
-
onInputChange:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
defaultSidebarOpen:
|
|
137
|
-
showSidebar:
|
|
138
|
-
messages:
|
|
139
|
-
renderMessage:
|
|
140
|
-
loadingIndicator:
|
|
141
|
-
children:
|
|
180
|
+
function cr({
|
|
181
|
+
user: t,
|
|
182
|
+
logo: a,
|
|
183
|
+
suggestedActions: n,
|
|
184
|
+
onSuggestionAction: i,
|
|
185
|
+
models: h,
|
|
186
|
+
selectedModelId: b,
|
|
187
|
+
onModelChange: u,
|
|
188
|
+
inputValue: f,
|
|
189
|
+
onInputChange: m,
|
|
190
|
+
inputDisabled: s = !1,
|
|
191
|
+
onSubmit: S,
|
|
192
|
+
isLoading: l = !1,
|
|
193
|
+
onStop: F,
|
|
194
|
+
onNewChat: v,
|
|
195
|
+
onDeleteAll: k,
|
|
196
|
+
onSignOut: y,
|
|
197
|
+
chatHistoryGroups: W,
|
|
198
|
+
onSelectChat: z,
|
|
199
|
+
onDeleteChat: I,
|
|
200
|
+
defaultSidebarOpen: V = !0,
|
|
201
|
+
showSidebar: O = !0,
|
|
202
|
+
messages: p,
|
|
203
|
+
renderMessage: $,
|
|
204
|
+
loadingIndicator: E,
|
|
205
|
+
children: D,
|
|
206
|
+
scrollKey: J
|
|
142
207
|
}) {
|
|
143
|
-
const
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
208
|
+
const K = !!D || p !== void 0 && p.length > 0, Q = t?.name ?? "there", T = W ?? [], M = /* @__PURE__ */ r(Pe, { children: [
|
|
209
|
+
/* @__PURE__ */ r(He, { children: [
|
|
210
|
+
/* @__PURE__ */ r(A, { children: [
|
|
211
|
+
O && /* @__PURE__ */ r(C, { children: [
|
|
212
|
+
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(fe, {}) }),
|
|
213
|
+
/* @__PURE__ */ e(x, { side: "bottom", children: "Toggle sidebar" })
|
|
214
|
+
] }),
|
|
147
215
|
/* @__PURE__ */ e(
|
|
148
|
-
|
|
216
|
+
qe,
|
|
149
217
|
{
|
|
150
|
-
models:
|
|
151
|
-
onModelChange:
|
|
152
|
-
selectedModelId:
|
|
218
|
+
models: h,
|
|
219
|
+
onModelChange: u,
|
|
220
|
+
selectedModelId: b
|
|
153
221
|
}
|
|
154
222
|
)
|
|
155
223
|
] }),
|
|
156
224
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
157
|
-
/* @__PURE__ */ e(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"aria-label": "New chat",
|
|
161
|
-
className: "h-9 gap-1 px-2",
|
|
162
|
-
onClick: h,
|
|
163
|
-
variant: "outline",
|
|
164
|
-
children: [
|
|
165
|
-
/* @__PURE__ */ e(Y, { className: "size-4" }),
|
|
166
|
-
/* @__PURE__ */ e("span", { className: "md:sr-only", children: "New Chat" })
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
) })
|
|
170
|
-
] }),
|
|
171
|
-
/* @__PURE__ */ a(ne, { className: "relative min-w-0 flex-1 flex-col pt-4", children: [
|
|
172
|
-
/* @__PURE__ */ a(le, { className: "gap-6 pb-4", children: [
|
|
173
|
-
C || (d && d.length > 0 ? /* @__PURE__ */ e(
|
|
174
|
-
xe,
|
|
225
|
+
/* @__PURE__ */ e(A, { children: v && /* @__PURE__ */ r(C, { children: [
|
|
226
|
+
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ r(
|
|
227
|
+
o,
|
|
175
228
|
{
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
229
|
+
"aria-label": "New chat",
|
|
230
|
+
className: "h-9 gap-1 px-2 text-foreground",
|
|
231
|
+
onClick: v,
|
|
232
|
+
variant: "outline",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ e(X, { className: "size-4" }),
|
|
235
|
+
/* @__PURE__ */ e("span", { className: "md:sr-only", children: "New Chat" })
|
|
236
|
+
]
|
|
180
237
|
}
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/* @__PURE__ */ e("span", { className: "text-primary/80", children: W })
|
|
185
|
-
] }),
|
|
186
|
-
/* @__PURE__ */ e(ke, { children: "How can I help you today?" })
|
|
187
|
-
] })),
|
|
188
|
-
/* @__PURE__ */ e(ie, {})
|
|
189
|
-
] }),
|
|
190
|
-
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-10 h-10 bg-gradient-to-t from-10% from-background to-transparent" }),
|
|
191
|
-
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute right-0 bottom-4 left-0 z-20 flex justify-center px-4", children: /* @__PURE__ */ e("div", { className: "flex w-full max-w-3xl justify-end pr-4", children: /* @__PURE__ */ e(se, { className: "pointer-events-auto shadow-md" }) }) })
|
|
238
|
+
) }),
|
|
239
|
+
/* @__PURE__ */ e(x, { children: "New chat" })
|
|
240
|
+
] }) })
|
|
192
241
|
] }),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
|
|
242
|
+
/* @__PURE__ */ r(
|
|
243
|
+
ae,
|
|
244
|
+
{
|
|
245
|
+
className: "relative min-w-0 flex-1 flex-col pt-4",
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ r(ie, { className: "gap-6 pb-4", children: [
|
|
248
|
+
D || (p && p.length > 0 ? /* @__PURE__ */ e(
|
|
249
|
+
ke,
|
|
250
|
+
{
|
|
251
|
+
isStreaming: l,
|
|
252
|
+
loadingIndicator: E,
|
|
253
|
+
messages: p,
|
|
254
|
+
renderMessage: $
|
|
255
|
+
}
|
|
256
|
+
) : /* @__PURE__ */ r(_e, { children: [
|
|
257
|
+
/* @__PURE__ */ r(je, { children: [
|
|
258
|
+
"Hi, ",
|
|
259
|
+
/* @__PURE__ */ e("span", { className: "text-primary/80", children: Q })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ e(Ae, { children: "How can I help you today?" })
|
|
262
|
+
] })),
|
|
263
|
+
/* @__PURE__ */ e(le, {})
|
|
264
|
+
] }),
|
|
265
|
+
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-10 h-10 bg-linear-to-t from-10% from-background to-transparent" }),
|
|
266
|
+
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute right-0 bottom-4 left-0 z-20 flex justify-center px-4", children: /* @__PURE__ */ e("div", { className: "flex w-full max-w-3xl justify-end pr-4", children: /* @__PURE__ */ e(ue, { className: "pointer-events-auto shadow-md" }) }) })
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
J
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ r(Ge, { children: [
|
|
272
|
+
!K && n && n.length > 0 && /* @__PURE__ */ e(Be, { children: n.map((c, g) => /* @__PURE__ */ e(
|
|
195
273
|
"div",
|
|
196
274
|
{
|
|
197
|
-
className:
|
|
275
|
+
className: q(
|
|
198
276
|
"col-span-12 sm:col-span-6",
|
|
199
|
-
|
|
200
|
-
|
|
277
|
+
g < 3 ? "md:col-span-4" : "md:col-span-6",
|
|
278
|
+
g > 1 && "hidden sm:block"
|
|
201
279
|
),
|
|
202
280
|
children: /* @__PURE__ */ e(
|
|
203
|
-
|
|
281
|
+
De,
|
|
204
282
|
{
|
|
205
|
-
icon:
|
|
206
|
-
onClick:
|
|
207
|
-
|
|
208
|
-
|
|
283
|
+
icon: c.icon,
|
|
284
|
+
onClick: Ue(
|
|
285
|
+
c,
|
|
286
|
+
i
|
|
287
|
+
),
|
|
288
|
+
subtitle: c.subtitle,
|
|
289
|
+
title: c.title
|
|
209
290
|
}
|
|
210
291
|
)
|
|
211
292
|
},
|
|
212
|
-
|
|
293
|
+
c.id
|
|
213
294
|
)) }),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
295
|
+
/* @__PURE__ */ r(
|
|
296
|
+
ye,
|
|
216
297
|
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
298
|
+
disabled: s,
|
|
299
|
+
isLoading: l,
|
|
300
|
+
onSubmit: S,
|
|
301
|
+
onValueChange: m,
|
|
302
|
+
value: f,
|
|
221
303
|
children: [
|
|
222
|
-
/* @__PURE__ */ e(
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
|
|
304
|
+
/* @__PURE__ */ e(ze, { placeholder: "Send a message..." }),
|
|
305
|
+
/* @__PURE__ */ e(Ie, { className: "justify-end px-2 pb-2", children: /* @__PURE__ */ e(
|
|
306
|
+
Oe,
|
|
225
307
|
{
|
|
226
|
-
tooltip:
|
|
308
|
+
tooltip: l ? "Stop generating" : "Send message",
|
|
227
309
|
children: /* @__PURE__ */ e(
|
|
228
310
|
o,
|
|
229
311
|
{
|
|
230
|
-
"aria-label":
|
|
231
|
-
disabled: !(
|
|
232
|
-
onClick:
|
|
312
|
+
"aria-label": l ? "Stop generating" : "Send message",
|
|
313
|
+
disabled: s || !(l || f?.trim()),
|
|
314
|
+
onClick: l ? F : S,
|
|
233
315
|
size: "icon",
|
|
234
|
-
variant:
|
|
235
|
-
children:
|
|
316
|
+
variant: l ? "destructive" : "default",
|
|
317
|
+
children: l ? /* @__PURE__ */ e(Y, { className: "size-4 fill-current" }) : /* @__PURE__ */ e(Z, { className: "size-4" })
|
|
236
318
|
}
|
|
237
319
|
)
|
|
238
320
|
}
|
|
@@ -242,59 +324,62 @@ function Xe({
|
|
|
242
324
|
)
|
|
243
325
|
] })
|
|
244
326
|
] });
|
|
245
|
-
return
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
className: "size-8",
|
|
255
|
-
onClick: x,
|
|
256
|
-
size: "icon",
|
|
257
|
-
variant: "ghost",
|
|
258
|
-
children: /* @__PURE__ */ e($, { className: "size-4" })
|
|
259
|
-
}
|
|
260
|
-
),
|
|
261
|
-
h && /* @__PURE__ */ e(
|
|
262
|
-
o,
|
|
263
|
-
{
|
|
264
|
-
"aria-label": "New chat",
|
|
265
|
-
className: "size-8",
|
|
266
|
-
onClick: h,
|
|
267
|
-
size: "icon",
|
|
268
|
-
variant: "ghost",
|
|
269
|
-
children: /* @__PURE__ */ e(L, { className: "size-4" })
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
] })
|
|
273
|
-
] }) }),
|
|
274
|
-
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ a(ue, { children: [
|
|
275
|
-
/* @__PURE__ */ e(fe, { children: "History" }),
|
|
276
|
-
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(u, { children: q?.map((n) => /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
277
|
-
v,
|
|
327
|
+
return O ? /* @__PURE__ */ r(ve, { defaultOpen: V, children: [
|
|
328
|
+
/* @__PURE__ */ r(ge, { className: "[--sidebar-accent-foreground:oklch(0.205_0_0)] [--sidebar-accent:oklch(0.95_0_0)] group-data-[side=left]:border-r-0 dark:[--sidebar-accent-foreground:oklch(0.985_0_0)] dark:[--sidebar-accent:oklch(0.269_0_0)]", children: [
|
|
329
|
+
/* @__PURE__ */ r(Ce, { className: "gap-6 pb-2", children: [
|
|
330
|
+
/* @__PURE__ */ r("div", { className: "flex items-center px-2 pt-2", children: [
|
|
331
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: a ?? /* @__PURE__ */ e(Re, {}) }),
|
|
332
|
+
k && T.length > 0 && /* @__PURE__ */ e("div", { className: "ml-auto", children: /* @__PURE__ */ e(Fe, { onDeleteAll: k }) })
|
|
333
|
+
] }),
|
|
334
|
+
v && /* @__PURE__ */ r(
|
|
335
|
+
o,
|
|
278
336
|
{
|
|
279
|
-
|
|
280
|
-
onClick:
|
|
281
|
-
|
|
337
|
+
className: "w-full gap-2 text-foreground",
|
|
338
|
+
onClick: v,
|
|
339
|
+
variant: "outline",
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ e(L, { className: "size-4" }),
|
|
342
|
+
"New Chat"
|
|
343
|
+
]
|
|
282
344
|
}
|
|
283
|
-
)
|
|
284
|
-
] })
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
|
|
345
|
+
)
|
|
346
|
+
] }),
|
|
347
|
+
/* @__PURE__ */ r(Ne, { children: [
|
|
348
|
+
T.length === 0 && /* @__PURE__ */ r(P, { className: "px-2", children: [
|
|
349
|
+
/* @__PURE__ */ e(H, { children: "History" }),
|
|
350
|
+
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e("p", { className: "px-2 py-2 text-muted-foreground text-xs", children: "No chats yet. Start a conversation!" }) })
|
|
351
|
+
] }),
|
|
352
|
+
T.map(({ label: c, items: g }) => /* @__PURE__ */ r(P, { children: [
|
|
353
|
+
/* @__PURE__ */ e(H, { children: c }),
|
|
354
|
+
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(xe, { children: g.map((d) => /* @__PURE__ */ e(
|
|
355
|
+
We,
|
|
356
|
+
{
|
|
357
|
+
isActive: d.isActive,
|
|
358
|
+
isStreaming: l && d.isActive,
|
|
359
|
+
onDelete: I ? () => I(d.id) : void 0,
|
|
360
|
+
onSelect: z ? () => z(d.id) : void 0,
|
|
361
|
+
title: d.title
|
|
362
|
+
},
|
|
363
|
+
d.id
|
|
364
|
+
)) }) })
|
|
365
|
+
] }, c))
|
|
366
|
+
] }),
|
|
367
|
+
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(
|
|
368
|
+
Me,
|
|
287
369
|
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
370
|
+
avatarUrl: t?.avatarUrl,
|
|
371
|
+
email: t?.email,
|
|
372
|
+
name: t?.name,
|
|
373
|
+
children: y && /* @__PURE__ */ r(oe, { onClick: y, children: [
|
|
374
|
+
/* @__PURE__ */ e(ee, { className: "size-4" }),
|
|
375
|
+
"Sign out"
|
|
376
|
+
] })
|
|
292
377
|
}
|
|
293
378
|
) })
|
|
294
379
|
] }),
|
|
295
|
-
/* @__PURE__ */ e(
|
|
296
|
-
] }) :
|
|
380
|
+
/* @__PURE__ */ e(Se, { children: M })
|
|
381
|
+
] }) : M;
|
|
297
382
|
}
|
|
298
383
|
export {
|
|
299
|
-
|
|
384
|
+
cr as ChatPage
|
|
300
385
|
};
|
|
@@ -7,7 +7,7 @@ export type ChatTemplateHeaderGroupProps = React.ComponentProps<"div">;
|
|
|
7
7
|
export declare function ChatTemplateHeaderGroup({ className, ...props }: ChatTemplateHeaderGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export type ChatTemplateBodyProps = React.ComponentProps<"div">;
|
|
9
9
|
export declare function ChatTemplateBody({ className, ...props }: ChatTemplateBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export type ChatTemplateFooterProps = React.ComponentProps<"
|
|
10
|
+
export type ChatTemplateFooterProps = React.ComponentProps<"footer">;
|
|
11
11
|
export declare function ChatTemplateFooter({ className, ...props }: ChatTemplateFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export type ChatTemplateOverviewProps = React.ComponentProps<"div">;
|
|
13
13
|
export declare function ChatTemplateOverview({ className, ...props }: ChatTemplateOverviewProps): import("react/jsx-runtime").JSX.Element;
|