@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.
Files changed (44) hide show
  1. package/README.md +128 -4
  2. package/dist/app.cjs +5311 -0
  3. package/dist/app.d.cts +29 -0
  4. package/dist/app.d.ts +29 -0
  5. package/dist/app.esm.js +81 -0
  6. package/dist/chart-artifact-C71dk4xI.d.ts +329 -0
  7. package/dist/chart-artifact-CPEpOmtV.d.cts +329 -0
  8. package/dist/chat-CWtQWDtJ.d.cts +650 -0
  9. package/dist/chat-CWtQWDtJ.d.ts +650 -0
  10. package/dist/chat.cjs +4162 -0
  11. package/dist/chat.d.cts +13 -0
  12. package/dist/chat.d.ts +13 -0
  13. package/dist/chat.esm.js +51 -0
  14. package/dist/chunk-4TCJQSIX.esm.js +565 -0
  15. package/dist/chunk-IYENDIRY.esm.js +119 -0
  16. package/dist/chunk-KC5QLVUG.esm.js +22 -0
  17. package/dist/chunk-M4V6Q6XO.esm.js +1082 -0
  18. package/dist/chunk-OFHLFNJH.esm.js +138 -0
  19. package/dist/chunk-OVHR7J3J.esm.js +1574 -0
  20. package/dist/chunk-WLTW56MC.esm.js +66 -0
  21. package/dist/chunk-YJQLLFKP.esm.js +3672 -0
  22. package/dist/index.cjs +1823 -359
  23. package/dist/index.d.cts +15 -931
  24. package/dist/index.d.ts +15 -931
  25. package/dist/index.esm.js +187 -5578
  26. package/dist/layout-B9VayJhZ.d.cts +75 -0
  27. package/dist/layout-CQWngNQ7.d.ts +75 -0
  28. package/dist/studio.cjs +5734 -0
  29. package/dist/studio.d.cts +15 -0
  30. package/dist/studio.d.ts +15 -0
  31. package/dist/studio.esm.js +27 -0
  32. package/dist/styles.css +52 -2
  33. package/dist/timbal-v2-button-F4-z7m33.d.cts +40 -0
  34. package/dist/timbal-v2-button-F4-z7m33.d.ts +40 -0
  35. package/dist/ui.cjs +720 -0
  36. package/dist/ui.d.cts +74 -0
  37. package/dist/ui.d.ts +74 -0
  38. package/dist/ui.esm.js +44 -0
  39. package/dist/welcome--80i_O0p.d.cts +190 -0
  40. package/dist/welcome-BOizSp5h.d.ts +190 -0
  41. package/package.json +35 -3
  42. package/scripts/dev-linked.mjs +66 -0
  43. package/vite/local-dev.d.ts +4 -0
  44. package/vite/local-dev.mjs +71 -0
