twico-ui 1.9.0 → 1.10.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/llms.txt CHANGED
@@ -1249,106 +1249,6 @@ import { Badge } from "twico-ui";
1249
1249
  <Badge tone="info" size="lg">12 new</Badge>
1250
1250
  ```
1251
1251
 
1252
- #### Boxplot
1253
-
1254
- A dependency-free inline-SVG box-and-whisker chart that draws one box per category from a five-number summary (min, Q1, median, Q3, max) with whiskers and optional outlier points. Reach for it to compare the spread, skew, and outliers of distributions across groups where a bar or line chart would hide the shape of the data.
1255
-
1256
- `import { Boxplot } from "twico-ui"`
1257
-
1258
- Props:
1259
- - `data` — `BoxplotDatum[]` · **required** — The boxes to plot, one per category, each a five-number summary with an optional array of outlier values.
1260
- - `color` — `string` · default `"var(--color-primary)"` — Box fill and stroke accent, accepting any CSS color including a design token reference.
1261
- - `height` — `number` · default `300` — Pixel height of the chart; the width fills its container at 100%.
1262
- - `showGrid` — `boolean` · default `true` — Whether to draw horizontal grid lines at the value axis ticks behind the boxes.
1263
- - `showAxis` — `boolean` · default `true` — Whether to render the value axis and the category labels under each box.
1264
- - `valueFormat` — `(value: number) => string` · default `toLocaleString` — Formatter applied to values in the per-box tooltip and the hidden data table.
1265
- - `ariaLabel` — `string` · default `"box plot"` — Accessible name for the chart's role="img" SVG; per-box values are exposed via the hidden data table.
1266
- - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden data table as an accessible text alternative for screen readers (WCAG 1.1.1).
1267
- - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
1268
-
1269
- ```jsx
1270
- import { Boxplot } from "twico-ui";
1271
-
1272
- <Boxplot
1273
- data={[
1274
- { label: "API", min: 12, q1: 24, median: 33, q3: 42, max: 58, outliers: [72] },
1275
- { label: "Web", min: 18, q1: 30, median: 41, q3: 52, max: 66 },
1276
- { label: "Cache", min: 8, q1: 20, median: 27, q3: 38, max: 49 },
1277
- ]}
1278
- valueFormat={(v) => `${v}ms`}
1279
- />
1280
- ```
1281
-
1282
- #### BubbleChart
1283
-
1284
- A dependency-free SVG bubble chart — a ScatterChart preset that sizes each dot by a third value (z) across two nice-scaled numeric axes. Reach for it when you need to show a third dimension (volume, revenue, weight) on top of an x/y relationship.
1285
-
1286
- `import { BubbleChart } from "twico-ui"`
1287
-
1288
- Props:
1289
- - `series` — `ScatterSeries[]` · **required** — The series to plot; each has an optional name/color and a list of { x, y, z?, label? } points.
1290
- - `bubble` — `boolean` · default `true` — Size the dots by their z value; on by default for BubbleChart, and also auto-enabled when any point has a numeric z.
1291
- - `maxBubble` — `number` · default `26` — Maximum bubble radius in pixels — the largest z value maps to this radius, with area scaling as radius ∝ √z.
1292
- - `dotRadius` — `number` · default `4.5` — Fixed dot radius in pixels used when bubble sizing is turned off.
1293
- - `height` — `number` · default `300` — Pixel height of the chart, which also sets the SVG aspect ratio so dots stay round.
1294
- - `xLabel` — `React.ReactNode` — Axis title drawn beneath the x axis.
1295
- - `yLabel` — `React.ReactNode` — Axis title drawn, rotated, beside the y axis.
1296
- - `showGrid` — `boolean` · default `true` — Whether to render the background grid lines behind the plotted points.
1297
- - `showLegend` — `boolean` · default `true when >1 series` — Whether to show the series legend; defaults on when there is more than one series.
1298
- - `xFormat` — `(value: number) => string` — Formatter for x values in tooltips and the hidden table; defaults to valueFormat.
1299
- - `yFormat` — `(value: number) => string` — Formatter for y values in tooltips and the hidden table; defaults to valueFormat.
1300
- - `valueFormat` — `(value: number) => string` — Fallback value formatter for x/y/z, using locale-grouped numbers by default.
1301
- - `ariaLabel` — `string` · default `"bubble chart"` — Accessible name for the chart's role="img" SVG; per-point values are exposed via the hidden data table instead.
1302
- - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
1303
- - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
1304
-
1305
- ```jsx
1306
- import { BubbleChart } from "twico-ui";
1307
-
1308
- <BubbleChart
1309
- series={[
1310
- { name: "Plans", points: [
1311
- { x: 12, y: 40, z: 800, label: "Starter" },
1312
- { x: 26, y: 65, z: 2400, label: "Team" },
1313
- { x: 48, y: 82, z: 5200, label: "Business" },
1314
- ] },
1315
- ]}
1316
- xLabel="Seats"
1317
- yLabel="Satisfaction"
1318
- />
1319
- ```
1320
-
1321
- #### Candlestick
1322
-
1323
- An OHLC candlestick chart that draws one candle per period — a high→low wick and an open→close body colored by direction — as dependency-free inline SVG. Reach for it to visualize price or range data over time; use Chart for bars, lines and areas.
1324
-
1325
- `import { Candlestick } from "twico-ui"`
1326
-
1327
- Props:
1328
- - `data` — `CandlestickDatum[]` · **required** — OHLC data points, one candle each ({ label, open, high, low, close }), given in chronological order.
1329
- - `upColor` — `string` · default `"var(--color-success)"` — Color for up candles where close is greater than or equal to open, accepting any CSS color.
1330
- - `downColor` — `string` · default `"var(--color-danger)"` — Color for down candles where close is less than open, accepting any CSS color.
1331
- - `height` — `number` · default `300` — Pixel height of the chart; the width always fills the container at 100 percent.
1332
- - `showGrid` — `boolean` · default `true` — Whether to draw the horizontal value grid lines behind the candles.
1333
- - `showAxis` — `boolean` · default `true` — Whether to render the value axis and the category (x) labels, which thin out automatically when dense.
1334
- - `valueFormat` — `(value: number) => string` · default `toLocaleString` — Formats values in the per-candle tooltip and the hidden data-table cells.
1335
- - `ariaLabel` — `string` · default `"candlestick chart"` — Accessible name for the chart's SVG role="img"; aria-label is also accepted as an alternative.
1336
- - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
1337
- - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
1338
-
1339
- ```jsx
1340
- import { Candlestick } from "twico-ui";
1341
-
1342
- <Candlestick
1343
- valueFormat={(v) => `$${v}`}
1344
- data={[
1345
- { label: "Mon", open: 132, high: 138, low: 130, close: 136 },
1346
- { label: "Tue", open: 136, high: 141, low: 134, close: 135 },
1347
- { label: "Wed", open: 135, high: 137, low: 128, close: 129 },
1348
- ]}
1349
- />
1350
- ```
1351
-
1352
1252
  #### Card
1353
1253
 
1354
1254
  Card is a surface container for grouping related content, with an optional header (title/subtitle), body, and footer. Use it to present grouped information such as stats, summaries, or actions, optionally making it interactive with a hover-lift effect.
@@ -1410,50 +1310,6 @@ import { Carousel } from "twico-ui";
1410
1310
  </Carousel>
1411
1311
  ```
