@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.
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
@@ -18,18 +18,30 @@ Generic container primitive with style token props.
18
18
  ## Example: Default
19
19
 
20
20
  ```tsx
21
- <Box padding="md" style={{ background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
22
- Content inside a Box
23
- </Box>
21
+ import { Box, Text } from '@nexub/react';
22
+
23
+ export default function Example() {
24
+ return (
25
+ <Box className="p-4 bg-[var(--color-surface-container-low)] rounded-shape-field">
26
+ <Text size="body-sm">Content inside a Box</Text>
27
+ </Box>
28
+ );
29
+ }
24
30
  ```
25
31
 
26
32
  ## Example: Nested
27
33
 
28
34
  ```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
+ import { Box, Heading, Text } from '@nexub/react';
36
+
37
+ export default function Example() {
38
+ return (
39
+ <Box className="p-6 bg-[var(--color-surface-container-low)] rounded-shape-container">
40
+ <Heading size="h4">Section title</Heading>
41
+ <Box className="p-3 bg-[var(--color-surface)] rounded-shape-field mt-2">
42
+ <Text size="body-sm">Nested box content</Text>
43
+ </Box>
44
+ </Box>
45
+ );
46
+ }
35
47
  ```
@@ -19,43 +19,41 @@ Hierarchical navigation trail showing page location.
19
19
  ## Example: Default
20
20
 
21
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>
22
+ import { Breadcrumb } from '@nexub/react';
23
+
24
+ export default function Example() {
25
+ return (
26
+ <Breadcrumb.Root>
27
+ <Breadcrumb.List>
28
+ <Breadcrumb.Item><Breadcrumb.Link href="/">Home</Breadcrumb.Link></Breadcrumb.Item>
29
+ <Breadcrumb.Separator />
30
+ <Breadcrumb.Item><Breadcrumb.Link href="/components">Components</Breadcrumb.Link></Breadcrumb.Item>
31
+ <Breadcrumb.Separator />
32
+ <Breadcrumb.Item><Breadcrumb.Page>Button</Breadcrumb.Page></Breadcrumb.Item>
33
+ </Breadcrumb.List>
34
+ </Breadcrumb.Root>
35
+ );
36
+ }
37
37
  ```
38
38
 
39
39
  ## Example: With ellipsis
40
40
 
41
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>
42
+ import { Breadcrumb } from '@nexub/react';
43
+
44
+ export default function Example() {
45
+ return (
46
+ <Breadcrumb.Root>
47
+ <Breadcrumb.List>
48
+ <Breadcrumb.Item><Breadcrumb.Link href="/">Home</Breadcrumb.Link></Breadcrumb.Item>
49
+ <Breadcrumb.Separator />
50
+ <Breadcrumb.Item><Breadcrumb.Ellipsis /></Breadcrumb.Item>
51
+ <Breadcrumb.Separator />
52
+ <Breadcrumb.Item><Breadcrumb.Link href="/components/navigation">Navigation</Breadcrumb.Link></Breadcrumb.Item>
53
+ <Breadcrumb.Separator />
54
+ <Breadcrumb.Item><Breadcrumb.Page>Breadcrumb</Breadcrumb.Page></Breadcrumb.Item>
55
+ </Breadcrumb.List>
56
+ </Breadcrumb.Root>
57
+ );
58
+ }
61
59
  ```
@@ -16,28 +16,46 @@ Groups related buttons together with optional attachment and orientation.
16
16
  ## Example: Default
17
17
 
18
18
  ```tsx
19
- <ButtonGroup>
20
- <Button variant="primary">Save</Button>
21
- <Button variant="outline">Cancel</Button>
22
- </ButtonGroup>
19
+ import { ButtonGroup, Button } from '@nexub/react';
20
+
21
+ export default function Example() {
22
+ return (
23
+ <ButtonGroup>
24
+ <Button variant="primary">Save</Button>
25
+ <Button variant="outline">Cancel</Button>
26
+ </ButtonGroup>
27
+ );
28
+ }
23
29
  ```
24
30
 
25
31
  ## Example: Attached
26
32
 