@@ -0,0 +1,15 @@
1
+ export { M as ModeToggle, a as ModeToggleProps, b as ModeToggleTheme, S as STUDIO_NAV_MODE, c as StudioModeSwitch, d as StudioModeSwitchProps, e as StudioNavMode, f as StudioSidebar, g as StudioSidebarProps, h as StudioWelcome, i as StudioWelcomeProps, T as TimbalChatShell, j as TimbalChatShellProps, k as TimbalMark, l as TimbalMarkProps, m as TimbalStudioShell, n as TimbalStudioShellProps } from './welcome--80i_O0p.cjs';
2
+ import { FC } from 'react';
3
+ import './chat-CWtQWDtJ.cjs';
4
+ import 'react/jsx-runtime';
5
+ import '@assistant-ui/react';
6
+ import '@timbal-ai/timbal-sdk';
7
+
8
+ interface StudioSidebarBackdropProps {
9
+ open: boolean;
10
+ onClose: () => void;
11
+ }
12
+ /** Mobile drawer backdrop. */
13
+ declare const StudioSidebarBackdrop: FC<StudioSidebarBackdropProps>;
14
+
15
+ export { StudioSidebarBackdrop };
@@ -0,0 +1,15 @@
1
+ export { M as ModeToggle, a as ModeToggleProps, b as ModeToggleTheme, S as STUDIO_NAV_MODE, c as StudioModeSwitch, d as StudioModeSwitchProps, e as StudioNavMode, f as StudioSidebar, g as StudioSidebarProps, h as StudioWelcome, i as StudioWelcomeProps, T as TimbalChatShell, j as TimbalChatShellProps, k as TimbalMark, l as TimbalMarkProps, m as TimbalStudioShell, n as TimbalStudioShellProps } from './welcome-BOizSp5h.js';
2
+ import { FC } from 'react';
3
+ import './chat-CWtQWDtJ.js';
4
+ import 'react/jsx-runtime';
5
+ import '@assistant-ui/react';
6
+ import '@timbal-ai/timbal-sdk';
7
+
8
+ interface StudioSidebarBackdropProps {
9
+ open: boolean;
10
+ onClose: () => void;
11
+ }
12
+ /** Mobile drawer backdrop. */
13
+ declare const StudioSidebarBackdrop: FC<StudioSidebarBackdropProps>;
14
+
15
+ export { StudioSidebarBackdrop };
@@ -0,0 +1,27 @@
1
+ import {
2
+ ModeToggle,
3
+ STUDIO_NAV_MODE,
4
+ StudioModeSwitch,
5
+ StudioSidebar,
6
+ StudioSidebarBackdrop,
7
+ StudioWelcome,
8
+ TimbalChatShell,
9
+ TimbalMark,
10
+ TimbalStudioShell
11
+ } from "./chunk-OVHR7J3J.esm.js";
12
+ import "./chunk-OFHLFNJH.esm.js";
13
+ import "./chunk-WLTW56MC.esm.js";
14
+ import "./chunk-YJQLLFKP.esm.js";
15
+ import "./chunk-IYENDIRY.esm.js";
16
+ import "./chunk-4TCJQSIX.esm.js";
17
+ export {
18
+ ModeToggle,
19
+ STUDIO_NAV_MODE,
20
+ StudioModeSwitch,
21
+ StudioSidebar,
22
+ StudioSidebarBackdrop,
23
+ StudioWelcome,
24
+ TimbalChatShell,
25
+ TimbalMark,
26
+ TimbalStudioShell
27
+ };
package/dist/styles.css CHANGED
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * The package's components are written exclusively against semantic Tailwind
9
9
  * tokens (bg-card, text-foreground, border-border, bg-elevated-from/to,
10
- * shadow-card, …). Every token has a complete light + dark definition here
10
+ * from-modal-from/to, shadow-card, …). Every token has a complete light + dark definition here
11
11
  * so a consumer's host CSS only needs:
12
12
  *
13
13
  * @import "tailwindcss";
@@ -62,6 +62,10 @@
62
62
  --elevated-from: oklch(1 0 0);
63
63
  --elevated-to: oklch(0.985 0.002 260 / 0.7);
64
64
 
65
+ /* Opaque modal/dialog gradient — same hue as elevated, no alpha bleed-through. */
66
+ --modal-from: oklch(1 0 0);
67
+ --modal-to: oklch(0.975 0.002 260);
68
+
65
69
  /* Soft playground gradient behind the message column. */
66
70
  --playground-from: oklch(0.91 0.004 260 / 0.6);
67
71
  --playground-via: oklch(0.965 0.002 260 / 0.3);
@@ -136,6 +140,15 @@
136
140
  var(--studio-sidebar-gap) + var(--studio-sidebar-width-collapsed) +
137
141
  var(--studio-sidebar-content-gap)
138
142
  );
143
+
144
+ /* Pill segmented control (WorkshopPillSegmentedTabs / Build–Manage). */
145
+ --pill-segmented-track: var(--muted);
146
+ --pill-segmented-track-border: transparent;
147
+ --pill-segmented-track-shadow: none;
148
+ --pill-segmented-indicator-from: oklch(1 0 0);
149
+ --pill-segmented-indicator-to: oklch(0.985 0.002 260 / 0.7);
150
+ --pill-segmented-indicator-border: oklch(0.9 0.004 260 / 0.8);
151
+ --pill-segmented-indicator-shadow: 0 1px 2px -0.5px rgba(0, 0, 0, 0.05);
139
152
  }
