@timbal-ai/timbal-react 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +55 -8
  3. package/dist/app.cjs +2369 -1189
  4. package/dist/app.d.cts +8 -4
  5. package/dist/app.d.ts +8 -4
  6. package/dist/app.esm.js +32 -7
  7. package/dist/{chart-artifact-DOkwSTjQ.d.cts → chart-artifact-E58ve76I.d.cts} +279 -12
  8. package/dist/{chart-artifact-CBo9x8Ch.d.ts → chart-artifact-_PEJgCpQ.d.ts} +279 -12
  9. package/dist/{chat-Bed4FQSl.d.cts → chat-ClmzWzCX.d.cts} +33 -4
  10. package/dist/{chat-Bed4FQSl.d.ts → chat-ClmzWzCX.d.ts} +33 -4
  11. package/dist/chat.cjs +1446 -776
  12. package/dist/chat.d.cts +1 -1
  13. package/dist/chat.d.ts +1 -1
  14. package/dist/chat.esm.js +3 -3
  15. package/dist/{chunk-YEFBANNF.esm.js → chunk-4VULP3CJ.esm.js} +242 -288
  16. package/dist/{chunk-RZ6QC6RG.esm.js → chunk-AGJKK6R7.esm.js} +2 -2
  17. package/dist/{chunk-FOD67Z6G.esm.js → chunk-BMXFXLVV.esm.js} +341 -12
  18. package/dist/chunk-FEYZUVBM.esm.js +52 -0
  19. package/dist/{chunk-C6IXFM4T.esm.js → chunk-MTYXREHK.esm.js} +4 -4
  20. package/dist/{chunk-AYHOVAMI.esm.js → chunk-NAMKO2MU.esm.js} +1 -1
  21. package/dist/{chunk-SNLXVG7H.esm.js → chunk-UY7AKWJL.esm.js} +1108 -656
  22. package/dist/{chunk-GLPOVYEA.esm.js → chunk-XDIY2WSL.esm.js} +669 -279
  23. package/dist/index.cjs +2967 -1824
  24. package/dist/index.d.cts +5 -5
  25. package/dist/index.d.ts +5 -5
  26. package/dist/index.esm.js +41 -11
  27. package/dist/pill-segmented-tabs-BsIOW1Lo.d.cts +528 -0
  28. package/dist/pill-segmented-tabs-BsIOW1Lo.d.ts +528 -0
  29. package/dist/studio.cjs +1685 -1015
  30. package/dist/studio.d.cts +2 -2
  31. package/dist/studio.d.ts +2 -2
  32. package/dist/studio.esm.js +5 -5
  33. package/dist/styles.css +24 -0
  34. package/dist/ui.cjs +387 -49
  35. package/dist/ui.d.cts +71 -491
  36. package/dist/ui.d.ts +71 -491
  37. package/dist/ui.esm.js +26 -6
  38. package/dist/{welcome-COOb05a5.d.cts → welcome-BFGRoNfK.d.cts} +1 -1
  39. package/dist/{welcome-DE08m9ca.d.ts → welcome-DXqsGTwH.d.ts} +1 -1
  40. package/package.json +7 -3
  41. package/vite/local-dev.d.ts +5 -1
  42. package/vite/local-dev.mjs +17 -13
