cyberui-2045 2.3.1 → 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.
Files changed (70) hide show
  1. package/AGENT.md +25 -23
  2. package/README.md +31 -28
  3. package/bin/init.js +11 -5
  4. package/bin/markers.js +18 -0
  5. package/bin/usage-content.js +136 -210
  6. package/dist/component-manifest.json +1454 -0
  7. package/dist/components/Badge.js +49 -0
  8. package/dist/components/Badge.js.map +1 -0
  9. package/dist/components/Button.js +62 -0
  10. package/dist/components/Button.js.map +1 -0
  11. package/dist/components/Card.js +31 -0
  12. package/dist/components/Card.js.map +1 -0
  13. package/dist/components/Carousel.js +585 -0
  14. package/dist/components/Carousel.js.map +1 -0
  15. package/dist/components/Checkbox.js +92 -0
  16. package/dist/components/Checkbox.js.map +1 -0
  17. package/dist/components/CircularProgress.js +87 -0
  18. package/dist/components/CircularProgress.js.map +1 -0
  19. package/dist/components/Divider.js +24 -0
  20. package/dist/components/Divider.js.map +1 -0
  21. package/dist/components/GradientText.js +27 -0
  22. package/dist/components/GradientText.js.map +1 -0
  23. package/dist/components/Image.js +369 -0
  24. package/dist/components/Image.js.map +1 -0
  25. package/dist/components/Input.js +70 -0
  26. package/dist/components/Input.js.map +1 -0
  27. package/dist/components/LinearProgress.js +39 -0
  28. package/dist/components/LinearProgress.js.map +1 -0
  29. package/dist/components/Modal.d.ts +19 -0
  30. package/dist/components/Modal.js +211 -0
  31. package/dist/components/Modal.js.map +1 -0
  32. package/dist/components/Notification.js +88 -0
  33. package/dist/components/Notification.js.map +1 -0
  34. package/dist/components/SectionTitle.js +33 -0
  35. package/dist/components/SectionTitle.js.map +1 -0
  36. package/dist/components/SegmentedProgress.js +82 -0
  37. package/dist/components/SegmentedProgress.js.map +1 -0
  38. package/dist/components/Select.js +93 -0
  39. package/dist/components/Select.js.map +1 -0
  40. package/dist/components/Skeleton.js +106 -0
  41. package/dist/components/Skeleton.js.map +1 -0
  42. package/dist/components/Steps.js +88 -0
  43. package/dist/components/Steps.js.map +1 -0
  44. package/dist/components/TabNavigation.js +153 -0
  45. package/dist/components/TabNavigation.js.map +1 -0
  46. package/dist/components/Timeline.js +99 -0
  47. package/dist/components/Timeline.js.map +1 -0
  48. package/dist/components/Toggle.js +73 -0
  49. package/dist/components/Toggle.js.map +1 -0
  50. package/dist/contexts/NotificationContext.js +100 -0
  51. package/dist/contexts/NotificationContext.js.map +1 -0
  52. package/dist/contexts/NotificationContextBase.js +6 -0
  53. package/dist/contexts/NotificationContextBase.js.map +1 -0
  54. package/dist/hooks/useAnimatedProgress.js +17 -0
  55. package/dist/hooks/useAnimatedProgress.js.map +1 -0
  56. package/dist/hooks/useCyberNotifications.js +14 -0
  57. package/dist/hooks/useCyberNotifications.js.map +1 -0
  58. package/dist/hooks/useCyberScrollbar.js +254 -0
  59. package/dist/hooks/useCyberScrollbar.js.map +1 -0
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.es.js +63 -5992
  62. package/dist/index.js +11 -11
  63. package/dist/utils/cn.js +9 -0
  64. package/dist/utils/cn.js.map +1 -0
  65. package/dist/utils/devWarn.d.ts +5 -0
  66. package/dist/utils/devWarn.js +8 -0
  67. package/dist/utils/devWarn.js.map +1 -0
  68. package/dist/utils/responsive.js +120 -0
  69. package/dist/utils/responsive.js.map +1 -0
  70. 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
- | Component | Description |
28
- | :--- | :--- |
29
- | `Button` | Neon-styled button. Variants: `primary`, `secondary`, `danger`, `ghost`. |
30
- | `Card` | Glassmorphism container with borders. |
31
- | `Input` | Cyberpunk text input with focus glows. |
32
- | `Modal` | CRT-style modal dialog. |
33
- | `Notification` | Toast notifications. Use `useCyberNotifications` hook. |
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 ▮▮▮▯▯). |
37
- | `TabNavigation` | Animated tab bar. |
38
- | `Badge` | Status indicator. Variants: `primary`, `secondary`, `accent`, `success`, `error`, `warning`. |
39
- | `Toggle` | Cyberpunk switch. |
40
- | `Select` | Styled dropdown. |
41
- | `Skeleton` | Loading placeholder. |
42
- | `Image` | Image with cyberpunk frame/effects. |
43
- | `Carousel` | Image carousel. |
44
- | `Checkbox` | Neon-styled checkbox with SVG icons. |
45
- | `Divider` | Gradient/solid/dashed content separator. |
46
- | `GradientText` | Text with cyberpunk gradient effects. |
47
- | `SectionTitle` | Title with decorative gradient line. |
48
- | `Steps` | Multi-step progress indicator. |
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
- | Component | Category | Docs |
44
- |-----------|----------|------|
45
- | Button | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-button--docs) |
46
- | Input | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-input--docs) |
47
- | Select | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-select--docs) |
48
- | Toggle | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-toggle--docs) |
49
- | Card | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-card--docs) |
50
- | Modal | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-modal--docs) |
51
- | Badge | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-badge--docs) |
52
- | Notification | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-notification--docs) |
53
- | Skeleton | Feedback | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-skeleton--docs) |
54
- | CircularProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-circularprogress--docs) |
55
- | LinearProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-linearprogress--docs) |
56
- | SegmentedProgress | Progress | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-segmentedprogress--docs) |
57
- | TabNavigation | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-tabnavigation--docs) |
58
- | Carousel | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-carousel--docs) |
59
- | Steps | Navigation | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-steps--docs) |
60
- | Image | Media | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-image--docs) |
61
- | Checkbox | Forms | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-checkbox--docs) |
62
- | Divider | Layout | [→](https://patrickkuei.github.io/CyberUI/storybook/?path=/docs/components-divider--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
-
67
- Also includes hooks (`useCyberNotifications`, `useAnimatedProgress`, `useCyberScrollbar`) and `CyberNotificationProvider` context.
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`, or `.github/copilot-instructions.md`). Idempotent: safe to re-run after upgrades.
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 --all # all three
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 = '1.3.2';
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 block = `${MARKER_START}\n${getUsageContent(version)}\n${MARKER_END}`;
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
- const before = existing.slice(0, existing.indexOf(MARKER_START));
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
+ }
@@ -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.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
- // Card supports 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
- }
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
+ }