@nexub/mcp 0.0.0-stage → 1.8.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 +70 -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 +50 -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,42 @@
|
|
|
1
|
+
# Bento Grid
|
|
2
|
+
|
|
3
|
+
A grid of card tiles in mixed sizes. Responds to its own width: 1 column, 2 at 480px, 4 at 768px.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/patterns` · Category: Layout · Status: beta
|
|
6
|
+
- Import: `import { BentoGrid } from '@nexub/patterns';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/patterns/bento-grid
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Overview pages where a few items deserve more room than the rest.
|
|
12
|
+
|
|
13
|
+
## When not to use
|
|
14
|
+
|
|
15
|
+
- Lists the user scans in order: dense packing can move tiles out of reading order.
|
|
16
|
+
- Equal-weight items: use Grid.
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| `BentoGrid children` (required) | `ReactNode` | | `BentoTile`s. Dense packing back-fills gaps left by large tiles, so visual order can differ from source order. |
|
|
23
|
+
| `size` | `'1x1' \| '2x1' \| '1x2' \| '2x2'` | `'1x1'` | Tile span, columns × rows. Two-wide spans apply from 2 columns up. |
|
|
24
|
+
| `...Card props` | `CardProps` | | A tile is a surface Card (`variant` is fixed); `tone`, `surface` and `effect` pass through. |
|
|
25
|
+
|
|
26
|
+
## Example: Dashboard
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<BentoGrid>
|
|
30
|
+
<BentoTile size="2x2">
|
|
31
|
+
<h3 className="text-title-sm">Revenue, last 7 days</h3>
|
|
32
|
+
<RevenueChart />
|
|
33
|
+
</BentoTile>
|
|
34
|
+
<BentoTile><StatTile label="Active users" value="12,480" /></BentoTile>
|
|
35
|
+
<BentoTile><StatTile label="Conversion" value="3.2%" /></BentoTile>
|
|
36
|
+
<BentoTile size="2x1">3 invoices awaiting approval.</BentoTile>
|
|
37
|
+
<BentoTile><StatTile label="Churn" value="0.8%" /></BentoTile>
|
|
38
|
+
<BentoTile><StatTile label="NPS" value="61" /></BentoTile>
|
|
39
|
+
</BentoGrid>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Related: [card](card.md), [stat-card](stat-card.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Box
|
|
2
|
+
|
|
3
|
+
Generic container primitive with style token props.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Layout · Status: stable
|
|
6
|
+
- Import: `import { Box } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/box
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `padding` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | | Padding applied to all sides using design tokens. |
|
|
14
|
+
| `background` | `string` | | Background color CSS value or token. |
|
|
15
|
+
| `radius` | `string` | | Border radius CSS value or token. |
|
|
16
|
+
| `asChild` | `boolean` | | Merges props onto the immediate child element (Radix Slot). |
|
|
17
|
+
|
|
18
|
+
## Example: Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<Box padding="md" style={{ background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
|
|
22
|
+
Content inside a Box
|
|
23
|
+
</Box>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Example: Nested
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<Box padding="lg" style={{ background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-lg)' }}>
|
|
30
|
+
<Heading size="h4">Section title</Heading>
|
|
31
|
+
<Box padding="sm" style={{ background: 'var(--color-bg-default)', borderRadius: 'var(--radius-md)', marginTop: '8px' }}>
|
|
32
|
+
<Text>Nested box content</Text>
|
|
33
|
+
</Box>
|
|
34
|
+
</Box>
|
|
35
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
Hierarchical navigation trail showing page location.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Navigation · Status: stable
|
|
6
|
+
- Import: `import { Breadcrumb } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/breadcrumb
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `Breadcrumb.Root aria-label` | `string` | `'breadcrumb'` | Accessible label for the nav landmark. |
|
|
14
|
+
| `Breadcrumb.Link href` | `string` | | URL the breadcrumb link navigates to. |
|
|
15
|
+
| `Breadcrumb.Link asChild` | `boolean` | `false` | Merges props onto the immediate child element, useful for router Link components. |
|
|
16
|
+
| `Breadcrumb.Separator children` | `React.ReactNode` | | Custom separator element. Defaults to a chevron icon. |
|
|
17
|
+
| `Breadcrumb.Ellipsis aria-label` | `string` | `'More'` | Accessible label for the ellipsis element used to collapse long trails. |
|
|
18
|
+
|
|
19
|
+
## Example: Default
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
<Breadcrumb.Root>
|
|
23
|
+
<Breadcrumb.List>
|
|
24
|
+
<Breadcrumb.Item>
|
|
25
|
+
<Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
26
|
+
</Breadcrumb.Item>
|
|
27
|
+
<Breadcrumb.Separator />
|
|
28
|
+
<Breadcrumb.Item>
|
|
29
|
+
<Breadcrumb.Link href="/components">Components</Breadcrumb.Link>
|
|
30
|
+
</Breadcrumb.Item>
|
|
31
|
+
<Breadcrumb.Separator />
|
|
32
|
+
<Breadcrumb.Item>
|
|
33
|
+
<Breadcrumb.Page>Button</Breadcrumb.Page>
|
|
34
|
+
</Breadcrumb.Item>
|
|
35
|
+
</Breadcrumb.List>
|
|
36
|
+
</Breadcrumb.Root>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Example: With ellipsis
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<Breadcrumb.Root>
|
|
43
|
+
<Breadcrumb.List>
|
|
44
|
+
<Breadcrumb.Item>
|
|
45
|
+
<Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
46
|
+
</Breadcrumb.Item>
|
|
47
|
+
<Breadcrumb.Separator />
|
|
48
|
+
<Breadcrumb.Item>
|
|
49
|
+
<Breadcrumb.Ellipsis />
|
|
50
|
+
</Breadcrumb.Item>
|
|
51
|
+
<Breadcrumb.Separator />
|
|
52
|
+
<Breadcrumb.Item>
|
|
53
|
+
<Breadcrumb.Link href="/components/navigation">Navigation</Breadcrumb.Link>
|
|
54
|
+
</Breadcrumb.Item>
|
|
55
|
+
<Breadcrumb.Separator />
|
|
56
|
+
<Breadcrumb.Item>
|
|
57
|
+
<Breadcrumb.Page>Breadcrumb</Breadcrumb.Page>
|
|
58
|
+
</Breadcrumb.Item>
|
|
59
|
+
</Breadcrumb.List>
|
|
60
|
+
</Breadcrumb.Root>
|
|
61
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Button Group
|
|
2
|
+
|
|
3
|
+
Groups related buttons together with optional attachment and orientation.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Actions · Status: stable
|
|
6
|
+
- Import: `import { ButtonGroup } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/button-group
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Lays out child buttons horizontally or vertically. |
|
|
14
|
+
| `attached` | `boolean` | `false` | Removes gap and merges borders between adjacent buttons. |
|
|
15
|
+
|
|
16
|
+
## Example: Default
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<ButtonGroup>
|
|
20
|
+
<Button variant="primary">Save</Button>
|
|
21
|
+
<Button variant="outline">Cancel</Button>
|
|
22
|
+
</ButtonGroup>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Example: Attached
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<ButtonGroup attached>
|
|
29
|
+
<Button variant="outline">Left</Button>
|
|
30
|
+
<Button variant="outline">Center</Button>
|
|
31
|
+
<Button variant="outline">Right</Button>
|
|
32
|
+
</ButtonGroup>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Example: Vertical
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<ButtonGroup orientation="vertical">
|
|
39
|
+
<Button variant="outline">Option A</Button>
|
|
40
|
+
<Button variant="outline">Option B</Button>
|
|
41
|
+
<Button variant="outline">Option C</Button>
|
|
42
|
+
</ButtonGroup>
|
|
43
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
Triggers an action or event. Supports multiple variants, sizes, and semantic tones.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Actions · Status: stable
|
|
6
|
+
- Import: `import { Button } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/button
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Triggering a primary or secondary action (submit, save, confirm)
|
|
12
|
+
- Navigating users to another page or step in a flow
|
|
13
|
+
- Opening a dialog, drawer, or modal overlay
|
|
14
|
+
- Destructive actions that need a visible, labelled control
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
|
|
18
|
+
- Inline text navigation — use a Link instead
|
|
19
|
+
- Icon-only controls — use IconButton for touch target compliance
|
|
20
|
+
- Selecting among multiple options — use ToggleGroup or SegmentedControl
|
|
21
|
+
- Passive information display with no action
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `variant` | `'filled' \| 'tonal' \| 'outlined' \| 'text' \| 'glass' \| 'subtle' \| 'link' \| 'destructive' \| 'accent'` | `'primary'` | Visual style of the button. Legacy aliases still work: primary = filled, secondary = tonal, outline = outlined, ghost = text. |
|
|
28
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Control height and padding. |
|
|
29
|
+
| `status` | `'idle' \| 'loading' \| 'success' \| 'error'` | `'idle'` | Async feedback (beta, 1.7.0). `loading` shows a spinner and blocks clicks but keeps focus; `success` draws a check; `error` shakes once. The label stays in flow, so the width holds. |
|
|
30
|
+
| `loading` | `boolean` | `false` | Alias for `status="loading"`. |
|
|
31
|
+
| `loadingLabel` | `string` | `'Loading'` | Announced when `status` becomes `loading`. |
|
|
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
|
+
| `errorLabel` | `string` | `'Something went wrong'` | Announced on `error`. |
|
|
34
|
+
| `disabled` | `boolean` | `false` | Disables the button. |
|
|
35
|
+
| `fullWidth` | `boolean` | `false` | Stretches the button to fill its container. |
|
|
36
|
+
| `leadingIcon` | `React.ReactNode` | | Icon rendered before the label. |
|
|
37
|
+
| `trailingIcon` | `React.ReactNode` | | Icon rendered after the label. |
|
|
38
|
+
| `tone` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | | Semantic colour tone — overrides the variant colour with a semantic palette. |
|
|
39
|
+
| `asChild` | `boolean` | `false` | Merges props onto the immediate child element (Radix Slot). `status` and `loading` have no effect with `asChild`. |
|
|
40
|
+
|
|
41
|
+
## Example: Default
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Button variant="primary">Click me</Button>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Example: Variants
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
51
|
+
<Button variant="primary">Primary</Button>
|
|
52
|
+
<Button variant="outline">Outline</Button>
|
|
53
|
+
<Button variant="ghost">Ghost</Button>
|
|
54
|
+
<Button variant="subtle">Subtle</Button>
|
|
55
|
+
<Button variant="link">Link</Button>
|
|
56
|
+
</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Example: Sizes
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
|
|
63
|
+
<Button size="xs" variant="primary">XSmall</Button>
|
|
64
|
+
<Button size="sm" variant="primary">Small</Button>
|
|
65
|
+
<Button size="md" variant="primary">Medium</Button>
|
|
66
|
+
<Button size="lg" variant="primary">Large</Button>
|
|
67
|
+
</div>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Example: States
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
74
|
+
<Button variant="primary" loading>Loading</Button>
|
|
75
|
+
<Button variant="outline" disabled>Disabled</Button>
|
|
76
|
+
</div>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Example: Async
|
|
80
|
+
|
|
81
|
+
Drive `status` from the request. Each click here moves to the next status.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
function SaveButton() {
|
|
85
|
+
const [status, setStatus] = React.useState<ButtonStatus>('idle');
|
|
86
|
+
|
|
87
|
+
async function save() {
|
|
88
|
+
setStatus('loading');
|
|
89
|
+
try {
|
|
90
|
+
await saveProfile();
|
|
91
|
+
setStatus('success');
|
|
92
|
+
} catch {
|
|
93
|
+
setStatus('error');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Button status={status} loadingLabel="Saving" successLabel="Saved" errorLabel="Couldn't save" onClick={save}>
|
|
99
|
+
Save
|
|
100
|
+
</Button>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Accessibility
|
|
106
|
+
|
|
107
|
+
- Roles: button
|
|
108
|
+
- `Space`: Activates the focused button.
|
|
109
|
+
- `Enter`: Activates the focused button.
|
|
110
|
+
- `Tab`: Moves focus to the button in document order.
|
|
111
|
+
- Receives focus in document order; `disabled` removes it from the tab sequence.
|
|
112
|
+
- Visible focus ring uses `--color-border-focus` and meets WCAG 2.4.7 contrast.
|
|
113
|
+
- Announces the visible label plus the implicit "button" role.
|
|
114
|
+
- While loading the button sets `aria-busy` and `aria-disabled` (not `disabled`), so focus stays on it and clicks are ignored.
|
|
115
|
+
- A button with `status` or `loading` renders a polite `role="status"` region next to it that announces `loadingLabel`, `successLabel` or `errorLabel` as the status changes.
|
|
116
|
+
- Pair icon-only triggers with `IconButton` for a 44×44 touch target.
|
|
117
|
+
|
|
118
|
+
Related: [icon-button](icon-button.md), [button-group](button-group.md), [link](link.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Callout
|
|
2
|
+
|
|
3
|
+
> **Deprecated.** Do not use in new code. Deprecated — use Alert. Highlighted content block for tips, warnings, or notes.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Feedback · Status: deprecated
|
|
6
|
+
- Import: `import { Callout } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/callout
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `tone` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | | Semantic colour tone of the callout. |
|
|
14
|
+
| `title` | `string` | | Bold title rendered at the top of the callout. |
|
|
15
|
+
| `icon` | `ReactNode` | | Custom icon rendered beside the title. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<Callout tone="warning" title="Before you continue">Deleting this record is permanent and cannot be undone.</Callout>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Example: Info
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<Callout tone="info">Use token names instead of raw hex values for consistent theming.</Callout>
|
|
27
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
Surface container for grouping related content. Supports flat, surface, and interactive variants.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Layout · Status: stable
|
|
6
|
+
- Import: `import { Card } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/card
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `variant` | `'flat' \| 'surface' \| 'interactive'` | `'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. |
|
|
14
|
+
| `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
|
+
| `tone` | `ToneValue` | `undefined` | Applies a semantic left-border accent. |
|
|
16
|
+
| `asChild` | `boolean` | `false` | Merges props onto the immediate child element. |
|
|
17
|
+
| `surface` | `'solid' \| 'glass'` | `'solid'` | Liquid-glass material treatment — see Foundations → Materials. |
|
|
18
|
+
| `CardLink` | `AnchorHTMLAttributes & { asChild?: boolean }` | | Put it around the card title to make the whole card one link. Its ::after covers the card and the card shows the focus ring. Give other controls inside the card `relative z-[1]`. Use `asChild` for a router link. |
|
|
19
|
+
|
|
20
|
+
## Example: Default
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Card>
|
|
24
|
+
<Heading level={3} size="h5">Card title</Heading>
|
|
25
|
+
<Text size="body-sm" tone="muted">Card description goes here.</Text>
|
|
26
|
+
</Card>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Example: Variants
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
33
|
+
<Card variant="flat"><Text size="body-sm">Flat</Text></Card>
|
|
34
|
+
<Card variant="surface"><Text size="body-sm">Surface (elevated)</Text></Card>
|
|
35
|
+
<Card variant="interactive"><Text size="body-sm">Interactive (hover)</Text></Card>
|
|
36
|
+
</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Example: Card link
|
|
40
|
+
|
|
41
|
+
The whole card is one link named by its title. The button sits above the link with `relative z-[1]`.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Card variant="interactive" className="p-4">
|
|
45
|
+
<Heading level={3} size="h5">
|
|
46
|
+
<CardLink href="/projects/atlas">Atlas</CardLink>
|
|
47
|
+
</Heading>
|
|
48
|
+
<Text size="body-sm" tone="muted">Updated 2 hours ago</Text>
|
|
49
|
+
<Button size="sm" variant="text" className="relative z-[1]" onClick={star}>
|
|
50
|
+
Star
|
|
51
|
+
</Button>
|
|
52
|
+
</Card>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Example: Sheen
|
|
56
|
+
|
|
57
|
+
Move the pointer over the card.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<Card variant="surface" effect="sheen" className="p-6">
|
|
61
|
+
<Heading level={3} size="h5">Pro</Heading>
|
|
62
|
+
<Text size="body-sm" tone="muted">Everything in Team, plus audit logs.</Text>
|
|
63
|
+
</Card>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Accessibility
|
|
67
|
+
|
|
68
|
+
- Roles: region (when used as a landmark)
|
|
69
|
+
- `Tab`: Focuses interactive children. The card itself is never focusable; with a CardLink, the link is.
|
|
70
|
+
- With a CardLink inside, the focus ring is drawn on the card, not around the title.
|
|
71
|
+
- Prefer CardLink over wrapping the whole card in `<a>`: the link’s accessible name stays the title instead of every word on the card.
|
|
72
|
+
- Group related content with a heading inside the Card so AT users can navigate by heading level.
|
|
73
|
+
|
|
74
|
+
Related: [media-card](media-card.md), [radio-card](radio-card.md), [callout](callout.md)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Checkbox Card
|
|
2
|
+
|
|
3
|
+
A checkbox drawn as a whole card: title, description and optional icon. Pick any number.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form Controls · Status: beta
|
|
6
|
+
- Import: `import { CheckboxCard } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/checkbox-card
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `title` (required) | `ReactNode` | | The card’s accessible name. |
|
|
14
|
+
| `description` | `ReactNode` | | Secondary text, exposed as the accessible description. |
|
|
15
|
+
| `icon` | `ReactNode` | | Leading icon. Turns primary when checked. |
|
|
16
|
+
| `checked / defaultChecked` | `boolean` | | Controlled or initial state. No indeterminate state. |
|
|
17
|
+
| `onCheckedChange` | `(checked: boolean) => void` | | Called with a plain boolean. |
|
|
18
|
+
| `children` | `ReactNode` | | Extra content under the description. Keep it non-interactive. |
|
|
19
|
+
| `disabled` | `boolean` | `false` | Disables the card. |
|
|
20
|
+
|
|
21
|
+
## Example: Features
|
|
22
|
+
|
|
23
|
+
Lay checkbox cards out with any grid; there is no group component.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<fieldset className="grid gap-3 sm:grid-cols-3">
|
|
27
|
+
<legend className="sr-only">Add-ons</legend>
|
|
28
|
+
<CheckboxCard icon={<Bell />} title="Alerts" description="Email and push notifications." defaultChecked />
|
|
29
|
+
<CheckboxCard icon={<Shield />} title="Audit log" description="Keep a year of activity." />
|
|
30
|
+
<CheckboxCard icon={<Zap />} title="Automations" description="Run rules on new records." />
|
|
31
|
+
</fieldset>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Example: Disabled
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<CheckboxCard title="SSO" description="Available on Enterprise." disabled />
|
|
38
|
+
<CheckboxCard title="Data residency" description="Included in your plan." defaultChecked disabled />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Accessibility
|
|
42
|
+
|
|
43
|
+
- Roles: checkbox
|
|
44
|
+
- `Tab`: Moves focus to the card.
|
|
45
|
+
- `Space`: Toggles the card.
|
|
46
|
+
- The title is the accessible name and the description is the accessible description.
|
|
47
|
+
- Wrap related cards in a `fieldset` with a `legend` so the set has a name.
|
|
48
|
+
|
|
49
|
+
Related: [checkbox](checkbox.md), [radio-card](radio-card.md), [card](card.md)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Binary checkbox input built on Radix UI.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Form Controls · Status: stable
|
|
6
|
+
- Import: `import { Checkbox } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/checkbox
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `checked` | `boolean` | | The controlled checked state. |
|
|
14
|
+
| `defaultChecked` | `boolean` | | The initial checked state when uncontrolled. |
|
|
15
|
+
| `disabled` | `boolean` | | Disables the checkbox when true. |
|
|
16
|
+
| `required` | `boolean` | | Marks the checkbox as required in a form. |
|
|
17
|
+
| `onCheckedChange` | `(checked: boolean) => void` | | Callback fired when the checked state changes. |
|
|
18
|
+
|
|
19
|
+
## Example: Default
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
<Checkbox defaultChecked />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Example: With label
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
29
|
+
<Checkbox id="terms" />
|
|
30
|
+
<Label htmlFor="terms">I agree to the terms</Label>
|
|
31
|
+
</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Example: States
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
38
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
39
|
+
<Checkbox id="checked" defaultChecked />
|
|
40
|
+
<Label htmlFor="checked">Checked</Label>
|
|
41
|
+
</div>
|
|
42
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
43
|
+
<Checkbox id="unchecked" />
|
|
44
|
+
<Label htmlFor="unchecked">Unchecked</Label>
|
|
45
|
+
</div>
|
|
46
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
47
|
+
<Checkbox id="disabled" disabled />
|
|
48
|
+
<Label htmlFor="disabled">Disabled</Label>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Compact label chip, optionally dismissible.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Labels & Badges · Status: stable
|
|
6
|
+
- Import: `import { Chip } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/chip
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `variant` | `'filled' \| 'outline'` | `'filled'` | Visual style of the chip. |
|
|
14
|
+
| `onRemove` | `() => void` | | When provided, renders a dismiss button that calls this handler. |
|
|
15
|
+
| `size` | `'sm' \| 'md'` | | Controls chip size. |
|
|
16
|
+
|
|
17
|
+
## Example: Default
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
21
|
+
<Chip>Design</Chip>
|
|
22
|
+
<Chip>Engineering</Chip>
|
|
23
|
+
<Chip>Product</Chip>
|
|
24
|
+
</div>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example: Dismissible
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
31
|
+
<Chip onRemove={() => {}}>Design</Chip>
|
|
32
|
+
<Chip onRemove={() => {}}>Engineering</Chip>
|
|
33
|
+
<Chip onRemove={() => {}}>Product</Chip>
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Citation
|
|
2
|
+
|
|
3
|
+
Numbered source markers for running text, with a hover preview, plus SourceChip and SourceList for the sources under a reply.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: AI · Status: beta
|
|
6
|
+
- Import: `import { Citation } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/citation
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Assistant answers built from retrieved documents or web results.
|
|
12
|
+
- SourceList under the reply, so sources are reachable without hovering.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
|
|
16
|
+
- Ordinary links in prose: use Link.
|
|
17
|
+
- Footnotes in static content, where a numbered list at the end of the page is enough.
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `index` (required) | `number` | | Citation: 1-based number shown in the marker. |
|
|
24
|
+
| `source` (required) | `CitationSource` | | Citation and SourceChip: `{ title, url, domain?, snippet?, favicon? }`. |
|
|
25
|
+
| `source.url` (required) | `string` | | Linked only if it is http or https. Anything else (javascript:, data:, relative) renders as plain text. |
|
|
26
|
+
| `source.domain` | `string` | | Shown instead of the URL’s hostname. |
|
|
27
|
+
| `source.snippet` | `string` | | Quoted text shown in the hover preview. |
|
|
28
|
+
| `source.favicon` | `string` | | http(s) image URL. Falls back to the domain’s first letter. |
|
|
29
|
+
| `SourceList sources` (required) | `CitationSource[]` | | Rendered as SourceChips under a "Sources" heading. Scrolls sideways when narrow, wraps from 480px. |
|
|
30
|
+
| `messages` | `Partial<CitationMessages>` | | Citation and SourceList: overrides for `sources` and `source(index)`. |
|
|
31
|
+
| `safeUrl(url)` | `(url?: string) => string \| undefined` | | The same http(s) check, exported for your own links. |
|
|
32
|
+
|
|
33
|
+
## Example: Cited answer
|
|
34
|
+
|
|
35
|
+
Hover or focus a number to preview its source.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
const sources: CitationSource[] = [
|
|
39
|
+
{ url: 'https://example.com/guides/heat-pumps', title: 'Choosing a heat pump', snippet: 'Air-source pumps suit most homes with a garden or outside wall.' },
|
|
40
|
+
{ url: 'https://example.org/grants', title: 'Grants for home heating', domain: 'example.org' },
|
|
41
|
+
{ url: 'https://example.net/costs', title: 'Running costs compared' },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
<p>
|
|
45
|
+
Most homes can use an air-source heat pump<Citation index={1} source={sources[0]} />.
|
|
46
|
+
Grants cover part of the cost<Citation index={2} source={sources[1]} />, and running
|
|
47
|
+
costs are close to gas<Citation index={3} source={sources[2]} />.
|
|
48
|
+
</p>
|
|
49
|
+
<SourceList sources={sources} />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
|
|
54
|
+
- Roles: link (marker and chips), region (SourceList, named by its heading)
|
|
55
|
+
- `Tab`: Focuses a marker and opens its preview.
|
|
56
|
+
- `Enter`: Opens the source in a new tab.
|
|
57
|
+
- Markers are named "Source 1: <title>", not just the number.
|
|
58
|
+
- The hover preview repeats the marker’s information; nothing in it is only available on hover.
|
|
59
|
+
- Links open in a new tab with `rel="noopener noreferrer"`; favicons load with `referrerPolicy="no-referrer"`.
|
|
60
|
+
|
|
61
|
+
Related: [message-bubble](message-bubble.md), [hover-card](hover-card.md), [link](link.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code
|
|
2
|
+
|
|
3
|
+
Inline code span for technical terms and short code snippets.
|
|
4
|
+
|
|
5
|
+
- Package: `@nexub/react` · Category: Inline Primitives · Status: stable
|
|
6
|
+
- Import: `import { CodeInline } from '@nexub/react';`
|
|
7
|
+
- Docs: https://nexub-ds-docs.pages.dev/components/code-inline
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `...props` | `React.HTMLAttributes<HTMLElement>` | | All standard span/code HTML attributes are forwarded. |
|
|
14
|
+
|
|
15
|
+
## Example: Default
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Code>npm install @nexub/react</Code>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Example: In prose
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<Text>Use the <Code>useTheme()</Code> hook to access the current theme.</Text>
|
|
25
|
+
```
|