1412
1312
 
1413
- #### Chart
1414
-
1415
- A lightweight, dependency-free SVG chart that renders bar or line graphs (single or multi-series) with grid, axes, animated entrance, tooltips, and an optional legend. Use it to visualize small datasets like daily metrics or trends without pulling in a charting library.
1416
-
1417
- `import { Chart } from "twico-ui"`
1418
-
1419
- Props:
1420
- - `type` — `"bar" | "line"` · default `"bar"` — Selects the rendering style, drawing the data as grouped bars or as connected lines for trends over time.
1421
- - `data` — `ChartDatum[]` · **required** — Supplies the array of data points, each carrying a label plus one numeric field for every named series.
1422
- - `series` — `string[]` · default `["value"]` — Names the numeric fields to plot, where multiple keys yield grouped bars or multiple lines per data point.
1423
- - `height` — `number` · default `220` — Sets the chart's pixel height, controlling its vertical footprint while it scales horizontally to its container.
1424
- - `showGrid` — `boolean` · default `true` — Draws horizontal grid lines behind the data, on by default, to make values easier to read against the scale.
1425
- - `showAxis` — `boolean` · default `true` — Renders axis tick marks and label text, enabled by default, so viewers can map plotted values to categories.
1426
- - `showLegend` — `boolean` · default `false` — Displays a legend keying each series to its color, off by default and most useful when plotting multiple series.
1427
- - `valueFormat` — `(value: number) => string` — Formats raw numeric values into display strings for tooltips, letting you add units, separators, or currency symbols.
1428
- - `colors` — `string[]` · default `built-in token palette` — Per-series colors (any CSS color), cycled when shorter than series.
1429
- - `showValues` — `boolean` · default `false` — Print each value as a small data label on the bars or points.
1430
- - `animate` — `boolean` · default `true` — Play the entrance animation (bars grow, lines draw); respects prefers-reduced-motion.
1431
- - `ariaLabel` — `string` — Accessible name for the chart's <svg role="img">; defaults to a description of the chart type.
1432
-
1433
- ```jsx
1434
- import { Chart } from "twico-ui";
1435
-
1436
- <Chart
1437
- type="bar"
1438
- data={[
1439
- { label: "Mon", value: 240 },
1440
- { label: "Tue", value: 310 },
1441
- { label: "Wed", value: 280 },
1442
- ]}
1443
- valueFormat={(v) => `$${v}`}
1444
- />
1445
-
1446
- <Chart
1447
- type="line"
1448
- series={["signups", "active"]}
1449
- showLegend
1450
- data={[
1451
- { label: "Jan", signups: 120, active: 80 },
1452
- { label: "Feb", signups: 180, active: 140 },
1453
- ]}
1454
- />
1455
- ```
1456
-
1457
1313
  #### Datatable
1458
1314
 
1459
1315
  Datatable is an advanced, MUI Data Grid-style data table with sortable, filterable, hideable, pinnable, reorderable, and resizable columns, plus a toolbar, density control, multi-format export, optional checkbox selection with batch actions, an actions column, pagination, and a skeleton loading state. Use it to display large tabular datasets that need interactive sorting, filtering, grouping, aggregation, or a server-side mode where only the current page is loaded.
@@ -1579,31 +1435,400 @@ export default function Example() {
1579
1435
  },
1580
1436
  ];
1581
1437
 
