@nexub/mcp 6.5.0 → 6.7.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/chart-zoom.md +47 -0
- package/dist/skill/references/components/data-table.md +47 -0
- package/dist/skill/references/components/notification-center.md +51 -0
- package/dist/skill/references/components/notification-item.md +4 -3
- package/dist/skill/references/components.md +3 -1
- package/dist/skill/references/tokens.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Chart Zoom
|
|
2
|
+
|
|
3
|
+
Zoom any chart to part of its range with a two-thumb slider.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Data Display · Status: beta
|
|
6
|
+
- Import: `import { ChartZoom } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/chart-zoom
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `data` (required) | `T[]` | | The full data. |
|
|
14
|
+
| `index` (required) | `keyof T` | | The category key; its values label the range. |
|
|
15
|
+
| `children` (required) | `(slice: T[]) => ReactNode` | | Render the chart for the visible slice. |
|
|
16
|
+
| `defaultRange` | `[start, end]` | | Starting indexes; the whole range by default. |
|
|
17
|
+
| `minSpan` | `number` | `2` | Fewest categories shown. |
|
|
18
|
+
|
|
19
|
+
## Example: Zoom a year of revenue
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
'use client';
|
|
23
|
+
|
|
24
|
+
import { ChartZoom, LineChart } from '@nexub/react';
|
|
25
|
+
|
|
26
|
+
const data = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'].map((month, i) => ({
|
|
27
|
+
month,
|
|
28
|
+
revenue: 120 + i * 14 + (i % 3) * 9,
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
export default function Example() {
|
|
32
|
+
return (
|
|
33
|
+
<ChartZoom data={data} index="month" defaultRange={[3, 8]} className="w-full">
|
|
34
|
+
{(slice) => (
|
|
35
|
+
<LineChart className="w-full" title="Revenue ($k)" data={slice} index="month" series={[{ key: 'revenue', label: 'Revenue' }]} />
|
|
36
|
+
)}
|
|
37
|
+
</ChartZoom>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Accessibility
|
|
43
|
+
|
|
44
|
+
- `Arrow keys / Home / End`: Move the focused thumb.
|
|
45
|
+
- Thumbs read "Zoom start: Mar" and "Zoom end: Sep". Charts themselves stay server components; only this wrapper runs on the client.
|
|
46
|
+
|
|
47
|
+
Related: [line-chart](line-chart.md), [bar-chart](bar-chart.md), [chart-toggle](chart-toggle.md)
|
|
@@ -296,6 +296,53 @@ export default function Example() {
|
|
|
296
296
|
}
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
+
## Example: Export CSV
|
|
300
|
+
|
|
301
|
+
`toCSV(rows, columns)` quotes and escapes per RFC 4180 and neutralises cells that start like a spreadsheet formula. Pass what the person sees.
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
'use client';
|
|
305
|
+
|
|
306
|
+
import { Button, DataTable, toCSV, type DataTableColumn } from '@nexub/react';
|
|
307
|
+
|
|
308
|
+
type Invoice = { id: string; customer: string; amount: number };
|
|
309
|
+
|
|
310
|
+
const data: Invoice[] = [
|
|
311
|
+
{ id: 'INV-1042', customer: 'Acme, Inc.', amount: 1200 },
|
|
312
|
+
{ id: 'INV-1043', customer: 'Globex', amount: 860 },
|
|
313
|
+
];
|
|
314
|
+
|
|
315
|
+
const columns: DataTableColumn<Invoice>[] = [
|
|
316
|
+
{ accessorKey: 'id', header: 'Invoice' },
|
|
317
|
+
{ accessorKey: 'customer', header: 'Customer' },
|
|
318
|
+
{ accessorKey: 'amount', header: 'Amount', meta: { align: 'end' } },
|
|
319
|
+
];
|
|
320
|
+
|
|
321
|
+
function download() {
|
|
322
|
+
const csv = toCSV(data, [
|
|
323
|
+
{ header: 'Invoice', value: 'id' },
|
|
324
|
+
{ header: 'Customer', value: 'customer' },
|
|
325
|
+
{ header: 'Amount', value: 'amount' },
|
|
326
|
+
]);
|
|
327
|
+
const url = URL.createObjectURL(new Blob([csv], { type: 'text/csv;charset=utf-8' }));
|
|
328
|
+
const a = Object.assign(document.createElement('a'), { href: url, download: 'invoices.csv' });
|
|
329
|
+
a.click();
|
|
330
|
+
URL.revokeObjectURL(url);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export default function Example() {
|
|
334
|
+
return (
|
|
335
|
+
<DataTable
|
|
336
|
+
caption="Invoices"
|
|
337
|
+
captionHidden
|
|
338
|
+
columns={columns}
|
|
339
|
+
data={data}
|
|
340
|
+
toolbar={<Button variant="outlined" size="sm" onClick={download}>Export CSV</Button>}
|
|
341
|
+
/>
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
299
346
|
## Accessibility
|
|
300
347
|
|
|
301
348
|
- Roles: table (default), grid (with `grid`), columnheader with aria-sort when sortable
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# NotificationCenter
|
|
2
|
+
|
|
3
|
+
A bell with an unread count that opens the notification list.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Feedback · Status: beta
|
|
6
|
+
- Import: `import { NotificationCenter } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/notification-center
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `notifications` (required) | `{ id, title, description?, timestamp?, read?, icon?, href? }[]` | | Newest first. Your app owns them and their read state. |
|
|
14
|
+
| `onOpen` | `(id) => void` | | A notification was opened; mark it read here. |
|
|
15
|
+
| `onDismiss` | `(id) => void` | | Shows a dismiss button per item. |
|
|
16
|
+
| `onMarkAllRead` | `() => void` | | Shows "Mark all as read" while some are unread. |
|
|
17
|
+
| `emptyText` | `ReactNode` | `"You’re all caught up"` | Shown with no notifications. |
|
|
18
|
+
|
|
19
|
+
## Example: Inbox
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
'use client';
|
|
23
|
+
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { NotificationCenter, type NotificationCenterItem } from '@nexub/patterns';
|
|
26
|
+
|
|
27
|
+
export default function Example() {
|
|
28
|
+
const [items, setItems] = React.useState<NotificationCenterItem[]>([
|
|
29
|
+
{ id: '1', title: 'Deploy failed on main', description: 'Build step "test" exited with 1.', timestamp: '2 min ago' },
|
|
30
|
+
{ id: '2', title: 'Invoice #1042 paid', timestamp: '1 h ago' },
|
|
31
|
+
{ id: '3', title: 'Ada commented on Q4 plan', timestamp: 'Yesterday', read: true },
|
|
32
|
+
]);
|
|
33
|
+
const markRead = (id?: string) => setItems((list) => list.map((n) => (!id || n.id === id ? { ...n, read: true } : n)));
|
|
34
|
+
return (
|
|
35
|
+
<NotificationCenter
|
|
36
|
+
notifications={items}
|
|
37
|
+
onOpen={(id) => markRead(id)}
|
|
38
|
+
onDismiss={(id) => setItems((list) => list.filter((n) => n.id !== id))}
|
|
39
|
+
onMarkAllRead={() => markRead()}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Accessibility
|
|
46
|
+
|
|
47
|
+
- The bell reads "Notifications, 3 unread"; the count badge is decorative.
|
|
48
|
+
- The list opens in a popover labelled by its heading; Escape closes it and focus returns to the bell.
|
|
49
|
+
- Each item’s title is its link or button, stretched over the whole item.
|
|
50
|
+
|
|
51
|
+
Related: [notification-item](notification-item.md)
|
|
@@ -13,9 +13,10 @@ Single notification row for notification panels or dropdowns.
|
|
|
13
13
|
| `title` (required) | `string` | | Notification title. |
|
|
14
14
|
| `description` | `string` | | Supporting text. |
|
|
15
15
|
| `timestamp` | `string` | | Relative time string. |
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
16
|
+
| `read` | `boolean` | `false` | Unread items get a tinted background and an "Unread" dot. |
|
|
17
|
+
| `icon` | `ReactNode` | | Icon or avatar before the text. |
|
|
18
|
+
| `href / onSelect` | `string / () => void` | | Makes the whole item a link or a button (6.6). |
|
|
19
|
+
| `onDismiss` | `() => void` | | Shows a dismiss button. |
|
|
19
20
|
|
|
20
21
|
## Example: Default
|
|
21
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Component index
|
|
2
2
|
|
|
3
|
-
Nexub DS v6.
|
|
3
|
+
Nexub DS v6.7.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
|
|
@@ -32,6 +32,7 @@ Never use a component marked deprecated.
|
|
|
32
32
|
- [Amount](components/amount.md) `@nexub/react`: Honest money: Intl formatting, tabular numerals, the currency’s minor unit and a true minus sign.
|
|
33
33
|
- [Bar Chart](components/bar-chart.md) `@nexub/react`: Compare values across categories, grouped or stacked. Server-rendered SVG on the chart palette.
|
|
34
34
|
- [Chart Toggle](components/chart-toggle.md) `@nexub/react`: A legend whose entries switch series on and off, wrapped around any chart.
|
|
35
|
+
- [Chart Zoom](components/chart-zoom.md) `@nexub/react`: Zoom any chart to part of its range with a two-thumb slider.
|
|
35
36
|
- [Data Table](components/data-table.md) `@nexub/react`: Feature-rich data table with sorting and row selection powered by TanStack Table.
|
|
36
37
|
- [Donut Chart](components/donut-chart.md) `@nexub/react`: Parts of a whole, with an optional total in the hole. Keep it to six slices or fewer.
|
|
37
38
|
- [Empty State](components/empty-state.md) `@nexub/react`: Placeholder UI shown when a list or page has no content.
|
|
@@ -212,6 +213,7 @@ Never use a component marked deprecated.
|
|
|
212
213
|
|
|
213
214
|
## Patterns — Feedback
|
|
214
215
|
|
|
216
|
+
- [NotificationCenter](components/notification-center.md) `@nexub/patterns`: A bell with an unread count that opens the notification list.
|
|
215
217
|
- [NotificationItem](components/notification-item.md) `@nexub/patterns`: Single notification row for notification panels or dropdowns.
|
|
216
218
|
|
|
217
219
|
## Patterns — Forms
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tokens
|
|
2
2
|
|
|
3
|
-
Nexub DS v6.
|
|
3
|
+
Nexub DS v6.7.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": "6.
|
|
3
|
+
"version": "6.7.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",
|