@timbal-ai/timbal-react 0.6.1 → 0.7.1

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 (47) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +35 -5
  3. package/dist/app.cjs +2291 -741
  4. package/dist/app.d.cts +5 -2
  5. package/dist/app.d.ts +5 -2
  6. package/dist/app.esm.js +58 -5
  7. package/dist/button-CIKzUrJI.d.cts +18 -0
  8. package/dist/button-CIKzUrJI.d.ts +18 -0
  9. package/dist/chart-artifact-C2m891nx.d.cts +756 -0
  10. package/dist/chart-artifact-CqqhdSR9.d.ts +756 -0
  11. package/dist/{chat-CWtQWDtJ.d.cts → chat-Bed4FQSl.d.cts} +10 -0
  12. package/dist/{chat-CWtQWDtJ.d.ts → chat-Bed4FQSl.d.ts} +10 -0
  13. package/dist/chat.cjs +876 -562
  14. package/dist/chat.d.cts +3 -3
  15. package/dist/chat.d.ts +3 -3
  16. package/dist/chat.esm.js +3 -3
  17. package/dist/{chunk-4TCJQSIX.esm.js → chunk-2XZ3S4OP.esm.js} +14 -3
  18. package/dist/{chunk-WLTW56MC.esm.js → chunk-3WCG6ZRL.esm.js} +2 -2
  19. package/dist/chunk-7U2N6XZA.esm.js +2296 -0
  20. package/dist/{chunk-OVHR7J3J.esm.js → chunk-EQC5JEDZ.esm.js} +38 -11
  21. package/dist/{chunk-YJQLLFKP.esm.js → chunk-RY3LB3JN.esm.js} +817 -507
  22. package/dist/{chunk-IYENDIRY.esm.js → chunk-TDIJHV4I.esm.js} +1 -1
  23. package/dist/{chunk-OFHLFNJH.esm.js → chunk-Z27GBSOT.esm.js} +3 -1
  24. package/dist/index.cjs +2596 -1019
  25. package/dist/index.d.cts +8 -7
  26. package/dist/index.d.ts +8 -7
  27. package/dist/index.esm.js +57 -7
  28. package/dist/{layout-CQWngNQ7.d.ts → layout-BTJyU8wd.d.ts} +1 -1
  29. package/dist/{layout-B9VayJhZ.d.cts → layout-C2G-FcER.d.cts} +1 -1
  30. package/dist/studio.cjs +1131 -788
  31. package/dist/studio.d.cts +2 -2
  32. package/dist/studio.d.ts +2 -2
  33. package/dist/studio.esm.js +6 -6
  34. package/dist/styles.css +8 -4
  35. package/dist/{timbal-v2-button-F4-z7m33.d.ts → timbal-v2-button-CNfdwGq4.d.cts} +1 -1
  36. package/dist/{timbal-v2-button-F4-z7m33.d.cts → timbal-v2-button-CNfdwGq4.d.ts} +1 -1
  37. package/dist/ui.cjs +12 -3
  38. package/dist/ui.d.cts +5 -16
  39. package/dist/ui.d.ts +5 -16
  40. package/dist/ui.esm.js +2 -2
  41. package/dist/{welcome--80i_O0p.d.cts → welcome-COOb05a5.d.cts} +5 -4
  42. package/dist/{welcome-BOizSp5h.d.ts → welcome-DE08m9ca.d.ts} +5 -4
  43. package/package.json +2 -1
  44. package/vite/local-dev.mjs +45 -3
  45. package/dist/chart-artifact-C71dk4xI.d.ts +0 -329
  46. package/dist/chart-artifact-CPEpOmtV.d.cts +0 -329
  47. package/dist/chunk-M4V6Q6XO.esm.js +0 -1082
