@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
@@ -19,11 +19,20 @@ Navigation for medium-width windows: icons over labels, with an active pill behi
19
19
  ## Example: Default
20
20
 
21
21
  ```tsx
22
- <NavigationRail.Root aria-label="Workspace">
23
- <NavigationRail.Item href="/" icon={<Home />} label="Home" active />
24
- <NavigationRail.Item href="/files" icon={<Folder />} label="Files" />
25
- <NavigationRail.Item href="/settings" icon={<Settings />} label="Settings" />
26
- </NavigationRail.Root>
22
+ import { NavigationRail } from '@nexub/react';
23
+
24
+ export default function Example() {
25
+ const glyph = (d: string) => (
26
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d={d} /></svg>
27
+ );
28
+ return (
29
+ <NavigationRail.Root aria-label="Workspace" className="h-auto bg-[var(--color-surface-container-low)] rounded-[24px]">
30
+ <NavigationRail.Item href="#" icon={glyph('M3 10l9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z')} label="Home" active />
31
+ <NavigationRail.Item href="#" icon={glyph('M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z')} label="Files" />
32
+ <NavigationRail.Item href="#" icon={glyph('M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z')} label="Settings" />
33
+ </NavigationRail.Root>
34
+ );
35
+ }
27
36
  ```
28
37
 
29
38
  Related: [sidebar](sidebar.md), [top-nav](top-nav.md)
@@ -20,10 +20,14 @@ Single notification row for notification panels or dropdowns.
20
20
  ## Example: Default
21
21
 
22
22
  ```tsx
23
- <NotificationItem
24
- title="New comment on your post"
25
- description="Alex left a comment on 'Design System v2'"
26
- timestamp="5 min ago"
27
- unread
28
- />
23
+ import { NotificationItem } from '@nexub/patterns';
24
+
25
+ export default function Example() {
26
+ return (
27
+ <div className="w-[340px]">
28
+ <NotificationItem title="New team member" description="Sarah joined your workspace." timestamp="2 min ago" read={false} />
29
+ <NotificationItem title="Invoice paid" description="Invoice #1042 was paid successfully." timestamp="1 hr ago" read />
30
+ </div>
31
+ );
32
+ }
29
33
  ```
@@ -20,11 +20,19 @@ A numeric input with increment and decrement controls, supporting min/max clampi
20
20
  ## Example: Default
21
21
 
22
22
  ```tsx
23
- <NumberInput defaultValue={0} />
23
+ import { NumberInput } from '@nexub/react';
24
+
25
+ export default function Example() {
26
+ return <div className="w-[180px]"><NumberInput defaultValue={0} /></div>;
27
+ }
24
28
  ```
25
29
 
26
30
  ## Example: With range
27
31
 
28
32
  ```tsx
29
- <NumberInput defaultValue={5} min={0} max={10} />
33
+ import { NumberInput } from '@nexub/react';
34
+
35
+ export default function Example() {
36
+ return <div className="w-[180px]"><NumberInput defaultValue={5} min={0} max={10} /></div>;
37
+ }
30
38
  ```
@@ -20,12 +20,20 @@ A number whose digits roll to new values on the spatial spring. The first render
20
20
  Each digit is a 0–9 strip; separators and symbols stay still.
21
21
 
22
22
  ```tsx
23
- const [n, setN] = React.useState(12480);
23
+ import * as React from 'react';
24
+ import { NumberTicker, Button } from '@nexub/react';
24
25
 
25
- <NumberTicker value={n} format={{ maximumFractionDigits: 0 }} className="text-title-lg" />
26
- <Button size="sm" variant="outlined" onClick={() => setN(Math.round(Math.random() * 100000))}>
27
- Change
28
- </Button>
26
+ export default function Example() {
27
+ const [n, setN] = React.useState(12480);
28
+ return (
29
+ <div className="flex flex-col gap-3 items-center">
30
+ <NumberTicker value={n} format={{ maximumFractionDigits: 0 }} className="text-title-lg" />
31
+ <Button size="sm" variant="outlined" onClick={() => setN(Math.round(Math.random() * 100000))}>
32
+ Change
33
+ </Button>
34
+ </div>
35
+ );
36
+ }
29
37
  ```
30
38
 
31
39
  ## Example: Amount
