@itechchoice/prime-chatkit 0.1.0-alpha.0 → 0.1.0-alpha.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/index.js +9939 -8783
- package/dist/types/components/agent-thread.d.ts +746 -0
- package/dist/types/components/app-shell.d.ts +478 -0
- package/dist/types/components/ui/chat-composer-clean.d.ts +4 -1
- package/dist/types/components/ui/command-menu-clean.d.ts +3 -1
- package/dist/types/components/ui/filter-menu-clean.d.ts +28 -0
- package/dist/types/components/ui/message-actions-clean.d.ts +85 -0
- package/dist/types/components/ui/setup-guide-clean.d.ts +22 -0
- package/dist/types/components/ui/text-field-clean.d.ts +28 -0
- package/dist/types/components/ui/thinking-loader-clean.d.ts +19 -0
- package/dist/types/ui/blocks/BlocksPanel.d.ts +4 -1
- package/dist/types/ui/blocks/LiveStatus.d.ts +9 -0
- package/dist/types/ui/i18n.d.ts +18 -78
- package/package.json +1 -1
- package/dist/types/ui/blocks/Process.d.ts +0 -7
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from "react";
|
|
2
|
+
import { type IconSvgElement } from "@hugeicons/react";
|
|
3
|
+
import { type FilterGroup, type FilterValue } from "@/components/ui/filter-menu-clean";
|
|
4
|
+
import { type SetupGroup } from "@/components/ui/setup-guide-clean";
|
|
5
|
+
/** Hugeicons, stroke + rounded with a slightly heavier stroke */
|
|
6
|
+
export declare const Icon: ({ icon, size, stroke, color }: {
|
|
7
|
+
icon: IconSvgElement;
|
|
8
|
+
size?: number;
|
|
9
|
+
stroke?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
12
|
+
/** Small flags as drawings – the same on every system, also where flag emoji don't show */
|
|
13
|
+
/** Small flags for the language menus – drawn, since flag emoji look different on every system */
|
|
14
|
+
export declare const Flag: ({ code }: {
|
|
15
|
+
code: "gb" | "de" | "fr" | "es";
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
export type ShellNavItem = {
|
|
18
|
+
label: string;
|
|
19
|
+
icon: IconSvgElement; /** Small number at the end, e.g. unread items */
|
|
20
|
+
count?: number;
|
|
21
|
+
};
|
|
22
|
+
/** A labelled list under the menu – replaces Projects when given */
|
|
23
|
+
export type ShellGroup = {
|
|
24
|
+
label: string;
|
|
25
|
+
items: ShellNavItem[]; /** Text shown while the list is empty */
|
|
26
|
+
empty?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const defaultNav: ShellNavItem[];
|
|
29
|
+
export declare const defaultProjects: string[];
|
|
30
|
+
/** Onboarding behind "Getting started" – shown in the library's Setup Guide */
|
|
31
|
+
export declare const defaultSetup: SetupGroup[];
|
|
32
|
+
/** A chat in the sidebar – `folder` puts it inside one of the projects, which then open and close like folders */
|
|
33
|
+
export type ShellChat = {
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
pinned?: boolean;
|
|
37
|
+
unread?: boolean;
|
|
38
|
+
folder?: string;
|
|
39
|
+
};
|
|
40
|
+
/** With both chrome regions disabled and a supplied header, all text belongs to the caller; no shell labels remain. */
|
|
41
|
+
export type ShellLabels = Record<string, never>;
|
|
42
|
+
export type AppShellProps = {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
/** Omit to keep both upstream chrome regions; false removes the region and its controls. */
|
|
45
|
+
chrome?: {
|
|
46
|
+
sidebar?: boolean;
|
|
47
|
+
workArea?: boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Labels for the shell without sidebar/work area; currently empty because header and children own their text. */
|
|
50
|
+
shellLabels?: Partial<ShellLabels>;
|
|
51
|
+
/** Label of the menu item or project that is open */
|
|
52
|
+
active?: string;
|
|
53
|
+
/** Called with the label of a menu item or project when it is clicked */
|
|
54
|
+
onNavigate?: (label: string) => void;
|
|
55
|
+
workspace?: string;
|
|
56
|
+
/** Line under the workspace's name in its menu */
|
|
57
|
+
workspaceMeta?: string;
|
|
58
|
+
/** The account at the bottom – its menu shows the email under the name (made up from the name when left out) */
|
|
59
|
+
user?: {
|
|
60
|
+
name: string;
|
|
61
|
+
avatar?: string;
|
|
62
|
+
email?: string;
|
|
63
|
+
};
|
|
64
|
+
nav?: ShellNavItem[];
|
|
65
|
+
projects?: string[];
|
|
66
|
+
/** Lists under the menu instead of Projects, e.g. Tools or Pipelines */
|
|
67
|
+
groups?: ShellGroup[];
|
|
68
|
+
/**
|
|
69
|
+
* Chats in the sidebar: the projects turn into folders that open and close and hold their chats; the other chats
|
|
70
|
+
* follow under Pinned and Chats. Pin, rename, mark as unread, move, copy or archive them from their ⋯ menu,
|
|
71
|
+
* and drag them into another order or into a folder
|
|
72
|
+
*/
|
|
73
|
+
chats?: ShellChat[];
|
|
74
|
+
/** Called when a chat is clicked (default: onNavigate with its title) */
|
|
75
|
+
onOpenChat?: (chat: ShellChat) => void;
|
|
76
|
+
/** Tasks behind "Getting started" */
|
|
77
|
+
setup?: SetupGroup[];
|
|
78
|
+
/** Sidebar width in px – drag its edge between min and max; double-click the edge for the default again */
|
|
79
|
+
sidebarWidth?: {
|
|
80
|
+
default?: number;
|
|
81
|
+
min?: number;
|
|
82
|
+
max?: number;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The work area on the right of the main area, with tabs like Codex: the screen's own tabs, artifacts in the shared
|
|
86
|
+
* viewers and New tabs with the start options – resizable and collapsible. Pass the options, or the result of
|
|
87
|
+
* useWorkArea when the page opens artifacts itself
|
|
88
|
+
*/
|
|
89
|
+
workArea?: WorkArea | WorkAreaOptions;
|
|
90
|
+
/** Plain content for the work area – shown as its one tab, named by panelTitle (use `workspace` for more) */
|
|
91
|
+
panel?: ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* A header across the whole app, like Claude's: the workspace and the sidebar toggle over the sidebar, the page's title and
|
|
94
|
+
* actions over the page, and the work area's title over the work area – one bar, one line under it
|
|
95
|
+
*/
|
|
96
|
+
header?: {
|
|
97
|
+
title: ReactNode;
|
|
98
|
+
actions?: ReactNode;
|
|
99
|
+
} | false;
|
|
100
|
+
/** The cards at the bottom of the sidebar – what's new and Getting started (default: shown) */
|
|
101
|
+
sideCards?: boolean;
|
|
102
|
+
/** Heading of the right work area */
|
|
103
|
+
panelTitle?: string;
|
|
104
|
+
/** What the tab of a plain `panel` shows instead of panelTitle, e.g. "Brief / Summer launch" */
|
|
105
|
+
panelHeading?: ReactNode;
|
|
106
|
+
/**
|
|
107
|
+
* Turns the sidebar into a settings sidebar: a back link with this title ("‹ Settings") in place of the workspace,
|
|
108
|
+
* and no news or setup cards at the bottom. Clicking it calls onNavigate with `label` (default "Back to app").
|
|
109
|
+
*/
|
|
110
|
+
back?: {
|
|
111
|
+
title: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
};
|
|
114
|
+
/** Start with the work area folded away – its icon waits in the top right corner (default: open) */
|
|
115
|
+
defaultPanelOpen?: boolean;
|
|
116
|
+
/** Width of the right work area in px, like sidebarWidth – on screens wider than 1440px the default and max grow in proportion */
|
|
117
|
+
panelWidth?: {
|
|
118
|
+
default?: number;
|
|
119
|
+
min?: number;
|
|
120
|
+
max?: number;
|
|
121
|
+
};
|
|
122
|
+
/** "inset": the page as a rounded panel on the gray page; "flat": edge to edge, split by a hairline. Without it,
|
|
123
|
+
* data-shell="flat" on an ancestor makes it flat */
|
|
124
|
+
layout?: "inset" | "flat";
|
|
125
|
+
/**
|
|
126
|
+
* A double sidebar, like Codex and ChatGPT: a column of icons on the gray page that always stays (the workspace on
|
|
127
|
+
* top, these items, the account at the bottom), and the chats inside the main area – in a light gray column of their
|
|
128
|
+
* own, split from the page by a line; it stays open and can be dragged wider or narrower. With it, the column's head
|
|
129
|
+
* is a project switcher – "All projects" or one of `projects`, which narrows the chats to that project
|
|
130
|
+
*/
|
|
131
|
+
rail?: {
|
|
132
|
+
items: ShellNavItem[]; /** Items at the bottom, above the account */
|
|
133
|
+
bottom?: ShellNavItem[]; /** The rail item that is open */
|
|
134
|
+
active?: string;
|
|
135
|
+
};
|
|
136
|
+
className?: string;
|
|
137
|
+
};
|
|
138
|
+
export declare function AppShell({ children, active, onNavigate, workspace: workspaceName, workspaceMeta, user, nav, projects, groups, chats, onOpenChat, setup, sidebarWidth, workArea, panel, panelTitle, panelHeading, back, defaultPanelOpen, panelWidth, header, sideCards, className, layout, rail: railOptions, chrome, }: AppShellProps): import("react").JSX.Element;
|
|
139
|
+
/**
|
|
140
|
+
* Tabs and radio groups are one stop for Tab: the arrow keys (and Home, End) move between their options and pick
|
|
141
|
+
* the one they land on – focus follows, inside the group's own buttons
|
|
142
|
+
*/
|
|
143
|
+
export declare function rove<T extends string>(e: ReactKeyboardEvent<HTMLElement>, items: readonly T[], current: T, pick: (item: T) => void): void;
|
|
144
|
+
/** Segmented tabs: a soft gray pill slides to the active tab */
|
|
145
|
+
export declare function Tabs({ items, value, defaultValue, onChange, controls, }: {
|
|
146
|
+
items: string[];
|
|
147
|
+
value?: string;
|
|
148
|
+
defaultValue?: string;
|
|
149
|
+
onChange?: (value: string) => void;
|
|
150
|
+
/** The id of the panel a tab shows, for aria-controls – leave out when there is none */
|
|
151
|
+
controls?: (item: string) => string | undefined;
|
|
152
|
+
}): import("react").JSX.Element;
|
|
153
|
+
/** The page's title in the header, with a chevron – a button, so it can open a menu (rename, move, delete…) */
|
|
154
|
+
export declare function BarTitle({ children, onClick }: {
|
|
155
|
+
children: ReactNode;
|
|
156
|
+
onClick?: () => void;
|
|
157
|
+
}): import("react").JSX.Element;
|
|
158
|
+
export declare function IconButton({ icon, label, onClick, pressed }: {
|
|
159
|
+
icon: IconSvgElement;
|
|
160
|
+
label: string;
|
|
161
|
+
onClick?: () => void;
|
|
162
|
+
pressed?: boolean;
|
|
163
|
+
}): import("react").JSX.Element;
|
|
164
|
+
export type SortDir = "asc" | "desc";
|
|
165
|
+
/** Flips between A–Z and Z–A; the icon turns with it */
|
|
166
|
+
export declare function SortButton({ value, onChange }: {
|
|
167
|
+
value?: SortDir;
|
|
168
|
+
onChange?: (dir: SortDir) => void;
|
|
169
|
+
}): import("react").JSX.Element;
|
|
170
|
+
export type ViewMode = "grid" | "list";
|
|
171
|
+
export declare function ViewToggle({ value, onChange }: {
|
|
172
|
+
value?: ViewMode;
|
|
173
|
+
onChange?: (view: ViewMode) => void;
|
|
174
|
+
}): import("react").JSX.Element;
|
|
175
|
+
export declare function SearchField({ placeholder, width, value, onChange, }: {
|
|
176
|
+
placeholder: string;
|
|
177
|
+
width?: number;
|
|
178
|
+
value?: string;
|
|
179
|
+
onChange?: (value: string) => void;
|
|
180
|
+
}): import("react").JSX.Element;
|
|
181
|
+
/**
|
|
182
|
+
* Small floating panel attached to its trigger. Opens on the preferred side and flips to the other side
|
|
183
|
+
* (or edge) when it would stick out of the screen or its scroll area – it is always fully reachable.
|
|
184
|
+
* Closes on a click outside or Escape; fades and scales in from the side it is attached to.
|
|
185
|
+
*/
|
|
186
|
+
export declare function Popover({ open, onClose, children, align, side, className, }: {
|
|
187
|
+
open: boolean;
|
|
188
|
+
onClose: () => void;
|
|
189
|
+
children: ReactNode;
|
|
190
|
+
align?: "start" | "end";
|
|
191
|
+
side?: "bottom" | "top" | "right";
|
|
192
|
+
className?: string;
|
|
193
|
+
}): import("react").JSX.Element | null;
|
|
194
|
+
export type MenuItem = {
|
|
195
|
+
label: string;
|
|
196
|
+
/** Second line in a lighter color */
|
|
197
|
+
description?: string;
|
|
198
|
+
icon?: IconSvgElement;
|
|
199
|
+
/** A brand mark (Gmail, Slack …) in place of the icon, at 16px */
|
|
200
|
+
logo?: ReactNode;
|
|
201
|
+
/** Shows a check – for choices like a model or a period */
|
|
202
|
+
checked?: boolean;
|
|
203
|
+
/** Red text, e.g. Delete */
|
|
204
|
+
danger?: boolean;
|
|
205
|
+
/** A keyboard shortcut on the right, e.g. "⌥⌘R" */
|
|
206
|
+
shortcut?: string;
|
|
207
|
+
/** A line above this item, to group the ones after it */
|
|
208
|
+
divider?: boolean;
|
|
209
|
+
/** More choices that open to the side on hover or focus */
|
|
210
|
+
submenu?: MenuItem[];
|
|
211
|
+
onSelect?: () => void;
|
|
212
|
+
};
|
|
213
|
+
/** List of actions or choices inside a popover */
|
|
214
|
+
export declare function MenuList({ items, onPick }: {
|
|
215
|
+
items: MenuItem[];
|
|
216
|
+
onPick: () => void;
|
|
217
|
+
}): import("react").JSX.Element;
|
|
218
|
+
/** Any trigger with a menu: the trigger gets the open state and a toggle */
|
|
219
|
+
export declare function Dropdown({ trigger, items, align, side, title, header, className, }: {
|
|
220
|
+
trigger: (props: {
|
|
221
|
+
open: boolean;
|
|
222
|
+
toggle: () => void;
|
|
223
|
+
}) => ReactNode;
|
|
224
|
+
items: MenuItem[];
|
|
225
|
+
align?: "start" | "end";
|
|
226
|
+
side?: "bottom" | "top";
|
|
227
|
+
/** Small heading above the items */
|
|
228
|
+
title?: string;
|
|
229
|
+
/** Anything above the items, e.g. who is signed in */
|
|
230
|
+
header?: ReactNode;
|
|
231
|
+
className?: string;
|
|
232
|
+
}): import("react").JSX.Element;
|
|
233
|
+
/** Opens the library's Filter Menu in a popover; the button shows how many filters are on */
|
|
234
|
+
export declare function FilterButton({ label, groups, value, onChange, align, }: {
|
|
235
|
+
label: string;
|
|
236
|
+
groups: FilterGroup[];
|
|
237
|
+
value: FilterValue;
|
|
238
|
+
onChange: (value: FilterValue) => void;
|
|
239
|
+
align?: "start" | "end";
|
|
240
|
+
}): import("react").JSX.Element;
|
|
241
|
+
/** Plain menu of choices in a popover, e.g. a period picker */
|
|
242
|
+
export declare function MenuButton<T extends string>({ value, options, onChange, icon, align, className, }: {
|
|
243
|
+
value: T;
|
|
244
|
+
options: {
|
|
245
|
+
value: T;
|
|
246
|
+
label: string;
|
|
247
|
+
}[];
|
|
248
|
+
onChange: (value: T) => void;
|
|
249
|
+
icon?: IconSvgElement;
|
|
250
|
+
align?: "start" | "end";
|
|
251
|
+
className?: string;
|
|
252
|
+
}): import("react").JSX.Element;
|
|
253
|
+
/** Short confirmation at the bottom of the main area – "Saved to Reports" */
|
|
254
|
+
export declare function useToast(): readonly [import("react").JSX.Element | null, (text: string) => void];
|
|
255
|
+
/** A section's head: a small uppercase title (with an optional count), then its tabs and tools */
|
|
256
|
+
export declare function SectionHead({ title, count, left, right }: {
|
|
257
|
+
title: string;
|
|
258
|
+
count?: number;
|
|
259
|
+
left?: ReactNode;
|
|
260
|
+
right?: ReactNode;
|
|
261
|
+
}): import("react").JSX.Element;
|
|
262
|
+
/** `bare`: without the dashed frame – the page's only content, e.g. inside .ui-as-center */
|
|
263
|
+
export declare function EmptyState({ title, text, action, tall, bare }: {
|
|
264
|
+
title: string;
|
|
265
|
+
text: string;
|
|
266
|
+
action?: ReactNode;
|
|
267
|
+
tall?: boolean;
|
|
268
|
+
bare?: boolean;
|
|
269
|
+
}): import("react").JSX.Element;
|
|
270
|
+
export type FileType = "DOC" | "PDF" | "XLS";
|
|
271
|
+
export type FileItem = {
|
|
272
|
+
name: string;
|
|
273
|
+
type: FileType;
|
|
274
|
+
edited?: string;
|
|
275
|
+
};
|
|
276
|
+
export declare const fileKind: Record<FileType, string>;
|
|
277
|
+
/** A file as a card: preview on a gray stage, name and one line of details below */
|
|
278
|
+
export declare function FileCard({ file, meta, onOpen }: {
|
|
279
|
+
file: FileItem;
|
|
280
|
+
meta: ReactNode; /** Called when the card is clicked or pressed */
|
|
281
|
+
onOpen?: (file: FileItem) => void;
|
|
282
|
+
}): import("react").JSX.Element;
|
|
283
|
+
/**
|
|
284
|
+
* A tab in the work area. Either the screen's own content – a task, a brief, a run's details – or an artifact by its
|
|
285
|
+
* file name, shown in the shared viewers (document, sheet, folder, code, image) with its content from `artifacts`
|
|
286
|
+
*/
|
|
287
|
+
export type WorkAreaTab = {
|
|
288
|
+
id: string;
|
|
289
|
+
/** Its name – the tab shows it, × and screen readers say it */
|
|
290
|
+
title: string;
|
|
291
|
+
/** What the tab shows instead of the plain title (the title still names it) */
|
|
292
|
+
label?: ReactNode;
|
|
293
|
+
icon?: IconSvgElement;
|
|
294
|
+
/** A small number after the name, e.g. what waits on you */
|
|
295
|
+
count?: number;
|
|
296
|
+
content: ReactNode;
|
|
297
|
+
artifact?: undefined;
|
|
298
|
+
} | {
|
|
299
|
+
/** Defaults to the file name */
|
|
300
|
+
id?: string;
|
|
301
|
+
/** The file name – its content comes from `artifacts` */
|
|
302
|
+
artifact: string;
|
|
303
|
+
/** Where it's from, the line under its name – e.g. the task or the run */
|
|
304
|
+
from?: string;
|
|
305
|
+
};
|
|
306
|
+
export type WorkAreaOptions = {
|
|
307
|
+
/** The screen's own tabs and the artifacts it starts with – in this order */
|
|
308
|
+
tabs?: WorkAreaTab[];
|
|
309
|
+
/**
|
|
310
|
+
* The ids of the tabs that are open when the screen starts – and again when the work area opens after its last tab
|
|
311
|
+
* was closed. "new" adds a New tab. Default: every tab in `tabs`, or one New tab when there are none
|
|
312
|
+
*/
|
|
313
|
+
defaultTabs?: string[];
|
|
314
|
+
/** The tabs open when the screen starts, if they differ from defaultTabs – e.g. the task and two artifacts, while only the task comes back */
|
|
315
|
+
initialTabs?: string[];
|
|
316
|
+
/** What each artifact shows when it's opened, by file name */
|
|
317
|
+
artifacts?: Record<string, ShellArtifact>;
|
|
318
|
+
/** Called when an artifact is opened – it opens in its own tab, or its tab comes to the front */
|
|
319
|
+
onOpenArtifact?: (name: string, from?: string) => void;
|
|
320
|
+
/**
|
|
321
|
+
* Called when you change an artifact in its tab – a cell of a sheet, its widths or styles, the text of a document,
|
|
322
|
+
* a folder's files – with the whole artifact as it is now. The workspace keeps the change itself while the screen
|
|
323
|
+
* lives; save it here
|
|
324
|
+
*/
|
|
325
|
+
onArtifactChange?: (name: string, artifact: ShellArtifact) => void;
|
|
326
|
+
/**
|
|
327
|
+
* What a New tab (the + at the end of the tabs) shows: the start options – an address field, Tools and Suggested.
|
|
328
|
+
* A suggestion with an `artifact` opens it in that tab. false: no + and no New tabs
|
|
329
|
+
*/
|
|
330
|
+
newTab?: Pick<WorkspacePanelProps, "tools" | "sources" | "onOpen"> | false;
|
|
331
|
+
};
|
|
332
|
+
/** One open tab */
|
|
333
|
+
type OpenTab = {
|
|
334
|
+
key: string;
|
|
335
|
+
page?: string;
|
|
336
|
+
artifact?: string;
|
|
337
|
+
from?: string;
|
|
338
|
+
};
|
|
339
|
+
type PageTab = Extract<WorkAreaTab, {
|
|
340
|
+
content: ReactNode;
|
|
341
|
+
}>;
|
|
342
|
+
type WorkAreaState = {
|
|
343
|
+
uid: string;
|
|
344
|
+
tabs: OpenTab[];
|
|
345
|
+
active: string | null;
|
|
346
|
+
/** Counts up whenever something asks to be seen – the shell opens the work area for it */
|
|
347
|
+
reveal: number;
|
|
348
|
+
page: (id: string) => PageTab | undefined;
|
|
349
|
+
newTab: WorkAreaOptions["newTab"];
|
|
350
|
+
select: (key: string) => void;
|
|
351
|
+
close: (key: string) => void;
|
|
352
|
+
/** The tabs the screen starts with, again */
|
|
353
|
+
reset: () => void;
|
|
354
|
+
openNew: () => string;
|
|
355
|
+
/** A New tab turns into an artifact – or hands over to the artifact's tab when it's open already */
|
|
356
|
+
openIn: (key: string, name: string, from?: string) => void;
|
|
357
|
+
edited: (name: string) => boolean;
|
|
358
|
+
memo: (name: string) => unknown;
|
|
359
|
+
setMemo: (name: string, memo: unknown) => void;
|
|
360
|
+
change: (name: string, next: ShellArtifact) => void;
|
|
361
|
+
seed: (name: string, artifact: ShellArtifact) => void;
|
|
362
|
+
};
|
|
363
|
+
/** The work area's tabs, from useWorkArea – pass it to AppShell as `workspace` */
|
|
364
|
+
export type WorkArea = {
|
|
365
|
+
/** Opens an artifact in its own tab (or brings its tab to the front) and opens the work area if it's folded away */
|
|
366
|
+
open: (name: string, from?: string) => void;
|
|
367
|
+
/** Brings one of the screen's own tabs back and to the front */
|
|
368
|
+
show: (id: string) => void;
|
|
369
|
+
/** Opens a New tab */
|
|
370
|
+
openNew: () => void;
|
|
371
|
+
/** An artifact as it is now – with your changes */
|
|
372
|
+
artifact: (name: string) => ShellArtifact | undefined;
|
|
373
|
+
/** For the App Shell */
|
|
374
|
+
readonly state: WorkAreaState;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* The work area's tabs and everything in them: which tabs are open, which one is in front, and what you changed in
|
|
378
|
+
* each artifact – kept by file name while the screen lives, so it outlives its tab. Call it in your screen and pass
|
|
379
|
+
* it to AppShell as `workspace`; open artifacts from anywhere in the page with `open(name)`
|
|
380
|
+
*/
|
|
381
|
+
export declare function useWorkArea(options?: WorkAreaOptions): WorkArea;
|
|
382
|
+
/** The work area's tabs from inside the page – e.g. to open an artifact from a chip deep in a message: useShellWorkArea()?.open(name) */
|
|
383
|
+
export declare const useShellWorkArea: () => WorkArea | null;
|
|
384
|
+
/** Artifacts as soft gray file chips – a small two-gray glyph by type; each opens its artifact in the work area */
|
|
385
|
+
export declare function ArtifactChips({ names, onOpen }: {
|
|
386
|
+
names: string[];
|
|
387
|
+
onOpen: (name: string) => void;
|
|
388
|
+
}): import("react").JSX.Element;
|
|
389
|
+
/** One gray block of an image drawn as a wireframe, on a 120 × 80 grid */
|
|
390
|
+
export type ShellBlock = {
|
|
391
|
+
x: number;
|
|
392
|
+
y: number;
|
|
393
|
+
w: number;
|
|
394
|
+
h: number; /** Corner radius (default 2) */
|
|
395
|
+
r?: number;
|
|
396
|
+
tone?: "ink" | "mid" | "soft";
|
|
397
|
+
};
|
|
398
|
+
/** One entry of a folder: just its name, or with what Finder shows about it */
|
|
399
|
+
export type ShellFolderEntry = string | {
|
|
400
|
+
name: string;
|
|
401
|
+
/** In bytes – or in words, e.g. "12 KB" */
|
|
402
|
+
size?: number | string;
|
|
403
|
+
/** When it last changed – an ISO date or a timestamp in ms */
|
|
404
|
+
modified?: string | number;
|
|
405
|
+
/** e.g. "YAML" – made up from the extension when left out; "Folder" makes it a folder */
|
|
406
|
+
kind?: string;
|
|
407
|
+
/** A subfolder's own entries – or give the subfolder an artifact of its own, by its name */
|
|
408
|
+
files?: ShellFolderEntry[];
|
|
409
|
+
};
|
|
410
|
+
/** How a sheet's cell shows a number */
|
|
411
|
+
export type ShellNumberFormat = "general" | "number" | "percent" | "currency";
|
|
412
|
+
export type ShellCellStyle = {
|
|
413
|
+
bold?: boolean;
|
|
414
|
+
format?: ShellNumberFormat;
|
|
415
|
+
};
|
|
416
|
+
/** What an opened artifact shows in its own tab of the Task panel – one of these, by the file's kind */
|
|
417
|
+
export type ShellArtifact = {
|
|
418
|
+
/** e.g. "Updated 2h ago" */
|
|
419
|
+
updated?: string;
|
|
420
|
+
/**
|
|
421
|
+
* A document: a title, a few paragraphs and points – points that start with "[ ] " or "[x] " make a checklist.
|
|
422
|
+
* It opens as a page you write in; what you wrote comes back as `html`, which then replaces the rest
|
|
423
|
+
*/
|
|
424
|
+
doc?: {
|
|
425
|
+
title: string;
|
|
426
|
+
paragraphs?: string[];
|
|
427
|
+
bullets?: string[];
|
|
428
|
+
html?: string;
|
|
429
|
+
};
|
|
430
|
+
/** A sheet: the first row is the header; a cell that starts with = is a formula */
|
|
431
|
+
table?: string[][];
|
|
432
|
+
/** The sheet's column widths in px and its cell styles by "row:column" (from 0) – set as you work in it */
|
|
433
|
+
sheet?: {
|
|
434
|
+
widths?: number[];
|
|
435
|
+
styles?: Record<string, ShellCellStyle>;
|
|
436
|
+
};
|
|
437
|
+
/** Code or data, shown as is */
|
|
438
|
+
code?: string;
|
|
439
|
+
/** An image, as gray blocks on a 120 × 80 grid – or pass `preview` */
|
|
440
|
+
image?: ShellBlock[];
|
|
441
|
+
/** A folder: what's in it – a name without an extension is a subfolder */
|
|
442
|
+
files?: ShellFolderEntry[];
|
|
443
|
+
/** Your own preview – replaces all of the above */
|
|
444
|
+
preview?: ReactNode;
|
|
445
|
+
};
|
|
446
|
+
export declare const fileGlyph: (name: string) => import("react").JSX.Element;
|
|
447
|
+
export declare function Wireframe({ blocks }: {
|
|
448
|
+
blocks: ShellBlock[];
|
|
449
|
+
}): import("react").JSX.Element;
|
|
450
|
+
export type WorkspaceTool = {
|
|
451
|
+
id: string;
|
|
452
|
+
label: string;
|
|
453
|
+
icon: Parameters<typeof Icon>[0]["icon"];
|
|
454
|
+
shortcut?: string;
|
|
455
|
+
};
|
|
456
|
+
export type WorkspaceSource = {
|
|
457
|
+
id: string;
|
|
458
|
+
title: string;
|
|
459
|
+
source: string;
|
|
460
|
+
mark?: ReactNode;
|
|
461
|
+
/** In a New tab of the workspace: opens this artifact (by file name) in that tab */
|
|
462
|
+
artifact?: string;
|
|
463
|
+
};
|
|
464
|
+
export declare const defaultTools: WorkspaceTool[];
|
|
465
|
+
export declare const defaultSources: WorkspaceSource[];
|
|
466
|
+
/** Sample artifacts for the work area – what the suggestions in sampleSources open in a New tab */
|
|
467
|
+
export declare const sampleArtifacts: Record<string, ShellArtifact>;
|
|
468
|
+
/** Suggestions for a New tab: the first opens a web page (onOpen), the others open sampleArtifacts in the tab */
|
|
469
|
+
export declare const sampleSources: WorkspaceSource[];
|
|
470
|
+
export type WorkspacePanelProps = {
|
|
471
|
+
tools?: WorkspaceTool[];
|
|
472
|
+
sources?: WorkspaceSource[];
|
|
473
|
+
/** A tool or a suggestion was opened */
|
|
474
|
+
onOpen?: (id: string) => void;
|
|
475
|
+
};
|
|
476
|
+
/** The pane's content: an address field, the tools, and suggested sources – each row opens its item */
|
|
477
|
+
export declare function WorkspacePanel({ tools, sources, onOpen }: WorkspacePanelProps): import("react").JSX.Element;
|
|
478
|
+
export {};
|
|
@@ -50,6 +50,7 @@ export declare const defaultChatComposerLabels: {
|
|
|
50
50
|
message: string;
|
|
51
51
|
voiceInput: string;
|
|
52
52
|
sendMessage: string;
|
|
53
|
+
stop: string;
|
|
53
54
|
discardRecording: string;
|
|
54
55
|
useRecording: string;
|
|
55
56
|
connectApps: string;
|
|
@@ -66,6 +67,8 @@ export declare const defaultChatComposerLabels: {
|
|
|
66
67
|
};
|
|
67
68
|
export type ChatComposerLabels = typeof defaultChatComposerLabels;
|
|
68
69
|
export type ChatComposerProps = {
|
|
70
|
+
running?: boolean;
|
|
71
|
+
onStop?: () => void;
|
|
69
72
|
sendDisabled?: boolean;
|
|
70
73
|
labels?: Partial<ChatComposerLabels>;
|
|
71
74
|
placeholder?: string;
|
|
@@ -112,4 +115,4 @@ export type ChatComposerProps = {
|
|
|
112
115
|
export declare const defaultFolders: string[];
|
|
113
116
|
export declare const defaultApps: ChatApp[];
|
|
114
117
|
export declare const defaultModels: ChatModel[];
|
|
115
|
-
export declare function ChatComposer({ sendDisabled, placeholder, disabled, labels: labelProp, models, dictation, onSend, onModelChange, onAttach, addItems, voice, approval: firstApproval, onApprovalChange, onLearnMore, folders, folder: firstFolder, onFolderChange, apps, connectedApps, onAppsChange, foot, tray, }: ChatComposerProps): import("react").JSX.Element;
|
|
118
|
+
export declare function ChatComposer({ running, onStop, sendDisabled, placeholder, disabled, labels: labelProp, models, dictation, onSend, onModelChange, onAttach, addItems, voice, approval: firstApproval, onApprovalChange, onLearnMore, folders, folder: firstFolder, onFolderChange, apps, connectedApps, onAppsChange, foot, tray, }: ChatComposerProps): import("react").JSX.Element;
|
|
@@ -51,7 +51,9 @@ export type CommandMenuProps = {
|
|
|
51
51
|
ask?: boolean;
|
|
52
52
|
hotkey?: boolean;
|
|
53
53
|
labels?: Partial<CommandMenuLabels>;
|
|
54
|
+
/** Fill the parent height and scroll results within the remaining space. */
|
|
55
|
+
fill?: boolean;
|
|
54
56
|
};
|
|
55
57
|
/** Sample commands – replace with your own */
|
|
56
58
|
export declare const defaultGroups: CommandGroup[];
|
|
57
|
-
export declare function CommandMenu({ groups, placeholder, onAction, onEditSubmit, onEditCancel, ask, hotkey, labels: labelOverrides, onRun, onClose, autoFocus, className, }: CommandMenuProps): import("react").JSX.Element;
|
|
59
|
+
export declare function CommandMenu({ groups, placeholder, onAction, onEditSubmit, onEditCancel, ask, hotkey, labels: labelOverrides, fill, onRun, onClose, autoFocus, className, }: CommandMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type FilterOption = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export type FilterGroup = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
options: FilterOption[];
|
|
9
|
+
/** Put in front of the option on its chip, e.g. "Score: " → "Score: 80–90" */
|
|
10
|
+
chipPrefix?: string;
|
|
11
|
+
};
|
|
12
|
+
/** Picked option ids per group id */
|
|
13
|
+
export type FilterValue = Record<string, string[]>;
|
|
14
|
+
export type FilterMenuProps = {
|
|
15
|
+
groups: FilterGroup[];
|
|
16
|
+
/** Controlled value */
|
|
17
|
+
value?: FilterValue;
|
|
18
|
+
/** Starting value when uncontrolled */
|
|
19
|
+
defaultValue?: FilterValue;
|
|
20
|
+
onChange?: (value: FilterValue) => void;
|
|
21
|
+
/** Groups that start open – by default the first one */
|
|
22
|
+
defaultOpen?: string[];
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Show the keyboard hints as the last row of the card */
|
|
25
|
+
hints?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function FilterMenu({ groups: rawGroups, value, defaultValue, onChange, defaultOpen, title, hints, className, }: FilterMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type MessageActionKey = "copy" | "regenerate" | "feedback" | "speak";
|
|
3
|
+
export type FeedbackKind = "up" | "down";
|
|
4
|
+
export declare const defaultMessageActionsLabels: {
|
|
5
|
+
label: string;
|
|
6
|
+
copy: string;
|
|
7
|
+
copied: string;
|
|
8
|
+
copyMessage: string;
|
|
9
|
+
regenerate: string;
|
|
10
|
+
regenerating: string;
|
|
11
|
+
writing: string;
|
|
12
|
+
regenerateResponse: string;
|
|
13
|
+
goodResponse: string;
|
|
14
|
+
badResponse: string;
|
|
15
|
+
thanks: string;
|
|
16
|
+
markedGood: string;
|
|
17
|
+
markedBad: string;
|
|
18
|
+
thanksFeedback: string;
|
|
19
|
+
finishedReading: string;
|
|
20
|
+
readingAloud: string;
|
|
21
|
+
stoppedReading: string;
|
|
22
|
+
stop: string;
|
|
23
|
+
stopReading: string;
|
|
24
|
+
readAloud: string;
|
|
25
|
+
versions: string;
|
|
26
|
+
previousVersion: string;
|
|
27
|
+
nextVersion: string;
|
|
28
|
+
version: (index: number, count: number) => string;
|
|
29
|
+
whatWentWrong: string;
|
|
30
|
+
closeFeedback: string;
|
|
31
|
+
send: string;
|
|
32
|
+
morePlaceholder: string;
|
|
33
|
+
moreLabel: string;
|
|
34
|
+
notAccurate: string;
|
|
35
|
+
tooLong: string;
|
|
36
|
+
didNotFollow: string;
|
|
37
|
+
other: string;
|
|
38
|
+
};
|
|
39
|
+
export type MessageActionsLabels = typeof defaultMessageActionsLabels;
|
|
40
|
+
export type MessageActionsProps = {
|
|
41
|
+
labels?: Partial<MessageActionsLabels>;
|
|
42
|
+
/** The message text – copied to the clipboard by Copy and used to time Read aloud */
|
|
43
|
+
text?: string;
|
|
44
|
+
/** Which actions to show, in this order */
|
|
45
|
+
actions?: MessageActionKey[];
|
|
46
|
+
/** All versions of the message, or just how many there are. From 2 on the version switcher shows */
|
|
47
|
+
versions?: number | string[];
|
|
48
|
+
/** Controlled version (0-based index) */
|
|
49
|
+
version?: number;
|
|
50
|
+
/** Starting version when uncontrolled – defaults to the newest */
|
|
51
|
+
defaultVersion?: number;
|
|
52
|
+
/** Called with the version index picked in the switcher */
|
|
53
|
+
onVersionChange?: (index: number) => void;
|
|
54
|
+
/** Called after Copy, with `text` */
|
|
55
|
+
onCopy?: (text?: string) => void;
|
|
56
|
+
/** Called when Regenerate is pressed – add a version and the switcher jumps to it */
|
|
57
|
+
onRegenerate?: () => void;
|
|
58
|
+
/** Keeps the regenerate arrow spinning while a new version is written */
|
|
59
|
+
regenerating?: boolean;
|
|
60
|
+
/** "up" or "down" when a thumb is pressed, null when it is taken back, and "down" with a reason when the feedback row is sent */
|
|
61
|
+
onFeedback?: (kind: FeedbackKind | null, reason?: string) => void;
|
|
62
|
+
/** Quick reasons in the feedback row. "Other" opens a small text field */
|
|
63
|
+
reasons?: string[];
|
|
64
|
+
/** Called with true when Read aloud starts and false when it stops */
|
|
65
|
+
onSpeak?: (playing: boolean) => void;
|
|
66
|
+
/** Controlled playing state, e.g. tied to your speech player */
|
|
67
|
+
speaking?: boolean;
|
|
68
|
+
/** How long an uncontrolled read aloud plays, in ms – defaults to an estimate from `text` */
|
|
69
|
+
speakDuration?: number;
|
|
70
|
+
/** Faded until the message is hovered (default true). Put data-ui-message on the message wrapper */
|
|
71
|
+
quiet?: boolean;
|
|
72
|
+
/** Accessible name of the bar */
|
|
73
|
+
label?: string;
|
|
74
|
+
className?: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The message itself, crossfading when `version` changes: the old text fades out underneath while the new one fades in,
|
|
78
|
+
* and the block eases to its new height.
|
|
79
|
+
*/
|
|
80
|
+
export declare function MessageText({ version, children, className }: {
|
|
81
|
+
version: string | number;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
className?: string;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
export declare function MessageActions({ text, actions: actionsProp, versions, version, defaultVersion, onVersionChange, onCopy, onRegenerate, regenerating, onFeedback, reasons: reasonsProp, onSpeak, speaking, speakDuration, quiet, label, labels: labelProp, className, }: MessageActionsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type SetupTask = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
done?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type SetupGroup = {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
tasks: SetupTask[];
|
|
10
|
+
};
|
|
11
|
+
export type SetupGuideProps = {
|
|
12
|
+
title?: string;
|
|
13
|
+
groups: SetupGroup[];
|
|
14
|
+
/** Shows an "Edit" link in the header */
|
|
15
|
+
onEdit?: () => void;
|
|
16
|
+
/** Shows a close button in the header */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** Called with the ids of all finished tasks */
|
|
19
|
+
onChange?: (done: string[]) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function SetupGuide({ title, groups, onEdit, onClose, onChange, className }: SetupGuideProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
export type TextFieldProps = Omit<ComponentPropsWithRef<"input">, "size" | "prefix"> & {
|
|
3
|
+
/** Shown above the field and tied to it */
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
/** A quiet line under the field – the error takes its place while there is one */
|
|
6
|
+
hint?: ReactNode;
|
|
7
|
+
/** Marks the field invalid and shows this under it, in place of the hint */
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
/** Text or an icon inside the field, before the value – e.g. "https://" or a search icon */
|
|
10
|
+
prefix?: ReactNode;
|
|
11
|
+
/** Text or an icon inside the field, after the value – e.g. ".acme.app" or "USD" */
|
|
12
|
+
suffix?: ReactNode;
|
|
13
|
+
/** sm 28 · md 32 · lg 36 high */
|
|
14
|
+
size?: "sm" | "md" | "lg";
|
|
15
|
+
/** "Optional" next to the label */
|
|
16
|
+
optional?: boolean;
|
|
17
|
+
/** A small × that empties the field while it has a value */
|
|
18
|
+
clearable?: boolean;
|
|
19
|
+
/** A copy button – for API keys, links and IDs, usually with readOnly */
|
|
20
|
+
copyable?: boolean;
|
|
21
|
+
/** Shows "12/40" under the field; needs maxLength */
|
|
22
|
+
counter?: boolean;
|
|
23
|
+
/** Called after the × emptied the field (onChange fires too) */
|
|
24
|
+
onClear?: () => void;
|
|
25
|
+
/** Extra class on the input itself; className goes on the wrapper */
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function TextField({ label, hint, error, prefix, suffix, size, optional, clearable, copyable, counter, onClear, onKeyDown, className, inputClassName, id, type, value, defaultValue, onChange, disabled, readOnly, maxLength, ref, "aria-describedby": describedBy, ...rest }: TextFieldProps): import("react").JSX.Element;
|