@nexub/mcp 2.7.0 → 2.9.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.
Files changed (103) hide show
  1. package/dist/skill/references/components/accordion.md +40 -45
  2. package/dist/skill/references/components/activity-feed.md +13 -12
  3. package/dist/skill/references/components/alert-dialog.md +26 -22
  4. package/dist/skill/references/components/alert.md +26 -8
  5. package/dist/skill/references/components/amount.md +15 -3
  6. package/dist/skill/references/components/auth-card.md +22 -11
  7. package/dist/skill/references/components/autocomplete.md +42 -21
  8. package/dist/skill/references/components/avatar-group.md +13 -6
  9. package/dist/skill/references/components/avatar.md +31 -10
  10. package/dist/skill/references/components/badge.md +37 -16
  11. package/dist/skill/references/components/banner.md +18 -7
  12. package/dist/skill/references/components/bento-grid.md +33 -11
  13. package/dist/skill/references/components/box.md +21 -9
  14. package/dist/skill/references/components/breadcrumb.md +32 -34
  15. package/dist/skill/references/components/button-group.md +32 -14
  16. package/dist/skill/references/components/button.md +57 -32
  17. package/dist/skill/references/components/callout.md +10 -2
  18. package/dist/skill/references/components/card.md +54 -22
  19. package/dist/skill/references/components/checkbox-card.md +23 -8
  20. package/dist/skill/references/components/checkbox.md +32 -19
  21. package/dist/skill/references/components/chip.md +22 -10
  22. package/dist/skill/references/components/citation.md +18 -10
  23. package/dist/skill/references/components/code-inline.md +20 -2
  24. package/dist/skill/references/components/collapsible.md +38 -33
  25. package/dist/skill/references/components/combobox.md +18 -16
  26. package/dist/skill/references/components/conversation.md +23 -11
  27. package/dist/skill/references/components/data-table.md +40 -36
  28. package/dist/skill/references/components/date-picker.md +21 -17
  29. package/dist/skill/references/components/date-range-picker.md +11 -5
  30. package/dist/skill/references/components/dialog.md +26 -22
  31. package/dist/skill/references/components/drawer.md +66 -44
  32. package/dist/skill/references/components/empty-state.md +40 -50
  33. package/dist/skill/references/components/error-state.md +22 -10
  34. package/dist/skill/references/components/error-summary.md +20 -14
  35. package/dist/skill/references/components/eyebrow-chip.md +15 -5
  36. package/dist/skill/references/components/filter-bar.md +18 -14
  37. package/dist/skill/references/components/filter-chip.md +12 -5
  38. package/dist/skill/references/components/flex.md +31 -15
  39. package/dist/skill/references/components/form-field.md +11 -5
  40. package/dist/skill/references/components/gradient-divider.md +5 -1
  41. package/dist/skill/references/components/grid.md +22 -14
  42. package/dist/skill/references/components/heading.md +30 -14
  43. package/dist/skill/references/components/helper-text.md +17 -7
  44. package/dist/skill/references/components/hover-card.md +21 -12
  45. package/dist/skill/references/components/icon-button.md +19 -17
  46. package/dist/skill/references/components/info-list.md +15 -6
  47. package/dist/skill/references/components/input.md +32 -12
  48. package/dist/skill/references/components/kbd.md +21 -19
  49. package/dist/skill/references/components/label.md +20 -6
  50. package/dist/skill/references/components/link.md +21 -7
  51. package/dist/skill/references/components/list-detail.md +27 -6
  52. package/dist/skill/references/components/media-card.md +55 -16
  53. package/dist/skill/references/components/message-bubble.md +30 -13
  54. package/dist/skill/references/components/money-input.md +10 -2
  55. package/dist/skill/references/components/motion-collapse.md +22 -22
  56. package/dist/skill/references/components/motion-fade.md +19 -15
  57. package/dist/skill/references/components/motion-scale.md +13 -20
  58. package/dist/skill/references/components/motion-slide.md +13 -25
  59. package/dist/skill/references/components/navigation-rail.md +14 -5
  60. package/dist/skill/references/components/notification-item.md +10 -6
  61. package/dist/skill/references/components/number-input.md +10 -2
  62. package/dist/skill/references/components/number-ticker.md +27 -6
  63. package/dist/skill/references/components/pagination.md +11 -20
  64. package/dist/skill/references/components/password-input.md +13 -2
  65. package/dist/skill/references/components/plan-card.md +17 -9
  66. package/dist/skill/references/components/popover.md +31 -21
  67. package/dist/skill/references/components/progress.md +22 -8
  68. package/dist/skill/references/components/prompt-input.md +57 -29
  69. package/dist/skill/references/components/radio-card.md +41 -22
  70. package/dist/skill/references/components/radio-group.md +32 -28
  71. package/dist/skill/references/components/rating.md +23 -7
  72. package/dist/skill/references/components/scroll-area.md +30 -29
  73. package/dist/skill/references/components/search-input.md +5 -1
  74. package/dist/skill/references/components/segmented-control.md +26 -19
  75. package/dist/skill/references/components/select.md +16 -8
  76. package/dist/skill/references/components/separator.md +16 -6
  77. package/dist/skill/references/components/settings-section.md +19 -10
  78. package/dist/skill/references/components/sheet.md +25 -22
  79. package/dist/skill/references/components/skeleton.md +29 -12
  80. package/dist/skill/references/components/slider.md +10 -2
  81. package/dist/skill/references/components/spinner.md +17 -8
  82. package/dist/skill/references/components/split-button.md +26 -15
  83. package/dist/skill/references/components/stack.md +22 -10
  84. package/dist/skill/references/components/stat-card.md +34 -15
  85. package/dist/skill/references/components/status-pill.md +18 -12
  86. package/dist/skill/references/components/step-indicator.md +10 -9
  87. package/dist/skill/references/components/streaming-text.md +21 -12
  88. package/dist/skill/references/components/switch.md +10 -9
  89. package/dist/skill/references/components/table.md +66 -60
  90. package/dist/skill/references/components/tabs.md +24 -16
  91. package/dist/skill/references/components/tag.md +13 -5
  92. package/dist/skill/references/components/text-gradient.md +14 -5
  93. package/dist/skill/references/components/text.md +29 -12
  94. package/dist/skill/references/components/textarea.md +21 -7
  95. package/dist/skill/references/components/thinking-indicator.md +16 -4
  96. package/dist/skill/references/components/toast.md +41 -64
  97. package/dist/skill/references/components/toggle-group.md +22 -10
  98. package/dist/skill/references/components/toggle.md +15 -5
  99. package/dist/skill/references/components/tooltip.md +22 -9
  100. package/dist/skill/references/components/user-card.md +9 -5
  101. package/dist/skill/references/components.md +1 -1
  102. package/dist/skill/references/tokens.md +1 -1
  103. 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