@@ -33,7 +41,20 @@ const [n, setN] = React.useState(12480);
33
41
  `Amount animate` uses the ticker and keeps the quieter symbol and minor units.
34
42
 
35
43
  ```tsx
36
- <Amount value={balance} currency="USD" size="display" animate />
44
+ import * as React from 'react';
45
+ import { Amount, Button } from '@nexub/react';
46
+
47
+ export default function Example() {
48
+ const [balance, setBalance] = React.useState(128450.75);
49
+ return (
50
+ <div className="flex flex-col gap-3 items-center">
51
+ <Amount value={balance} currency="USD" size="display" animate />
52
+ <Button size="sm" variant="outlined" onClick={() => setBalance(Math.round(Math.random() * 20000000) / 100)}>
53
+ Change
54
+ </Button>
55
+ </div>
56
+ );
57
+ }
37
58
  ```
38
59
 
39
60
  ## Accessibility
@@ -21,32 +21,23 @@ Page navigation control with prev/next and page number buttons.
21
21
  ## Example: Default
22
22
 
23
23
  ```tsx
24
- function DefaultPagination() {
24
+ import * as React from 'react';
25
+ import { Pagination } from '@nexub/react';
26
+
27
+ export default function Example() {
25
28
  const [page, setPage] = React.useState(3);
26
- return (
27
- <Pagination
28
- page={page}
29
- totalItems={100}
30
- pageSize={10}
31
- onPageChange={setPage}
32
- />
33
- );
29
+ return <Pagination page={page} totalItems={100} pageSize={10} onPageChange={setPage} />;
34
30
  }
35
31
  ```
36
32
 
37
33
  ## Example: Large dataset
38
34
 
39
35
  ```tsx
40
- function LargeDatasetPagination() {
41
- const [page, setPage] = React.useState(5);
42
- return (
43
- <Pagination
44
- page={page}
45
- totalItems={500}
46
- pageSize={20}
47
- siblingCount={2}
48
- onPageChange={setPage}
49
- />
50
- );
36
+ import * as React from 'react';
37
+ import { Pagination } from '@nexub/react';
38
+
39
+ export default function Example() {
40
+ const [page, setPage] = React.useState(3);
41
+ return <Pagination page={page} totalItems={500} pageSize={20} siblingCount={2} onPageChange={setPage} />;
51
42
  }
52
43
  ```
@@ -14,15 +14,26 @@ A password field with a built-in toggle to reveal or hide the entered value.
14
14
  | `invalid` | `boolean` | | Applies error styling to indicate a validation failure. |
15
15
  | `disabled` | `boolean` | | Disables the input. |
16
16
  | `size` | `'sm' \| 'md' \| 'lg'` | | Controls font size and padding. |
17
+ | `visible` | `boolean` | | Shows the password as text. Controlled when set; pair with onVisibleChange. |
18
+ | `defaultVisible` | `boolean` | | Initial visibility when uncontrolled. Defaults to false. |
19
+ | `onVisibleChange` | `(visible: boolean) => void` | | Called when the reveal toggle is pressed. |
17
20
 
18
21
  ## Example: Default
19
22
 
20
23
  ```tsx
21
- <PasswordInput placeholder="Enter password…" />
24
+ import { PasswordInput } from '@nexub/react';
25
+
26
+ export default function Example() {
27
+ return <div className="w-[280px]"><PasswordInput placeholder="Enter password…" /></div>;
28
+ }
22
29
  ```
23
30
 
24
31
  ## Example: Invalid
25
32
 
26
33
  ```tsx
27
- <PasswordInput invalid placeholder="Password is too short" />
34
+ import { PasswordInput } from '@nexub/react';
35
+
36
+ export default function Example() {
37
+ return <div className="w-[280px]"><PasswordInput invalid placeholder="Password is too short" /></div>;
38
+ }
28
39
  ```
@@ -22,13 +22,21 @@ Pricing plan card with feature checklist, badge, and CTA button.
22
22
  ## Example: Default
23
23
 