27
33
  ```tsx
28
- <ButtonGroup attached>
29
- <Button variant="outline">Left</Button>
30
- <Button variant="outline">Center</Button>
31
- <Button variant="outline">Right</Button>
32
- </ButtonGroup>
34
+ import { ButtonGroup, Button } from '@nexub/react';
35
+
36
+ export default function Example() {
37
+ return (
38
+ <ButtonGroup attached>
39
+ <Button variant="outline">Left</Button>
40
+ <Button variant="outline">Center</Button>
41
+ <Button variant="outline">Right</Button>
42
+ </ButtonGroup>
43
+ );
44
+ }
33
45
  ```
34
46
 
35
47
  ## Example: Vertical
36
48
 
37
49
  ```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>
50
+ import { ButtonGroup, Button } from '@nexub/react';
51
+
52
+ export default function Example() {
53
+ return (
54
+ <ButtonGroup orientation="vertical">
55
+ <Button variant="outline">Option A</Button>
56
+ <Button variant="outline">Option B</Button>
57
+ <Button variant="outline">Option C</Button>
58
+ </ButtonGroup>
59
+ );
60
+ }
43
61
  ```
@@ -41,39 +41,61 @@ Triggers an action or event. Supports multiple variants, sizes, and semantic ton
41
41
  ## Example: Default
42
42
 
43
43
  ```tsx
44
- <Button variant="primary">Click me</Button>
44
+ import { Button } from '@nexub/react';
45
+
46
+ export default function Example() {
47
+ return <Button variant="primary">Click me</Button>;
48
+ }
45
49
  ```
46
50
 
47
51
  ## Example: Variants
48
52
 
49
53
  ```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>
54
+ import { Button } from '@nexub/react';
55
+
56
+ export default function Example() {
57
+ return (
58
+ <div className="flex gap-2 flex-wrap items-center justify-center">
59
+ <Button variant="primary">Primary</Button>
60
+ <Button variant="outline">Outline</Button>
61
+ <Button variant="ghost">Ghost</Button>
62
+ <Button variant="subtle">Subtle</Button>
63
+ <Button variant="link">Link</Button>
64
+ </div>
65
+ );
66
+ }
57
67
  ```
58
68
 
59
69
  ## Example: Sizes
60
70
 
61
71
  ```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>
72
+ import { Button } from '@nexub/react';
73
+
74
+ export default function Example() {
75
+ return (
76
+ <div className="flex gap-2 flex-wrap items-center justify-center">
77
+ <Button size="xs" variant="primary">XSmall</Button>
78
+ <Button size="sm" variant="primary">Small</Button>
79
+ <Button size="md" variant="primary">Medium</Button>
80
+ <Button size="lg" variant="primary">Large</Button>
81
+ </div>
82
+ );
83
+ }
68
84
  ```
69
85
 
70
86
  ## Example: States
71
87
 
72
88
  ```tsx
73
- <div style={{ display: 'flex', gap: '8px' }}>
74
- <Button variant="primary" loading>Loading</Button>
75
- <Button variant="outline" disabled>Disabled</Button>
76
- </div>
89
+ import { Button } from '@nexub/react';
90
+
91
+ export default function Example() {
92
+ return (
93
+ <div className="flex gap-2 flex-wrap items-center justify-center">
94
+ <Button variant="primary" loading>Loading</Button>
95
+ <Button variant="outline" disabled>Disabled</Button>
96
+ </div>
97
+ );
98
+ }
77
99
  ```
78
100
 
79
101
  ## Example: Async
@@ -81,23 +103,26 @@ Triggers an action or event. Supports multiple variants, sizes, and semantic ton
81
103
  Drive `status` from the request. Each click here moves to the next status.
82
104
 
