@nexub/mcp 4.2.0 → 4.4.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.
@@ -32,6 +32,7 @@ Triggers an action or event. Supports multiple variants, sizes, and semantic ton
32
32
  | `successLabel` | `string` | `'Done'` | Announced on `success`. When set, it also replaces the visible label (with a check) instead of showing the check alone. |
33
33
  | `errorLabel` | `string` | `'Something went wrong'` | Announced on `error`. |
34
34
  | `disabled` | `boolean` | `false` | Disables the button. |
35
+ | `magnetic` | `boolean` | `false` | 4.3: drifts a few pixels toward the pointer on hover. For one key action per screen. Off for touch and reduced motion. |
35
36
  | `fullWidth` | `boolean` | `false` | Stretches the button to fill its container. |
36
37
  | `leadingIcon` | `React.ReactNode` | | Icon rendered before the label. |
37
38
  | `trailingIcon` | `React.ReactNode` | | Icon rendered after the label. |
@@ -145,6 +146,18 @@ export default function Example() {
145
146
  }
146
147
  ```
147
148
 
149
+ ## Example: Magnetic
150
+
151
+ `magnetic` (4.3): drifts toward the pointer. Use it for one key action per screen.
152
+
153
+ ```tsx
154
+ import { Button } from '@nexub/react';
155
+
156
+ export default function Example() {
157
+ return <Button magnetic size="lg">Start free trial</Button>;
158
+ }
159
+ ```
160
+
148
161
  ## Accessibility
149
162
 
150
163
  - Roles: button
@@ -12,7 +12,7 @@ Surface container for grouping related content. Supports flat, surface, and inte
12
12
  | --- | --- | --- | --- |
13
13
  | `variant` | `'flat' \| 'surface' \| 'interactive' \| 'showcase'` | `'flat'` | `interactive` lifts 2px on hover (spatial spring, elevation 1 → 2), sinks to 0.99 on press and adds a state layer. Use it for cards that are links or buttons. `showcase` is the marketing-mode card (24px corners, soft shadow, hover lift); a flat card outside `data-mode="marketing"`. |
14
14
  | `accent` | `'leap' \| 'bookub' \| 'payub' \| 'founderub'` | | With `variant="showcase"`: a product-coloured top edge and tint in marketing mode. Sets `data-product` on the card. Only for product-specific content. |
15
- | `effect` | `'none' \| 'sheen'` | `'none'` | Opt-in. `sheen` is a soft light that follows the pointer, with a brighter rim near the edge. Off for touch, reduced motion and reduced transparency. |
15
+ | `effect` | `'none' \| 'sheen' \| 'tilt'` | `'none'` | Opt-in. `sheen` is a soft light that follows the pointer, with a brighter rim near the edge. `tilt` (4.3) also leans the card toward the pointer in 3D. Off for touch, reduced motion and reduced transparency. |
16
16
  | `tone` | `ToneValue` | `undefined` | Applies a semantic left-border accent. |
17
17
  | `asChild` | `boolean` | `false` | Merges props onto the immediate child element. |
18
18
  | `surface` | `'solid' \| 'glass'` | `'solid'` | Liquid-glass material treatment — see Foundations → Materials. |
@@ -122,6 +122,27 @@ export default function Example() {
122
122
  }
123
123
  ```
124
124
 
125
+ ## Example: Tilt
126
+
127
+ `effect="tilt"` (4.3): the card leans toward the pointer and the sheen catches the light. Hover with a mouse.
128
+
129
+ ```tsx
130
+ import { Card } from '@nexub/react';
131
+
132
+ export default function Example() {
133
+ return (
134
+ <div className="grid w-full grid-cols-2 gap-4">
135
+ {['Revenue', 'Customers'].map((t) => (
136
+ <Card key={t} variant="interactive" effect="tilt" className="p-6">
137
+ <p className="m-0 text-label-md text-[var(--color-on-surface-variant)]">{t}</p>
138
+ <p className="m-0 text-title-lg">{t === 'Revenue' ? '$68,420' : '1,204'}</p>
139
+ </Card>
140
+ ))}
141
+ </div>
142
+ );
143
+ }
144
+ ```
145
+
125
146
  ## Accessibility
126
147
 
127
148
  - Roles: region (when used as a landmark)
