cyberui-2045 1.3.1 → 1.3.3

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 ADDED
@@ -0,0 +1,79 @@
1
+ # CyberUI 2045 - Agent Guide
2
+
3
+ You are an expert frontend developer building a futuristic, cyberpunk-themed application using the `cyberui-2045` library.
4
+
5
+ ## 1. Setup & Installation
6
+
7
+ **Install the package:**
8
+ ```bash
9
+ npm install cyberui-2045
10
+ ```
11
+
12
+ **Import the styles (CRITICAL):**
13
+ Add this to your root entry file (e.g., `main.tsx`, `App.tsx`):
14
+ ```tsx
15
+ import "cyberui-2045/styles.css";
16
+ ```
17
+
18
+ ## 2. Vibe Coding Principles (Consumer Edition)
19
+
20
+ * **Dark Mode Only**: CyberUI is designed for dark backgrounds. Always set your page background to a dark color (e.g., `bg-slate-900`, `#050505`).
21
+ * **Use the Library**: Do not build custom UI components if a CyberUI component exists.
22
+ * **Neon Pop**: Use the library's built-in glow effects. Don't override them with flat colors unless necessary.
23
+ * **Responsive**: Use the `ResponsiveValue` prop pattern for mobile-first designs.
24
+
25
+ ## 3. Component Reference
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 progress indicator. |
35
+ | `TabNavigation` | Animated tab bar. |
36
+ | `Badge` | Status indicator. Variants: `default`, `success`, `warning`, `danger`. |
37
+ | `Toggle` | Cyberpunk switch. |
38
+ | `Select` | Styled dropdown. |
39
+ | `Skeleton` | Loading placeholder. |
40
+ | `Image` | Image with cyberpunk frame/effects. |
41
+ | `Carousel` | Image carousel. |
42
+
43
+ ## 4. Usage Patterns (Few-Shot)
44
+
45
+ ### Basic Card with Action
46
+ ```tsx
47
+ import { Card, Button, Badge } from "cyberui-2045";
48
+
49
+ export const UserProfile = () => (
50
+ <Card variant="default" className="max-w-md">
51
+ <div className="flex justify-between items-center mb-4">
52
+ <h2 className="text-xl text-cyan-400 font-bold">Operative Status</h2>
53
+ <Badge variant="success">ONLINE</Badge>
54
+ </div>
55
+ <p className="text-gray-300 mb-6">System synchronization at 98%.</p>
56
+ <Button variant="primary" onClick={() => console.log("Syncing...")}>
57
+ INITIATE SYNC
58
+ </Button>
59
+ </Card>
60
+ );
61
+ ```
62
+
63
+ ### Responsive Layout
64
+ ```tsx
65
+ import { Button } from "cyberui-2045";
66
+
67
+ // Resize button based on screen width
68
+ <Button
69
+ size={{ base: 'sm', md: 'md', lg: 'lg' }}
70
+ variant="secondary"
71
+ >
72
+ Responsive Action
73
+ </Button>
74
+ ```
75
+
76
+ ## 5. Troubleshooting
77
+
78
+ * **Missing Styles?** Ensure `import "cyberui-2045/styles.css"` is present.
79
+ * **Text Invisible?** Check if you are on a white background. Switch to dark mode.
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
- # CyberUI 🚀
1
+ # CyberUI
2
2
 
3
3
  A cyberpunk-themed React UI library with neon-styled components and futuristic aesthetics.
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
 
7
- ## Demo & Documentation
7
+ ## 🌐 Demo & Documentation
8
+
9
+ <details>
10
+ <summary>Check out the Demo Video 🎬</summary>
11
+ <video src="https://github.com/user-attachments/assets/00d3de8d-d243-4ae0-80c4-e6b97b71c0f0">
12
+ </video>
13
+ </details>
8
14
 
