@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,51 @@
|
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
Alias for Drawer — slide-in sheet panel.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Overlays · Status: stable
|
|
6
|
+
- Import: `import { Sheet } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/sheet
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `Sheet.Root` | `compound` | | Root provider that manages open/close state. Exported from Drawer. |
|
|
14
|
+
| `Sheet.Trigger` | `compound` | | Element that opens the sheet. |
|
|
15
|
+
| `Sheet.Portal` | `compound` | | Portals the overlay and content into the document body. |
|
|
16
|
+
| `Sheet.Overlay` | `compound` | | Dimmed backdrop rendered behind the sheet. |
|
|
17
|
+
| `Sheet.Content` | `compound` | | The sheet panel. Accepts a side prop. |
|
|
18
|
+
| `scrollLock` | `'style' \| 'class'` | | On Sheet.Root. How page scroll is locked while open. `class` adds a class from @nexub/themes/base instead of injecting a <style> tag, so it works under a strict CSP (style-src 'self'). Default `style`. |
|
|
19
|
+
| `side` | `'left' \| 'right' \| 'top' \| 'bottom'` | | Edge of the screen from which the sheet slides in. |
|
|
20
|
+
| `Sheet.Header` | `compound` | | Header section of the sheet panel. |
|
|
21
|
+
| `Sheet.Footer` | `compound` | | Footer section of the sheet panel. |
|
|
22
|
+
| `Sheet.Title` | `compound` | | Accessible title for the sheet. |
|
|
23
|
+
| `Sheet.Description` | `compound` | | Supporting description text for the sheet. |
|
|
24
|
+
| `Sheet.Close` | `compound` | | Element that closes the sheet. |
|
|
25
|
+
|
|
26
|
+
## Example: Default
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<Sheet.Root>
|
|
30
|
+
<Sheet.Trigger asChild>
|
|
31
|
+
<Button variant="outline">Open sheet</Button>
|
|
32
|
+
</Sheet.Trigger>
|
|
33
|
+
<Sheet.Portal>
|
|
34
|
+
<Sheet.Overlay />
|
|
35
|
+
<Sheet.Content side="right">
|
|
36
|
+
<Sheet.Header>
|
|
37
|
+
<Sheet.Title>Notifications</Sheet.Title>
|
|
38
|
+
<Sheet.Description>Review your latest activity.</Sheet.Description>
|
|
39
|
+
</Sheet.Header>
|
|
40
|
+
<div style={{ padding: '16px', flex: 1 }}>
|
|
41
|
+
<Text size="body-sm" tone="secondary">No new notifications.</Text>
|
|
42
|
+
</div>
|
|
43
|
+
<Sheet.Footer>
|
|
44
|
+
<Sheet.Close asChild>
|
|
45
|
+
<Button variant="outline">Close</Button>
|
|
46
|
+
</Sheet.Close>
|
|
47
|
+
</Sheet.Footer>
|
|
48
|
+
</Sheet.Content>
|
|
49
|
+
</Sheet.Portal>
|
|
50
|
+
</Sheet.Root>
|
|
51
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
Placeholder loading animation that mimics content layout.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Loading States · Status: stable
|
|
6
|
+
- Import: `import { Skeleton } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/skeleton
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `shape` | `'line' \| 'rect' \| 'circle'` | `'line'` | Shape of the skeleton placeholder. |
|
|
14
|
+
| `width` | `string \| number` | | Width of the skeleton element. |
|
|
15
|
+
| `height` | `string \| number` | | Height of the skeleton element. |
|
|
16
|
+
| `animated` | `boolean` | `true` | Enables the shimmer animation. |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px', width: '280px', padding: '16px', border: '1px solid #e5e7eb', borderRadius: '8px' }}>
|
|
22
|
+
<Skeleton shape="circle" width={40} height={40} />
|
|
23
|
+
<Skeleton shape="line" width="60%" height={12} />
|
|
24
|
+
<Skeleton shape="line" width="100%" height={12} />
|
|
25
|
+
<Skeleton shape="line" width="80%" height={12} />
|
|
26
|
+
<Skeleton shape="rect" width="100%" height={80} />
|
|
27
|
+
</div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example: Shapes
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
|
34
|
+
<Skeleton shape="line" width={120} height={12} />
|
|
35
|
+
<Skeleton shape="rect" width={80} height={60} />
|
|
36
|
+
<Skeleton shape="circle" width={40} height={40} />
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
Range slider built on Radix UI Slider.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Interactive · Status: stable
|
|
6
|
+
- Import: `import { Slider } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/slider
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `value` | `number[]` | | The controlled value of the slider. |
|
|
14
|
+
| `defaultValue` | `number[]` | | The initial value when uncontrolled. |
|
|
15
|
+
| `min` | `number` | | The minimum value of the slider. |
|
|
16
|
+
| `max` | `number` | | The maximum value of the slider. |
|
|
17
|
+
| `step` | `number` | | The step increment between values. |
|
|
18
|
+
| `disabled` | `boolean` | | Disables slider interaction when true. |
|
|
19
|
+
| `onValueChange` | `(value: number[]) => void` | | Callback fired when the value changes. |
|
|
20
|
+
|
|
21
|
+
## Example: Default
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<Slider defaultValue={[50]} min={0} max={100} style={{ width: '240px' }} />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example: Range
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<Slider defaultValue={[20, 80]} min={0} max={100} style={{ width: '240px' }} />
|
|
31
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
Animated loading indicator. Inherits color from context.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Feedback · Status: stable
|
|
6
|
+
- Import: `import { Spinner } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/spinner
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Diameter of the spinner. |
|
|
14
|
+
| `label` | `string` | `'Loading…'` | Screen-reader accessible label. |
|
|
15
|
+
|
|
16
|
+
## Example: Sizes
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
|
|
20
|
+
<Spinner size="xs" />
|
|
21
|
+
<Spinner size="sm" />
|
|
22
|
+
<Spinner size="md" />
|
|
23
|
+
<Spinner size="lg" />
|
|
24
|
+
<Spinner size="xl" />
|
|
25
|
+
</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example: Inside button
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Button loading>Saving…</Button>
|
|
32
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Split Button
|
|
2
|
+
|
|
3
|
+
A primary action with related secondary actions behind a chevron, as one connected control.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Actions · Status: beta
|
|
6
|
+
- Import: `import { SplitButton } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/split-button
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `menuLabel` (required) | `string` | | Accessible name of the menu toggle, e.g. "More save options". |
|
|
14
|
+
| `menu` (required) | `ReactNode` | | `DropdownMenu.Item`s for the secondary actions. |
|
|
15
|
+
| `align` | `'start' \| 'end'` | `'end'` | Menu alignment against the toggle. |
|
|
16
|
+
| `variant / size / tone` | `Button props` | | Applied to both halves. |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<SplitButton
|
|
22
|
+
onClick={save}
|
|
23
|
+
menuLabel="More save options"
|
|
24
|
+
menu={
|
|
25
|
+
<>
|
|
26
|
+
<DropdownMenu.Item>Save as draft</DropdownMenu.Item>
|
|
27
|
+
<DropdownMenu.Item>Save a copy</DropdownMenu.Item>
|
|
28
|
+
</>
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
Save
|
|
32
|
+
</SplitButton>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Example: Outlined
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<SplitButton variant="outlined" menuLabel="More export options" menu={<DropdownMenu.Item>CSV</DropdownMenu.Item>}>
|
|
39
|
+
Export
|
|
40
|
+
</SplitButton>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Related: [button](button.md), [button-group](button-group.md), [dropdown-menu](dropdown-menu.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Stack
|
|
2
|
+
|
|
3
|
+
Vertical stack layout with configurable gap.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Layout · Status: stable
|
|
6
|
+
- Import: `import { Stack } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/stack
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `gap` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Spacing between child elements. |
|
|
14
|
+
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | | Cross-axis alignment of children. |
|
|
15
|
+
| `dividers` | `boolean` | | Renders a divider line between each child element. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<Stack gap="md">
|
|
21
|
+
<Button variant="outline">Item 1</Button>
|
|
22
|
+
<Button variant="outline">Item 2</Button>
|
|
23
|
+
<Button variant="outline">Item 3</Button>
|
|
24
|
+
</Stack>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example: With dividers
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<Stack gap="md" dividers>
|
|
31
|
+
<Text>First section</Text>
|
|
32
|
+
<Text>Second section</Text>
|
|
33
|
+
<Text>Third section</Text>
|
|
34
|
+
</Stack>
|
|
35
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# StatCard
|
|
2
|
+
|
|
3
|
+
Metric display card showing a KPI value, label, optional delta, and icon.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Data · Status: stable
|
|
6
|
+
- Import: `import { StatCard } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/stat-card
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `label` (required) | `string` | | Metric name label. |
|
|
14
|
+
| `value` (required) | `React.ReactNode` | | Primary metric value. |
|
|
15
|
+
| `delta` | `string` | | Change value (e.g. "+12.5%"). |
|
|
16
|
+
| `deltaType` | `'increase' \| 'decrease' \| 'neutral'` | | Semantic direction of the delta. |
|
|
17
|
+
| `icon` | `React.ReactNode` | | Icon displayed in the card header. |
|
|
18
|
+
| `description` | `string` | | Additional context below the value. |
|
|
19
|
+
| `animate` | `boolean` | `false` | Roll the digits when a number or string `value` changes (NumberTicker), announced politely. The first render never animates. |
|
|
20
|
+
|
|
21
|
+
## Example: Default
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<StatCard
|
|
25
|
+
label="Total Revenue"
|
|
26
|
+
value="$48,295"
|
|
27
|
+
delta="+12.5%"
|
|
28
|
+
deltaType="increase"
|
|
29
|
+
description="vs last month"
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Example: With icon
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<StatCard
|
|
37
|
+
label="Active Users"
|
|
38
|
+
value="2,841"
|
|
39
|
+
delta="-3.2%"
|
|
40
|
+
deltaType="decrease"
|
|
41
|
+
icon={<Users size={20} />}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Example: Animated
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
<StatCard label="Orders today" value={orders.toLocaleString()} animate />
|
|
49
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Status Pill
|
|
2
|
+
|
|
3
|
+
> **Deprecated.** Do not use in new code. Deprecated — use Badge. A pill indicator for status values like active, pending, error.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Labels & Badges · Status: deprecated
|
|
6
|
+
- Import: `import { StatusPill } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/status-pill
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `label` (required) | `string` | | Text displayed inside the pill. |
|
|
14
|
+
| `tone` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic colour tone of the pill. |
|
|
15
|
+
| `dot` | `boolean` | `false` | Renders a small status dot before the label. Pulses automatically for success and info tones. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
21
|
+
<StatusPill tone="success" label="Active" />
|
|
22
|
+
<StatusPill tone="warning" label="Pending" />
|
|
23
|
+
<StatusPill tone="danger" label="Error" />
|
|
24
|
+
<StatusPill tone="neutral" label="Draft" />
|
|
25
|
+
<StatusPill tone="info" label="Syncing" />
|
|
26
|
+
</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Example: With dot
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
33
|
+
<StatusPill tone="success" dot label="Live" />
|
|
34
|
+
<StatusPill tone="info" dot label="Syncing" />
|
|
35
|
+
<StatusPill tone="warning" dot label="Degraded" />
|
|
36
|
+
</div>
|
|
37
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# StepIndicator
|
|
2
|
+
|
|
3
|
+
Visual progress indicator for multi-step flows like onboarding or checkout.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Navigation · Status: stable
|
|
6
|
+
- Import: `import { StepIndicator } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/step-indicator
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `steps` (required) | `StepIndicatorStep[]` | | Array of step definitions. |
|
|
14
|
+
| `currentStep` (required) | `number` | | Zero-based index of the active step. |
|
|
15
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<StepIndicator
|
|
21
|
+
currentStep={1}
|
|
22
|
+
steps={[
|
|
23
|
+
{ label: 'Account' },
|
|
24
|
+
{ label: 'Profile' },
|
|
25
|
+
{ label: 'Payment' },
|
|
26
|
+
{ label: 'Review' },
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Streaming Text
|
|
2
|
+
|
|
3
|
+
Assistant text as it arrives: new chunks fade in, text already shown stays still, and a caret marks the end.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: AI · Status: beta
|
|
6
|
+
- Import: `import { StreamingText } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/streaming-text
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Any model output rendered token by token.
|
|
12
|
+
|
|
13
|
+
## When not to use
|
|
14
|
+
|
|
15
|
+
- Finished text loaded from history: render it as plain text, or with `streaming={false}`.
|
|
16
|
+
- Model output as HTML or Markdown HTML: StreamingText renders text only. Parse Markdown to React elements yourself; never inject model HTML.
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| `text` (required) | `string` | | The full text received so far. Append to it; anything that is not an append renders statically. |
|
|
23
|
+
| `streaming` | `boolean` | `false` | Shows the caret and sets `aria-busy` while more text is expected. |
|
|
24
|
+
| `as` | `'div' \| 'p' \| 'span'` | `'div'` | Element to render. |
|
|
25
|
+
| `aria-live` | `'off' \| 'polite'` | `'off'` | Opt-in live announcements. Leave off: screen readers would re-read the region on every token. |
|
|
26
|
+
|
|
27
|
+
## Example: Streaming a reply
|
|
28
|
+
|
|
29
|
+
Words arrive on a timer. Restart streams the paragraph again.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
const reply = 'Tokens arrive a few characters at a time. Each new chunk fades in while the text before it stays put, so the eye can keep reading.';
|
|
33
|
+
const [length, setLength] = React.useState(0);
|
|
34
|
+
const streaming = length < reply.length;
|
|
35
|
+
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
if (!streaming) return;
|
|
38
|
+
const id = setTimeout(() => setLength((n) => Math.min(reply.length, n + 6)), 60);
|
|
39
|
+
return () => clearTimeout(id);
|
|
40
|
+
}, [length, streaming]);
|
|
41
|
+
|
|
42
|
+
<StreamingText as="p" text={reply.slice(0, length)} streaming={streaming} />
|
|
43
|
+
<Button variant="outline" size="sm" onClick={() => setLength(0)}>Restart</Button>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Accessibility
|
|
47
|
+
|
|
48
|
+
- Not a live region by default. Announce the finished message once instead, e.g. through a polite status or Conversation’s `announce` for whole messages.
|
|
49
|
+
- `aria-busy` is true while streaming, so assistive tech can wait for the final text.
|
|
50
|
+
- The caret is decorative (`aria-hidden`). With reduced motion, chunks appear without fading and the caret does not blink.
|
|
51
|
+
- Only the last three chunks keep their own span, so the DOM stays flat however long the reply gets.
|
|
52
|
+
|
|
53
|
+
Related: [message-bubble](message-bubble.md), [thinking-indicator](thinking-indicator.md), [conversation](conversation.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
Toggle control for binary on/off settings. Built on Radix UI Switch.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form Controls · Status: stable
|
|
6
|
+
- Import: `import { Switch } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/switch
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `checked` | `boolean` | | Controlled checked state. |
|
|
14
|
+
| `defaultChecked` | `boolean` | `false` | Uncontrolled initial state. |
|
|
15
|
+
| `onCheckedChange` | `(checked: boolean) => void` | | Callback when checked state changes. |
|
|
16
|
+
| `disabled` | `boolean` | `false` | Disables interaction. |
|
|
17
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Switch size. |
|
|
18
|
+
|
|
19
|
+
## Example: Default
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
23
|
+
<Switch id="airplane" />
|
|
24
|
+
<Label htmlFor="airplane">Airplane mode</Label>
|
|
25
|
+
</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example: Sizes
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
32
|
+
<Switch size="sm" />
|
|
33
|
+
<Switch size="md" />
|
|
34
|
+
<Switch size="lg" />
|
|
35
|
+
</div>
|
|
36
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
Semantic HTML table with styled variants.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Data Display · Status: stable
|
|
6
|
+
- Import: `import { Table } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/table
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `Table.Root striped` | `boolean` | `false` | Applies alternating row background colours. |
|
|
14
|
+
| `Table.Root bordered` | `boolean` | `false` | Adds borders between rows and columns. |
|
|
15
|
+
| `Table.Root hoverable` | `boolean` | `false` | Highlights rows on mouse hover. |
|
|
16
|
+
| `Table.Root stickyHeader` | `boolean` | `false` | Fixes the table header to the top when scrolling inside a scrollable container. |
|
|
17
|
+
| `Table.Head align` | `'start' \| 'center' \| 'end'` | `'start'` | Text alignment within the header cell. |
|
|
18
|
+
| `Table.Cell align` | `'start' \| 'center' \| 'end'` | `'start'` | Text alignment within the data cell. |
|
|
19
|
+
| `Table.Caption side` | `'top' \| 'bottom'` | `'bottom'` | Whether the caption appears above or below the table. |
|
|
20
|
+
|
|
21
|
+
## Example: Default
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<Table.Root>
|
|
25
|
+
<Table.Header>
|
|
26
|
+
<Table.Row>
|
|
27
|
+
<Table.Head>Name</Table.Head>
|
|
28
|
+
<Table.Head>Status</Table.Head>
|
|
29
|
+
<Table.Head>Date</Table.Head>
|
|
30
|
+
</Table.Row>
|
|
31
|
+
</Table.Header>
|
|
32
|
+
<Table.Body>
|
|
33
|
+
<Table.Row>
|
|
34
|
+
<Table.Cell>Alice Johnson</Table.Cell>
|
|
35
|
+
<Table.Cell><StatusPill tone="success" label="Active" /></Table.Cell>
|
|
36
|
+
<Table.Cell>12 Jan 2026</Table.Cell>
|
|
37
|
+
</Table.Row>
|
|
38
|
+
<Table.Row>
|
|
39
|
+
<Table.Cell>Bob Martinez</Table.Cell>
|
|
40
|
+
<Table.Cell><StatusPill tone="warning" label="Pending" /></Table.Cell>
|
|
41
|
+
<Table.Cell>18 Feb 2026</Table.Cell>
|
|
42
|
+
</Table.Row>
|
|
43
|
+
<Table.Row>
|
|
44
|
+
<Table.Cell>Carol Smith</Table.Cell>
|
|
45
|
+
<Table.Cell><StatusPill tone="neutral" label="Inactive" /></Table.Cell>
|
|
46
|
+
<Table.Cell>03 Mar 2026</Table.Cell>
|
|
47
|
+
</Table.Row>
|
|
48
|
+
</Table.Body>
|
|
49
|
+
</Table.Root>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Example: With caption
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Table.Root>
|
|
56
|
+
<Table.Caption>Recent user activity — last 30 days</Table.Caption>
|
|
57
|
+
<Table.Header>
|
|
58
|
+
<Table.Row>
|
|
59
|
+
<Table.Head>Name</Table.Head>
|
|
60
|
+
<Table.Head>Status</Table.Head>
|
|
61
|
+
<Table.Head>Date</Table.Head>
|
|
62
|
+
</Table.Row>
|
|
63
|
+
</Table.Header>
|
|
64
|
+
<Table.Body>
|
|
65
|
+
<Table.Row>
|
|
66
|
+
<Table.Cell>Alice Johnson</Table.Cell>
|
|
67
|
+
<Table.Cell><StatusPill tone="success" label="Active" /></Table.Cell>
|
|
68
|
+
<Table.Cell>12 Jan 2026</Table.Cell>
|
|
69
|
+
</Table.Row>
|
|
70
|
+
<Table.Row>
|
|
71
|
+
<Table.Cell>Bob Martinez</Table.Cell>
|
|
72
|
+
<Table.Cell><StatusPill tone="warning" label="Pending" /></Table.Cell>
|
|
73
|
+
<Table.Cell>18 Feb 2026</Table.Cell>
|
|
74
|
+
</Table.Row>
|
|
75
|
+
<Table.Row>
|
|
76
|
+
<Table.Cell>Carol Smith</Table.Cell>
|
|
77
|
+
<Table.Cell><StatusPill tone="neutral" label="Inactive" /></Table.Cell>
|
|
78
|
+
<Table.Cell>03 Mar 2026</Table.Cell>
|
|
79
|
+
</Table.Row>
|
|
80
|
+
</Table.Body>
|
|
81
|
+
<Table.Footer>
|
|
82
|
+
<Table.Row>
|
|
83
|
+
<Table.Cell colSpan={3} style={{ color: 'var(--color-text-secondary)', fontSize: '0.875rem' }}>
|
|
84
|
+
Showing 3 of 3 users
|
|
85
|
+
</Table.Cell>
|
|
86
|
+
</Table.Row>
|
|
87
|
+
</Table.Footer>
|
|
88
|
+
</Table.Root>
|
|
89
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Layered content panels switched by tab triggers. Built on Radix UI Tabs.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Navigation · Status: stable
|
|
6
|
+
- Import: `import { Tabs } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/tabs
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Switching between related views within the same page context
|
|
12
|
+
- Organising content that belongs to the same entity
|
|
13
|
+
- Reducing visual clutter by hiding secondary content behind tabs
|
|
14
|
+
- Horizontal navigation within a bounded section
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
|
|
18
|
+
- Global site navigation — use the sidebar or top nav
|
|
19
|
+
- Sequential steps in order — use StepIndicator
|
|
20
|
+
- Comparing content side-by-side — keep both views visible
|
|
21
|
+
- More than 5–7 tabs — consider a Select or sub-navigation
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `defaultValue` | `string` | | Initially active tab value (uncontrolled). |
|
|
28
|
+
| `value` | `string` | | Controlled active tab value. |
|
|
29
|
+
| `onValueChange` | `(value: string) => void` | | Callback when active tab changes. |
|
|
30
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction of the tab list. |
|
|
31
|
+
|
|
32
|
+
## Example: Default
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<Tabs.Root defaultValue="account">
|
|
36
|
+
<Tabs.List>
|
|
37
|
+
<Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
38
|
+
<Tabs.Trigger value="billing">Billing</Tabs.Trigger>
|
|
39
|
+
<Tabs.Trigger value="notifications">Notifications</Tabs.Trigger>
|
|
40
|
+
</Tabs.List>
|
|
41
|
+
<Tabs.Content value="account">
|
|
42
|
+
<Text>Account settings content.</Text>
|
|
43
|
+
</Tabs.Content>
|
|
44
|
+
<Tabs.Content value="billing">
|
|
45
|
+
<Text>Billing details content.</Text>
|
|
46
|
+
</Tabs.Content>
|
|
47
|
+
<Tabs.Content value="notifications">
|
|
48
|
+
<Text>Notification preferences content.</Text>
|
|
49
|
+
</Tabs.Content>
|
|
50
|
+
</Tabs.Root>
|
|
51
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
> **Deprecated.** Do not use in new code. Deprecated — use Badge. Non-interactive label tag for categorisation.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Labels & Badges · Status: deprecated
|
|
6
|
+
- Import: `import { Tag } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/tag
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `variant` | `'solid' \| 'soft' \| 'outline'` | `'soft'` | Visual style of the tag. |
|
|
14
|
+
| `tone` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | | Semantic colour tone of the tag. |
|
|
15
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Controls tag size. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
21
|
+
<Tag>Frontend</Tag>
|
|
22
|
+
<Tag tone="info">Backend</Tag>
|
|
23
|
+
<Tag tone="success">Deployed</Tag>
|
|
24
|
+
</div>
|
|
25
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Text Gradient
|
|
2
|
+
|
|
3
|
+
Renders text with a brand gradient fill.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Inline Primitives · Status: stable
|
|
6
|
+
- Import: `import { TextGradient } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/text-gradient
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `from` | `string` | | Starting color of the gradient (CSS color value or token). |
|
|
14
|
+
| `to` | `string` | | Ending color of the gradient (CSS color value or token). |
|
|
15
|
+
| `direction` | `'to-r' \| 'to-br' \| 'to-b'` | | Direction of the gradient. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<TextGradient>Design system for ambitious teams</TextGradient>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Example: In heading
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<Heading size="h1">
|
|
27
|
+
Build with{' '}
|
|
28
|
+
<TextGradient>Nexub</TextGradient>
|
|
29
|
+
</Heading>
|
|
30
|
+
```
|