@nexub/mcp 5.4.0 → 5.6.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.
@@ -19,6 +19,7 @@ Confirmation dialog that requires an explicit user action before proceeding.
19
19
  | `AlertDialog.Description` | `compound` | | Supporting description text for the dialog. |
20
20
  | `AlertDialog.Action` | `compound` | | Confirms the destructive or affirmative action and closes the dialog. |
21
21
  | `AlertDialog.Cancel` | `compound` | | Cancels the action and closes the dialog. |
22
+ | `AlertDialog.Confirm text` | `string` | | Type-to-confirm (5.6): the Action stays disabled until this text is typed. For irreversible actions on named resources. |
22
23
 
23
24
  ## Example: Default
24
25
 
@@ -50,3 +51,34 @@ export default function Example() {
50
51
  );
51
52
  }
52
53
  ```
54
+
55
+ ## Example: Type to confirm
56
+
57
+ Deleting a workspace asks for its name first.
58
+
59
+ ```tsx
60
+ 'use client';
61
+
62
+ import { AlertDialog, Button } from '@nexub/react';
63
+
64
+ export default function Example() {
65
+ return (
66
+ <AlertDialog.Root>
67
+ <AlertDialog.Trigger asChild>
68
+ <Button variant="destructive">Delete workspace</Button>
69
+ </AlertDialog.Trigger>
70
+ <AlertDialog.Content>
71
+ <AlertDialog.Header>
72
+ <AlertDialog.Title>Delete acme-prod?</AlertDialog.Title>
73
+ <AlertDialog.Description>All projects, members and billing history go with it. This can’t be undone.</AlertDialog.Description>
74
+ </AlertDialog.Header>
75
+ <AlertDialog.Confirm text="acme-prod" />
76
+ <AlertDialog.Footer>
77
+ <AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
78
+ <AlertDialog.Action>Delete workspace</AlertDialog.Action>
79
+ </AlertDialog.Footer>
80
+ </AlertDialog.Content>
81
+ </AlertDialog.Root>
82
+ );
83
+ }
84
+ ```
@@ -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
- | `error` | `string` | | Error message displayed below the input. |
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 @@ Placeholder UI shown when a list or page has no content.
15
15
  | `EmptyState.Title children` (required) | `React.ReactNode` | | Primary heading text for the empty state. |
16
16
  | `EmptyState.Description children` | `React.ReactNode` | | Supporting text providing more context or guidance. |
17
17
  | `EmptyState.Actions children` | `React.ReactNode` | | One or more action buttons rendered below the description. |
18
+ | `EmptyStatePreset kind` (required) | `'noData' \| 'noResults' \| 'noAccess' \| 'serverError' \| 'offline'` | | Ready-made icon, title and description (5.6). serverError and offline are announced as alerts. |
19
+ | `EmptyStatePreset title / description / actions` | `ReactNode` | | Override the localised text; add buttons such as Retry. |
18
20
 
19
21
  ## Example: Default
20
22
 
@@ -65,3 +67,20 @@ export default function Example() {
65
67
  );
66
68
  }
67
69
  ```