package/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@timbal-ai/timbal-react` are documented here.
4
+
5
+ ## [0.7.1] — 2026-06-02
6
+
7
+ ### Changed
8
+
9
+ - **Opaque elevated surfaces** — `--elevated-from` / `--elevated-to` no longer use alpha in light or dark themes, preserving the signature vertical gradient with no background bleed-through.
10
+
11
+ ### Added
12
+
13
+ - **`TIMBAL_V2_ELEVATED_SURFACE`** — elevated card/list surface (gradient + border + `shadow-card`) without hover/active fill shifts, for catalog cards and connection lists.
14
+ - **`TIMBAL_V2_LOGO_TILE`** — logo/integration mark tile pinned to the light plate in both themes so dark provider logos stay legible.
15
+ - **`STORAGE_KEYS.theme`** — localStorage key used by `ModeToggle` in uncontrolled mode.
16
+
17
+ ### Fixed
18
+
19
+ - **`StatTile`** typography aligned with platform metrics (normal weight, compact labels, tabular numerals).
20
+
21
+ ---
22
+
23
+ ## [0.7.0] — 2026-05-29
24
+
25
+ ### Added
26
+
27
+ - **App kit premade components** under `@timbal-ai/timbal-react/app`:
28
+ - **Metrics:** `MetricRow`, `MetricChartCard`, `MetricTile` (platform-style KPI strip + flush chart)
29
+ - **Integrations:** `IntegrationCard`, `ConnectionRow`, `ConnectionRowList`, `IntegrationsEmptyState`, `PlanBadge`
30
+ - **Settings:** `SettingsSection`, `FieldRow`, `DangerZone`, `FloatingUnsavedChangesBar`
31
+ - **Surfaces:** `InfoCard`, `DescriptionList`, `ExpandableSection`, `ResourceCard`, `StatusDot`
32
+ - **Charts engine** (`LineAreaChart`, `Sparkline`, `CHART_PALETTE`) — dependency-free SVG + motion; shared by app kit and chart artifacts
33
+ - **`APP_KIT_AGENT_INSTRUCTIONS`** — codegen system-prompt text (component menu, recipes, accessibility)
34
+ - **`TIMBAL_V2_ELEVATED_SURFACE`** and **`TIMBAL_V2_LOGO_TILE`** design tokens for catalog/resource cards
35
+ - **`@timbal-ai/timbal-react/vite`** — `timbalReactLocalDev()` plugin: linked-package dev, `dist/` watch, src alias when `dist/` is missing
36
+ - **`examples/app-kit`** recipe gallery and reference dashboard
37
+ - **`AGENTS.md`** section for app kit + recipes
38
+
39
+ ### Changed
40
+
41
+ - **`ChartPanel`** — same shell as `MetricChartCard` (title row + flush plot); `ChartArtifactView` supports `embedded` mode
42
+ - **Chart artifacts** — area/line/bar route through `LineAreaChart` with flush layout and improved styling
43
+ - **`Button`** — pill shape by default; re-exported from `/app` for catalog CTAs
44
+ - **`StatTile`** — typography aligned with platform metrics (normal weight, compact labels)
45
+ - **Integration / resource / metric cards** — elevated secondary chrome; no background flash on card click (reserved for `Button`)
46
+
47
+ ### Fixed
48
+
49
+ - Local dev **404 on `*.esm.js`** when `dist/` is empty — vite plugin falls back to `src/` with a console warning
50
+
51
+ ---
52
+
53
+ ## [0.6.1]
54
+
55
+ Subpath exports (`/chat`, `/studio`, `/ui`, `/app`), layered package architecture, initial app kit (`AppShell`, `Page`, `DataTable`, …).
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  React components and runtime for building Timbal chat UIs and studio apps. Drop in a single component to get a fully-featured streaming chat interface connected to a Timbal workforce agent, or compose dashboards with the **app kit**.
4
4
 
5
- ## Package structure (0.6+)
5
+ ## Package structure (0.7+)
6
6
 
7
7
  | Subpath | Use when |
8
8
  |---------|----------|
@@ -49,7 +49,7 @@ The package ships pre-built Tailwind class names **plus a complete light + dark
49
49
  @source "../node_modules/@timbal-ai/timbal-react/dist";
50
50
  ```
51
51
 
52
- That's it — no `@theme`, `:root`, or `.dark` blocks of your own. Toggling dark mode is a single `document.documentElement.classList.toggle("dark")` (or `next-themes` `attribute="class"`).
52
+ That's it — no `@theme`, `:root`, or `.dark` blocks of your own. Toggling dark mode is a single `document.documentElement.classList.toggle("dark")` (or `next-themes` `attribute="class"`). The built-in `ModeToggle` (uncontrolled) persists to `localStorage` key `timbal-theme` and restores on reload.
53
53
 
54
54
  > Adjust the `@source` path if your CSS file lives at a different depth relative to `node_modules`.
55
55
 
@@ -134,6 +134,16 @@ Suggestions also accept a function (sync or async) for per-user or server-driven
134
134
 
135
135
  Each chip supports `icon`, `description`, and `prompt` (sent instead of `title` when clicked).
136
136
 
137
+ In `AppChatPanel` (`variant="panel"`), welcome suggestions are **off** by default. Enable them with `showWelcomeSuggestions`:
138
+
139
+ ```tsx
140
+ <AppChatPanel
141
+ workforceId="your-workforce-id"
142
+ showWelcomeSuggestions
143
+ suggestions={[{ title: "Summarize this dashboard" }]}
144
+ />
145
+ ```
146
+
137
147
  ### Placeholder and width
