@cyberbloxai/ui-kit 0.1.2 → 0.2.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/README.md +30 -1
- package/package.json +6 -2
- package/src/App.css +42 -0
- package/src/App.tsx +31 -0
- package/src/cli.js +393 -0
- package/src/components/CodeBlock.tsx +50 -0
- package/src/components/ComponentLivePreview.tsx +310 -0
- package/src/components/NavLink.tsx +28 -0
- package/src/components/PropTable.tsx +54 -0
- package/src/components/showcase/AuthShowcase.tsx +164 -0
- package/src/components/showcase/ComponentsShowcase.tsx +133 -0
- package/src/components/showcase/DashboardShowcase.tsx +153 -0
- package/src/components/showcase/ErrorShowcase.tsx +55 -0
- package/src/components/showcase/NotificationShowcase.tsx +102 -0
- package/src/components/ui/accordion.tsx +52 -0
- package/src/components/ui/alert-dialog.tsx +104 -0
- package/src/components/ui/alert.tsx +43 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +38 -0
- package/src/components/ui/badge.tsx +29 -0
- package/src/components/ui/breadcrumb.tsx +90 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/calendar.tsx +54 -0
- package/src/components/ui/card.tsx +43 -0
- package/src/components/ui/carousel.tsx +224 -0
- package/src/components/ui/chart.tsx +303 -0
- package/src/components/ui/checkbox.tsx +26 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +132 -0
- package/src/components/ui/context-menu.tsx +178 -0
- package/src/components/ui/dialog.tsx +95 -0
- package/src/components/ui/drawer.tsx +87 -0
- package/src/components/ui/dropdown-menu.tsx +179 -0
- package/src/components/ui/form.tsx +129 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-otp.tsx +61 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +17 -0
- package/src/components/ui/menubar.tsx +207 -0
- package/src/components/ui/navigation-menu.tsx +120 -0
- package/src/components/ui/pagination.tsx +81 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +23 -0
- package/src/components/ui/radio-group.tsx +36 -0
- package/src/components/ui/resizable.tsx +37 -0
- package/src/components/ui/scroll-area.tsx +38 -0
- package/src/components/ui/select.tsx +143 -0
- package/src/components/ui/separator.tsx +20 -0
- package/src/components/ui/sheet.tsx +107 -0
- package/src/components/ui/sidebar.tsx +637 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +23 -0
- package/src/components/ui/sonner.tsx +27 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +72 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +21 -0
- package/src/components/ui/toast.tsx +111 -0
- package/src/components/ui/toaster.tsx +24 -0
- package/src/components/ui/toggle-group.tsx +49 -0
- package/src/components/ui/toggle.tsx +37 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/components/ui/use-toast.ts +3 -0
- package/src/data/componentRegistry.ts +501 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/hooks/use-toast.ts +186 -0
- package/src/index.css +105 -0
- package/src/lib/index.ts +58 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +5 -0
- package/src/pages/ComponentDetail.tsx +167 -0
- package/src/pages/ComponentsList.tsx +126 -0
- package/src/pages/Index.tsx +223 -0
- package/src/pages/NotFound.tsx +24 -0
- package/src/test/example.test.ts +7 -0
- package/src/test/setup.ts +15 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import {
|
|
5
|
+
LogIn, LayoutDashboard, Bell, AlertTriangle, Puzzle, Package,
|
|
6
|
+
ArrowRight, Copy, Check, Github, Sparkles
|
|
7
|
+
} from "lucide-react";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import AuthShowcase from "@/components/showcase/AuthShowcase";
|
|
10
|
+
import DashboardShowcase from "@/components/showcase/DashboardShowcase";
|
|
11
|
+
import NotificationShowcase from "@/components/showcase/NotificationShowcase";
|
|
12
|
+
import ErrorShowcase from "@/components/showcase/ErrorShowcase";
|
|
13
|
+
import ComponentsShowcase from "@/components/showcase/ComponentsShowcase";
|
|
14
|
+
|
|
15
|
+
const sections = [
|
|
16
|
+
{ id: "auth", label: "Authentication", icon: LogIn, desc: "Login, signup, forgot password with social auth" },
|
|
17
|
+
{ id: "dashboard", label: "Dashboard", icon: LayoutDashboard, desc: "Stats, charts, activity feeds, progress bars" },
|
|
18
|
+
{ id: "notifications", label: "Notifications", icon: Bell, desc: "Toast system with auto-dismiss and stacking" },
|
|
19
|
+
{ id: "errors", label: "Error Pages", icon: AlertTriangle, desc: "404, 500, offline, forbidden, maintenance" },
|
|
20
|
+
{ id: "components", label: "UI Components", icon: Puzzle, desc: "Buttons, inputs, badges, toggles, sliders" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const fadeUp = {
|
|
24
|
+
hidden: { opacity: 0, y: 20 },
|
|
25
|
+
visible: (i: number) => ({
|
|
26
|
+
opacity: 1, y: 0,
|
|
27
|
+
transition: { delay: i * 0.1, duration: 0.5 }
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const Index = () => {
|
|
32
|
+
const [activeSection, setActiveSection] = useState("auth");
|
|
33
|
+
const [copied, setCopied] = useState(false);
|
|
34
|
+
|
|
35
|
+
const handleCopy = () => {
|
|
36
|
+
navigator.clipboard.writeText("npx create-ui-kit@latest");
|
|
37
|
+
setCopied(true);
|
|
38
|
+
setTimeout(() => setCopied(false), 2000);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const renderShowcase = () => {
|
|
42
|
+
switch (activeSection) {
|
|
43
|
+
case "auth": return <AuthShowcase />;
|
|
44
|
+
case "dashboard": return <DashboardShowcase />;
|
|
45
|
+
case "notifications": return <NotificationShowcase />;
|
|
46
|
+
case "errors": return <ErrorShowcase />;
|
|
47
|
+
case "components": return <ComponentsShowcase />;
|
|
48
|
+
default: return <AuthShowcase />;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="min-h-screen bg-background text-foreground">
|
|
54
|
+
{/* Hero */}
|
|
55
|
+
<header className="relative overflow-hidden">
|
|
56
|
+
<div className="absolute inset-0 dot-grid opacity-40" />
|
|
57
|
+
<div className="absolute top-20 left-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl" />
|
|
58
|
+
<div className="absolute bottom-0 right-1/4 w-80 h-80 bg-accent/5 rounded-full blur-3xl" />
|
|
59
|
+
|
|
60
|
+
<nav className="relative z-10 flex items-center justify-between max-w-6xl mx-auto px-6 py-5">
|
|
61
|
+
<div className="flex items-center gap-2">
|
|
62
|
+
<Package className="h-6 w-6 text-primary" />
|
|
63
|
+
<span className="font-bold text-lg text-foreground">UIKit</span>
|
|
64
|
+
<span className="text-xs font-mono text-primary bg-primary/10 px-2 py-0.5 rounded-full">v1.0</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="flex items-center gap-3">
|
|
67
|
+
<Link to="/components">
|
|
68
|
+
<Button variant="ghost" size="sm" className="hover:bg-muted/60 text-sm hidden sm:flex">
|
|
69
|
+
Docs
|
|
70
|
+
</Button>
|
|
71
|
+
</Link>
|
|
72
|
+
<Button variant="ghost" size="sm" className="hover:bg-muted/60 text-sm gap-1.5 hidden sm:flex">
|
|
73
|
+
<Github className="h-4 w-4" /> GitHub
|
|
74
|
+
</Button>
|
|
75
|
+
<Button size="sm" className="bg-primary text-primary-foreground hover:bg-primary/90 text-sm">
|
|
76
|
+
Get Started <ArrowRight className="ml-1.5 h-3.5 w-3.5" />
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
</nav>
|
|
80
|
+
|
|
81
|
+
<div className="relative z-10 max-w-4xl mx-auto px-6 pt-16 pb-20 text-center">
|
|
82
|
+
<motion.div
|
|
83
|
+
initial={{ opacity: 0, y: 20 }}
|
|
84
|
+
animate={{ opacity: 1, y: 0 }}
|
|
85
|
+
transition={{ duration: 0.6 }}
|
|
86
|
+
className="space-y-6"
|
|
87
|
+
>
|
|
88
|
+
<div className="inline-flex items-center gap-2 bg-primary/10 border border-primary/20 text-primary text-xs font-medium px-3 py-1.5 rounded-full">
|
|
89
|
+
<Sparkles className="h-3.5 w-3.5" />
|
|
90
|
+
Production-ready components
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<h1 className="text-4xl sm:text-6xl lg:text-7xl font-bold leading-tight">
|
|
94
|
+
<span className="text-foreground">Build faster with </span>
|
|
95
|
+
<span className="gradient-text">beautiful UI</span>
|
|
96
|
+
</h1>
|
|
97
|
+
|
|
98
|
+
<p className="text-lg text-muted-foreground max-w-2xl mx-auto">
|
|
99
|
+
A modular, themeable component library. Auth flows, dashboards, notifications, error pages —
|
|
100
|
+
all production-grade and ready to drop into your project.
|
|
101
|
+
</p>
|
|
102
|
+
|
|
103
|
+
<div className="flex flex-col sm:flex-row items-center justify-center gap-3 pt-4">
|
|
104
|
+
<Link to="/components">
|
|
105
|
+
<Button size="lg" className="bg-primary text-primary-foreground hover:bg-primary/90 text-base px-8">
|
|
106
|
+
Browse Components <ArrowRight className="ml-2 h-4 w-4" />
|
|
107
|
+
</Button>
|
|
108
|
+
</Link>
|
|
109
|
+
<button
|
|
110
|
+
onClick={handleCopy}
|
|
111
|
+
className="flex items-center gap-2 bg-muted/50 border border-border/60 rounded-lg px-4 py-2.5 font-mono text-sm text-muted-foreground hover:border-primary/30 hover:text-foreground transition-all"
|
|
112
|
+
>
|
|
113
|
+
<span>npx create-ui-kit@latest</span>
|
|
114
|
+
{copied ? <Check className="h-4 w-4 text-success" /> : <Copy className="h-4 w-4" />}
|
|
115
|
+
</button>
|
|
116
|
+
</div>
|
|
117
|
+
</motion.div>
|
|
118
|
+
</div>
|
|
119
|
+
</header>
|
|
120
|
+
|
|
121
|
+
{/* Component Showcase */}
|
|
122
|
+
<section className="max-w-6xl mx-auto px-6 pb-24">
|
|
123
|
+
{/* Section Tabs */}
|
|
124
|
+
<div className="flex flex-wrap justify-center gap-2 mb-10">
|
|
125
|
+
{sections.map((s, i) => (
|
|
126
|
+
<motion.button
|
|
127
|
+
key={s.id}
|
|
128
|
+
custom={i}
|
|
129
|
+
variants={fadeUp}
|
|
130
|
+
initial="hidden"
|
|
131
|
+
whileInView="visible"
|
|
132
|
+
viewport={{ once: true }}
|
|
133
|
+
onClick={() => setActiveSection(s.id)}
|
|
134
|
+
className={`flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${
|
|
135
|
+
activeSection === s.id
|
|
136
|
+
? "bg-primary/15 text-primary border border-primary/30"
|
|
137
|
+
: "glass-card text-muted-foreground hover:text-foreground hover:border-border/60"
|
|
138
|
+
}`}
|
|
139
|
+
>
|
|
140
|
+
<s.icon className="h-4 w-4" />
|
|
141
|
+
<span className="hidden sm:inline">{s.label}</span>
|
|
142
|
+
</motion.button>
|
|
143
|
+
))}
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
{/* Active section description */}
|
|
147
|
+
<motion.div
|
|
148
|
+
key={activeSection}
|
|
149
|
+
initial={{ opacity: 0, y: 10 }}
|
|
150
|
+
animate={{ opacity: 1, y: 0 }}
|
|
151
|
+
className="text-center mb-8"
|
|
152
|
+
>
|
|
153
|
+
<h2 className="text-2xl font-bold text-foreground mb-2">
|
|
154
|
+
{sections.find((s) => s.id === activeSection)?.label}
|
|
155
|
+
</h2>
|
|
156
|
+
<p className="text-sm text-muted-foreground">
|
|
157
|
+
{sections.find((s) => s.id === activeSection)?.desc}
|
|
158
|
+
</p>
|
|
159
|
+
</motion.div>
|
|
160
|
+
|
|
161
|
+
{/* Showcase area */}
|
|
162
|
+
<motion.div
|
|
163
|
+
key={`showcase-${activeSection}`}
|
|
164
|
+
initial={{ opacity: 0 }}
|
|
165
|
+
animate={{ opacity: 1 }}
|
|
166
|
+
transition={{ duration: 0.3 }}
|
|
167
|
+
className="glass-card p-6 sm:p-8"
|
|
168
|
+
>
|
|
169
|
+
{renderShowcase()}
|
|
170
|
+
</motion.div>
|
|
171
|
+
</section>
|
|
172
|
+
|
|
173
|
+
{/* Features Grid */}
|
|
174
|
+
<section className="max-w-6xl mx-auto px-6 pb-24">
|
|
175
|
+
<div className="text-center mb-12">
|
|
176
|
+
<h2 className="text-3xl font-bold text-foreground mb-3">Why UIKit?</h2>
|
|
177
|
+
<p className="text-muted-foreground">Everything you need to ship fast.</p>
|
|
178
|
+
</div>
|
|
179
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
180
|
+
{[
|
|
181
|
+
{ title: "Type-Safe", desc: "Full TypeScript support with proper generics and inference." },
|
|
182
|
+
{ title: "Accessible", desc: "WCAG compliant with proper ARIA labels and keyboard nav." },
|
|
183
|
+
{ title: "Themeable", desc: "CSS variables and design tokens for easy customization." },
|
|
184
|
+
{ title: "Responsive", desc: "Mobile-first design that looks great on every screen." },
|
|
185
|
+
{ title: "Modular", desc: "Import only what you need. Tree-shakeable by default." },
|
|
186
|
+
{ title: "Production Ready", desc: "Battle-tested patterns used in real SaaS applications." },
|
|
187
|
+
].map((f, i) => (
|
|
188
|
+
<motion.div
|
|
189
|
+
key={f.title}
|
|
190
|
+
custom={i}
|
|
191
|
+
variants={fadeUp}
|
|
192
|
+
initial="hidden"
|
|
193
|
+
whileInView="visible"
|
|
194
|
+
viewport={{ once: true }}
|
|
195
|
+
className="glass-card p-5 space-y-2 hover:border-primary/20 transition-colors"
|
|
196
|
+
>
|
|
197
|
+
<h3 className="font-semibold text-foreground">{f.title}</h3>
|
|
198
|
+
<p className="text-sm text-muted-foreground">{f.desc}</p>
|
|
199
|
+
</motion.div>
|
|
200
|
+
))}
|
|
201
|
+
</div>
|
|
202
|
+
</section>
|
|
203
|
+
|
|
204
|
+
{/* Footer */}
|
|
205
|
+
<footer className="border-t border-border/40 py-8">
|
|
206
|
+
<div className="max-w-6xl mx-auto px-6 flex flex-col sm:flex-row items-center justify-between gap-4">
|
|
207
|
+
<div className="flex items-center gap-2">
|
|
208
|
+
<Package className="h-4 w-4 text-primary" />
|
|
209
|
+
<span className="text-sm font-medium text-foreground">UIKit</span>
|
|
210
|
+
<span className="text-xs text-muted-foreground">© 2026</span>
|
|
211
|
+
</div>
|
|
212
|
+
<div className="flex items-center gap-4 text-sm text-muted-foreground">
|
|
213
|
+
<a href="#" className="hover:text-foreground transition-colors">Documentation</a>
|
|
214
|
+
<a href="#" className="hover:text-foreground transition-colors">GitHub</a>
|
|
215
|
+
<a href="#" className="hover:text-foreground transition-colors">License</a>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</footer>
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export default Index;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useLocation } from "react-router-dom";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
const NotFound = () => {
|
|
5
|
+
const location = useLocation();
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
console.error("404 Error: User attempted to access non-existent route:", location.pathname);
|
|
9
|
+
}, [location.pathname]);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex min-h-screen items-center justify-center bg-muted">
|
|
13
|
+
<div className="text-center">
|
|
14
|
+
<h1 className="mb-4 text-4xl font-bold">404</h1>
|
|
15
|
+
<p className="mb-4 text-xl text-muted-foreground">Oops! Page not found</p>
|
|
16
|
+
<a href="/" className="text-primary underline hover:text-primary/90">
|
|
17
|
+
Return to Home
|
|
18
|
+
</a>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default NotFound;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(window, "matchMedia", {
|
|
4
|
+
writable: true,
|
|
5
|
+
value: (query: string) => ({
|
|
6
|
+
matches: false,
|
|
7
|
+
media: query,
|
|
8
|
+
onchange: null,
|
|
9
|
+
addListener: () => {},
|
|
10
|
+
removeListener: () => {},
|
|
11
|
+
addEventListener: () => {},
|
|
12
|
+
removeEventListener: () => {},
|
|
13
|
+
dispatchEvent: () => {},
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|