@nexub/mcp 5.3.0 → 5.4.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.
@@ -23,6 +23,13 @@ Feature-rich data table with sorting and row selection powered by TanStack Table
23
23
  | `columnVisibility / onColumnVisibilityChange` | `Record<string, boolean>` | | Which columns show, keyed by column id (5.3). |
24
24
  | `viewOptions` | `boolean` | `false` | A "View" menu above the table for density and column visibility (5.3). |
25
25
  | `toolbar` | `ReactNode` | | Content at the start of the row above the table, e.g. filters (5.3). |
26
+ | `enableColumnResizing` | `boolean` | `false` | Drag a header edge to resize (5.4). The handle is focusable: Arrow keys resize by 16px, double-click resets. |
27
+ | `columnSizing / onColumnSizingChange` | `Record<string, number>` | | Column widths in px, keyed by column id (5.4). |
28
+ | `enableColumnReordering` | `boolean` | `false` | Drag headers to reorder, or Alt+Arrow on a focused header; the move is announced (5.4). |
29
+ | `columnOrder / onColumnOrderChange` | `string[]` | | Column ids in display order (5.4). |
30
+ | `columnPinning / onColumnPinningChange` | `{ left?: string[]; right?: string[] }` | | Columns that stay in view while the rest scroll sideways (5.4). The selection column pins with them. |
31
+ | `maxHeight` | `number \| string` | | Caps the height: rows scroll and the header sticks (5.4). |
32
+ | `DataTableVirtual` | `import from '@nexub/react/DataTableVirtual'` | | Same props plus `maxHeight` (required), `estimateRowHeight` and `overscan`: renders only the rows in view, for thousands of rows. Needs `@tanstack/react-virtual` installed (5.4). No pagination. |
26
33
  | `pagination.pageSize` | `number` | `20` | Rows per page; pagination is on when `pagination` is set. |
27
34
 
28
35
  ## Example: Default
@@ -140,3 +147,97 @@ export default function Example() {
140
147
  );
141
148
  }
