@nexub/mcp 5.3.0 → 5.5.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/skill/references/components/data-table.md +101 -0
- package/dist/skill/references/components/date-range-picker.md +22 -2
- package/dist/skill/references/components/filter-bar.md +2 -0
- package/dist/skill/references/components/filter-builder.md +68 -0
- package/dist/skill/references/components/saved-views.md +53 -0
- package/dist/skill/references/components.md +4 -2
- package/dist/skill/references/tokens.md +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
```
|
|
@@ -17,10 +17,10 @@ Dual-calendar date range selector.
|
|
|
17
17
|
| `disabled` | `boolean` | `false` | Disables the trigger input and calendar popover. |
|
|
18
18
|
| `minDate` | `Date` | | Earliest selectable date. Dates before this are greyed out. |
|
|
19
19
|
| `maxDate` | `Date` | | Latest selectable date. Dates after this are greyed out. |
|
|
20
|
-
| `numberOfMonths` | `number` | `2` | Number of months to display in the calendar popover. |
|
|
21
20
|
| `aria-label` | `string` | | Field name for screen readers; the selected value is appended. |
|
|
22
21
|
| `id` | `string` | | Id for the trigger button, e.g. to pair with a <label htmlFor>. |
|
|
23
|
-
| `
|
|
22
|
+
| `presets` | `boolean \| { label: string; range: (today: Date) => DateRange }[]` | | `true` adds Today, Last 7 days, Last 30 days, Month to date and Last month beside the calendar; or pass your own (5.5). |
|
|
23
|
+
| `timeZone` | `string` | | IANA zone the dates mean, e.g. `Europe/London`. Shown under the calendar; presets count "today" there (5.5). `todayIn(zone)` is exported. |
|
|
24
24
|
|
|
25
25
|
## Example: Default
|
|
26
26
|
|
|
@@ -52,3 +52,23 @@ export default function Example() {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
|
+
|
|
56
|
+
## Example: Presets and time zone
|
|
57
|
+
|
|
58
|
+
Quick ranges counted in the chosen time zone, which is labelled under the calendar.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
'use client';
|
|
62
|
+
|
|
63
|
+
import * as React from 'react';
|
|
64
|
+
import { DateRangePicker, type DateRange } from '@nexub/react';
|
|
65
|
+
|
|
66
|
+
export default function Example() {
|
|
67
|
+
const [range, setRange] = React.useState<DateRange | undefined>();
|
|
68
|
+
return (
|
|
69
|
+
<div className="w-[300px]">
|
|
70
|
+
<DateRangePicker aria-label="Report period" value={range} onChange={setRange} presets timeZone="Europe/London" />
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
@@ -15,6 +15,8 @@ Search + filter toolbar pattern for data-heavy list or table views.
|
|
|
15
15
|
| `onSearch` | `(value: string) => void` | | Callback when search value changes. |
|
|
16
16
|
| `searchLabel` | `string` | `'Search'` | Accessible name of the search field (5.1). Defaults to the localised `search` message. |
|
|
17
17
|
| `filters` | `React.ReactNode` | | Filter controls rendered to the right of search. |
|
|
18
|
+
| `activeCount` | `number` | `0` | Applied filters; above 0 shows "N filters" (5.5). `countFilters(group)` counts a FilterBuilder query. |
|
|
19
|
+
| `onClearAll` | `() => void` | | Shows a Clear all button next to the count (5.5). |
|
|
18
20
|
| `actions` | `React.ReactNode` | | Action buttons (e.g. "Export") rendered on the far right. |
|
|
19
21
|
|
|
20
22
|
## Example: Default
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Filter Builder
|
|
2
|
+
|
|
3
|
+
Build AND/OR filter queries with nested groups. The output is plain JSON your app runs.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form Controls · Status: beta
|
|
6
|
+
- Import: `import { FilterBuilder } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/filter-builder
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `fields` (required) | `{ id; label; type: "text" \| "number" \| "select" \| "date"; options? }[]` | | What can be filtered. The type picks the operators and the value input. |
|
|
14
|
+
| `value / defaultValue` | `FilterGroup` | | `{ id, combinator: "and" \| "or", rules: (FilterRule \| FilterGroup)[] }`; a rule is `{ id, field, operator, value: string }`. |
|
|
15
|
+
| `onValueChange` | `(value: FilterGroup) => void` | | Called with the whole query on every change. |
|
|
16
|
+
| `maxDepth` | `number` | `1` | Levels of nested groups "Add group" may create; 0 hides it. |
|
|
17
|
+
|
|
18
|
+
## Example: Deals filter
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
'use client';
|
|
22
|
+
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { FilterBuilder, type FilterField, type FilterGroup } from '@nexub/react';
|
|
25
|
+
|
|
26
|
+
const fields: FilterField[] = [
|
|
27
|
+
{ id: 'name', label: 'Deal name', type: 'text' },
|
|
28
|
+
{ id: 'amount', label: 'Amount', type: 'number' },
|
|
29
|
+
{
|
|
30
|
+
id: 'stage',
|
|
31
|
+
label: 'Stage',
|
|
32
|
+
type: 'select',
|
|
33
|
+
options: [
|
|
34
|
+
{ value: 'lead', label: 'Lead' },
|
|
35
|
+
{ value: 'proposal', label: 'Proposal' },
|
|
36
|
+
{ value: 'won', label: 'Won' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{ id: 'close', label: 'Close date', type: 'date' },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export default function Example() {
|
|
43
|
+
const [query, setQuery] = React.useState<FilterGroup>({
|
|
44
|
+
id: 'root',
|
|
45
|
+
combinator: 'and',
|
|
46
|
+
rules: [
|
|
47
|
+
{ id: 'r1', field: 'stage', operator: 'equals', value: 'proposal' },
|
|
48
|
+
{ id: 'r2', field: 'amount', operator: 'greaterThan', value: '10000' },
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
return (
|
|
52
|
+
<div className="flex w-full max-w-[640px] flex-col gap-4">
|
|
53
|
+
<FilterBuilder fields={fields} value={query} onValueChange={setQuery} />
|
|
54
|
+
<pre className="max-h-40 overflow-auto rounded-shape-container bg-[var(--color-surface-container-low)] p-3 text-label-sm">
|
|
55
|
+
{JSON.stringify(query, null, 2)}
|
|
56
|
+
</pre>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
|
|
64
|
+
- Roles: Each group is a `group` named "Filters, match all/any".
|
|
65
|
+
- Field, condition and value controls are labelled; remove buttons say what they remove.
|
|
66
|
+
- Helpers: `emptyFilter()`, `countFilters(group)`, `isFilterGroup(rule)`, `filterOperators`.
|
|
67
|
+
|
|
68
|
+
Related: [filter-bar](filter-bar.md), [saved-views](saved-views.md), [data-table](data-table.md)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Saved Views
|
|
2
|
+
|
|
3
|
+
A menu to switch, save, update and delete saved filter views. Your app stores them.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Navigation · Status: beta
|
|
6
|
+
- Import: `import { SavedViews } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/saved-views
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `views` (required) | `{ id: string; name: string }[]` | | The saved views. |
|
|
14
|
+
| `activeId` | `string` | | The view in use; its name shows on the button. |
|
|
15
|
+
| `onSelect` (required) | `(id: string) => void` | | Switch to a view: restore its filters, sort and columns. |
|
|
16
|
+
| `onSave` | `(name: string) => void` | | Adds "Save as new view…", which asks for a name. |
|
|
17
|
+
| `onUpdate / onDelete` | `(id: string) => void` | | Add "Update" and "Delete" for the active view. |
|
|
18
|
+
|
|
19
|
+
## Example: Views for a deals table
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
'use client';
|
|
23
|
+
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { SavedViews, type SavedView } from '@nexub/react';
|
|
26
|
+
|
|
27
|
+
export default function Example() {
|
|
28
|
+
const [views, setViews] = React.useState<SavedView[]>([
|
|
29
|
+
{ id: 'mine', name: 'My open deals' },
|
|
30
|
+
{ id: 'big', name: 'Over $10k' },
|
|
31
|
+
]);
|
|
32
|
+
const [active, setActive] = React.useState('mine');
|
|
33
|
+
return (
|
|
34
|
+
<SavedViews
|
|
35
|
+
views={views}
|
|
36
|
+
activeId={active}
|
|
37
|
+
onSelect={setActive}
|
|
38
|
+
onSave={(name) => {
|
|
39
|
+
const id = crypto.randomUUID();
|
|
40
|
+
setViews((v) => [...v, { id, name }]);
|
|
41
|
+
setActive(id);
|
|
42
|
+
}}
|
|
43
|
+
onUpdate={() => {}}
|
|
44
|
+
onDelete={(id) => {
|
|
45
|
+
setViews((v) => v.filter((x) => x.id !== id));
|
|
46
|
+
setActive('');
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Related: [filter-builder](filter-builder.md), [filter-bar](filter-bar.md), [data-table](data-table.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Component index
|
|
2
2
|
|
|
3
|
-
Nexub DS v5.
|
|
3
|
+
Nexub DS v5.5.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
|
|
@@ -83,6 +83,7 @@ Never use a component marked deprecated.
|
|
|
83
83
|
- [Checkbox](components/checkbox.md) `@nexub/react`: Binary checkbox input built on Radix UI.
|
|
84
84
|
- [Checkbox Card](components/checkbox-card.md) `@nexub/react`: A checkbox drawn as a whole card: title, description and optional icon. Pick any number.
|
|
85
85
|
- [Combobox](components/combobox.md) `@nexub/react`: Command-palette style searchable dropdown built on cmdk.
|
|
86
|
+
- [Filter Builder](components/filter-builder.md) `@nexub/react`: Build AND/OR filter queries with nested groups. The output is plain JSON your app runs.
|
|
86
87
|
- [Multi Select](components/multi-select.md) `@nexub/react`: Pick several options as chips, with search, "+N more" and an optional create option.
|
|
87
88
|
- [Radio Card](components/radio-card.md) `@nexub/react`: A radio group where each option is a whole card: title, description and optional icon, one choice.
|
|
88
89
|
- [Radio Group](components/radio-group.md) `@nexub/react`: Group of mutually exclusive radio inputs.
|
|
@@ -147,6 +148,7 @@ Never use a component marked deprecated.
|
|
|
147
148
|
- [Breadcrumb](components/breadcrumb.md) `@nexub/react`: Hierarchical navigation trail showing page location.
|
|
148
149
|
- [Navigation Rail](components/navigation-rail.md) `@nexub/react`: Navigation for medium-width windows: icons over labels, with an active pill behind the icon.
|
|
149
150
|
- [Pagination](components/pagination.md) `@nexub/react`: Page navigation control with prev/next and page number buttons.
|
|
151
|
+
- [Saved Views](components/saved-views.md) `@nexub/react`: A menu to switch, save, update and delete saved filter views. Your app stores them.
|
|
150
152
|
- [Tabs](components/tabs.md) `@nexub/react`: Layered content panels switched by tab triggers. Built on Radix UI Tabs.
|
|
151
153
|
|
|
152
154
|
## Components — Overlays
|
|
@@ -225,5 +227,5 @@ Never use a component marked deprecated.
|
|
|
225
227
|
|
|
226
228
|
These exist; read their TypeScript props in `node_modules/<package>/dist/index.d.ts`.
|
|
227
229
|
|
|
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
|
|
230
|
+
- `@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
231
|
- `@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
|
+
Nexub DS v5.5.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
|
+
"version": "5.5.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",
|