@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.
Files changed (45) hide show
  1. package/dist/components/index.js +595 -567
  2. package/dist/components/ui/atoms/avatar-notification-badge.d.ts +34 -0
  3. package/dist/components/ui/atoms/avatar-notification-badge.d.ts.map +1 -0
  4. package/dist/components/ui/atoms/avatar-notification-badge.js +78 -0
  5. package/dist/components/ui/atoms/index.d.ts +3 -0
  6. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  7. package/dist/components/ui/atoms/index.js +512 -504
  8. package/dist/components/ui/atoms/json-highlight.d.ts +60 -0
  9. package/dist/components/ui/atoms/json-highlight.d.ts.map +1 -0
  10. package/dist/components/ui/atoms/json-highlight.js +77 -0
  11. package/dist/components/ui/atoms/scroll-button.js +8 -8
  12. package/dist/components/ui/atoms/view-tools-control.d.ts +1 -1
  13. package/dist/components/ui/atoms/view-tools-control.d.ts.map +1 -1
  14. package/dist/components/ui/atoms/view-tools-control.js +20 -19
  15. package/dist/components/ui/index.js +595 -567
  16. package/dist/components/ui/molecules/chat-message-list.d.ts +5 -2
  17. package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
  18. package/dist/components/ui/molecules/chat-message-list.js +2 -2
  19. package/dist/components/ui/molecules/index.d.ts +8 -0
  20. package/dist/components/ui/molecules/index.d.ts.map +1 -1
  21. package/dist/components/ui/molecules/index.js +48 -28
  22. package/dist/components/ui/molecules/prompt-input.js +20 -20
  23. package/dist/components/ui/molecules/requirement-badges.js +8 -4
  24. package/dist/components/ui/molecules/switcher.d.ts +83 -0
  25. package/dist/components/ui/molecules/switcher.d.ts.map +1 -0
  26. package/dist/components/ui/molecules/switcher.js +164 -0
  27. package/dist/components/ui/molecules/tool-authorization.d.ts +56 -0
  28. package/dist/components/ui/molecules/tool-authorization.d.ts.map +1 -0
  29. package/dist/components/ui/molecules/tool-authorization.js +160 -0
  30. package/dist/components/ui/molecules/tool-call-accordion.d.ts +36 -0
  31. package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -0
  32. package/dist/components/ui/molecules/tool-call-accordion.js +301 -0
  33. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  34. package/dist/components/ui/molecules/user-nav.d.ts +65 -0
  35. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -0
  36. package/dist/components/ui/molecules/user-nav.js +154 -0
  37. package/dist/components/ui/pages/chat-page.d.ts +18 -10
  38. package/dist/components/ui/pages/chat-page.d.ts.map +1 -1
  39. package/dist/components/ui/pages/chat-page.js +328 -243
  40. package/dist/components/ui/templates/chat-template.d.ts +1 -1
  41. package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
  42. package/dist/components/ui/templates/chat-template.js +11 -11
  43. package/dist/main.js +621 -593
  44. package/dist/{toolkit-card-k8jio69G.js → toolkit-card-DAgQXF93.js} +13 -10
  45. package/package.json +1 -1