70
+
71
+ ## Example: Presets
72
+
73
+ `EmptyStatePreset` for no data, no results, no access (403), server error (500) and offline.
74
+
75
+ ```tsx
76
+ import { Button, EmptyStatePreset } from '@nexub/react';
77
+
78
+ export default function Example() {
79
+ return (
80
+ <div className="grid w-full gap-4 sm:grid-cols-2">
81
+ <EmptyStatePreset kind="noResults" actions={<Button variant="outline" size="sm">Clear filters</Button>} />
82
+ <EmptyStatePreset kind="serverError" actions={<Button size="sm">Retry</Button>} />
83
+ </div>
84
+ );
85
+ }
86
+ ```
@@ -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,49 @@
1
+ # OTP Input
2
+
3
+ One box per digit for verification codes, with paste and one-time-code autofill.
4
+
5
+ - Package: `@nexub/react` · Category: Form Controls · Status: beta
6
+ - Import: `import { OtpInput } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/otp-input
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `length` | `number` | `6` | Number of boxes. |
14
+ | `value / defaultValue / onValueChange` | `string` | | The code so far, without gaps. |
15
+ | `onComplete` | `(code: string) => void` | | Called when every box is filled; submit or verify here. |
16
+ | `mode` | `'numeric' \| 'alphanumeric'` | `'numeric'` | Numeric shows the number keypad on phones. |
17
+ | `invalid / disabled` | `boolean` | | Error styling (pair with a FormError) and the disabled state. |
18
+ | `name` | `string` | | Submits the code with a form. |
19
+ | `aria-label` | `string` | `'Verification code'` | Group name; each box reads "Digit N of M". |
20
+
21
+ ## Example: Verification code
22
+
23
+ ```tsx
24
+ 'use client';
25
+
26
+ import * as React from 'react';
27
+ import { OTPInput } from '@nexub/react';
28
+
29
+ export default function Example() {
30
+ const [status, setStatus] = React.useState('');
31
+ return (
32
+ <div className="flex flex-col items-start gap-3">
33
+ <OTPInput onComplete={(code) => setStatus(code === '123456' ? 'Verified' : 'That code didn’t work')} onValueChange={() => setStatus('')} />
34
+ <p aria-live="polite" className="text-body-sm text-[var(--color-on-surface-muted)]">
35
+ {status || 'Try 123456'}
36
+ </p>
37
+ </div>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ## Accessibility
43
+
44
+ - `Type`: Fills the box and moves to the next.
45
+ - `Backspace`: Clears the box, or the previous one when empty.
46
+ - `ArrowLeft / ArrowRight`: Moves between boxes.
47
+ - The first box has `autocomplete="one-time-code"`, so the code from an SMS fills every box.
48
+
49
+ Related: [input](input.md), [password-input](password-input.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.4.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v5.6.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,7 +83,9 @@ 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.
88
+ - [OTP Input](components/otp-input.md) `@nexub/react`: One box per digit for verification codes, with paste and one-time-code autofill.
87
89
  - [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
90
  - [Radio Group](components/radio-group.md) `@nexub/react`: Group of mutually exclusive radio inputs.
89
91
  - [Select](components/select.md) `@nexub/react`: Accessible dropdown select built on Radix UI. Supports groups and search.
@@ -147,6 +149,7 @@ Never use a component marked deprecated.
147
149
  - [Breadcrumb](components/breadcrumb.md) `@nexub/react`: Hierarchical navigation trail showing page location.
148
150
  - [Navigation Rail](components/navigation-rail.md) `@nexub/react`: Navigation for medium-width windows: icons over labels, with an active pill behind the icon.
149
151
  - [Pagination](components/pagination.md) `@nexub/react`: Page navigation control with prev/next and page number buttons.
152
+ - [Saved Views](components/saved-views.md) `@nexub/react`: A menu to switch, save, update and delete saved filter views. Your app stores them.
150
153
  - [Tabs](components/tabs.md) `@nexub/react`: Layered content panels switched by tab triggers. Built on Radix UI Tabs.
151
154
 
152
155
  ## Components — Overlays
@@ -225,5 +228,5 @@ Never use a component marked deprecated.
225
228
 
226
229
  These exist; read their TypeScript props in `node_modules/<package>/dist/index.d.ts`.
227
230
 
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
231
+ - `@nexub/react`: AgentKit, AppShell, AspectRatio, Chart, CheckList, Code, CommandPalette, Container, ContextMenu, CountryBadge, DataTableVirtual, DropdownMenu, FileUpload, Flag, FormError, KeyboardShortcut, Logo, Menubar, Motion, NavigationMenu, NexubProvider, OTPInput, PageHeader, Section, Sidebar, ThemeProvider, Toolbar, TopNav, VisuallyHidden
229
232
  - `@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.4.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v5.6.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.4.0",
3
+ "version": "5.6.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",