142
149
  ```
150
+
151
+ ## Example: Resize, reorder and pin
152
+
153
+ Drag header edges to resize and headers to reorder (or Alt+Arrow). Invoice stays pinned while the rest scroll; the header sticks within `maxHeight`.
154
+
155
+ ```tsx
156
+ 'use client';
157
+
158
+ import { DataTable, type DataTableColumn } from '@nexub/react';
159
+
160
+ interface Invoice {
161
+ id: string;
162
+ customer: string;
163
+ region: string;
164
+ owner: string;
165
+ status: string;
166
+ amount: number;
167
+ }
168
+
169
+ const invoices: Invoice[] = Array.from({ length: 30 }, (_, i) => ({
170
+ id: `INV-${2041 + i}`,
171
+ customer: ['Acme', 'Globex', 'Initech', 'Umbrella', 'Hooli'][i % 5]!,
172
+ region: ['EMEA', 'APAC', 'Americas'][i % 3]!,
173
+ owner: ['Ana', 'Ben', 'Chen', 'Dev'][i % 4]!,
174
+ status: ['Paid', 'Overdue', 'Draft'][i % 3]!,
175
+ amount: 400 + ((i * 137) % 2000),
176
+ }));
177
+
178
+ const columns: DataTableColumn<Invoice>[] = [
179
+ { accessorKey: 'id', header: 'Invoice', size: 120 },
180
+ { accessorKey: 'customer', header: 'Customer', size: 160 },
181
+ { accessorKey: 'region', header: 'Region', size: 140 },
182
+ { accessorKey: 'owner', header: 'Owner', size: 140 },
183
+ { accessorKey: 'status', header: 'Status', size: 140 },
184
+ { accessorKey: 'amount', header: 'Amount', size: 120, meta: { align: 'end' } },
185
+ ];
186
+
187
+ export default function Example() {
188
+ return (
189
+ <div className="w-full max-w-[640px]">
190
+ <DataTable
191
+ caption="Invoices"
192
+ captionHidden
193
+ columns={columns}
194
+ data={invoices}
195
+ enableColumnResizing
196
+ enableColumnReordering
197
+ columnPinning={{ left: ['id'] }}
198
+ maxHeight={320}
199
+ />
200
+ </div>
201
+ );
202
+ }
203
+ ```
204
+
205
+ ## Example: 10,000 rows (DataTableVirtual)
206
+
207
+ `import { DataTableVirtual } from '@nexub/react/DataTableVirtual'` and install `@tanstack/react-virtual`. Only the rows in view are rendered.
208
+
209
+ ```tsx
210
+ 'use client';
211
+
212
+ import type { DataTableColumn } from '@nexub/react';
213
+ import { DataTableVirtual } from '@nexub/react/DataTableVirtual';
214
+
215
+ interface Event {
216
+ id: number;
217
+ name: string;
218
+ user: string;
219
+ at: string;
220
+ }
221
+
222
+ const events: Event[] = Array.from({ length: 10_000 }, (_, i) => ({
223
+ id: i + 1,
224
+ name: ['sign_in', 'export', 'invite', 'upgrade'][i % 4]!,
225
+ user: `user${(i * 7919) % 997}@example.com`,
226
+ at: new Date(Date.UTC(2026, 10, 1) + i * 60_000).toISOString().slice(0, 16).replace('T', ' '),
227
+ }));
228
+
229
+ const columns: DataTableColumn<Event>[] = [
230
+ { accessorKey: 'id', header: '#', meta: { align: 'end' } },
231
+ { accessorKey: 'name', header: 'Event' },
232
+ { accessorKey: 'user', header: 'User' },
233
+ { accessorKey: 'at', header: 'Time (UTC)' },
234
+ ];
235
+
236
+ export default function Example() {
237
+ return (
238
+ <div className="w-full max-w-[640px]">
239
+ <DataTableVirtual caption="Audit log" captionHidden columns={columns} data={events} maxHeight={360} enableSorting />
240
+ </div>
241
+ );
242
+ }
243
+ ```
@@ -1,6 +1,6 @@
1
1
  # Component index
2
2
 
3
- Nexub DS v5.3.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v5.4.0. Open `components/<slug>.md` for props, examples and accessibility notes.
4
4
  Never use a component marked deprecated.
5
5
 
6
6
  ## Components — Actions
@@ -225,5 +225,5 @@ Never use a component marked deprecated.
225
225
 
226
226
  These exist; read their TypeScript props in `node_modules/<package>/dist/index.d.ts`.
227
227
 
228
- - `@nexub/react`: AgentKit, AppShell, AspectRatio, Chart, CheckList, Code, CommandPalette, Container, ContextMenu, CountryBadge, DropdownMenu, FileUpload, Flag, FormError, KeyboardShortcut, Logo, Menubar, Motion, NavigationMenu, NexubProvider, PageHeader, Section, Sidebar, ThemeProvider, Toolbar, TopNav, VisuallyHidden
228
+ - `@nexub/react`: AgentKit, AppShell, AspectRatio, Chart, CheckList, Code, CommandPalette, Container, ContextMenu, CountryBadge, DataTableVirtual, DropdownMenu, FileUpload, Flag, FormError, KeyboardShortcut, Logo, Menubar, Motion, NavigationMenu, NexubProvider, PageHeader, Section, Sidebar, ThemeProvider, Toolbar, TopNav, VisuallyHidden
229
229
  - `@nexub/patterns`: ActivityPage, AppHeader, AppLauncher, ChatPage, CheckoutPage, DashboardPage, PageFrame, PaywallPage, SettingsLayout, SettingsPage, SignInPage, TransactionDetailPage
@@ -1,6 +1,6 @@
1
1
  # Tokens
2
2
 
3
- Nexub DS v5.3.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v5.4.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
4
4
  The Tailwind preset (`@nexub/tokens/tailwind`) maps them to utilities. Never hardcode a hex, px spacing or shadow that a token covers.
5
5
 
6
6
  ## Color roles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/mcp",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "MCP server for Nexub Design System: gives Claude, Cursor and any MCP client the components, patterns, tokens and design rules of the installed release.",
5
5
  "type": "module",
6
6
  "license": "MIT",