@@ -1,238 +1,320 @@
1
- import { jsxs as a, jsx as e, Fragment as X } from "react/jsx-runtime";
2
- import { PlusIcon as Y, SquareIcon as Z, ArrowUpIcon as _, Trash2Icon as $, SquarePenIcon as L, ChevronsUpDownIcon as T, SunIcon as ee, MoonIcon as ae, MonitorIcon as re, LogOutIcon as te } from "lucide-react";
3
- import { Avatar as w, AvatarImage as I, AvatarFallback as M } from "../atoms/avatar.js";
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 ne, ChatContainerContent as le, ChatContainerScrollAnchor as ie } from "../atoms/chat-container.js";
6
- import { DropdownMenu as D, DropdownMenuTrigger as P, DropdownMenuContent as j, DropdownMenuRadioGroup as A, DropdownMenuRadioItem as p, DropdownMenuLabel as y, DropdownMenuSeparator as U, DropdownMenuItem as ce } from "../atoms/dropdown-menu.js";
7
- import { ScrollButton as se } from "../atoms/scroll-button.js";
8
- import { SidebarTrigger as de, SidebarProvider as oe, Sidebar as me, SidebarHeader as he, SidebarContent as pe, SidebarGroup as ue, SidebarGroupLabel as fe, SidebarGroupContent as ve, SidebarMenu as u, SidebarMenuItem as f, SidebarMenuButton as v, SidebarFooter as Ne, SidebarInset as ge } from "../atoms/sidebar.js";
9
- import { ChatMessageList as xe } from "../molecules/chat-message-list.js";
10
- import { PromptInput as be, PromptInputTextarea as Ce, PromptInputActions as Se, PromptInputAction as ze } from "../molecules/prompt-input.js";
11
- import { SuggestionCard as we } from "../molecules/suggestion-card.js";
12
- import { ChatTemplate as Ie, ChatTemplateHeader as Me, ChatTemplateHeaderGroup as k, ChatTemplateOverview as ye, ChatTemplateOverviewTitle as Ue, ChatTemplateOverviewSubtitle as ke, ChatTemplateFooter as Te, ChatTemplateSuggestions as De } from "../templates/chat-template.js";
13
- import { cn as Pe } from "../../../lib/utils.js";
14
- function je({
15
- user: r,
16
- theme: c = "system",
17
- onThemeChange: l,
18
- onSignOut: t
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
- const m = r?.name?.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase();
21
- return l || t ? /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ a(D, { children: [
22
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ a(
23
- v,
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
- className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
26
- size: "lg",
27
- children: [
28
- /* @__PURE__ */ a(w, { className: "size-8 rounded-lg", children: [
29
- r?.avatarUrl && /* @__PURE__ */ e(I, { alt: r.name ?? "User", src: r.avatarUrl }),
30
- /* @__PURE__ */ e(M, { className: "rounded-lg", children: m ?? "U" })
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
- /* @__PURE__ */ a(
41
- j,
42
- {
43
- align: "end",
44
- className: "w-56",
45
- side: "top",
46
- sideOffset: 4,
47
- children: [
48
- /* @__PURE__ */ e(y, { children: "My Account" }),
49
- /* @__PURE__ */ e(U, {}),
50
- l && /* @__PURE__ */ a(X, { children: [
51
- /* @__PURE__ */ e(y, { className: "font-normal text-muted-foreground text-xs", children: "Theme" }),
52
- /* @__PURE__ */ a(
53
- A,
54
- {
55
- onValueChange: (s) => l(s),
56
- value: c,
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__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
88
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: r?.name ?? "User" }),
89
- r?.email && /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground text-xs", children: r.email })
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 Ae({
94
- models: r,
95
- selectedModelId: c,
96
- onModelChange: l
89
+ function We({
90
+ title: t,
91
+ isActive: a,
92
+ isStreaming: n = !1,
93
+ onSelect: i,
94
+ onDelete: h
97
95
  }) {
98
- return !r || r.length === 0 ? null : /* @__PURE__ */ a(D, { children: [
99
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ a(o, { className: "h-[34px] gap-1 px-2", variant: "outline", children: [
100
- r.find((t) => t.id === c)?.name ?? "Select model",
101
- /* @__PURE__ */ e(T, { className: "size-3" })
102
- ] }) }),
103
- /* @__PURE__ */ e(j, { align: "start", className: "min-w-[300px]", children: /* @__PURE__ */ e(
104
- A,
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
- onValueChange: l,
107
- value: c,
108
- children: r.map((t) => /* @__PURE__ */ e(p, { value: t.id, children: /* @__PURE__ */ a("div", { className: "flex flex-col items-start gap-1", children: [
109
- /* @__PURE__ */ e("div", { className: "font-medium", children: t.name }),
110
- t.description && /* @__PURE__ */ e("div", { className: "text-muted-foreground text-xs", children: t.description })
111
- ] }) }, t.id))
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 Xe({
117
- user: r,
118
- logo: c,
119
- suggestedActions: l,
120
- onSuggestionAction: t,
121
- models: m,
122
- selectedModelId: s,
123
- onModelChange: H,
124
- inputValue: N,
125
- onInputChange: G,
126
- onSubmit: g,
127
- isLoading: i = !1,
128
- onStop: B,
129
- onNewChat: h,
130
- onDeleteAll: x,
131
- onSignOut: F,
132
- onThemeChange: O,
133
- theme: R = "system",
134
- chatHistory: q,
135
- onSelectChat: V,
136
- defaultSidebarOpen: E = !0,
137
- showSidebar: b = !0,
138
- messages: d,
139
- renderMessage: J,
140
- loadingIndicator: K,
141
- children: C
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 Q = !!C || d !== void 0 && d.length > 0, W = r?.name ?? "there", S = /* @__PURE__ */ a(Ie, { children: [
144
- /* @__PURE__ */ a(Me, { children: [
145
- /* @__PURE__ */ a(k, { children: [
146
- b && /* @__PURE__ */ e(de, {}),
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
- Ae,
216
+ qe,
149
217
  {
150
- models: m,
151
- onModelChange: H,
152
- selectedModelId: s
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(k, { children: h && /* @__PURE__ */ a(
158
- o,
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
- isStreaming: i,
177
- loadingIndicator: K,
178
- messages: d,
179
- renderMessage: J
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
- ) : /* @__PURE__ */ a(ye, { children: [
182
- /* @__PURE__ */ a(Ue, { children: [
183
- "Hi, ",
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__ */ a(Te, { children: [
194
- !Q && l && l.length > 0 && /* @__PURE__ */ e(De, { children: l.map((n, z) => /* @__PURE__ */ e(
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: Pe(
275
+ className: q(
198
276
  "col-span-12 sm:col-span-6",
199
- z < 3 ? "md:col-span-4" : "md:col-span-6",
200
- z > 1 && "hidden sm:block"
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
- we,
281
+ De,
204
282
  {
205
- icon: n.icon,
206
- onClick: n.onClick ?? (n.action ? () => t?.(n.action ?? "") : void 0),
207
- subtitle: n.subtitle,
208
- title: n.title
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
- n.id
293
+ c.id
213
294
  )) }),
214
- /* @__PURE__ */ a(
215
- be,
295
+ /* @__PURE__ */ r(
296
+ ye,
216
297
  {
217
- isLoading: i,
218
- onSubmit: g,
219
- onValueChange: G,
220
- value: N,
298
+ disabled: s,
299
+ isLoading: l,
300
+ onSubmit: S,
301
+ onValueChange: m,
302
+ value: f,
221
303
  children: [
222
- /* @__PURE__ */ e(Ce, { placeholder: "Send a message..." }),
223
- /* @__PURE__ */ e(Se, { className: "justify-end px-2 pb-2", children: /* @__PURE__ */ e(
224
- ze,
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: i ? "Stop generating" : "Send message",
308
+ tooltip: l ? "Stop generating" : "Send message",
227
309
  children: /* @__PURE__ */ e(
228
310
  o,
229
311
  {
230
- "aria-label": i ? "Stop generating" : "Send message",
231
- disabled: !(i || N?.trim()),
232
- onClick: i ? B : g,
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: i ? "destructive" : "default",
235
- children: i ? /* @__PURE__ */ e(Z, { className: "size-4 fill-current" }) : /* @__PURE__ */ e(_, { className: "size-4" })
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 b ? /* @__PURE__ */ a(oe, { defaultOpen: E, children: [
246
- /* @__PURE__ */ a(me, { className: "group-data-[side=left]:border-r-0", children: [
247
- /* @__PURE__ */ e(he, { children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
248
- c && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 px-2", children: c }),
249
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
250
- x && /* @__PURE__ */ e(
251
- o,
252
- {
253
- "aria-label": "Delete all chats",
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
- isActive: n.isActive,
280
- onClick: () => V?.(n.id),
281
- children: /* @__PURE__ */ e("span", { children: n.title })
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
- ) }, n.id)) }) })
284
- ] }) }),
285
- /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
286
- je,
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
- onSignOut: F,
289
- onThemeChange: O,
290
- theme: R,
291
- user: r
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(ge, { children: S })
296
- ] }) : S;
380
+ /* @__PURE__ */ e(Se, { children: M })
381
+ ] }) : M;
297
382
  }
298
383
  export {
299
- Xe as ChatPage
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<"div">;
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;