83
105
  ```tsx
84
- function SaveButton() {
85
- const [status, setStatus] = React.useState<ButtonStatus>('idle');
106
+ import * as React from 'react';
107
+ import { type ButtonStatus, Button } from '@nexub/react';
86
108
 
87
- async function save() {
88
- setStatus('loading');
89
- try {
90
- await saveProfile();
91
- setStatus('success');
92
- } catch {
93
- setStatus('error');
94
- }
95
- }
109
+ const NEXT_STATUS: Record<ButtonStatus, ButtonStatus> = { idle: 'loading', loading: 'success', success: 'error', error: 'idle' };
96
110
 
111
+ export default function Example() {
112
+ const [status, setStatus] = React.useState<ButtonStatus>('idle');
113
+ // Clicks are ignored while loading, so loading moves on by itself.
114
+ React.useEffect(() => {
115
+ if (status !== 'loading') return;
116
+ const t = setTimeout(() => setStatus('success'), 1200);
117
+ return () => clearTimeout(t);
118
+ }, [status]);
97
119
  return (
98
- <Button status={status} loadingLabel="Saving" successLabel="Saved" errorLabel="Couldn't save" onClick={save}>
99
- Save
100
- </Button>
120
+ <div className="flex flex-col gap-2 items-start">
121
+ <Button status={status} loadingLabel="Saving" successLabel="Saved" errorLabel="Couldn't save" onClick={() => setStatus(NEXT_STATUS[status])}>
122
+ Save
123
+ </Button>
124
+ <span className="text-body-sm text-[var(--color-on-surface-variant)]">status: {status}</span>
125
+ </div>
101
126
  );
102
127
  }
103
128
  ```
@@ -17,11 +17,19 @@
17
17
  ## Example: Default
18
18
 
19
19
  ```tsx
20
- <Callout tone="warning" title="Before you continue">Deleting this record is permanent and cannot be undone.</Callout>
20
+ import { Callout } from '@nexub/react';
21
+
22
+ export default function Example() {
23
+ return <Callout tone="warning" title="Before you continue">Deleting this record is permanent and cannot be undone.</Callout>;
24
+ }
21
25
  ```
22
26
 
23
27
  ## Example: Info
24
28
 
25
29
  ```tsx
26
- <Callout tone="info">Use token names instead of raw hex values for consistent theming.</Callout>
30
+ import { Callout } from '@nexub/react';
31
+
32
+ export default function Example() {
33
+ return <Callout tone="info">Use token names instead of raw hex values for consistent theming.</Callout>;
34
+ }
27
35
  ```
@@ -20,20 +20,34 @@ Surface container for grouping related content. Supports flat, surface, and inte
20
20
  ## Example: Default
21
21
 
22
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>
23
+ import { Card, Text } from '@nexub/react';
24
+
25
+ export default function Example() {
26
+ return (
27
+ <div className="w-[280px]">
28
+ <Card>
29
+ <div className="font-semibold mb-1 text-[var(--color-on-surface)]">Card title</div>
30
+ <Text size="body-sm" tone="muted">Cards group related content on a raised surface.</Text>
31
+ </Card>
32
+ </div>
33
+ );
34
+ }
27
35
  ```
28
36
 
29
37
  ## Example: Variants
30
38
 
31
39
  ```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>
40
+ import { Card, Text } from '@nexub/react';
41
+
42
+ export default function Example() {
43
+ return (
44
+ <div className="flex flex-col gap-2.5 items-start w-[280px]">
45
+ <Card variant="flat"><Text size="body-sm">Flat</Text></Card>
46
+ <Card variant="surface"><Text size="body-sm">Surface</Text></Card>
47
+ <Card variant="interactive"><Text size="body-sm">Interactive</Text></Card>
48
+ </div>
49
+ );
50
+ }
37
51
  ```
38
52
 
39
53
  ## Example: Card link
@@ -41,15 +55,25 @@ Surface container for grouping related content. Supports flat, surface, and inte
41
55
  The whole card is one link named by its title. The button sits above the link with `relative z-[1]`.
42
56
 
43
57
  ```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>
58
+ import * as React from 'react';
59
+ import { Card, Heading, CardLink, Text, Button } from '@nexub/react';
60
+
61
+ export default function Example() {
62
+ const [starred, setStarred] = React.useState(false);
63
+ return (
64
+ <div className="w-[280px]">
65
+ <Card variant="interactive" className="p-4">
66
+ <Heading level={3} size="h5">
67
+ <CardLink href="#">Atlas</CardLink>
68
+ </Heading>
69
+ <Text size="body-sm" tone="muted">Updated 2 hours ago</Text>
70
+ <Button size="sm" variant="text" className="relative z-[1] mt-2" onClick={() => setStarred((v) => !v)}>
71
+ {starred ? 'Starred' : 'Star'}
72
+ </Button>
73
+ </Card>
74
+ </div>
75
+ );
76
+ }
53
77
  ```
54
78
 
55
79
  ## Example: Sheen
@@ -57,10 +81,18 @@ The whole card is one link named by its title. The button sits above the link wi
57
81
  Move the pointer over the card.
58
82
 
59
83
  ```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>