@@ -0,0 +1,52 @@
1
+ # Celebrate
2
+
3
+ A short confetti burst for a real win, such as a first payment or finishing onboarding.
4
+
5
+ - Package: `@nexub/react` · Category: Feedback · Status: beta
6
+ - Import: `import { Celebrate } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/celebrate
8
+
9
+ ## When to use
10
+
11
+ - A rare, real win the user worked for: first payment received, onboarding finished, a goal reached.
12
+
13
+ ## When not to use
14
+
15
+ - Routine saves or every success; use the Button success state or a Toast.
16
+ - As the only feedback: say what happened in text too.
17
+
18
+ ## Props
19
+
20
+ | Prop | Type | Default | Description |
21
+ | --- | --- | --- | --- |
22
+ | `active` (required) | `boolean` | | Bursts each time this goes from false to true. |
23
+ | `count` | `number` | `28` | Number of pieces. |
24
+
25
+ ## Example: On a win
26
+
27
+ ```tsx
28
+ 'use client';
29
+
30
+ import * as React from 'react';
31
+ import { Button, Celebrate } from '@nexub/react';
32
+
33
+ export default function Example() {
34
+ const [paid, setPaid] = React.useState(false);
35
+ return (
36
+ <div className="relative flex flex-col items-center gap-3 py-10">
37
+ <Celebrate active={paid} />
38
+ <Button magnetic status={paid ? 'success' : 'idle'} successLabel="Paid" onClick={() => setPaid((p) => !p)}>
39
+ Pay $1,250
40
+ </Button>
41
+ <p role="status" className="m-0 min-h-5 text-body-sm text-[var(--color-on-surface-variant)]">{paid ? 'Payment sent. Your first one!' : ''}</p>
42
+ </div>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ## Accessibility
48
+
49
+ - Decorative (`aria-hidden`). Announce the win in text, for example in a Toast or a status message.
50
+ - Hidden under reduced motion.
51
+
52
+ Related: [toast](toast.md), [button](button.md)
@@ -0,0 +1,36 @@
1
+ # Floating Input
2
+
3
+ A text field whose label sits inside and floats up on focus or input. CSS only.
4
+
5
+ - Package: `@nexub/react` · Category: Forms · Status: beta
6
+ - Import: `import { FloatingInput } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/floating-input
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `label` (required) | `string` | | Always visible: inside the empty field, above the value otherwise. |
14
+ | `...input` | `InputHTMLAttributes` | | Any input attribute except `placeholder`. Set `aria-invalid` for errors. |
15
+
16
+ ## Example: Sign-in form
17
+
18
+ ```tsx
19
+ import { Button, FloatingInput } from '@nexub/react';
20
+
21
+ export default function Example() {
22
+ return (
23
+ <form className="flex w-full max-w-sm flex-col gap-3">
24
+ <FloatingInput label="Email" type="email" autoComplete="email" />
25
+ <FloatingInput label="Password" type="password" autoComplete="current-password" />
26
+ <Button type="submit">Sign in</Button>
27
+ </form>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ## Accessibility
33
+
34
+ - A real `<label>` tied to the input, so the name never disappears.
35
+
36
+ Related: [input](input.md), [form-field](form-field.md)
@@ -0,0 +1,34 @@
1
+ # Scroll Progress
2
+
3
+ A thin bar along the top that fills as the page scrolls. CSS only.
4
+
5
+ - Package: `@nexub/react` · Category: Motion · Status: beta
6
+ - Import: `import { ScrollProgress } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/scroll-progress
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `className` | `string` | | Position or colour overrides. Defaults to the accent (the Vivid gradient under data-expression="vivid"). |
14
+
15
+ ## Example: Long page
16
+
17
+ ```tsx
18
+ import { ScrollProgress } from '@nexub/react';
19
+
20
+ export default function Example() {
21
+ return (
22
+ <div className="w-full text-body-sm text-[var(--color-on-surface-variant)]">
23
+ <ScrollProgress />
24
+ Scroll this page: the bar along the very top of the window fills as you read.
25
+ </div>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ## Accessibility
31
+
32
+ - Decorative (`aria-hidden`); hidden under reduced motion and where scroll-driven animations are not supported.
33
+
34
+ Related: [scroll-area](scroll-area.md)
@@ -0,0 +1,53 @@
1
+ # Shared Element
2
+
3
+ Morphs the same element between two states or pages inside a view transition.
4
+
5
+ - Package: `@nexub/react` · Category: Motion · Status: beta
6
+ - Import: `import { SharedElement } from '@nexub/react';`
7
+ - Docs: https://nexub-ds-docs.pages.dev/components/shared-element
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | --- | --- | --- | --- |
13
+ | `name` (required) | `string` | | Same name on both sides, e.g. `avatar-${id}`. One element per name on screen at a time. |
14
+ | `children` (required) | `ReactElement` | | One element; the name is set on it. |
15
+
16
+ ## Example: List to detail
17
+
18
+ ```tsx
19
+ 'use client';
20
+
21
+ import * as React from 'react';
22
+ import { Avatar, Button, Card, SharedElement, startViewTransition } from '@nexub/react';
23
+
24
+ const people = [{ id: 'sl', name: 'Sam Lee', role: 'Finance' }, { id: 'ar', name: 'Ana Ruiz', role: 'Design' }];
25
+
26
+ export default function Example() {
27
+ const [open, setOpen] = React.useState<string | null>(null);
28
+ const person = people.find((p) => p.id === open);
29
+ const go = (id: string | null) => startViewTransition(() => setOpen(id));
30
+ return person ? (
31
+ <Card variant="surface" className="flex w-full flex-col items-center gap-3 p-8">
32
+ <SharedElement name={`avatar-${person.id}`}><Avatar size="xl" fallback={person.id.toUpperCase()} /></SharedElement>
33
+ <p className="m-0 text-title-lg">{person.name}</p>
34
+ <Button variant="outlined" onClick={() => go(null)}>Back</Button>
35
+ </Card>
36
+ ) : (
37
+ <div className="flex w-full flex-col gap-2">
38
+ {people.map((p) => (
39
+ <button key={p.id} type="button" onClick={() => go(p.id)} className="nx-state-layer flex items-center gap-3 rounded-shape-container border border-[var(--color-outline-variant)] p-3 text-start">
40
+ <SharedElement name={`avatar-${p.id}`}><Avatar size="sm" fallback={p.id.toUpperCase()} /></SharedElement>
41
+ <span className="text-body-md">{p.name} · {p.role}</span>
42
+ </button>
43
+ ))}
44
+ </div>
45
+ );
46
+ }
47
+ ```
48
+
49
+ ## Accessibility
50
+
51
+ - Visual only: run the change in `startViewTransition()` and move focus to the new view as usual.
52
+
53
+ Related: [motion-fade](motion-fade.md)
@@ -1,6 +1,6 @@
1
1
  # Component index
2
2
 
3
- Nexub DS v4.2.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v4.4.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
@@ -50,6 +50,7 @@ Never use a component marked deprecated.
50
50
  ## Components — Feedback
51
51
 
52
52
  - [Alert](components/alert.md) `@nexub/react`: Inline contextual message with optional title, icon, and dismiss action.
53
+ - [Celebrate](components/celebrate.md) `@nexub/react`: A short confetti burst for a real win, such as a first payment or finishing onboarding.
53
54
  - [Spinner](components/spinner.md) `@nexub/react`: Animated loading indicator. Inherits color from context.
54
55
  - [Toast](components/toast.md) `@nexub/react`: Imperative toast notifications using the toast object. Render <Toaster /> once in your layout.
55
56
 
@@ -78,6 +79,10 @@ Never use a component marked deprecated.
78
79
  - [Select](components/select.md) `@nexub/react`: Accessible dropdown select built on Radix UI. Supports groups and search.
79
80
  - [Switch](components/switch.md) `@nexub/react`: Toggle control for binary on/off settings. Built on Radix UI Switch.
80
81
 
82
+ ## Components — Forms
83
+
84
+ - [Floating Input](components/floating-input.md) `@nexub/react`: A text field whose label sits inside and floats up on focus or input. CSS only.
85
+
81
86
  ## Components — Inline Primitives
82
87
 
83
88
  - [Aurora](components/aurora.md) `@nexub/react`: A decorative background of slow-drifting colour fields from the accent roles. Subtle by default, richer under data-expression="vivid".
@@ -124,6 +129,8 @@ Never use a component marked deprecated.
124
129
  - [Reveal](components/motion-reveal.md) `@nexub/react`: Fades its content up as it scrolls into view, in marketing mode. CSS scroll-driven where supported, an IntersectionObserver elsewhere; content on screen at load, and every visitor without JS or with reduced motion, just sees it.
125
130
  - [Scale](components/motion-scale.md) `@nexub/react`: Scales content in/out from its center.
126
131
  - [Slide](components/motion-slide.md) `@nexub/react`: Slides content in from a direction based on the `in` prop.
132
+ - [Scroll Progress](components/scroll-progress.md) `@nexub/react`: A thin bar along the top that fills as the page scrolls. CSS only.
133
+ - [Shared Element](components/shared-element.md) `@nexub/react`: Morphs the same element between two states or pages inside a view transition.
127
134
 
128
135
  ## Components — Navigation
129
136
 
@@ -1,6 +1,6 @@
1
1
  # Tokens
2
2
 
3
- Nexub DS v4.2.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v4.4.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": "4.2.0",
3
+ "version": "4.4.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",