@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
|
@@ -18,18 +18,30 @@ Generic container primitive with style token props.
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</Breadcrumb.
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
85
|
-
|
|
106
|
+
import * as React from 'react';
|
|
107
|
+
import { type ButtonStatus, Button } from '@nexub/react';
|
|
86
108
|
|
|
87
|
-
|
|
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
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{ url: 'https://example.
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
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
|
-
|
|
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
|
-
|
|
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
|
```
|