cyberui-2045 2.3.0 → 2.4.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 +25 -23
- package/README.md +31 -28
- package/bin/init.js +11 -5
- package/bin/markers.js +18 -0
- package/bin/usage-content.js +136 -210
- package/dist/component-manifest.json +1454 -0
- package/dist/components/Badge.js +49 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Button.js +62 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.js +31 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Carousel.js +585 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Checkbox.js +92 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/CircularProgress.js +87 -0
- package/dist/components/CircularProgress.js.map +1 -0
- package/dist/components/Divider.js +24 -0
- package/dist/components/Divider.js.map +1 -0
- package/dist/components/GradientText.js +27 -0
- package/dist/components/GradientText.js.map +1 -0
- package/dist/components/Image.js +369 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/Input.js +70 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/LinearProgress.js +39 -0
- package/dist/components/LinearProgress.js.map +1 -0
- package/dist/components/Modal.d.ts +19 -0
- package/dist/components/Modal.js +211 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/Notification.js +88 -0
- package/dist/components/Notification.js.map +1 -0
- package/dist/components/SectionTitle.js +33 -0
- package/dist/components/SectionTitle.js.map +1 -0
- package/dist/components/SegmentedProgress.js +82 -0
- package/dist/components/SegmentedProgress.js.map +1 -0
- package/dist/components/Select.js +93 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Skeleton.js +106 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Steps.js +88 -0
- package/dist/components/Steps.js.map +1 -0
- package/dist/components/TabNavigation.js +153 -0
- package/dist/components/TabNavigation.js.map +1 -0
- package/dist/components/Timeline.js +99 -0
- package/dist/components/Timeline.js.map +1 -0
- package/dist/components/Toggle.js +73 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/contexts/NotificationContext.js +100 -0
- package/dist/contexts/NotificationContext.js.map +1 -0
- package/dist/contexts/NotificationContextBase.js +6 -0
- package/dist/contexts/NotificationContextBase.js.map +1 -0
- package/dist/hooks/useAnimatedProgress.js +17 -0
- package/dist/hooks/useAnimatedProgress.js.map +1 -0
- package/dist/hooks/useCyberNotifications.js +14 -0
- package/dist/hooks/useCyberNotifications.js.map +1 -0
- package/dist/hooks/useCyberScrollbar.js +254 -0
- package/dist/hooks/useCyberScrollbar.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +63 -5954
- package/dist/index.js +13 -13
- package/dist/utils/cn.js +9 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/devWarn.d.ts +5 -0
- package/dist/utils/devWarn.js +8 -0
- package/dist/utils/devWarn.js.map +1 -0
- package/dist/utils/responsive.js +120 -0
- package/dist/utils/responsive.js.map +1 -0
- package/package.json +158 -125
package/AGENT.md
CHANGED
|
@@ -24,29 +24,31 @@ import "cyberui-2045/styles.css";
|
|
|
24
24
|
|
|
25
25
|
## 3. Component Reference
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
| `Input` | Cyberpunk text input with focus glows. |
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `Timeline` | Vertical event history display. |
|
|
27
|
+
<!-- cyberui-2045:manifest:start -->
|
|
28
|
+
| Component | Description |
|
|
29
|
+
| :--- | :--- |
|
|
30
|
+
| `Button` | Neon-styled button. Variants: `primary`, `secondary`, `danger`, `ghost`. |
|
|
31
|
+
| `Input` | Cyberpunk text input with focus glows. |
|
|
32
|
+
| `Toggle` | Cyberpunk switch. |
|
|
33
|
+
| `Select` | Styled dropdown. |
|
|
34
|
+
| `Checkbox` | Neon-styled checkbox with SVG icons. |
|
|
35
|
+
| `Card` | Glassmorphism container with borders. |
|
|
36
|
+
| `Modal` | CRT-style modal dialog. |
|
|
37
|
+
| `Divider` | Gradient/solid/dashed content separator. |
|
|
38
|
+
| `Notification` | Toast notifications. Use `useCyberNotifications` hook. |
|
|
39
|
+
| `Badge` | Status indicator. Variants: `primary`, `secondary`, `accent`, `success`, `error`, `warning`. |
|
|
40
|
+
| `Skeleton` | Loading placeholder. |
|
|
41
|
+
| `CircularProgress` | Dual-ring circular progress indicator. |
|
|
42
|
+
| `SegmentedProgress` | Segmented progress: `variant="radial"` (circular arc gauge, default) or `variant="block"` (discrete filled blocks ▮▮▮▯▯). |
|
|
43
|
+
| `LinearProgress` | Smooth horizontal progress bar. |
|
|
44
|
+
| `TabNavigation` | Animated tab bar. |
|
|
45
|
+
| `Carousel` | Image carousel. |
|
|
46
|
+
| `Steps` | Multi-step progress indicator. |
|
|
47
|
+
| `GradientText` | Text with cyberpunk gradient effects. |
|
|
48
|
+
| `SectionTitle` | Title with decorative gradient line. |
|
|
49
|
+
| `Timeline` | Vertical event history display. |
|
|
50
|
+
| `Image` | Image with cyberpunk frame/effects. |
|
|
51
|
+
<!-- cyberui-2045:manifest:end -->
|
|
50
52
|
|
|
51
53
|
## 4. Usage Patterns (Few-Shot)
|
|
52
54
|
|
package/README.md
CHANGED
|
@@ -40,47 +40,50 @@ function App() {
|
|
|
40
40
|
|
|
41
41
|
## Components
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
| Toggle | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-toggle--docs) |
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
| GradientText | Typography | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-gradienttext--docs) |
|
|
64
|
-
| SectionTitle | Typography | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-sectiontitle--docs) |
|
|
65
|
-
| Timeline | Display | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-timeline--docs) |
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
<!-- cyberui-2045:manifest:start -->
|
|
44
|
+
| Component | Category | Docs |
|
|
45
|
+
|-----------|----------|------|
|
|
46
|
+
| Button | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-button--docs) |
|
|
47
|
+
| Input | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-input--docs) |
|
|
48
|
+
| Toggle | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-toggle--docs) |
|
|
49
|
+
| Select | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-select--docs) |
|
|
50
|
+
| Checkbox | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-checkbox--docs) |
|
|
51
|
+
| Card | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-card--docs) |
|
|
52
|
+
| Modal | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-modal--docs) |
|
|
53
|
+
| Divider | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-divider--docs) |
|
|
54
|
+
| Notification | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-notification--docs) |
|
|
55
|
+
| Badge | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-badge--docs) |
|
|
56
|
+
| Skeleton | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-skeleton--docs) |
|
|
57
|
+
| CircularProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-circularprogress--docs) |
|
|
58
|
+
| SegmentedProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-segmentedprogress--docs) |
|
|
59
|
+
| LinearProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-linearprogress--docs) |
|
|
60
|
+
| TabNavigation | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-tabnavigation--docs) |
|
|
61
|
+
| Carousel | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-carousel--docs) |
|
|
62
|
+
| Steps | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-steps--docs) |
|
|
63
|
+
| GradientText | Typography | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-gradienttext--docs) |
|
|
64
|
+
| SectionTitle | Typography | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-sectiontitle--docs) |
|
|
65
|
+
| Timeline | Display | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-timeline--docs) |
|
|
66
|
+
| Image | Media | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-image--docs) |
|
|
67
|
+
|
|
68
|
+
Also includes hooks (`useCyberScrollbar`, `useCyberNotifications`, `useAnimatedProgress`) and `CyberNotificationProvider` context.
|
|
69
|
+
<!-- cyberui-2045:manifest:end -->
|
|
68
70
|
|
|
69
71
|
## AI Coding Setup
|
|
70
72
|
|
|
71
|
-
If you use an AI coding assistant (Claude Code, Cursor, GitHub Copilot), run this once after installing:
|
|
73
|
+
If you use an AI coding assistant (Claude Code, Cursor, GitHub Copilot, or any tool that reads the open `AGENTS.md` standard), run this once after installing:
|
|
72
74
|
|
|
73
75
|
```bash
|
|
74
76
|
npx cyberui-2045 init
|
|
75
77
|
```
|
|
76
78
|
|
|
77
|
-
It writes a concise CyberUI usage guide — components, hooks, tokens, and patterns — directly into your AI config file (`CLAUDE.md`, `.cursorrules`,
|
|
79
|
+
It writes a concise CyberUI usage guide — components, hooks, tokens, and patterns — directly into your AI config file (`CLAUDE.md`, `.cursorrules`, `.github/copilot-instructions.md`, or `AGENTS.md`). Idempotent: safe to re-run after upgrades.
|
|
78
80
|
|
|
79
81
|
```bash
|
|
80
82
|
npx cyberui-2045 init --claude # Claude Code only
|
|
81
83
|
npx cyberui-2045 init --cursor # Cursor only
|
|
82
84
|
npx cyberui-2045 init --copilot # GitHub Copilot only
|
|
83
|
-
npx cyberui-2045 init --
|
|
85
|
+
npx cyberui-2045 init --agents # AGENTS.md standard only
|
|
86
|
+
npx cyberui-2045 init --all # all four
|
|
84
87
|
npx cyberui-2045 init --dry-run # preview without writing
|
|
85
88
|
```
|
|
86
89
|
|
package/bin/init.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createInterface } from 'node:readline';
|
|
|
4
4
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
5
5
|
import { join, dirname } from 'node:path';
|
|
6
6
|
import { getUsageContent } from './usage-content.js';
|
|
7
|
+
import { replaceMarkedBlock } from './markers.js';
|
|
7
8
|
|
|
8
9
|
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
9
10
|
|
|
@@ -23,6 +24,10 @@ const TARGETS = {
|
|
|
23
24
|
label: 'GitHub Copilot → .github/copilot-instructions.md',
|
|
24
25
|
file: '.github/copilot-instructions.md',
|
|
25
26
|
},
|
|
27
|
+
agents: {
|
|
28
|
+
label: 'AGENTS.md standard → AGENTS.md',
|
|
29
|
+
file: 'AGENTS.md',
|
|
30
|
+
},
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
// ─── Arg parsing ──────────────────────────────────────────────────────────────
|
|
@@ -37,6 +42,7 @@ if (args.includes('--all')) {
|
|
|
37
42
|
if (args.includes('--claude')) selectedKeys.push('claude');
|
|
38
43
|
if (args.includes('--cursor')) selectedKeys.push('cursor');
|
|
39
44
|
if (args.includes('--copilot')) selectedKeys.push('copilot');
|
|
45
|
+
if (args.includes('--agents')) selectedKeys.push('agents');
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
// ─── Main ─────────────────────────────────────────────────────────────────────
|
|
@@ -51,6 +57,7 @@ async function main() {
|
|
|
51
57
|
console.log(' npx cyberui-2045 init --claude');
|
|
52
58
|
console.log(' npx cyberui-2045 init --cursor');
|
|
53
59
|
console.log(' npx cyberui-2045 init --copilot');
|
|
60
|
+
console.log(' npx cyberui-2045 init --agents');
|
|
54
61
|
console.log(' npx cyberui-2045 init --all\n');
|
|
55
62
|
process.exit(0);
|
|
56
63
|
}
|
|
@@ -123,7 +130,7 @@ function writeTarget(key) {
|
|
|
123
130
|
const filePath = join(cwd, target.file);
|
|
124
131
|
|
|
125
132
|
// Read current package version
|
|
126
|
-
let version = '
|
|
133
|
+
let version = '2.4.0';
|
|
127
134
|
try {
|
|
128
135
|
const pkgPath = new URL('../package.json', import.meta.url).pathname;
|
|
129
136
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
@@ -132,7 +139,8 @@ function writeTarget(key) {
|
|
|
132
139
|
// fallback to hardcoded version
|
|
133
140
|
}
|
|
134
141
|
|
|
135
|
-
const
|
|
142
|
+
const content = getUsageContent(version);
|
|
143
|
+
const block = `${MARKER_START}\n${content}\n${MARKER_END}`;
|
|
136
144
|
|
|
137
145
|
if (isDryRun) {
|
|
138
146
|
console.log(` ── ${target.file} ──\n${block}\n`);
|
|
@@ -152,9 +160,7 @@ function writeTarget(key) {
|
|
|
152
160
|
|
|
153
161
|
if (existing.includes(MARKER_START) && existing.includes(MARKER_END)) {
|
|
154
162
|
// Replace existing section
|
|
155
|
-
|
|
156
|
-
const after = existing.slice(existing.indexOf(MARKER_END) + MARKER_END.length);
|
|
157
|
-
finalContent = `${before}${block}${after}`;
|
|
163
|
+
finalContent = replaceMarkedBlock(existing, MARKER_START, MARKER_END, content);
|
|
158
164
|
console.log(` ✓ Updated ${target.file}`);
|
|
159
165
|
} else {
|
|
160
166
|
// Append new section
|
package/bin/markers.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Shared marker-block replace helper.
|
|
2
|
+
// Used by bin/init.js (consumer-file injection) and scripts/generate-manifest.js
|
|
3
|
+
// (this repo's own doc regeneration) to replace only the text between a pair of
|
|
4
|
+
// HTML comment markers, leaving the rest of the file untouched.
|
|
5
|
+
|
|
6
|
+
export const MANIFEST_MARKER_START = '<!-- cyberui-2045:manifest:start -->';
|
|
7
|
+
export const MANIFEST_MARKER_END = '<!-- cyberui-2045:manifest:end -->';
|
|
8
|
+
|
|
9
|
+
export function replaceMarkedBlock(content, startMarker, endMarker, block) {
|
|
10
|
+
const startIdx = content.indexOf(startMarker);
|
|
11
|
+
const endIdx = content.indexOf(endMarker);
|
|
12
|
+
if (startIdx === -1 || endIdx === -1) {
|
|
13
|
+
throw new Error(`Markers not found: ${startMarker} / ${endMarker}`);
|
|
14
|
+
}
|
|
15
|
+
const before = content.slice(0, startIdx);
|
|
16
|
+
const after = content.slice(endIdx + endMarker.length);
|
|
17
|
+
return `${before}${startMarker}\n${block}\n${endMarker}${after}`;
|
|
18
|
+
}
|
package/bin/usage-content.js
CHANGED
|
@@ -1,210 +1,136 @@
|
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
}
|
|
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.4.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
|
+
Paths below are relative to \`node_modules/cyberui-2045/\`.
|
|
30
|
+
|
|
31
|
+
<!-- cyberui-2045:manifest:start -->
|
|
32
|
+
| Component | Category | Types |
|
|
33
|
+
|-----------|----------|-------|
|
|
34
|
+
| Button | Forms | \`dist/components/Button.d.ts\` |
|
|
35
|
+
| Input | Forms | \`dist/components/Input.d.ts\` |
|
|
36
|
+
| Toggle | Forms | \`dist/components/Toggle.d.ts\` |
|
|
37
|
+
| Select | Forms | \`dist/components/Select.d.ts\` |
|
|
38
|
+
| Checkbox | Forms | \`dist/components/Checkbox.d.ts\` |
|
|
39
|
+
| Card | Layout | \`dist/components/Card.d.ts\` |
|
|
40
|
+
| Modal | Layout | \`dist/components/Modal.d.ts\` |
|
|
41
|
+
| Divider | Layout | \`dist/components/Divider.d.ts\` |
|
|
42
|
+
| Notification | Feedback | \`dist/components/Notification.d.ts\` |
|
|
43
|
+
| Badge | Feedback | \`dist/components/Badge.d.ts\` |
|
|
44
|
+
| Skeleton | Feedback | \`dist/components/Skeleton.d.ts\` |
|
|
45
|
+
| CircularProgress | Progress | \`dist/components/CircularProgress.d.ts\` |
|
|
46
|
+
| SegmentedProgress | Progress | \`dist/components/SegmentedProgress.d.ts\` |
|
|
47
|
+
| LinearProgress | Progress | \`dist/components/LinearProgress.d.ts\` |
|
|
48
|
+
| TabNavigation | Navigation | \`dist/components/TabNavigation.d.ts\` |
|
|
49
|
+
| Carousel | Navigation | \`dist/components/Carousel.d.ts\` |
|
|
50
|
+
| Steps | Navigation | \`dist/components/Steps.d.ts\` |
|
|
51
|
+
| GradientText | Typography | \`dist/components/GradientText.d.ts\` |
|
|
52
|
+
| SectionTitle | Typography | \`dist/components/SectionTitle.d.ts\` |
|
|
53
|
+
| Timeline | Display | \`dist/components/Timeline.d.ts\` |
|
|
54
|
+
| Image | Media | \`dist/components/Image.d.ts\` |
|
|
55
|
+
<!-- cyberui-2045:manifest:end -->
|
|
56
|
+
|
|
57
|
+
### Critical API notes
|
|
58
|
+
|
|
59
|
+
Every prop carries full JSDoc (types, \`@default\`, gotchas) — hover it in your editor or read
|
|
60
|
+
\`node_modules/cyberui-2045/dist/index.d.ts\` before using an unfamiliar component. Don't guess.
|
|
61
|
+
|
|
62
|
+
Only cross-cutting facts that don't belong to any single component's own types are listed here:
|
|
63
|
+
|
|
64
|
+
- \`Button\` variants: \`primary | secondary | danger | ghost\`. \`Badge\` variants: \`primary | secondary | accent | success | error | warning\`. Different sets — \`Button\` has no \`accent\`, \`Badge\` has no \`danger\`. Easy to mix up since both are status/action-ish components.
|
|
65
|
+
- Full machine-readable prop reference for all 21 components + hooks: \`node_modules/cyberui-2045/dist/component-manifest.json\`. Grep it for a component name before writing code against it if you're not confident of its exact props.
|
|
66
|
+
|
|
67
|
+
### Hooks
|
|
68
|
+
|
|
69
|
+
\`\`\`tsx
|
|
70
|
+
import { useCyberNotifications, useAnimatedProgress, useCyberScrollbar } from 'cyberui-2045';
|
|
71
|
+
|
|
72
|
+
// Toast notifications — showNotification(type, title, message, options?)
|
|
73
|
+
// type: 'success' | 'warning' | 'error'
|
|
74
|
+
const { showNotification } = useCyberNotifications();
|
|
75
|
+
showNotification('success', 'Access Granted', 'Welcome back, runner.');
|
|
76
|
+
showNotification('error', 'Breach Detected', 'Sector 7 compromised.', { duration: 5000 });
|
|
77
|
+
|
|
78
|
+
// Oscillating value for loading/pulse animations (min → max → min loop)
|
|
79
|
+
const value = useAnimatedProgress({ min: 5, max: 95, speed: 30 });
|
|
80
|
+
|
|
81
|
+
// Apply cyberpunk scrollbar styles to a scrollable element
|
|
82
|
+
const ref = useCyberScrollbar<HTMLDivElement>();
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
### Notifications (requires provider)
|
|
86
|
+
|
|
87
|
+
\`\`\`tsx
|
|
88
|
+
import { CyberNotificationProvider, useCyberNotifications } from 'cyberui-2045';
|
|
89
|
+
|
|
90
|
+
// Wrap your app once
|
|
91
|
+
<CyberNotificationProvider>
|
|
92
|
+
<App />
|
|
93
|
+
</CyberNotificationProvider>
|
|
94
|
+
|
|
95
|
+
// Then anywhere inside:
|
|
96
|
+
const { showNotification } = useCyberNotifications();
|
|
97
|
+
showNotification('success', 'Upload Complete', 'Neural data synced.');
|
|
98
|
+
\`\`\`
|
|
99
|
+
|
|
100
|
+
### Theming — CSS token overrides
|
|
101
|
+
|
|
102
|
+
Override in your global CSS (after importing cyberui-2045/styles.css):
|
|
103
|
+
|
|
104
|
+
\`\`\`css
|
|
105
|
+
:root {
|
|
106
|
+
--color-primary: #ff005d; /* neon pink */
|
|
107
|
+
--color-secondary: #00fff9; /* cyan */
|
|
108
|
+
--color-accent: #fffb00; /* yellow */
|
|
109
|
+
--color-success: #00ff9e; /* green */
|
|
110
|
+
--color-error: #ff4f4f; /* red */
|
|
111
|
+
--color-warning: #ffaa00; /* orange */
|
|
112
|
+
--color-base: #1a1a2e; /* page background */
|
|
113
|
+
--color-surface: #2d2d44; /* card / component surface */
|
|
114
|
+
--color-border-default: #3c3c5e; /* borders */
|
|
115
|
+
--color-default: #e0e0e0; /* primary text */
|
|
116
|
+
--color-muted: #8888aa; /* secondary text */
|
|
117
|
+
--color-inverse: #1a1a2e; /* inverted text */
|
|
118
|
+
}
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
### className overrides
|
|
122
|
+
|
|
123
|
+
All components accept a \`className\` prop merged via \`tailwind-merge\` — your classes win on conflict.
|
|
124
|
+
|
|
125
|
+
\`\`\`tsx
|
|
126
|
+
<Button className="w-full mt-4">Full width</Button>
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
### cn() utility (re-exported)
|
|
130
|
+
|
|
131
|
+
\`\`\`tsx
|
|
132
|
+
import { cn } from 'cyberui-2045';
|
|
133
|
+
// clsx + tailwind-merge — compose className strings in your own components
|
|
134
|
+
const cls = cn('base-class', isActive && 'active', className);
|
|
135
|
+
\`\`\``;
|
|
136
|
+
}
|