cyberui-2045 2.1.1 → 2.3.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/AGENT.md CHANGED
@@ -31,9 +31,11 @@ import "cyberui-2045/styles.css";
31
31
  | `Input` | Cyberpunk text input with focus glows. |
32
32
  | `Modal` | CRT-style modal dialog. |
33
33
  | `Notification` | Toast notifications. Use `useCyberNotifications` hook. |
34
- | `CircularProgress` | Dual-ring progress indicator. |
34
+ | `CircularProgress` | Dual-ring circular progress indicator. |
35
+ | `LinearProgress` | Smooth horizontal progress bar. |
36
+ | `SegmentedProgress` | Segmented progress: `variant="radial"` (circular arc gauge, default) or `variant="block"` (discrete filled blocks ▮▮▮▯▯). |
35
37
  | `TabNavigation` | Animated tab bar. |
36
- | `Badge` | Status indicator. Variants: `default`, `success`, `warning`, `danger`. |
38
+ | `Badge` | Status indicator. Variants: `primary`, `secondary`, `accent`, `success`, `error`, `warning`. |
37
39
  | `Toggle` | Cyberpunk switch. |
38
40
  | `Select` | Styled dropdown. |
39
41
  | `Skeleton` | Loading placeholder. |
@@ -1,120 +1,210 @@
1
- // Consumer-facing AI usage guide for cyberui-2045.
2
- // Injected into CLAUDE.md / .cursorrules / copilot-instructions.md by `init`.
3
-
4
- export function getUsageContent(version = '1.4.0') {
5
- return `## CyberUI (cyberui-2045 v${version})
6
-
7
- Cyberpunk-themed React UI library. Docs & live examples: https://patrickkuei.github.io/CyberUI
8
-
9
- ### Setup
10
-
11
- \`\`\`bash
12
- npm install cyberui-2045
13
- \`\`\`
14
-
15
- \`\`\`tsx
16
- // Import styles once in your app entry (e.g. main.tsx)
17
- import 'cyberui-2045/styles.css';
18
-
19
- // Import components
20
- import { Button, Card, Modal } from 'cyberui-2045';
21
- \`\`\`
22
-
23
- ### Component Reference
24
-
25
- | Component | Category | Storybook |
26
- |-----------|----------|-----------|
27
- | Button | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-button--docs |
28
- | Input | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-input--docs |
29
- | Select | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-select--docs |
30
- | Toggle | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-toggle--docs |
31
- | Card | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-card--docs |
32
- | Modal | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-modal--docs |
33
- | Badge | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-badge--docs |
34
- | Notification | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-notification--docs |
35
- | Skeleton | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-skeleton--docs |
36
- | CircularProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-circularprogress--docs |
37
- | LinearProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-linearprogress--docs |
38
- | SegmentedProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-segmentedprogress--docs |
39
- | TabNavigation | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-tabnavigation--docs |
40
- | Carousel | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-carousel--docs |
41
- | Image | Media | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-image--docs |
42
- | Checkbox | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-checkbox--docs |
43
- | Divider | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-divider--docs |
44
- | GradientText | Typography | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-gradienttext--docs |
45
- | SectionTitle | Typography | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-sectiontitle--docs |
46
- | Steps | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-steps--docs |
47
- | Timeline | Display | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-timeline--docs |
48
-
49
- ### Hooks
50
-
51
- \`\`\`tsx
52
- import { useCyberNotifications, useAnimatedProgress, useCyberScrollbar } from 'cyberui-2045';
53
-
54
- // Trigger toast notifications
55
- const { notify } = useCyberNotifications();
56
- notify({ message: 'Hack complete', variant: 'success' });
57
-
58
- // Animated numeric counter for progress displays
59
- const value = useAnimatedProgress(targetValue, { duration: 800 });
60
-
61
- // Apply cyberpunk scrollbar styles to an element
62
- const ref = useCyberScrollbar<HTMLDivElement>();
63
- \`\`\`
64
-
65
- ### Notifications (requires provider)
66
-
67
- \`\`\`tsx
68
- import { CyberNotificationProvider, useCyberNotifications } from 'cyberui-2045';
69
-
70
- // Wrap your app
71
- <CyberNotificationProvider>
72
- <App />
73
- </CyberNotificationProvider>
74
-
75
- // Then anywhere inside:
76
- const { notify } = useCyberNotifications();
77
- notify({ message: 'Access granted', variant: 'success', duration: 3000 });
78
- // variants: 'primary' | 'secondary' | 'accent' | 'success' | 'error' | 'warning'
79
- \`\`\`
80
-
81
- ### Theming CSS token overrides
82
-
83
- Override in your global CSS (after importing cyberui-2045/styles.css):
84
-
85
- \`\`\`css
86
- :root {
87
- --color-primary: #ff0055; /* neon pink */
88
- --color-secondary: #00fff9; /* cyan */
89
- --color-accent: #fbff00; /* yellow */
90
- --color-success: #00ff88; /* green */
91
- --color-error: #ff4444; /* red */
92
- --color-warning: #ff8800; /* orange */
93
- --color-background: #0a0a0f; /* dark bg */
94
- --color-surface: #12121a; /* card bg */
95
- --color-border: #2a2a3a; /* borders */
96
- --color-text: #e0e0ff; /* body text */
97
- --color-text-muted: #6b6b8a; /* muted text */
98
- }
99
- \`\`\`
100
-
101
- ### className overrides
102
-
103
- All components accept a \`className\` prop. Classes are merged via \`twMerge\` — your classes win on conflict.
104
-
105
- \`\`\`tsx
106
- // Layout overrides (safe — doesn't break variant identity)
107
- <Button className="w-full mt-4">Submit</Button>
108
-
109
- // Color/variant overrides (you own visual coherence)
110
- <Button variant="primary" className="bg-purple-600">Custom</Button>
111
- \`\`\`
112
-
113
- ### cn() utility (re-exported)
114
-
115
- \`\`\`tsx
116
- import { cn } from 'cyberui-2045';
117
- // clsx + tailwind-merge use for composing className strings in your own components
118
- const cls = cn('base-class', isActive && 'active', className);
119
- \`\`\``;
120
- }
1
+ // Consumer-facing AI usage guide for cyberui-2045.
2
+ // Injected into CLAUDE.md / .cursorrules / copilot-instructions.md by `init`.
3
+
4
+ export function getUsageContent(version = '2.2.0') {
5
+ return `## CyberUI (cyberui-2045 v${version})
6
+
7
+ Cyberpunk-themed React UI library. Docs & live examples: https://patrickkuei.github.io/CyberUI/storybook/
8
+
9
+ ### Setup
10
+
11
+ \`\`\`bash
12
+ npm install cyberui-2045
13
+ \`\`\`
14
+
15
+ \`\`\`tsx
16
+ // ⚠️ REQUIRED: import styles once in your app entry (e.g. main.tsx / index.tsx)
17
+ // Without this ALL components lose colors, backgrounds, and animations.
18
+ import 'cyberui-2045/styles.css';
19
+
20
+ // Import components — always from the root, never from subpaths
21
+ import { Button, Card, Modal } from 'cyberui-2045';
22
+ \`\`\`
23
+
24
+ ⚠️ Do NOT import from \`cyberui-2045/components/Button\` or similar subpaths — root only.
25
+ ⚠️ If styles look broken or text is invisible, \`cyberui-2045/styles.css\` is missing from the app entry.
26
+
27
+ ### Component Reference
28
+
29
+ | Component | Category | Storybook |
30
+ |-----------|----------|-----------|
31
+ | Button | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-button--docs |
32
+ | Input | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-input--docs |
33
+ | Select | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-select--docs |
34
+ | Toggle | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-toggle--docs |
35
+ | Checkbox | Forms | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-checkbox--docs |
36
+ | Card | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-card--docs |
37
+ | Modal | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-modal--docs |
38
+ | Divider | Layout | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-divider--docs |
39
+ | Badge | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-badge--docs |
40
+ | Notification | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-notification--docs |
41
+ | Skeleton | Feedback | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-skeleton--docs |
42
+ | CircularProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-circularprogress--docs |
43
+ | LinearProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-linearprogress--docs |
44
+ | SegmentedProgress | Progress | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-segmentedprogress--docs |
45
+ | TabNavigation | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-tabnavigation--docs |
46
+ | Carousel | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-carousel--docs |
47
+ | Steps | Navigation | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-steps--docs |
48
+ | GradientText | Typography | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-gradienttext--docs |
49
+ | SectionTitle | Typography | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-sectiontitle--docs |
50
+ | Timeline | Display | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-timeline--docs |
51
+ | Image | Media | https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-image--docs |
52
+
53
+ ### Critical API notes (read before coding)
54
+
55
+ \`\`\`tsx
56
+ // Button — variants: 'primary' | 'secondary' | 'danger' | 'ghost' (NO 'accent')
57
+ <Button variant="primary">Jack In</Button>
58
+ <Button variant="danger">Purge</Button>
59
+
60
+ // Badge — uses children, NOT a label prop
61
+ <Badge variant="success">Online</Badge>
62
+ <Badge variant="error">Offline</Badge>
63
+ // variants: 'primary' | 'secondary' | 'accent' | 'success' | 'error' | 'warning'
64
+
65
+ // CircularProgress — use size prop (sm/md/lg/xl); prop is 'progress' not 'value'
66
+ // center content goes as children; do NOT pass a large radius — default 20 is correct
67
+ <CircularProgress progress={75} size="md">
68
+ <span className="text-xs font-mono text-accent">75%</span>
69
+ </CircularProgress>
70
+
71
+ // LinearProgress — prop is 'progress' (not 'value'); fills container width (w-full) by default
72
+ // wrap in a constrained div to control width
73
+ <LinearProgress progress={60} />
74
+ <div className="w-64"><LinearProgress progress={60} /></div>
75
+
76
+ // SegmentedProgress two variants:
77
+ // variant="radial" (default): circular arc-segment gauge; children render in the center
78
+ // variant="block": linear discrete-block bar (▮▮▮▯▯); use segments prop (default 10)
79
+ // Both support size prop (sm/md/lg/xl)
80
+ <SegmentedProgress progress={80} size="md">
81
+ <span className="text-accent font-bold text-xs">80%</span>
82
+ </SegmentedProgress>
83
+ <SegmentedProgress variant="block" progress={60} segments={10} size="md" />
84
+
85
+ // TabNavigation — tabs is a plain string array (NOT {id, label}[])
86
+ <TabNavigation
87
+ tabs={['Overview', 'Stats', 'History']}
88
+ activeTab="Overview"
89
+ onTabChange={setTab}
90
+ />
91
+
92
+ // SectionTitle — NO subtitle prop; use children for the heading text
93
+ <SectionTitle>System Status</SectionTitle>
94
+
95
+ // Select — use onValueChange for a simple string callback (like Toggle/Checkbox pattern)
96
+ // or use standard HTML onChange for the raw event
97
+ <Select
98
+ options={[{ value: 'a', label: 'Option A' }]}
99
+ onValueChange={(val) => setSelected(val)}
100
+ />
101
+
102
+ // Toggle — onChange receives boolean directly
103
+ <Toggle checked={on} onChange={setOn} />
104
+
105
+ // Checkbox — use onCheckedChange for a simple boolean callback
106
+ <Checkbox checked={val} onCheckedChange={setVal} />
107
+
108
+ // Modal — default size is 'lg' (672px); use 'xl' for forms/tables, 'sm' only for simple alerts
109
+ // variant="danger" for destructive confirmations
110
+ <Modal title="Settings" size="lg" isOpen={open} onClose={close}>
111
+ content here
112
+ </Modal>
113
+ <Modal variant="danger" title="Delete?" size="md" onConfirm={handleDelete} onCancel={close}>
114
+ This cannot be undone.
115
+ </Modal>
116
+
117
+ // Cardsupports onClick and all standard div HTML attributes
118
+ <Card onClick={() => select(item)}>content</Card>
119
+
120
+ // Image — preview={true} must be explicit to enable click-to-expand fullscreen (disabled by default)
121
+ <Image src="/photo.jpg" alt="Description" size="md" preview={true} />
122
+
123
+ // Carousel — images takes CarouselImageData[]: { src, alt, fallbackSrc?, caption? }
124
+ <Carousel
125
+ images={[
126
+ { src: 'img1.jpg', alt: 'Cyber City', caption: 'Night District' },
127
+ { src: 'img2.jpg', alt: 'Neon Lights', fallbackSrc: 'fallback.jpg' }
128
+ ]}
129
+ currentIndex={idx}
130
+ onIndexChange={setIdx}
131
+ />
132
+
133
+ // Steps — current is 0-BASED. First step = current={0}, second = current={1}.
134
+ // Passing 1-based values is a common mistake that skips the first step.
135
+ <Steps
136
+ current={0}
137
+ items={[{ title: 'Login' }, { title: 'Verify' }, { title: 'Complete' }]}
138
+ />
139
+ \`\`\`
140
+
141
+ ### Hooks
142
+
143
+ \`\`\`tsx
144
+ import { useCyberNotifications, useAnimatedProgress, useCyberScrollbar } from 'cyberui-2045';
145
+
146
+ // Toast notifications — showNotification(type, title, message, options?)
147
+ // type: 'success' | 'warning' | 'error'
148
+ const { showNotification } = useCyberNotifications();
149
+ showNotification('success', 'Access Granted', 'Welcome back, runner.');
150
+ showNotification('error', 'Breach Detected', 'Sector 7 compromised.', { duration: 5000 });
151
+
152
+ // Oscillating value for loading/pulse animations (min → max → min loop)
153
+ const value = useAnimatedProgress({ min: 5, max: 95, speed: 30 });
154
+
155
+ // Apply cyberpunk scrollbar styles to a scrollable element
156
+ const ref = useCyberScrollbar<HTMLDivElement>();
157
+ \`\`\`
158
+
159
+ ### Notifications (requires provider)
160
+
161
+ \`\`\`tsx
162
+ import { CyberNotificationProvider, useCyberNotifications } from 'cyberui-2045';
163
+
164
+ // Wrap your app once
165
+ <CyberNotificationProvider>
166
+ <App />
167
+ </CyberNotificationProvider>
168
+
169
+ // Then anywhere inside:
170
+ const { showNotification } = useCyberNotifications();
171
+ showNotification('success', 'Upload Complete', 'Neural data synced.');
172
+ \`\`\`
173
+
174
+ ### Theming — CSS token overrides
175
+
176
+ Override in your global CSS (after importing cyberui-2045/styles.css):
177
+
178
+ \`\`\`css
179
+ :root {
180
+ --color-primary: #ff005d; /* neon pink */
181
+ --color-secondary: #00fff9; /* cyan */
182
+ --color-accent: #fffb00; /* yellow */
183
+ --color-success: #00ff9e; /* green */
184
+ --color-error: #ff4f4f; /* red */
185
+ --color-warning: #ffaa00; /* orange */
186
+ --color-base: #1a1a2e; /* page background */
187
+ --color-surface: #2d2d44; /* card / component surface */
188
+ --color-border-default: #3c3c5e; /* borders */
189
+ --color-default: #e0e0e0; /* primary text */
190
+ --color-muted: #8888aa; /* secondary text */
191
+ --color-inverse: #1a1a2e; /* inverted text */
192
+ }
193
+ \`\`\`
194
+
195
+ ### className overrides
196
+
197
+ All components accept a \`className\` prop merged via \`tailwind-merge\` — your classes win on conflict.
198
+
199
+ \`\`\`tsx
200
+ <Button className="w-full mt-4">Full width</Button>
201
+ \`\`\`
202
+
203
+ ### cn() utility (re-exported)
204
+
205
+ \`\`\`tsx
206
+ import { cn } from 'cyberui-2045';
207
+ // clsx + tailwind-merge — compose className strings in your own components
208
+ const cls = cn('base-class', isActive && 'active', className);
209
+ \`\`\``;
210
+ }
@@ -38,11 +38,11 @@ export interface CarouselCallbacks {
38
38
  * Props for the CyberUI Carousel component
39
39
  *
40
40
  * @example
41
- * // Basic carousel
41
+ * // Basic carousel — images is CarouselImageData[]: { src, alt, fallbackSrc?, caption? }
42
42
  * <Carousel
43
43
  * images={[
44
- * { src: 'img1.jpg', alt: 'Cyber City' },
45
- * { src: 'img2.jpg', alt: 'Neon Lights' }
44
+ * { src: 'img1.jpg', alt: 'Cyber City', caption: 'Night District' },
45
+ * { src: 'img2.jpg', alt: 'Neon Lights', fallbackSrc: 'fallback.jpg' }
46
46
  * ]}
47
47
  * currentIndex={index}
48
48
  * onChange={setIndex}
@@ -2,13 +2,18 @@ import { default as React } from 'react';
2
2
  /**
3
3
  * A circular progress indicator with neon glow effects.
4
4
  *
5
+ * Use the `size` prop for common cases — it constrains the container automatically.
6
+ * Only use `radius` if you need a custom size (radius is in SVG units, viewBox is 50×50).
7
+ *
5
8
  * @example
6
- * // Basic progress
7
- * <CircularProgress progress={75} radius={40} />
9
+ * // Recommended: use size prop
10
+ * <CircularProgress progress={75} size="md">
11
+ * <span className="text-xs font-mono text-accent">75%</span>
12
+ * </CircularProgress>
8
13
  *
9
14
  * @example
10
- * // Progress with label
11
- * <CircularProgress progress={45} radius={60}>
15
+ * // Custom size via className
16
+ * <CircularProgress progress={45} className="w-32 h-32">
12
17
  * <span className="text-accent font-bold">45%</span>
13
18
  * </CircularProgress>
14
19
  */
@@ -18,9 +23,17 @@ export interface CircularProgressProps {
18
23
  */
19
24
  progress: number;
20
25
  /**
21
- * Radius of the circle in pixels.
26
+ * Preset container size. Sets width and height of the component automatically.
27
+ * - sm: 64px, md: 96px, lg: 128px, xl: 160px
28
+ * @default 'md'
29
+ */
30
+ size?: 'sm' | 'md' | 'lg' | 'xl';
31
+ /**
32
+ * Radius of the SVG circle in SVG units (viewBox is 50×50, center at 25,25).
33
+ * Default 20 fits cleanly within the viewBox. Only override for custom layouts.
34
+ * @default 20
22
35
  */
23
- radius: number;
36
+ radius?: number;
24
37
  /** Optional custom class name */
25
38
  className?: string;
26
39
  /** Optional content to render in the center of the circle */
@@ -32,7 +45,7 @@ export interface CircularProgressProps {
32
45
  * A beautiful circular progress indicator with neon glow and dual-tone stroke.
33
46
  *
34
47
  * @example
35
- * <CircularProgress progress={60} radius={20}>
48
+ * <CircularProgress progress={60} size="md">
36
49
  * <span className="text-xs font-mono">60%</span>
37
50
  * </CircularProgress>
38
51
  */
@@ -55,7 +55,11 @@ export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElemen
55
55
  alt: string;
56
56
  /** Size of the image container */
57
57
  size?: ResponsiveValue<ImageSize>;
58
- /** Enable click-to-expand preview functionality */
58
+ /**
59
+ * Enable click-to-expand fullscreen preview on click.
60
+ * Must be explicitly set to `true` — disabled by default.
61
+ * @default false
62
+ */
59
63
  preview?: boolean;
60
64
  /** Fallback image URL when main image fails to load */
61
65
  fallback?: string;
@@ -31,14 +31,18 @@ export interface LinearProgressProps {
31
31
  /**
32
32
  * A sleek, animated linear progress bar with cyberpunk aesthetic.
33
33
  *
34
+ * The bar is `w-full` by default — it fills its container width.
35
+ * Wrap it in a constrained element to control its width.
36
+ *
34
37
  * @example
35
- * <LinearProgress progress={75} variant="primary" />
38
+ * // Full-width bar (fills parent)
39
+ * <LinearProgress progress={75} />
36
40
  *
37
41
  * @example
38
- * <LinearProgress
39
- * progress={kbytesLoaded}
40
- * size={{ base: 'sm', lg: 'md' }}
41
- * />
42
+ * // Width-constrained
43
+ * <div className="w-64">
44
+ * <LinearProgress progress={kbytesLoaded} size={{ base: 'sm', lg: 'md' }} />
45
+ * </div>
42
46
  */
43
47
  declare const LinearProgress: React.FC<LinearProgressProps>;
44
48
  export default LinearProgress;
@@ -1,12 +1,32 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * Controls CRT animation timing and effects.
4
+ * Pass this as the `animation` prop on `<Modal>`:
5
+ * ```tsx
6
+ * <Modal animation={{ openDuration: 300, crtEffects: false }} ... />
7
+ * ```
8
+ */
2
9
  export interface ModalAnimationConfig {
10
+ /** Duration of the open (CRT boot) animation in ms. @default 600 */
3
11
  openDuration?: number;
12
+ /** Duration of the close (CRT off) animation in ms. @default 400 */
4
13
  closeDuration?: number;
14
+ /** Enable CRT scanline power-on/off effects. @default true */
5
15
  crtEffects?: boolean;
6
16
  }
17
+ /**
18
+ * Lifecycle event handlers for the modal.
19
+ * These are flat props on `<Modal>` — not nested under `animation`:
20
+ * ```tsx
21
+ * <Modal onOpen={track} onClose={cleanup} ... />
22
+ * ```
23
+ */
7
24
  export interface ModalCallbacks {
25
+ /** Fired when the modal begins opening (before animation completes). */
8
26
  onOpen?: () => void;
27
+ /** Fired when the modal has fully closed. Alias of `onClose` for clarity. */
9
28
  onClose?: () => void;
29
+ /** Fired when the CRT boot animation finishes and the modal is fully visible. */
10
30
  onCRTBootComplete?: () => void;
11
31
  }
12
32
  /**
@@ -52,7 +72,9 @@ export interface ModalProps extends ModalCallbacks {
52
72
  showConfirm?: boolean;
53
73
  /**
54
74
  * Width of the modal.
55
- * @default 'md'
75
+ * - sm: 448px, md: 512px, lg: 672px, xl: 896px
76
+ * Use `lg` or `xl` for content-heavy modals (forms, tables, multi-step flows).
77
+ * @default 'lg'
56
78
  */
57
79
  size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
58
80
  /**
@@ -1,37 +1,45 @@
1
1
  import { default as React } from 'react';
2
- /**
3
- * A circular progress indicator divided into segments.
4
- *
5
- * @example
6
- * // Basic segmented progress
7
- * <SegmentedProgress progress={30} />
8
- *
9
- * @example
10
- * // Segmented progress with center content
11
- * <SegmentedProgress progress={80}>
12
- * <div className="text-center">
13
- * <div className="text-2xl font-bold text-accent">80%</div>
14
- * <div className="text-xs text-muted">LOADED</div>
15
- * </div>
16
- * </SegmentedProgress>
17
- */
18
- export interface SegmentedProgressProps {
2
+ type Size = 'sm' | 'md' | 'lg' | 'xl';
3
+ interface RadialProps {
19
4
  /**
20
- * Progress value (0-100).
5
+ * Renders a **radial/circular** gauge — discrete arc segments arranged in a ring.
6
+ * This is the original behaviour and the default.
21
7
  */
8
+ variant?: 'radial';
9
+ /** Size of the circular gauge. Sets width and height automatically.
10
+ * - sm: 64px, md: 96px, lg: 128px, xl: 160px
11
+ * @default 'md'
12
+ */
13
+ size?: Size;
14
+ /** Optional content to render in the center of the gauge. */
15
+ children?: React.ReactNode;
16
+ /** Progress value (0–100). */
22
17
  progress: number;
23
- /** Optional custom class name */
18
+ /** Optional custom class name. */
24
19
  className?: string;
25
- /** Optional content to render in the center of the segments */
26
- children?: React.ReactNode;
27
20
  }
28
- /**
29
- * A highly technical, segmented radial progress indicator reminiscent of radar or power gauges.
30
- *
31
- * @example
32
- * <SegmentedProgress progress={45}>
33
- * <div className="text-primary font-bold">LVL 4</div>
34
- * </SegmentedProgress>
35
- */
21
+ interface BlockProps {
22
+ /**
23
+ * Renders a **linear block bar** — discrete filled rectangles in a row
24
+ * (think health bar or loading indicator divided into blocks: ▮▮▮▮▯▯).
25
+ */
26
+ variant: 'block';
27
+ /**
28
+ * Number of discrete blocks.
29
+ * @default 10
30
+ */
31
+ segments?: number;
32
+ /** Size controls block height.
33
+ * - sm: h-3, md: h-5, lg: h-7, xl: h-9
34
+ * @default 'md'
35
+ */
36
+ size?: Size;
37
+ /** Progress value (0–100). */
38
+ progress: number;
39
+ /** Optional custom class name. */
40
+ className?: string;
41
+ children?: never;
42
+ }
43
+ export type SegmentedProgressProps = RadialProps | BlockProps;
36
44
  declare const SegmentedProgress: React.FC<SegmentedProgressProps>;
37
45
  export default SegmentedProgress;
@@ -55,6 +55,11 @@ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectE
55
55
  error?: string;
56
56
  /** Optional custom class name */
57
57
  className?: string;
58
+ /**
59
+ * Convenience callback that receives the selected string value directly.
60
+ * Use instead of onChange when you only need the value (not the raw event).
61
+ */
62
+ onValueChange?: (value: string) => void;
58
63
  }
59
64
  /**
60
65
  * A futuristic Cyberpunk-themed dropdown select component with support for labels and error states.
@@ -57,7 +57,8 @@ export interface StepsProps {
57
57
  */
58
58
  items: StepItem[];
59
59
  /**
60
- * Current active step index (0-based). Used to derive status when individual step status is not set.
60
+ * Current active step index. **0-based** first step is `current={0}`, second is `current={1}`.
61
+ * A common mistake is passing a 1-based value which skips the first step.
61
62
  * @default 0
62
63
  */
63
64
  current?: number;
@@ -47,5 +47,7 @@ export { useCyberScrollbar } from '../hooks/useCyberScrollbar';
47
47
  export type { UseCyberScrollbarOptions } from '../hooks/useCyberScrollbar';
48
48
  export { useCyberNotifications } from '../hooks/useCyberNotifications';
49
49
  export type { CyberNotification, NotificationOptions } from '../hooks/useCyberNotifications';
50
+ export { useAnimatedProgress } from '../hooks/useAnimatedProgress';
51
+ export type { UseAnimatedProgressOptions } from '../hooks/useAnimatedProgress';
50
52
  export { CyberNotificationProvider } from '../contexts/NotificationContext';
51
53
  export type { CyberNotificationProviderProps } from '../contexts/NotificationContext';