1582
- // Actions for the toolbar that replaces the header when one or more rows are ticked.
1583
- // (A built-in "Edit" button is added automatically because some columns are editable.)
1584
- const batchActions = [
1585
- { label: "Export", icon: <Download />, onClick: (keys, selected, clear) => clear() },
1586
- { label: "Email", icon: <Mail />, onClick: (keys, selected, clear) => { console.log(selected); clear(); } },
1587
- { label: "Delete", icon: <Trash />, danger: true, onClick: (keys, selected, clear) => { setRows((d) => d.filter((r) => !keys.includes(r.id))); clear(); } },
1588
- ];
1438
+ // Actions for the toolbar that replaces the header when one or more rows are ticked.
1439
+ // (A built-in "Edit" button is added automatically because some columns are editable.)
1440
+ const batchActions = [
1441
+ { label: "Export", icon: <Download />, onClick: (keys, selected, clear) => clear() },
1442
+ { label: "Email", icon: <Mail />, onClick: (keys, selected, clear) => { console.log(selected); clear(); } },
1443
+ { label: "Delete", icon: <Trash />, danger: true, onClick: (keys, selected, clear) => { setRows((d) => d.filter((r) => !keys.includes(r.id))); clear(); } },
1444
+ ];
1445
+
1446
+ return (
1447
+ <Datatable
1448
+ columns={columns}
1449
+ rows={rows}
1450
+ checkboxSelection
1451
+ rowNumbers
1452
+ batchActions={batchActions}
1453
+ onRowUpdate={(updated) => setRows((d) => d.map((r) => (r.id === updated.id ? updated : r)))}
1454
+ onBatchUpdate={(changed) => setRows((d) => d.map((r) => changed.find((c) => c.id === r.id) || r))}
1455
+ showAggregation
1456
+ showDensity
1457
+ showExport
1458
+ rowPinning
1459
+ pageSize={10}
1460
+ />
1461
+ );
1462
+ }
1463
+ ```
1464
+
1465
+ #### Kanban
1466
+
1467
+ Kanban is a drag-and-drop board that arranges cards into columns you can drag between. Use it for visualizing and reorganizing work items (tasks, tickets, stages) by status, either controlled via cards + onCardMove or uncontrolled.
1468
+
1469
+ `import { Kanban } from "twico-ui"`
1470
+
1471
+ Props:
1472
+ - `columns` — `KanbanColumn[] ({ id: string; title: React.ReactNode; color?: string })` · **required** — Defines the board columns, each with an id matching cards' column field, a title, and an optional heading dot color.
1473
+ - `cards` — `KanbanCard[] ({ id; column; title?; description?; tags?; footer?; ... })` · **required** — Supplies the cards to render, each assigned to a column via its column field and carrying title, description, and tags.
1474
+ - `onCardMove` — `(cardId: string, toColumn: string, nextCards: KanbanCard[]) => void` — Fires when a card is dropped into a different column, passing the card id, target column, and updated card list.
1475
+ - `renderCard` — `(card: KanbanCard) => React.ReactNode` — Overrides the default card contents with a custom renderer, falling back to title, description, tags, and footer.
1476
+ - `defaultCards` — `KanbanCard[]` · default `[]` — Initial cards when uncontrolled (the board applies moves internally).
1477
+
1478
+ ```jsx
1479
+ import { Kanban } from "twico-ui";
1480
+
1481
+ <Kanban
1482
+ columns={[
1483
+ { id: "todo", title: "To do", color: "var(--slate-400)" },
1484
+ { id: "doing", title: "In progress", color: "var(--amber-500)" },
1485
+ { id: "done", title: "Done", color: "var(--emerald-500)" },
1486
+ ]}
1487
+ cards={[
1488
+ { id: "1", column: "todo", title: "Design tokens", tags: ["Design"] },
1489
+ { id: "2", column: "doing", title: "Datatable filters" },
1490
+ { id: "3", column: "done", title: "Ship release" },
1491
+ ]}
1492
+ onCardMove={(id, to) => {}}
1493
+ />
1494
+ ```
1495
+
1496
+ #### List
1497
+
1498
+ List renders a vertical stack of rows with optional leading/trailing slots, a title, and a description. Use it for compact data displays like people, files, or settings, where rows can be static, links, or buttons.
1499
+
1500
+ `import { List } from "twico-ui"`
1501
+
1502
+ Props:
1503
+ - `items` — `ListItemData[]` · **required** — Provides the rows to render, each with a title plus optional description, leading, trailing, onClick, href, and active fields.
1504
+ - `plain` — `boolean` · default `false` — Drops the card chrome to render borderless, transparent rows when set to true; defaults to false for the boxed style.
1505
+ - `emptyMessage` — `React.ReactNode` · default `"Nothing here yet"` — Shown as a centered zero-state row when items is empty, so an empty list reads as intentional rather than broken.
1506
+
1507
+ ```jsx
1508
+ import { List } from "twico-ui";
1509
+
1510
+ <List
1511
+ items={[
1512
+ { title: "Ada Park", description: "ada@twico.dev", trailing: "Active", onClick: () => {} },
1513
+ { title: "report.pdf", description: "2.4 MB", trailing: "Today" },
1514
+ ]}
1515
+ />
1516
+ ```
1517
+
1518
+ #### Pagination
1519
+
1520
+ Pagination renders page navigation with prev/next buttons and smart ellipsis truncation, keeping boundary and sibling pages visible. Use it to let users move through paged data (tables, lists, search results), optionally with a "Go to" page jumper.
1521
+
1522
+ `import { Pagination } from "twico-ui"`
1523
+
1524
+ Props:
1525
+ - `page` — `number` · default `1` — The currently active 1-based page number, used to highlight the active button and compute which pages to show.
1526
+ - `total` — `number` · **required** — Total number of pages available, determining the range of page buttons and when ellipsis truncation appears.
1527
+ - `onChange` — `(page: number) => void` — Fires with the destination page number whenever the user clicks a page, prev, next, or jumper control.
1528
+ - `siblings` — `number` · default `1` — Number of adjacent page buttons rendered on each side of the current page before ellipsis truncation kicks in.
1529
+ - `boundaries` — `number` · default `1` — Number of page buttons always kept visible at each end so the first and last pages stay reachable.
1530
+ - `size` — `"sm" | "md"` · default `"md"` — Sets the control density, sm or md, scaling button height and spacing to match the surrounding layout.
1531
+ - `showJumper` — `boolean` · default `false` — Adds a "Go to" number input so users can jump directly to a specific page instead of clicking through.
1532
+ - `jumperLabel` — `React.ReactNode` · default `"Go to"` — Text or node rendered before the jumper input, defaulting to "Go to", to clarify what the field does.
1533
+ - `getPageLabel` — `(page: number) => string` · default `(n) => `Page ${n}`` — Accessible label for each numbered page button, so screen readers announce "Page 3" rather than a bare number; override for i18n.
1534
+ - `defaultPage` — `number` · default `1` — Initial 1-based page when uncontrolled (no `page` prop).
1535
+ - `showPageJumper` — `boolean` · default `false` — Show a "Go to" page input for jumping directly to a page; preferred alias for showJumper.
1536
+
1537
+ ```jsx
1538
+ import { Pagination } from "twico-ui";
1539
+
1540
+ const [page, setPage] = useState(1);
1541
+
1542
+ <Pagination
1543
+ page={page}
1544
+ total={12}
1545
+ onChange={setPage}
1546
+ showJumper
1547
+ />
1548
+ ```
1549
+
1550
+ #### Stat
1551
+
1552
+ Stat is a KPI / metric card that displays a label, a large value, and optional icon, trend delta, and help text. Use it on dashboards or summary panels to surface a single key metric with its trend direction.
1553
+
1554
+ `import { Stat } from "twico-ui"`
1555
+
1556
+ Props:
1557
+ - `label` — `React.ReactNode` · **required** — Renders the metric's caption shown above the value, naming what the number represents such as "Revenue".
1558
+ - `value` — `React.ReactNode` · **required** — Renders the large primary metric value that anchors the card, like a count, currency amount, or percentage.
1559
+ - `icon` — `React.ReactNode` — Renders an optional icon in a tinted tile at the top-right corner to visually reinforce the metric's meaning.
1560
+ - `delta` — `React.ReactNode` — Shows the trend change beside the value, such as "+12.5%" or "-3%", to convey movement over a period.
1561
+ - `deltaDirection` — `"up" | "down" | "flat"` — Forces the delta's direction and color (up, down, or flat); otherwise it is inferred from a leading minus sign.
1562
+ - `helpText` — `React.ReactNode` — Renders muted context after the delta, such as "vs last month", to clarify the comparison period.
1563
+ - `plain` — `boolean` · default `false` — Strips the card chrome (border, background, and padding) so the stat blends into an existing surface.
1564
+
1565
+ ```jsx
1566
+ import { Stat } from "twico-ui";
1567
+
1568
+ <Stat
1569
+ label="Revenue"
1570
+ value="$48,200"
1571
+ delta="+12.5%"
1572
+ helpText="vs last month"
1573
+ />
1574
+ <Stat
1575
+ label="Churn"
1576
+ value="2.1%"
1577
+ delta="-0.4%"
1578
+ deltaDirection="up"
1579
+ helpText="improved"
1580
+ />
1581
+ ```
1582
+
1583
+ #### Table
1584
+
1585
+ A data table with a styled header, hover and zebra-striped rows, client-side click-to-sort headers, custom cell renderers, and selected-row highlighting. Use it to display structured rows of data when you need lightweight sorting and per-column rendering or alignment.
1586
+
1587
+ `import { Table } from "twico-ui"`
1588
+
1589
+ Props:
1590
+ - `columns` — `TableColumn<T>[]` · **required** — Defines each column with key, header, optional align, width, sortable flag, and a custom render function for cell content.
1591
+ - `hover` — `boolean` · default `true` — Highlights the row under the cursor on mouse-over, on by default to aid scanning and pointing at dense rows.
1592
+ - `striped` — `boolean` · default `false` — Applies zebra striping to alternating rows when enabled, improving readability across wide tables of similar-looking data.
1593
+ - `size` — `"sm" | "md"` · default `"md"` — Controls cell padding density, choosing sm for compact rows or md for the default roomier spacing.
1594
+ - `sortable` — `boolean` · default `false` — Enables client-side click-to-sort headers when true, letting users reorder rows by any column marked sortable.
1595
+ - `rowKey` — `(row: T, index: number) => string | number` — Returns a stable unique key for each row from its data and index, defaulting to the row index.
1596
+ - `selectedKeys` — `Array<string | number>` — Lists the keys of rows to render with selected-row highlighting, useful for marking chosen or active records.
1597
+ - `sort` — `TableSort | null` — Controlled sort state — pair with onSortChange (null = unsorted).
1598
+ - `defaultSort` — `TableSort` · default `{ key: null, dir: "asc" }` — Initial sort when uncontrolled.
1599
+ - `onSortChange` — `(sort: TableSort) => void` — Fired when a sortable header is clicked with the next sort state.
1600
+ - `stickyHeader` — `boolean` · default `false` — Pin the header to the top while the body scrolls (use with maxHeight or an enclosing scroll container).
1601
+ - `maxHeight` — `number | string` — Cap the table height and give it its own vertical scroll area (CSS length or number of px); enables stickyHeader to shine.
1602
+ - `loading` — `boolean` · default `false` — Renders shimmering skeleton rows instead of data and sets aria-busy, avoiding a flash-of-empty during fetches.
1603
+ - `loadingRows` — `number` · default `8` — Number of skeleton rows to show while loading is true.
1604
+ - `emptyMessage` — `React.ReactNode` · default `"No data"` — Rendered as a single full-width row when rows is empty instead of a bare header over a blank body.
1605
+ - `ariaLabel` — `string` — Accessible name applied to the <table> itself (not the wrapper div); a raw aria-label prop takes precedence over it.
1606
+ - `caption` — `React.ReactNode` — Renders a visually-hidden <caption> naming the table for assistive technology.
1607
+ - `rows` — `T[]` — Row objects.
1608
+ - `field (column)` — `string` — Alias for key (Datatable vocabulary); key wins when both are set.
1609
+ - `headerName (column)` — `React.ReactNode` — Alias for header (Datatable vocabulary); header wins when both are set.
1610
+ - `renderCell (column)` — `(value: any, row: T, index: number) => React.ReactNode` — Alias for render (Datatable vocabulary); render wins when both are set.
1611
+
1612
+ ```jsx
1613
+ import { Table } from "twico-ui";
1614
+
1615
+ const users = [
1616
+ { id: 1, name: "Ava Stone", role: "Admin", status: "Active", mrr: 480 },
1617
+ { id: 2, name: "Liam Reed", role: "Editor", status: "Invited", mrr: 120 },
1618
+ { id: 3, name: "Noah Park", role: "Viewer", status: "Active", mrr: 60 },
1619
+ ];
1620
+
1621
+ <Table
1622
+ sortable
1623
+ striped
1624
+ rowKey={(r) => r.id}
1625
+ columns={[
1626
+ { field: "name", headerName: "Name" },
1627
+ { field: "role", headerName: "Role" },
1628
+ { field: "status", headerName: "Status" },
1629
+ { field: "mrr", headerName: "MRR", align: "right" },
1630
+ ]}
1631
+ rows={users}
1632
+ />
1633
+ ```
1634
+
1635
+ #### Tag
1636
+
1637
+ Tag is a removable chip for displaying filters, selected items, or keywords. Use it when you need compact, dismissible labels with an optional leading icon and an optional remove (×) button.
1638
+
1639
+ `import { Tag } from "twico-ui"`
1640
+
1641
+ Props:
1642
+ - `onRemove` — `(e: React.MouseEvent<HTMLButtonElement>) => void` — Renders the remove (×) button and handles its click, letting users dismiss the tag as a filter or selection.
1643
+ - `variant` — `"soft" | "solid" | "outline"` · default `"soft"` — Chooses the fill style between soft, solid, and outline to control how prominently the tag reads.
1644
+ - `tone` — `"neutral" | "primary" | "success" | "warning" | "danger" | "info"` · default `"neutral"` — Sets the semantic color from six options like success or danger; defaults to neutral (the classic chip).
1645
+ - `leftIcon` — `React.ReactNode` — Renders an optional leading icon before the label, useful for signaling the tag's category or status.
1646
+ - `children` — `React.ReactNode` — Provides the tag's label content, typically the filter name, selected item, or keyword being displayed.
1647
+
1648
+ ```jsx
1649
+ import { Tag } from "twico-ui";
1650
+
1651
+ <Tag onRemove={() => {}}>React</Tag>
1652
+ <Tag leftIcon={<span>#</span>}>design-system</Tag>
1653
+ <Tag>read-only</Tag>
1654
+ ```
1655
+
1656
+ #### Timeline
1657
+
1658
+ Timeline renders a vertical list of events as node dots connected by a rail, each showing a title, optional timestamp, and description. Use it for activity feeds, order tracking, or history views.
1659
+
1660
+ `import { Timeline } from "twico-ui"`
1661
+
1662
+ Props:
1663
+ - `items` — `TimelineItem[] — { title, time?, description?, icon?, tone? }` · **required** — Array of events to render as connected node dots, each with a title, optional time, description, icon, and primary/success/warning/danger tone.
1664
+ - `className` — `string` · default `""` — Extra CSS class appended to the root <ul> so you can layer custom spacing or styling onto the timeline.
1665
+ - `tone (TimelineItem)` — `"primary" | "info" | "success" | "warning" | "danger"` — Added `info` value to the per-item node tone union; maps the dot to var(--color-info) with var(--color-info-fg) icon color.
1666
+
1667
+ ```jsx
1668
+ import { Timeline } from "twico-ui";
1669
+
1670
+ <Timeline
1671
+ items={[
1672
+ { title: "Order placed", time: "9:41 AM", description: "We received your order.", tone: "primary" },
1673
+ { title: "Shipped", time: "2:10 PM", description: "Left the warehouse.", tone: "success" },
1674
+ { title: "Out for delivery", time: "Tomorrow" },
1675
+ ]}
1676
+ />
1677
+ ```
1678
+
1679
+ ### Charts
1680
+
1681
+ #### Boxplot
1682
+
1683
+ A dependency-free inline-SVG box-and-whisker chart that draws one box per category from a five-number summary (min, Q1, median, Q3, max) with whiskers and optional outlier points. Reach for it to compare the spread, skew, and outliers of distributions across groups where a bar or line chart would hide the shape of the data.
1684
+
1685
+ `import { Boxplot } from "twico-ui"`
1686
+
1687
+ Props:
1688
+ - `data` — `BoxplotDatum[]` · **required** — The boxes to plot, one per category, each a five-number summary with an optional array of outlier values.
1689
+ - `color` — `string` · default `"var(--color-primary)"` — Box fill and stroke accent, accepting any CSS color including a design token reference.
1690
+ - `height` — `number` · default `300` — Pixel height of the chart; the width fills its container at 100%.
1691
+ - `showGrid` — `boolean` · default `true` — Whether to draw horizontal grid lines at the value axis ticks behind the boxes.
1692
+ - `showAxis` — `boolean` · default `true` — Whether to render the value axis and the category labels under each box.
1693
+ - `valueFormat` — `(value: number) => string` · default `toLocaleString` — Formatter applied to values in the per-box tooltip and the hidden data table.
1694
+ - `ariaLabel` — `string` · default `"box plot"` — Accessible name for the chart's role="img" SVG; per-box values are exposed via the hidden data table.
1695
+ - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden data table as an accessible text alternative for screen readers (WCAG 1.1.1).
1696
+ - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
1697
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1698
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1699
+
1700
+ ```jsx
1701
+ import { Boxplot } from "twico-ui";
1702
+
1703
+ <Boxplot
1704
+ data={[
1705
+ { label: "API", min: 12, q1: 24, median: 33, q3: 42, max: 58, outliers: [72] },
1706
+ { label: "Web", min: 18, q1: 30, median: 41, q3: 52, max: 66 },
1707
+ { label: "Cache", min: 8, q1: 20, median: 27, q3: 38, max: 49 },
1708
+ ]}
1709
+ valueFormat={(v) => `${v}ms`}
1710
+ />
1711
+ ```
1712
+
1713
+ #### BubbleChart
1714
+
1715
+ A dependency-free SVG bubble chart — a ScatterChart preset that sizes each dot by a third value (z) across two nice-scaled numeric axes. Reach for it when you need to show a third dimension (volume, revenue, weight) on top of an x/y relationship.
1716
+
1717
+ `import { BubbleChart } from "twico-ui"`
1718
+
1719
+ Props:
1720
+ - `series` — `ScatterSeries[]` · **required** — The series to plot; each has an optional name/color and a list of { x, y, z?, label? } points.
1721
+ - `bubble` — `boolean` · default `true` — Size the dots by their z value; on by default for BubbleChart, and also auto-enabled when any point has a numeric z.
1722
+ - `maxBubble` — `number` · default `26` — Maximum bubble radius in pixels — the largest z value maps to this radius, with area scaling as radius ∝ √z.
1723
+ - `dotRadius` — `number` · default `4.5` — Fixed dot radius in pixels used when bubble sizing is turned off.
1724
+ - `height` — `number` · default `300` — Pixel height of the chart, which also sets the SVG aspect ratio so dots stay round.
1725
+ - `xLabel` — `React.ReactNode` — Axis title drawn beneath the x axis.
1726
+ - `yLabel` — `React.ReactNode` — Axis title drawn, rotated, beside the y axis.
1727
+ - `showGrid` — `boolean` · default `true` — Whether to render the background grid lines behind the plotted points.
1728
+ - `showLegend` — `boolean` · default `true when >1 series` — Whether to show the series legend; defaults on when there is more than one series.
1729
+ - `xFormat` — `(value: number) => string` — Formatter for x values in tooltips and the hidden table; defaults to valueFormat.
1730
+ - `yFormat` — `(value: number) => string` — Formatter for y values in tooltips and the hidden table; defaults to valueFormat.
1731
+ - `valueFormat` — `(value: number) => string` — Fallback value formatter for x/y/z, using locale-grouped numbers by default.
1732
+ - `ariaLabel` — `string` · default `"bubble chart"` — Accessible name for the chart's role="img" SVG; per-point values are exposed via the hidden data table instead.
1733
+ - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
1734
+ - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
1735
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1736
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1737
+
1738
+ ```jsx
1739
+ import { BubbleChart } from "twico-ui";
1740
+
1741
+ <BubbleChart
1742
+ series={[
1743
+ { name: "Plans", points: [
1744
+ { x: 12, y: 40, z: 800, label: "Starter" },
1745
+ { x: 26, y: 65, z: 2400, label: "Team" },
1746
+ { x: 48, y: 82, z: 5200, label: "Business" },
1747
+ ] },
1748
+ ]}
1749
+ xLabel="Seats"
1750
+ yLabel="Satisfaction"
1751
+ />
1752
+ ```
1753
+
1754
+ #### Candlestick
1755
+
1756
+ An OHLC candlestick chart that draws one candle per period — a high→low wick and an open→close body colored by direction — as dependency-free inline SVG. Reach for it to visualize price or range data over time; use Chart for bars, lines and areas.
1757
+
1758
+ `import { Candlestick } from "twico-ui"`
1759
+
1760
+ Props:
1761
+ - `data` — `CandlestickDatum[]` · **required** — OHLC data points, one candle each ({ label, open, high, low, close }), given in chronological order.
1762
+ - `upColor` — `string` · default `"var(--color-success)"` — Color for up candles where close is greater than or equal to open, accepting any CSS color.
1763
+ - `downColor` — `string` · default `"var(--color-danger)"` — Color for down candles where close is less than open, accepting any CSS color.
1764
+ - `height` — `number` · default `300` — Pixel height of the chart; the width always fills the container at 100 percent.
1765
+ - `showGrid` — `boolean` · default `true` — Whether to draw the horizontal value grid lines behind the candles.
1766
+ - `showAxis` — `boolean` · default `true` — Whether to render the value axis and the category (x) labels, which thin out automatically when dense.
1767
+ - `valueFormat` — `(value: number) => string` · default `toLocaleString` — Formats values in the per-candle tooltip and the hidden data-table cells.
1768
+ - `ariaLabel` — `string` · default `"candlestick chart"` — Accessible name for the chart's SVG role="img"; aria-label is also accepted as an alternative.
1769
+ - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
1770
+ - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
1771
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1772
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1773
+
1774
+ ```jsx
1775
+ import { Candlestick } from "twico-ui";
1776
+
1777
+ <Candlestick
1778
+ valueFormat={(v) => `$${v}`}
1779
+ data={[
1780
+ { label: "Mon", open: 132, high: 138, low: 130, close: 136 },
1781
+ { label: "Tue", open: 136, high: 141, low: 134, close: 135 },
1782
+ { label: "Wed", open: 135, high: 137, low: 128, close: 129 },
1783
+ ]}
1784
+ />
1785
+ ```
1786
+
1787
+ #### Chart
1788
+
1789
+ A lightweight, dependency-free SVG chart that renders bar or line graphs (single or multi-series) with grid, axes, animated entrance, tooltips, and an optional legend. Use it to visualize small datasets like daily metrics or trends without pulling in a charting library.
1790
+
1791
+ `import { Chart } from "twico-ui"`
1792
+
1793
+ Props:
1794
+ - `type` — `"bar" | "line"` · default `"bar"` — Selects the rendering style, drawing the data as grouped bars or as connected lines for trends over time.
1795
+ - `data` — `ChartDatum[]` · **required** — Supplies the array of data points, each carrying a label plus one numeric field for every named series.
1796
+ - `series` — `string[]` · default `["value"]` — Names the numeric fields to plot, where multiple keys yield grouped bars or multiple lines per data point.
1797
+ - `height` — `number` · default `220` — Sets the chart's pixel height, controlling its vertical footprint while it scales horizontally to its container.
1798
+ - `showGrid` — `boolean` · default `true` — Draws horizontal grid lines behind the data, on by default, to make values easier to read against the scale.
1799
+ - `showAxis` — `boolean` · default `true` — Renders axis tick marks and label text, enabled by default, so viewers can map plotted values to categories.
1800
+ - `showLegend` — `boolean` · default `false` — Displays a legend keying each series to its color, off by default and most useful when plotting multiple series.
1801
+ - `valueFormat` — `(value: number) => string` — Formats raw numeric values into display strings for tooltips, letting you add units, separators, or currency symbols.
1802
+ - `colors` — `string[]` · default `built-in token palette` — Per-series colors (any CSS color), cycled when shorter than series.
1803
+ - `showValues` — `boolean` · default `false` — Print each value as a small data label on the bars or points.
1804
+ - `animate` — `boolean` · default `true` — Play the entrance animation (bars grow, lines draw); respects prefers-reduced-motion.
1805
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1806
+ - `crosshair` — `boolean` · default `true` — Show a vertical crosshair guide line at the hovered category on line/area/vertical-bar charts.
1807
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1808
+ - `ariaLabel` — `string` — Accessible name for the chart's <svg role="img">; defaults to a description of the chart type.
1809
+
1810
+ ```jsx
1811
+ import { Chart } from "twico-ui";
1812
+
1813
+ <Chart
1814
+ type="bar"
1815
+ data={[
1816
+ { label: "Mon", value: 240 },
1817
+ { label: "Tue", value: 310 },
1818
+ { label: "Wed", value: 280 },
1819
+ ]}
1820
+ valueFormat={(v) => `$${v}`}
1821
+ />
1589
1822
 
1590
- return (
1591
- <Datatable
1592
- columns={columns}
1593
- rows={rows}
1594
- checkboxSelection
1595
- rowNumbers
1596
- batchActions={batchActions}
1597
- onRowUpdate={(updated) => setRows((d) => d.map((r) => (r.id === updated.id ? updated : r)))}
1598
- onBatchUpdate={(changed) => setRows((d) => d.map((r) => changed.find((c) => c.id === r.id) || r))}
1599
- showAggregation
1600
- showDensity
1601
- showExport
1602
- rowPinning
1603
- pageSize={10}
1604
- />
1605
- );
1606
- }
1823
+ <Chart
1824
+ type="line"
1825
+ series={["signups", "active"]}
1826
+ showLegend
1827
+ data={[
1828
+ { label: "Jan", signups: 120, active: 80 },
1829
+ { label: "Feb", signups: 180, active: 140 },
1830
+ ]}
1831
+ />
1607
1832
  ```
1608
1833
 
1609
1834
  #### DonutChart
@@ -1627,6 +1852,7 @@ Props:
1627
1852
  - `ariaLabel` — `string` · default `"donut chart"` — Accessible name for the <svg role="img">; per-slice values live in the hidden data table, not this label.
1628
1853
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
1629
1854
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
1855
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1630
1856
 
1631
1857
  ```jsx
