@nexub/mcp 0.0.0-stage → 1.7.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/README.md +40 -2
- package/dist/skill/SKILL.md +97 -0
- package/dist/skill/references/components/accordion.md +77 -0
- package/dist/skill/references/components/activity-feed.md +33 -0
- package/dist/skill/references/components/alert-dialog.md +48 -0
- package/dist/skill/references/components/alert.md +54 -0
- package/dist/skill/references/components/amount.md +34 -0
- package/dist/skill/references/components/auth-card.md +33 -0
- package/dist/skill/references/components/autocomplete.md +54 -0
- package/dist/skill/references/components/avatar-group.md +26 -0
- package/dist/skill/references/components/avatar.md +48 -0
- package/dist/skill/references/components/badge.md +71 -0
- package/dist/skill/references/components/banner.md +32 -0
- package/dist/skill/references/components/bento-grid.md +42 -0
- package/dist/skill/references/components/box.md +35 -0
- package/dist/skill/references/components/breadcrumb.md +61 -0
- package/dist/skill/references/components/button-group.md +43 -0
- package/dist/skill/references/components/button.md +118 -0
- package/dist/skill/references/components/callout.md +27 -0
- package/dist/skill/references/components/card.md +74 -0
- package/dist/skill/references/components/checkbox-card.md +49 -0
- package/dist/skill/references/components/checkbox.md +51 -0
- package/dist/skill/references/components/chip.md +35 -0
- package/dist/skill/references/components/citation.md +61 -0
- package/dist/skill/references/components/code-inline.md +25 -0
- package/dist/skill/references/components/collapsible.md +71 -0
- package/dist/skill/references/components/combobox.md +40 -0
- package/dist/skill/references/components/conversation.md +100 -0
- package/dist/skill/references/components/data-table.md +69 -0
- package/dist/skill/references/components/date-picker.md +56 -0
- package/dist/skill/references/components/date-range-picker.md +48 -0
- package/dist/skill/references/components/dialog.md +57 -0
- package/dist/skill/references/components/drawer.md +79 -0
- package/dist/skill/references/components/empty-state.md +77 -0
- package/dist/skill/references/components/error-state.md +37 -0
- package/dist/skill/references/components/error-summary.md +71 -0
- package/dist/skill/references/components/eyebrow-chip.md +28 -0
- package/dist/skill/references/components/filter-bar.md +36 -0
- package/dist/skill/references/components/filter-chip.md +26 -0
- package/dist/skill/references/components/flex.md +47 -0
- package/dist/skill/references/components/form-field.md +26 -0
- package/dist/skill/references/components/gradient-divider.md +13 -0
- package/dist/skill/references/components/grid.md +39 -0
- package/dist/skill/references/components/heading.md +46 -0
- package/dist/skill/references/components/helper-text.md +31 -0
- package/dist/skill/references/components/hover-card.md +34 -0
- package/dist/skill/references/components/icon-button.md +44 -0
- package/dist/skill/references/components/info-list.md +25 -0
- package/dist/skill/references/components/input.md +78 -0
- package/dist/skill/references/components/kbd.md +42 -0
- package/dist/skill/references/components/label.md +37 -0
- package/dist/skill/references/components/link.md +38 -0
- package/dist/skill/references/components/list-detail.md +27 -0
- package/dist/skill/references/components/media-card.md +61 -0
- package/dist/skill/references/components/message-bubble.md +68 -0
- package/dist/skill/references/components/money-input.md +30 -0
- package/dist/skill/references/components/motion-collapse.md +57 -0
- package/dist/skill/references/components/motion-fade.md +64 -0
- package/dist/skill/references/components/motion-scale.md +54 -0
- package/dist/skill/references/components/motion-slide.md +60 -0
- package/dist/skill/references/components/navigation-rail.md +29 -0
- package/dist/skill/references/components/notification-item.md +29 -0
- package/dist/skill/references/components/number-input.md +30 -0
- package/dist/skill/references/components/number-ticker.md +44 -0
- package/dist/skill/references/components/pagination.md +52 -0
- package/dist/skill/references/components/password-input.md +28 -0
- package/dist/skill/references/components/plan-card.md +34 -0
- package/dist/skill/references/components/popover.md +53 -0
- package/dist/skill/references/components/progress.md +39 -0
- package/dist/skill/references/components/prompt-input.md +95 -0
- package/dist/skill/references/components/radio-card.md +83 -0
- package/dist/skill/references/components/radio-group.md +57 -0
- package/dist/skill/references/components/rating.md +39 -0
- package/dist/skill/references/components/scroll-area.md +57 -0
- package/dist/skill/references/components/search-input.md +22 -0
- package/dist/skill/references/components/segmented-control.md +44 -0
- package/dist/skill/references/components/select.md +43 -0
- package/dist/skill/references/components/separator.md +30 -0
- package/dist/skill/references/components/settings-section.md +31 -0
- package/dist/skill/references/components/sheet.md +51 -0
- package/dist/skill/references/components/skeleton.md +38 -0
- package/dist/skill/references/components/slider.md +31 -0
- package/dist/skill/references/components/spinner.md +32 -0
- package/dist/skill/references/components/split-button.md +43 -0
- package/dist/skill/references/components/stack.md +35 -0
- package/dist/skill/references/components/stat-card.md +49 -0
- package/dist/skill/references/components/status-pill.md +37 -0
- package/dist/skill/references/components/step-indicator.md +29 -0
- package/dist/skill/references/components/streaming-text.md +53 -0
- package/dist/skill/references/components/switch.md +36 -0
- package/dist/skill/references/components/table.md +89 -0
- package/dist/skill/references/components/tabs.md +51 -0
- package/dist/skill/references/components/tag.md +25 -0
- package/dist/skill/references/components/text-gradient.md +30 -0
- package/dist/skill/references/components/text.md +45 -0
- package/dist/skill/references/components/textarea.md +40 -0
- package/dist/skill/references/components/thinking-indicator.md +50 -0
- package/dist/skill/references/components/toast.md +141 -0
- package/dist/skill/references/components/toggle-group.md +35 -0
- package/dist/skill/references/components/toggle.md +32 -0
- package/dist/skill/references/components/tooltip.md +34 -0
- package/dist/skill/references/components/user-card.md +27 -0
- package/dist/skill/references/components.md +192 -0
- package/dist/skill/references/tokens.md +234 -0
- package/package.json +41 -3
- package/src/cli.js +9 -0
- package/src/server.js +98 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Link
|
|
2
|
+
|
|
3
|
+
Styled anchor link with variant and external support.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Inline Primitives · Status: stable
|
|
6
|
+
- Import: `import { Link } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/link
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `variant` | `'default' \| 'muted' \| 'underline'` | | Visual style of the link. |
|
|
14
|
+
| `external` | `boolean` | | Opens the link in a new tab with appropriate rel attributes. |
|
|
15
|
+
| `href` | `string` | | The URL the link points to. |
|
|
16
|
+
| `asChild` | `boolean` | | Merges props onto the immediate child element (Radix Slot). |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<Link href="#">View documentation</Link>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Example: Variants
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<div style={{ display: 'flex', gap: '16px' }}>
|
|
28
|
+
<Link href="#" variant="default">Default</Link>
|
|
29
|
+
<Link href="#" variant="muted">Muted</Link>
|
|
30
|
+
<Link href="#" variant="underline">Underline</Link>
|
|
31
|
+
</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Example: External
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Link href="#" external>Open in new tab</Link>
|
|
38
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# List Detail
|
|
2
|
+
|
|
3
|
+
The list-detail layout: side by side at 720px+ of its own width (a container query), one pane at a time below.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Layout · Status: beta
|
|
6
|
+
- Import: `import { ListDetail } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/list-detail
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `list / detail` (required) | `ReactNode` | | The two panes. |
|
|
14
|
+
| `showDetail` | `boolean` | `false` | When narrow, show the detail instead of the list (set it on selection). |
|
|
15
|
+
| `onBack` | `() => void` | | Back button, shown only when narrow. |
|
|
16
|
+
| `listWidth` | `'sm' \| 'md' \| 'lg'` | `'md'` | Fixed list width when both panes show (288 / 320 / 400px). |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<ListDetail
|
|
22
|
+
showDetail={selected !== null}
|
|
23
|
+
onBack={() => setSelected(null)}
|
|
24
|
+
list={<MessageList onSelect={setSelected} />}
|
|
25
|
+
detail={<Message id={selected} />}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Media Card
|
|
2
|
+
|
|
3
|
+
An image card with a glass caption over a soft scrim. With `href`, the whole card is one link.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Layout · Status: beta
|
|
6
|
+
- Import: `import { MediaCard } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/media-card
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `src` (required) | `string` | | Image URL. Loaded lazily. |
|
|
14
|
+
| `alt` (required) | `string` | | Image description. Pass '' when the image is decorative. |
|
|
15
|
+
| `ratio` | `'16/9' \| '4/3' \| '1/1' \| '3/4'` | `'16/9'` | Aspect ratio of the image box. |
|
|
16
|
+
| `title` | `ReactNode` | | Caption title, rendered as an h3. |
|
|
17
|
+
| `description` | `ReactNode` | | Caption text under the title. |
|
|
18
|
+
| `eyebrow` | `ReactNode` | | Small label above the title. |
|
|
19
|
+
| `href` | `string` | | Makes the whole card one link, stretched from the title (so it needs `title`). Adds the hover lift and image zoom. |
|
|
20
|
+
| `children` | `ReactNode` | | Actions under the caption. They stay clickable above the stretched link. |
|
|
21
|
+
|
|
22
|
+
## Example: With link
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<MediaCard
|
|
26
|
+
src="/covers/lisbon.jpg"
|
|
27
|
+
alt=""
|
|
28
|
+
eyebrow="Guide"
|
|
29
|
+
title="A weekend in Lisbon"
|
|
30
|
+
description="Where to eat, walk and stay."
|
|
31
|
+
href="/guides/lisbon"
|
|
32
|
+
/>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Example: Without link, with actions
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<MediaCard src="/covers/q3.jpg" alt="" title="Q3 brand shoot" description="48 photos">
|
|
39
|
+
<Button size="sm" variant="tonal">Open</Button>
|
|
40
|
+
<Button size="sm" variant="text">Share</Button>
|
|
41
|
+
</MediaCard>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Example: Ratios
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<MediaCard ratio="16/9" src={src} alt="" title="16/9" />
|
|
48
|
+
<MediaCard ratio="4/3" src={src} alt="" title="4/3" />
|
|
49
|
+
<MediaCard ratio="1/1" src={src} alt="" title="1/1" />
|
|
50
|
+
<MediaCard ratio="3/4" src={src} alt="" title="3/4" />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
|
|
55
|
+
- Roles: link (when `href` is set), heading level 3 (title)
|
|
56
|
+
- `Tab`: Focuses the link (the card shows the focus ring), then any actions.
|
|
57
|
+
- `Enter`: Follows the link.
|
|
58
|
+
- With `href`, the link’s name is the title only, not the whole caption.
|
|
59
|
+
- Most card images repeat the title, so `alt=""` is usually right.
|
|
60
|
+
|
|
61
|
+
Related: [card](card.md)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Message Bubble
|
|
2
|
+
|
|
3
|
+
One message in a conversation. User messages sit in a bubble at the end; assistant replies run full width. MessageActions adds copy, feedback and regenerate.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: AI · Status: beta
|
|
6
|
+
- Import: `import { MessageBubble } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/message-bubble
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Each turn in a chat or assistant thread, inside Conversation.
|
|
12
|
+
- MessageActions under assistant replies the user may want to copy, rate or retry.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
|
|
16
|
+
- Comment threads and activity logs: use ActivityFeed or NotificationItem.
|
|
17
|
+
- Model output as HTML: render text or React elements as children, never `dangerouslySetInnerHTML`.
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `from` (required) | `'user' \| 'assistant' \| 'system'` | | Who sent it. Sets layout and the default accessible name. |
|
|
24
|
+
| `avatar` | `ReactNode` | | Assistant only: shown at the inline start. |
|
|
25
|
+
| `name` | `string` | | Accessible name of the message. Defaults to "You said" or "Assistant said". |
|
|
26
|
+
| `status` | `'sending' \| 'error'` | | `sending` sets `aria-busy`; `error` shows "Failed to send". |
|
|
27
|
+
| `onRetry` | `() => void` | | With `status="error"`, adds a Retry button. |
|
|
28
|
+
| `messages` | `Partial<MessageStrings>` | | Local string overrides. |
|
|
29
|
+
| `MessageActions text` | `string` | | Text Copy puts on the clipboard. |
|
|
30
|
+
| `MessageActions copy` | `boolean` | `true` | Set false to hide Copy. |
|
|
31
|
+
| `MessageActions feedback / defaultFeedback / onFeedback` | `'up' \| 'down' \| null` | | Thumbs up/down appear when `onFeedback` is set. Pressing the active one clears it. |
|
|
32
|
+
| `MessageActions onRegenerate` | `() => void` | | Shows Regenerate when set. |
|
|
33
|
+
|
|
34
|
+
## Example: Conversation
|
|
35
|
+
|
|
36
|
+
Hover or focus the assistant reply to show its actions.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<MessageBubble from="user">How do I cancel my subscription?</MessageBubble>
|
|
40
|
+
<MessageBubble from="assistant" avatar={<Avatar size="sm" fallback={<Sparkles />} />}>
|
|
41
|
+
<p>Open Settings, then Billing, and choose Cancel plan. You keep access until the end of the billing period.</p>
|
|
42
|
+
<MessageActions
|
|
43
|
+
text="Open Settings, then Billing, and choose Cancel plan."
|
|
44
|
+
onFeedback={(value) => logFeedback(value)}
|
|
45
|
+
onRegenerate={() => regenerate()}
|
|
46
|
+
/>
|
|
47
|
+
</MessageBubble>
|
|
48
|
+
<MessageBubble from="system">Conversation moved to Billing support</MessageBubble>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Example: Failed to send
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<MessageBubble from="user" status="error" onRetry={() => resend()}>
|
|
55
|
+
Can I get a refund for last month?
|
|
56
|
+
</MessageBubble>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Accessibility
|
|
60
|
+
|
|
61
|
+
- Roles: article (each message), alert (send error), button (actions)
|
|
62
|
+
- `Tab`: Moves through the action buttons; focusing one reveals the row.
|
|
63
|
+
- `Space / Enter`: Activates an action. Feedback buttons toggle.
|
|
64
|
+
- Each message is an `article` named "You said" or "Assistant said", so users can jump between messages.
|
|
65
|
+
- Feedback buttons expose `aria-pressed`. Copy announces "Copied" through a status region.
|
|
66
|
+
- The action row is only visually hidden until hover; it stays in the tab order and accessibility tree.
|
|
67
|
+
|
|
68
|
+
Related: [streaming-text](streaming-text.md), [conversation](conversation.md), [citation](citation.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Money Input
|
|
2
|
+
|
|
3
|
+
An amount field: locale-aware parsing as you type, grouped on blur, the currency symbol leading.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form & Input · Status: beta
|
|
6
|
+
- Import: `import { MoneyInput } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/money-input
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `currency` (required) | `string` | | ISO 4217 code, e.g. "EUR". |
|
|
14
|
+
| `locale` | `string` | | BCP 47 locale for separators. Defaults to the user's. |
|
|
15
|
+
| `value / defaultValue` | `number \| null` | | The amount, or null when empty. |
|
|
16
|
+
| `onValueChange` | `(value: number \| null) => void` | | Parsed amount, rounded to the minor unit, as the person types. |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<MoneyInput aria-label="Amount to send" currency="USD" defaultValue={1250} onValueChange={setAmount} />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Example: German separators
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<MoneyInput aria-label="Betrag" currency="EUR" locale="de-DE" defaultValue={1234.5} />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Related: [amount](amount.md), [number-input](number-input.md), [input](input.md)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Collapse
|
|
2
|
+
|
|
3
|
+
Expands and collapses content along the block axis.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Motion · Status: stable
|
|
6
|
+
- Import: `import { MotionCollapse } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/motion-collapse
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `in` (required) | `boolean` | | When true, expands the content to its natural height. When false, collapses it to zero height. |
|
|
14
|
+
| `duration` | `'instant' \| 'fast' \| 'normal' \| 'slow' \| 'slower'` | `'normal'` | Controls the animation speed using the design token scale. |
|
|
15
|
+
| `easing` | `'linear' \| 'in' \| 'out' \| 'in-out' \| 'out-expo' \| 'spring'` | `'out'` | Easing curve applied to the animation. |
|
|
16
|
+
| `unmountOnExit` | `boolean` | `false` | Removes the element from the DOM after the collapse animation completes. |
|
|
17
|
+
| `as` | `React.ElementType` | `'div'` | The HTML element or component to render as the wrapper. |
|
|
18
|
+
| `children` (required) | `React.ReactNode` | | Content to expand and collapse. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Collapse in={true}>
|
|
24
|
+
<div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
|
|
25
|
+
Collapsed content
|
|
26
|
+
</div>
|
|
27
|
+
</Collapse>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example: Toggle
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
function CollapseToggle() {
|
|
34
|
+
const [open, setOpen] = React.useState(false);
|
|
35
|
+
return (
|
|
36
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
37
|
+
<Button variant="outline" onClick={() => setOpen((o) => !o)}>
|
|
38
|
+
{open ? 'Collapse' : 'Expand'}
|
|
39
|
+
</Button>
|
|
40
|
+
<Collapse in={open} unmountOnExit>
|
|
41
|
+
<div
|
|
42
|
+
style={{
|
|
43
|
+
padding: '16px',
|
|
44
|
+
background: 'var(--color-bg-subtle)',
|
|
45
|
+
borderRadius: 'var(--radius-md)',
|
|
46
|
+
color: 'var(--color-text-secondary)',
|
|
47
|
+
fontSize: '0.875rem',
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
This section smoothly expands and collapses along the vertical axis.
|
|
51
|
+
It preserves the natural document flow by animating the block size.
|
|
52
|
+
</div>
|
|
53
|
+
</Collapse>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Fade
|
|
2
|
+
|
|
3
|
+
Animates opacity between 0 and 1 based on the `in` prop.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Motion · Status: stable
|
|
6
|
+
- Import: `import { MotionFade } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/motion-fade
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `in` (required) | `boolean` | | When true, fades content in. When false, fades it out. |
|
|
14
|
+
| `duration` | `'instant' \| 'fast' \| 'normal' \| 'slow' \| 'slower'` | `'normal'` | Controls the animation speed using the design token scale. |
|
|
15
|
+
| `easing` | `'linear' \| 'in' \| 'out' \| 'in-out' \| 'out-expo' \| 'spring'` | `'out'` | Easing curve applied to the animation. |
|
|
16
|
+
| `unmountOnExit` | `boolean` | `false` | Removes the element from the DOM after the exit animation completes. |
|
|
17
|
+
| `as` | `React.ElementType` | `'div'` | The HTML element or component to render as the wrapper. |
|
|
18
|
+
| `children` (required) | `React.ReactNode` | | Content to animate. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Fade in={true}>
|
|
24
|
+
<Card>Faded in content</Card>
|
|
25
|
+
</Fade>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example: Toggle
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
function FadeToggle() {
|
|
32
|
+
const [visible, setVisible] = React.useState(true);
|
|
33
|
+
return (
|
|
34
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
35
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>
|
|
36
|
+
{visible ? 'Fade out' : 'Fade in'}
|
|
37
|
+
</Button>
|
|
38
|
+
<Fade in={visible} duration="normal" easing="out" unmountOnExit>
|
|
39
|
+
<Card style={{ padding: '16px' }}>
|
|
40
|
+
This content fades in and out. Toggle the button to animate it.
|
|
41
|
+
</Card>
|
|
42
|
+
</Fade>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Example: Slow with spring easing
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
function SlowFade() {
|
|
52
|
+
const [visible, setVisible] = React.useState(true);
|
|
53
|
+
return (
|
|
54
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
55
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>Toggle</Button>
|
|
56
|
+
<Fade in={visible} duration="slow" easing="spring">
|
|
57
|
+
<div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
|
|
58
|
+
Slow spring fade animation.
|
|
59
|
+
</div>
|
|
60
|
+
</Fade>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Scale
|
|
2
|
+
|
|
3
|
+
Scales content in/out from its center.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Motion · Status: stable
|
|
6
|
+
- Import: `import { MotionScale } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/motion-scale
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `in` (required) | `boolean` | | When true, scales content in from 0 to 1. When false, scales it back down to 0. |
|
|
14
|
+
| `duration` | `'instant' \| 'fast' \| 'normal' \| 'slow' \| 'slower'` | `'normal'` | Controls the animation speed using the design token scale. |
|
|
15
|
+
| `easing` | `'linear' \| 'in' \| 'out' \| 'in-out' \| 'out-expo' \| 'spring'` | `'out'` | Easing curve applied to the animation. |
|
|
16
|
+
| `unmountOnExit` | `boolean` | `false` | Removes the element from the DOM after the exit animation completes. |
|
|
17
|
+
| `as` | `React.ElementType` | `'div'` | The HTML element or component to render as the wrapper. |
|
|
18
|
+
| `children` (required) | `React.ReactNode` | | Content to animate. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Scale in={true}>
|
|
24
|
+
<Card>Scaled content</Card>
|
|
25
|
+
</Scale>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example: Toggle
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
function ScaleToggle() {
|
|
32
|
+
const [visible, setVisible] = React.useState(true);
|
|
33
|
+
return (
|
|
34
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
35
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>
|
|
36
|
+
{visible ? 'Scale out' : 'Scale in'}
|
|
37
|
+
</Button>
|
|
38
|
+
<Scale in={visible} duration="fast" easing="spring" unmountOnExit>
|
|
39
|
+
<div
|
|
40
|
+
style={{
|
|
41
|
+
padding: '24px',
|
|
42
|
+
background: 'var(--color-bg-subtle)',
|
|
43
|
+
borderRadius: 'var(--radius-md)',
|
|
44
|
+
textAlign: 'center',
|
|
45
|
+
color: 'var(--color-text-secondary)',
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
Pop!
|
|
49
|
+
</div>
|
|
50
|
+
</Scale>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Slide
|
|
2
|
+
|
|
3
|
+
Slides content in from a direction based on the `in` prop.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Motion · Status: stable
|
|
6
|
+
- Import: `import { MotionSlide } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/motion-slide
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `in` (required) | `boolean` | | When true, slides content in. When false, slides it out. |
|
|
14
|
+
| `direction` | `'up' \| 'down' \| 'left' \| 'right'` | `'up'` | The direction from which the content slides in. |
|
|
15
|
+
| `duration` | `'instant' \| 'fast' \| 'normal' \| 'slow' \| 'slower'` | `'normal'` | Controls the animation speed using the design token scale. |
|
|
16
|
+
| `easing` | `'linear' \| 'in' \| 'out' \| 'in-out' \| 'out-expo' \| 'spring'` | `'out'` | Easing curve applied to the animation. |
|
|
17
|
+
| `unmountOnExit` | `boolean` | `false` | Removes the element from the DOM after the exit animation completes. |
|
|
18
|
+
| `as` | `React.ElementType` | `'div'` | The HTML element or component to render as the wrapper. |
|
|
19
|
+
| `children` (required) | `React.ReactNode` | | Content to animate. |
|
|
20
|
+
|
|
21
|
+
## Example: Default
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<Slide in={true} direction="up">
|
|
25
|
+
<Card>Slid in from bottom</Card>
|
|
26
|
+
</Slide>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Example: Directions
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
function SlideDirections() {
|
|
33
|
+
const [visible, setVisible] = React.useState(true);
|
|
34
|
+
const [direction, setDirection] = React.useState('up');
|
|
35
|
+
return (
|
|
36
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
37
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
38
|
+
{['up', 'down', 'left', 'right'].map((dir) => (
|
|
39
|
+
<Button
|
|
40
|
+
key={dir}
|
|
41
|
+
variant={direction === dir ? 'primary' : 'outline'}
|
|
42
|
+
size="sm"
|
|
43
|
+
onClick={() => { setDirection(dir); setVisible(true); }}
|
|
44
|
+
>
|
|
45
|
+
{dir}
|
|
46
|
+
</Button>
|
|
47
|
+
))}
|
|
48
|
+
<Button variant="ghost" size="sm" onClick={() => setVisible((v) => !v)}>
|
|
49
|
+
Toggle
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
<Slide in={visible} direction={direction} unmountOnExit>
|
|
53
|
+
<div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
|
|
54
|
+
Sliding in from {direction}.
|
|
55
|
+
</div>
|
|
56
|
+
</Slide>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Navigation Rail
|
|
2
|
+
|
|
3
|
+
Navigation for medium-width windows: icons over labels, with an active pill behind the icon.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Navigation · Status: beta
|
|
6
|
+
- Import: `import { NavigationRail } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/navigation-rail
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `Root header` | `ReactNode` | | Slot above the items, e.g. a primary action. |
|
|
14
|
+
| `Root aria-label` | `string` | `'Main'` | Name of the nav landmark. |
|
|
15
|
+
| `Item icon / label` (required) | `ReactNode` | | Icon in the indicator pill; label below. |
|
|
16
|
+
| `Item active` | `boolean` | | Marks the current page (aria-current="page"). |
|
|
17
|
+
| `Item asChild` | `boolean` | | Use your router link as the item; pass it as the only child. |
|
|
18
|
+
|
|
19
|
+
## Example: Default
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
<NavigationRail.Root aria-label="Workspace">
|
|
23
|
+
<NavigationRail.Item href="/" icon={<Home />} label="Home" active />
|
|
24
|
+
<NavigationRail.Item href="/files" icon={<Folder />} label="Files" />
|
|
25
|
+
<NavigationRail.Item href="/settings" icon={<Settings />} label="Settings" />
|
|
26
|
+
</NavigationRail.Root>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Related: [sidebar](sidebar.md), [top-nav](top-nav.md)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# NotificationItem
|
|
2
|
+
|
|
3
|
+
Single notification row for notification panels or dropdowns.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Feedback · Status: stable
|
|
6
|
+
- Import: `import { NotificationItem } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/notification-item
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `title` (required) | `string` | | Notification title. |
|
|
14
|
+
| `description` | `string` | | Supporting text. |
|
|
15
|
+
| `timestamp` | `string` | | Relative time string. |
|
|
16
|
+
| `unread` | `boolean` | `false` | Applies unread indicator styling. |
|
|
17
|
+
| `avatar` | `React.ReactNode` | | Avatar for the notification actor. |
|
|
18
|
+
| `onClick` | `() => void` | | Click handler for the item. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<NotificationItem
|
|
24
|
+
title="New comment on your post"
|
|
25
|
+
description="Alex left a comment on 'Design System v2'"
|
|
26
|
+
timestamp="5 min ago"
|
|
27
|
+
unread
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Number Input
|
|
2
|
+
|
|
3
|
+
A numeric input with increment and decrement controls, supporting min/max clamping and step.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form & Input · Status: stable
|
|
6
|
+
- Import: `import { NumberInput } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/number-input
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `value` | `number` | | Controlled value of the input. |
|
|
14
|
+
| `min` | `number` | | Minimum allowed value. |
|
|
15
|
+
| `max` | `number` | | Maximum allowed value. |
|
|
16
|
+
| `step` | `number` | `1` | Amount to increment or decrement on each step. |
|
|
17
|
+
| `disabled` | `boolean` | | Disables the input and its controls. |
|
|
18
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | | Controls font size and padding. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<NumberInput defaultValue={0} />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Example: With range
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<NumberInput defaultValue={5} min={0} max={10} />
|
|
30
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Number Ticker
|
|
2
|
+
|
|
3
|
+
A number whose digits roll to new values on the spatial spring. The first render never animates.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Data Display · Status: beta
|
|
6
|
+
- Import: `import { NumberTicker } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/number-ticker
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `value` (required) | `number \| string \| NumberTickerPart[]` | | A number (formatted with `format` and `locale`), an already-formatted string, or styled parts. |
|
|
14
|
+
| `format` | `Intl.NumberFormatOptions` | | Formatting for a number `value`. |
|
|
15
|
+
| `locale` | `string` | | BCP 47 locale. Defaults to the user's. |
|
|
16
|
+
| `aria-live` | `'off' \| 'polite'` | `'off'` | Announce changes to screen readers. Use `polite` only for values the user is waiting on. |
|
|
17
|
+
|
|
18
|
+
## Example: Formatted number
|
|
19
|
+
|
|
20
|
+
Each digit is a 0–9 strip; separators and symbols stay still.
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
const [n, setN] = React.useState(12480);
|
|
24
|
+
|
|
25
|
+
<NumberTicker value={n} format={{ maximumFractionDigits: 0 }} className="text-title-lg" />
|
|
26
|
+
<Button size="sm" variant="outlined" onClick={() => setN(Math.round(Math.random() * 100000))}>
|
|
27
|
+
Change
|
|
28
|
+
</Button>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Example: Amount
|
|
32
|
+
|
|
33
|
+
`Amount animate` uses the ticker and keeps the quieter symbol and minor units.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<Amount value={balance} currency="USD" size="display" animate />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Accessibility
|
|
40
|
+
|
|
41
|
+
- The full value is read as one string; the rolling digits are hidden from assistive tech.
|
|
42
|
+
- Under reduced motion digits change instantly.
|
|
43
|
+
|
|
44
|
+
Related: [amount](amount.md), [stat-card](stat-card.md)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
Page navigation control with prev/next and page number buttons.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Navigation · Status: stable
|
|
6
|
+
- Import: `import { Pagination } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/pagination
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `page` (required) | `number` | | The currently active page (1-indexed). |
|
|
14
|
+
| `totalItems` (required) | `number` | | Total number of items across all pages. |
|
|
15
|
+
| `pageSize` | `number` | `10` | Number of items per page. Used to calculate total page count. |
|
|
16
|
+
| `siblingCount` | `number` | `1` | Number of page buttons to show on each side of the current page. |
|
|
17
|
+
| `onPageChange` (required) | `(page: number) => void` | | Callback invoked with the new page number when the user navigates. |
|
|
18
|
+
| `showFirstLast` | `boolean` | `true` | Whether to show First and Last page navigation buttons. |
|
|
19
|
+
| `disabled` | `boolean` | `false` | Disables all pagination controls. |
|
|
20
|
+
|
|
21
|
+
## Example: Default
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
function DefaultPagination() {
|
|
25
|
+
const [page, setPage] = React.useState(3);
|
|
26
|
+
return (
|
|
27
|
+
<Pagination
|
|
28
|
+
page={page}
|
|
29
|
+
totalItems={100}
|
|
30
|
+
pageSize={10}
|
|
31
|
+
onPageChange={setPage}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Example: Large dataset
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
function LargeDatasetPagination() {
|
|
41
|
+
const [page, setPage] = React.useState(5);
|
|
42
|
+
return (
|
|
43
|
+
<Pagination
|
|
44
|
+
page={page}
|
|
45
|
+
totalItems={500}
|
|
46
|
+
pageSize={20}
|
|
47
|
+
siblingCount={2}
|
|
48
|
+
onPageChange={setPage}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|