9
15
  - 🔗 **[Live Demo](https://patrickkuei.github.io/CyberUI)** - Experience the cyberpunk theme in action
10
16
  - 📚 **[Storybook Documentation](https://patrickkuei.github.io/CyberUI/storybook)** - Interactive component documentation
@@ -15,9 +21,12 @@ A cyberpunk-themed React UI library with neon-styled components and futuristic a
15
21
  npm install cyberui-2045
16
22
  ```
17
23
 
24
+ Import the core stylesheet and components
25
+
18
26
  ```tsx
19
- import React from 'react';
20
- import { CircularProgress, Notification } from 'cyberui-2045';
27
+ import React from "react";
28
+ import "cyberui-2045/styles.css";
29
+ import { CircularProgress, Notification } from "cyberui-2045";
21
30
 
22
31
  function App() {
23
32
  return (
@@ -36,6 +45,10 @@ function App() {
36
45
  }
37
46
  ```
38
47
 
48
+ ## Changelog
49
+
50
+ See the full history in [CHANGELOG.md](./CHANGELOG.md).
51
+
39
52
  ## 🛠️ Development
40
53
 
41
54
  ```bash
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A status indicator badge with various semantic variants.
5
+ *
6
+ * @example
7
+ * // Success badge
8
+ * <Badge variant="success">ONLINE</Badge>
9
+ *
10
+ * @example
11
+ * // Clickable badge with icon
12
+ * <Badge
13
+ * variant="primary"
14
+ * clickable
15
+ * onClick={handleClick}
16
+ * leftIcon={<Icon name="user" />}
17
+ * >
18
+ * Profile
19
+ * </Badge>
20
+ */
21
+ export interface BadgeProps {
22
+ /**
23
+ * Semantic style of the badge.
24
+ * @default 'primary'
25
+ */
26
+ variant?: 'primary' | 'secondary' | 'accent' | 'success' | 'error' | 'warning';
27
+ /**
28
+ * Size of the badge.
29
+ * @default 'md'
30
+ */
31
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
32
+ children: React.ReactNode;
33
+ className?: string;
34
+ leftIcon?: React.ReactNode;
35
+ rightIcon?: React.ReactNode;
36
+ clickable?: boolean;
37
+ onClick?: () => void;
38
+ }
39
+ declare const Badge: React.FC<BadgeProps>;
40
+ export default Badge;
@@ -0,0 +1,44 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A neon-styled cyberpunk button component.
5
+ *
6
+ * Supports multiple variants and responsive sizing.
7
+ *
8
+ * @example
9
+ * // Primary button
10
+ * <Button variant="primary" onClick={handleClick}>
11
+ * INITIATE
12
+ * </Button>
13
+ *
14
+ * @example
15
+ * // Responsive size (Small on mobile, Large on desktop)
16
+ * <Button size={{ base: 'sm', lg: 'lg' }}>
17
+ * RESPONSIVE
18
+ * </Button>
19
+ *
20
+ * @example
21
+ * // Ghost variant for secondary actions
22
+ * <Button variant="ghost">
23
+ * CANCEL
24
+ * </Button>
25
+ */
26
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
27
+ /**
28
+ * Visual style of the button.
29
+ * - `primary`: Main action, neon glow.
30
+ * - `secondary`: Alternative action, bordered.
31
+ * - `danger`: Destructive action, red glow.
32
+ * - `ghost`: Subtle action, transparent background.
33
+ * @default 'primary'
34
+ */
35
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
36
+ /**
37
+ * Size of the button. Can be a static value or a responsive object.
38
+ * @default 'md'
39
+ */
40
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
41
+ children: React.ReactNode;
42
+ }
43
+ declare const Button: React.FC<ButtonProps>;
44
+ export default Button;
@@ -0,0 +1,42 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A glassmorphism container for grouping content.
5
+ *
6
+ * @example
7
+ * // Basic card with title
8
+ * <Card title="System Status">
9
+ * <p>All systems operational.</p>
10
+ * </Card>
11
+ *
12
+ * @example
13
+ * // Accent variant with hover effect
14
+ * <Card variant="accent" title="High Priority">
15
+ * <Button>Action Required</Button>
16
+ * </Card>
17
+ */
18
+ export interface CardProps {
19
+ /**
20
+ * Visual style of the card.
21
+ * - `default`: Standard glassmorphism.
22
+ * - `accent`: Glowing border and hover effects.
23
+ * - `small`: Compact padding for tight spaces.
24
+ * @default 'default'
25
+ */
26
+ variant?: 'default' | 'accent' | 'small';
27
+ /**
28
+ * Padding size of the card content.
29
+ * @default 'md'
30
+ */
31
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
32
+ title?: string;
33
+ /**
34
+ * Whether to show a border under the title.
35
+ * @default true
36
+ */
37
+ titleBorder?: boolean;
38
+ children: React.ReactNode;
39
+ className?: string;
40
+ }
41
+ declare const Card: React.FC<CardProps>;
42
+ export default Card;
@@ -0,0 +1,94 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * Size options for the Carousel component
5
+ */
6
+ export type CarouselSize = "sm" | "md" | "lg";
7
+ /**
8
+ * Transition effects for the Carousel
9
+ */
10
+ export type CarouselTransition = "slide" | "fade" | "matrix" | "signal-glitch";
11
+ /**
12
+ * Object fit options for images
13
+ */
14
+ export type CarouselObjectFit = "cover" | "contain";
15
+ /**
16
+ * Image data structure for Carousel
17
+ */
18
+ export interface CarouselImageData {
19
+ /** Image source URL */
20
+ src: string;
21
+ /** Alt text for accessibility */
22
+ alt: string;
23
+ /** Optional fallback image URL */
24
+ fallbackSrc?: string;
25
+ /** Optional caption */
26
+ caption?: string;
27
+ }
28
+ /**
29
+ * Lifecycle callback functions for Carousel events
30
+ */
31
+ export interface CarouselCallbacks {
32
+ /** Fired before slide change (fromIndex, toIndex) */
33
+ onBeforeChange?: (fromIndex: number, toIndex: number) => void;
34
+ /** Fired after slide change */
35
+ onAfterChange?: (index: number) => void;
36
+ }
37
+ /**
38
+ * Props for the CyberUI Carousel component
39
+ *
40
+ * @example
41
+ * // Basic carousel
42
+ * <Carousel
43
+ * images={[
44
+ * { src: 'img1.jpg', alt: 'Cyber City' },
45
+ * { src: 'img2.jpg', alt: 'Neon Lights' }
46
+ * ]}
47
+ * currentIndex={index}
48
+ * onChange={setIndex}
49
+ * />
50
+ *
51
+ * @example
52
+ * // Glitch effect carousel
53
+ * <Carousel
54
+ * images={images}
55
+ * currentIndex={index}
56
+ * onChange={setIndex}
57
+ * transition="signal-glitch"
58
+ * glitchRate={0.5}
59
+ * autoPlay
60
+ * interval={5000}
61
+ * />
62
+ */
63
+ export interface CarouselProps extends CarouselCallbacks {
64
+ /** Array of images to display */
65
+ images: CarouselImageData[];
66
+ /** Current slide index (controlled) */
67
+ currentIndex: number;
68
+ /** Callback when slide changes */
69
+ onChange: (index: number) => void;
70
+ /** Size variant with responsive support */
71
+ size?: ResponsiveValue<CarouselSize>;
72
+ /** Enable auto-play functionality */
73
+ autoPlay?: boolean;
74
+ /** Auto-play interval in milliseconds */
75
+ interval?: number;
76
+ /** Enable infinite loop */
77
+ infinite?: boolean;
78
+ /** Transition effect */
79
+ transition?: CarouselTransition;
80
+ /** Image object fit behavior */
81
+ objectFit?: CarouselObjectFit;
82
+ /** Show navigation arrows */
83
+ showArrows?: boolean;
84
+ /** Show slide indicators */
85
+ showIndicators?: boolean;
86
+ /** Additional CSS classes */
87
+ className?: string;
88
+ /** Disable click-to-expand on images */
89
+ disableImagePreview?: boolean;
90
+ /** Control signal-glitch effect frequency. Float (0.0-1.0) for probability, boolean for on/off */
91
+ glitchRate?: number | boolean;
92
+ }
93
+ declare const _default: React.NamedExoticComponent<CarouselProps>;
94
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * A circular progress indicator with neon glow effects.
4
+ *
5
+ * @example
6
+ * // Basic progress
7
+ * <CircularProgress progress={75} radius={40} />
8
+ *
9
+ * @example
10
+ * // Progress with label
11
+ * <CircularProgress progress={45} radius={60}>
12
+ * <span className="text-accent font-bold">45%</span>
13
+ * </CircularProgress>
14
+ */
15
+ export interface CircularProgressProps {
16
+ /**
17
+ * Progress value (0-100).
18
+ */
19
+ progress: number;
20
+ /**
21
+ * Radius of the circle in pixels.
22
+ */
23
+ radius: number;
24
+ className?: string;
25
+ children?: React.ReactNode;
26
+ ariaLabel?: string;
27
+ }
28
+ declare const CircularProgress: React.FC<CircularProgressProps>;
29
+ export default CircularProgress;
@@ -0,0 +1,90 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * Size options for the Image component
5
+ */
6
+ export type ImageSize = "sm" | "md" | "lg";
7
+ /**
8
+ * Animation configuration for preview transitions
9
+ */
10
+ export interface ImageAnimationConfig {
11
+ /** Duration of opening animation in milliseconds */
12
+ openDuration?: number;
13
+ /** Duration of closing animation in milliseconds */
14
+ closeDuration?: number;
15
+ /** Enable/disable cyberpunk effects */
16
+ cyberpunkEffects?: boolean;
17
+ }
18
+ /**
19
+ * Callback functions for Image component events
20
+ */
21
+ export interface ImageCallbacks {
22
+ /** Fired when preview opens */
23
+ onPreviewOpen?: () => void;
24
+ /** Fired when preview closes */
25
+ onPreviewClose?: () => void;
26
+ /** Fired when image loads successfully */
27
+ onLoad?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
28
+ /** Fired when image fails to load */
29
+ onError?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
30
+ }
31
+ /**
32
+ * Props for the CyberUI Image component
33
+ *
34
+ * @example
35
+ * // Basic image with preview
36
+ * <Image
37
+ * src="/cyber-city.jpg"
38
+ * alt="Cyberpunk cityscape"
39
+ * size="lg"
40
+ * />
41
+ *
42
+ * @example
43
+ * // Image with fallback and custom animation
44
+ * <Image
45
+ * src={src}
46
+ * alt="Avatar"
47
+ * fallback="/default-avatar.png"
48
+ * animation={{ cyberpunkEffects: false }}
49
+ * />
50
+ */
51
+ export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "size" | "onLoad" | "onError">, ImageCallbacks {
52
+ /** Image source URL (required) */
53
+ src: string;
54
+ /** Alternative text for accessibility (required) */
55
+ alt: string;
56
+ /** Size of the image container */
57
+ size?: ResponsiveValue<ImageSize>;
58
+ /** Enable click-to-expand preview functionality */
59
+ preview?: boolean;
60
+ /** Fallback image URL when main image fails to load */
61
+ fallback?: string;
62
+ /** Custom loading placeholder component */
63
+ placeholder?: React.ReactNode;
64
+ /** Additional CSS classes */
65
+ className?: string;
66
+ /** Animation configuration */
67
+ animation?: ImageAnimationConfig;
68
+ /** Disable lazy loading (images load immediately) */
69
+ eager?: boolean;
70
+ /** Custom preview container styles */
71
+ previewClassName?: string;
72
+ }
73
+ /**
74
+ * CyberUI Image Component
75
+ *
76
+ * A cyberpunk-themed image component with click-to-expand preview functionality,
77
+ * loading states, error handling, and smooth animations.
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * <Image
82
+ * src="/cyber-city.jpg"
83
+ * alt="Cyberpunk cityscape"
84
+ * size="lg"
85
+ * onPreviewOpen={() => console.log('Preview opened')}
86
+ * />
87
+ * ```
88
+ */
89
+ declare const Image: React.FC<ImageProps>;
90
+ export default Image;
@@ -0,0 +1,37 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A cyberpunk-styled text input field.
5
+ *
6
+ * @example
7
+ * // Basic input with label
8
+ * <Input label="Username" placeholder="Enter alias..." />
9
+ *
10
+ * @example
11
+ * // Input with error state and icon
12
+ * <Input
13
+ * label="Password"
14
+ * type="password"
15
+ * error="Invalid credentials"
16
+ * leftIcon={<LockIcon />}
17
+ * />
18
+ */
19
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
20
+ /**
21
+ * Visual style of the input.
22
+ * @default 'primary'
23
+ */
24
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
25
+ /**
26
+ * Size of the input (height and padding).
27
+ * @default 'md'
28
+ */
29
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
30
+ label?: string;
31
+ helperText?: string;
32
+ error?: string;
33
+ leftIcon?: React.ReactNode;
34
+ rightIcon?: React.ReactNode;
35
+ }
36
+ declare const Input: React.FC<InputProps>;
37
+ export default Input;
@@ -0,0 +1,31 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A linear progress bar with gradient and glow effects.
5
+ *
6
+ * @example
7
+ * // Basic progress bar
8
+ * <LinearProgress progress={60} />
9
+ *
10
+ * @example
11
+ * // Large progress bar with custom class
12
+ * <LinearProgress
13
+ * progress={85}
14
+ * size="lg"
15
+ * className="my-4"
16
+ * />
17
+ */
18
+ export interface LinearProgressProps {
19
+ /**
20
+ * Progress value (0-100).
21
+ */
22
+ progress: number;
23
+ /**
24
+ * Height of the progress bar.
25
+ * @default 'md'
26
+ */
27
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
28
+ className?: string;
29
+ }
30
+ declare const LinearProgress: React.FC<LinearProgressProps>;
31
+ export default LinearProgress;
@@ -0,0 +1,66 @@
1
+ import { default as React } from 'react';
2
+ export interface ModalAnimationConfig {
3
+ openDuration?: number;
4
+ closeDuration?: number;
5
+ crtEffects?: boolean;
6
+ }
7
+ export interface ModalCallbacks {
8
+ onOpen?: () => void;
9
+ onClose?: () => void;
10
+ onCRTBootComplete?: () => void;
11
+ }
12
+ /**
13
+ * A CRT-styled modal dialog with retro animation effects.
14
+ *
15
+ * @example
16
+ * // Basic modal
17
+ * <Modal isOpen={isOpen} onClose={close} title="System Alert">
18
+ * <p>Breach detected in sector 7.</p>
19
+ * </Modal>
20
+ *
21
+ * @example
22
+ * // Confirmation modal with custom actions
23
+ * <Modal
24
+ * isOpen={isOpen}
25
+ * onClose={close}
26
+ * title="Confirm Override"
27
+ * onConfirm={handleConfirm}
28
+ * confirmText="EXECUTE"
29
+ * variant="danger"
30
+ * >
31
+ * Are you sure you want to override safety protocols?
32
+ * </Modal>
33
+ */
34
+ export interface ModalProps extends ModalCallbacks {
35
+ /**
36
+ * Whether the modal is visible.
37
+ */
38
+ isOpen: boolean;
39
+ /**
40
+ * Callback when the modal requests to close.
41
+ */
42
+ onClose: () => void;
43
+ title?: string;
44
+ children: React.ReactNode;
45
+ footer?: React.ReactNode;
46
+ onCancel?: () => void;
47
+ onConfirm?: () => void;
48
+ cancelText?: string;
49
+ confirmText?: string;
50
+ confirmLoading?: boolean;
51
+ showCancel?: boolean;
52
+ showConfirm?: boolean;
53
+ /**
54
+ * Width of the modal.
55
+ * @default 'md'
56
+ */
57
+ size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
58
+ closeOnOverlayClick?: boolean;
59
+ closeOnEscape?: boolean;
60
+ animation?: ModalAnimationConfig;
61
+ className?: string;
62
+ overlayClassName?: string;
63
+ showCloseButton?: boolean;
64
+ }
65
+ declare const Modal: React.FC<ModalProps>;
66
+ export default Modal;
@@ -0,0 +1,38 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveValue } from '../utils/responsive';
3
+ /**
4
+ * A toast notification component with status indicators.
5
+ *
6
+ * @example
7
+ * // Success notification
8
+ * <Notification
9
+ * type="success"
10
+ * title="Upload Complete"
11
+ * message="Data transfer finished successfully."
12
+ * />
13
+ *
14
+ * @example
15
+ * // Error notification with close handler
16
+ * <Notification
17
+ * type="error"
18
+ * title="Connection Failed"
19
+ * message="Unable to reach the mainframe."
20
+ * onClose={handleClose}
21
+ * />
22
+ */
23
+ export interface NotificationProps {
24
+ /**
25
+ * Semantic type of the notification.
26
+ */
27
+ type: 'success' | 'warning' | 'error';
28
+ title: string;
29
+ message: string;
30
+ /**
31
+ * Size of the notification.
32
+ * @default 'md'
33
+ */
34
+ size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
35
+ onClose?: () => void;
36
+ }
37
+ declare const Notification: React.FC<NotificationProps>;
38
+ export default Notification;
@@ -0,0 +1,27 @@
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 {
19
+ /**
20
+ * Progress value (0-100).
21
+ */
22
+ progress: number;
23
+ className?: string;
24
+ children?: React.ReactNode;
25
+ }
26
+ declare const SegmentedProgress: React.FC<SegmentedProgressProps>;
27
+ export default SegmentedProgress;