cyberui-2045 2.1.1 → 2.2.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/bin/usage-content.js +206 -120
- package/dist/components/Carousel.d.ts +3 -3
- package/dist/components/CircularProgress.d.ts +20 -7
- package/dist/components/Image.d.ts +5 -1
- package/dist/components/LinearProgress.d.ts +9 -5
- package/dist/components/Modal.d.ts +3 -1
- package/dist/components/SegmentedProgress.d.ts +13 -5
- package/dist/components/Select.d.ts +5 -0
- package/dist/components/Steps.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/cyberui-2045.css +1 -1
- package/dist/hooks/useAnimatedProgress.d.ts +1 -2
- package/dist/index.d.ts +13 -3
- package/dist/index.es.js +1101 -1059
- package/dist/index.js +21 -16
- package/package.json +1 -1
package/bin/usage-content.js
CHANGED
|
@@ -1,120 +1,206 @@
|
|
|
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 = '
|
|
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
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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 — use size prop (sm/md/lg/xl); fills container without it
|
|
77
|
+
<SegmentedProgress progress={80} size="md">
|
|
78
|
+
<span className="text-accent font-bold text-xs">80%</span>
|
|
79
|
+
</SegmentedProgress>
|
|
80
|
+
|
|
81
|
+
// TabNavigation — tabs is a plain string array (NOT {id, label}[])
|
|
82
|
+
<TabNavigation
|
|
83
|
+
tabs={['Overview', 'Stats', 'History']}
|
|
84
|
+
activeTab="Overview"
|
|
85
|
+
onTabChange={setTab}
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
// SectionTitle — NO subtitle prop; use children for the heading text
|
|
89
|
+
<SectionTitle>System Status</SectionTitle>
|
|
90
|
+
|
|
91
|
+
// Select — use onValueChange for a simple string callback (like Toggle/Checkbox pattern)
|
|
92
|
+
// or use standard HTML onChange for the raw event
|
|
93
|
+
<Select
|
|
94
|
+
options={[{ value: 'a', label: 'Option A' }]}
|
|
95
|
+
onValueChange={(val) => setSelected(val)}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
// Toggle — onChange receives boolean directly
|
|
99
|
+
<Toggle checked={on} onChange={setOn} />
|
|
100
|
+
|
|
101
|
+
// Checkbox — use onCheckedChange for a simple boolean callback
|
|
102
|
+
<Checkbox checked={val} onCheckedChange={setVal} />
|
|
103
|
+
|
|
104
|
+
// Modal — default size is 'lg' (672px); use 'xl' for forms/tables, 'sm' only for simple alerts
|
|
105
|
+
// variant="danger" for destructive confirmations
|
|
106
|
+
<Modal title="Settings" size="lg" isOpen={open} onClose={close}>
|
|
107
|
+
content here
|
|
108
|
+
</Modal>
|
|
109
|
+
<Modal variant="danger" title="Delete?" size="md" onConfirm={handleDelete} onCancel={close}>
|
|
110
|
+
This cannot be undone.
|
|
111
|
+
</Modal>
|
|
112
|
+
|
|
113
|
+
// Card — supports onClick and all standard div HTML attributes
|
|
114
|
+
<Card onClick={() => select(item)}>content</Card>
|
|
115
|
+
|
|
116
|
+
// Image — preview={true} must be explicit to enable click-to-expand fullscreen (disabled by default)
|
|
117
|
+
<Image src="/photo.jpg" alt="Description" size="md" preview={true} />
|
|
118
|
+
|
|
119
|
+
// Carousel — images takes CarouselImageData[]: { src, alt, fallbackSrc?, caption? }
|
|
120
|
+
<Carousel
|
|
121
|
+
images={[
|
|
122
|
+
{ src: 'img1.jpg', alt: 'Cyber City', caption: 'Night District' },
|
|
123
|
+
{ src: 'img2.jpg', alt: 'Neon Lights', fallbackSrc: 'fallback.jpg' }
|
|
124
|
+
]}
|
|
125
|
+
currentIndex={idx}
|
|
126
|
+
onIndexChange={setIdx}
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
// Steps — current is 0-BASED. First step = current={0}, second = current={1}.
|
|
130
|
+
// Passing 1-based values is a common mistake that skips the first step.
|
|
131
|
+
<Steps
|
|
132
|
+
current={0}
|
|
133
|
+
items={[{ title: 'Login' }, { title: 'Verify' }, { title: 'Complete' }]}
|
|
134
|
+
/>
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
### Hooks
|
|
138
|
+
|
|
139
|
+
\`\`\`tsx
|
|
140
|
+
import { useCyberNotifications, useAnimatedProgress, useCyberScrollbar } from 'cyberui-2045';
|
|
141
|
+
|
|
142
|
+
// Toast notifications — showNotification(type, title, message, options?)
|
|
143
|
+
// type: 'success' | 'warning' | 'error'
|
|
144
|
+
const { showNotification } = useCyberNotifications();
|
|
145
|
+
showNotification('success', 'Access Granted', 'Welcome back, runner.');
|
|
146
|
+
showNotification('error', 'Breach Detected', 'Sector 7 compromised.', { duration: 5000 });
|
|
147
|
+
|
|
148
|
+
// Oscillating value for loading/pulse animations (min → max → min loop)
|
|
149
|
+
const value = useAnimatedProgress({ min: 5, max: 95, speed: 30 });
|
|
150
|
+
|
|
151
|
+
// Apply cyberpunk scrollbar styles to a scrollable element
|
|
152
|
+
const ref = useCyberScrollbar<HTMLDivElement>();
|
|
153
|
+
\`\`\`
|
|
154
|
+
|
|
155
|
+
### Notifications (requires provider)
|
|
156
|
+
|
|
157
|
+
\`\`\`tsx
|
|
158
|
+
import { CyberNotificationProvider, useCyberNotifications } from 'cyberui-2045';
|
|
159
|
+
|
|
160
|
+
// Wrap your app once
|
|
161
|
+
<CyberNotificationProvider>
|
|
162
|
+
<App />
|
|
163
|
+
</CyberNotificationProvider>
|
|
164
|
+
|
|
165
|
+
// Then anywhere inside:
|
|
166
|
+
const { showNotification } = useCyberNotifications();
|
|
167
|
+
showNotification('success', 'Upload Complete', 'Neural data synced.');
|
|
168
|
+
\`\`\`
|
|
169
|
+
|
|
170
|
+
### Theming — CSS token overrides
|
|
171
|
+
|
|
172
|
+
Override in your global CSS (after importing cyberui-2045/styles.css):
|
|
173
|
+
|
|
174
|
+
\`\`\`css
|
|
175
|
+
:root {
|
|
176
|
+
--color-primary: #ff005d; /* neon pink */
|
|
177
|
+
--color-secondary: #00fff9; /* cyan */
|
|
178
|
+
--color-accent: #fffb00; /* yellow */
|
|
179
|
+
--color-success: #00ff9e; /* green */
|
|
180
|
+
--color-error: #ff4f4f; /* red */
|
|
181
|
+
--color-warning: #ffaa00; /* orange */
|
|
182
|
+
--color-base: #1a1a2e; /* page background */
|
|
183
|
+
--color-surface: #2d2d44; /* card / component surface */
|
|
184
|
+
--color-border-default: #3c3c5e; /* borders */
|
|
185
|
+
--color-default: #e0e0e0; /* primary text */
|
|
186
|
+
--color-muted: #8888aa; /* secondary text */
|
|
187
|
+
--color-inverse: #1a1a2e; /* inverted text */
|
|
188
|
+
}
|
|
189
|
+
\`\`\`
|
|
190
|
+
|
|
191
|
+
### className overrides
|
|
192
|
+
|
|
193
|
+
All components accept a \`className\` prop merged via \`tailwind-merge\` — your classes win on conflict.
|
|
194
|
+
|
|
195
|
+
\`\`\`tsx
|
|
196
|
+
<Button className="w-full mt-4">Full width</Button>
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
### cn() utility (re-exported)
|
|
200
|
+
|
|
201
|
+
\`\`\`tsx
|
|
202
|
+
import { cn } from 'cyberui-2045';
|
|
203
|
+
// clsx + tailwind-merge — compose className strings in your own components
|
|
204
|
+
const cls = cn('base-class', isActive && 'active', className);
|
|
205
|
+
\`\`\``;
|
|
206
|
+
}
|
|
@@ -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
|
-
* //
|
|
7
|
-
* <CircularProgress progress={75}
|
|
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
|
-
* //
|
|
11
|
-
* <CircularProgress progress={45}
|
|
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
|
-
*
|
|
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
|
|
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}
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
38
|
+
* // Full-width bar (fills parent)
|
|
39
|
+
* <LinearProgress progress={75} />
|
|
36
40
|
*
|
|
37
41
|
* @example
|
|
38
|
-
*
|
|
39
|
-
*
|
|
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;
|
|
@@ -52,7 +52,9 @@ export interface ModalProps extends ModalCallbacks {
|
|
|
52
52
|
showConfirm?: boolean;
|
|
53
53
|
/**
|
|
54
54
|
* Width of the modal.
|
|
55
|
-
*
|
|
55
|
+
* - sm: 448px, md: 512px, lg: 672px, xl: 896px
|
|
56
|
+
* Use `lg` or `xl` for content-heavy modals (forms, tables, multi-step flows).
|
|
57
|
+
* @default 'lg'
|
|
56
58
|
*/
|
|
57
59
|
size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
|
|
58
60
|
/**
|
|
@@ -2,13 +2,15 @@ import { default as React } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* A circular progress indicator divided into segments.
|
|
4
4
|
*
|
|
5
|
+
* Use the `size` prop to control dimensions — without it the component fills its container.
|
|
6
|
+
*
|
|
5
7
|
* @example
|
|
6
|
-
* //
|
|
7
|
-
* <SegmentedProgress progress={30} />
|
|
8
|
+
* // Recommended: use size prop
|
|
9
|
+
* <SegmentedProgress progress={30} size="md" />
|
|
8
10
|
*
|
|
9
11
|
* @example
|
|
10
|
-
* //
|
|
11
|
-
* <SegmentedProgress progress={80}>
|
|
12
|
+
* // With center content
|
|
13
|
+
* <SegmentedProgress progress={80} size="lg">
|
|
12
14
|
* <div className="text-center">
|
|
13
15
|
* <div className="text-2xl font-bold text-accent">80%</div>
|
|
14
16
|
* <div className="text-xs text-muted">LOADED</div>
|
|
@@ -20,6 +22,12 @@ export interface SegmentedProgressProps {
|
|
|
20
22
|
* Progress value (0-100).
|
|
21
23
|
*/
|
|
22
24
|
progress: number;
|
|
25
|
+
/**
|
|
26
|
+
* Preset container size. Sets width and height automatically.
|
|
27
|
+
* - sm: 64px, md: 96px, lg: 128px, xl: 160px
|
|
28
|
+
* @default 'md'
|
|
29
|
+
*/
|
|
30
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
23
31
|
/** Optional custom class name */
|
|
24
32
|
className?: string;
|
|
25
33
|
/** Optional content to render in the center of the segments */
|
|
@@ -29,7 +37,7 @@ export interface SegmentedProgressProps {
|
|
|
29
37
|
* A highly technical, segmented radial progress indicator reminiscent of radar or power gauges.
|
|
30
38
|
*
|
|
31
39
|
* @example
|
|
32
|
-
* <SegmentedProgress progress={45}>
|
|
40
|
+
* <SegmentedProgress progress={45} size="md">
|
|
33
41
|
* <div className="text-primary font-bold">LVL 4</div>
|
|
34
42
|
* </SegmentedProgress>
|
|
35
43
|
*/
|
|
@@ -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
|
|
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';
|