1632
1858
  import { DonutChart } from "twico-ui";
@@ -1662,6 +1888,7 @@ Props:
1662
1888
  - `ariaLabel` — `string` · default `"funnel chart"` — Accessible name for the chart's `<svg role="img">`; also accepts `aria-label`, with per-stage values in the hidden table.
1663
1889
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative (WCAG 1.1.1).
1664
1890
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
1891
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1665
1892
 
1666
1893
  ```jsx
1667
1894
  import { FunnelChart } from "twico-ui";
@@ -1707,6 +1934,7 @@ Props:
1707
1934
  - `ariaLabel` — `string` — Accessible name for the SVG role="img"; defaults to a value summary and also accepts aria-label.
1708
1935
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative per WCAG 1.1.1.
1709
1936
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the gauge's accessible label.
1937
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1710
1938
 
1711
1939
  ```jsx
1712
1940
  import { Gauge } from "twico-ui";
@@ -1742,6 +1970,8 @@ Props:
1742
1970
  - `ariaLabel` — `string` · default `"heatmap"` — Accessible name for the chart's SVG role="img"; also accepts aria-label, with per-cell values exposed via the hidden table.
1743
1971
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative (WCAG 1.1.1).
1744
1972
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
1973
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1974
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1745
1975
 
1746
1976
  ```jsx
1747
1977
  import { Heatmap } from "twico-ui";
@@ -1758,91 +1988,6 @@ import { Heatmap } from "twico-ui";
1758
1988
  <Heatmap showValues colorScale="var(--emerald-500)" valueFormat={(v) => `${v}%`} data={cells} />
1759
1989
  ```
