@nexub/mcp 5.9.0 → 6.1.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.
@@ -18,7 +18,7 @@ Type-to-search input with matching options dropdown.
18
18
  | `loading` | `boolean` | | Skeleton rows while options are being fetched (5.2); "Loading" is announced. |
19
19
  | `inputValue` | `string` | | Controlled input text (5.1). |
20
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. |
21
+ | `mode` | `'inline' \| 'popover'` | `'popover'` | Popover: a field whose list opens below it while typing (the default from 6.0). Inline keeps the list always visible, as in 5.x. |
22
22
  | `onCreate` | `(text: string) => void` | | Adds a "Create “text”" option when the text matches no option (5.2). |
23
23
  | `aria-label` | `string` | | Accessible name of the field when it has no visible label. |
24
24
 
@@ -52,7 +52,7 @@ import { Autocomplete } from '@nexub/react';
52
52
  export default function Example() {
53
53
  return (
54
54
  <div className="w-[260px]">
55
- <Autocomplete options={[]} loading placeholder="Loading options…" />
55
+ <Autocomplete mode="inline" options={[]} loading placeholder="Loading options…" />
56
56
  </div>
57
57
  );
58
58
  }
@@ -79,7 +79,7 @@ export default function Example() {
79
79
  }
80
80
  ```
81
81
 
82
- ## Example: Popover, fetch as you type
82
+ ## Example: Fetch as you type
83
83
 
84
84
  `mode="popover"` with `onInputChange`: the app filters, the list shows skeleton rows while loading.
85
85
 
@@ -108,7 +108,6 @@ export default function Example() {
108
108
  return (
109
109
  <div className="w-[280px]">
110
110
  <Autocomplete
111
- mode="popover"
112
111
  aria-label="City"
113
112
  placeholder="Search cities…"
114
113
  options={options}
@@ -15,7 +15,7 @@ Feature-rich data table with sorting and row selection powered by TanStack Table
15
15
  | `caption` | `ReactNode` | | Names the table for assistive tech (and its scroll region). Shown below the table; add `captionHidden` to keep it screen-reader only. |
16
16
  | `enableSorting` | `boolean` | `false` | Click a header to sort; Shift+click adds more columns, numbered 1, 2… (5.3). |
17
17
  | `enableRowSelection` | `boolean` | `false` | Turns on row selection state. |
18
- | `selectionColumn` | `boolean` | `false` | With `enableRowSelection` (5.3): a checkbox column, select-page in its header, and "Select all N" across pages. On by default from 6.0. |
18
+ | `selectionColumn` | `boolean` | `true` | With `enableRowSelection`: a checkbox column, select-page in its header, and "Select all N" across pages (on by default from 6.0). `false` keeps selection without the column. |
19
19
  | `rowSelection / onRowSelectionChange` | `Record<string, boolean>` | | Controlled selection keyed by row id (5.3). |
20
20
  | `getRowId` | `(row: TData, index: number) => string` | | Stable row ids for selection; defaults to the row index (5.3). |
21
21
  | `bulkActions` | `(rows: TData[], clear: () => void) => ReactNode` | | A floating bar while rows are selected, with the count, your actions and a clear button (5.3). |
@@ -129,7 +129,6 @@ export default function Example() {
129
129
  getRowId={(r) => r.id}
130
130
  enableSorting
131
131
  enableRowSelection
132
- selectionColumn
133
132
  rowSelection={selection}
134
133
  onRowSelectionChange={setSelection}
135
134
  viewOptions
@@ -0,0 +1,46 @@
1
+ # Fieldset
2
+
3
+ Groups related fields under a legend; disabling it disables everything inside.
4
+
5
+ - Package: `@nexub/react` · Category: Form & Input · Status: beta
6
+ - Import: `import { Fieldset } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/fieldset
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `legend` (required) | `ReactNode` | | The group’s name, read before each field inside it. |
14
+ | `description` | `ReactNode` | | Hint under the legend, linked with `aria-describedby`. |
15
+ | `disabled` | `boolean` | | Disables every control inside, natively. |
16
+
17
+ ## Example: Grouped fields
18
+
19
+ ```tsx
20
+ import { Fieldset, FormField, Input } from '@nexub/react';
21
+
22
+ export default function Example() {
23
+ return (
24
+ <Fieldset legend="Billing address" description="Printed on every invoice." className="w-full max-w-sm">
25
+ <FormField.Root name="street">
26
+ <FormField.Label>Street</FormField.Label>
27
+ <FormField.Control>
28
+ <Input autoComplete="street-address" />
29
+ </FormField.Control>
30
+ </FormField.Root>
31
+ <FormField.Root name="city">
32
+ <FormField.Label>City</FormField.Label>
33
+ <FormField.Control>
34
+ <Input autoComplete="address-level2" />
35
+ </FormField.Control>
36
+ </FormField.Root>
37
+ </Fieldset>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ## Accessibility
43
+
44
+ - Renders a native `<fieldset>` and `<legend>`; screen readers announce the legend on entering the group.
45
+
46
+ Related: [form](form.md), [form-field](form-field.md)
@@ -0,0 +1,70 @@
1
+ # Form
2
+
3
+ Validates on submit with the browser’s own checks plus yours, shows each message on its FormField and focuses the first invalid field.
4
+
5
+ - Package: `@nexub/react` · Category: Form & Input · Status: beta
6
+ - Import: `import { Form } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/form
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `onSubmit` | `(data: FormData, event) => void \| Promise` | | Runs only when every field is valid. Return a promise to mark the form busy (`aria-busy`, `useForm().submitting`) until it settles. |
14
+ | `validate` | `(data: FormData) => Record<string, string \| false \| null \| undefined>` | | Checks the browser can’t do (cross-field rules, a zod schema, a server answer). Keys are field names; empty values mean valid. |
15
+ | `onInvalidSubmit` | `(errors: FormErrorItem[]) => void` | | Errors in field order after a failed submit, ready for ErrorSummary. |
16
+ | `useForm()` | `{ errors, submitting } \| null` | | Reads the closest Form’s state, for a submit button or a custom field. |
17
+
18
+ ## Example: Native validation plus a custom rule
19
+
20
+ ```tsx
21
+ 'use client';
22
+
23
+ import * as React from 'react';
24
+ import { Button, Form, FormField, Input, useForm } from '@nexub/react';
25
+
26
+ function Submit() {
27
+ const submitting = useForm()?.submitting;
28
+ return (
29
+ <Button type="submit" className="self-start" disabled={submitting}>
30
+ {submitting ? 'Inviting…' : 'Send invite'}
31
+ </Button>
32
+ );
33
+ }
34
+
35
+ export default function Example() {
36
+ const [sent, setSent] = React.useState('');
37
+ return (
38
+ <Form
39
+ className="w-full max-w-sm"
40
+ validate={(data) => ({
41
+ email: String(data.get('email')).endsWith('@example.com') && 'Use a work address, not example.com',
42
+ })}
43
+ onSubmit={async (data) => {
44
+ await new Promise((r) => setTimeout(r, 600));
45
+ setSent(`Invite sent to ${data.get('email')}`);
46
+ }}
47
+ >
48
+ <FormField.Root name="email" required>
49
+ <FormField.Label>Email</FormField.Label>
50
+ <FormField.Control>
51
+ <Input type="email" autoComplete="email" />
52
+ </FormField.Control>
53
+ <FormField.Error />
54
+ </FormField.Root>
55
+ <Submit />
56
+ <p aria-live="polite" className="text-body-sm text-[var(--color-on-surface-muted)]">{sent}</p>
57
+ </Form>
58
+ );
59
+ }
60
+ ```
61
+
62
+ ## Accessibility
63
+
64
+ - `Enter`: Submits from any text field; the first invalid field takes focus.
65
+ - Messages come from the browser’s constraint validation (`required`, `type="email"`, `pattern`, `min`…), so they are already in the reader’s language.
66
+ - FormField.Root with the same `name` picks the message up: the control gets `aria-invalid` and `aria-describedby`, and FormField.Error shows the text.
67
+ - A field’s error clears as soon as it is edited; the rest stay until the next submit.
68
+ - For long forms, render ErrorSummary (@nexub/patterns) from `onInvalidSubmit`.
69
+
70
+ Related: [form-field](form-field.md), [fieldset](fieldset.md)
@@ -0,0 +1,50 @@
1
+ # Inline Edit
2
+
3
+ Text that becomes an input on click, for renaming things in place.
4
+
5
+ - Package: `@nexub/react` · Category: Form & Input · Status: beta
6
+ - Import: `import { InlineEdit } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/inline-edit
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `value` (required) | `string` | | The saved text. |
14
+ | `onSave` (required) | `(value: string) => void \| Promise` | | Called on Enter or blur when the text changed. A promise keeps the field open and busy; a rejection keeps it open and invalid. |
15
+ | `label` (required) | `string` | | Names the input, and the button reads "Edit ‹label›, ‹value›". |
16
+ | `placeholder` | `string` | | Shown when the value is empty. |
17
+ | `disabled` | `boolean` | | Shows the text without editing. |
18
+
19
+ ## Example: Rename
20
+
21
+ ```tsx
22
+ 'use client';
23
+
24
+ import * as React from 'react';
25
+ import { InlineEdit } from '@nexub/react';
26
+
27
+ export default function Example() {
28
+ const [name, setName] = React.useState('Q4 launch plan');
29
+ return (
30
+ <InlineEdit
31
+ label="Project name"
32
+ placeholder="Add a name"
33
+ value={name}
34
+ onSave={(next) => {
35
+ if (!next.trim()) return Promise.reject(new Error('Name is required'));
36
+ setName(next.trim());
37
+ }}
38
+ />
39
+ );
40
+ }
41
+ ```
42
+
43
+ ## Accessibility
44
+
45
+ - `Enter / Space`: On the text: starts editing.
46
+ - `Enter`: In the input: saves.
47
+ - `Escape`: Reverts and returns focus to the text.
48
+ - Moving focus away saves too. Validate in `onSave` and reject to keep the field open.
49
+
50
+ Related: [input](input.md), [form](form.md)
@@ -1,6 +1,6 @@
1
1
  # Component index
2
2
 
3
- Nexub DS v5.9.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v6.1.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
@@ -67,8 +67,11 @@ Never use a component marked deprecated.
67
67
 
68
68
  - [Date Picker](components/date-picker.md) `@nexub/react`: Calendar date picker with text input.
69
69
  - [Date Range Picker](components/date-range-picker.md) `@nexub/react`: Dual-calendar date range selector.
70
+ - [Fieldset](components/fieldset.md) `@nexub/react`: Groups related fields under a legend; disabling it disables everything inside.
71
+ - [Form](components/form.md) `@nexub/react`: Validates on submit with the browser’s own checks plus yours, shows each message on its FormField and focuses the first invalid field.
70
72
  - [Form Field](components/form-field.md) `@nexub/react`: Wraps Label, Input, HelperText and FormError into a single accessible group.
71
73
  - [Helper Text](components/helper-text.md) `@nexub/react`: Small supporting text placed beneath a form field to provide hints or validation feedback.
74
+ - [Inline Edit](components/inline-edit.md) `@nexub/react`: Text that becomes an input on click, for renaming things in place.
72
75
  - [Input](components/input.md) `@nexub/react`: Text input field for forms. Supports size variants, icons, addons, and validation states.
73
76
  - [Label](components/label.md) `@nexub/react`: An accessible form label that optionally shows a required asterisk and links to an input via htmlFor.
74
77
  - [Money Input](components/money-input.md) `@nexub/react`: An amount field: locale-aware parsing as you type, grouped on blur, the currency symbol leading.
@@ -1,6 +1,6 @@
1
1
  # Tokens
2
2
 
3
- Nexub DS v5.9.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v6.1.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.9.0",
3
+ "version": "6.1.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",