84
+ import { Card, Heading, Text } from '@nexub/react';
85
+
86
+ export default function Example() {
87
+ return (
88
+ <div className="w-[280px]">
89
+ <Card variant="surface" effect="sheen" className="p-6">
90
+ <Heading level={3} size="h5">Pro</Heading>
91
+ <Text size="body-sm" tone="muted">Everything in Team, plus audit logs.</Text>
92
+ </Card>
93
+ </div>
94
+ );
95
+ }
64
96
  ```
65
97
 
66
98
  ## Accessibility
@@ -23,19 +23,34 @@ A checkbox drawn as a whole card: title, description and optional icon. Pick any
23
23
  Lay checkbox cards out with any grid; there is no group component.
24
24
 
25
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>
26
+ import { CheckboxCard } from '@nexub/react';
27
+ import { Bell, Shield, Zap } from '@nexub/icons';
28
+
29
+ export default function Example() {
30
+ return (
31
+ <fieldset className="grid gap-3 sm:grid-cols-3 w-full border-0 p-0 m-0">
32
+ <legend className="sr-only">Add-ons</legend>
33
+ <CheckboxCard icon={<Bell />} title="Alerts" description="Email and push notifications." defaultChecked />
34
+ <CheckboxCard icon={<Shield />} title="Audit log" description="Keep a year of activity." />
35
+ <CheckboxCard icon={<Zap />} title="Automations" description="Run rules on new records." />
36
+ </fieldset>
37
+ );
38
+ }
32
39
  ```
33
40
 
34
41
  ## Example: Disabled
35
42
 
36
43
  ```tsx
37
- <CheckboxCard title="SSO" description="Available on Enterprise." disabled />
38
- <CheckboxCard title="Data residency" description="Included in your plan." defaultChecked disabled />
44
+ import { CheckboxCard } from '@nexub/react';
45
+
46
+ export default function Example() {
47
+ return (
48
+ <div className="flex flex-col gap-3 items-stretch w-[320px]">
49
+ <CheckboxCard title="SSO" description="Available on Enterprise." disabled />
50
+ <CheckboxCard title="Data residency" description="Included in your plan." defaultChecked disabled />
51
+ </div>
52
+ );
53
+ }
39
54
  ```
40
55
 
41
56
  ## Accessibility
@@ -19,33 +19,46 @@ Binary checkbox input built on Radix UI.
19
19
  ## Example: Default
20
20
 
21
21
  ```tsx
22
- <Checkbox defaultChecked />
22
+ import { Checkbox } from '@nexub/react';
23
+
24
+ export default function Example() {
25
+ return <Checkbox defaultChecked />;
26
+ }
23
27
  ```
24
28
 
25
29
  ## Example: With label
26
30
 
27
31
  ```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
+ import { Checkbox, Label } from '@nexub/react';
33
+
34
+ export default function Example() {
35
+ return (
36
+ <div className="flex items-center gap-2">
37
+ <Checkbox id="terms" />
38
+ <Label htmlFor="terms">I agree to the terms and conditions</Label>
39
+ </div>
40
+ );
41
+ }
32
42
  ```
33
43
 
34
44
  ## Example: States
35
45
 
36
46
  ```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>
47
+ import { Checkbox, Label } from '@nexub/react';
48
+
49
+ export default function Example() {
50
+ return (
51
+ <div className="flex flex-col gap-3 items-start">
52
+ <div className="flex items-center gap-2">
53
+ <Checkbox defaultChecked /><Label>Checked</Label>
54
+ </div>
55
+ <div className="flex items-center gap-2">
56
+ <Checkbox /><Label>Unchecked</Label>
57
+ </div>
58
+ <div className="flex items-center gap-2">
59
+ <Checkbox disabled /><Label>Disabled</Label>
60
+ </div>
61
+ </div>
62
+ );
63
+ }
51
64
  ```
