@nexub/mcp 2.6.0 → 2.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/dist/skill/references/components/accordion.md +40 -45
- package/dist/skill/references/components/activity-feed.md +13 -12
- package/dist/skill/references/components/alert-dialog.md +26 -22
- package/dist/skill/references/components/alert.md +26 -8
- package/dist/skill/references/components/amount.md +15 -3
- package/dist/skill/references/components/auth-card.md +22 -11
- package/dist/skill/references/components/autocomplete.md +42 -21
- package/dist/skill/references/components/avatar-group.md +13 -6
- package/dist/skill/references/components/avatar.md +31 -10
- package/dist/skill/references/components/badge.md +37 -16
- package/dist/skill/references/components/banner.md +18 -7
- package/dist/skill/references/components/bento-grid.md +33 -11
- package/dist/skill/references/components/box.md +21 -9
- package/dist/skill/references/components/breadcrumb.md +32 -34
- package/dist/skill/references/components/button-group.md +32 -14
- package/dist/skill/references/components/button.md +57 -32
- package/dist/skill/references/components/callout.md +10 -2
- package/dist/skill/references/components/card.md +54 -22
- package/dist/skill/references/components/checkbox-card.md +23 -8
- package/dist/skill/references/components/checkbox.md +32 -19
- package/dist/skill/references/components/chip.md +22 -10
- package/dist/skill/references/components/citation.md +18 -10
- package/dist/skill/references/components/code-inline.md +20 -2
- package/dist/skill/references/components/collapsible.md +38 -33
- package/dist/skill/references/components/combobox.md +18 -16
- package/dist/skill/references/components/conversation.md +23 -11
- package/dist/skill/references/components/data-table.md +40 -36
- package/dist/skill/references/components/date-picker.md +21 -17
- package/dist/skill/references/components/date-range-picker.md +11 -5
- package/dist/skill/references/components/dialog.md +26 -22
- package/dist/skill/references/components/drawer.md +66 -44
- package/dist/skill/references/components/empty-state.md +40 -50
- package/dist/skill/references/components/error-state.md +22 -10
- package/dist/skill/references/components/error-summary.md +20 -14
- package/dist/skill/references/components/eyebrow-chip.md +15 -5
- package/dist/skill/references/components/filter-bar.md +18 -14
- package/dist/skill/references/components/filter-chip.md +12 -5
- package/dist/skill/references/components/flex.md +31 -15
- package/dist/skill/references/components/form-field.md +11 -5
- package/dist/skill/references/components/gradient-divider.md +5 -1
- package/dist/skill/references/components/grid.md +22 -14
- package/dist/skill/references/components/heading.md +30 -14
- package/dist/skill/references/components/helper-text.md +17 -7
- package/dist/skill/references/components/hover-card.md +21 -12
- package/dist/skill/references/components/icon-button.md +19 -17
- package/dist/skill/references/components/info-list.md +15 -6
- package/dist/skill/references/components/input.md +32 -12
- package/dist/skill/references/components/kbd.md +21 -19
- package/dist/skill/references/components/label.md +20 -6
- package/dist/skill/references/components/link.md +21 -7
- package/dist/skill/references/components/list-detail.md +27 -6
- package/dist/skill/references/components/media-card.md +55 -16
- package/dist/skill/references/components/message-bubble.md +30 -13
- package/dist/skill/references/components/money-input.md +10 -2
- package/dist/skill/references/components/motion-collapse.md +22 -22
- package/dist/skill/references/components/motion-fade.md +19 -15
- package/dist/skill/references/components/motion-scale.md +13 -20
- package/dist/skill/references/components/motion-slide.md +13 -25
- package/dist/skill/references/components/navigation-rail.md +14 -5
- package/dist/skill/references/components/notification-item.md +10 -6
- package/dist/skill/references/components/number-input.md +10 -2
- package/dist/skill/references/components/number-ticker.md +27 -6
- package/dist/skill/references/components/pagination.md +11 -20
- package/dist/skill/references/components/password-input.md +13 -2
- package/dist/skill/references/components/plan-card.md +17 -9
- package/dist/skill/references/components/popover.md +31 -21
- package/dist/skill/references/components/progress.md +22 -8
- package/dist/skill/references/components/prompt-input.md +57 -29
- package/dist/skill/references/components/radio-card.md +41 -22
- package/dist/skill/references/components/radio-group.md +32 -28
- package/dist/skill/references/components/rating.md +23 -7
- package/dist/skill/references/components/scroll-area.md +30 -29
- package/dist/skill/references/components/search-input.md +5 -1
- package/dist/skill/references/components/segmented-control.md +26 -19
- package/dist/skill/references/components/select.md +16 -8
- package/dist/skill/references/components/separator.md +16 -6
- package/dist/skill/references/components/settings-section.md +19 -10
- package/dist/skill/references/components/sheet.md +25 -22
- package/dist/skill/references/components/skeleton.md +29 -12
- package/dist/skill/references/components/slider.md +10 -2
- package/dist/skill/references/components/spinner.md +17 -8
- package/dist/skill/references/components/split-button.md +26 -15
- package/dist/skill/references/components/stack.md +22 -10
- package/dist/skill/references/components/stat-card.md +34 -15
- package/dist/skill/references/components/status-pill.md +18 -12
- package/dist/skill/references/components/step-indicator.md +10 -9
- package/dist/skill/references/components/streaming-text.md +21 -12
- package/dist/skill/references/components/switch.md +10 -9
- package/dist/skill/references/components/table.md +66 -60
- package/dist/skill/references/components/tabs.md +24 -16
- package/dist/skill/references/components/tag.md +13 -5
- package/dist/skill/references/components/text-gradient.md +14 -5
- package/dist/skill/references/components/text.md +29 -12
- package/dist/skill/references/components/textarea.md +21 -7
- package/dist/skill/references/components/thinking-indicator.md +16 -4
- package/dist/skill/references/components/toast.md +41 -64
- package/dist/skill/references/components/toggle-group.md +22 -10
- package/dist/skill/references/components/toggle.md +15 -5
- package/dist/skill/references/components/tooltip.md +22 -9
- package/dist/skill/references/components/user-card.md +9 -5
- package/dist/skill/references/components.md +1 -1
- package/dist/skill/references/tokens.md +1 -1
- package/package.json +1 -1
|
@@ -29,18 +29,27 @@ Assistant text as it arrives: new chunks fade in, text already shown stays still
|
|
|
29
29
|
Words arrive on a timer. Restart streams the paragraph again.
|
|
30
30
|
|
|
31
31
|
```tsx
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
import * as React from 'react';
|
|
33
|
+
import { StreamingText, Button } from '@nexub/react';
|
|
34
|
+
|
|
35
|
+
const STREAM_DEMO_TEXT =
|
|
36
|
+
'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.';
|
|
37
|
+
|
|
38
|
+
export default function Example() {
|
|
39
|
+
const [length, setLength] = React.useState(0);
|
|
40
|
+
const streaming = length < STREAM_DEMO_TEXT.length;
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
if (!streaming) return;
|
|
43
|
+
const id = setTimeout(() => setLength((n) => Math.min(STREAM_DEMO_TEXT.length, n + 6)), 60);
|
|
44
|
+
return () => clearTimeout(id);
|
|
45
|
+
}, [length, streaming]);
|
|
46
|
+
return (
|
|
47
|
+
<div className="flex flex-col gap-3 items-start max-w-[480px]">
|
|
48
|
+
<StreamingText as="p" text={STREAM_DEMO_TEXT.slice(0, length)} streaming={streaming} />
|
|
49
|
+
<Button variant="outline" size="sm" onClick={() => setLength(0)}>Restart</Button>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
44
53
|
```
|
|
45
54
|
|
|
46
55
|
## Accessibility
|
|
@@ -19,18 +19,19 @@ Toggle control for binary on/off settings. Built on Radix UI Switch.
|
|
|
19
19
|
## Example: Default
|
|
20
20
|
|
|
21
21
|
```tsx
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
import { Switch } from '@nexub/react';
|
|
23
|
+
|
|
24
|
+
export default function Example() {
|
|
25
|
+
return <div className="flex gap-4 flex-wrap items-center justify-center"><Switch defaultChecked /><Switch /></div>;
|
|
26
|
+
}
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
## Example: Sizes
|
|
29
30
|
|
|
30
31
|
```tsx
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<Switch size="lg"
|
|
35
|
-
|
|
32
|
+
import { Switch } from '@nexub/react';
|
|
33
|
+
|
|
34
|
+
export default function Example() {
|
|
35
|
+
return <div className="flex gap-4 flex-wrap items-center justify-center"><Switch size="sm" defaultChecked /><Switch size="md" defaultChecked /><Switch size="lg" defaultChecked /></div>;
|
|
36
|
+
}
|
|
36
37
|
```
|
|
@@ -21,69 +21,75 @@ Semantic HTML table with styled variants.
|
|
|
21
21
|
## Example: Default
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<Table.
|
|
34
|
-
<Table.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<Table.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</Table.
|
|
24
|
+
import { Table, Badge } from '@nexub/react';
|
|
25
|
+
|
|
26
|
+
export default function Example() {
|
|
27
|
+
const rows = [
|
|
28
|
+
{ name: 'Alice Brown', status: 'Active', date: 'Jan 15, 2026' },
|
|
29
|
+
{ name: 'Bob Carter', status: 'Pending', date: 'Jan 14, 2026' },
|
|
30
|
+
{ name: 'Carol Davis', status: 'Inactive', date: 'Jan 10, 2026' },
|
|
31
|
+
];
|
|
32
|
+
return (
|
|
33
|
+
<Table.Root className="w-full max-w-[480px]">
|
|
34
|
+
<Table.Header>
|
|
35
|
+
<Table.Row>
|
|
36
|
+
<Table.Head>Name</Table.Head>
|
|
37
|
+
<Table.Head>Status</Table.Head>
|
|
38
|
+
<Table.Head>Date</Table.Head>
|
|
39
|
+
</Table.Row>
|
|
40
|
+
</Table.Header>
|
|
41
|
+
<Table.Body>
|
|
42
|
+
{rows.map((r) => (
|
|
43
|
+
<Table.Row key={r.name}>
|
|
44
|
+
<Table.Cell>{r.name}</Table.Cell>
|
|
45
|
+
<Table.Cell><Badge tone={r.status === 'Active' ? 'success' : r.status === 'Pending' ? 'warning' : 'neutral'} size="sm">{r.status}</Badge></Table.Cell>
|
|
46
|
+
<Table.Cell>{r.date}</Table.Cell>
|
|
47
|
+
</Table.Row>
|
|
48
|
+
))}
|
|
49
|
+
</Table.Body>
|
|
50
|
+
</Table.Root>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
50
53
|
```
|
|
51
54
|
|
|
52
55
|
## Example: With caption
|
|
53
56
|
|
|
54
57
|
```tsx
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<Table.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<Table.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</Table.
|
|
58
|
+
import { Table, StatusPill } from '@nexub/react';
|
|
59
|
+
|
|
60
|
+
export default function Example() {
|
|
61
|
+
const rows = [
|
|
62
|
+
{ name: 'Alice Brown', status: 'Active', date: 'Jan 15, 2026' },
|
|
63
|
+
{ name: 'Bob Carter', status: 'Pending', date: 'Jan 14, 2026' },
|
|
64
|
+
{ name: 'Carol Davis', status: 'Inactive', date: 'Jan 10, 2026' },
|
|
65
|
+
];
|
|
66
|
+
return (
|
|
67
|
+
<Table.Root className="w-full max-w-[480px]">
|
|
68
|
+
<Table.Caption>Recent user activity — last 30 days</Table.Caption>
|
|
69
|
+
<Table.Header>
|
|
70
|
+
<Table.Row>
|
|
71
|
+
<Table.Head>Name</Table.Head>
|
|
72
|
+
<Table.Head>Status</Table.Head>
|
|
73
|
+
<Table.Head>Date</Table.Head>
|
|
74
|
+
</Table.Row>
|
|
75
|
+
</Table.Header>
|
|
76
|
+
<Table.Body>
|
|
77
|
+
{rows.map((r) => (
|
|
78
|
+
<Table.Row key={r.name}>
|
|
79
|
+
<Table.Cell>{r.name}</Table.Cell>
|
|
80
|
+
<Table.Cell><StatusPill tone={r.status === 'Active' ? 'success' : r.status === 'Pending' ? 'warning' : 'neutral'} label={r.status} /></Table.Cell>
|
|
81
|
+
<Table.Cell>{r.date}</Table.Cell>
|
|
82
|
+
</Table.Row>
|
|
83
|
+
))}
|
|
84
|
+
</Table.Body>
|
|
85
|
+
<Table.Footer>
|
|
86
|
+
<Table.Row>
|
|
87
|
+
<Table.Cell colSpan={3} className="text-[var(--color-on-surface-variant)] text-body-sm">
|
|
88
|
+
Showing {rows.length} of {rows.length} users
|
|
89
|
+
</Table.Cell>
|
|
90
|
+
</Table.Row>
|
|
91
|
+
</Table.Footer>
|
|
92
|
+
</Table.Root>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
89
95
|
```
|
|
@@ -32,20 +32,28 @@ Layered content panels switched by tab triggers. Built on Radix UI Tabs.
|
|
|
32
32
|
## Example: Default
|
|
33
33
|
|
|
34
34
|
```tsx
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
import { Tabs } from '@nexub/react';
|
|
36
|
+
|
|
37
|
+
export default function Example() {
|
|
38
|
+
return (
|
|
39
|
+
<div className="w-[320px]">
|
|
40
|
+
<Tabs.Root defaultValue="tab1">
|
|
41
|
+
<Tabs.List>
|
|
42
|
+
<Tabs.Trigger value="tab1">Overview</Tabs.Trigger>
|
|
43
|
+
<Tabs.Trigger value="tab2">Analytics</Tabs.Trigger>
|
|
44
|
+
<Tabs.Trigger value="tab3">Settings</Tabs.Trigger>
|
|
45
|
+
</Tabs.List>
|
|
46
|
+
<Tabs.Content value="tab1">
|
|
47
|
+
<div className="py-3 px-0 text-[var(--color-on-surface-variant)] text-body-sm">Overview content goes here.</div>
|
|
48
|
+
</Tabs.Content>
|
|
49
|
+
<Tabs.Content value="tab2">
|
|
50
|
+
<div className="py-3 px-0 text-[var(--color-on-surface-variant)] text-body-sm">Analytics content goes here.</div>
|
|
51
|
+
</Tabs.Content>
|
|
52
|
+
<Tabs.Content value="tab3">
|
|
53
|
+
<div className="py-3 px-0 text-[var(--color-on-surface-variant)] text-body-sm">Settings content goes here.</div>
|
|
54
|
+
</Tabs.Content>
|
|
55
|
+
</Tabs.Root>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
51
59
|
```
|
|
@@ -17,9 +17,17 @@
|
|
|
17
17
|
## Example: Default
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
import { Tag } from '@nexub/react';
|
|
21
|
+
|
|
22
|
+
export default function Example() {
|
|
23
|
+
return (
|
|
24
|
+
<div className="flex gap-2 flex-wrap items-center justify-center">
|
|
25
|
+
<Tag>Frontend</Tag>
|
|
26
|
+
<Tag tone="info">Backend</Tag>
|
|
27
|
+
<Tag tone="success">Deployed</Tag>
|
|
28
|
+
<Tag tone="warning">Review</Tag>
|
|
29
|
+
<Tag tone="danger">Blocked</Tag>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
25
33
|
```
|
|
@@ -17,14 +17,23 @@ Renders text with a brand gradient fill.
|
|
|
17
17
|
## Example: Default
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
|
|
20
|
+
import { TextGradient } from '@nexub/react';
|
|
21
|
+
|
|
22
|
+
export default function Example() {
|
|
23
|
+
return <TextGradient className="text-[1.5rem] font-bold">Design system for ambitious teams</TextGradient>;
|
|
24
|
+
}
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
## Example: In heading
|
|
24
28
|
|
|
25
29
|
```tsx
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
import { Heading, TextGradient } from '@nexub/react';
|
|
31
|
+
|
|
32
|
+
export default function Example() {
|
|
33
|
+
return (
|
|
34
|
+
<Heading size="h2">
|
|
35
|
+
<TextGradient>Build faster, ship consistently</TextGradient>
|
|
36
|
+
</Heading>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
30
39
|
```
|
|
@@ -20,26 +20,43 @@ Paragraph text component with size, tone, and weight variants.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
23
|
+
import { Text } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return <Text>The Nexub design system provides accessible, token-driven components.</Text>;
|
|
27
|
+
}
|
|
24
28
|
```
|
|
25
29
|
|
|
26
30
|
## Example: Sizes
|
|
27
31
|
|
|
28
32
|
```tsx
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
import { Text } from '@nexub/react';
|
|
34
|
+
|
|
35
|
+
export default function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex flex-col gap-1.5 items-start">
|
|
38
|
+
<Text size="body-lg">Body Large — spacious reading.</Text>
|
|
39
|
+
<Text size="body">Body — default paragraph.</Text>
|
|
40
|
+
<Text size="body-sm">Body Small — compact content.</Text>
|
|
41
|
+
<Text size="caption">Caption — supporting info.</Text>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
35
45
|
```
|
|
36
46
|
|
|
37
47
|
## Example: Tones
|
|
38
48
|
|
|
39
49
|
```tsx
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
import { Text } from '@nexub/react';
|
|
51
|
+
|
|
52
|
+
export default function Example() {
|
|
53
|
+
return (
|
|
54
|
+
<div className="flex flex-col gap-1.5 items-start">
|
|
55
|
+
<Text tone="default">Default</Text>
|
|
56
|
+
<Text tone="secondary">Secondary</Text>
|
|
57
|
+
<Text tone="muted">Muted</Text>
|
|
58
|
+
<Text tone="subtle">Subtle</Text>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
45
62
|
```
|
|
@@ -20,21 +20,35 @@ A multi-line text input with configurable resize behaviour, size, and validation
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
23
|
+
import { Textarea } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return <div className="w-[280px]"><Textarea placeholder="Enter your message…" /></div>;
|
|
27
|
+
}
|
|
24
28
|
```
|
|
25
29
|
|
|
26
30
|
## Example: Sizes
|
|
27
31
|
|
|
28
32
|
```tsx
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
import { Textarea } from '@nexub/react';
|
|
34
|
+
|
|
35
|
+
export default function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex flex-col gap-2 items-start w-[280px]">
|
|
38
|
+
<Textarea size="sm" placeholder="Small" rows={2} />
|
|
39
|
+
<Textarea size="md" placeholder="Medium" rows={3} />
|
|
40
|
+
<Textarea size="lg" placeholder="Large" rows={4} />
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
34
44
|
```
|
|
35
45
|
|
|
36
46
|
## Example: Invalid
|
|
37
47
|
|
|
38
48
|
```tsx
|
|
39
|
-
|
|
49
|
+
import { Textarea } from '@nexub/react';
|
|
50
|
+
|
|
51
|
+
export default function Example() {
|
|
52
|
+
return <div className="w-[280px]"><Textarea invalid placeholder="This field has an error" /></div>;
|
|
53
|
+
}
|
|
40
54
|
```
|
|
@@ -27,7 +27,11 @@ Shows the assistant is working before the first token arrives: a morphing shape
|
|
|
27
27
|
## Example: Default
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
|
-
|
|
30
|
+
import { ThinkingIndicator } from '@nexub/react';
|
|
31
|
+
|
|
32
|
+
export default function Example() {
|
|
33
|
+
return <ThinkingIndicator />;
|
|
34
|
+
}
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
## Example: Custom label and sizes
|
|
@@ -35,9 +39,17 @@ Shows the assistant is working before the first token arrives: a morphing shape
|
|
|
35
39
|
Name the step when you know it. `label={null}` keeps only the shape.
|
|
36
40
|
|
|
37
41
|
```tsx
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
import { ThinkingIndicator } from '@nexub/react';
|
|
43
|
+
|
|
44
|
+
export default function Example() {
|
|
45
|
+
return (
|
|
46
|
+
<div className="flex flex-col gap-4 items-start">
|
|
47
|
+
<ThinkingIndicator label="Searching 4 sources" />
|
|
48
|
+
<ThinkingIndicator size="sm" />
|
|
49
|
+
<ThinkingIndicator size="sm" label={null} />
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
41
53
|
```
|
|
42
54
|
|
|
43
55
|
## Accessibility
|
|
@@ -40,17 +40,14 @@ Imperative toast notifications using the toast object. Render <Toaster /> once i
|
|
|
40
40
|
## Example: Default
|
|
41
41
|
|
|
42
42
|
```tsx
|
|
43
|
-
|
|
43
|
+
import { Button, toast } from '@nexub/react';
|
|
44
|
+
|
|
45
|
+
// The docs root layout already renders <Toaster />; a second one doubles every toast.
|
|
46
|
+
export default function Example() {
|
|
44
47
|
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
variant="outline"
|
|
49
|
-
onClick={() => toast.custom('Changes saved', { description: 'Your profile has been updated.' })}
|
|
50
|
-
>
|
|
51
|
-
Show toast
|
|
52
|
-
</Button>
|
|
53
|
-
</>
|
|
48
|
+
<Button variant="outline" onClick={() => toast.custom('Changes saved', { description: 'Your profile has been updated.' })}>
|
|
49
|
+
Show toast
|
|
50
|
+
</Button>
|
|
54
51
|
);
|
|
55
52
|
}
|
|
56
53
|
```
|
|
@@ -58,28 +55,16 @@ function DefaultToast() {
|
|
|
58
55
|
## Example: Variants
|
|
59
56
|
|
|
60
57
|
```tsx
|
|
61
|
-
|
|
58
|
+
import { Button, toast } from '@nexub/react';
|
|
59
|
+
|
|
60
|
+
export default function Example() {
|
|
62
61
|
return (
|
|
63
|
-
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<Button variant="outline" onClick={() => toast.success('Saved successfully')}>
|
|
70
|
-
Success
|
|
71
|
-
</Button>
|
|
72
|
-
<Button variant="outline" onClick={() => toast.error('Something went wrong')}>
|
|
73
|
-
Error
|
|
74
|
-
</Button>
|
|
75
|
-
<Button variant="outline" onClick={() => toast.warning('Proceed with caution')}>
|
|
76
|
-
Warning
|
|
77
|
-
</Button>
|
|
78
|
-
<Button variant="outline" onClick={() => toast.info('New update available')}>
|
|
79
|
-
Info
|
|
80
|
-
</Button>
|
|
81
|
-
</div>
|
|
82
|
-
</>
|
|
62
|
+
<div className="flex gap-2 flex-wrap items-center justify-center">
|
|
63
|
+
<Button variant="outline" size="sm" onClick={() => toast.success('Saved successfully!')}>Success</Button>
|
|
64
|
+
<Button variant="outline" size="sm" onClick={() => toast.error('Something went wrong.')}>Error</Button>
|
|
65
|
+
<Button variant="outline" size="sm" onClick={() => toast.warning('Review required.')}>Warning</Button>
|
|
66
|
+
<Button variant="outline" size="sm" onClick={() => toast.info('New update available.')}>Info</Button>
|
|
67
|
+
</div>
|
|
83
68
|
);
|
|
84
69
|
}
|
|
85
70
|
```
|
|
@@ -87,25 +72,21 @@ function ToastVariants() {
|
|
|
87
72
|
## Example: With action
|
|
88
73
|
|
|
89
74
|
```tsx
|
|
90
|
-
|
|
75
|
+
import { Button, toast } from '@nexub/react';
|
|
76
|
+
|
|
77
|
+
export default function Example() {
|
|
91
78
|
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
>
|
|
106
|
-
Send message
|
|
107
|
-
</Button>
|
|
108
|
-
</>
|
|
79
|
+
<Button
|
|
80
|
+
variant="outline"
|
|
81
|
+
onClick={() =>
|
|
82
|
+
toast.custom('File deleted', {
|
|
83
|
+
description: 'The file was moved to trash.',
|
|
84
|
+
action: { label: 'Undo', onClick: () => {} },
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
>
|
|
88
|
+
Delete with undo
|
|
89
|
+
</Button>
|
|
109
90
|
);
|
|
110
91
|
}
|
|
111
92
|
```
|
|
@@ -115,27 +96,23 @@ function ToastWithAction() {
|
|
|
115
96
|
Hide the item right away; delete it for real only when the toast closes without Undo.
|
|
116
97
|
|
|
117
98
|
```tsx
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
import * as React from 'react';
|
|
100
|
+
import { Button, toast } from '@nexub/react';
|
|
120
101
|
|
|
121
|
-
|
|
102
|
+
export default function Example() {
|
|
103
|
+
const [hidden, setHidden] = React.useState(false);
|
|
104
|
+
const remove = () => {
|
|
122
105
|
setHidden(true);
|
|
123
106
|
toast.undoable('Invoice deleted', {
|
|
124
107
|
description: 'INV-2041',
|
|
125
108
|
onUndo: () => setHidden(false),
|
|
126
|
-
onCommit: () =>
|
|
109
|
+
onCommit: () => {},
|
|
127
110
|
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{hidden ? (
|
|
134
|
-
<Button variant="text" onClick={() => setHidden(false)}>Restore demo</Button>
|
|
135
|
-
) : (
|
|
136
|
-
<Button variant="outline" tone="danger" onClick={remove}>Delete INV-2041</Button>
|
|
137
|
-
)}
|
|
138
|
-
</>
|
|
111
|
+
};
|
|
112
|
+
return hidden ? (
|
|
113
|
+
<Button variant="text" onClick={() => setHidden(false)}>Restore demo</Button>
|
|
114
|
+
) : (
|
|
115
|
+
<Button variant="outline" tone="danger" onClick={remove}>Delete INV-2041</Button>
|
|
139
116
|
);
|
|
140
117
|
}
|
|
141
118
|
```
|
|
@@ -17,19 +17,31 @@ Group of toggle buttons where one or many can be active.
|
|
|
17
17
|
## Example: Single
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
import { ToggleGroup } from '@nexub/react';
|
|
21
|
+
|
|
22
|
+
export default function Example() {
|
|
23
|
+
return (
|
|
24
|
+
<ToggleGroup.Root type="single" defaultValue="left">
|
|
25
|
+
<ToggleGroup.Item value="left">Left</ToggleGroup.Item>
|
|
26
|
+
<ToggleGroup.Item value="center">Center</ToggleGroup.Item>
|
|
27
|
+
<ToggleGroup.Item value="right">Right</ToggleGroup.Item>
|
|
28
|
+
</ToggleGroup.Root>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
## Example: Multiple
|
|
28
34
|
|
|
29
35
|
```tsx
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
import { ToggleGroup } from '@nexub/react';
|
|
37
|
+
|
|
38
|
+
export default function Example() {
|
|
39
|
+
return (
|
|
40
|
+
<ToggleGroup.Root type="multiple" defaultValue={['bold', 'italic']}>
|
|
41
|
+
<ToggleGroup.Item value="bold">Bold</ToggleGroup.Item>
|
|
42
|
+
<ToggleGroup.Item value="italic">Italic</ToggleGroup.Item>
|
|
43
|
+
<ToggleGroup.Item value="underline">Underline</ToggleGroup.Item>
|
|
44
|
+
</ToggleGroup.Root>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
35
47
|
```
|