@oalacea/chaosui 0.4.0 → 0.5.1
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/buttons/cta-brutal/css/cta-brutal.module.css +175 -0
- package/buttons/cta-brutal/css/index.tsx +78 -0
- package/buttons/cta-brutal/tailwind/index.tsx +85 -0
- package/buttons/dead-button/css/dead-button.module.css +216 -0
- package/buttons/dead-button/css/index.tsx +47 -0
- package/buttons/dead-button/tailwind/index.tsx +90 -0
- package/buttons/deeper-button/css/deeper-button.module.css +141 -0
- package/buttons/deeper-button/css/index.tsx +62 -0
- package/buttons/deeper-button/tailwind/index.tsx +78 -0
- package/buttons/dual-choice/css/dual-choice.module.css +176 -0
- package/buttons/dual-choice/css/index.tsx +56 -0
- package/buttons/dual-choice/tailwind/index.tsx +89 -0
- package/buttons/tension-bar/css/index.tsx +96 -0
- package/buttons/tension-bar/css/tension-bar.module.css +204 -0
- package/buttons/tension-bar/tailwind/index.tsx +122 -0
- package/decorative/inscription/css/index.tsx +66 -0
- package/decorative/inscription/css/inscription.module.css +160 -0
- package/decorative/inscription/tailwind/index.tsx +91 -0
- package/decorative/ornaments/css/index.tsx +136 -0
- package/decorative/ornaments/css/ornaments.module.css +144 -0
- package/decorative/ornaments/tailwind/index.tsx +122 -0
- package/decorative/rune-symbols/css/index.tsx +116 -0
- package/decorative/rune-symbols/css/rune-symbols.module.css +116 -0
- package/decorative/rune-symbols/tailwind/index.tsx +108 -0
- package/decorative/sheet-music/css/index.tsx +144 -0
- package/decorative/sheet-music/css/sheet-music.module.css +152 -0
- package/decorative/sheet-music/tailwind/index.tsx +111 -0
- package/layout/horizontal-scroll/css/horizontal-scroll.module.css +93 -0
- package/layout/horizontal-scroll/css/index.tsx +114 -0
- package/layout/horizontal-scroll/tailwind/index.tsx +108 -0
- package/layout/spec-grid/css/index.tsx +103 -0
- package/layout/spec-grid/css/spec-grid.module.css +125 -0
- package/layout/spec-grid/tailwind/index.tsx +91 -0
- package/layout/tower-pricing/css/index.tsx +91 -0
- package/layout/tower-pricing/css/tower-pricing.module.css +177 -0
- package/layout/tower-pricing/tailwind/index.tsx +106 -0
- package/layout/tracklist/css/index.tsx +96 -0
- package/layout/tracklist/css/tracklist.module.css +141 -0
- package/layout/tracklist/tailwind/index.tsx +92 -0
- package/layout/void-frame/css/index.tsx +60 -0
- package/layout/void-frame/css/void-frame.module.css +141 -0
- package/layout/void-frame/tailwind/index.tsx +64 -0
- package/navigation/brutal-nav/css/brutal-nav.module.css +178 -0
- package/navigation/brutal-nav/css/index.tsx +80 -0
- package/navigation/brutal-nav/tailwind/index.tsx +95 -0
- package/navigation/progress-dots/css/index.tsx +60 -0
- package/navigation/progress-dots/css/progress-dots.module.css +152 -0
- package/navigation/progress-dots/tailwind/index.tsx +105 -0
- package/navigation/scattered-nav/css/index.tsx +59 -0
- package/navigation/scattered-nav/css/scattered-nav.module.css +121 -0
- package/navigation/scattered-nav/tailwind/index.tsx +77 -0
- package/navigation/scroll-indicator/css/index.tsx +72 -0
- package/navigation/scroll-indicator/css/scroll-indicator.module.css +129 -0
- package/navigation/scroll-indicator/tailwind/index.tsx +107 -0
- package/navigation/vertical-nav/css/index.tsx +69 -0
- package/navigation/vertical-nav/css/vertical-nav.module.css +117 -0
- package/navigation/vertical-nav/tailwind/index.tsx +91 -0
- package/package.json +8 -33
- package/text/ascii-art/css/ascii-art.module.css +173 -0
- package/text/ascii-art/css/index.tsx +116 -0
- package/text/ascii-art/tailwind/index.tsx +124 -0
- package/text/blood-drip/css/blood-drip.module.css +142 -0
- package/text/blood-drip/css/index.tsx +113 -0
- package/text/blood-drip/tailwind/index.tsx +133 -0
- package/text/char-glitch/css/char-glitch.module.css +124 -0
- package/text/char-glitch/css/index.tsx +153 -0
- package/text/char-glitch/tailwind/index.tsx +126 -0
- package/text/countdown-display/css/countdown-display.module.css +179 -0
- package/text/countdown-display/css/index.tsx +190 -0
- package/text/countdown-display/tailwind/index.tsx +155 -0
- package/text/giant-layers/css/giant-layers.module.css +156 -0
- package/text/giant-layers/css/index.tsx +97 -0
- package/text/giant-layers/tailwind/index.tsx +111 -0
- package/text/reveal-text/css/index.tsx +180 -0
- package/text/reveal-text/css/reveal-text.module.css +129 -0
- package/text/reveal-text/tailwind/index.tsx +135 -0
- package/text/rotate-text/css/index.tsx +139 -0
- package/text/rotate-text/css/rotate-text.module.css +162 -0
- package/text/rotate-text/tailwind/index.tsx +127 -0
- package/text/strike-reveal/css/index.tsx +124 -0
- package/text/strike-reveal/css/strike-reveal.module.css +139 -0
- package/text/strike-reveal/tailwind/index.tsx +138 -0
- package/text/terminal-output/css/index.tsx +179 -0
- package/text/terminal-output/css/terminal-output.module.css +203 -0
- package/text/terminal-output/tailwind/index.tsx +174 -0
- package/text/typing-text/css/index.tsx +115 -0
- package/text/typing-text/css/typing-text.module.css +84 -0
- package/text/typing-text/tailwind/index.tsx +126 -0
- package/bin/cli.js +0 -278
- package/components/backgrounds/light-beams/index.tsx +0 -80
- package/components/backgrounds/light-beams/light-beams.module.css +0 -27
- package/components/navigation/hexagon-menu/css/hexagon-menu.module.css +0 -55
- package/components/navigation/hexagon-menu/css/index.tsx +0 -35
- package/components/navigation/hexagon-menu/tailwind/index.tsx +0 -53
- /package/{components/backgrounds → backgrounds}/glow-orbs/glow-orbs.module.css +0 -0
- /package/{components/backgrounds → backgrounds}/glow-orbs/index.tsx +0 -0
- /package/{components/backgrounds → backgrounds}/noise-canvas/index.tsx +0 -0
- /package/{components/backgrounds → backgrounds}/noise-canvas/noise-canvas.module.css +0 -0
- /package/{components/backgrounds → backgrounds}/particle-field/index.tsx +0 -0
- /package/{components/backgrounds → backgrounds}/particle-field/particle-field.module.css +0 -0
- /package/{components/buttons → buttons}/chaos-button/chaos-button.module.css +0 -0
- /package/{components/buttons → buttons}/chaos-button/index.tsx +0 -0
- /package/{components/buttons → buttons}/glitch-button/glitch-button.module.css +0 -0
- /package/{components/buttons → buttons}/glitch-button/index.tsx +0 -0
- /package/{components/chaos-vars.css → chaos-vars.css} +0 -0
- /package/{components/cyber → cyber}/cyber-avatar/css/cyber-avatar.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-avatar/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-avatar/tailwind/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-input/css/cyber-input.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-input/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-input/tailwind/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-loader/css/cyber-loader.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-loader/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-loader/tailwind/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-modal/css/cyber-modal.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-modal/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-modal/tailwind/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-slider/css/cyber-slider.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-slider/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-slider/tailwind/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-tooltip/css/cyber-tooltip.module.css +0 -0
- /package/{components/cyber → cyber}/cyber-tooltip/css/index.tsx +0 -0
- /package/{components/cyber → cyber}/cyber-tooltip/tailwind/index.tsx +0 -0
- /package/{components/effects → effects}/cursor-follower/cursor-follower.module.css +0 -0
- /package/{components/effects → effects}/cursor-follower/index.tsx +0 -0
- /package/{components/effects → effects}/glitch-image/css/glitch-image.module.css +0 -0
- /package/{components/effects → effects}/glitch-image/css/index.tsx +0 -0
- /package/{components/effects → effects}/glitch-image/tailwind/index.tsx +0 -0
- /package/{components/effects → effects}/glowing-border/css/glowing-border.module.css +0 -0
- /package/{components/effects → effects}/glowing-border/css/index.tsx +0 -0
- /package/{components/effects → effects}/glowing-border/tailwind/index.tsx +0 -0
- /package/{components/effects → effects}/screen-distortion/index.tsx +0 -0
- /package/{components/effects → effects}/screen-distortion/screen-distortion.module.css +0 -0
- /package/{components/effects → effects}/warning-tape/index.tsx +0 -0
- /package/{components/effects → effects}/warning-tape/warning-tape.module.css +0 -0
- /package/{components/layout → layout}/data-grid/css/data-grid.module.css +0 -0
- /package/{components/layout → layout}/data-grid/css/index.tsx +0 -0
- /package/{components/layout → layout}/data-grid/tailwind/index.tsx +0 -0
- /package/{components/layout → layout}/hologram-card/css/hologram-card.module.css +0 -0
- /package/{components/layout → layout}/hologram-card/css/index.tsx +0 -0
- /package/{components/layout → layout}/hologram-card/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-alert/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-alert/css/neon-alert.module.css +0 -0
- /package/{components/neon → neon}/neon-alert/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-badge/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-badge/css/neon-badge.module.css +0 -0
- /package/{components/neon → neon}/neon-badge/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-button/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-button/css/neon-button.module.css +0 -0
- /package/{components/neon → neon}/neon-button/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-divider/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-divider/css/neon-divider.module.css +0 -0
- /package/{components/neon → neon}/neon-divider/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-progress/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-progress/css/neon-progress.module.css +0 -0
- /package/{components/neon → neon}/neon-progress/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-tabs/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-tabs/css/neon-tabs.module.css +0 -0
- /package/{components/neon → neon}/neon-tabs/tailwind/index.tsx +0 -0
- /package/{components/neon → neon}/neon-toggle/css/index.tsx +0 -0
- /package/{components/neon → neon}/neon-toggle/css/neon-toggle.module.css +0 -0
- /package/{components/neon → neon}/neon-toggle/tailwind/index.tsx +0 -0
- /package/{components/overlays → overlays}/noise-overlay/index.tsx +0 -0
- /package/{components/overlays → overlays}/noise-overlay/noise-overlay.module.css +0 -0
- /package/{components/overlays → overlays}/scanlines/index.tsx +0 -0
- /package/{components/overlays → overlays}/scanlines/scanlines.module.css +0 -0
- /package/{components/overlays → overlays}/static-flicker/index.tsx +0 -0
- /package/{components/overlays → overlays}/static-flicker/static-flicker.module.css +0 -0
- /package/{components/overlays → overlays}/vignette/index.tsx +0 -0
- /package/{components/overlays → overlays}/vignette/vignette.module.css +0 -0
- /package/{components/text → text}/distortion-text/distortion-text.module.css +0 -0
- /package/{components/text → text}/distortion-text/index.tsx +0 -0
- /package/{components/text → text}/falling-text/falling-text.module.css +0 -0
- /package/{components/text → text}/falling-text/index.tsx +0 -0
- /package/{components/text → text}/flicker-text/flicker-text.module.css +0 -0
- /package/{components/text → text}/flicker-text/index.tsx +0 -0
- /package/{components/text → text}/glitch-text/glitch-text.module.css +0 -0
- /package/{components/text → text}/glitch-text/index.tsx +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-family: 'Courier New', 'Monaco', monospace;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.text {
|
|
8
|
+
display: inline;
|
|
9
|
+
white-space: pre-wrap;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cursor {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
width: 0.6em;
|
|
15
|
+
height: 1.1em;
|
|
16
|
+
background: currentColor;
|
|
17
|
+
margin-left: 2px;
|
|
18
|
+
vertical-align: text-bottom;
|
|
19
|
+
animation: blink 1s step-end infinite;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cursor.block {
|
|
23
|
+
width: 0.6em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cursor.line {
|
|
27
|
+
width: 2px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cursor.underscore {
|
|
31
|
+
width: 0.6em;
|
|
32
|
+
height: 2px;
|
|
33
|
+
vertical-align: baseline;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cursorHidden {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Variants */
|
|
41
|
+
.terminal {
|
|
42
|
+
color: #00ff00;
|
|
43
|
+
text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff0080;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.terminal .cursor {
|
|
47
|
+
background: #00ff00;
|
|
48
|
+
box-shadow: 0 0 5px #00ff00, 0 0 10px #00ff0080;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hacker {
|
|
52
|
+
color: #ff0040;
|
|
53
|
+
text-shadow: 0 0 5px #ff0040, 0 0 15px #ff004080;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.hacker .cursor {
|
|
57
|
+
background: #ff0040;
|
|
58
|
+
box-shadow: 0 0 5px #ff0040;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cyber {
|
|
62
|
+
color: #00ffff;
|
|
63
|
+
text-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff80;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.cyber .cursor {
|
|
67
|
+
background: #00ffff;
|
|
68
|
+
box-shadow: 0 0 5px #00ffff;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ghost {
|
|
72
|
+
color: #888;
|
|
73
|
+
opacity: 0.8;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ghost .cursor {
|
|
77
|
+
background: #888;
|
|
78
|
+
animation: blink 2s step-end infinite;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes blink {
|
|
82
|
+
0%, 100% { opacity: 1; }
|
|
83
|
+
50% { opacity: 0; }
|
|
84
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { forwardRef, HTMLAttributes, useEffect, useState, useCallback } from 'react';
|
|
4
|
+
|
|
5
|
+
export interface TypingTextProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
6
|
+
text: string;
|
|
7
|
+
speed?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
showCursor?: boolean;
|
|
10
|
+
cursorStyle?: 'block' | 'line' | 'underscore';
|
|
11
|
+
variant?: 'default' | 'terminal' | 'hacker' | 'cyber' | 'ghost';
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
loopDelay?: number;
|
|
14
|
+
deleteSpeed?: number;
|
|
15
|
+
onComplete?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const variantStyles = {
|
|
19
|
+
default: '',
|
|
20
|
+
terminal: 'text-green-400 drop-shadow-[0_0_5px_#00ff00]',
|
|
21
|
+
hacker: 'text-rose-500 drop-shadow-[0_0_5px_#ff0040]',
|
|
22
|
+
cyber: 'text-cyan-400 drop-shadow-[0_0_5px_#00ffff]',
|
|
23
|
+
ghost: 'text-gray-500 opacity-80',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const cursorVariants = {
|
|
27
|
+
default: 'bg-current',
|
|
28
|
+
terminal: 'bg-green-400 shadow-[0_0_5px_#00ff00]',
|
|
29
|
+
hacker: 'bg-rose-500 shadow-[0_0_5px_#ff0040]',
|
|
30
|
+
cyber: 'bg-cyan-400 shadow-[0_0_5px_#00ffff]',
|
|
31
|
+
ghost: 'bg-gray-500',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const cursorSizes = {
|
|
35
|
+
block: 'w-[0.6em] h-[1.1em]',
|
|
36
|
+
line: 'w-0.5 h-[1.1em]',
|
|
37
|
+
underscore: 'w-[0.6em] h-0.5',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const TypingText = forwardRef<HTMLSpanElement, TypingTextProps>(
|
|
41
|
+
(
|
|
42
|
+
{
|
|
43
|
+
text,
|
|
44
|
+
speed = 50,
|
|
45
|
+
delay = 0,
|
|
46
|
+
showCursor = true,
|
|
47
|
+
cursorStyle = 'block',
|
|
48
|
+
variant = 'default',
|
|
49
|
+
loop = false,
|
|
50
|
+
loopDelay = 2000,
|
|
51
|
+
deleteSpeed = 30,
|
|
52
|
+
onComplete,
|
|
53
|
+
className = '',
|
|
54
|
+
...props
|
|
55
|
+
},
|
|
56
|
+
ref
|
|
57
|
+
) => {
|
|
58
|
+
const [displayText, setDisplayText] = useState('');
|
|
59
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
60
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
61
|
+
|
|
62
|
+
const typeText = useCallback(() => {
|
|
63
|
+
setIsTyping(true);
|
|
64
|
+
let index = 0;
|
|
65
|
+
|
|
66
|
+
const typeInterval = setInterval(() => {
|
|
67
|
+
if (index < text.length) {
|
|
68
|
+
setDisplayText(text.slice(0, index + 1));
|
|
69
|
+
index++;
|
|
70
|
+
} else {
|
|
71
|
+
clearInterval(typeInterval);
|
|
72
|
+
setIsTyping(false);
|
|
73
|
+
|
|
74
|
+
if (loop) {
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
setIsDeleting(true);
|
|
77
|
+
let deleteIndex = text.length;
|
|
78
|
+
|
|
79
|
+
const deleteInterval = setInterval(() => {
|
|
80
|
+
if (deleteIndex > 0) {
|
|
81
|
+
setDisplayText(text.slice(0, deleteIndex - 1));
|
|
82
|
+
deleteIndex--;
|
|
83
|
+
} else {
|
|
84
|
+
clearInterval(deleteInterval);
|
|
85
|
+
setIsDeleting(false);
|
|
86
|
+
setTimeout(typeText, delay);
|
|
87
|
+
}
|
|
88
|
+
}, deleteSpeed);
|
|
89
|
+
}, loopDelay);
|
|
90
|
+
} else {
|
|
91
|
+
onComplete?.();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, speed);
|
|
95
|
+
|
|
96
|
+
return () => clearInterval(typeInterval);
|
|
97
|
+
}, [text, speed, loop, loopDelay, deleteSpeed, delay, onComplete]);
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const timeout = setTimeout(typeText, delay);
|
|
101
|
+
return () => clearTimeout(timeout);
|
|
102
|
+
}, [typeText, delay]);
|
|
103
|
+
|
|
104
|
+
const showBlinkingCursor = isTyping || isDeleting || loop;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<span
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={`inline-block font-mono ${variantStyles[variant]} ${className}`}
|
|
110
|
+
{...props}
|
|
111
|
+
>
|
|
112
|
+
<span className="whitespace-pre-wrap">{displayText}</span>
|
|
113
|
+
{showCursor && (
|
|
114
|
+
<span
|
|
115
|
+
className={`inline-block ml-0.5 align-text-bottom ${cursorSizes[cursorStyle]} ${cursorVariants[variant]} ${
|
|
116
|
+
showBlinkingCursor ? 'animate-pulse' : 'opacity-0'
|
|
117
|
+
}`}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
120
|
+
</span>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
TypingText.displayName = 'TypingText';
|
|
126
|
+
export default TypingText;
|
package/bin/cli.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import pc from 'picocolors';
|
|
5
|
-
import prompts from 'prompts';
|
|
6
|
-
import fs from 'fs-extra';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const __dirname = path.dirname(__filename);
|
|
12
|
-
const COMPONENTS_DIR = path.join(__dirname, '..', 'components');
|
|
13
|
-
|
|
14
|
-
// Component registry
|
|
15
|
-
const COMPONENTS = {
|
|
16
|
-
// Overlays
|
|
17
|
-
'noise-overlay': { category: 'overlays', description: 'SVG fractal noise texture overlay', status: 'ready' },
|
|
18
|
-
'scanlines': { category: 'overlays', description: 'CRT-style horizontal scanlines', status: 'ready' },
|
|
19
|
-
'vignette': { category: 'overlays', description: 'Dark edges radial gradient', status: 'ready' },
|
|
20
|
-
'static-flicker': { category: 'overlays', description: 'Animated noise with flicker effect', status: 'ready' },
|
|
21
|
-
|
|
22
|
-
// Text effects
|
|
23
|
-
'glitch-text': { category: 'text', description: 'RGB split glitch text effect', status: 'ready' },
|
|
24
|
-
'flicker-text': { category: 'text', description: 'Text that flickers randomly', status: 'ready' },
|
|
25
|
-
'distortion-text': { category: 'text', description: 'Wave/shake/skew/blur text effects', status: 'ready' },
|
|
26
|
-
'falling-text': { category: 'text', description: 'Letters falling in cascade', status: 'ready' },
|
|
27
|
-
|
|
28
|
-
// Buttons
|
|
29
|
-
'glitch-button': { category: 'buttons', description: 'Button with glitch hover effect', status: 'ready' },
|
|
30
|
-
'chaos-button': { category: 'buttons', description: 'Chaotic animated button with debris', status: 'ready' },
|
|
31
|
-
|
|
32
|
-
// Backgrounds
|
|
33
|
-
'noise-canvas': { category: 'backgrounds', description: 'Animated noise canvas background', status: 'ready' },
|
|
34
|
-
'light-beams': { category: 'backgrounds', description: 'Vertical colored light beams', status: 'ready' },
|
|
35
|
-
'glow-orbs': { category: 'backgrounds', description: 'Floating blurred orbs', status: 'ready' },
|
|
36
|
-
'particle-field': { category: 'backgrounds', description: 'Drifting particle background', status: 'ready' },
|
|
37
|
-
|
|
38
|
-
// Effects
|
|
39
|
-
'warning-tape': { category: 'effects', description: 'Scrolling warning tape banner', status: 'ready' },
|
|
40
|
-
'cursor-follower': { category: 'effects', description: 'Custom cursor with trail', status: 'ready' },
|
|
41
|
-
'screen-distortion': { category: 'effects', description: 'Full screen distortion effect', status: 'ready' },
|
|
42
|
-
'glowing-border': { category: 'effects', description: 'Glowing border container with pulse', status: 'ready' },
|
|
43
|
-
|
|
44
|
-
// Neon components
|
|
45
|
-
'neon-button': { category: 'neon', description: 'Button with neon glow effect', status: 'ready' },
|
|
46
|
-
'neon-badge': { category: 'neon', description: 'Luminous status badges', status: 'ready' },
|
|
47
|
-
'neon-progress': { category: 'neon', description: 'Glowing progress bar with shimmer', status: 'ready' },
|
|
48
|
-
'neon-toggle': { category: 'neon', description: 'On/off switch with neon glow', status: 'ready' },
|
|
49
|
-
'neon-alert': { category: 'neon', description: 'Alert notifications with neon style', status: 'ready' },
|
|
50
|
-
'neon-tabs': { category: 'neon', description: 'Tab navigation with glow effect', status: 'ready' },
|
|
51
|
-
'neon-divider': { category: 'neon', description: 'Luminous section dividers', status: 'ready' },
|
|
52
|
-
|
|
53
|
-
// Cyber components
|
|
54
|
-
'cyber-input': { category: 'cyber', description: 'Input with animated border glow', status: 'ready' },
|
|
55
|
-
'cyber-loader': { category: 'cyber', description: 'Futuristic spinners and loaders', status: 'ready' },
|
|
56
|
-
'cyber-modal': { category: 'cyber', description: 'Modal with scanlines and glow', status: 'ready' },
|
|
57
|
-
'cyber-avatar': { category: 'cyber', description: 'Avatar with neon border and status', status: 'ready' },
|
|
58
|
-
'cyber-slider': { category: 'cyber', description: 'Slider with neon track and thumb', status: 'ready' },
|
|
59
|
-
'cyber-tooltip': { category: 'cyber', description: 'Terminal-style tooltips', status: 'ready' },
|
|
60
|
-
|
|
61
|
-
// Layout components
|
|
62
|
-
'hologram-card': { category: 'layout', description: 'Holographic card with scanlines', status: 'ready' },
|
|
63
|
-
'data-grid': { category: 'layout', description: 'Terminal-style data table', status: 'ready' },
|
|
64
|
-
|
|
65
|
-
// Navigation
|
|
66
|
-
'hexagon-menu': { category: 'navigation', description: 'Honeycomb hexagon menu', status: 'ready' },
|
|
67
|
-
|
|
68
|
-
// Effects (new)
|
|
69
|
-
'glitch-image': { category: 'effects', description: 'Image with RGB glitch on hover', status: 'ready' },
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const program = new Command();
|
|
73
|
-
|
|
74
|
-
program
|
|
75
|
-
.name('chaos-ui')
|
|
76
|
-
.description('Add glitch & noise components to your project')
|
|
77
|
-
.version('0.1.0');
|
|
78
|
-
|
|
79
|
-
// LIST command
|
|
80
|
-
program
|
|
81
|
-
.command('list')
|
|
82
|
-
.description('List all available components')
|
|
83
|
-
.action(() => {
|
|
84
|
-
console.log(pc.bold('\n🗡️ Chaos UI Components\n'));
|
|
85
|
-
|
|
86
|
-
const categories = {};
|
|
87
|
-
for (const [name, info] of Object.entries(COMPONENTS)) {
|
|
88
|
-
if (!categories[info.category]) categories[info.category] = [];
|
|
89
|
-
categories[info.category].push({ name, ...info });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
for (const [category, components] of Object.entries(categories)) {
|
|
93
|
-
console.log(pc.cyan(` ${category}/`));
|
|
94
|
-
for (const comp of components) {
|
|
95
|
-
console.log(` ${pc.white(comp.name.padEnd(20))} ${pc.dim(comp.description)}`);
|
|
96
|
-
}
|
|
97
|
-
console.log();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// ADD command
|
|
102
|
-
program
|
|
103
|
-
.command('add [component]')
|
|
104
|
-
.description('Add a component to your project')
|
|
105
|
-
.option('-d, --dir <path>', 'Target directory', './components/chaos')
|
|
106
|
-
.option('-v, --variant <type>', 'Styling variant: css or tailwind', 'css')
|
|
107
|
-
.option('-y, --yes', 'Skip confirmation')
|
|
108
|
-
.action(async (componentName, options) => {
|
|
109
|
-
const variant = options.variant.toLowerCase();
|
|
110
|
-
if (!['css', 'tailwind'].includes(variant)) {
|
|
111
|
-
console.log(pc.red(`\n✗ Invalid variant "${variant}". Use 'css' or 'tailwind'.\n`));
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// If no component specified, show interactive picker
|
|
116
|
-
if (!componentName) {
|
|
117
|
-
const choices = Object.entries(COMPONENTS).map(([name, info]) => ({
|
|
118
|
-
title: name,
|
|
119
|
-
description: info.description,
|
|
120
|
-
value: name,
|
|
121
|
-
}));
|
|
122
|
-
|
|
123
|
-
const response = await prompts([
|
|
124
|
-
{
|
|
125
|
-
type: 'autocomplete',
|
|
126
|
-
name: 'component',
|
|
127
|
-
message: 'Which component?',
|
|
128
|
-
choices,
|
|
129
|
-
suggest: (input, choices) =>
|
|
130
|
-
choices.filter(c => c.title.includes(input) || c.description.toLowerCase().includes(input.toLowerCase()))
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: 'select',
|
|
134
|
-
name: 'variant',
|
|
135
|
-
message: 'Styling variant?',
|
|
136
|
-
choices: [
|
|
137
|
-
{ title: 'CSS Modules', value: 'css' },
|
|
138
|
-
{ title: 'Tailwind', value: 'tailwind' },
|
|
139
|
-
],
|
|
140
|
-
initial: variant === 'tailwind' ? 1 : 0,
|
|
141
|
-
}
|
|
142
|
-
]);
|
|
143
|
-
|
|
144
|
-
if (!response.component) {
|
|
145
|
-
console.log(pc.dim('Cancelled.'));
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
componentName = response.component;
|
|
149
|
-
options.variant = response.variant || variant;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Validate component exists
|
|
153
|
-
if (!COMPONENTS[componentName]) {
|
|
154
|
-
console.log(pc.red(`\n✗ Component "${componentName}" not found.`));
|
|
155
|
-
console.log(pc.dim(` Run ${pc.white('chaos-ui list')} to see available components.\n`));
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const info = COMPONENTS[componentName];
|
|
160
|
-
const baseDir = path.join(COMPONENTS_DIR, info.category, componentName);
|
|
161
|
-
|
|
162
|
-
// Check if component has variant subdirs or is legacy (flat structure)
|
|
163
|
-
const variantDir = path.join(baseDir, options.variant);
|
|
164
|
-
const hasVariants = fs.existsSync(path.join(baseDir, 'css')) || fs.existsSync(path.join(baseDir, 'tailwind'));
|
|
165
|
-
const sourceDir = hasVariants ? variantDir : baseDir;
|
|
166
|
-
const targetDir = path.resolve(options.dir, info.category);
|
|
167
|
-
|
|
168
|
-
// Check source exists
|
|
169
|
-
if (!fs.existsSync(sourceDir)) {
|
|
170
|
-
if (hasVariants) {
|
|
171
|
-
console.log(pc.yellow(`\n⚠ Variant "${options.variant}" not available for "${componentName}".`));
|
|
172
|
-
const available = [];
|
|
173
|
-
if (fs.existsSync(path.join(baseDir, 'css'))) available.push('css');
|
|
174
|
-
if (fs.existsSync(path.join(baseDir, 'tailwind'))) available.push('tailwind');
|
|
175
|
-
console.log(pc.dim(` Available variants: ${available.join(', ')}\n`));
|
|
176
|
-
} else {
|
|
177
|
-
console.log(pc.yellow(`\n⚠ Component "${componentName}" is not yet implemented.`));
|
|
178
|
-
console.log(pc.dim(' Coming soon!\n'));
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Confirm
|
|
184
|
-
if (!options.yes) {
|
|
185
|
-
const variantLabel = hasVariants ? ` (${pc.magenta(options.variant)})` : '';
|
|
186
|
-
const confirm = await prompts({
|
|
187
|
-
type: 'confirm',
|
|
188
|
-
name: 'value',
|
|
189
|
-
message: `Add ${pc.cyan(componentName)}${variantLabel} to ${pc.dim(targetDir)}?`,
|
|
190
|
-
initial: true,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
if (!confirm.value) {
|
|
194
|
-
console.log(pc.dim('Cancelled.'));
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Copy files
|
|
200
|
-
try {
|
|
201
|
-
await fs.ensureDir(targetDir);
|
|
202
|
-
await fs.copy(sourceDir, path.join(targetDir, componentName));
|
|
203
|
-
|
|
204
|
-
console.log(pc.green(`\n✓ Added ${componentName}`) + (hasVariants ? pc.magenta(` (${options.variant})`) : ''));
|
|
205
|
-
console.log(pc.dim(` → ${path.join(targetDir, componentName)}\n`));
|
|
206
|
-
|
|
207
|
-
// Show usage hint
|
|
208
|
-
const pascalName = componentName
|
|
209
|
-
.split('-')
|
|
210
|
-
.map(s => s.charAt(0).toUpperCase() + s.slice(1))
|
|
211
|
-
.join('');
|
|
212
|
-
|
|
213
|
-
console.log(pc.dim(' Import:'));
|
|
214
|
-
console.log(pc.white(` import { ${pascalName} } from './components/chaos/${info.category}/${componentName}';\n`));
|
|
215
|
-
|
|
216
|
-
} catch (err) {
|
|
217
|
-
console.log(pc.red(`\n✗ Failed to add component: ${err.message}\n`));
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
// INIT command
|
|
222
|
-
program
|
|
223
|
-
.command('init')
|
|
224
|
-
.description('Initialize chaos-ui in your project')
|
|
225
|
-
.action(async () => {
|
|
226
|
-
console.log(pc.bold('\n🗡️ Initializing Chaos UI...\n'));
|
|
227
|
-
|
|
228
|
-
const response = await prompts([
|
|
229
|
-
{
|
|
230
|
-
type: 'select',
|
|
231
|
-
name: 'framework',
|
|
232
|
-
message: 'Framework?',
|
|
233
|
-
choices: [
|
|
234
|
-
{ title: 'React', value: 'react' },
|
|
235
|
-
{ title: 'Vue', value: 'vue' },
|
|
236
|
-
{ title: 'Vanilla (HTML/CSS/JS)', value: 'vanilla' },
|
|
237
|
-
],
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
type: 'select',
|
|
241
|
-
name: 'styling',
|
|
242
|
-
message: 'Styling?',
|
|
243
|
-
choices: [
|
|
244
|
-
{ title: 'CSS Modules', value: 'css-modules' },
|
|
245
|
-
{ title: 'Plain CSS', value: 'css' },
|
|
246
|
-
{ title: 'Tailwind (with CSS vars)', value: 'tailwind' },
|
|
247
|
-
],
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
type: 'text',
|
|
251
|
-
name: 'dir',
|
|
252
|
-
message: 'Components directory?',
|
|
253
|
-
initial: './components/chaos',
|
|
254
|
-
},
|
|
255
|
-
]);
|
|
256
|
-
|
|
257
|
-
if (!response.framework) {
|
|
258
|
-
console.log(pc.dim('Cancelled.'));
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Create config file
|
|
263
|
-
const config = {
|
|
264
|
-
framework: response.framework,
|
|
265
|
-
styling: response.styling,
|
|
266
|
-
componentsDir: response.dir,
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
await fs.writeJson('./chaos-ui.json', config, { spaces: 2 });
|
|
270
|
-
await fs.ensureDir(response.dir);
|
|
271
|
-
|
|
272
|
-
console.log(pc.green('\n✓ Initialized!'));
|
|
273
|
-
console.log(pc.dim(` Config: ${pc.white('./chaos-ui.json')}`));
|
|
274
|
-
console.log(pc.dim(` Components: ${pc.white(response.dir)}\n`));
|
|
275
|
-
console.log(pc.dim(` Run ${pc.white('chaos-ui add <component>')} to add components.\n`));
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
program.parse();
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { forwardRef, HTMLAttributes } from 'react';
|
|
4
|
-
import styles from './light-beams.module.css';
|
|
5
|
-
|
|
6
|
-
export interface LightBeamsProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/** Array of beam colors */
|
|
8
|
-
colors?: string[];
|
|
9
|
-
/** Number of beams */
|
|
10
|
-
count?: number;
|
|
11
|
-
/** Beam width in pixels */
|
|
12
|
-
beamWidth?: number;
|
|
13
|
-
/** Beam opacity (0-1) */
|
|
14
|
-
opacity?: number;
|
|
15
|
-
/** Animation duration range [min, max] in seconds */
|
|
16
|
-
durationRange?: [number, number];
|
|
17
|
-
/** Fixed or absolute positioning */
|
|
18
|
-
position?: 'fixed' | 'absolute';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const LightBeams = forwardRef<HTMLDivElement, LightBeamsProps>(
|
|
22
|
-
(
|
|
23
|
-
{
|
|
24
|
-
colors = ['#7c3aed', '#06b6d4', '#ec4899', '#10b981', '#f59e0b'],
|
|
25
|
-
count = 5,
|
|
26
|
-
beamWidth = 2,
|
|
27
|
-
opacity = 0.15,
|
|
28
|
-
durationRange = [15, 25],
|
|
29
|
-
position = 'fixed',
|
|
30
|
-
className,
|
|
31
|
-
style,
|
|
32
|
-
...props
|
|
33
|
-
},
|
|
34
|
-
ref
|
|
35
|
-
) => {
|
|
36
|
-
const beams = Array.from({ length: count }, (_, i) => {
|
|
37
|
-
const duration = durationRange[0] + Math.random() * (durationRange[1] - durationRange[0]);
|
|
38
|
-
const delay = Math.random() * -duration;
|
|
39
|
-
const color = colors[i % colors.length];
|
|
40
|
-
const positionX = ((i + 1) / (count + 1)) * 100;
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
id: i,
|
|
44
|
-
duration,
|
|
45
|
-
delay,
|
|
46
|
-
color,
|
|
47
|
-
positionX,
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<div
|
|
53
|
-
ref={ref}
|
|
54
|
-
className={`${styles.container} ${className || ''}`}
|
|
55
|
-
style={{ position, ...style }}
|
|
56
|
-
aria-hidden="true"
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
{beams.map((beam) => (
|
|
60
|
-
<div
|
|
61
|
-
key={beam.id}
|
|
62
|
-
className={styles.beam}
|
|
63
|
-
style={{
|
|
64
|
-
left: `${beam.positionX}%`,
|
|
65
|
-
width: beamWidth,
|
|
66
|
-
background: `linear-gradient(180deg, transparent, ${beam.color}, transparent)`,
|
|
67
|
-
opacity,
|
|
68
|
-
animationDuration: `${beam.duration}s`,
|
|
69
|
-
animationDelay: `${beam.delay}s`,
|
|
70
|
-
}}
|
|
71
|
-
/>
|
|
72
|
-
))}
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
LightBeams.displayName = 'LightBeams';
|
|
79
|
-
|
|
80
|
-
export default LightBeams;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
inset: 0;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
pointer-events: none;
|
|
7
|
-
z-index: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.beam {
|
|
11
|
-
position: absolute;
|
|
12
|
-
top: 0;
|
|
13
|
-
height: 100%;
|
|
14
|
-
filter: blur(1px);
|
|
15
|
-
animation: beam-move 20s ease-in-out infinite;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@keyframes beam-move {
|
|
19
|
-
0%, 100% {
|
|
20
|
-
transform: translateX(-50px) skewX(-5deg);
|
|
21
|
-
opacity: 0.1;
|
|
22
|
-
}
|
|
23
|
-
50% {
|
|
24
|
-
transform: translateX(50px) skewX(5deg);
|
|
25
|
-
opacity: 0.2;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.menu {
|
|
2
|
-
--hex-color: #00f0ff;
|
|
3
|
-
--hex-size: 5rem;
|
|
4
|
-
--hex-offset: 2.5rem;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-wrap: wrap;
|
|
7
|
-
gap: 0.5rem;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.cyan { --hex-color: #00f0ff; }
|
|
12
|
-
.pink { --hex-color: #ff00ff; }
|
|
13
|
-
.green { --hex-color: #00ff88; }
|
|
14
|
-
.purple { --hex-color: #a855f7; }
|
|
15
|
-
|
|
16
|
-
.sm { --hex-size: 3.75rem; --hex-offset: 1.875rem; }
|
|
17
|
-
.md { --hex-size: 5rem; --hex-offset: 2.5rem; }
|
|
18
|
-
.lg { --hex-size: 6.25rem; --hex-offset: 3.125rem; }
|
|
19
|
-
|
|
20
|
-
.item {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: var(--hex-size);
|
|
26
|
-
height: calc(var(--hex-size) * 1.1547);
|
|
27
|
-
padding: 0.5rem;
|
|
28
|
-
background: rgba(0, 0, 0, 0.6);
|
|
29
|
-
border: 2px solid var(--hex-color);
|
|
30
|
-
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
transition: all 0.3s ease;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.item:hover {
|
|
36
|
-
background: rgba(0, 240, 255, 0.2);
|
|
37
|
-
box-shadow: 0 0 20px var(--hex-color);
|
|
38
|
-
transform: scale(1.1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.icon {
|
|
42
|
-
font-size: calc(var(--hex-size) / 3);
|
|
43
|
-
color: var(--hex-color);
|
|
44
|
-
margin-bottom: 0.25rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.label {
|
|
48
|
-
font-family: var(--font-display, 'Orbitron', sans-serif);
|
|
49
|
-
font-size: 0.5625rem;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
text-transform: uppercase;
|
|
52
|
-
letter-spacing: 0.0625em;
|
|
53
|
-
color: rgba(255, 255, 255, 0.9);
|
|
54
|
-
text-align: center;
|
|
55
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { forwardRef, HTMLAttributes } from 'react';
|
|
4
|
-
import styles from './hexagon-menu.module.css';
|
|
5
|
-
|
|
6
|
-
export interface HexagonMenuItem {
|
|
7
|
-
id: string;
|
|
8
|
-
label: string;
|
|
9
|
-
icon?: React.ReactNode;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface HexagonMenuProps extends HTMLAttributes<HTMLElement> {
|
|
14
|
-
items: HexagonMenuItem[];
|
|
15
|
-
variant?: 'cyan' | 'pink' | 'green' | 'purple';
|
|
16
|
-
size?: 'sm' | 'md' | 'lg';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const HexagonMenu = forwardRef<HTMLElement, HexagonMenuProps>(
|
|
20
|
-
({ items, variant = 'cyan', size = 'md', className, ...props }, ref) => {
|
|
21
|
-
return (
|
|
22
|
-
<nav ref={ref} className={`${styles.menu} ${styles[variant]} ${styles[size]} ${className || ''}`} {...props}>
|
|
23
|
-
{items.map((item, i) => (
|
|
24
|
-
<button key={item.id} className={styles.item} onClick={item.onClick} style={{ marginTop: i % 2 === 1 ? 'var(--hex-offset)' : 0 }}>
|
|
25
|
-
{item.icon && <span className={styles.icon}>{item.icon}</span>}
|
|
26
|
-
<span className={styles.label}>{item.label}</span>
|
|
27
|
-
</button>
|
|
28
|
-
))}
|
|
29
|
-
</nav>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
HexagonMenu.displayName = 'HexagonMenu';
|
|
35
|
-
export default HexagonMenu;
|