@nexub/mcp 5.0.1 → 5.2.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/autocomplete.md +47 -1
- package/dist/skill/references/components/breadcrumb.md +25 -0
- package/dist/skill/references/components/chip.md +1 -0
- package/dist/skill/references/components/drawer.md +2 -2
- package/dist/skill/references/components/filter-bar.md +1 -0
- package/dist/skill/references/components/multi-select.md +70 -0
- package/dist/skill/references/components/toast.md +1 -0
- package/dist/skill/references/components.md +2 -1
- package/dist/skill/references/tokens.md +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,12 @@ Type-to-search input with matching options dropdown.
|
|
|
15
15
|
| `onValueChange` | `(value: string) => void` | | Callback fired when the selected value changes. |
|
|
16
16
|
| `placeholder` | `string` | | Placeholder text shown in the input when empty. |
|
|
17
17
|
| `emptyText` | `string` | | Text shown when no options match the current search query. |
|
|
18
|
-
| `loading` | `boolean` | |
|
|
18
|
+
| `loading` | `boolean` | | Skeleton rows while options are being fetched (5.2); "Loading" is announced. |
|
|
19
|
+
| `inputValue` | `string` | | Controlled input text (5.1). |
|
|
20
|
+
| `onInputChange` | `(text: string) => void` | | Called as the user types, so you can fetch options (5.1). When set, options are shown as given, without built-in filtering. |
|
|
21
|
+
| `mode` | `'inline' \| 'popover'` | `'inline'` | Popover (5.2): a field whose list opens below it while typing. Inline keeps the list always visible; it stays the default until 6.0. |
|
|
22
|
+
| `onCreate` | `(text: string) => void` | | Adds a "Create “text”" option when the text matches no option (5.2). |
|
|
23
|
+
| `aria-label` | `string` | | Accessible name of the field when it has no visible label. |
|
|
19
24
|
|
|
20
25
|
## Example: Default
|
|
21
26
|
|
|
@@ -73,3 +78,44 @@ export default function Example() {
|
|
|
73
78
|
);
|
|
74
79
|
}
|
|
75
80
|
```
|
|
81
|
+
|
|
82
|
+
## Example: Popover, fetch as you type
|
|
83
|
+
|
|
84
|
+
`mode="popover"` with `onInputChange`: the app filters, the list shows skeleton rows while loading.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
'use client';
|
|
88
|
+
|
|
89
|
+
import * as React from 'react';
|
|
90
|
+
import { Autocomplete } from '@nexub/react';
|
|
91
|
+
|
|
92
|
+
const all = ['Amsterdam', 'Berlin', 'Lisbon', 'London', 'Madrid', 'Paris', 'Singapore', 'Tokyo'];
|
|
93
|
+
|
|
94
|
+
// Fetch-as-you-type: onInputChange turns built-in filtering off.
|
|
95
|
+
export default function Example() {
|
|
96
|
+
const [query, setQuery] = React.useState('');
|
|
97
|
+
const [loading, setLoading] = React.useState(false);
|
|
98
|
+
const [options, setOptions] = React.useState(all.map((c) => ({ value: c, label: c })));
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
setLoading(true);
|
|
101
|
+
const t = setTimeout(() => {
|
|
102
|
+
const q = query.toLowerCase();
|
|
103
|
+
setOptions(all.filter((c) => c.toLowerCase().includes(q)).map((c) => ({ value: c, label: c })));
|
|
104
|
+
setLoading(false);
|
|
105
|
+
}, 300);
|
|
106
|
+
return () => clearTimeout(t);
|
|
107
|
+
}, [query]);
|
|
108
|
+
return (
|
|
109
|
+
<div className="w-[280px]">
|
|
110
|
+
<Autocomplete
|
|
111
|
+
mode="popover"
|
|
112
|
+
aria-label="City"
|
|
113
|
+
placeholder="Search cities…"
|
|
114
|
+
options={options}
|
|
115
|
+
loading={loading}
|
|
116
|
+
onInputChange={setQuery}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
@@ -13,6 +13,8 @@ Hierarchical navigation trail showing page location.
|
|
|
13
13
|
| `Breadcrumb.Root aria-label` | `string` | `'breadcrumb'` | Accessible label for the nav landmark. |
|
|
14
14
|
| `Breadcrumb.Link href` | `string` | | URL the breadcrumb link navigates to. |
|
|
15
15
|
| `Breadcrumb.Link asChild` | `boolean` | `false` | Merges props onto the immediate child element, useful for router Link components. |
|
|
16
|
+
| `Breadcrumb.Trail items` (required) | `{ label: ReactNode; href?: string }[]` | | The whole trail from data (5.1), root first; the last item is the current page. |
|
|
17
|
+
| `Breadcrumb.Trail maxItems` | `number` | `4` | Longer trails keep the first item and the last `maxItems - 1`, and move the rest into a "More" menu. |
|
|
16
18
|
| `Breadcrumb.Separator children` | `React.ReactNode` | | Custom separator element. Defaults to a chevron icon. |
|
|
17
19
|
| `Breadcrumb.Ellipsis aria-label` | `string` | `'More'` | Accessible label for the ellipsis element used to collapse long trails. |
|
|
18
20
|
|
|
@@ -57,3 +59,26 @@ export default function Example() {
|
|
|
57
59
|
);
|
|
58
60
|
}
|
|
59
61
|
```
|
|
62
|
+
|
|
63
|
+
## Example: Auto-collapse
|
|
64
|
+
|
|
65
|
+
Breadcrumb.Trail moves the middle of a long path into a menu.
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Breadcrumb } from '@nexub/react';
|
|
69
|
+
|
|
70
|
+
export default function Example() {
|
|
71
|
+
return (
|
|
72
|
+
<Breadcrumb.Trail
|
|
73
|
+
maxItems={3}
|
|
74
|
+
items={[
|
|
75
|
+
{ label: 'Home', href: '/' },
|
|
76
|
+
{ label: 'Acme', href: '/' },
|
|
77
|
+
{ label: 'Billing', href: '/' },
|
|
78
|
+
{ label: 'Invoices', href: '/' },
|
|
79
|
+
{ label: 'INV-2041' },
|
|
80
|
+
]}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
@@ -12,6 +12,7 @@ Compact label chip, optionally dismissible.
|
|
|
12
12
|
| --- | --- | --- | --- |
|
|
13
13
|
| `variant` | `'filled' \| 'outline'` | `'filled'` | Visual style of the chip. |
|
|
14
14
|
| `onRemove` | `() => void` | | When provided, renders a dismiss button that calls this handler. |
|
|
15
|
+
| `removeLabel` | `string` | `'Remove'` | Accessible name of the dismiss button (5.2), e.g. "Remove Bug". Use it when several chips sit together. |
|
|
15
16
|
| `size` | `'sm' \| 'md'` | | Controls chip size. |
|
|
16
17
|
|
|
17
18
|
## Example: Default
|
|
@@ -17,8 +17,8 @@ Slide-in panel from any edge of the screen.
|
|
|
17
17
|
| `Drawer.Content` | `compound` | | The drawer panel. Accepts a side prop. |
|
|
18
18
|
| `scrollLock` | `'style' \| 'class'` | | On Drawer.Root. How page scroll is locked while open. `class` adds a class from @nexub/themes/base instead of injecting a <style> tag, so it works under a strict CSP (style-src 'self'). Default `style`. |
|
|
19
19
|
| `side` | `'left' \| 'right' \| 'top' \| 'bottom'` | | Edge of the screen from which the drawer slides in. |
|
|
20
|
-
| `Drawer.Header` | `compound` | | Header section of the drawer panel. |
|
|
21
|
-
| `Drawer.Footer` | `compound` | | Footer section of the drawer panel. |
|
|
20
|
+
| `Drawer.Header` | `compound` | | Header section of the drawer panel. Sticky on solid panels (5.1): long content scrolls under it. |
|
|
21
|
+
| `Drawer.Footer` | `compound` | | Footer section of the drawer panel. Sticky on solid panels (5.1): actions stay in view while content scrolls. |
|
|
22
22
|
| `Drawer.Title` | `compound` | | Accessible title for the drawer. |
|
|
23
23
|
| `Drawer.Description` | `compound` | | Supporting description text for the drawer. |
|
|
24
24
|
| `Drawer.Close` | `compound` | | Element that closes the drawer. |
|
|
@@ -13,6 +13,7 @@ Search + filter toolbar pattern for data-heavy list or table views.
|
|
|
13
13
|
| `searchPlaceholder` | `string` | `'Search…'` | Placeholder text for the search input. |
|
|
14
14
|
| `searchValue` | `string` | | Controlled search value. |
|
|
15
15
|
| `onSearch` | `(value: string) => void` | | Callback when search value changes. |
|
|
16
|
+
| `searchLabel` | `string` | `'Search'` | Accessible name of the search field (5.1). Defaults to the localised `search` message. |
|
|
16
17
|
| `filters` | `React.ReactNode` | | Filter controls rendered to the right of search. |
|
|
17
18
|
| `actions` | `React.ReactNode` | | Action buttons (e.g. "Export") rendered on the far right. |
|
|
18
19
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Multi Select
|
|
2
|
+
|
|
3
|
+
Pick several options as chips, with search, "+N more" and an optional create option.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form Controls · Status: beta
|
|
6
|
+
- Import: `import { MultiSelect } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/multi-select
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `options` (required) | `{ value: string; label: string }[]` | | The options to pick from. |
|
|
14
|
+
| `value / defaultValue` | `string[]` | | Selected values, controlled or not. |
|
|
15
|
+
| `onValueChange` | `(value: string[]) => void` | | Called with the new selection. |
|
|
16
|
+
| `maxVisibleChips` | `number` | `3` | Chips shown before the rest collapse into "+N more". |
|
|
17
|
+
| `onInputChange` | `(text: string) => void` | | Called as the user types. When set, options are shown as given, so you can fetch them. |
|
|
18
|
+
| `onCreate` | `(text: string) => void` | | Adds a "Create “text”" option when the text matches no option. |
|
|
19
|
+
| `loading` | `boolean` | | Skeleton rows instead of options; "Loading" is announced. |
|
|
20
|
+
| `aria-label / aria-labelledby` | `string` | | Name the field: there is no visible label inside it. |
|
|
21
|
+
|
|
22
|
+
## Example: Labels with create
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
'use client';
|
|
26
|
+
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
import { MultiSelect } from '@nexub/react';
|
|
29
|
+
|
|
30
|
+
const labels = [
|
|
31
|
+
{ value: 'bug', label: 'Bug' },
|
|
32
|
+
{ value: 'design', label: 'Design' },
|
|
33
|
+
{ value: 'docs', label: 'Docs' },
|
|
34
|
+
{ value: 'perf', label: 'Performance' },
|
|
35
|
+
{ value: 'a11y', label: 'Accessibility' },
|
|
36
|
+
{ value: 'security', label: 'Security' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export default function Example() {
|
|
40
|
+
const [options, setOptions] = React.useState(labels);
|
|
41
|
+
const [value, setValue] = React.useState(['bug', 'a11y']);
|
|
42
|
+
return (
|
|
43
|
+
<div className="w-[320px]">
|
|
44
|
+
<MultiSelect
|
|
45
|
+
aria-label="Labels"
|
|
46
|
+
placeholder="Add labels…"
|
|
47
|
+
options={options}
|
|
48
|
+
value={value}
|
|
49
|
+
onValueChange={setValue}
|
|
50
|
+
onCreate={(text) => {
|
|
51
|
+
const v = text.toLowerCase();
|
|
52
|
+
setOptions((o) => [...o, { value: v, label: text }]);
|
|
53
|
+
setValue((s) => [...s, v]);
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
|
|
63
|
+
- `Type`: Filters the options and opens the list.
|
|
64
|
+
- `ArrowDown / ArrowUp`: Moves through the options.
|
|
65
|
+
- `Enter`: Toggles the highlighted option.
|
|
66
|
+
- `Backspace`: In an empty field, removes the last chip.
|
|
67
|
+
- `Escape`: Closes the list.
|
|
68
|
+
- Options carry `aria-checked`; each chip has a "Remove <label>" button.
|
|
69
|
+
|
|
70
|
+
Related: [autocomplete](autocomplete.md), [chip](chip.md), [select](select.md)
|
|
@@ -25,6 +25,7 @@ Imperative toast notifications using the toast object. Render <Toaster /> once i
|
|
|
25
25
|
| Prop | Type | Default | Description |
|
|
26
26
|
| --- | --- | --- | --- |
|
|
27
27
|
| `Toaster expand` | `boolean` | `false` | Always show toasts as a list. By default they collapse into a stack that fans out on hover or focus, which also pauses their timers. |
|
|
28
|
+
| `Toaster position` | `'top-start' \| 'top-center' \| 'top-end' \| 'bottom-start' \| 'bottom-center' \| 'bottom-end'` | `'top-end'` | Where the stack sits (5.1). Start and end follow the reading direction; bottom positions stack upward. |
|
|
28
29
|
| `Toaster visibleToasts` | `number` | `3` | How many toasts show at once. Older ones are hidden visually but stay in the live region. |
|
|
29
30
|
| `toast.success(title, opts?)` (required) | `string` | | Show a success toast with an optional options object. |
|
|
30
31
|
| `toast.error(title, opts?)` (required) | `string` | | Show an error toast. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Component index
|
|
2
2
|
|
|
3
|
-
Nexub DS v5.0.
|
|
3
|
+
Nexub DS v5.2.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
|
+
- [Multi Select](components/multi-select.md) `@nexub/react`: Pick several options as chips, with search, "+N more" and an optional create option.
|
|
86
87
|
- [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.
|
|
87
88
|
- [Radio Group](components/radio-group.md) `@nexub/react`: Group of mutually exclusive radio inputs.
|
|
88
89
|
- [Select](components/select.md) `@nexub/react`: Accessible dropdown select built on Radix UI. Supports groups and search.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tokens
|
|
2
2
|
|
|
3
|
-
Nexub DS v5.0.
|
|
3
|
+
Nexub DS v5.2.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.0
|
|
3
|
+
"version": "5.2.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",
|