138
148
 
139
149
  ```tsx
@@ -605,6 +615,7 @@ import {
605
615
  | `welcome.heading` | `string` | `"How can I help you today?"` | Welcome screen heading |
606
616
  | `welcome.subheading` | `string` | `"Send a message to start a conversation."` | Welcome screen subheading |
607
617
  | `suggestions` | `{ title: string; description?: string }[]` | — | Suggestion chips on the welcome screen |
618
+ | `showWelcomeSuggestions` | `boolean` | `true` (`default` variant), `false` (`panel`) | Show built-in welcome suggestions when `suggestions` is set |
608
619
  | `composerPlaceholder` | `string` | `"Send a message..."` | Composer input placeholder |
609
620
  | `components` | `ThreadComponents` | — | Override individual UI slots |
610
621
  | `onArtifactEvent` | `(event: UiEventEnvelope) => void` | — | Called when a `ui` artifact fires an `emit` action |
@@ -905,11 +916,30 @@ The shell renders a rounded floating panel (bottom-right) and a **text-only** pi
905
916
  | `AppCopilotProvider` | Page context via `useAppCopilotContext` (not shown in UI) |
906
917
  | `AppChatPanel` | Full-height floating thread; dismiss via **X** in the corner |
907
918
  | `AppShell` `chat` | Floating overlay — `chatWidth`; optional `chatHeight` (default: stretch top–bottom) |
908
- | `ChartPanel` `artifact` | Built-in SVG charts without extra imports |
919
+ | `LineAreaChart` / `Sparkline` | Dependency-free charts (smooth area/line/bar, hover tooltip, responsive) |
920
+ | `MetricRow` | Platform KPI strip in one card (overview metrics, no chart) |
921
+ | `MetricChartCard` | `MetricRow` + selectable flush chart (Analytics / Infrastructure) |
922
+ | `ChartPanel` `artifact` | Chrome around a `ChartArtifact` or any chart |
923
+ | `SettingsSection` / `FieldRow` / `DangerZone` / `FloatingUnsavedChangesBar` | Two-column settings page building blocks |
924
+ | `IntegrationCard` / `ConnectionRow` / `PlanBadge` / `IntegrationsEmptyState` | Integration catalog + connected list |
925
+ | `InfoCard` / `DescriptionList` / `ExpandableSection` / `ResourceCard` / `StatusDot` | Surfaces & detail views |
909
926
  | `FieldTextarea` / `FieldSelect` / `FieldSwitch` | Settings forms matching `FieldInput` |
910
927
  | `AppConfirmDialog` | Delete/export confirmations |
911
928
 
912
- Full gallery: [`examples/app-kit`](examples/app-kit) (`bun run example:app`).
929
+ Inject `APP_KIT_AGENT_INSTRUCTIONS` into codegen / workforce prompts (same idea as `ARTIFACT_AGENT_INSTRUCTIONS`). Agents should compose **creatively** from the component menu — not clone a single demo layout.
930
+
931
+ ```ts
932
+ import { APP_KIT_AGENT_INSTRUCTIONS } from "@timbal-ai/timbal-react/app";
933
+
934
+ const systemPrompt = `${basePrompt}\n\n${APP_KIT_AGENT_INSTRUCTIONS}`;
935
+ ```
936
+
937
+ | Examples | Purpose |
938
+ |----------|---------|
939
+ | [`examples/app-kit/src/recipes/`](examples/app-kit/src/recipes/) | Short patterns (metrics, table, forms, copilot, …) — **preferred for agents** |
940
+ | [`examples/app-kit/src/reference/`](examples/app-kit/src/reference/) | One full wired dashboard — **reference only** |
941
+
942
+ Browse locally: [`examples/app-kit`](examples/app-kit) (`bun run example:app`).
913
943
 
914
944
  ---
915
945
 
@@ -958,7 +988,7 @@ Everything else (the three shells, primitives, hooks, auth, artifact API, design
958
988
  ## Examples
959
989
 
960
990
  - [`examples/mock-ui`](examples/mock-ui) — chat + artifact gallery (mock `fetch`).
961
- - [`examples/app-kit`](examples/app-kit) — dashboard / app kit component gallery (no API).
991
+ - [`examples/app-kit`](examples/app-kit) — app kit **recipes** + optional **reference** dashboard (see `APP_KIT_AGENT_INSTRUCTIONS`).
962
992
 
963
993
  ## Mock UI demo
964
994