@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.
- 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
|
@@ -37,33 +37,53 @@ Text input field for forms. Supports size variants, icons, addons, and validatio
|
|
|
37
37
|
## Example: Default
|
|
38
38
|
|
|
39
39
|
```tsx
|
|
40
|
-
|
|
40
|
+
import { Input } from '@nexub/react';
|
|
41
|
+
|
|
42
|
+
export default function Example() {
|
|
43
|
+
return <div className="w-[280px]"><Input placeholder="Enter value…" /></div>;
|
|
44
|
+
}
|
|
41
45
|
```
|
|
42
46
|
|
|
43
47
|
## Example: Sizes
|
|
44
48
|
|
|
45
49
|
```tsx
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
import { Input } from '@nexub/react';
|
|
51
|
+
|
|
52
|
+
export default function Example() {
|
|
53
|
+
return (
|
|
54
|
+
<div className="flex flex-col gap-2 items-start w-[280px]">
|
|
55
|
+
<Input size="sm" placeholder="Small" />
|
|
56
|
+
<Input size="md" placeholder="Medium" />
|
|
57
|
+
<Input size="lg" placeholder="Large" />
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
51
61
|
```
|
|
52
62
|
|
|
53
63
|
## Example: Invalid state
|
|
54
64
|
|
|
55
65
|
```tsx
|
|
56
|
-
|
|
66
|
+
import { Input } from '@nexub/react';
|
|
67
|
+
|
|
68
|
+
export default function Example() {
|
|
69
|
+
return <div className="w-[280px]"><Input invalid placeholder="Invalid value" /></div>;
|
|
70
|
+
}
|
|
57
71
|
```
|
|
58
72
|
|
|
59
73
|
## Example: With label and helper
|
|
60
74
|
|
|
61
75
|
```tsx
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
import { Label, Input, HelperText } from '@nexub/react';
|
|
77
|
+
|
|
78
|
+
export default function Example() {
|
|
79
|
+
return (
|
|
80
|
+
<div className="flex flex-col gap-1 items-start w-[280px]">
|
|
81
|
+
<Label htmlFor="demo-email">Email address</Label>
|
|
82
|
+
<Input id="demo-email" type="email" placeholder="you@example.com" />
|
|
83
|
+
<HelperText>We'll never share your email.</HelperText>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
67
87
|
```
|
|
68
88
|
|
|
69
89
|
## Accessibility
|
|
@@ -15,28 +15,30 @@ Keyboard key display — renders a styled <kbd> element.
|
|
|
15
15
|
## Example: Default
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
import { Kbd } from '@nexub/react';
|
|
19
|
+
|
|
20
|
+
export default function Example() {
|
|
21
|
+
return (
|
|
22
|
+
<div className="flex gap-1 flex-wrap items-center justify-center">
|
|
23
|
+
<Kbd>⌘</Kbd>
|
|
24
|
+
<Kbd>K</Kbd>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
22
28
|
```
|
|
23
29
|
|
|
24
30
|
## Example: Combinations
|
|
25
31
|
|
|
26
32
|
```tsx
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<Kbd>⌘</Kbd>
|
|
39
|
-
<Kbd>P</Kbd>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
33
|
+
import { Kbd, Text } from '@nexub/react';
|
|
34
|
+
|
|
35
|
+
export default function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex flex-col gap-2 items-start">
|
|
38
|
+
<div className="flex gap-1 flex-wrap items-center justify-center"><Kbd>⌘</Kbd><Kbd>K</Kbd><Text size="body-sm" tone="secondary">— Open search</Text></div>
|
|
39
|
+
<div className="flex gap-1 flex-wrap items-center justify-center"><Kbd>⌃</Kbd><Kbd>C</Kbd><Text size="body-sm" tone="secondary">— Copy</Text></div>
|
|
40
|
+
<div className="flex gap-1 flex-wrap items-center justify-center"><Kbd>⇧</Kbd><Kbd>⌘</Kbd><Kbd>P</Kbd><Text size="body-sm" tone="secondary">— Command palette</Text></div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
42
44
|
```
|
|
@@ -18,20 +18,34 @@ An accessible form label that optionally shows a required asterisk and links to
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
21
|
+
import { Label } from '@nexub/react';
|
|
22
|
+
|
|
23
|
+
export default function Example() {
|
|
24
|
+
return <Label htmlFor="demo">Full name</Label>;
|
|
25
|
+
}
|
|
22
26
|
```
|
|
23
27
|
|
|
24
28
|
## Example: Required
|
|
25
29
|
|
|
26
30
|
```tsx
|
|
27
|
-
|
|
31
|
+
import { Label } from '@nexub/react';
|
|
32
|
+
|
|
33
|
+
export default function Example() {
|
|
34
|
+
return <Label required>Email address</Label>;
|
|
35
|
+
}
|
|
28
36
|
```
|
|
29
37
|
|
|
30
38
|
## Example: With input
|
|
31
39
|
|
|
32
40
|
```tsx
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
import { Label, Input } from '@nexub/react';
|
|
42
|
+
|
|
43
|
+
export default function Example() {
|
|
44
|
+
return (
|
|
45
|
+
<div className="flex flex-col gap-1 items-start w-[280px]">
|
|
46
|
+
<Label htmlFor="email-ex">Email</Label>
|
|
47
|
+
<Input id="email-ex" type="email" placeholder="you@example.com" />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
37
51
|
```
|
|
@@ -18,21 +18,35 @@ Styled anchor link with variant and external support.
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
21
|
+
import { Link } from '@nexub/react';
|
|
22
|
+
|
|
23
|
+
export default function Example() {
|
|
24
|
+
return <Link href="#">View documentation</Link>;
|
|
25
|
+
}
|
|
22
26
|
```
|
|
23
27
|
|
|
24
28
|
## Example: Variants
|
|
25
29
|
|
|
26
30
|
```tsx
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
import { Link } from '@nexub/react';
|
|
32
|
+
|
|
33
|
+
export default function Example() {
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex gap-4 flex-wrap items-center justify-center">
|
|
36
|
+
<Link href="#" variant="default">Default</Link>
|
|
37
|
+
<Link href="#" variant="muted">Muted</Link>
|
|
38
|
+
<Link href="#" variant="underlined">Underline</Link>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
32
42
|
```
|
|
33
43
|
|
|
34
44
|
## Example: External
|
|
35
45
|
|
|
36
46
|
```tsx
|
|
37
|
-
|
|
47
|
+
import { Link } from '@nexub/react';
|
|
48
|
+
|
|
49
|
+
export default function Example() {
|
|
50
|
+
return <Link href="#" external>Open in new tab</Link>;
|
|
51
|
+
}
|
|
38
52
|
```
|
|
@@ -18,10 +18,31 @@ The list-detail layout: side by side at 720px+ of its own width (a container que
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
import { ListDetail } from '@nexub/patterns';
|
|
23
|
+
|
|
24
|
+
export default function Example() {
|
|
25
|
+
const [selected, setSelected] = React.useState<number | null>(0);
|
|
26
|
+
const items = ['Quarterly report', 'Design review', 'Invoice #4821'];
|
|
27
|
+
return (
|
|
28
|
+
<div className="w-full h-[240px] border border-[var(--color-outline-variant)] rounded-[16px] overflow-hidden">
|
|
29
|
+
<ListDetail
|
|
30
|
+
showDetail={selected !== null}
|
|
31
|
+
onBack={() => setSelected(null)}
|
|
32
|
+
list={
|
|
33
|
+
<ul className="p-2 m-0 list-none">
|
|
34
|
+
{items.map((m, i) => (
|
|
35
|
+
<li key={m}>
|
|
36
|
+
<button type="button" onClick={() => setSelected(i)} className="nx-state-layer relative w-full rounded-shape-container px-3 py-2 text-left text-body-sm">
|
|
37
|
+
{m}
|
|
38
|
+
</button>
|
|
39
|
+
</li>
|
|
40
|
+
))}
|
|
41
|
+
</ul>
|
|
42
|
+
}
|
|
43
|
+
detail={<div className="text-title-md p-5">{selected === null ? 'Nothing selected' : items[selected]}</div>}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
27
48
|
```
|
|
@@ -22,32 +22,71 @@ An image card with a glass caption over a soft scrim. With `href`, the whole car
|
|
|
22
22
|
## Example: With link
|
|
23
23
|
|
|
24
24
|
```tsx
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
import { MediaCard } from '@nexub/react';
|
|
26
|
+
|
|
27
|
+
// Gradient placeholder image: a data: URI keeps it inside the docs CSP (img-src 'self' data:).
|
|
28
|
+
const COVER =
|
|
29
|
+
'data:image/svg+xml;utf8,' +
|
|
30
|
+
encodeURIComponent(
|
|
31
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300"><defs><linearGradient id="g" x2="1" y2="1"><stop offset="0" stop-color="#0e7490"/><stop offset="1" stop-color="#f59e0b"/></linearGradient></defs><rect width="400" height="300" fill="url(#g)"/></svg>',
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export default function Example() {
|
|
35
|
+
return (
|
|
36
|
+
<div className="w-[320px]">
|
|
37
|
+
<MediaCard src={COVER} alt="" eyebrow="Guide" title="A weekend in Lisbon" description="Where to eat, walk and stay." href="#" />
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
33
41
|
```
|
|
34
42
|
|
|
35
43
|
## Example: Without link, with actions
|
|
36
44
|
|
|
37
45
|
```tsx
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
import { MediaCard, Button } from '@nexub/react';
|
|
47
|
+
|
|
48
|
+
// Gradient placeholder image: a data: URI keeps it inside the docs CSP (img-src 'self' data:).
|
|
49
|
+
const COVER =
|
|
50
|
+
'data:image/svg+xml;utf8,' +
|
|
51
|
+
encodeURIComponent(
|
|
52
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300"><defs><linearGradient id="g" x2="1" y2="1"><stop offset="0" stop-color="#0e7490"/><stop offset="1" stop-color="#f59e0b"/></linearGradient></defs><rect width="400" height="300" fill="url(#g)"/></svg>',
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export default function Example() {
|
|
56
|
+
return (
|
|
57
|
+
<div className="w-[320px]">
|
|
58
|
+
<MediaCard src={COVER} alt="" title="Q3 brand shoot" description="48 photos">
|
|
59
|
+
<Button size="sm" variant="tonal">Open</Button>
|
|
60
|
+
<Button size="sm" variant="text">Share</Button>
|
|
61
|
+
</MediaCard>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
42
65
|
```
|
|
43
66
|
|
|
44
67
|
## Example: Ratios
|
|
45
68
|
|
|
46
69
|
```tsx
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
70
|
+
import { MediaCard } from '@nexub/react';
|
|
71
|
+
|
|
72
|
+
// Gradient placeholder image: a data: URI keeps it inside the docs CSP (img-src 'self' data:).
|
|
73
|
+
const COVER =
|
|
74
|
+
'data:image/svg+xml;utf8,' +
|
|
75
|
+
encodeURIComponent(
|
|
76
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300"><defs><linearGradient id="g" x2="1" y2="1"><stop offset="0" stop-color="#0e7490"/><stop offset="1" stop-color="#f59e0b"/></linearGradient></defs><rect width="400" height="300" fill="url(#g)"/></svg>',
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
export default function Example() {
|
|
80
|
+
return (
|
|
81
|
+
<div className="flex gap-3 flex-wrap items-start justify-center">
|
|
82
|
+
{(['16/9', '4/3', '1/1', '3/4'] as const).map((r) => (
|
|
83
|
+
<div key={r} className="w-[160px]">
|
|
84
|
+
<MediaCard ratio={r} src={COVER} alt="" title={r} />
|
|
85
|
+
</div>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
51
90
|
```
|
|
52
91
|
|
|
53
92
|
## Accessibility
|
|
@@ -36,24 +36,41 @@ One message in a conversation. User messages sit in a bubble at the end; assista
|
|
|
36
36
|
Hover or focus the assistant reply to show its actions.
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<
|
|
39
|
+
import { MessageBubble, Avatar, MessageActions, toast } from '@nexub/react';
|
|
40
|
+
import { Sparkles } from '@nexub/icons';
|
|
41
|
+
|
|
42
|
+
export default function Example() {
|
|
43
|
+
return (
|
|
44
|
+
<div className="flex flex-col gap-4 items-stretch w-full max-w-[560px]">
|
|
45
|
+
<MessageBubble from="user">How do I cancel my subscription?</MessageBubble>
|
|
46
|
+
<MessageBubble from="assistant" avatar={<Avatar size="sm" fallback={<Sparkles />} />}>
|
|
47
|
+
<p>Open Settings, then Billing, and choose Cancel plan. You keep access until the end of the billing period.</p>
|
|
48
|
+
<MessageActions
|
|
49
|
+
text="Open Settings, then Billing, and choose Cancel plan."
|
|
50
|
+
onFeedback={() => {}}
|
|
51
|
+
onRegenerate={() => toast.info('Regenerating…')}
|
|
52
|
+
/>
|
|
53
|
+
</MessageBubble>
|
|
54
|
+
<MessageBubble from="system">Conversation moved to Billing support</MessageBubble>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
49
58
|
```
|
|
50
59
|
|
|
51
60
|
## Example: Failed to send
|
|
52
61
|
|
|
53
62
|
```tsx
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
import { MessageBubble, toast } from '@nexub/react';
|
|
64
|
+
|
|
65
|
+
export default function Example() {
|
|
66
|
+
return (
|
|
67
|
+
<div className="w-full max-w-[560px]">
|
|
68
|
+
<MessageBubble from="user" status="error" onRetry={() => toast.info('Retrying…')}>
|
|
69
|
+
Can I get a refund for last month?
|
|
70
|
+
</MessageBubble>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
57
74
|
```
|
|
58
75
|
|
|
59
76
|
## Accessibility
|
|
@@ -18,13 +18,21 @@ An amount field: locale-aware parsing as you type, grouped on blur, the currency
|
|
|
18
18
|
## Example: Default
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
|
|
21
|
+
import { MoneyInput } from '@nexub/react';
|
|
22
|
+
|
|
23
|
+
export default function Example() {
|
|
24
|
+
return <MoneyInput aria-label="Amount to send" currency="USD" defaultValue={1250} />;
|
|
25
|
+
}
|
|
22
26
|
```
|
|
23
27
|
|
|
24
28
|
## Example: German separators
|
|
25
29
|
|
|
26
30
|
```tsx
|
|
27
|
-
|
|
31
|
+
import { MoneyInput } from '@nexub/react';
|
|
32
|
+
|
|
33
|
+
export default function Example() {
|
|
34
|
+
return <MoneyInput aria-label="Betrag" currency="EUR" locale="de-DE" defaultValue={1234.5} />;
|
|
35
|
+
}
|
|
28
36
|
```
|
|
29
37
|
|
|
30
38
|
Related: [amount](amount.md), [number-input](number-input.md), [input](input.md)
|
|
@@ -20,35 +20,35 @@ Expands and collapses content along the block axis.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
import { Collapse, Text } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return (
|
|
27
|
+
<Collapse in>
|
|
28
|
+
<div className="p-4 bg-[var(--color-surface-container-low)] rounded-shape-field">
|
|
29
|
+
<Text size="body-sm">Collapsed content goes here.</Text>
|
|
30
|
+
</div>
|
|
31
|
+
</Collapse>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
28
34
|
```
|
|
29
35
|
|
|
30
36
|
## Example: Toggle
|
|
31
37
|
|
|
32
38
|
```tsx
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
import * as React from 'react';
|
|
40
|
+
import { Button, Collapse, Text } from '@nexub/react';
|
|
41
|
+
|
|
42
|
+
export default function Example() {
|
|
43
|
+
const [visible, setVisible] = React.useState(true);
|
|
35
44
|
return (
|
|
36
|
-
<div
|
|
37
|
-
<Button variant="outline" onClick={() =>
|
|
38
|
-
{
|
|
45
|
+
<div className="flex flex-col gap-3 items-start">
|
|
46
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>
|
|
47
|
+
{visible ? 'Collapse' : 'Expand'}
|
|
39
48
|
</Button>
|
|
40
|
-
<Collapse in={
|
|
41
|
-
<div
|
|
42
|
-
|
|
43
|
-
padding: '16px',
|
|
44
|
-
background: 'var(--color-bg-subtle)',
|
|
45
|
-
borderRadius: 'var(--radius-md)',
|
|
46
|
-
color: 'var(--color-text-secondary)',
|
|
47
|
-
fontSize: '0.875rem',
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
This section smoothly expands and collapses along the vertical axis.
|
|
51
|
-
It preserves the natural document flow by animating the block size.
|
|
49
|
+
<Collapse in={visible}>
|
|
50
|
+
<div className="p-4 bg-[var(--color-surface-container-low)] rounded-shape-field">
|
|
51
|
+
<Text size="body-sm">This content collapses and expands smoothly.</Text>
|
|
52
52
|
</div>
|
|
53
53
|
</Collapse>
|
|
54
54
|
</div>
|
|
@@ -20,25 +20,28 @@ Animates opacity between 0 and 1 based on the `in` prop.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
import { Fade, Card, Text } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return <Fade in><Card className="w-[200px]"><Text size="body-sm">Faded in content</Text></Card></Fade>;
|
|
27
|
+
}
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
## Example: Toggle
|
|
29
31
|
|
|
30
32
|
```tsx
|
|
31
|
-
|
|
33
|
+
import * as React from 'react';
|
|
34
|
+
import { Button, Fade, Card, Text } from '@nexub/react';
|
|
35
|
+
|
|
36
|
+
export default function Example() {
|
|
32
37
|
const [visible, setVisible] = React.useState(true);
|
|
33
38
|
return (
|
|
34
|
-
<div
|
|
39
|
+
<div className="flex flex-col gap-3 items-start">
|
|
35
40
|
<Button variant="outline" onClick={() => setVisible((v) => !v)}>
|
|
36
|
-
{visible ? '
|
|
41
|
+
{visible ? 'Hide' : 'Show'}
|
|
37
42
|
</Button>
|
|
38
|
-
<Fade in={visible}
|
|
39
|
-
<Card
|
|
40
|
-
This content fades in and out. Toggle the button to animate it.
|
|
41
|
-
</Card>
|
|
43
|
+
<Fade in={visible} unmountOnExit>
|
|
44
|
+
<Card className="w-[200px]"><Text size="body-sm">Animated content</Text></Card>
|
|
42
45
|
</Fade>
|
|
43
46
|
</div>
|
|
44
47
|
);
|
|
@@ -48,15 +51,16 @@ function FadeToggle() {
|
|
|
48
51
|
## Example: Slow with spring easing
|
|
49
52
|
|
|
50
53
|
```tsx
|
|
51
|
-
|
|
54
|
+
import * as React from 'react';
|
|
55
|
+
import { Button, Fade, Card, Text } from '@nexub/react';
|
|
56
|
+
|
|
57
|
+
export default function Example() {
|
|
52
58
|
const [visible, setVisible] = React.useState(true);
|
|
53
59
|
return (
|
|
54
|
-
<div
|
|
60
|
+
<div className="flex flex-col gap-3 items-start">
|
|
55
61
|
<Button variant="outline" onClick={() => setVisible((v) => !v)}>Toggle</Button>
|
|
56
62
|
<Fade in={visible} duration="slow" easing="spring">
|
|
57
|
-
<
|
|
58
|
-
Slow spring fade animation.
|
|
59
|
-
</div>
|
|
63
|
+
<Card className="w-[200px]"><Text size="body-sm">Slow spring fade animation.</Text></Card>
|
|
60
64
|
</Fade>
|
|
61
65
|
</div>
|
|
62
66
|
);
|
|
@@ -20,33 +20,26 @@ Scales content in/out from its center.
|
|
|
20
20
|
## Example: Default
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
import { Scale, Card, Text } from '@nexub/react';
|
|
24
|
+
|
|
25
|
+
export default function Example() {
|
|
26
|
+
return <Scale in><Card className="w-[200px]"><Text size="body-sm">Scaled content</Text></Card></Scale>;
|
|
27
|
+
}
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
## Example: Toggle
|
|
29
31
|
|
|
30
32
|
```tsx
|
|
31
|
-
|
|
33
|
+
import * as React from 'react';
|
|
34
|
+
import { Button, Scale, Card, Text } from '@nexub/react';
|
|
35
|
+
|
|
36
|
+
export default function Example() {
|
|
32
37
|
const [visible, setVisible] = React.useState(true);
|
|
33
38
|
return (
|
|
34
|
-
<div
|
|
35
|
-
<Button variant="outline" onClick={() => setVisible((v) => !v)}>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<Scale in={visible} duration="fast" easing="spring" unmountOnExit>
|
|
39
|
-
<div
|
|
40
|
-
style={{
|
|
41
|
-
padding: '24px',
|
|
42
|
-
background: 'var(--color-bg-subtle)',
|
|
43
|
-
borderRadius: 'var(--radius-md)',
|
|
44
|
-
textAlign: 'center',
|
|
45
|
-
color: 'var(--color-text-secondary)',
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
Pop!
|
|
49
|
-
</div>
|
|
39
|
+
<div className="flex flex-col gap-3 items-start">
|
|
40
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>Toggle</Button>
|
|
41
|
+
<Scale in={visible} unmountOnExit>
|
|
42
|
+
<Card className="w-[200px]"><Text size="body-sm">Scaling content</Text></Card>
|
|
50
43
|
</Scale>
|
|
51
44
|
</div>
|
|
52
45
|
);
|
|
@@ -21,38 +21,26 @@ Slides content in from a direction based on the `in` prop.
|
|
|
21
21
|
## Example: Default
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
import { Slide, Card, Text } from '@nexub/react';
|
|
25
|
+
|
|
26
|
+
export default function Example() {
|
|
27
|
+
return <Slide in direction="up"><Card className="w-[200px]"><Text size="body-sm">Slid in from bottom</Text></Card></Slide>;
|
|
28
|
+
}
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
## Example: Directions
|
|
30
32
|
|
|
31
33
|
```tsx
|
|
32
|
-
|
|
34
|
+
import * as React from 'react';
|
|
35
|
+
import { Button, Slide, Card, Text } from '@nexub/react';
|
|
36
|
+
|
|
37
|
+
export default function Example() {
|
|
33
38
|
const [visible, setVisible] = React.useState(true);
|
|
34
|
-
const [direction, setDirection] = React.useState('up');
|
|
35
39
|
return (
|
|
36
|
-
<div
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
key={dir}
|
|
41
|
-
variant={direction === dir ? 'primary' : 'outline'}
|
|
42
|
-
size="sm"
|
|
43
|
-
onClick={() => { setDirection(dir); setVisible(true); }}
|
|
44
|
-
>
|
|
45
|
-
{dir}
|
|
46
|
-
</Button>
|
|
47
|
-
))}
|
|
48
|
-
<Button variant="ghost" size="sm" onClick={() => setVisible((v) => !v)}>
|
|
49
|
-
Toggle
|
|
50
|
-
</Button>
|
|
51
|
-
</div>
|
|
52
|
-
<Slide in={visible} direction={direction} unmountOnExit>
|
|
53
|
-
<div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
|
|
54
|
-
Sliding in from {direction}.
|
|
55
|
-
</div>
|
|
40
|
+
<div className="flex flex-col gap-3 items-start">
|
|
41
|
+
<Button variant="outline" onClick={() => setVisible((v) => !v)}>Toggle</Button>
|
|
42
|
+
<Slide in={visible} direction="up" unmountOnExit>
|
|
43
|
+
<Card className="w-[200px]"><Text size="body-sm">Sliding content</Text></Card>
|
|
56
44
|
</Slide>
|
|
57
45
|
</div>
|
|
58
46
|
);
|