24
24
  ```tsx
25
- <PlanCard
26
- name="Pro"
27
- price="$49/mo"
28
- description="Everything you need to scale."
29
- features={['Unlimited projects', 'Priority support', 'Custom domains', 'Analytics']}
30
- highlighted
31
- badge="Most Popular"
32
- ctaLabel="Start free trial"
33
- />
25
+ import { PlanCard } from '@nexub/patterns';
26
+
27
+ export default function Example() {
28
+ return (
29
+ <div className="w-[280px]">
30
+ <PlanCard
31
+ name="Pro"
32
+ price="$49"
33
+ period="/ month"
34
+ description="For growing teams that need more power."
35
+ features={['Unlimited seats', 'Advanced analytics', 'Priority support']}
36
+ cta="Get started"
37
+ onSelect={() => {}}
38
+ />
39
+ </div>
40
+ );
41
+ }
34
42
  ```
@@ -23,31 +23,41 @@ Floating content panel anchored to a trigger element.
23
23
  ## Example: Default
24
24
 
25
25
  ```tsx
26
- <Popover.Root>
27
- <Popover.Trigger asChild>
28
- <Button variant="outline">Open popover</Button>
29
- </Popover.Trigger>
30
- <Popover.Content>
31
- <Text size="body-sm">Popover content goes here.</Text>
32
- </Popover.Content>
33
- </Popover.Root>
26
+ import { Popover, Button, Text } from '@nexub/react';
27
+
28
+ export default function Example() {
29
+ return (
30
+ <Popover.Root>
31
+ <Popover.Trigger asChild>
32
+ <Button variant="outline">Open popover</Button>
33
+ </Popover.Trigger>
34
+ <Popover.Content>
35
+ <Text size="body-sm">This is popover content. You can put anything here.</Text>
36
+ </Popover.Content>
37
+ </Popover.Root>
38
+ );
39
+ }
34
40
  ```
35
41
 
36
42
  ## Example: With close button
37
43
 
38
44
  ```tsx
39
- <Popover.Root>
40
- <Popover.Trigger asChild>
41
- <Button variant="outline">Settings</Button>
42
- </Popover.Trigger>
43
- <Popover.Content side="bottom" align="end" sideOffset={8}>
44
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
45
- <Text weight="semibold">Preferences</Text>
46
- <Text size="body-sm" tone="secondary">Adjust your display settings.</Text>
47
- <Popover.Close asChild>
48
- <Button variant="ghost" size="sm">Close</Button>
49
- </Popover.Close>
45
+ import { Popover, Button, Text } from '@nexub/react';
46
+
47
+ export default function Example() {
48
+ return (
49
+ <div className="flex gap-3 flex-wrap items-center justify-center">
50
+ {(['top', 'right', 'bottom', 'left'] as const).map((s) => (
51
+ <Popover.Root key={s}>
52
+ <Popover.Trigger asChild>
53
+ <Button variant="ghost" size="sm">{s}</Button>
54
+ </Popover.Trigger>
55
+ <Popover.Content side={s}>
56
+ <Text size="body-sm">Opens {s}</Text>
57
+ </Popover.Content>
58
+ </Popover.Root>
59
+ ))}
50
60
  </div>
51
- </Popover.Content>
52
- </Popover.Root>
61
+ );
62
+ }
53
63
  ```
@@ -18,22 +18,36 @@ Horizontal progress bar with optional tone and animation.
18
18
  ## Example: Default
19
19
 
20
20
  ```tsx
21
- <Progress value={65} />
21
+ import { Progress } from '@nexub/react';
22
+
23
+ export default function Example() {
24
+ return <div className="w-[280px]"><Progress value={65} /></div>;
25
+ }
22
26
  ```
23
27
 
24
28
  ## Example: Tones
25
29
 
26
30
  ```tsx
27
- <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
28
- <Progress value={80} tone="info" />
29
- <Progress value={60} tone="success" />
30
- <Progress value={45} tone="warning" />
31
- <Progress value={30} tone="danger" />
32
- </div>
31
+ import { Progress } from '@nexub/react';
32
+
33
+ export default function Example() {
34
+ return (
35
+ <div className="flex flex-col gap-2.5 items-start w-[280px]">
36
+ <Progress value={80} tone="success" />
37
+ <Progress value={55} tone="info" />
38
+ <Progress value={30} tone="warning" />
39
+ <Progress value={20} tone="danger" />
40
+ </div>
41
+ );
42
+ }
33
43
  ```
34
44
 
35
45
  ## Example: Animated
36
46
 
37
47
  ```tsx
38
- <Progress value={40} animated tone="info" />
48
+ import { Progress } from '@nexub/react';
49
+
50
+ export default function Example() {
51
+ return <div className="w-[280px]"><Progress value={40} animated tone="info" /></div>;
52
+ }
39
53
  ```