1760
1990
 
1761
- #### Kanban
1762
-
1763
- Kanban is a drag-and-drop board that arranges cards into columns you can drag between. Use it for visualizing and reorganizing work items (tasks, tickets, stages) by status, either controlled via cards + onCardMove or uncontrolled.
1764
-
1765
- `import { Kanban } from "twico-ui"`
1766
-
1767
- Props:
1768
- - `columns` — `KanbanColumn[] ({ id: string; title: React.ReactNode; color?: string })` · **required** — Defines the board columns, each with an id matching cards' column field, a title, and an optional heading dot color.
1769
- - `cards` — `KanbanCard[] ({ id; column; title?; description?; tags?; footer?; ... })` · **required** — Supplies the cards to render, each assigned to a column via its column field and carrying title, description, and tags.
1770
- - `onCardMove` — `(cardId: string, toColumn: string, nextCards: KanbanCard[]) => void` — Fires when a card is dropped into a different column, passing the card id, target column, and updated card list.
1771
- - `renderCard` — `(card: KanbanCard) => React.ReactNode` — Overrides the default card contents with a custom renderer, falling back to title, description, tags, and footer.
1772
- - `defaultCards` — `KanbanCard[]` · default `[]` — Initial cards when uncontrolled (the board applies moves internally).
1773
-
1774
- ```jsx
1775
- import { Kanban } from "twico-ui";
1776
-
1777
- <Kanban
1778
- columns={[
1779
- { id: "todo", title: "To do", color: "var(--slate-400)" },
1780
- { id: "doing", title: "In progress", color: "var(--amber-500)" },
1781
- { id: "done", title: "Done", color: "var(--emerald-500)" },
1782
- ]}
1783
- cards={[
1784
- { id: "1", column: "todo", title: "Design tokens", tags: ["Design"] },
1785
- { id: "2", column: "doing", title: "Datatable filters" },
1786
- { id: "3", column: "done", title: "Ship release" },
1787
- ]}
1788
- onCardMove={(id, to) => {}}
1789
- />
1790
- ```
1791
-
1792
- #### List
1793
-
1794
- List renders a vertical stack of rows with optional leading/trailing slots, a title, and a description. Use it for compact data displays like people, files, or settings, where rows can be static, links, or buttons.
1795
-
1796
- `import { List } from "twico-ui"`
1797
-
1798
- Props:
1799
- - `items` — `ListItemData[]` · **required** — Provides the rows to render, each with a title plus optional description, leading, trailing, onClick, href, and active fields.
1800
- - `plain` — `boolean` · default `false` — Drops the card chrome to render borderless, transparent rows when set to true; defaults to false for the boxed style.
1801
- - `emptyMessage` — `React.ReactNode` · default `"Nothing here yet"` — Shown as a centered zero-state row when items is empty, so an empty list reads as intentional rather than broken.
1802
-
1803
- ```jsx
1804
- import { List } from "twico-ui";
1805
-
1806
- <List
1807
- items={[
1808
- { title: "Ada Park", description: "ada@twico.dev", trailing: "Active", onClick: () => {} },
1809
- { title: "report.pdf", description: "2.4 MB", trailing: "Today" },
1810
- ]}
1811
- />
1812
- ```
1813
-
1814
- #### Pagination
1815
-
1816
- Pagination renders page navigation with prev/next buttons and smart ellipsis truncation, keeping boundary and sibling pages visible. Use it to let users move through paged data (tables, lists, search results), optionally with a "Go to" page jumper.
1817
-
1818
- `import { Pagination } from "twico-ui"`
1819
-
1820
- Props:
1821
- - `page` — `number` · default `1` — The currently active 1-based page number, used to highlight the active button and compute which pages to show.
1822
- - `total` — `number` · **required** — Total number of pages available, determining the range of page buttons and when ellipsis truncation appears.
1823
- - `onChange` — `(page: number) => void` — Fires with the destination page number whenever the user clicks a page, prev, next, or jumper control.
1824
- - `siblings` — `number` · default `1` — Number of adjacent page buttons rendered on each side of the current page before ellipsis truncation kicks in.
1825
- - `boundaries` — `number` · default `1` — Number of page buttons always kept visible at each end so the first and last pages stay reachable.
1826
- - `size` — `"sm" | "md"` · default `"md"` — Sets the control density, sm or md, scaling button height and spacing to match the surrounding layout.
1827
- - `showJumper` — `boolean` · default `false` — Adds a "Go to" number input so users can jump directly to a specific page instead of clicking through.
1828
- - `jumperLabel` — `React.ReactNode` · default `"Go to"` — Text or node rendered before the jumper input, defaulting to "Go to", to clarify what the field does.
1829
- - `getPageLabel` — `(page: number) => string` · default `(n) => `Page ${n}`` — Accessible label for each numbered page button, so screen readers announce "Page 3" rather than a bare number; override for i18n.
1830
- - `defaultPage` — `number` · default `1` — Initial 1-based page when uncontrolled (no `page` prop).
1831
- - `showPageJumper` — `boolean` · default `false` — Show a "Go to" page input for jumping directly to a page; preferred alias for showJumper.
1832
-
1833
- ```jsx
1834
- import { Pagination } from "twico-ui";
1835
-
1836
- const [page, setPage] = useState(1);
1837
-
1838
- <Pagination
1839
- page={page}
1840
- total={12}
1841
- onChange={setPage}
1842
- showJumper
1843
- />
1844
- ```
1845
-
1846
1991
  #### PieChart
