@nexub/mcp 5.4.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/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 +3 -1
- package/dist/skill/references/tokens.md +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
@@ -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",
|