140
153
 
141
154
  .dark {
@@ -171,6 +184,21 @@
171
184
  --elevated-from: oklch(1 0 0 / 0.05);
172
185
  --elevated-to: oklch(1 0 0 / 0.025);
173
186
 
187
+ --modal-from: oklch(0.22 0.005 260);
188
+ --modal-to: oklch(0.19 0.005 260);
189
+
190
+ --pill-segmented-track: linear-gradient(
191
+ to bottom,
192
+ oklch(1 0 0 / 0.05),
193
+ oklch(1 0 0 / 0.025)
194
+ );
195
+ --pill-segmented-track-border: oklch(1 0 0 / 0.08);
196
+ --pill-segmented-track-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
197
+ --pill-segmented-indicator-from: oklch(1 0 0 / 0.05);
198
+ --pill-segmented-indicator-to: oklch(1 0 0 / 0.025);
199
+ --pill-segmented-indicator-border: oklch(1 0 0 / 0.08);
200
+ --pill-segmented-indicator-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
201
+
174
202
  --playground-from: oklch(0.27 0.005 285);
175
203
  --playground-via: oklch(0.19 0.005 260);
176
204
  --playground-to: oklch(0.13 0.005 285);
@@ -263,6 +291,8 @@
263
291
  bg-*, border-*, text-*, from-*, via-*, to-* utilities alike. */
264
292
  --color-elevated-from: var(--elevated-from);
265
293
  --color-elevated-to: var(--elevated-to);
294
+ --color-modal-from: var(--modal-from);
295
+ --color-modal-to: var(--modal-to);
266
296
  --color-playground-from: var(--playground-from);
267
297
  --color-playground-via: var(--playground-via);
268
298
  --color-playground-to: var(--playground-to);
@@ -304,6 +334,11 @@
304
334
  from `<html>` and every utility flips together with the base tokens. */
305
335
  @custom-variant dark (&:is(.dark *));
306
336
 
337
+ /** Pill segmented track — supports solid or gradient via `--pill-segmented-track`. */
338
+ @utility bg-pill-segmented-track {
339
+ background: var(--pill-segmented-track);
340
+ }
341
+
307
342
  /* =============================================================== *
308
343
  * Polish — markdown, shiki, katex, scrollbars *
309
344
  * =============================================================== */
@@ -456,14 +491,29 @@
456
491
  background-clip: content-box;
457
492
  }
458
493
 
494
+ /* =============================================================== *
495
+ * App kit — layout shells use .aui-app-* class hooks in components *
496
+ * =============================================================== */
497
+
459
498
  /* =============================================================== *
460
499
  * Component fixes — baked in so consumers don't need overrides *
461
500
  * =============================================================== */
462
501
 
463
- /* Sticky footer stacks above scrolling messages; composer shell is opaque. */
502
+ /* Sticky footer stacks above scrolling messages. */
464
503
  .aui-thread-viewport-footer {
465
504
  isolation: isolate;
466
505
  z-index: 10;
506
+ background-color: var(--background);
507
+ }
508
+
509
+ .aui-thread-root[data-thread-variant="panel"] .aui-thread-viewport-footer {
510
+ background-color: var(--card);
511
+ }
512
+
513
+ /* Clip inner textarea/toolbar fills to the rounded shell (also in Tailwind class). */
514
+ .aui-composer-shell {
515
+ border-radius: var(--radius-2xl, 1rem);
516
+ overflow: hidden;
467
517
  }
468
518
 
