@aircall/ds 0.31.4 → 0.34.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/dist/globals.css +1 -1
- package/dist/index.d.ts +462 -194
- package/dist/index.js +1975 -435
- package/dist/theme.css +28 -0
- package/package.json +14 -2
- package/skills/aircall-ds/migrate-tractor/data-table/SKILL.md +62 -2
package/dist/theme.css
CHANGED
|
@@ -438,6 +438,34 @@
|
|
|
438
438
|
margin-block-end: -0.25em;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
+
/*
|
|
442
|
+
* The overlay layering scale, such as it is. Two tiers, and the gap between them is the point.
|
|
443
|
+
*
|
|
444
|
+
* MODAL SURFACES sit at `z-50`: the `Dialog` / `AlertDialog` / `Sheet` / `Drawer` backdrops and
|
|
445
|
+
* their panels. Those stay on plain `z-50` — this utility is deliberately not applied to them.
|
|
446
|
+
*
|
|
447
|
+
* POPUPS get this tier, one step above, and it has to be a real step rather than the shared
|
|
448
|
+
* `z-50` they used to carry. A popup opened from INSIDE a modal surface must paint above that
|
|
449
|
+
* surface's backdrop, and at an EQUAL z-index that is decided by paint order — which Base UI
|
|
450
|
+
* cannot guarantee here. Its portal container resolves to
|
|
451
|
+
* `container ?? parentPortalNode ?? document.body`, and React runs effects child-first: a
|
|
452
|
+
* `SelectContent` mounted inside a `DialogContent` runs its portal effect BEFORE the dialog's, so
|
|
453
|
+
* `PortalContext` has no node yet, the popup lands in `<body>`, and the dialog's own portal node
|
|
454
|
+
* is appended after it. The backdrop then paints over the popup, and because it carries
|
|
455
|
+
* `backdrop-filter` the popup comes out blurred rather than merely behind.
|
|
456
|
+
*
|
|
457
|
+
* That ordering depends on whether the consumer mounts the dialog eagerly (a `show` prop on an
|
|
458
|
+
* always-rendered modal) or on open, which is why it looked intermittent. One tier of separation
|
|
459
|
+
* makes it a z-index question instead, and z-index does not care about mount order.
|
|
460
|
+
*
|
|
461
|
+
* Applied to each popup family's POSITIONER — the `position: fixed` element that actually
|
|
462
|
+
* competes with the backdrop, and the one a consumer's `className` cannot reach (it lands on the
|
|
463
|
+
* popup, inside the positioner's own `isolation: isolate` stacking context).
|
|
464
|
+
*/
|
|
465
|
+
@utility z-popup {
|
|
466
|
+
z-index: 60;
|
|
467
|
+
}
|
|
468
|
+
|
|
441
469
|
/*
|
|
442
470
|
* Attachment utilities — ported verbatim from the shadcn base theme
|
|
443
471
|
* (packages/shadcn/src/tailwind.css). Consumed by the Attachment component:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aircall/ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
@@ -52,9 +52,19 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
+
"@ariakit/react": "0.4.36",
|
|
55
56
|
"@base-ui/react": "1.3.0",
|
|
56
57
|
"@headless-tree/core": "1.7.0",
|
|
57
58
|
"@headless-tree/react": "1.7.0",
|
|
59
|
+
"@platejs/basic-nodes": "53.0.0",
|
|
60
|
+
"@platejs/combobox": "53.0.0",
|
|
61
|
+
"@platejs/floating": "53.0.0",
|
|
62
|
+
"@platejs/indent": "53.0.0",
|
|
63
|
+
"@platejs/link": "53.3.1",
|
|
64
|
+
"@platejs/list": "53.1.3",
|
|
65
|
+
"@platejs/markdown": "53.3.3",
|
|
66
|
+
"@platejs/mention": "53.0.0",
|
|
67
|
+
"@platejs/slash-command": "53.0.0",
|
|
58
68
|
"@tanstack/react-virtual": "3.13.12",
|
|
59
69
|
"class-variance-authority": "0.7.1",
|
|
60
70
|
"clsx": "2.1.1",
|
|
@@ -63,6 +73,8 @@
|
|
|
63
73
|
"emoji-picker-react": "4.4.9",
|
|
64
74
|
"input-otp": "1.4.2",
|
|
65
75
|
"next-themes": "0.4.6",
|
|
76
|
+
"platejs": "53.3.3",
|
|
77
|
+
"remark-gfm": "4.0.1",
|
|
66
78
|
"sonner": "2.0.3",
|
|
67
79
|
"tailwind-merge": "3.4.0",
|
|
68
80
|
"tw-animate-css": "1.4.0"
|
|
@@ -102,7 +114,7 @@
|
|
|
102
114
|
"storybook": "10.3.3",
|
|
103
115
|
"storybook-addon-pseudo-states": "10.3.3",
|
|
104
116
|
"tailwindcss": "4.1.18",
|
|
105
|
-
"tsdown": "0.
|
|
117
|
+
"tsdown": "0.22.14",
|
|
106
118
|
"typescript": "5.9.3",
|
|
107
119
|
"vite": "7.3.1",
|
|
108
120
|
"vitest": "4.0.17",
|
|
@@ -3,7 +3,8 @@ name: aircall-ds/migrate-tractor/data-table
|
|
|
3
3
|
description: >
|
|
4
4
|
Migrate Tractor Table and TableColumn to the @aircall/ds DataTable (TanStack
|
|
5
5
|
Table-backed). Load when a file imports Table or TableColumn from @aircall/tractor.
|
|
6
|
-
Covers column definitions, sorting, row selection,
|
|
6
|
+
Covers column definitions, sorting, row selection, column pinning (`stickTo` ->
|
|
7
|
+
`meta.pin`), loading states, and empty states.
|
|
7
8
|
type: sub-skill
|
|
8
9
|
library: aircall-ds
|
|
9
10
|
requires:
|
|
@@ -40,6 +41,7 @@ There is no sub-component API (no `<TableColumn>`) — everything is declared in
|
|
|
40
41
|
| `onOrderChange(columnId)` | `onSortingChange` (receives `SortingState`) + `sorting` |
|
|
41
42
|
| `order` (`OrderInput`) | `sorting` (`SortingState`) |
|
|
42
43
|
| `footer` | column-level `ColumnDef.footer` (auto-renders `<tfoot>`) |
|
|
44
|
+
| `stickTo: 'left' \| 'right'` (Tractor column pinning) | `meta: { pin: 'left' \| 'right' }` on the column def |
|
|
43
45
|
| _(no equivalent)_ | `loadingState="sorting"` / `"filtering"` (overlay spinner) |
|
|
44
46
|
| _(no equivalent)_ | `loadingState="loadingMore"` (infinite scroll spinner row) |
|
|
45
47
|
| _(no equivalent)_ | `onFetchMore` + `hasMore` (IntersectionObserver sentinel for infinite scroll) |
|
|
@@ -71,8 +73,42 @@ Tractor used a descriptor array (`TableColumn[]`) with a `renderer` function. DS
|
|
|
71
73
|
| `label` | `header` (`ReactNode` or render function) |
|
|
72
74
|
| `renderer(rowData, value, rowIndex)` | `cell: ({ row }) => row.original.<field>` |
|
|
73
75
|
| `sortable: false` | `enableSorting: false` |
|
|
76
|
+
| `stickTo` / `StickTo.Left` / `StickTo.Right` | `meta: { pin: 'left' \| 'right' }` (implies fixed widths — set `size`) |
|
|
74
77
|
| _(no equivalent)_ | `footer` (triggers `<tfoot>` rendering) |
|
|
75
|
-
| _(no equivalent)_ | `size`, `minSize`, `maxSize` (for `enableColumnResizing`) |
|
|
78
|
+
| _(no equivalent)_ | `size`, `minSize`, `maxSize` (for `enableColumnResizing` / pinned columns) |
|
|
79
|
+
|
|
80
|
+
### Column pinning (`stickTo` → `meta.pin`)
|
|
81
|
+
|
|
82
|
+
Tractor pinned columns with `stickTo: StickTo.Left | StickTo.Right` (selection stuck left, row actions stuck right). DS uses TanStack column pinning behind a declarative column-def field:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
const columns: ColumnDef<Person>[] = [
|
|
86
|
+
{
|
|
87
|
+
accessorKey: 'name',
|
|
88
|
+
header: 'Name',
|
|
89
|
+
size: 220,
|
|
90
|
+
meta: { pin: 'left' }
|
|
91
|
+
},
|
|
92
|
+
{ accessorKey: 'email', header: 'Email', size: 280 },
|
|
93
|
+
{
|
|
94
|
+
id: 'actions',
|
|
95
|
+
header: '',
|
|
96
|
+
size: 40,
|
|
97
|
+
enableResizing: false,
|
|
98
|
+
meta: { pin: 'right' },
|
|
99
|
+
cell: ({ row }) => <RowActionsMenu person={row.original} />
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Rules:
|
|
105
|
+
|
|
106
|
+
- **Set an explicit `size`** on every pinned column (and prefer sizes on siblings). Pinning implies `table-layout: fixed`; missing `size` falls back to TanStack's 150px default.
|
|
107
|
+
- **Resolvable id required.** Pinning derives TanStack `columnPinning` from column ids. Resolution matches TanStack: `id` → string `accessorKey` → string `header`. Display-only columns (`cell` + non-string `header`, no `id`/`accessorKey`) need an explicit `id` or pinning is skipped (dev warning).
|
|
108
|
+
- **Selection auto-pin is gated.** When `selectionMode` is on *and* at least one consumer column has `meta.pin`, the built-in checkbox column is also auto-pinned left. Selection-only tables without `meta.pin` stay on fluid layout.
|
|
109
|
+
- Tractor's left-pinned select + right-pinned actions map to: pin your identity/name column(s) left, pin the actions column right, enable `selectionMode` — the checkbox column joins the left pin group automatically.
|
|
110
|
+
|
|
111
|
+
Source: `packages/ds/src/components/data-table.tsx`
|
|
76
112
|
|
|
77
113
|
## 6. Before / After
|
|
78
114
|
|
|
@@ -332,6 +368,30 @@ Tractor `noDataMessage` accepted a `ReactNode` but was declared as a simple prop
|
|
|
332
368
|
|
|
333
369
|
Source: `packages/ds/src/components/data-table.tsx`
|
|
334
370
|
|
|
371
|
+
### Mistake 5 — `meta.pin` without a resolvable column id
|
|
372
|
+
|
|
373
|
+
```tsx
|
|
374
|
+
// Wrong — no id / accessorKey / string header; pinning is silently skipped
|
|
375
|
+
{
|
|
376
|
+
header: () => <span>Status</span>,
|
|
377
|
+
cell: ({ row }) => <Badge>{row.original.status}</Badge>,
|
|
378
|
+
meta: { pin: 'left' }
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Correct — give TanStack (and DataTable) a stable id
|
|
382
|
+
{
|
|
383
|
+
id: 'status',
|
|
384
|
+
header: () => <span>Status</span>,
|
|
385
|
+
cell: ({ row }) => <Badge>{row.original.status}</Badge>,
|
|
386
|
+
size: 120,
|
|
387
|
+
meta: { pin: 'left' }
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
`meta.pin` is applied by deriving `columnPinning` from column ids before render. If the id cannot be resolved, the column does not pin (dev-only console warning). Prefer `id` or a string `accessorKey`; a string `header` also works as a last resort (same as TanStack).
|
|
392
|
+
|
|
393
|
+
Source: `packages/ds/src/components/data-table.tsx`
|
|
394
|
+
|
|
335
395
|
## 8. Infinite scroll and row virtualization
|
|
336
396
|
|
|
337
397
|
`DataTable` supports infinite scroll via `onFetchMore` + `hasMore` (IntersectionObserver sentinel). Row virtualization is a **separate, explicit opt-in** via the `virtualizeRows` prop — the consumer decides when to enable it.
|