1847
1992
 
1848
1993
  A dependency-free inline-SVG pie or donut chart that renders proportional slices of a whole from a single value series, with per-slice tooltips, an optional legend, percentage labels, and a donut center label. Reach for it to show part-to-whole composition; use Chart for bar/line/area trends.
@@ -1864,6 +2009,7 @@ Props:
1864
2009
  - `ariaLabel` — `string` · default `"pie chart" / "donut chart"` — Accessible name for the role="img" SVG; per-slice values live in the hidden data table, not this label.
1865
2010
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative for the chart (WCAG 1.1.1).
1866
2011
  - `caption` — `React.ReactNode` · default `chart's accessible label` — Caption for the hidden data table; defaults to the chart's accessible label.
2012
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1867
2013
 
1868
2014
  ```jsx
1869
2015
  import { PieChart } from "twico-ui";
@@ -1899,6 +2045,7 @@ Props:
1899
2045
  - `ariaLabel` — `string` · default `"polar area chart"` — Accessible name for the chart's SVG role="img"; aria-label is also accepted as an alternative.
1900
2046
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative for screen readers (WCAG 1.1.1).
1901
2047
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
2048
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1902
2049
 
1903
2050
  ```jsx
1904
2051
  import { PolarAreaChart } from "twico-ui";