package/dist/ui.esm.js CHANGED
@@ -34,7 +34,6 @@ import {
34
34
  CardFooter,
35
35
  CardHeader,
36
36
  CardTitle,
37
- Checkbox,
38
37
  Collapsible,
39
38
  CollapsibleContent,
40
39
  CollapsibleTrigger,
@@ -172,7 +171,6 @@ import {
172
171
  SheetHeader,
173
172
  SheetTitle,
174
173
  SheetTrigger,
175
- Skeleton,
176
174
  Slider,
177
175
  Spinner,
178
176
  Switch,
@@ -209,17 +207,28 @@ import {
209
207
  toast,
210
208
  toggleVariants,
211
209
  useToast
212
- } from "./chunk-YEFBANNF.esm.js";
210
+ } from "./chunk-4VULP3CJ.esm.js";
211
+ import {
212
+ Checkbox,
213
+ Skeleton
214
+ } from "./chunk-FEYZUVBM.esm.js";
213
215
  import {
214
216
  MemoPillSegmentedTabs,
215
217
  PillSegmentedTabs
216
- } from "./chunk-AYHOVAMI.esm.js";
218
+ } from "./chunk-NAMKO2MU.esm.js";
217
219
  import {
220
+ AVATAR_PRIMARY_FALLBACK_CLASS,
218
221
  Avatar,
219
222
  AvatarFallback,
220
223
  AvatarImage,
221
224
  Button,
222
225
  CONTROL_SIZE,
226
+ ChartContainer,
227
+ ChartLegend,
228
+ ChartLegendContent,
229
+ ChartStyle,
230
+ ChartTooltip,
231
+ ChartTooltipContent,
223
232
  Dialog,
224
233
  DialogClose,
225
234
  DialogContent,
@@ -236,14 +245,17 @@ import {
236
245
  TooltipContent,
237
246
  TooltipProvider,
238
247
  TooltipTrigger,
248
+ avatarChartVariantClass,
239
249
  controlClass,
240
250
  controlSurfaceClass,
241
251
  overlayAnimationClass,
242
252
  overlayItemClass,
243
253
  overlayListPanelClass,
244
- overlaySurfaceClass
245
- } from "./chunk-FOD67Z6G.esm.js";
254
+ overlaySurfaceClass,
255
+ useChart
256
+ } from "./chunk-BMXFXLVV.esm.js";
246
257
  export {
258
+ AVATAR_PRIMARY_FALLBACK_CLASS,
247
259
  Accordion,
248
260
  AccordionContent,
249
261
  AccordionItem,
@@ -284,6 +296,12 @@ export {
284
296
  CardFooter,
285
297
  CardHeader,
286
298
  CardTitle,
299
+ ChartContainer,
300
+ ChartLegend,
301
+ ChartLegendContent,
302
+ ChartStyle,
303
+ ChartTooltip,
304
+ ChartTooltipContent,
287
305
  Checkbox,
288
306
  Collapsible,
289
307
  CollapsibleContent,
@@ -471,6 +489,7 @@ export {
471
489
  TooltipProvider,
472
490
  TooltipTrigger,
473
491
  alertVariants,
492
+ avatarChartVariantClass,
474
493
  badgeVariants,
475
494
  controlClass,
476
495
  controlSurfaceClass,
@@ -482,5 +501,6 @@ export {
482
501
  overlaySurfaceClass,
483
502
  toast,
484
503
  toggleVariants,
504
+ useChart,
485
505
  useToast
486
506
  };
@@ -1,5 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
- import { b as TimbalChatProps, u as ThreadWelcomeProps } from './chat-Bed4FQSl.cjs';
2
+ import { c as TimbalChatProps, v as ThreadWelcomeProps } from './chat-ClmzWzCX.cjs';
3
3
  import { WorkforceItem } from '@timbal-ai/timbal-sdk';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
- import { b as TimbalChatProps, u as ThreadWelcomeProps } from './chat-Bed4FQSl.js';
2
+ import { c as TimbalChatProps, v as ThreadWelcomeProps } from './chat-ClmzWzCX.js';
3
3
  import { WorkforceItem } from '@timbal-ai/timbal-sdk';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timbal-ai/timbal-react",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "React components and runtime for building Timbal chat and studio apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -64,7 +64,8 @@
64
64
  "@assistant-ui/react": ">=0.12",
65
65
  "@timbal-ai/timbal-sdk": ">=0.4",
66
66
  "react": ">=19",
67
- "react-dom": ">=19"
67
+ "react-dom": ">=19",
68
+ "react-is": ">=19"
68
69
  },
69
70
  "dependencies": {
70
71
  "@assistant-ui/react-markdown": "^0.12.3",
@@ -81,6 +82,7 @@
81
82
  "motion": "^12.23.24",
82
83
  "radix-ui": "^1.4.3",
83
84
  "react-day-picker": "^10.0.1",
85
+ "recharts": "^3.8.1",
84
86
  "rehype-katex": "^7.0.1",
85
87
  "remark-gfm": "^4.0.1",
86
88
  "remark-math": "^6.0.0",
@@ -96,10 +98,12 @@
96
98
  "@timbal-ai/timbal-sdk": "0.4.9",
97
99
  "@types/react": "^19.2.4",
98
100
  "@types/react-dom": "^19.2.3",
101
+ "@types/react-is": "^19.2.0",
102
+ "dependency-cruiser": "^16.10.4",
99
103
  "happy-dom": "^20.8.9",
100
104
  "react": "^19.2.0",
101
105
  "react-dom": "^19.2.0",
102
- "dependency-cruiser": "^16.10.4",
106
+ "react-is": "^19.2.0",
103
107
  "tsup": "^8.5.0",
104
108
  "typescript": "~5.8.3"
105
109
  },
@@ -1,4 +1,8 @@
1
1
  import type { Plugin } from "vite";
2
2
 
3
- /** Use in Vite apps that link `@timbal-ai/timbal-react` via `file:../timbal-react`. */
3
+ /**
4
+ * Vite plugin for apps that link `@timbal-ai/timbal-react` via `file:../timbal-react`.
5
+ * Aliases package entrypoints to `src/`, excludes the package from `optimizeDeps`, and
6
+ * reloads when `src/` or `dist/` changes.
7
+ */
4
8
  export function timbalReactLocalDev(): Plugin;
@@ -2,7 +2,8 @@
2
2
  * Vite plugin for apps that depend on `@timbal-ai/timbal-react` via `file:../timbal-react`.
3
3
  *
4
4
  * - Skips pre-bundling so `dist/` updates are not stuck in `node_modules/.vite/deps`
5
- * - Watches the linked package `dist/` and triggers a full reload when it changes
5
+ * - Aliases package entrypoints to `src/` so gallery apps pick up source edits without rebuilding `dist/`
6
+ * - Watches `src/` and `dist/` and triggers a full reload when either changes
6
7
  *
7
8
  * IMPORTANT: this is a no-op for normal npm installs. Excluding the package from
8
9
  * `optimizeDeps` only makes sense when it is `file:`-linked (a symlink in
@@ -23,7 +24,7 @@ const TIMBAL_REACT_EXPORTS = [
23
24
  "@timbal-ai/timbal-react/app",
24
25
  ];
25
26
 
26
- /** Subpath → source entry (used when `dist/*.esm.js` is missing). */
27
+ /** Subpath → source entry (linked `file:` dev always resolves here). */
27
28
  const SOURCE_ENTRIES = {
28
29
  "@timbal-ai/timbal-react": "src/index.ts",
29
30
  "@timbal-ai/timbal-react/chat": "src/chat.ts",
@@ -102,34 +103,37 @@ export function timbalReactLocalDev() {
102
103
  distDir = path.join(pkgRoot, "dist");
103
104
  const built = distIsBuilt(distDir);
104
105
  const srcDir = path.join(pkgRoot, "src");
105
- const watchGlob = built
106
- ? `${distDir.replace(/\\/g, "/")}/**`
107
- : `${srcDir.replace(/\\/g, "/")}/**`;
106
+ const watchGlobs = [
107
+ `${srcDir.replace(/\\/g, "/")}/**`,
108
+ `${distDir.replace(/\\/g, "/")}/**`,
109
+ ];
108
110
 
109
111
  if (!built) {
110
112
  console.warn(
111
- "[timbal-react] dist/ is missing (404 on *.esm.js) aliasing to src/. " +
112
- "Run `bun run build` in timbal-react for production-like dev, or `bun run example:app` from the repo root.",
113
+ "[timbal-react] dist/ is missing — dev uses src/ only. " +
114
+ "Run `bun run build` in timbal-react to verify the production bundle.",
113
115
  );
114
116
  }
115
117
 
116
118
  /** @type {Record<string, string>} */
117
119
  const alias = {};
118
- if (!built) {
119
- for (const [pkg, rel] of Object.entries(SOURCE_ENTRIES)) {
120
- alias[pkg] = path.join(pkgRoot, rel);
121
- }
120
+ for (const [pkg, rel] of Object.entries(SOURCE_ENTRIES)) {
121
+ alias[pkg] = path.join(pkgRoot, rel);
122
122
  }
123
123
 
124
124
  return {
125
- resolve: Object.keys(alias).length ? { alias } : undefined,
125
+ resolve: { alias },
126
126
  optimizeDeps: {
127
127
  exclude: TIMBAL_REACT_EXPORTS,
128
128
  include: CJS_INTEROP_DEPS,
129
129
  },
130
130
  server: {
131
131
  watch: {
132
- ignored: ["**/.git/**", "**/node_modules/**", `!${watchGlob}`],
132
+ ignored: [
133
+ "**/.git/**",
134
+ "**/node_modules/**",
135
+ ...watchGlobs.map((g) => `!${g}`),
136
+ ],
133
137
  },
134
138
  },
135
139
  };