@@ -37,27 +37,48 @@ The composer for a chat: an auto-growing text field with Send, which turns into
37
37
  Enter sends, Shift+Enter adds a line. Send stays inert until there is text.
38
38
 
39
39
  ```tsx
40
- <PromptInput placeholder="Ask anything" onSubmit={(text) => send(text)} />
40
+ import { PromptInput } from '@nexub/react';
41
+
42
+ export default function Example() {
43
+ return (
44
+ <div className="w-full max-w-[520px]">
45
+ <PromptInput placeholder="Ask anything" />
46
+ </div>
47
+ );
48
+ }
41
49
  ```
42
50
 
43
51
  ## Example: Attachments and actions
44
52
 
45
53
  ```tsx
46
- <PromptInput
47
- placeholder="Ask about these files"
48
- attachments={
49
- <>
50
- <Chip onRemove={() => remove('q3-report.pdf')}>q3-report.pdf</Chip>
51
- <Chip onRemove={() => remove('pricing.csv')}>pricing.csv</Chip>
52
- </>
53
- }
54
- actions={
55
- <>
56
- <IconButton size="sm" label="Attach files"><Paperclip /></IconButton>
57
- <IconButton size="sm" label="Search the web"><Globe /></IconButton>
58
- </>
59
- }
60
- />
54
+ import * as React from 'react';
55
+ import { PromptInput, Chip, IconButton } from '@nexub/react';
56
+ import { Paperclip, Globe } from '@nexub/icons';
57
+
58
+ export default function Example() {
59
+ const [files, setFiles] = React.useState(['q3-report.pdf', 'pricing.csv']);
60
+ return (
61
+ <div className="w-full max-w-[520px]">
62
+ <PromptInput
63
+ placeholder="Ask about these files"
64
+ attachments={
65
+ files.length > 0 &&
66
+ files.map((f) => (
67
+ <Chip key={f} onRemove={() => setFiles((all) => all.filter((x) => x !== f))}>
68
+ {f}
69
+ </Chip>
70
+ ))
71
+ }
72
+ actions={
73
+ <>
74
+ <IconButton size="sm" label="Attach files"><Paperclip /></IconButton>
75
+ <IconButton size="sm" label="Search the web"><Globe /></IconButton>
76
+ </>
77
+ }
78
+ />
79
+ </div>
80
+ );
81
+ }
61
82
  ```
62
83
 
63
84
  ## Example: Streaming
@@ -65,20 +86,27 @@ Enter sends, Shift+Enter adds a line. Send stays inert until there is text.
65
86
  Send a message: the button turns into Stop for three seconds. Stop or Escape ends it early.
66
87
 
67
88
  ```tsx
68
- const [status, setStatus] = React.useState<PromptInputStatus>('idle');
69
- const timer = React.useRef<ReturnType<typeof setTimeout>>();
70
-
71
- function send() {
72
- setStatus('streaming');
73
- timer.current = setTimeout(() => setStatus('idle'), 3000);
89
+ import * as React from 'react';
90
+ import { type PromptInputStatus, PromptInput } from '@nexub/react';
91
+
92
+ export default function Example() {
93
+ const [status, setStatus] = React.useState<PromptInputStatus>('idle');
94
+ const timer = React.useRef<ReturnType<typeof setTimeout>>(undefined);
95
+ React.useEffect(() => () => clearTimeout(timer.current), []);
96
+ const send = () => {
97
+ setStatus('streaming');
98
+ timer.current = setTimeout(() => setStatus('idle'), 3000);
99
+ };
100
+ const stop = () => {
101
+ clearTimeout(timer.current);
102
+ setStatus('idle');
103
+ };
104
+ return (
105
+ <div className="w-full max-w-[520px]">
106
+ <PromptInput placeholder="Ask anything" status={status} onSubmit={send} onStop={stop} />
107
+ </div>
108
+ );
74
109
  }
75
-
76
- function stop() {
77
- clearTimeout(timer.current);
78
- setStatus('idle');
79
- }
80
-
81
- <PromptInput placeholder="Ask anything" status={status} onSubmit={send} onStop={stop} />
82
110
  ```
83
111
 
84
112
  ## Accessibility
@@ -33,19 +33,26 @@ A radio group where each option is a whole card: title, description and optional
33
33
  ## Example: Plan picker