@@ -17,19 +17,31 @@ Compact label chip, optionally dismissible.
17
17
  ## Example: Default
18
18
 
19
19
  ```tsx
20
- <div style={{ display: 'flex', gap: '8px' }}>
21
- <Chip>Design</Chip>
22
- <Chip>Engineering</Chip>
23
- <Chip>Product</Chip>
24
- </div>
20
+ import { Chip } from '@nexub/react';
21
+
22
+ export default function Example() {
23
+ return (
24
+ <div className="flex gap-2 flex-wrap items-center justify-center">
25
+ {['Design', 'Engineering', 'Product'].map((c) => <Chip key={c}>{c}</Chip>)}
26
+ </div>
27
+ );
28
+ }
25
29
  ```
26
30
 
27
31
  ## Example: Dismissible
28
32
 
29
33
  ```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>
34
+ import * as React from 'react';
35
+ import { Chip } from '@nexub/react';
36
+
37
+ export default function Example() {
38
+ const [chips, setChips] = React.useState(['Design', 'Engineering', 'Product']);
39
+ return (
40
+ <div className="flex gap-2 flex-wrap items-center justify-center">
41
+ {chips.map((c) => (
42
+ <Chip key={c} onRemove={() => setChips((prev) => prev.filter((x) => x !== c))}>{c}</Chip>
43
+ ))}
44
+ </div>
45
+ );
46
+ }
35
47
  ```
@@ -35,18 +35,26 @@ Numbered source markers for running text, with a hover preview, plus SourceChip
35
35
  Hover or focus a number to preview its source.
36
36
 
37
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' },
38
+ import { Citation, SourceList, type CitationSource } from '@nexub/react';
39
+
40
+ const CITATION_SOURCES: CitationSource[] = [
41
+ { title: 'Choosing a heat pump', url: 'https://example.com/guides/heat-pumps', snippet: 'Air-source pumps suit most homes with a garden or outside wall.' },
42
+ { title: 'Grants for home heating', url: 'https://example.org/grants', domain: 'example.org' },
43
+ { title: 'Running costs compared', url: 'https://example.net/costs' },
42
44
  ];
43
45
 
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} />
46
+ export default function Example() {
47
+ return (
48
+ <div className="flex flex-col gap-4 items-stretch max-w-[560px]">
49
+ <p>
50
+ Most homes can use an air-source heat pump<Citation index={1} source={CITATION_SOURCES[0]!} />. Grants cover
51
+ part of the cost<Citation index={2} source={CITATION_SOURCES[1]!} />, and running costs are close to gas
52
+ <Citation index={3} source={CITATION_SOURCES[2]!} />.
53
+ </p>
54
+ <SourceList sources={CITATION_SOURCES} />
55
+ </div>
56
+ );
57
+ }
50
58
  ```
51
59
 
52
60
  ## Accessibility
@@ -15,11 +15,29 @@ Inline code span for technical terms and short code snippets.
15
15
  ## Example: Default
16
16
 
17
17
  ```tsx
18
- <Code>npm install @nexub/react</Code>
18
+ import { Code } from '@nexub/react';
19
+
20
+ export default function Example() {
21
+ return (
22
+ <div className="flex gap-2 flex-wrap">
23
+ <Code>npm install</Code>
24
+ <Code>useTheme()</Code>
25
+ <Code>@nexub/react</Code>
26
+ </div>
27
+ );
28
+ }
19
29
  ```
20
30
 
21
31
  ## Example: In prose
22
32
 
23
33
  ```tsx
24
- <Text>Use the <Code>useTheme()</Code> hook to access the current theme.</Text>
34
+ import { Text, Code } from '@nexub/react';
35
+
36
+ export default function Example() {
37
+ return (
38
+ <Text>
39
+ Use the <Code>useTheme()</Code> hook to access the current theme from any component.
40
+ </Text>
41
+ );
42
+ }
25
43
  ```