@timbal-ai/timbal-react 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -4
- package/dist/app.cjs +5311 -0
- package/dist/app.d.cts +29 -0
- package/dist/app.d.ts +29 -0
- package/dist/app.esm.js +81 -0
- package/dist/chart-artifact-C71dk4xI.d.ts +329 -0
- package/dist/chart-artifact-CPEpOmtV.d.cts +329 -0
- package/dist/chat-CWtQWDtJ.d.cts +650 -0
- package/dist/chat-CWtQWDtJ.d.ts +650 -0
- package/dist/chat.cjs +4162 -0
- package/dist/chat.d.cts +13 -0
- package/dist/chat.d.ts +13 -0
- package/dist/chat.esm.js +51 -0
- package/dist/chunk-4TCJQSIX.esm.js +565 -0
- package/dist/chunk-IYENDIRY.esm.js +119 -0
- package/dist/chunk-KC5QLVUG.esm.js +22 -0
- package/dist/chunk-M4V6Q6XO.esm.js +1082 -0
- package/dist/chunk-OFHLFNJH.esm.js +138 -0
- package/dist/chunk-OVHR7J3J.esm.js +1574 -0
- package/dist/chunk-WLTW56MC.esm.js +66 -0
- package/dist/chunk-YJQLLFKP.esm.js +3672 -0
- package/dist/index.cjs +1823 -359
- package/dist/index.d.cts +15 -931
- package/dist/index.d.ts +15 -931
- package/dist/index.esm.js +187 -5578
- package/dist/layout-B9VayJhZ.d.cts +75 -0
- package/dist/layout-CQWngNQ7.d.ts +75 -0
- package/dist/studio.cjs +5734 -0
- package/dist/studio.d.cts +15 -0
- package/dist/studio.d.ts +15 -0
- package/dist/studio.esm.js +27 -0
- package/dist/styles.css +52 -2
- package/dist/timbal-v2-button-F4-z7m33.d.cts +40 -0
- package/dist/timbal-v2-button-F4-z7m33.d.ts +40 -0
- package/dist/ui.cjs +720 -0
- package/dist/ui.d.cts +74 -0
- package/dist/ui.d.ts +74 -0
- package/dist/ui.esm.js +44 -0
- package/dist/welcome--80i_O0p.d.cts +190 -0
- package/dist/welcome-BOizSp5h.d.ts +190 -0
- package/package.json +35 -3
- package/scripts/dev-linked.mjs +66 -0
- package/vite/local-dev.d.ts +4 -0
- package/vite/local-dev.mjs +71 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { FC, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { w as TimbalRuntimeProviderProps, q as ThreadProps, C as ChartArtifact } from './chat-CWtQWDtJ.cjs';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface AppShellProps {
|
|
6
|
+
/** Primary navigation (e.g. StudioSidebar or custom rail). */
|
|
7
|
+
sidebar?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Global top bar (login, theme, account) — spans the full shell width (not
|
|
10
|
+
* the page `max-w-6xl` column). Use `<AppShellTopbar start actions />`.
|
|
11
|
+
*/
|
|
12
|
+
topbar?: ReactNode;
|
|
13
|
+
/** @deprecated Use `topbar`. */
|
|
14
|
+
header?: ReactNode;
|
|
15
|
+
/** Main routed content. */
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Floating copilot panel (e.g. `<AppChatPanel />`). Overlays the dashboard;
|
|
19
|
+
* does not shrink the main column.
|
|
20
|
+
*/
|
|
21
|
+
chat?: ReactNode;
|
|
22
|
+
/** Floating panel width. Default: `24rem`. */
|
|
23
|
+
chatWidth?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Floating panel height. Omit to stretch between vertical shell insets
|
|
26
|
+
* (full page height with `top` / `bottom` margins).
|
|
27
|
+
*/
|
|
28
|
+
chatHeight?: string;
|
|
29
|
+
/** Controlled open state for the floating panel. */
|
|
30
|
+
chatOpen?: boolean;
|
|
31
|
+
/** Uncontrolled initial open state. Default: `false`. */
|
|
32
|
+
defaultChatOpen?: boolean;
|
|
33
|
+
onChatOpenChange?: (open: boolean) => void;
|
|
34
|
+
/** Show floating open/close control. Default: `true`. */
|
|
35
|
+
chatCollapsible?: boolean;
|
|
36
|
+
/** Label on the floating open trigger. Default: `Assistant`. */
|
|
37
|
+
chatTriggerLabel?: string;
|
|
38
|
+
/** Hide the built-in floating trigger (use your own + `useAppShellChat`). */
|
|
39
|
+
hideChatTrigger?: boolean;
|
|
40
|
+
className?: string;
|
|
41
|
+
mainClassName?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* App-first layout: sidebar + topbar + main, with optional **floating** copilot.
|
|
45
|
+
*/
|
|
46
|
+
declare const AppShell: FC<AppShellProps>;
|
|
47
|
+
|
|
48
|
+
interface AppShellTopbarProps {
|
|
49
|
+
/** Leading cluster — mobile menu, product mark, org switcher. */
|
|
50
|
+
start?: ReactNode;
|
|
51
|
+
/** Trailing cluster — theme toggle, login, account menu. */
|
|
52
|
+
actions?: ReactNode;
|
|
53
|
+
/** Optional center content between start and actions. */
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Global app chrome row inside `AppShell` — auth, theme, and account actions.
|
|
59
|
+
* Spans the full shell width via the shell’s `topbar` slot (wider than `<Page />`).
|
|
60
|
+
*/
|
|
61
|
+
declare const AppShellTopbar: FC<AppShellTopbarProps>;
|
|
62
|
+
|
|
63
|
+
interface AppShellChatTriggerProps {
|
|
64
|
+
className?: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
/**
|
|
67
|
+
* `floating` — primary pill fixed bottom-right (matches shell default).
|
|
68
|
+
* `inline` — for topbar/actions rows; text only, no icons.
|
|
69
|
+
*/
|
|
70
|
+
placement?: "floating" | "inline";
|
|
71
|
+
}
|
|
72
|
+
/** Opens the floating copilot. Text only — no icons. */
|
|
73
|
+
declare const AppShellChatTrigger: FC<AppShellChatTriggerProps>;
|
|
74
|
+
|
|
75
|
+
interface AppShellChatControls {
|
|
76
|
+
open: boolean;
|
|
77
|
+
setOpen: (open: boolean) => void;
|
|
78
|
+
toggle: () => void;
|
|
79
|
+
collapsible: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare function useAppShellChat(): AppShellChatControls | null;
|
|
82
|
+
|
|
83
|
+
interface PageHeaderProps {
|
|
84
|
+
title: ReactNode;
|
|
85
|
+
description?: ReactNode;
|
|
86
|
+
actions?: ReactNode;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
declare const PageHeader: FC<PageHeaderProps>;
|
|
90
|
+
|
|
91
|
+
interface PageProps extends PageHeaderProps {
|
|
92
|
+
children: ReactNode;
|
|
93
|
+
/** Slot above the title (breadcrumbs). */
|
|
94
|
+
breadcrumbs?: ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
}
|
|
97
|
+
declare const Page: FC<PageProps>;
|
|
98
|
+
|
|
99
|
+
interface SectionProps {
|
|
100
|
+
title?: ReactNode;
|
|
101
|
+
description?: ReactNode;
|
|
102
|
+
children: ReactNode;
|
|
103
|
+
className?: string;
|
|
104
|
+
}
|
|
105
|
+
declare const Section: FC<SectionProps>;
|
|
106
|
+
|
|
107
|
+
type AppCopilotContextValue = Record<string, unknown>;
|
|
108
|
+
interface AppCopilotProviderProps {
|
|
109
|
+
value: AppCopilotContextValue;
|
|
110
|
+
children: ReactNode;
|
|
111
|
+
}
|
|
112
|
+
/** Supplies page/dashboard context for `AppChatPanel` and agent tools. */
|
|
113
|
+
declare const AppCopilotProvider: FC<AppCopilotProviderProps>;
|
|
114
|
+
declare function useAppCopilotContext(): AppCopilotContextValue;
|
|
115
|
+
|
|
116
|
+
interface AppChatPanelProps extends Omit<TimbalRuntimeProviderProps, "children">, Omit<ThreadProps, "variant" | "maxWidth"> {
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Floating copilot body — `TimbalRuntimeProvider` + compact `Thread`.
|
|
121
|
+
* Render inside `AppShell` `chat`; open/close via shell trigger or `useAppShellChat`.
|
|
122
|
+
*/
|
|
123
|
+
declare const AppChatPanel: FC<AppChatPanelProps>;
|
|
124
|
+
|
|
125
|
+
interface SurfaceCardProps {
|
|
126
|
+
children: ReactNode;
|
|
127
|
+
className?: string;
|
|
128
|
+
}
|
|
129
|
+
declare const SurfaceCard: FC<SurfaceCardProps>;
|
|
130
|
+
|
|
131
|
+
interface StatTileProps {
|
|
132
|
+
label: ReactNode;
|
|
133
|
+
value: ReactNode;
|
|
134
|
+
hint?: ReactNode;
|
|
135
|
+
className?: string;
|
|
136
|
+
}
|
|
137
|
+
declare const StatTile: FC<StatTileProps>;
|
|
138
|
+
|
|
139
|
+
interface EmptyStateProps {
|
|
140
|
+
title: ReactNode;
|
|
141
|
+
description?: ReactNode;
|
|
142
|
+
action?: ReactNode;
|
|
143
|
+
className?: string;
|
|
144
|
+
}
|
|
145
|
+
declare const EmptyState: FC<EmptyStateProps>;
|
|
146
|
+
|
|
147
|
+
declare const statusBadgeToneClass: {
|
|
148
|
+
readonly default: "bg-muted text-foreground";
|
|
149
|
+
readonly primary: "bg-primary/10 text-primary";
|
|
150
|
+
readonly success: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400";
|
|
151
|
+
readonly warn: "bg-amber-500/10 text-amber-600 dark:text-amber-400";
|
|
152
|
+
readonly muted: "bg-muted/80 text-muted-foreground";
|
|
153
|
+
};
|
|
154
|
+
type StatusBadgeTone = keyof typeof statusBadgeToneClass;
|
|
155
|
+
interface StatusBadgeProps {
|
|
156
|
+
children: ReactNode;
|
|
157
|
+
tone?: StatusBadgeTone;
|
|
158
|
+
className?: string;
|
|
159
|
+
}
|
|
160
|
+
declare const StatusBadge: FC<StatusBadgeProps>;
|
|
161
|
+
|
|
162
|
+
interface AppConfirmDialogProps {
|
|
163
|
+
open: boolean;
|
|
164
|
+
onOpenChange: (open: boolean) => void;
|
|
165
|
+
title: ReactNode;
|
|
166
|
+
description?: ReactNode;
|
|
167
|
+
confirmLabel?: string;
|
|
168
|
+
cancelLabel?: string;
|
|
169
|
+
onConfirm: () => void;
|
|
170
|
+
destructive?: boolean;
|
|
171
|
+
className?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Confirm/cancel dialog for app flows (delete row, discard changes, etc.).
|
|
175
|
+
*/
|
|
176
|
+
declare const AppConfirmDialog: FC<AppConfirmDialogProps>;
|
|
177
|
+
|
|
178
|
+
interface SubNavItem {
|
|
179
|
+
id: string;
|
|
180
|
+
label: ReactNode;
|
|
181
|
+
}
|
|
182
|
+
interface SubNavProps {
|
|
183
|
+
items: SubNavItem[];
|
|
184
|
+
activeId: string;
|
|
185
|
+
onChange: (id: string) => void;
|
|
186
|
+
className?: string;
|
|
187
|
+
"aria-label"?: string;
|
|
188
|
+
/** Passed to the underlying pill control for shared-layout animation. */
|
|
189
|
+
layoutId?: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Section tabs using the same pill segmented control as timbal-platform
|
|
193
|
+
* (Build/Manage, dashboard section bars).
|
|
194
|
+
*/
|
|
195
|
+
declare const SubNav: FC<SubNavProps>;
|
|
196
|
+
|
|
197
|
+
interface BreadcrumbItem {
|
|
198
|
+
label: ReactNode;
|
|
199
|
+
href?: string;
|
|
200
|
+
onClick?: () => void;
|
|
201
|
+
}
|
|
202
|
+
interface BreadcrumbsProps {
|
|
203
|
+
items: BreadcrumbItem[];
|
|
204
|
+
className?: string;
|
|
205
|
+
}
|
|
206
|
+
declare const Breadcrumbs: FC<BreadcrumbsProps>;
|
|
207
|
+
|
|
208
|
+
interface FieldProps {
|
|
209
|
+
label: ReactNode;
|
|
210
|
+
hint?: ReactNode;
|
|
211
|
+
error?: ReactNode;
|
|
212
|
+
children?: ReactNode;
|
|
213
|
+
className?: string;
|
|
214
|
+
htmlFor?: string;
|
|
215
|
+
}
|
|
216
|
+
declare const Field: FC<FieldProps>;
|
|
217
|
+
interface FieldInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
218
|
+
label: ReactNode;
|
|
219
|
+
hint?: ReactNode;
|
|
220
|
+
error?: ReactNode;
|
|
221
|
+
fieldClassName?: string;
|
|
222
|
+
}
|
|
223
|
+
declare const FieldInput: FC<FieldInputProps>;
|
|
224
|
+
|
|
225
|
+
interface FieldTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
226
|
+
label: FieldProps["label"];
|
|
227
|
+
hint?: FieldProps["hint"];
|
|
228
|
+
error?: FieldProps["error"];
|
|
229
|
+
fieldClassName?: string;
|
|
230
|
+
}
|
|
231
|
+
declare const FieldTextarea: FC<FieldTextareaProps>;
|
|
232
|
+
|
|
233
|
+
interface FieldSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
234
|
+
label: FieldProps["label"];
|
|
235
|
+
hint?: FieldProps["hint"];
|
|
236
|
+
error?: FieldProps["error"];
|
|
237
|
+
fieldClassName?: string;
|
|
238
|
+
children: ReactNode;
|
|
239
|
+
}
|
|
240
|
+
declare const FieldSelect: FC<FieldSelectProps>;
|
|
241
|
+
|
|
242
|
+
interface FieldSwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
243
|
+
label: ReactNode;
|
|
244
|
+
description?: ReactNode;
|
|
245
|
+
className?: string;
|
|
246
|
+
}
|
|
247
|
+
declare const FieldSwitch: FC<FieldSwitchProps>;
|
|
248
|
+
|
|
249
|
+
interface SearchInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
250
|
+
className?: string;
|
|
251
|
+
}
|
|
252
|
+
declare const SearchInput: FC<SearchInputProps>;
|
|
253
|
+
|
|
254
|
+
interface FormSectionProps {
|
|
255
|
+
title?: ReactNode;
|
|
256
|
+
children: ReactNode;
|
|
257
|
+
className?: string;
|
|
258
|
+
}
|
|
259
|
+
declare const FormSection: FC<FormSectionProps>;
|
|
260
|
+
|
|
261
|
+
interface FilterBarProps {
|
|
262
|
+
children: ReactNode;
|
|
263
|
+
className?: string;
|
|
264
|
+
}
|
|
265
|
+
declare const FilterBar: FC<FilterBarProps>;
|
|
266
|
+
|
|
267
|
+
type DataTableSortDirection = "asc" | "desc";
|
|
268
|
+
interface DataTableSort {
|
|
269
|
+
columnId: string;
|
|
270
|
+
direction: DataTableSortDirection;
|
|
271
|
+
}
|
|
272
|
+
interface DataTableColumn<T> {
|
|
273
|
+
id: string;
|
|
274
|
+
header: ReactNode;
|
|
275
|
+
cell: (row: T) => ReactNode;
|
|
276
|
+
className?: string;
|
|
277
|
+
headerClassName?: string;
|
|
278
|
+
align?: "left" | "center" | "right";
|
|
279
|
+
sortable?: boolean;
|
|
280
|
+
/** Value used when sorting; defaults to stringifying `cell(row)`. */
|
|
281
|
+
sortValue?: (row: T) => string | number | boolean | Date | null | undefined;
|
|
282
|
+
}
|
|
283
|
+
interface DataTableProps<T> {
|
|
284
|
+
columns: DataTableColumn<T>[];
|
|
285
|
+
rows: T[];
|
|
286
|
+
getRowKey: (row: T) => string;
|
|
287
|
+
emptyTitle?: ReactNode;
|
|
288
|
+
emptyDescription?: ReactNode;
|
|
289
|
+
/** When `inline`, keeps the table chrome and shows an in-body empty message. */
|
|
290
|
+
emptyMode?: "replace" | "inline";
|
|
291
|
+
className?: string;
|
|
292
|
+
sort?: DataTableSort | null;
|
|
293
|
+
defaultSort?: DataTableSort | null;
|
|
294
|
+
onSortChange?: (sort: DataTableSort | null) => void;
|
|
295
|
+
showRowCount?: boolean;
|
|
296
|
+
rowCountLabel?: (count: number) => ReactNode;
|
|
297
|
+
footer?: ReactNode;
|
|
298
|
+
onRowClick?: (row: T) => void;
|
|
299
|
+
stickyHeader?: boolean;
|
|
300
|
+
dense?: boolean;
|
|
301
|
+
caption?: string;
|
|
302
|
+
}
|
|
303
|
+
declare function DataTable<T>({ columns, rows, getRowKey, emptyTitle, emptyDescription, emptyMode, className, sort: sortProp, defaultSort, onSortChange, showRowCount, rowCountLabel, footer, onRowClick, stickyHeader, dense, caption, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
interface ChartPanelProps {
|
|
306
|
+
title?: ReactNode;
|
|
307
|
+
/** Built-in SVG chart — alternative to custom `children`. */
|
|
308
|
+
artifact?: ChartArtifact;
|
|
309
|
+
children?: ReactNode;
|
|
310
|
+
actions?: ReactNode;
|
|
311
|
+
className?: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Chrome for charts — pass `artifact` for the built-in renderer or any chart in `children`.
|
|
315
|
+
*/
|
|
316
|
+
declare const ChartPanel: FC<ChartPanelProps>;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Lightweight SVG chart for the four basic chart types. We deliberately don't
|
|
320
|
+
* pull in `recharts` or similar — most artifact charts are small and these
|
|
321
|
+
* render fine at the cost of a few hundred lines of SVG. Apps that need
|
|
322
|
+
* production-grade charting can register a custom renderer that wraps their
|
|
323
|
+
* preferred lib.
|
|
324
|
+
*/
|
|
325
|
+
declare const ChartArtifactView: FC<{
|
|
326
|
+
artifact: ChartArtifact;
|
|
327
|
+
}>;
|
|
328
|
+
|
|
329
|
+
export { type StatusBadgeTone as $, AppChatPanel as A, type BreadcrumbItem as B, ChartArtifactView as C, DataTable as D, EmptyState as E, Field as F, type FieldSelectProps as G, FieldSwitch as H, type FieldSwitchProps as I, FieldTextarea as J, type FieldTextareaProps as K, FilterBar as L, type FilterBarProps as M, FormSection as N, type FormSectionProps as O, Page as P, PageHeader as Q, type PageHeaderProps as R, type PageProps as S, SearchInput as T, type SearchInputProps as U, Section as V, type SectionProps as W, StatTile as X, type StatTileProps as Y, StatusBadge as Z, type StatusBadgeProps as _, type AppChatPanelProps as a, SubNav as a0, type SubNavItem as a1, type SubNavProps as a2, SurfaceCard as a3, type SurfaceCardProps as a4, useAppCopilotContext as a5, useAppShellChat as a6, AppConfirmDialog as b, type AppConfirmDialogProps as c, type AppCopilotContextValue as d, AppCopilotProvider as e, type AppCopilotProviderProps as f, AppShell as g, type AppShellChatControls as h, AppShellChatTrigger as i, type AppShellChatTriggerProps as j, type AppShellProps as k, AppShellTopbar as l, type AppShellTopbarProps as m, Breadcrumbs as n, type BreadcrumbsProps as o, ChartPanel as p, type ChartPanelProps as q, type DataTableColumn as r, type DataTableProps as s, type DataTableSort as t, type DataTableSortDirection as u, type EmptyStateProps as v, FieldInput as w, type FieldInputProps as x, type FieldProps as y, FieldSelect as z };
|