@nexub/mcp 2.7.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
|
@@ -24,54 +24,49 @@ Vertically stacked list of collapsible sections.
|
|
|
24
24
|
## Example: Default
|
|
25
25
|
|
|
26
26
|
```tsx
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</Accordion.Root>
|
|
27
|
+
import { Accordion, Code } from '@nexub/react';
|
|
28
|
+
|
|
29
|
+
export default function Example() {
|
|
30
|
+
return (
|
|
31
|
+
<div className="w-full max-w-[480px]">
|
|
32
|
+
<Accordion.Root type="single" collapsible>
|
|
33
|
+
<Accordion.Item value="a">
|
|
34
|
+
<Accordion.Trigger>What is Nexub?</Accordion.Trigger>
|
|
35
|
+
<Accordion.Content>A design system for ambitious SaaS teams, built on tokens and accessibility.</Accordion.Content>
|
|
36
|
+
</Accordion.Item>
|
|
37
|
+
<Accordion.Item value="b">
|
|
38
|
+
<Accordion.Trigger>How do I install?</Accordion.Trigger>
|
|
39
|
+
<Accordion.Content>Run: <Code>pnpm add @nexub/react</Code></Accordion.Content>
|
|
40
|
+
</Accordion.Item>
|
|
41
|
+
<Accordion.Item value="c">
|
|
42
|
+
<Accordion.Trigger>Is it open source?</Accordion.Trigger>
|
|
43
|
+
<Accordion.Content>Yes — MIT licensed and free to use.</Accordion.Content>
|
|
44
|
+
</Accordion.Item>
|
|
45
|
+
</Accordion.Root>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
50
49
|
```
|
|
51
50
|
|
|
52
51
|
## Example: Multiple
|
|
53
52
|
|
|
54
53
|
```tsx
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Closed by default. Expanding this does not close the others.
|
|
74
|
-
</Accordion.Content>
|
|
75
|
-
</Accordion.Item>
|
|
76
|
-
</Accordion.Root>
|
|
54
|
+
import { Accordion } from '@nexub/react';
|
|
55
|
+
|
|
56
|
+
export default function Example() {
|
|
57
|
+
return (
|
|
58
|
+
<div className="w-full max-w-[480px]">
|
|
59
|
+
<Accordion.Root type="multiple">
|
|
60
|
+
<Accordion.Item value="x">
|
|
61
|
+
<Accordion.Trigger>Section A</Accordion.Trigger>
|
|
62
|
+
<Accordion.Content>Content for section A — stays open when B is opened.</Accordion.Content>
|
|
63
|
+
</Accordion.Item>
|
|
64
|
+
<Accordion.Item value="y">
|
|
65
|
+
<Accordion.Trigger>Section B</Accordion.Trigger>
|
|
66
|
+
<Accordion.Content>Content for section B — multiple can be open at once.</Accordion.Content>
|
|
67
|
+
</Accordion.Item>
|
|
68
|
+
</Accordion.Root>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
77
72
|
```
|
|
@@ -18,16 +18,17 @@ Chronological list of activity events with avatar, description, and timestamp.
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
import { ActivityFeed } from '@nexub/patterns';
|
|
22
|
+
|
|
23
|
+
export default function Example() {
|
|
24
|
+
return (
|
|
25
|
+
<div className="w-[340px]">
|
|
26
|
+
<ActivityFeed.Root>
|
|
27
|
+
<ActivityFeed.Item title="Sarah K. created an invoice" description="Invoice #1042 for Acme Corp" timestamp="2 min ago" />
|
|
28
|
+
<ActivityFeed.Item title="James L. approved a request" description="Budget increase for Q2" timestamp="15 min ago" />
|
|
29
|
+
<ActivityFeed.Item title="Maria R. added a comment" description="On the design review document" timestamp="1 hr ago" />
|
|
30
|
+
</ActivityFeed.Root>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
33
34
|
```
|
|
@@ -23,26 +23,30 @@ Confirmation dialog that requires an explicit user action before proceeding.
|
|
|
23
23
|
## Example: Default
|
|
24
24
|
|
|
25
25
|
```tsx
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
<AlertDialog.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</AlertDialog.
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
import { Button, AlertDialog } from '@nexub/react';
|
|
28
|
+
|
|
29
|
+
export default function Example() {
|
|
30
|
+
const [open, setOpen] = React.useState(false);
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<Button variant="destructive" onClick={() => setOpen(true)}>Delete account</Button>
|
|
34
|
+
<AlertDialog.Root open={open} onOpenChange={setOpen}>
|
|
35
|
+
<AlertDialog.Portal>
|
|
36
|
+
<AlertDialog.Overlay />
|
|
37
|
+
<AlertDialog.Content>
|
|
38
|
+
<AlertDialog.Title>Are you absolutely sure?</AlertDialog.Title>
|
|
39
|
+
<AlertDialog.Description>
|
|
40
|
+
This action cannot be undone. This will permanently delete your account and remove all your data.
|
|
41
|
+
</AlertDialog.Description>
|
|
42
|
+
<div className="flex gap-2 justify-end mt-6">
|
|
43
|
+
<AlertDialog.Cancel asChild><Button variant="outline">Cancel</Button></AlertDialog.Cancel>
|
|
44
|
+
<AlertDialog.Action asChild><Button variant="destructive">Yes, delete</Button></AlertDialog.Action>
|
|
45
|
+
</div>
|
|
46
|
+
</AlertDialog.Content>
|
|
47
|
+
</AlertDialog.Portal>
|
|
48
|
+
</AlertDialog.Root>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
48
52
|
```
|
|
@@ -33,22 +33,40 @@ Inline contextual message with optional title, icon, and dismiss action.
|
|
|
33
33
|
## Example: Default
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
|
-
|
|
36
|
+
import { Alert } from '@nexub/react';
|
|
37
|
+
|
|
38
|
+
export default function Example() {
|
|
39
|
+
return <Alert tone="info" title="Heads up">Your trial expires in 3 days.</Alert>;
|
|
40
|
+
}
|
|
37
41
|
```
|
|
38
42
|
|
|
39
43
|
## Example: Tones
|
|
40
44
|
|
|
41
45
|
```tsx
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
import { Alert } from '@nexub/react';
|
|
47
|
+
|
|
48
|
+
export default function Example() {
|
|
49
|
+
return (
|
|
50
|
+
<div className="flex flex-col gap-2 items-start w-full max-w-[480px]">
|
|
51
|
+
<Alert tone="info" title="Info">Informational message.</Alert>
|
|
52
|
+
<Alert tone="success" title="Success">Operation completed successfully.</Alert>
|
|
53
|
+
<Alert tone="warning" title="Warning">Something needs your attention.</Alert>
|
|
54
|
+
<Alert tone="danger" title="Error">Something went wrong.</Alert>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
48
58
|
```
|
|
49
59
|
|
|
50
60
|
## Example: Dismissible
|
|
51
61
|
|
|
52
62
|
```tsx
|
|
53
|
-
|
|
63
|
+
import { Alert } from '@nexub/react';
|
|
64
|
+
|
|
65
|
+
export default function Example() {
|
|
66
|
+
return (
|
|
67
|
+
<div className="w-full max-w-[480px]">
|
|
68
|
+
<Alert tone="success" title="Saved" onClose={() => {}}>Your changes have been saved.</Alert>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
54
72
|
```
|
|
@@ -21,14 +21,26 @@ Honest money: Intl formatting, tabular numerals, the currency’s minor unit and
|
|
|
21
21
|
## Example: Display
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
|
|
24
|
+
import { Amount } from '@nexub/react';
|
|
25
|
+
|
|
26
|
+
export default function Example() {
|
|
27
|
+
return <Amount value={128450.75} currency="USD" size="display" />;
|
|
28
|
+
}
|
|
25
29
|
```
|
|
26
30
|
|
|
27
31
|
## Example: Gains and losses
|
|
28
32
|
|
|
29
33
|
```tsx
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
import { Amount } from '@nexub/react';
|
|
35
|
+
|
|
36
|
+
export default function Example() {
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex gap-4">
|
|
39
|
+
<Amount value={312.4} currency="USD" tone="auto" signDisplay="exceptZero" />
|
|
40
|
+
<Amount value={-89.99} currency="USD" tone="auto" />
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
32
44
|
```
|
|
33
45
|
|
|
34
46
|
Related: [money-input](money-input.md), [number-ticker](number-ticker.md)
|
|
@@ -19,15 +19,26 @@ Authentication layout pattern. Wraps sign-in, sign-up, and reset flows in a cent
|
|
|
19
19
|
## Example: Sign in
|
|
20
20
|
|
|
21
21
|
```tsx
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
import { AuthCard } from '@nexub/patterns';
|
|
23
|
+
import { Label, Input, Button } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return (
|
|
27
|
+
<div className="w-[360px]">
|
|
28
|
+
<AuthCard title="Sign in" description="Welcome back — enter your credentials to continue.">
|
|
29
|
+
<div className="flex flex-col gap-3 items-start">
|
|
30
|
+
<div className="flex flex-col gap-1 items-start">
|
|
31
|
+
<Label htmlFor="auth-email">Email</Label>
|
|
32
|
+
<Input id="auth-email" type="email" placeholder="you@company.com" />
|
|
33
|
+
</div>
|
|
34
|
+
<div className="flex flex-col gap-1 items-start">
|
|
35
|
+
<Label htmlFor="auth-pass">Password</Label>
|
|
36
|
+
<Input id="auth-pass" type="password" placeholder="••••••••" />
|
|
37
|
+
</div>
|
|
38
|
+
<Button variant="primary" className="w-full">Sign in</Button>
|
|
39
|
+
</div>
|
|
40
|
+
</AuthCard>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
33
44
|
```
|
|
@@ -20,35 +20,56 @@ Type-to-search input with matching options dropdown.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
import { Autocomplete } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return (
|
|
27
|
+
<div className="w-[260px]">
|
|
28
|
+
<Autocomplete
|
|
29
|
+
options={[
|
|
30
|
+
{ value: 'react', label: 'React' },
|
|
31
|
+
{ value: 'vue', label: 'Vue' },
|
|
32
|
+
{ value: 'angular', label: 'Angular' },
|
|
33
|
+
{ value: 'svelte', label: 'Svelte' },
|
|
34
|
+
]}
|
|
35
|
+
placeholder="Search framework…"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
31
40
|
```
|
|
32
41
|
|
|
33
42
|
## Example: With loading state
|
|
34
43
|
|
|
35
44
|
```tsx
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
import { Autocomplete } from '@nexub/react';
|
|
46
|
+
|
|
47
|
+
export default function Example() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="w-[260px]">
|
|
50
|
+
<Autocomplete options={[]} loading placeholder="Loading options…" />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
41
54
|
```
|
|
42
55
|
|
|
43
56
|
## Example: Custom empty text
|
|
44
57
|
|
|
45
58
|
```tsx
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
import { Autocomplete } from '@nexub/react';
|
|
60
|
+
|
|
61
|
+
export default function Example() {
|
|
62
|
+
return (
|
|
63
|
+
<div className="w-[260px]">
|
|
64
|
+
<Autocomplete
|
|
65
|
+
options={[
|
|
66
|
+
{ value: 'nexub', label: 'Nexub' },
|
|
67
|
+
{ value: 'acme', label: 'Acme Corp' },
|
|
68
|
+
]}
|
|
69
|
+
placeholder="Search company…"
|
|
70
|
+
emptyText="No companies found. Try a different search."
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
54
75
|
```
|
|
@@ -17,10 +17,17 @@ Stacked group of avatars with overflow count.
|
|
|
17
17
|
## Example: Default
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
import { AvatarGroup, Avatar } from '@nexub/react';
|
|
21
|
+
|
|
22
|
+
export default function Example() {
|
|
23
|
+
return (
|
|
24
|
+
<AvatarGroup max={3}>
|
|
25
|
+
<Avatar name="Alice B" />
|
|
26
|
+
<Avatar name="Bob C" />
|
|
27
|
+
<Avatar name="Carol D" />
|
|
28
|
+
<Avatar name="Dave E" />
|
|
29
|
+
<Avatar name="Eve F" />
|
|
30
|
+
</AvatarGroup>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
26
33
|
```
|
|
@@ -20,29 +20,50 @@ Displays a user's profile picture with initials fallback.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
23
|
+
import { Avatar } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return <Avatar name="Alex Johnson" />;
|
|
27
|
+
}
|
|
24
28
|
```
|
|
25
29
|
|
|
26
30
|
## Example: Sizes
|
|
27
31
|
|
|
28
32
|
```tsx
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
import { Avatar } from '@nexub/react';
|
|
34
|
+
|
|
35
|
+
export default function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex gap-3 flex-wrap items-center justify-center">
|
|
38
|
+
{(['xs', 'sm', 'md', 'lg', 'xl'] as const).map((s) => (
|
|
39
|
+
<Avatar key={s} name="Alex J" size={s} />
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
## Example: With image
|
|
39
47
|
|
|
40
48
|
```tsx
|
|
41
|
-
|
|
49
|
+
import { Avatar } from '@nexub/react';
|
|
50
|
+
|
|
51
|
+
export default function Example() {
|
|
52
|
+
return <Avatar src="https://i.pravatar.cc/150?img=3" name="Alex Johnson" />;
|
|
53
|
+
}
|
|
42
54
|
```
|
|
43
55
|
|
|
44
56
|
## Example: With badge
|
|
45
57
|
|
|
46
58
|
```tsx
|
|
47
|
-
|
|
59
|
+
import { Avatar } from '@nexub/react';
|
|
60
|
+
|
|
61
|
+
export default function Example() {
|
|
62
|
+
return (
|
|
63
|
+
<div className="flex gap-3 flex-wrap items-center justify-center">
|
|
64
|
+
<Avatar name="Online" badge badgeColor="var(--color-success)" />
|
|
65
|
+
<Avatar name="Away" badge badgeColor="var(--color-warning)" />
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
48
69
|
```
|
|
@@ -32,32 +32,53 @@ Small status indicator or label. Communicates state, category, or count.
|
|
|
32
32
|
## Example: Tones
|
|
33
33
|
|
|
34
34
|
```tsx
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</
|
|
35
|
+
import { Badge } from '@nexub/react';
|
|
36
|
+
|
|
37
|
+
export default function Example() {
|
|
38
|
+
return (
|
|
39
|
+
<div className="flex gap-2 flex-wrap items-center justify-center">
|
|
40
|
+
<Badge tone="success">Active</Badge>
|
|
41
|
+
<Badge tone="danger">Error</Badge>
|
|
42
|
+
<Badge tone="warning">Warning</Badge>
|
|
43
|
+
<Badge tone="info">Info</Badge>
|
|
44
|
+
<Badge tone="neutral">Draft</Badge>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
42
48
|
```
|
|
43
49
|
|
|
44
50
|
## Example: Variants
|
|
45
51
|
|
|
46
52
|
```tsx
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
import { Badge } from '@nexub/react';
|
|
54
|
+
|
|
55
|
+
export default function Example() {
|
|
56
|
+
return (
|
|
57
|
+
<div className="flex gap-2 flex-wrap items-center justify-center">
|
|
58
|
+
<Badge variant="solid" tone="success">Solid</Badge>
|
|
59
|
+
<Badge variant="soft" tone="info">Soft</Badge>
|
|
60
|
+
<Badge variant="outline" tone="warning">Outline</Badge>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
52
64
|
```
|
|
53
65
|
|
|
54
66
|
## Example: With leading dot
|
|
55
67
|
|
|
56
68
|
```tsx
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
import { Badge } from '@nexub/react';
|
|
70
|
+
|
|
71
|
+
export default function Example() {
|
|
72
|
+
return (
|
|
73
|
+
<div className="flex gap-2 flex-wrap items-center justify-center">
|
|
74
|
+
{(['success', 'danger', 'warning'] as const).map((t) => (
|
|
75
|
+
<Badge key={t} tone={t} leadingIcon={<span className="w-[6px] h-[6px] rounded-full bg-current inline-block" />}>
|
|
76
|
+
{t === 'success' ? 'Online' : t === 'danger' ? 'Offline' : 'Away'}
|
|
77
|
+
</Badge>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
61
82
|
```
|
|
62
83
|
|
|
63
84
|
## Accessibility
|
|
@@ -17,16 +17,27 @@
|
|
|
17
17
|
## Example: Default
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
|
|
20
|
+
import { Banner } from '@nexub/react';
|
|
21
|
+
|
|
22
|
+
export default function Example() {
|
|
23
|
+
return <Banner tone="info">New features available — <strong>see what's new</strong></Banner>;
|
|
24
|
+
}
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
## Example: With action
|
|
24
28
|
|
|
25
29
|
```tsx
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
import { Banner, Button } from '@nexub/react';
|
|
31
|
+
|
|
32
|
+
export default function Example() {
|
|
33
|
+
return (
|
|
34
|
+
<Banner
|
|
35
|
+
tone="warning"
|
|
36
|
+
action={<Button variant="outline" size="sm">Review now</Button>}
|
|
37
|
+
onClose={() => {}}
|
|
38
|
+
>
|
|
39
|
+
Your payment method is expiring soon.
|
|
40
|
+
</Banner>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
32
43
|
```
|
|
@@ -26,17 +26,39 @@ A grid of card tiles in mixed sizes. Responds to its own width: 1 column, 2 at 4
|
|
|
26
26
|
## Example: Dashboard
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
import { BentoGrid, BentoTile } from '@nexub/patterns';
|
|
30
|
+
|
|
31
|
+
function BentoStat({ label, value }: { label: string; value: string }) {
|
|
32
|
+
return (
|
|
33
|
+
<BentoTile className="flex flex-col justify-between">
|
|
34
|
+
<span className="text-label-md text-[var(--color-on-surface-variant)]">{label}</span>
|
|
35
|
+
<span className="text-title-lg text-[var(--color-on-surface)]">{value}</span>
|
|
36
|
+
</BentoTile>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default function Example() {
|
|
41
|
+
const bars = ['40%', '65%', '50%', '80%', '72%', '90%', '60%'];
|
|
42
|
+
return (
|
|
43
|
+
<BentoGrid className="w-full">
|
|
44
|
+
<BentoTile size="2x2" className="flex flex-col gap-3">
|
|
45
|
+
<h3 className="text-title-sm text-[var(--color-on-surface)]">Revenue, last 7 days</h3>
|
|
46
|
+
<div role="img" aria-label={`Bar chart: ${bars.join(', ')}`} className="flex flex-1 items-end gap-2">
|
|
47
|
+
{bars.map((h, i) => (
|
|
48
|
+
<div key={i} className="flex-1 rounded-shape-min bg-[var(--color-primary-container)]" style={{ height: h }} />
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
</BentoTile>
|
|
52
|
+
<BentoStat label="Active users" value="12,480" />
|
|
53
|
+
<BentoStat label="Conversion" value="3.2%" />
|
|
54
|
+
<BentoTile size="2x1" className="flex items-center text-body-md text-[var(--color-on-surface-variant)]">
|
|
55
|
+
3 invoices awaiting approval.
|
|
56
|
+
</BentoTile>
|
|
57
|
+
<BentoStat label="Churn" value="0.8%" />
|
|
58
|
+
<BentoStat label="NPS" value="61" />
|
|
59
|
+
</BentoGrid>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
40
62
|
```
|
|
41
63
|
|
|
42
64
|
Related: [card](card.md), [stat-card](stat-card.md)
|