@@ -1939,6 +2086,7 @@ Props:
1939
2086
  - `ariaLabel` — `string` · default `"radar chart"` — Accessible name for the chart's role="img" SVG; also accepts the aria-label attribute.
1940
2087
  - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden data table as a text alternative to the SVG for screen readers (WCAG 1.1.1).
1941
2088
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
2089
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
1942
2090
 
1943
2091
  ```jsx
1944
2092
  import { RadarChart } from "twico-ui";
@@ -1973,6 +2121,8 @@ Props:
1973
2121
  - `ariaLabel` — `string` · default `"range <type> chart"` — Accessible name for the chart's role="img" SVG; aria-label is also accepted as an alias.
1974
2122
  - `tableFallback` — `boolean` · default `true` — Renders a visually-hidden min/max data table as an accessible text alternative for screen readers (WCAG 1.1.1).
1975
2123
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
2124
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
2125
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
1976
2126
 
1977
2127
  ```jsx
1978
2128
  import { RangeChart } from "twico-ui";
@@ -2010,6 +2160,8 @@ Props:
2010
2160
  - `ariaLabel` — `string` · default `"scatter chart" / "bubble chart"` — Accessible name for the chart's role="img" SVG; also accepts aria-label. Per-point values live in the hidden table.
2011
2161
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative to the SVG (WCAG 1.1.1).
2012
2162
  - `caption` — `React.ReactNode` · default `chart's accessible label` — Caption for the hidden data table; defaults to the chart's accessible label.
2163
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
2164
+ - `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
2013
2165
 
2014
2166
  ```jsx
2015
2167
  import { ScatterChart } from "twico-ui";
@@ -2055,6 +2207,7 @@ Props:
2055
2207
  - `ariaLabel` — `string` — Accessible name for the `<svg role="img">`; defaults to a spoken summary of point count and first/last/min/max.
2056
2208
  - `tableFallback` — `boolean` · default `false` — Render a visually-hidden data table as a WCAG 1.1.1 text alternative; off by default since the aria-label usually suffices.
2057
2209
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the accessible label when not provided.
2210
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
2058
2211
 
2059
2212
  ```jsx
2060
2213
  import { Sparkline } from "twico-ui";
@@ -2064,135 +2217,6 @@ import { Sparkline } from "twico-ui";
2064
2217
  <Sparkline type="bar" height={28} data={[4, 6, 2, 8, 5, 7]} />
2065
2218
  ```
2066
2219
 