- 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>
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
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
23
- <Switch id="airplane" />
24
- <Label htmlFor="airplane">Airplane mode</Label>
25
- </div>
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
- <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
32
- <Switch size="sm" />
33
- <Switch size="md" />
34
- <Switch size="lg" />
35
- </div>
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
- <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>
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
- <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>
58
+ import { Table, Badge } 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><Badge variant="soft" tone={r.status === 'Active' ? 'success' : r.status === 'Pending' ? 'warning' : 'neutral'}>{r.status}</Badge></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
- <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>
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
- <div style={{ display: 'flex', gap: '8px' }}>
21
- <Tag>Frontend</Tag>
22
- <Tag tone="info">Backend</Tag>
23
- <Tag tone="success">Deployed</Tag>
24
- </div>
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
- <TextGradient>Design system for ambitious teams</TextGradient>
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
- <Heading size="h1">
27
- Build with{' '}
28
- <TextGradient>Nexub</TextGradient>
29
- </Heading>
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
- <Text>The Nexub design system provides accessible, token-driven components.</Text>
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
30
- <Text size="body-lg">Body large — ideal for introductory paragraphs.</Text>
31
- <Text size="body">Body — the default reading size.</Text>
32
- <Text size="body-sm">Body small — secondary content and descriptions.</Text>
33
- <Text size="caption">Caption — metadata and timestamps.</Text>
34
- </div>
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
41
- <Text tone="default">Default tone</Text>
42
- <Text tone="secondary">Secondary tone</Text>
43
- <Text tone="muted">Muted tone</Text>
44
- </div>
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
- <Textarea placeholder="Enter your message…" />
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
30
- <Textarea size="sm" placeholder="Small textarea" />
31
- <Textarea size="md" placeholder="Medium textarea" />
32
- <Textarea size="lg" placeholder="Large textarea" />
33
- </div>
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
- <Textarea invalid placeholder="This field has an error" />
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
- <ThinkingIndicator />
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
- <ThinkingIndicator label="Searching 4 sources" />
39
- <ThinkingIndicator size="sm" />
40
- <ThinkingIndicator size="sm" label={null} />
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
- function DefaultToast() {
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
- <Toaster />
47
- <Button
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
- function ToastVariants() {
58
+ import { Button, toast } from '@nexub/react';
59
+
60
+ export default function Example() {
62
61
  return (
63
- <>
64
- <Toaster />
65
- <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
66
- <Button variant="outline" onClick={() => toast.custom('Default notification')}>
67
- Default
68
- </Button>
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
- function ToastWithAction() {
75
+ import { Button, toast } from '@nexub/react';
76
+
77
+ export default function Example() {
91
78
  return (
92
- <>
93
- <Toaster />
94
- <Button
95
- variant="outline"
96
- onClick={() =>
97
- toast.custom('Message sent', {
98
- description: 'Your message has been delivered to the team.',
99
- action: {
100
- label: 'Undo',
101
- onClick: () => {},
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
- function UndoableDelete() {
119
- const [hidden, setHidden] = React.useState(false);
99
+ import * as React from 'react';
100
+ import { Button, toast } from '@nexub/react';
120
101
 
121
- function remove() {
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: () => deleteInvoice('INV-2041'),
109
+ onCommit: () => {},
127
110
  });
128
- }
129
-
130
- return (
131
- <>
132
- <Toaster />
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
- <ToggleGroup.Root type="single" defaultValue="left">
21
- <ToggleGroup.Item value="left">Left</ToggleGroup.Item>
22
- <ToggleGroup.Item value="center">Center</ToggleGroup.Item>
23
- <ToggleGroup.Item value="right">Right</ToggleGroup.Item>
24
- </ToggleGroup.Root>
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
- <ToggleGroup.Root type="multiple" defaultValue={["bold", "italic"]}>
31
- <ToggleGroup.Item value="bold">Bold</ToggleGroup.Item>
32
- <ToggleGroup.Item value="italic">Italic</ToggleGroup.Item>
33
- <ToggleGroup.Item value="underline">Underline</ToggleGroup.Item>
34
- </ToggleGroup.Root>
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
  ```