@timbal-ai/timbal-react 1.0.0 → 1.1.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/CHANGELOG.md +28 -0
- package/README.md +45 -4
- package/dist/app.cjs +1996 -1183
- package/dist/app.d.cts +8 -4
- package/dist/app.d.ts +8 -4
- package/dist/app.esm.js +23 -6
- package/dist/{chart-artifact-CBo9x8Ch.d.ts → chart-artifact-BZp7nmaf.d.ts} +253 -12
- package/dist/{chart-artifact-DOkwSTjQ.d.cts → chart-artifact-CX-rh9nq.d.cts} +253 -12
- package/dist/{chat-Bed4FQSl.d.cts → chat-DCms8pJ_.d.cts} +31 -4
- package/dist/{chat-Bed4FQSl.d.ts → chat-DCms8pJ_.d.ts} +31 -4
- package/dist/chat.cjs +1088 -775
- package/dist/chat.d.cts +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/chat.esm.js +3 -3
- package/dist/{chunk-FOD67Z6G.esm.js → chunk-4AKJ6FKE.esm.js} +235 -4
- package/dist/{chunk-YEFBANNF.esm.js → chunk-6HWMJNZT.esm.js} +242 -288
- package/dist/{chunk-C6IXFM4T.esm.js → chunk-FRZOEYBO.esm.js} +4 -4
- package/dist/chunk-JEAUF54A.esm.js +52 -0
- package/dist/{chunk-AYHOVAMI.esm.js → chunk-P3KDAYX6.esm.js} +1 -1
- package/dist/{chunk-GLPOVYEA.esm.js → chunk-TK2AGIME.esm.js} +662 -274
- package/dist/{chunk-RZ6QC6RG.esm.js → chunk-XCM3V6RK.esm.js} +2 -2
- package/dist/{chunk-SNLXVG7H.esm.js → chunk-YXZ22OJN.esm.js} +849 -665
- package/dist/index.cjs +2558 -1789
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +29 -11
- package/dist/pill-segmented-tabs-Ba5q0feL.d.cts +500 -0
- package/dist/pill-segmented-tabs-Ba5q0feL.d.ts +500 -0
- package/dist/studio.cjs +1310 -997
- package/dist/studio.d.cts +2 -2
- package/dist/studio.d.ts +2 -2
- package/dist/studio.esm.js +5 -5
- package/dist/styles.css +26 -0
- package/dist/ui.cjs +275 -37
- package/dist/ui.d.cts +71 -491
- package/dist/ui.d.ts +71 -491
- package/dist/ui.esm.js +22 -6
- package/dist/{welcome-COOb05a5.d.cts → welcome-CRqOPKMp.d.cts} +1 -1
- package/dist/{welcome-DE08m9ca.d.ts → welcome-DlHUa3OL.d.ts} +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@timbal-ai/timbal-react` are documented here.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **App-kit charts now run on [recharts](https://recharts.org)** (native shadcn chart layer). `LineAreaChart`, `PieChart`, `RadialChart`, and `RadarChart` keep the same public props but render via recharts under the shadcn `ChartContainer` / `ChartTooltipContent` / `ChartLegendContent` chrome — so tooltips, hover states, and animation match shadcn exactly across every chart kind. Series colors still flow from the theme `--chart-1..6` tokens.
|
|
10
|
+
- Fixes from feedback: in-card legends no longer clip outside the card; line/area charts use a thin crosshair cursor (not a wide band); tooltips animate in; and radial/radar charts now have hover tooltips.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **shadcn chart primitives exported from `/ui`**: `ChartContainer`, `ChartTooltip`, `ChartTooltipContent`, `ChartLegend`, `ChartLegendContent`, `ChartStyle`, `useChart`, and the `ChartConfig` type.
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
- Adds **`recharts`** as a dependency and **`react-is`** as a peer dependency (`react-is` must match your React version).
|
|
19
|
+
|
|
20
|
+
## [1.1.0] — 2026-06-03
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **`DataTable` scales to real datasets** — three additive props (all backward-compatible):
|
|
25
|
+
- **`pageSize`** — built-in client-side pagination with a compact footer pager (row range + prev/next). Controlled via `pageIndex` / `onPageChange`, or uncontrolled with `defaultPageIndex`; out-of-range pages snap back after filtering.
|
|
26
|
+
- **`selectable`** + **`selectedKeys`** / **`defaultSelectedKeys`** / **`onSelectionChange`** — a leading checkbox column with header select-all (indeterminate state) for bulk actions (acknowledge/resolve/export). Toggling a checkbox never triggers `onRowClick`.
|
|
27
|
+
- **`loading`** (+ **`loadingRows`**) — shaped skeleton rows that preserve the header/columns so the table doesn't jump when data arrives.
|
|
28
|
+
- **Loading states across the data kit** — `MetricRow`, `MetricChartCard`, and `ChartPanel` accept **`loading`**, rendering skeleton tiles / plot-height skeletons. Every async dashboard gets a consistent pending state without re-inventing one.
|
|
29
|
+
- **`useLiveQuery` / `useInterval`** (root + `/app`) — poll an async source on an interval for live dashboards (alerts, metrics, logs). Handles loading vs. background `refreshing`, drops stale/post-unmount responses, pauses while the tab is hidden + refetches on focus, and exposes `lastUpdated` + a manual `refetch`. Pairs with `authFetch`.
|
|
30
|
+
- **`AppShell` owns the mobile nav** — `AppShell` manages the drawer open-state (`navOpen` / `defaultNavOpen` / `onNavOpenChange`), renders the mobile backdrop automatically, and provides **`useAppShellNav()`** + **`AppShellSidebarTrigger`** (an `md:hidden` hamburger). Wiring a responsive `StudioSidebar` drops from ~30 lines of `isMobile`/resize/backdrop boilerplate to passing `mobileOpen={nav.open}` / `onMobileOpenChange={nav.setOpen}`.
|
|
31
|
+
- **`StatusBadge` `tone="danger"`** — a destructive/red tone for critical severity, so error/critical states aren't forced onto the brand `primary` tone.
|
|
32
|
+
|
|
5
33
|
## [1.0.0] — 2026-06-02
|
|
6
34
|
|
|
7
35
|
First stable release. The `@timbal-ai/timbal-react/ui` primitive layer, the control-surface contract, and the app-kit are now a settled public surface.
|
package/README.md
CHANGED
|
@@ -35,9 +35,11 @@ bun add @timbal-ai/timbal-react
|
|
|
35
35
|
**Peer dependencies:**
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npm install react react-dom @assistant-ui/react @timbal-ai/timbal-sdk
|
|
38
|
+
npm install react react-dom react-is @assistant-ui/react @timbal-ai/timbal-sdk
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
> The app-kit charts are built on [recharts](https://recharts.org) (installed automatically). `react-is` is a recharts peer and **must match your React version** — install it explicitly if your package manager doesn't hoist peers.
|
|
42
|
+
|
|
41
43
|
### Tailwind setup
|
|
42
44
|
|
|
43
45
|
The package ships pre-built Tailwind class names **plus a complete light + dark token set** (`bg-background`, `text-foreground`, `bg-card`, `bg-bubble-user`, `from-elevated-from`, `bg-playground-from/via/to`, etc.). Your app CSS only needs three lines:
|
|
@@ -61,15 +63,51 @@ Every token has a CSS-variable indirection in `styles.css`. Override individual
|
|
|
61
63
|
:root {
|
|
62
64
|
--primary: oklch(0.5 0.12 265);
|
|
63
65
|
--playground-from: oklch(0.95 0.04 265 / 0.6);
|
|
66
|
+
/* Chart series — override any to rebrand every dashboard chart at once */
|
|
67
|
+
--chart-1: var(--primary);
|
|
68
|
+
--chart-2: oklch(0.62 0.13 184);
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
.dark {
|
|
67
72
|
--primary: oklch(0.72 0.14 265);
|
|
68
73
|
--playground-from: oklch(0.27 0.04 265);
|
|
74
|
+
--chart-1: var(--primary);
|
|
69
75
|
}
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
Both light AND dark blocks must
|
|
78
|
+
Both light AND dark blocks must define every overridden token — otherwise toggling dark mode produces an inconsistent UI. The library prints a one-time dev-only console warning when it detects a mismatch.
|
|
79
|
+
|
|
80
|
+
### Charts (app kit + artifacts)
|
|
81
|
+
|
|
82
|
+
Dashboard and in-chat charts use the **native shadcn/recharts layer** — animated tooltips, hover crosshairs, and legends that match shadcn/ui out of the box.
|
|
83
|
+
|
|
84
|
+
| Import from | Components |
|
|
85
|
+
|-------------|------------|
|
|
86
|
+
| `@timbal-ai/timbal-react` or `/app` | `LineAreaChart`, `PieChart`, `RadialChart`, `RadarChart`, `Sparkline`, `ChartPanel`, `MetricChartCard` |
|
|
87
|
+
| `@timbal-ai/timbal-react/ui` | `ChartContainer`, `ChartTooltip`, `ChartTooltipContent`, `ChartLegend`, `ChartLegendContent`, `ChartConfig` |
|
|
88
|
+
|
|
89
|
+
**Dependencies:** `recharts` ships with the package. Install **`react-is`** alongside React (same major version) — it is a recharts peer and must match your React version.
|
|
90
|
+
|
|
91
|
+
**Rebrand:** override `--chart-1` … `--chart-6` in `:root` / `.dark` (series 1 defaults to `--primary`). Per-series overrides: `series[].color` on `LineAreaChart` or `colors` on pie/radial artifacts.
|
|
92
|
+
|
|
93
|
+
**`ChartArtifact` kinds:** `bar`, `horizontalBar`, `line`, `area`, `pie`, `donut`, `radial`, `radar` — see `ChartPanel` + the app-kit **Chart catalog** recipe.
|
|
94
|
+
|
|
95
|
+
**Custom charts** (same pattern as shadcn docs):
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
import { Bar, BarChart, XAxis } from "recharts";
|
|
99
|
+
import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from "@timbal-ai/timbal-react/ui";
|
|
100
|
+
|
|
101
|
+
const config = { revenue: { label: "Revenue", color: "var(--chart-1)" } } satisfies ChartConfig;
|
|
102
|
+
|
|
103
|
+
<ChartContainer config={config} className="h-[240px] w-full">
|
|
104
|
+
<BarChart data={rows} accessibilityLayer>
|
|
105
|
+
<XAxis dataKey="month" hide />
|
|
106
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
107
|
+
<Bar dataKey="revenue" fill="var(--color-revenue)" radius={4} />
|
|
108
|
+
</BarChart>
|
|
109
|
+
</ChartContainer>
|
|
110
|
+
```
|
|
73
111
|
|
|
74
112
|
### Programmatic theming (no hand-authored OKLCH)
|
|
75
113
|
|
|
@@ -1025,10 +1063,13 @@ The shell renders a rounded floating panel (bottom-right) and a **text-only** pi
|
|
|
1025
1063
|
| `AppCopilotProvider` | Page context via `useAppCopilotContext` (not shown in UI) |
|
|
1026
1064
|
| `AppChatPanel` | Full-height floating thread; dismiss via **X** in the corner |
|
|
1027
1065
|
| `AppShell` `chat` | Floating overlay — `chatWidth`; optional `chatHeight` (default: stretch top–bottom) |
|
|
1028
|
-
| `LineAreaChart`
|
|
1066
|
+
| `LineAreaChart` | Cartesian engine on **recharts** — area/line/bar, stacked, horizontal bars, `monotone`/`linear`/`step` curves, dots, shadcn-style hover tooltip (`dot`/`line`/`dashed` indicators), responsive |
|
|
1067
|
+
| `PieChart` / `RadialChart` / `RadarChart` | Pie & donut (center KPI), concentric progress rings, and spider charts — native shadcn/recharts charts |
|
|
1068
|
+
| `ChartContainer` / `ChartTooltip` / `ChartTooltipContent` / `ChartLegend` / `ChartLegendContent` (`/ui`) | shadcn chart primitives (recharts wrappers); colors flow from `ChartConfig` → `--color-*` |
|
|
1069
|
+
| `Sparkline` | Tiny inline trend for table cells and tiles |
|
|
1029
1070
|
| `MetricRow` | Platform KPI strip in one card (overview metrics, no chart) |
|
|
1030
1071
|
| `MetricChartCard` | `MetricRow` + selectable flush chart (Analytics / Infrastructure) |
|
|
1031
|
-
| `ChartPanel` `artifact` | Chrome around a `ChartArtifact` or any chart |
|
|
1072
|
+
| `ChartPanel` `artifact` | Chrome around a `ChartArtifact` (`chartType`: `bar`/`horizontalBar`/`line`/`area`/`pie`/`donut`/`radial`/`radar`) or any chart |
|
|
1032
1073
|
| `SettingsSection` / `FieldRow` / `DangerZone` / `FloatingUnsavedChangesBar` | Two-column settings page building blocks |
|
|
1033
1074
|
| `IntegrationCard` / `ConnectionRow` / `PlanBadge` / `IntegrationsEmptyState` | Integration catalog + connected list |
|
|
1034
1075
|
| `InfoCard` / `DescriptionList` / `ExpandableSection` / `ResourceCard` / `StatusDot` | Surfaces & detail views |
|