34
34
 
35
35
  ```tsx
36
- const [plan, setPlan] = React.useState('team');
37
-
38
- <RadioCardGroup aria-label="Plan" columns={3} value={plan} onValueChange={setPlan}>
39
- <RadioCard value="solo" icon={<User />} title="Solo" description="One seat, core features.">
40
- <span className="text-sm font-medium">$0 / month</span>
41
- </RadioCard>
42
- <RadioCard value="team" icon={<Users />} title="Team" description="Up to 20 seats, shared workspaces.">
43
- <span className="text-sm font-medium">$12 / seat</span>
44
- </RadioCard>
45
- <RadioCard value="enterprise" icon={<Building2 />} title="Enterprise" description="SSO, audit logs, priority support.">
46
- <span className="text-sm font-medium">Contact sales</span>
47
- </RadioCard>
48
- </RadioCardGroup>
36
+ import * as React from 'react';
37
+ import { RadioCardGroup, RadioCard } from '@nexub/react';
38
+ import { User, Users, Building2 } from '@nexub/icons';
39
+
40
+ export default function Example() {
41
+ const [plan, setPlan] = React.useState('team');
42
+ return (
43
+ <RadioCardGroup aria-label="Plan" columns={3} value={plan} onValueChange={setPlan} className="w-full">
44
+ <RadioCard value="solo" icon={<User />} title="Solo" description="One seat, core features.">
45
+ <span className="text-sm font-medium">$0 / month</span>
46
+ </RadioCard>
47
+ <RadioCard value="team" icon={<Users />} title="Team" description="Up to 20 seats, shared workspaces.">
48
+ <span className="text-sm font-medium">$12 / seat</span>
49
+ </RadioCard>
50
+ <RadioCard value="enterprise" icon={<Building2 />} title="Enterprise" description="SSO, audit logs, priority support.">
51
+ <span className="text-sm font-medium">Contact sales</span>
52
+ </RadioCard>
53
+ </RadioCardGroup>
54
+ );
55
+ }
49
56
  ```
50
57
 
51
58
  ## Example: Columns
@@ -53,10 +60,16 @@ const [plan, setPlan] = React.useState('team');
53
60
  Two columns from the sm breakpoint up, one below.
54
61
 
55
62
  ```tsx
56
- <RadioCardGroup aria-label="Billing" columns={2} defaultValue="yearly">
57
- <RadioCard value="monthly" title="Monthly" description="Billed every month." />
58
- <RadioCard value="yearly" title="Yearly" description="Two months free." />
59
- </RadioCardGroup>
63
+ import { RadioCardGroup, RadioCard } from '@nexub/react';
64
+
65
+ export default function Example() {
66
+ return (
67
+ <RadioCardGroup aria-label="Billing" columns={2} defaultValue="yearly" className="w-full">
68
+ <RadioCard value="monthly" title="Monthly" description="Billed every month." />
69
+ <RadioCard value="yearly" title="Yearly" description="Two months free." />
70
+ </RadioCardGroup>
71
+ );
72
+ }
60
73
  ```
61
74
 
62
75
  ## Example: Disabled
@@ -64,11 +77,17 @@ Two columns from the sm breakpoint up, one below.
64
77
  Disable one card, or pass `disabled` to the group to disable all of them.
65
78
 
66
79
  ```tsx
67
- <RadioCardGroup aria-label="Region" columns={2} defaultValue="eu">
68
- <RadioCard value="eu" title="Europe" description="Frankfurt" />
69
- <RadioCard value="us" title="United States" description="Virginia" />
70
- <RadioCard value="ap" title="Asia Pacific" description="Coming soon" disabled />
71
- </RadioCardGroup>
80
+ import { RadioCardGroup, RadioCard } from '@nexub/react';
81
+
82
+ export default function Example() {
83
+ return (
84
+ <RadioCardGroup aria-label="Region" columns={2} defaultValue="eu" className="w-full">
85
+ <RadioCard value="eu" title="Europe" description="Frankfurt" />
86
+ <RadioCard value="us" title="United States" description="Virginia" />
87
+ <RadioCard value="ap" title="Asia Pacific" description="Coming soon" disabled />
88
+ </RadioCardGroup>
89
+ );
90
+ }
72
91
  ```
73
92
 
74
93
  ## Accessibility
