@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.
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
@@ -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
- <Input placeholder="Enter value…" />
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px', maxWidth: '320px' }}>
47
- <Input size="sm" placeholder="Small" />
48
- <Input size="md" placeholder="Medium" />
49
- <Input size="lg" placeholder="Large" />
50
- </div>
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
- <Input invalid placeholder="Invalid value" />
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', maxWidth: '320px' }}>
63
- <Label htmlFor="email">Email address</Label>
64
- <Input id="email" type="email" placeholder="you@example.com" />
65
- <HelperText>We'll never share your email.</HelperText>
66
- </div>
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&apos;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
- <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>
19
- <Kbd>⌘</Kbd>
20
- <Kbd>K</Kbd>
21
- </div>
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
28
- <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>
29
- <Kbd>⌘</Kbd>
30
- <Kbd>K</Kbd>
31
- </div>
32
- <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>
33
- <Kbd>Ctrl</Kbd>
34
- <Kbd>C</Kbd>
35
- </div>
36
- <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>
37
- <Kbd>⇧</Kbd>
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
- <Label htmlFor="name">Full name</Label>
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
- <Label required>Email address</Label>
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
- <div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
34
- <Label htmlFor="email">Email</Label>
35
- <Input id="email" type="email" placeholder="you@example.com" />
36
- </div>
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
- <Link href="#">View documentation</Link>
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
- <div style={{ display: 'flex', gap: '16px' }}>
28
- <Link href="#" variant="default">Default</Link>
29
- <Link href="#" variant="muted">Muted</Link>
30
- <Link href="#" variant="underline">Underline</Link>
31
- </div>
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
- <Link href="#" external>Open in new tab</Link>
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
- <ListDetail
22
- showDetail={selected !== null}
23
- onBack={() => setSelected(null)}
24
- list={<MessageList onSelect={setSelected} />}
25
- detail={<Message id={selected} />}
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
- <MediaCard
26
- src="/covers/lisbon.jpg"
27
- alt=""
28
- eyebrow="Guide"
29
- title="A weekend in Lisbon"
30
- description="Where to eat, walk and stay."
31
- href="/guides/lisbon"
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
- <MediaCard src="/covers/q3.jpg" alt="" title="Q3 brand shoot" description="48 photos">
39
- <Button size="sm" variant="tonal">Open</Button>
40
- <Button size="sm" variant="text">Share</Button>
41
- </MediaCard>
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
- <MediaCard ratio="16/9" src={src} alt="" title="16/9" />
48
- <MediaCard ratio="4/3" src={src} alt="" title="4/3" />
49
- <MediaCard ratio="1/1" src={src} alt="" title="1/1" />
50
- <MediaCard ratio="3/4" src={src} alt="" title="3/4" />
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
- <MessageBubble from="user">How do I cancel my subscription?</MessageBubble>
40
- <MessageBubble from="assistant" avatar={<Avatar size="sm" fallback={<Sparkles />} />}>
41
- <p>Open Settings, then Billing, and choose Cancel plan. You keep access until the end of the billing period.</p>
42
- <MessageActions
43
- text="Open Settings, then Billing, and choose Cancel plan."
44
- onFeedback={(value) => logFeedback(value)}
45
- onRegenerate={() => regenerate()}
46
- />
47
- </MessageBubble>
48
- <MessageBubble from="system">Conversation moved to Billing support</MessageBubble>
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
- <MessageBubble from="user" status="error" onRetry={() => resend()}>
55
- Can I get a refund for last month?
56
- </MessageBubble>
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
- <MoneyInput aria-label="Amount to send" currency="USD" defaultValue={1250} onValueChange={setAmount} />
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
- <MoneyInput aria-label="Betrag" currency="EUR" locale="de-DE" defaultValue={1234.5} />
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
- <Collapse in={true}>
24
- <div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
25
- Collapsed content
26
- </div>
27
- </Collapse>
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
- function CollapseToggle() {
34
- const [open, setOpen] = React.useState(false);
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 style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
37
- <Button variant="outline" onClick={() => setOpen((o) => !o)}>
38
- {open ? 'Collapse' : 'Expand'}
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={open} unmountOnExit>
41
- <div
42
- style={{
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
- <Fade in={true}>
24
- <Card>Faded in content</Card>
25
- </Fade>
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
- function FadeToggle() {
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 style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
39
+ <div className="flex flex-col gap-3 items-start">
35
40
  <Button variant="outline" onClick={() => setVisible((v) => !v)}>
36
- {visible ? 'Fade out' : 'Fade in'}
41
+ {visible ? 'Hide' : 'Show'}
37
42
  </Button>
38
- <Fade in={visible} duration="normal" easing="out" unmountOnExit>
39
- <Card style={{ padding: '16px' }}>
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
- function SlowFade() {
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 style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
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
- <div style={{ padding: '16px', background: 'var(--color-bg-subtle)', borderRadius: 'var(--radius-md)' }}>
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
- <Scale in={true}>
24
- <Card>Scaled content</Card>
25
- </Scale>
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
- function ScaleToggle() {
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 style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
35
- <Button variant="outline" onClick={() => setVisible((v) => !v)}>
36
- {visible ? 'Scale out' : 'Scale in'}
37
- </Button>
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
- <Slide in={true} direction="up">
25
- <Card>Slid in from bottom</Card>
26
- </Slide>
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
- function SlideDirections() {
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 style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
37
- <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
38
- {['up', 'down', 'left', 'right'].map((dir) => (
39
- <Button
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
  );