@arcadeai/design-system 3.36.0 → 3.36.2
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 +411 -396
- package/dist/components/ui/atoms/arcade-gradient.d.ts.map +1 -0
- package/dist/components/ui/atoms/{icons/arcade-gradient.js → arcade-gradient.js} +1 -1
- package/dist/components/ui/atoms/icons/index.d.ts +0 -1
- package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/index.js +294 -296
- package/dist/components/ui/atoms/index.d.ts +1 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +112 -112
- package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -1
- package/dist/components/ui/atoms/virtualized-grid.js +16 -16
- package/dist/components/ui/index.js +411 -396
- package/dist/components/ui/molecules/chat-history-item.d.ts +21 -0
- package/dist/components/ui/molecules/chat-history-item.d.ts.map +1 -0
- package/dist/components/ui/molecules/chat-history-item.js +88 -0
- package/dist/components/ui/molecules/chat-message-list.d.ts +6 -0
- package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
- package/dist/components/ui/molecules/chat-message-list.js +117 -61
- package/dist/components/ui/molecules/confirm-popover.d.ts +20 -0
- package/dist/components/ui/molecules/confirm-popover.d.ts.map +1 -0
- package/dist/components/ui/molecules/confirm-popover.js +50 -0
- package/dist/components/ui/molecules/error-state.d.ts +17 -0
- package/dist/components/ui/molecules/error-state.d.ts.map +1 -0
- package/dist/components/ui/molecules/error-state.js +45 -0
- package/dist/components/ui/molecules/index.d.ts +8 -4
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +41 -41
- package/dist/components/ui/molecules/requirement-badges.js +4 -5
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/pages/chat-page-skeleton.d.ts +7 -0
- package/dist/components/ui/pages/chat-page-skeleton.d.ts.map +1 -0
- package/dist/components/ui/pages/chat-page-skeleton.js +18 -0
- package/dist/components/ui/pages/index.d.ts +2 -2
- package/dist/components/ui/pages/index.d.ts.map +1 -1
- package/dist/components/ui/pages/index.js +4 -4
- package/dist/components/ui/templates/chat-template-skeletons.d.ts +12 -0
- package/dist/components/ui/templates/chat-template-skeletons.d.ts.map +1 -0
- package/dist/components/ui/templates/chat-template-skeletons.js +127 -0
- package/dist/components/ui/templates/error-template.d.ts +20 -0
- package/dist/components/ui/templates/error-template.d.ts.map +1 -0
- package/dist/components/ui/templates/error-template.js +117 -0
- package/dist/components/ui/templates/index.d.ts +4 -0
- package/dist/components/ui/templates/index.d.ts.map +1 -1
- package/dist/components/ui/templates/index.js +37 -22
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +12 -11
- package/dist/main.js +380 -365
- package/dist/metadata/toolkit-icons.d.ts.map +1 -1
- package/dist/metadata/toolkit-icons.js +187 -186
- package/dist/metadata/toolkits.d.ts.map +1 -1
- package/dist/metadata/toolkits.js +13 -0
- package/dist/{toolkit-card-B97E7TBA.js → toolkit-card-CB1oiaei.js} +2 -3
- package/package.json +1 -1
- package/dist/components/ui/atoms/icons/arcade-gradient.d.ts.map +0 -1
- package/dist/components/ui/molecules/switcher.d.ts +0 -83
- package/dist/components/ui/molecules/switcher.d.ts.map +0 -1
- package/dist/components/ui/molecules/switcher.js +0 -164
- package/dist/components/ui/pages/chat-page.d.ts +0 -83
- package/dist/components/ui/pages/chat-page.d.ts.map +0 -1
- package/dist/components/ui/pages/chat-page.js +0 -385
- /package/dist/components/ui/atoms/{icons/arcade-gradient.d.ts → arcade-gradient.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switcher.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/switcher.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAUlD,OAAO,EAEL,mBAAmB,EAGpB,MAAM,qCAAqC,CAAC;AA6B7C;;;;GAIG;AACH,iBAAS,WAAW;;;oBA1BF,OAAO,KAAK,IAAI;;EAkCjC;AAID,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yFAAyF;IACzF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,KAAK,EACL,aAAa,EACb,IAAI,EAAE,cAAc,EACpB,YAAY,GACb,EAAE,iBAAiB,2CA2CnB;AAID,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CAMrE;AAID,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CACN,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,EAChD,UAAU,GAAG,WAAW,CACzB,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,2CAgBtB;AAID,KAAK,kBAAkB,GAAG;IACxB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,iBAAS,aAAa,CAAC,EAAE,WAA4B,EAAE,EAAE,kBAAkB,2CA4D1E;AAID,KAAK,iBAAiB,GAAG;IACvB,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iFAAiF;IACjF,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAC,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,kDA4CnB;AAID,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,IAAI,aAAa,EAClC,oBAAoB,GACrB,CAAC;AACF,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,CAAC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as C } from "react/jsx-runtime";
|
|
2
|
-
import { Search as D } from "lucide-react";
|
|
3
|
-
import { createContext as x, useState as y, useRef as S, useCallback as I, useMemo as k, useEffect as R, useContext as Q } from "react";
|
|
4
|
-
import { DropdownMenu as T, DropdownMenuContent as E, DropdownMenuItem as M, DropdownMenuTrigger as N } from "../atoms/dropdown-menu.js";
|
|
5
|
-
import { Input as V } from "../atoms/input.js";
|
|
6
|
-
import { cn as g } from "../../../lib/utils.js";
|
|
7
|
-
const b = x(null);
|
|
8
|
-
function m() {
|
|
9
|
-
const t = Q(b);
|
|
10
|
-
if (!t)
|
|
11
|
-
throw new Error(
|
|
12
|
-
"Switcher compound components must be used within <Switcher>"
|
|
13
|
-
);
|
|
14
|
-
return t;
|
|
15
|
-
}
|
|
16
|
-
function F() {
|
|
17
|
-
const t = m();
|
|
18
|
-
return {
|
|
19
|
-
searchQuery: t.searchQuery,
|
|
20
|
-
open: t.open,
|
|
21
|
-
setOpen: t.setOpen,
|
|
22
|
-
selectedValue: t.selectedValue
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function U({
|
|
26
|
-
children: t,
|
|
27
|
-
value: r,
|
|
28
|
-
onValueChange: o,
|
|
29
|
-
open: n,
|
|
30
|
-
onOpenChange: s
|
|
31
|
-
}) {
|
|
32
|
-
const [a, c] = y(!1), [l, e] = y(""), f = S(null), w = S(null), p = n !== void 0, u = p ? n : a, h = I(
|
|
33
|
-
(d) => {
|
|
34
|
-
p || c(d), s?.(d), d && e("");
|
|
35
|
-
},
|
|
36
|
-
[p, s]
|
|
37
|
-
), v = k(
|
|
38
|
-
() => ({
|
|
39
|
-
open: u,
|
|
40
|
-
setOpen: h,
|
|
41
|
-
searchQuery: l,
|
|
42
|
-
setSearchQuery: e,
|
|
43
|
-
selectedValue: r,
|
|
44
|
-
onValueChange: o,
|
|
45
|
-
searchInputRef: f,
|
|
46
|
-
contentRef: w
|
|
47
|
-
}),
|
|
48
|
-
[u, h, l, r, o]
|
|
49
|
-
);
|
|
50
|
-
return /* @__PURE__ */ i(b.Provider, { value: v, children: /* @__PURE__ */ i(T, { onOpenChange: h, open: u, children: t }) });
|
|
51
|
-
}
|
|
52
|
-
function z({ children: t, className: r }) {
|
|
53
|
-
return /* @__PURE__ */ i(N, { asChild: !0, className: r, "data-slot": "switcher", children: t });
|
|
54
|
-
}
|
|
55
|
-
function Y({
|
|
56
|
-
children: t,
|
|
57
|
-
className: r,
|
|
58
|
-
...o
|
|
59
|
-
}) {
|
|
60
|
-
const { contentRef: n } = m();
|
|
61
|
-
return /* @__PURE__ */ i(
|
|
62
|
-
E,
|
|
63
|
-
{
|
|
64
|
-
className: g(
|
|
65
|
-
"max-h-[var(--radix-dropdown-menu-content-available-height)] w-80 overflow-y-auto p-2",
|
|
66
|
-
r
|
|
67
|
-
),
|
|
68
|
-
"data-switcher-content": !0,
|
|
69
|
-
ref: n,
|
|
70
|
-
...o,
|
|
71
|
-
children: t
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
const A = 100;
|
|
76
|
-
function _({ placeholder: t = "Search…" }) {
|
|
77
|
-
const {
|
|
78
|
-
open: r,
|
|
79
|
-
searchQuery: o,
|
|
80
|
-
setSearchQuery: n,
|
|
81
|
-
setOpen: s,
|
|
82
|
-
contentRef: a,
|
|
83
|
-
searchInputRef: c
|
|
84
|
-
} = m();
|
|
85
|
-
R(() => {
|
|
86
|
-
if (r && c.current) {
|
|
87
|
-
const e = setTimeout(
|
|
88
|
-
() => c.current?.focus(),
|
|
89
|
-
A
|
|
90
|
-
);
|
|
91
|
-
return () => clearTimeout(e);
|
|
92
|
-
}
|
|
93
|
-
}, [r, c]);
|
|
94
|
-
function l(e) {
|
|
95
|
-
const f = () => a.current?.querySelector(
|
|
96
|
-
"[data-switcher-item]"
|
|
97
|
-
);
|
|
98
|
-
if (e.key === "Tab") {
|
|
99
|
-
s(!1);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
e.key === "ArrowDown" ? (e.preventDefault(), f()?.focus()) : e.key === "Enter" ? (e.preventDefault(), f()?.click()) : e.key === "Escape" && (e.preventDefault(), s(!1)), e.stopPropagation();
|
|
103
|
-
}
|
|
104
|
-
return /* @__PURE__ */ C("div", { className: "relative sticky top-0 z-10 border-border/60 border-b bg-popover pb-2", children: [
|
|
105
|
-
/* @__PURE__ */ i(D, { className: "absolute top-2.5 left-2 h-4 w-4 text-muted-foreground" }),
|
|
106
|
-
/* @__PURE__ */ i(
|
|
107
|
-
V,
|
|
108
|
-
{
|
|
109
|
-
className: "h-9 border-0 pl-8 focus-visible:ring-1",
|
|
110
|
-
onChange: (e) => n(e.target.value),
|
|
111
|
-
onClick: (e) => e.stopPropagation(),
|
|
112
|
-
onFocus: (e) => e.stopPropagation(),
|
|
113
|
-
onKeyDown: l,
|
|
114
|
-
placeholder: t,
|
|
115
|
-
ref: c,
|
|
116
|
-
value: o
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] });
|
|
120
|
-
}
|
|
121
|
-
function B({
|
|
122
|
-
value: t,
|
|
123
|
-
textValue: r,
|
|
124
|
-
onSelect: o,
|
|
125
|
-
children: n,
|
|
126
|
-
className: s
|
|
127
|
-
}) {
|
|
128
|
-
const {
|
|
129
|
-
searchQuery: a,
|
|
130
|
-
selectedValue: c,
|
|
131
|
-
onValueChange: l,
|
|
132
|
-
searchInputRef: e,
|
|
133
|
-
contentRef: f
|
|
134
|
-
} = m();
|
|
135
|
-
if (!(!a || r === void 0 || r.toLowerCase().includes(a.toLowerCase())))
|
|
136
|
-
return null;
|
|
137
|
-
const p = t === c;
|
|
138
|
-
return /* @__PURE__ */ i(
|
|
139
|
-
M,
|
|
140
|
-
{
|
|
141
|
-
className: g(
|
|
142
|
-
"group flex cursor-pointer items-center gap-2.5 px-3 py-2.5 hover:bg-accent/50 focus:bg-accent",
|
|
143
|
-
s
|
|
144
|
-
),
|
|
145
|
-
"data-switcher-item": !0,
|
|
146
|
-
"data-value": t,
|
|
147
|
-
onClick: () => o ? o() : l(t),
|
|
148
|
-
onKeyDown: (u) => {
|
|
149
|
-
u.key === "ArrowUp" && f.current?.querySelectorAll(
|
|
150
|
-
"[data-switcher-item]"
|
|
151
|
-
)?.[0] === u.currentTarget && (u.preventDefault(), e.current?.focus());
|
|
152
|
-
},
|
|
153
|
-
children: typeof n == "function" ? n({ isSelected: p }) : n
|
|
154
|
-
}
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
export {
|
|
158
|
-
U as Switcher,
|
|
159
|
-
Y as SwitcherContent,
|
|
160
|
-
_ as SwitcherInput,
|
|
161
|
-
B as SwitcherItem,
|
|
162
|
-
z as SwitcherTrigger,
|
|
163
|
-
F as useSwitcher
|
|
164
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ChatMessageItem, ChatMessageListProps } from '../molecules/chat-message-list';
|
|
2
|
-
import { SuggestionCardProps } from '../molecules/suggestion-card';
|
|
3
|
-
import type * as React from "react";
|
|
4
|
-
/** A suggestion card item extended with an id and optional action string. */
|
|
5
|
-
export type ChatPageSuggestion = Pick<SuggestionCardProps, "icon" | "title" | "subtitle" | "onClick"> & {
|
|
6
|
-
id: string;
|
|
7
|
-
/** Message text to send when this suggestion is clicked. Used with `onSuggestionAction`. */
|
|
8
|
-
action?: string;
|
|
9
|
-
};
|
|
10
|
-
export type ChatPageProps = {
|
|
11
|
-
/** User information for greeting and sidebar avatar */
|
|
12
|
-
user?: {
|
|
13
|
-
name?: string;
|
|
14
|
-
email?: string;
|
|
15
|
-
avatarUrl?: string;
|
|
16
|
-
};
|
|
17
|
-
/** Logo element for the sidebar header */
|
|
18
|
-
logo?: React.ReactNode;
|
|
19
|
-
/** Suggested action cards shown when the chat is empty */
|
|
20
|
-
suggestedActions?: ChatPageSuggestion[];
|
|
21
|
-
/** Callback when a suggestion with an `action` string is clicked */
|
|
22
|
-
onSuggestionAction?: (action: string) => void;
|
|
23
|
-
/** Available models for the model selector dropdown */
|
|
24
|
-
models?: Array<{
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
}>;
|
|
29
|
-
/** Currently selected model ID */
|
|
30
|
-
selectedModelId?: string;
|
|
31
|
-
/** Callback when model changes */
|
|
32
|
-
onModelChange?: (id: string) => void;
|
|
33
|
-
/** Prompt input value (controlled) */
|
|
34
|
-
inputValue?: string;
|
|
35
|
-
/** Callback when input changes */
|
|
36
|
-
onInputChange?: (value: string) => void;
|
|
37
|
-
/** Disables the composer while the caller is hydrating or otherwise blocking input. */
|
|
38
|
-
inputDisabled?: boolean;
|
|
39
|
-
/** Callback when message is submitted */
|
|
40
|
-
onSubmit?: () => void;
|
|
41
|
-
/** Whether a response is loading / streaming */
|
|
42
|
-
isLoading?: boolean;
|
|
43
|
-
/** Callback to stop a streaming response */
|
|
44
|
-
onStop?: () => void;
|
|
45
|
-
/** Callback for creating a new chat */
|
|
46
|
-
onNewChat?: () => void;
|
|
47
|
-
/** Callback for deleting all chats */
|
|
48
|
-
onDeleteAll?: () => void;
|
|
49
|
-
/** Callback for sign out */
|
|
50
|
-
onSignOut?: () => void;
|
|
51
|
-
/** Chat history items for the sidebar, pre-grouped by date (use groupHistory from @arcadeai/ui-kit) */
|
|
52
|
-
chatHistoryGroups?: Array<{
|
|
53
|
-
label: string;
|
|
54
|
-
items: Array<{
|
|
55
|
-
id: string;
|
|
56
|
-
title: string;
|
|
57
|
-
isActive?: boolean;
|
|
58
|
-
}>;
|
|
59
|
-
}>;
|
|
60
|
-
/** Callback when a chat history item is selected */
|
|
61
|
-
onSelectChat?: (id: string) => void;
|
|
62
|
-
/** Callback to delete a single chat history item */
|
|
63
|
-
onDeleteChat?: (id: string) => void;
|
|
64
|
-
/** Whether the sidebar is open by default */
|
|
65
|
-
defaultSidebarOpen?: boolean;
|
|
66
|
-
/** Whether to show the sidebar. When false, the chat takes the full width. */
|
|
67
|
-
showSidebar?: boolean;
|
|
68
|
-
/** Normalized messages to render via ChatMessageList. When present with items, hides overview/suggestions. */
|
|
69
|
-
messages?: ChatMessageItem[];
|
|
70
|
-
/** Custom render function for individual messages (passed to ChatMessageList) */
|
|
71
|
-
renderMessage?: ChatMessageListProps["renderMessage"];
|
|
72
|
-
/** Custom loading indicator for streaming (passed to ChatMessageList) */
|
|
73
|
-
loadingIndicator?: React.ReactNode;
|
|
74
|
-
/** Children rendered in the body area. Overrides `messages` prop when present. */
|
|
75
|
-
children?: React.ReactNode;
|
|
76
|
-
/**
|
|
77
|
-
* Key for the scroll container. Change this value (e.g. pass the active chat ID)
|
|
78
|
-
* to remount the container and jump instantly to the bottom instead of animating.
|
|
79
|
-
*/
|
|
80
|
-
scrollKey?: string | number;
|
|
81
|
-
};
|
|
82
|
-
export declare function ChatPage({ user, logo, suggestedActions, onSuggestionAction, models, selectedModelId, onModelChange, inputValue, onInputChange, inputDisabled, onSubmit, isLoading, onStop, onNewChat, onDeleteAll, onSignOut, chatHistoryGroups, onSelectChat, onDeleteChat, defaultSidebarOpen, showSidebar, messages, renderMessage, loadingIndicator, children, scrollKey, }: ChatPageProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
-
//# sourceMappingURL=chat-page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-page.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/pages/chat-page.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,385 +0,0 @@
|
|
|
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 { Button as o } from "../atoms/button.js";
|
|
5
|
-
import { ChatContainerRoot as ne, ChatContainerContent as ae, ChatContainerScrollAnchor as ie } from "../atoms/chat-container.js";
|
|
6
|
-
import { DropdownMenuItem as le, DropdownMenu as oe, DropdownMenuTrigger as ce, DropdownMenuContent as se, DropdownMenuRadioGroup as de, DropdownMenuRadioItem as he } from "../atoms/dropdown-menu.js";
|
|
7
|
-
import { ArcadeLogo as me } from "../atoms/icons/arcade-logo.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(me, { 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
|
|
34
|
-
}) {
|
|
35
|
-
return !t || t.length === 0 ? null : /* @__PURE__ */ r(oe, { children: [
|
|
36
|
-
/* @__PURE__ */ e(ce, { 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(se, { align: "start", className: "min-w-[300px]", children: /* @__PURE__ */ e(
|
|
41
|
-
de,
|
|
42
|
-
{
|
|
43
|
-
onValueChange: n,
|
|
44
|
-
value: a,
|
|
45
|
-
children: t.map((i) => /* @__PURE__ */ e(he, { 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))
|
|
49
|
-
}
|
|
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" })
|
|
68
|
-
] }),
|
|
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
|
-
] })
|
|
86
|
-
] })
|
|
87
|
-
] });
|
|
88
|
-
}
|
|
89
|
-
function We({
|
|
90
|
-
title: t,
|
|
91
|
-
isActive: a,
|
|
92
|
-
isStreaming: n = !1,
|
|
93
|
-
onSelect: i,
|
|
94
|
-
onDelete: h
|
|
95
|
-
}) {
|
|
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,
|
|
121
|
-
{
|
|
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
|
-
)
|
|
133
|
-
}
|
|
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
|
-
] })
|
|
178
|
-
] });
|
|
179
|
-
}
|
|
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
|
|
207
|
-
}) {
|
|
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
|
-
] }),
|
|
215
|
-
/* @__PURE__ */ e(
|
|
216
|
-
qe,
|
|
217
|
-
{
|
|
218
|
-
models: h,
|
|
219
|
-
onModelChange: u,
|
|
220
|
-
selectedModelId: b
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] }),
|
|
224
|
-
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
225
|
-
/* @__PURE__ */ e(A, { children: v && /* @__PURE__ */ r(C, { children: [
|
|
226
|
-
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ r(
|
|
227
|
-
o,
|
|
228
|
-
{
|
|
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
|
-
]
|
|
237
|
-
}
|
|
238
|
-
) }),
|
|
239
|
-
/* @__PURE__ */ e(x, { children: "New chat" })
|
|
240
|
-
] }) })
|
|
241
|
-
] }),
|
|
242
|
-
/* @__PURE__ */ r(
|
|
243
|
-
ne,
|
|
244
|
-
{
|
|
245
|
-
className: "relative min-w-0 flex-1 flex-col pt-4",
|
|
246
|
-
children: [
|
|
247
|
-
/* @__PURE__ */ r(ae, { 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(ie, {})
|
|
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(
|
|
273
|
-
"div",
|
|
274
|
-
{
|
|
275
|
-
className: q(
|
|
276
|
-
"col-span-12 sm:col-span-6",
|
|
277
|
-
g < 3 ? "md:col-span-4" : "md:col-span-6",
|
|
278
|
-
g > 1 && "hidden sm:block"
|
|
279
|
-
),
|
|
280
|
-
children: /* @__PURE__ */ e(
|
|
281
|
-
De,
|
|
282
|
-
{
|
|
283
|
-
icon: c.icon,
|
|
284
|
-
onClick: Ue(
|
|
285
|
-
c,
|
|
286
|
-
i
|
|
287
|
-
),
|
|
288
|
-
subtitle: c.subtitle,
|
|
289
|
-
title: c.title
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
},
|
|
293
|
-
c.id
|
|
294
|
-
)) }),
|
|
295
|
-
/* @__PURE__ */ r(
|
|
296
|
-
ye,
|
|
297
|
-
{
|
|
298
|
-
disabled: s,
|
|
299
|
-
isLoading: l,
|
|
300
|
-
onSubmit: S,
|
|
301
|
-
onValueChange: m,
|
|
302
|
-
value: f,
|
|
303
|
-
children: [
|
|
304
|
-
/* @__PURE__ */ e(ze, { placeholder: "Send a message..." }),
|
|
305
|
-
/* @__PURE__ */ e(Ie, { className: "justify-end px-2 pb-2", children: /* @__PURE__ */ e(
|
|
306
|
-
Oe,
|
|
307
|
-
{
|
|
308
|
-
tooltip: l ? "Stop generating" : "Send message",
|
|
309
|
-
children: /* @__PURE__ */ e(
|
|
310
|
-
o,
|
|
311
|
-
{
|
|
312
|
-
"aria-label": l ? "Stop generating" : "Send message",
|
|
313
|
-
disabled: s || !(l || f?.trim()),
|
|
314
|
-
onClick: l ? F : S,
|
|
315
|
-
size: "icon",
|
|
316
|
-
variant: l ? "destructive" : "default",
|
|
317
|
-
children: l ? /* @__PURE__ */ e(Y, { className: "size-4 fill-current" }) : /* @__PURE__ */ e(Z, { className: "size-4" })
|
|
318
|
-
}
|
|
319
|
-
)
|
|
320
|
-
}
|
|
321
|
-
) })
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
)
|
|
325
|
-
] })
|
|
326
|
-
] });
|
|
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,
|
|
336
|
-
{
|
|
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
|
-
]
|
|
344
|
-
}
|
|
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,
|
|
369
|
-
{
|
|
370
|
-
avatarUrl: t?.avatarUrl,
|
|
371
|
-
email: t?.email,
|
|
372
|
-
name: t?.name,
|
|
373
|
-
children: y && /* @__PURE__ */ r(le, { onClick: y, children: [
|
|
374
|
-
/* @__PURE__ */ e(ee, { className: "size-4" }),
|
|
375
|
-
"Sign out"
|
|
376
|
-
] })
|
|
377
|
-
}
|
|
378
|
-
) })
|
|
379
|
-
] }),
|
|
380
|
-
/* @__PURE__ */ e(Se, { children: M })
|
|
381
|
-
] }) : M;
|
|
382
|
-
}
|
|
383
|
-
export {
|
|
384
|
-
cr as ChatPage
|
|
385
|
-
};
|
|
File without changes
|