@arcadeai/design-system 3.35.2 → 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/assets/icons/claude-code-logotype.js +10 -0
- package/dist/assets/icons/cursor-logotype.js +10 -0
- package/dist/assets/icons/langchain-logotype.js +10 -0
- package/dist/assets/icons/mastra-logotype.js +10 -0
- package/dist/assets/icons/vercel-logotype.js +10 -0
- package/dist/components/index.js +631 -600
- package/dist/components/ui/atoms/arcade-gradient.d.ts +4 -0
- package/dist/components/ui/atoms/arcade-gradient.d.ts.map +1 -0
- package/dist/components/ui/atoms/arcade-gradient.js +26 -0
- package/dist/components/ui/atoms/brand-chip.d.ts +9 -0
- package/dist/components/ui/atoms/brand-chip.d.ts.map +1 -0
- package/dist/components/ui/atoms/brand-chip.js +19 -0
- package/dist/components/ui/atoms/code-block.d.ts.map +1 -1
- package/dist/components/ui/atoms/code-block.js +31 -723
- package/dist/components/ui/atoms/icons/claude-code-logotype.d.ts +4 -0
- package/dist/components/ui/atoms/icons/claude-code-logotype.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/claude-code-logotype.js +34 -0
- package/dist/components/ui/atoms/icons/cursor-logotype.d.ts +4 -0
- package/dist/components/ui/atoms/icons/cursor-logotype.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/cursor-logotype.js +21 -0
- package/dist/components/ui/atoms/icons/index.d.ts +5 -0
- package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/index.js +278 -268
- package/dist/components/ui/atoms/icons/langchain-logotype.d.ts +4 -0
- package/dist/components/ui/atoms/icons/langchain-logotype.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/langchain-logotype.js +45 -0
- package/dist/components/ui/atoms/icons/mastra-logotype.d.ts +4 -0
- package/dist/components/ui/atoms/icons/mastra-logotype.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/mastra-logotype.js +19 -0
- package/dist/components/ui/atoms/icons/vercel-logotype.d.ts +4 -0
- package/dist/components/ui/atoms/icons/vercel-logotype.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/vercel-logotype.js +26 -0
- package/dist/components/ui/atoms/icons/vercel.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/vercel.js +0 -1
- package/dist/components/ui/atoms/index.d.ts +2 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +530 -516
- 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 +631 -600
- 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/command-bar.d.ts +7 -0
- package/dist/components/ui/molecules/command-bar.d.ts.map +1 -0
- package/dist/components/ui/molecules/command-bar.js +38 -0
- 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/empty-state.d.ts +2 -1
- package/dist/components/ui/molecules/empty-state.d.ts.map +1 -1
- package/dist/components/ui/molecules/empty-state.js +9 -7
- 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 +9 -4
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +51 -49
- 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/lib/shiki-themes.d.ts +5 -0
- package/dist/lib/shiki-themes.d.ts.map +1 -0
- package/dist/lib/shiki-themes.js +7 -0
- package/dist/main.js +656 -625
- 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/dist/web-BwFNdl01.js +697 -0
- package/package.json +3 -2
- 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
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DropdownMenuContent } from '../atoms/dropdown-menu';
|
|
3
|
-
/**
|
|
4
|
-
* Access the switcher context from a child component.
|
|
5
|
-
*
|
|
6
|
-
* Read `searchQuery` to filter items and conditionally render empty states.
|
|
7
|
-
*/
|
|
8
|
-
declare function useSwitcher(): {
|
|
9
|
-
searchQuery: string;
|
|
10
|
-
open: boolean;
|
|
11
|
-
setOpen: (open: boolean) => void;
|
|
12
|
-
selectedValue: string | null | undefined;
|
|
13
|
-
};
|
|
14
|
-
type SwitcherRootProps = {
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
/** Currently selected item value. */
|
|
17
|
-
value?: string | null;
|
|
18
|
-
/** Called when the user selects an item. Receives the item's `value` string. */
|
|
19
|
-
onValueChange: (value: string) => void;
|
|
20
|
-
/** Controlled open state. When omitted the component manages its own state. */
|
|
21
|
-
open?: boolean;
|
|
22
|
-
/** Called when open state changes. Works with both controlled and uncontrolled modes. */
|
|
23
|
-
onOpenChange?: (open: boolean) => void;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Composable searchable dropdown for selecting an item from a list.
|
|
27
|
-
*
|
|
28
|
-
* Built as compound components — combine `SwitcherTrigger`, `SwitcherContent`,
|
|
29
|
-
* `SwitcherInput`, and `SwitcherItem` to build any picker UI.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* <Switcher value={activeOrg.id} onValueChange={handleSelect}>
|
|
34
|
-
* <SwitcherTrigger>
|
|
35
|
-
* <Button variant="outline">{activeOrg.name}</Button>
|
|
36
|
-
* </SwitcherTrigger>
|
|
37
|
-
* <SwitcherContent>
|
|
38
|
-
* <SwitcherInput placeholder="Search…" />
|
|
39
|
-
* <OrgItems orgs={orgs} />
|
|
40
|
-
* </SwitcherContent>
|
|
41
|
-
* </Switcher>
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
declare function Switcher({ children, value, onValueChange, open: controlledOpen, onOpenChange, }: SwitcherRootProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
type SwitcherTriggerProps = {
|
|
46
|
-
children: ReactNode;
|
|
47
|
-
className?: string;
|
|
48
|
-
};
|
|
49
|
-
declare function SwitcherTrigger({ children, className }: SwitcherTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
type SwitcherContentProps = {
|
|
51
|
-
children: ReactNode;
|
|
52
|
-
className?: string;
|
|
53
|
-
} & Omit<React.ComponentProps<typeof DropdownMenuContent>, "children" | "className">;
|
|
54
|
-
declare function SwitcherContent({ children, className, ...props }: SwitcherContentProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
type SwitcherInputProps = {
|
|
56
|
-
/** @default "Search…" */
|
|
57
|
-
placeholder?: string;
|
|
58
|
-
};
|
|
59
|
-
declare function SwitcherInput({ placeholder }: SwitcherInputProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
-
type SwitcherItemProps = {
|
|
61
|
-
/** Unique value — passed to root `onValueChange` when selected. */
|
|
62
|
-
value: string;
|
|
63
|
-
/**
|
|
64
|
-
* Text used for search filtering. When the search query doesn't match this
|
|
65
|
-
* text the item is hidden. Omit to make the item always visible.
|
|
66
|
-
*/
|
|
67
|
-
textValue?: string;
|
|
68
|
-
/**
|
|
69
|
-
* Called on select *instead of* the root `onValueChange`.
|
|
70
|
-
* Use for items that trigger side-effects (opening dialogs, navigation)
|
|
71
|
-
* rather than changing the selected value.
|
|
72
|
-
*/
|
|
73
|
-
onSelect?: () => void;
|
|
74
|
-
/** Render children directly, or use a render function to access `isSelected`. */
|
|
75
|
-
children: ReactNode | ((props: {
|
|
76
|
-
isSelected: boolean;
|
|
77
|
-
}) => ReactNode);
|
|
78
|
-
className?: string;
|
|
79
|
-
};
|
|
80
|
-
declare function SwitcherItem({ value, textValue, onSelect: itemOnSelect, children, className, }: SwitcherItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
81
|
-
export type { SwitcherContentProps, SwitcherInputProps, SwitcherItemProps, SwitcherRootProps as SwitcherProps, SwitcherTriggerProps, };
|
|
82
|
-
export { Switcher, SwitcherContent, SwitcherInput, SwitcherItem, SwitcherTrigger, useSwitcher, };
|
|
83
|
-
//# sourceMappingURL=switcher.d.ts.map
|
|
@@ -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":"AASA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA6CpC,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EAC1B,MAAM,6CAA6C,CAAC;AAOrD,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,2CAA2C,CAAC;AAsBnD,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,mBAAmB,EACnB,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC1C,GAAG;IACF,EAAE,EAAE,MAAM,CAAC;IACX,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,uDAAuD;IACvD,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE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