469
519
  /* Scrolled assistant action bars must not show through the composer shell. */
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Timbal V2 button design tokens.
5
+ *
6
+ * Mirrors the `timbal-platform` design language (`TimbalV2Button`) so chat
7
+ * surfaces built with the SDK feel identical to the Timbal Studio. Each record
8
+ * is keyed by variant or size and ships only Tailwind utility classes — no
9
+ * runtime JS — so consumers can compose them with `cn(...)` and add their own
10
+ * overrides without ejecting.
11
+ *
12
+ * Every colour is resolved through semantic CSS variables defined in
13
+ * `styles.css`. There are NO hardcoded palette literals — light/dark mode
14
+ * flips by swapping the variable values, not by toggling Tailwind classes.
15
+ */
16
+ type TimbalV2Variant = "primary" | "secondary" | "ghost" | "informative" | "destructive" | "link";
17
+ type TimbalV2Size = "xs" | "sm" | "md" | "lg";
18
+
19
+ interface TimbalV2ButtonProps extends React.ComponentProps<"button"> {
20
+ variant?: TimbalV2Variant;
21
+ size?: TimbalV2Size;
22
+ isIconOnly?: boolean;
23
+ isLoading?: boolean;
24
+ fullWidth?: boolean;
25
+ /** `pill` (default) — full rounding; `rect` — `rounded-md` for shadcn-style buttons. */
26
+ shape?: "pill" | "rect";
27
+ /**
28
+ * When true, merges props onto the single child element (Radix Slot).
29
+ * Uses a flat surface (no layered fill spans) — required for `asChild` to work.
30
+ */
31
+ asChild?: boolean;
32
+ }
33
+ /**
34
+ * Canonical Timbal pill button — layered absolute-fill span + relative label
35
+ * row scoped to `group/tbv2`. Mirrors `timbal-platform` `TimbalV2Button` so
36
+ * chat UIs built with the SDK feel identical to the Studio.
37
+ */
38
+ declare const TimbalV2Button: React.ForwardRefExoticComponent<Omit<TimbalV2ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
39
+
40
+ export { type TimbalV2ButtonProps as T, TimbalV2Button as a };
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Timbal V2 button design tokens.
5
+ *
6
+ * Mirrors the `timbal-platform` design language (`TimbalV2Button`) so chat
7
+ * surfaces built with the SDK feel identical to the Timbal Studio. Each record
8
+ * is keyed by variant or size and ships only Tailwind utility classes — no
9
+ * runtime JS — so consumers can compose them with `cn(...)` and add their own
10
+ * overrides without ejecting.
11
+ *
12
+ * Every colour is resolved through semantic CSS variables defined in
13
+ * `styles.css`. There are NO hardcoded palette literals — light/dark mode
14
+ * flips by swapping the variable values, not by toggling Tailwind classes.
15
+ */
16
+ type TimbalV2Variant = "primary" | "secondary" | "ghost" | "informative" | "destructive" | "link";
17
+ type TimbalV2Size = "xs" | "sm" | "md" | "lg";
18
+
19
+ interface TimbalV2ButtonProps extends React.ComponentProps<"button"> {
20
+ variant?: TimbalV2Variant;
21
+ size?: TimbalV2Size;
22
+ isIconOnly?: boolean;
23
+ isLoading?: boolean;
24
+ fullWidth?: boolean;
25
+ /** `pill` (default) — full rounding; `rect` — `rounded-md` for shadcn-style buttons. */
26
+ shape?: "pill" | "rect";
27
+ /**
28
+ * When true, merges props onto the single child element (Radix Slot).
29
+ * Uses a flat surface (no layered fill spans) — required for `asChild` to work.
30
+ */
31
+ asChild?: boolean;
32
+ }
33
+ /**
34
+ * Canonical Timbal pill button — layered absolute-fill span + relative label
35
+ * row scoped to `group/tbv2`. Mirrors `timbal-platform` `TimbalV2Button` so
36
+ * chat UIs built with the SDK feel identical to the Studio.
37
+ */
38
+ declare const TimbalV2Button: React.ForwardRefExoticComponent<Omit<TimbalV2ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
39
+
40
+ export { type TimbalV2ButtonProps as T, TimbalV2Button as a };