@@ -21,37 +21,41 @@ Group of mutually exclusive radio inputs.
21
21
  ## Example: Default
22
22
 
23
23
  ```tsx
24
- <RadioGroup.Root defaultValue="option-2">
25
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
26
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
27
- <RadioGroup.Item value="option-1" id="r1" />
28
- <Label htmlFor="r1">Option one</Label>
29
- </div>
30
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
31
- <RadioGroup.Item value="option-2" id="r2" />
32
- <Label htmlFor="r2">Option two</Label>
33
- </div>
34
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
35
- <RadioGroup.Item value="option-3" id="r3" />
36
- <Label htmlFor="r3">Option three</Label>
37
- </div>
38
- </div>
39
- </RadioGroup.Root>
24
+ import { RadioGroup, Label } from '@nexub/react';
25
+
26
+ export default function Example() {
27
+ return (
28
+ <RadioGroup.Root defaultValue="monthly">
29
+ <div className="flex flex-col gap-2 items-start">
30
+ {['Monthly', 'Yearly', 'Lifetime'].map((opt) => (
31
+ <div key={opt} className="flex items-center gap-2">
32
+ <RadioGroup.Item value={opt.toLowerCase()} id={`rg-${opt}`} />
33
+ <Label htmlFor={`rg-${opt}`}>{opt}</Label>
34
+ </div>
35
+ ))}
36
+ </div>
37
+ </RadioGroup.Root>
38
+ );
39
+ }
40
40
  ```
41
41
 
42
42
  ## Example: Horizontal
43
43
 
44
44
  ```tsx
45
- <RadioGroup.Root defaultValue="monthly" orientation="horizontal">
46
- <div style={{ display: 'flex', gap: '16px' }}>
47
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
48
- <RadioGroup.Item value="monthly" id="monthly" />
49
- <Label htmlFor="monthly">Monthly</Label>
50
- </div>
51
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
52
- <RadioGroup.Item value="annual" id="annual" />
53
- <Label htmlFor="annual">Annual</Label>
54
- </div>
55
- </div>
56
- </RadioGroup.Root>
45
+ import { RadioGroup, Label } from '@nexub/react';
46
+
47
+ export default function Example() {
48
+ return (
49
+ <RadioGroup.Root defaultValue="monthly" orientation="horizontal">
50
+ <div className="flex gap-4">
51
+ {[{ value: 'monthly', label: 'Monthly' }, { value: 'annual', label: 'Annual' }].map(({ value, label }) => (
52
+ <div key={value} className="flex items-center gap-2">
53
+ <RadioGroup.Item value={value} id={`rgh-${value}`} />
54
+ <Label htmlFor={`rgh-${value}`}>{label}</Label>
55
+ </div>
56
+ ))}
57
+ </div>
58
+ </RadioGroup.Root>
59
+ );
60
+ }
57
61
  ```
@@ -19,21 +19,37 @@ Star rating input, supports controlled and read-only modes.
19
19
  ## Example: Default
20
20
 
21
21
  ```tsx
22
- <Rating defaultValue={3} />
22
+ import * as React from 'react';
23
+ import { Rating } from '@nexub/react';
24
+
25
+ export default function Example() {
26
+ const [val, setVal] = React.useState(3);
27
+ return <Rating value={val} onValueChange={setVal} />;
28
+ }
23
29
  ```
24
30
 
25
31
  ## Example: Read-only
26
32
 
27
33
  ```tsx
28
- <Rating value={4} readOnly />
34
+ import { Rating } from '@nexub/react';
35
+
36
+ export default function Example() {
37
+ return <Rating value={4} readOnly />;
38
+ }
29
39
  ```
30
40
 
31
41
  ## Example: Sizes
32
42
 
33
43
  ```tsx
34
- <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
35
- <Rating defaultValue={3} size="sm" />
36
- <Rating defaultValue={3} size="md" />
37
- <Rating defaultValue={3} size="lg" />
38
- </div>
44
+ import { Rating } from '@nexub/react';
45
+
46
+ export default function Example() {
47
+ return (
48
+ <div className="flex flex-col gap-2 items-start">
49
+ <Rating size="sm" value={4} readOnly />
50
+ <Rating size="md" value={4} readOnly />
51
+ <Rating size="lg" value={4} readOnly />
52
+ </div>
53
+ );
54
+ }
39
55
  ```