create-bdpa-react-scaffold 2.0.0 → 2.0.2
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/create-ui-lib.js +68 -68
- package/package.json +1 -1
package/create-ui-lib.js
CHANGED
|
@@ -658,6 +658,7 @@ export function cn(...inputs) {
|
|
|
658
658
|
write("src/index.js", `
|
|
659
659
|
export { Button } from "./components/ui/button.jsx";
|
|
660
660
|
|
|
661
|
+
export { default as Home } from "./pages/Home.jsx";
|
|
661
662
|
export { default as Login } from "./pages/auth/Login.jsx";
|
|
662
663
|
export { default as Register } from "./pages/auth/Register.jsx";
|
|
663
664
|
|
|
@@ -669,8 +670,50 @@ export { hashPassword, verifyPassword, getPasswordStrength, getPasswordStrengthL
|
|
|
669
670
|
`);
|
|
670
671
|
|
|
671
672
|
write("src/App.jsx", `
|
|
672
|
-
import { useState } from "react";
|
|
673
673
|
import { Routes, Route, useNavigate } from "react-router-dom";
|
|
674
|
+
import { toast } from "sonner";
|
|
675
|
+
import Home from "./pages/Home.jsx";
|
|
676
|
+
import Login from "./pages/auth/Login.jsx";
|
|
677
|
+
import Register from "./pages/auth/Register.jsx";
|
|
678
|
+
import ComponentTest from "./pages/ComponentTest.jsx";
|
|
679
|
+
|
|
680
|
+
export default function App() {
|
|
681
|
+
const navigate = useNavigate();
|
|
682
|
+
|
|
683
|
+
return (
|
|
684
|
+
<Routes>
|
|
685
|
+
<Route path="/" element={<Home />} />
|
|
686
|
+
<Route
|
|
687
|
+
path="/login"
|
|
688
|
+
element={
|
|
689
|
+
<Login
|
|
690
|
+
onSubmit={() => {
|
|
691
|
+
toast.success("Login submitted!");
|
|
692
|
+
navigate("/");
|
|
693
|
+
}}
|
|
694
|
+
/>
|
|
695
|
+
}
|
|
696
|
+
/>
|
|
697
|
+
<Route
|
|
698
|
+
path="/register"
|
|
699
|
+
element={
|
|
700
|
+
<Register
|
|
701
|
+
onSubmit={() => {
|
|
702
|
+
toast.success("Registration submitted!");
|
|
703
|
+
navigate("/");
|
|
704
|
+
}}
|
|
705
|
+
/>
|
|
706
|
+
}
|
|
707
|
+
/>
|
|
708
|
+
<Route path="/component-test" element={<ComponentTest />} />
|
|
709
|
+
</Routes>
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
`);
|
|
713
|
+
|
|
714
|
+
write("src/pages/Home.jsx", `
|
|
715
|
+
import { useState } from "react";
|
|
716
|
+
import { useNavigate } from "react-router-dom";
|
|
674
717
|
import { Button } from "@/components/ui/button";
|
|
675
718
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
676
719
|
import { Input } from "@/components/ui/input";
|
|
@@ -691,23 +734,26 @@ import { Skeleton } from "@/components/ui/skeleton";
|
|
|
691
734
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
|
692
735
|
import { toast } from "sonner";
|
|
693
736
|
import { Menu, Info, CheckCircle } from "lucide-react";
|
|
694
|
-
import { ApiClient } from "
|
|
695
|
-
import Login from "./pages/auth/Login.jsx";
|
|
696
|
-
import Register from "./pages/auth/Register.jsx";
|
|
697
|
-
import ComponentTest from "./pages/ComponentTest.jsx";
|
|
737
|
+
import { ApiClient } from "@/utils/api.js";
|
|
698
738
|
|
|
699
739
|
const enrollmentData = [
|
|
700
740
|
{ name: "Alex", course: "Web Design Fundamentals", status: "Enrolled" },
|
|
701
741
|
{ name: "Jordan", course: "Advanced Web App Design", status: "Waitlisted" },
|
|
702
|
-
{ name: "Taylor", course: "eSports Strategy", status: "Enrolled" }
|
|
742
|
+
{ name: "Taylor", course: "eSports Strategy", status: "Enrolled" },
|
|
703
743
|
];
|
|
704
744
|
|
|
705
|
-
|
|
745
|
+
const navLinks = [
|
|
746
|
+
{ label: "Home", href: "/" },
|
|
747
|
+
{ label: "Login", href: "/login" },
|
|
748
|
+
{ label: "Register", href: "/register" },
|
|
749
|
+
{ label: "Component Test", href: "/component-test" },
|
|
750
|
+
];
|
|
751
|
+
|
|
752
|
+
export default function Home() {
|
|
706
753
|
const [modalOpen, setModalOpen] = useState(false);
|
|
707
754
|
const [posts, setPosts] = useState([]);
|
|
708
755
|
const [loadingPosts, setLoadingPosts] = useState(false);
|
|
709
756
|
const [postsError, setPostsError] = useState("");
|
|
710
|
-
const navigate = useNavigate();
|
|
711
757
|
const client = new ApiClient("https://jsonplaceholder.typicode.com");
|
|
712
758
|
|
|
713
759
|
const fetchPosts = async () => {
|
|
@@ -722,13 +768,6 @@ function Dashboard() {
|
|
|
722
768
|
setLoadingPosts(false);
|
|
723
769
|
};
|
|
724
770
|
|
|
725
|
-
const navLinks = [
|
|
726
|
-
{ label: "Home", href: "/" },
|
|
727
|
-
{ label: "Login", href: "/login" },
|
|
728
|
-
{ label: "Register", href: "/register" },
|
|
729
|
-
{ label: "Component Test", href: "/component-test" }
|
|
730
|
-
];
|
|
731
|
-
|
|
732
771
|
return (
|
|
733
772
|
<div className="flex h-screen overflow-hidden">
|
|
734
773
|
|
|
@@ -749,7 +788,6 @@ function Dashboard() {
|
|
|
749
788
|
|
|
750
789
|
{/* Navbar */}
|
|
751
790
|
<nav className="bg-white border-b px-4 py-3 flex items-center justify-between">
|
|
752
|
-
{/* Mobile sidebar trigger */}
|
|
753
791
|
<Sheet>
|
|
754
792
|
<SheetTrigger asChild>
|
|
755
793
|
<Button variant="ghost" size="icon" className="md:hidden">
|
|
@@ -774,14 +812,10 @@ function Dashboard() {
|
|
|
774
812
|
{/* Page content */}
|
|
775
813
|
<div className="p-6 space-y-6 overflow-auto">
|
|
776
814
|
|
|
777
|
-
{/* BDPA Logo
|
|
815
|
+
{/* BDPA Logo */}
|
|
778
816
|
<Card className="text-center">
|
|
779
817
|
<CardContent className="pt-6">
|
|
780
|
-
<img
|
|
781
|
-
src="/BDPA_edited.png"
|
|
782
|
-
alt="BDPA Logo"
|
|
783
|
-
className="h-32 mx-auto mb-4"
|
|
784
|
-
/>
|
|
818
|
+
<img src="/BDPA_edited.png" alt="BDPA Logo" className="h-32 mx-auto mb-4" />
|
|
785
819
|
<h1 className="text-3xl font-bold text-blue-600">Welcome to BDPA</h1>
|
|
786
820
|
<p className="text-gray-600 mt-2">Black Data Professionals Association</p>
|
|
787
821
|
</CardContent>
|
|
@@ -808,12 +842,14 @@ function Dashboard() {
|
|
|
808
842
|
<AlertDescription>Buttons, Cards, Inputs, Tables, Badges, Selects, and more — all from shadcn/ui.</AlertDescription>
|
|
809
843
|
</Alert>
|
|
810
844
|
</TabsContent>
|
|
811
|
-
<TabsContent value="auth"
|
|
845
|
+
<TabsContent value="auth">
|
|
846
|
+
<p className="mt-2 text-sm">Login + Registration pages included.</p>
|
|
847
|
+
</TabsContent>
|
|
812
848
|
</Tabs>
|
|
813
849
|
|
|
814
850
|
<div className="grid md:grid-cols-2 gap-6">
|
|
815
851
|
|
|
816
|
-
{/* Form
|
|
852
|
+
{/* Sample Form */}
|
|
817
853
|
<Card>
|
|
818
854
|
<CardHeader><CardTitle>Sample Form</CardTitle></CardHeader>
|
|
819
855
|
<CardContent className="space-y-4">
|
|
@@ -836,7 +872,7 @@ function Dashboard() {
|
|
|
836
872
|
</CardContent>
|
|
837
873
|
</Card>
|
|
838
874
|
|
|
839
|
-
{/* Table
|
|
875
|
+
{/* Enrollment Table */}
|
|
840
876
|
<Card>
|
|
841
877
|
<CardHeader><CardTitle>Enrollment Overview</CardTitle></CardHeader>
|
|
842
878
|
<CardContent>
|
|
@@ -882,7 +918,7 @@ function Dashboard() {
|
|
|
882
918
|
|
|
883
919
|
<Separator />
|
|
884
920
|
|
|
885
|
-
{/*
|
|
921
|
+
{/* Badges */}
|
|
886
922
|
<Card>
|
|
887
923
|
<CardHeader><CardTitle>Badges</CardTitle></CardHeader>
|
|
888
924
|
<CardContent className="flex flex-wrap gap-2">
|
|
@@ -893,7 +929,7 @@ function Dashboard() {
|
|
|
893
929
|
</CardContent>
|
|
894
930
|
</Card>
|
|
895
931
|
|
|
896
|
-
{/* Select
|
|
932
|
+
{/* Select / Checkbox / Switch / Textarea / Progress */}
|
|
897
933
|
<div className="grid md:grid-cols-2 gap-6">
|
|
898
934
|
<Card>
|
|
899
935
|
<CardHeader><CardTitle>Select & Switch</CardTitle></CardHeader>
|
|
@@ -938,7 +974,7 @@ function Dashboard() {
|
|
|
938
974
|
</Card>
|
|
939
975
|
</div>
|
|
940
976
|
|
|
941
|
-
{/* Skeleton
|
|
977
|
+
{/* Skeleton */}
|
|
942
978
|
<Card>
|
|
943
979
|
<CardHeader><CardTitle>Skeleton Loading State</CardTitle></CardHeader>
|
|
944
980
|
<CardContent className="space-y-2">
|
|
@@ -973,9 +1009,7 @@ function Dashboard() {
|
|
|
973
1009
|
{/* Dialog + Toast */}
|
|
974
1010
|
<div className="flex gap-4">
|
|
975
1011
|
<Button onClick={() => setModalOpen(true)}>Open Dialog</Button>
|
|
976
|
-
<Button onClick={() => toast.success("This is a toast!")}>
|
|
977
|
-
Show Toast
|
|
978
|
-
</Button>
|
|
1012
|
+
<Button onClick={() => toast.success("This is a toast!")}>Show Toast</Button>
|
|
979
1013
|
</div>
|
|
980
1014
|
|
|
981
1015
|
<Dialog open={modalOpen} onOpenChange={setModalOpen}>
|
|
@@ -993,39 +1027,6 @@ function Dashboard() {
|
|
|
993
1027
|
</div>
|
|
994
1028
|
);
|
|
995
1029
|
}
|
|
996
|
-
|
|
997
|
-
export default function App() {
|
|
998
|
-
const navigate = useNavigate();
|
|
999
|
-
|
|
1000
|
-
return (
|
|
1001
|
-
<Routes>
|
|
1002
|
-
<Route path="/" element={<Dashboard />} />
|
|
1003
|
-
<Route
|
|
1004
|
-
path="/login"
|
|
1005
|
-
element={
|
|
1006
|
-
<Login
|
|
1007
|
-
onSubmit={() => {
|
|
1008
|
-
toast.success("Login submitted!");
|
|
1009
|
-
navigate("/");
|
|
1010
|
-
}}
|
|
1011
|
-
/>
|
|
1012
|
-
}
|
|
1013
|
-
/>
|
|
1014
|
-
<Route
|
|
1015
|
-
path="/register"
|
|
1016
|
-
element={
|
|
1017
|
-
<Register
|
|
1018
|
-
onSubmit={() => {
|
|
1019
|
-
toast.success("Registration submitted!");
|
|
1020
|
-
navigate("/");
|
|
1021
|
-
}}
|
|
1022
|
-
/>
|
|
1023
|
-
}
|
|
1024
|
-
/>
|
|
1025
|
-
<Route path="/component-test" element={<ComponentTest />} />
|
|
1026
|
-
</Routes>
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
1030
|
`);
|
|
1030
1031
|
|
|
1031
1032
|
// Note: All UI components (Card, Input, Form, Table, Navbar, Tabs, Toast, etc.)
|
|
@@ -1221,10 +1222,9 @@ export default function Register({ onSubmit }) {
|
|
|
1221
1222
|
</p>
|
|
1222
1223
|
</div>
|
|
1223
1224
|
)}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
</Button>
|
|
1225
|
+
<Button type="submit" className="w-full">
|
|
1226
|
+
Register
|
|
1227
|
+
</Button>
|
|
1228
1228
|
</form>
|
|
1229
1229
|
<Separator className="my-4" />
|
|
1230
1230
|
<p className="text-sm text-center text-gray-600">
|