cyberui-2045 1.3.2 → 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 +79 -0
- package/README.md +6 -0
- package/dist/components/Badge.d.ts +26 -0
- package/dist/components/Button.d.ts +35 -0
- package/dist/components/Card.d.ts +30 -0
- package/dist/components/Carousel.d.ts +23 -0
- package/dist/components/CircularProgress.d.ts +19 -0
- package/dist/components/Image.d.ts +17 -0
- package/dist/components/Input.d.ts +24 -0
- package/dist/components/LinearProgress.d.ts +22 -0
- package/dist/components/Modal.d.ts +32 -0
- package/dist/components/Notification.d.ts +27 -0
- package/dist/components/SegmentedProgress.d.ts +19 -0
- package/dist/components/Select.d.ts +29 -0
- package/dist/components/Skeleton.d.ts +36 -0
- package/dist/components/TabNavigation.d.ts +41 -0
- package/dist/components/Toggle.d.ts +28 -0
- package/dist/cyberui-2045.css +1 -1
- package/dist/hooks/useAnimatedProgress.d.ts +10 -0
- package/dist/hooks/useCyberNotifications.d.ts +7 -0
- package/dist/index.es.js +206 -206
- package/dist/index.js +4 -4
- package/dist/utils/responsive.d.ts +28 -0
- package/package.json +3 -2
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
|
@@ -6,6 +6,12 @@ A cyberpunk-themed React UI library with neon-styled components and futuristic a
|
|
|
6
6
|
|
|
7
7
|
## 🌐 Demo & Documentation
|
|
8
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>
|
|
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
|
|
11
17
|
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
21
|
export interface BadgeProps {
|
|
22
|
+
/**
|
|
23
|
+
* Semantic style of the badge.
|
|
24
|
+
* @default 'primary'
|
|
25
|
+
*/
|
|
4
26
|
variant?: 'primary' | 'secondary' | 'accent' | 'success' | 'error' | 'warning';
|
|
27
|
+
/**
|
|
28
|
+
* Size of the badge.
|
|
29
|
+
* @default 'md'
|
|
30
|
+
*/
|
|
5
31
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
6
32
|
children: React.ReactNode;
|
|
7
33
|
className?: string;
|
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
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
|
+
*/
|
|
4
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
|
+
*/
|
|
5
40
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
6
41
|
children: React.ReactNode;
|
|
7
42
|
}
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
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
|
+
*/
|
|
4
26
|
variant?: 'default' | 'accent' | 'small';
|
|
27
|
+
/**
|
|
28
|
+
* Padding size of the card content.
|
|
29
|
+
* @default 'md'
|
|
30
|
+
*/
|
|
5
31
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
6
32
|
title?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to show a border under the title.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
7
37
|
titleBorder?: boolean;
|
|
8
38
|
children: React.ReactNode;
|
|
9
39
|
className?: string;
|
|
@@ -36,6 +36,29 @@ export interface CarouselCallbacks {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
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
|
+
* />
|
|
39
62
|
*/
|
|
40
63
|
export interface CarouselProps extends CarouselCallbacks {
|
|
41
64
|
/** Array of images to display */
|
|
@@ -1,6 +1,25 @@
|
|
|
1
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
|
+
*/
|
|
2
15
|
export interface CircularProgressProps {
|
|
16
|
+
/**
|
|
17
|
+
* Progress value (0-100).
|
|
18
|
+
*/
|
|
3
19
|
progress: number;
|
|
20
|
+
/**
|
|
21
|
+
* Radius of the circle in pixels.
|
|
22
|
+
*/
|
|
4
23
|
radius: number;
|
|
5
24
|
className?: string;
|
|
6
25
|
children?: React.ReactNode;
|
|
@@ -30,6 +30,23 @@ export interface ImageCallbacks {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
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
|
+
* />
|
|
33
50
|
*/
|
|
34
51
|
export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "size" | "onLoad" | "onError">, ImageCallbacks {
|
|
35
52
|
/** Image source URL (required) */
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
19
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
20
|
+
/**
|
|
21
|
+
* Visual style of the input.
|
|
22
|
+
* @default 'primary'
|
|
23
|
+
*/
|
|
4
24
|
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
25
|
+
/**
|
|
26
|
+
* Size of the input (height and padding).
|
|
27
|
+
* @default 'md'
|
|
28
|
+
*/
|
|
5
29
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
6
30
|
label?: string;
|
|
7
31
|
helperText?: string;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
18
|
export interface LinearProgressProps {
|
|
19
|
+
/**
|
|
20
|
+
* Progress value (0-100).
|
|
21
|
+
*/
|
|
4
22
|
progress: number;
|
|
23
|
+
/**
|
|
24
|
+
* Height of the progress bar.
|
|
25
|
+
* @default 'md'
|
|
26
|
+
*/
|
|
5
27
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
6
28
|
className?: string;
|
|
7
29
|
}
|
|
@@ -9,8 +9,36 @@ export interface ModalCallbacks {
|
|
|
9
9
|
onClose?: () => void;
|
|
10
10
|
onCRTBootComplete?: () => void;
|
|
11
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
|
+
*/
|
|
12
34
|
export interface ModalProps extends ModalCallbacks {
|
|
35
|
+
/**
|
|
36
|
+
* Whether the modal is visible.
|
|
37
|
+
*/
|
|
13
38
|
isOpen: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when the modal requests to close.
|
|
41
|
+
*/
|
|
14
42
|
onClose: () => void;
|
|
15
43
|
title?: string;
|
|
16
44
|
children: React.ReactNode;
|
|
@@ -22,6 +50,10 @@ export interface ModalProps extends ModalCallbacks {
|
|
|
22
50
|
confirmLoading?: boolean;
|
|
23
51
|
showCancel?: boolean;
|
|
24
52
|
showConfirm?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Width of the modal.
|
|
55
|
+
* @default 'md'
|
|
56
|
+
*/
|
|
25
57
|
size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
|
|
26
58
|
closeOnOverlayClick?: boolean;
|
|
27
59
|
closeOnEscape?: boolean;
|
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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
|
+
*/
|
|
3
23
|
export interface NotificationProps {
|
|
24
|
+
/**
|
|
25
|
+
* Semantic type of the notification.
|
|
26
|
+
*/
|
|
4
27
|
type: 'success' | 'warning' | 'error';
|
|
5
28
|
title: string;
|
|
6
29
|
message: string;
|
|
30
|
+
/**
|
|
31
|
+
* Size of the notification.
|
|
32
|
+
* @default 'md'
|
|
33
|
+
*/
|
|
7
34
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
8
35
|
onClose?: () => void;
|
|
9
36
|
}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A circular progress indicator divided into segments.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Basic segmented progress
|
|
7
|
+
* <SegmentedProgress progress={30} />
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Segmented progress with center content
|
|
11
|
+
* <SegmentedProgress progress={80}>
|
|
12
|
+
* <div className="text-center">
|
|
13
|
+
* <div className="text-2xl font-bold text-accent">80%</div>
|
|
14
|
+
* <div className="text-xs text-muted">LOADED</div>
|
|
15
|
+
* </div>
|
|
16
|
+
* </SegmentedProgress>
|
|
17
|
+
*/
|
|
2
18
|
export interface SegmentedProgressProps {
|
|
19
|
+
/**
|
|
20
|
+
* Progress value (0-100).
|
|
21
|
+
*/
|
|
3
22
|
progress: number;
|
|
4
23
|
className?: string;
|
|
5
24
|
children?: React.ReactNode;
|
|
@@ -5,9 +5,38 @@ export interface SelectOption {
|
|
|
5
5
|
label: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* A styled dropdown selection component.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Basic select
|
|
13
|
+
* <Select
|
|
14
|
+
* label="Choose Sector"
|
|
15
|
+
* options={[
|
|
16
|
+
* { value: 'sector-7', label: 'Sector 7' },
|
|
17
|
+
* { value: 'sector-9', label: 'Sector 9' }
|
|
18
|
+
* ]}
|
|
19
|
+
* />
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Select with error
|
|
23
|
+
* <Select
|
|
24
|
+
* label="Clearance Level"
|
|
25
|
+
* error="Insufficient permissions"
|
|
26
|
+
* options={levels}
|
|
27
|
+
* />
|
|
28
|
+
*/
|
|
8
29
|
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
9
30
|
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Size of the select input.
|
|
33
|
+
* @default 'md'
|
|
34
|
+
*/
|
|
10
35
|
size?: ResponsiveValue<"sm" | "md" | "lg">;
|
|
36
|
+
/**
|
|
37
|
+
* Visual style variant.
|
|
38
|
+
* @default 'primary'
|
|
39
|
+
*/
|
|
11
40
|
variant?: "primary" | "secondary" | "danger" | "ghost";
|
|
12
41
|
options: SelectOption[];
|
|
13
42
|
placeholder?: string;
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ResponsiveValue } from '../utils/responsive';
|
|
3
|
+
/**
|
|
4
|
+
* A placeholder component for loading states.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Text skeleton
|
|
8
|
+
* <Skeleton variant="text" lines={3} />
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Avatar and text combination
|
|
12
|
+
* <Skeleton variant="avatar-text" size="lg" />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Custom rectangular skeleton
|
|
16
|
+
* <Skeleton
|
|
17
|
+
* variant="rectangular"
|
|
18
|
+
* width={200}
|
|
19
|
+
* height={150}
|
|
20
|
+
* animate={false}
|
|
21
|
+
* />
|
|
22
|
+
*/
|
|
3
23
|
export interface SkeletonProps {
|
|
24
|
+
/**
|
|
25
|
+
* Shape variant of the skeleton.
|
|
26
|
+
* @default 'text'
|
|
27
|
+
*/
|
|
4
28
|
variant?: "text" | "circular" | "rectangular" | "card" | "avatar-text" | "button-group";
|
|
29
|
+
/**
|
|
30
|
+
* Size of the skeleton element.
|
|
31
|
+
* @default 'md'
|
|
32
|
+
*/
|
|
5
33
|
size?: ResponsiveValue<"sm" | "md" | "lg">;
|
|
6
34
|
width?: string | number;
|
|
7
35
|
height?: string | number;
|
|
8
36
|
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Number of lines for text variant.
|
|
39
|
+
* @default 3
|
|
40
|
+
*/
|
|
9
41
|
lines?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to show the pulse animation.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
10
46
|
animate?: boolean;
|
|
11
47
|
}
|
|
12
48
|
declare const Skeleton: React.FC<SkeletonProps>;
|
|
@@ -1,11 +1,52 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ResponsiveValue } from '../utils/responsive';
|
|
3
3
|
export type TabNavigationMode = "scroll" | "wrap" | "dropdown" | "collapsible";
|
|
4
|
+
/**
|
|
5
|
+
* A responsive tab navigation component.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Basic tabs
|
|
9
|
+
* <TabNavigation
|
|
10
|
+
* tabs={['Home', 'Profile', 'Settings']}
|
|
11
|
+
* activeTab={activeTab}
|
|
12
|
+
* onTabChange={setActiveTab}
|
|
13
|
+
* />
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Tabs with dropdown mode for mobile
|
|
17
|
+
* <TabNavigation
|
|
18
|
+
* tabs={categories}
|
|
19
|
+
* activeTab={category}
|
|
20
|
+
* onTabChange={setCategory}
|
|
21
|
+
* mode="dropdown"
|
|
22
|
+
* dropdownLabel="Select Category"
|
|
23
|
+
* />
|
|
24
|
+
*/
|
|
4
25
|
export interface TabNavigationProps {
|
|
26
|
+
/**
|
|
27
|
+
* List of tab labels.
|
|
28
|
+
*/
|
|
5
29
|
tabs: readonly string[];
|
|
30
|
+
/**
|
|
31
|
+
* Currently active tab label.
|
|
32
|
+
*/
|
|
6
33
|
activeTab: string;
|
|
34
|
+
/**
|
|
35
|
+
* Callback when a tab is selected.
|
|
36
|
+
*/
|
|
7
37
|
onTabChange: (tab: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the tabs.
|
|
40
|
+
* @default 'md'
|
|
41
|
+
*/
|
|
8
42
|
size?: ResponsiveValue<"sm" | "md" | "lg">;
|
|
43
|
+
/**
|
|
44
|
+
* Responsive display mode.
|
|
45
|
+
* - `scroll`: Horizontal scrolling container.
|
|
46
|
+
* - `wrap`: Wraps to new lines.
|
|
47
|
+
* - `dropdown`: Collapses into a dropdown menu.
|
|
48
|
+
* @default 'scroll'
|
|
49
|
+
*/
|
|
9
50
|
mode?: ResponsiveValue<TabNavigationMode>;
|
|
10
51
|
containerClassName?: string;
|
|
11
52
|
tabsClassName?: string;
|
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ResponsiveValue } from '../utils/responsive';
|
|
3
|
+
/**
|
|
4
|
+
* A toggle switch component.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Basic toggle
|
|
8
|
+
* <Toggle
|
|
9
|
+
* label="Enable Notifications"
|
|
10
|
+
* checked={enabled}
|
|
11
|
+
* onChange={setEnabled}
|
|
12
|
+
* />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Large accent toggle
|
|
16
|
+
* <Toggle
|
|
17
|
+
* checked={isActive}
|
|
18
|
+
* onChange={toggle}
|
|
19
|
+
* size="lg"
|
|
20
|
+
* variant="accent"
|
|
21
|
+
* />
|
|
22
|
+
*/
|
|
3
23
|
export interface ToggleProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange'> {
|
|
4
24
|
label?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Size of the toggle.
|
|
27
|
+
* @default 'md'
|
|
28
|
+
*/
|
|
5
29
|
size?: ResponsiveValue<'sm' | 'md' | 'lg'>;
|
|
30
|
+
/**
|
|
31
|
+
* Visual style variant.
|
|
32
|
+
* @default 'primary'
|
|
33
|
+
*/
|
|
6
34
|
variant?: 'primary' | 'secondary' | 'accent';
|
|
7
35
|
className?: string;
|
|
8
36
|
checked?: boolean;
|