2067
- #### Stat
2068
-
2069
- Stat is a KPI / metric card that displays a label, a large value, and optional icon, trend delta, and help text. Use it on dashboards or summary panels to surface a single key metric with its trend direction.
2070
-
2071
- `import { Stat } from "twico-ui"`
2072
-
2073
- Props:
2074
- - `label` — `React.ReactNode` · **required** — Renders the metric's caption shown above the value, naming what the number represents such as "Revenue".
2075
- - `value` — `React.ReactNode` · **required** — Renders the large primary metric value that anchors the card, like a count, currency amount, or percentage.
2076
- - `icon` — `React.ReactNode` — Renders an optional icon in a tinted tile at the top-right corner to visually reinforce the metric's meaning.
2077
- - `delta` — `React.ReactNode` — Shows the trend change beside the value, such as "+12.5%" or "-3%", to convey movement over a period.
2078
- - `deltaDirection` — `"up" | "down" | "flat"` — Forces the delta's direction and color (up, down, or flat); otherwise it is inferred from a leading minus sign.
2079
- - `helpText` — `React.ReactNode` — Renders muted context after the delta, such as "vs last month", to clarify the comparison period.
2080
- - `plain` — `boolean` · default `false` — Strips the card chrome (border, background, and padding) so the stat blends into an existing surface.
2081
-
2082
- ```jsx
2083
- import { Stat } from "twico-ui";
2084
-
2085
- <Stat
2086
- label="Revenue"
2087
- value="$48,200"
2088
- delta="+12.5%"
2089
- helpText="vs last month"
2090
- />
2091
- <Stat
2092
- label="Churn"
2093
- value="2.1%"
2094
- delta="-0.4%"
2095
- deltaDirection="up"
2096
- helpText="improved"
2097
- />
2098
- ```
2099
-
2100
- #### Table
2101
-
2102
- A data table with a styled header, hover and zebra-striped rows, client-side click-to-sort headers, custom cell renderers, and selected-row highlighting. Use it to display structured rows of data when you need lightweight sorting and per-column rendering or alignment.
2103
-
2104
- `import { Table } from "twico-ui"`
2105
-
2106
- Props:
2107
- - `columns` — `TableColumn<T>[]` · **required** — Defines each column with key, header, optional align, width, sortable flag, and a custom render function for cell content.
2108
- - `hover` — `boolean` · default `true` — Highlights the row under the cursor on mouse-over, on by default to aid scanning and pointing at dense rows.
2109
- - `striped` — `boolean` · default `false` — Applies zebra striping to alternating rows when enabled, improving readability across wide tables of similar-looking data.
2110
- - `size` — `"sm" | "md"` · default `"md"` — Controls cell padding density, choosing sm for compact rows or md for the default roomier spacing.
2111
- - `sortable` — `boolean` · default `false` — Enables client-side click-to-sort headers when true, letting users reorder rows by any column marked sortable.
2112
- - `rowKey` — `(row: T, index: number) => string | number` — Returns a stable unique key for each row from its data and index, defaulting to the row index.
2113
- - `selectedKeys` — `Array<string | number>` — Lists the keys of rows to render with selected-row highlighting, useful for marking chosen or active records.
2114
- - `sort` — `TableSort | null` — Controlled sort state — pair with onSortChange (null = unsorted).
2115
- - `defaultSort` — `TableSort` · default `{ key: null, dir: "asc" }` — Initial sort when uncontrolled.
2116
- - `onSortChange` — `(sort: TableSort) => void` — Fired when a sortable header is clicked with the next sort state.
2117
- - `stickyHeader` — `boolean` · default `false` — Pin the header to the top while the body scrolls (use with maxHeight or an enclosing scroll container).
2118
- - `maxHeight` — `number | string` — Cap the table height and give it its own vertical scroll area (CSS length or number of px); enables stickyHeader to shine.
2119
- - `loading` — `boolean` · default `false` — Renders shimmering skeleton rows instead of data and sets aria-busy, avoiding a flash-of-empty during fetches.
2120
- - `loadingRows` — `number` · default `8` — Number of skeleton rows to show while loading is true.
2121
- - `emptyMessage` — `React.ReactNode` · default `"No data"` — Rendered as a single full-width row when rows is empty instead of a bare header over a blank body.
2122
- - `ariaLabel` — `string` — Accessible name applied to the <table> itself (not the wrapper div); a raw aria-label prop takes precedence over it.
2123
- - `caption` — `React.ReactNode` — Renders a visually-hidden <caption> naming the table for assistive technology.
2124
- - `rows` — `T[]` — Row objects.
2125
- - `field (column)` — `string` — Alias for key (Datatable vocabulary); key wins when both are set.
2126
- - `headerName (column)` — `React.ReactNode` — Alias for header (Datatable vocabulary); header wins when both are set.
2127
- - `renderCell (column)` — `(value: any, row: T, index: number) => React.ReactNode` — Alias for render (Datatable vocabulary); render wins when both are set.
2128
-
2129
- ```jsx
2130
- import { Table } from "twico-ui";
2131
-
2132
- const users = [
2133
- { id: 1, name: "Ava Stone", role: "Admin", status: "Active", mrr: 480 },
2134
- { id: 2, name: "Liam Reed", role: "Editor", status: "Invited", mrr: 120 },
2135
- { id: 3, name: "Noah Park", role: "Viewer", status: "Active", mrr: 60 },
2136
- ];
2137
-
2138
- <Table
2139
- sortable
2140
- striped
2141
- rowKey={(r) => r.id}
2142
- columns={[
2143
- { field: "name", headerName: "Name" },
2144
- { field: "role", headerName: "Role" },
2145
- { field: "status", headerName: "Status" },
2146
- { field: "mrr", headerName: "MRR", align: "right" },
2147
- ]}
2148
- rows={users}
2149
- />
2150
- ```
2151
-
2152
- #### Tag
2153
-
2154
- Tag is a removable chip for displaying filters, selected items, or keywords. Use it when you need compact, dismissible labels with an optional leading icon and an optional remove (×) button.
2155
-
2156
- `import { Tag } from "twico-ui"`
2157
-
2158
- Props:
2159
- - `onRemove` — `(e: React.MouseEvent<HTMLButtonElement>) => void` — Renders the remove (×) button and handles its click, letting users dismiss the tag as a filter or selection.
2160
- - `variant` — `"soft" | "solid" | "outline"` · default `"soft"` — Chooses the fill style between soft, solid, and outline to control how prominently the tag reads.
2161
- - `tone` — `"neutral" | "primary" | "success" | "warning" | "danger" | "info"` · default `"neutral"` — Sets the semantic color from six options like success or danger; defaults to neutral (the classic chip).
2162
- - `leftIcon` — `React.ReactNode` — Renders an optional leading icon before the label, useful for signaling the tag's category or status.
2163
- - `children` — `React.ReactNode` — Provides the tag's label content, typically the filter name, selected item, or keyword being displayed.
2164
-
2165
- ```jsx
2166
- import { Tag } from "twico-ui";
2167
-
2168
- <Tag onRemove={() => {}}>React</Tag>
2169
- <Tag leftIcon={<span>#</span>}>design-system</Tag>
2170
- <Tag>read-only</Tag>
2171
- ```
2172
-
2173
- #### Timeline
2174
-
2175
- Timeline renders a vertical list of events as node dots connected by a rail, each showing a title, optional timestamp, and description. Use it for activity feeds, order tracking, or history views.
2176
-
2177
- `import { Timeline } from "twico-ui"`
2178
-
2179
- Props:
2180
- - `items` — `TimelineItem[] — { title, time?, description?, icon?, tone? }` · **required** — Array of events to render as connected node dots, each with a title, optional time, description, icon, and primary/success/warning/danger tone.
2181
- - `className` — `string` · default `""` — Extra CSS class appended to the root <ul> so you can layer custom spacing or styling onto the timeline.
2182
- - `tone (TimelineItem)` — `"primary" | "info" | "success" | "warning" | "danger"` — Added `info` value to the per-item node tone union; maps the dot to var(--color-info) with var(--color-info-fg) icon color.
2183
-
2184
- ```jsx
2185
- import { Timeline } from "twico-ui";
2186
-
2187
- <Timeline
2188
- items={[
2189
- { title: "Order placed", time: "9:41 AM", description: "We received your order.", tone: "primary" },
2190
- { title: "Shipped", time: "2:10 PM", description: "Left the warehouse.", tone: "success" },
2191
- { title: "Out for delivery", time: "Tomorrow" },
2192
- ]}
2193
- />
2194
- ```
2195
-
2196
2220
  #### Treemap
2197
2221
 
2198
2222
  A dependency-free SVG treemap that partitions a rectangle into tiles sized in proportion to a flat list of values, using a squarified layout that keeps tile aspect ratios near 1:1. Reach for it to show the relative weight of parts within a whole — spend by category, storage by bucket — where a pie would crowd or a bar chart would lose the sense of area.
@@ -2209,6 +2233,7 @@ Props:
2209
2233
  - `ariaLabel` — `string` · default `"treemap"` — Accessible name for the chart's role="img" SVG; also accepts aria-label, with values exposed via the data table.
2210
2234
  - `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table of value and share as an accessible text alternative (WCAG 1.1.1).
2211
2235
  - `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label when omitted.
2236
+ - `onDataClick` — `(payload) => void` — Fires with the clicked item's data + metadata; the clicked mark also toggles a persistent selected outline.
2212
2237
 
2213
2238
  ```jsx
2214
2239
  import { Treemap } from "twico-ui";