create-bdpa-react-scaffold 2.0.2 → 2.0.4
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 +117 -3
- package/package.json +1 -1
package/create-ui-lib.js
CHANGED
|
@@ -168,7 +168,6 @@ write("package.json", `
|
|
|
168
168
|
"react": "^18.2.0",
|
|
169
169
|
"react-dom": "^18.2.0",
|
|
170
170
|
"react-router-dom": "^6.20.0",
|
|
171
|
-
"lucide-react": "^0.344.0",
|
|
172
171
|
"bcryptjs": "^2.4.3",
|
|
173
172
|
"class-variance-authority": "^0.7.0",
|
|
174
173
|
"clsx": "^2.1.0",
|
|
@@ -711,6 +710,90 @@ export default function App() {
|
|
|
711
710
|
}
|
|
712
711
|
`);
|
|
713
712
|
|
|
713
|
+
write("src/components/ui/icons.jsx", `
|
|
714
|
+
// Local SVG icon module — inline icon components, no external icon library needed.
|
|
715
|
+
// All icons accept className and other SVG props.
|
|
716
|
+
|
|
717
|
+
function SvgIcon({ className = "h-4 w-4", children, ...props }) {
|
|
718
|
+
return (
|
|
719
|
+
<svg
|
|
720
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
721
|
+
viewBox="0 0 24 24"
|
|
722
|
+
fill="none"
|
|
723
|
+
stroke="currentColor"
|
|
724
|
+
strokeWidth="2"
|
|
725
|
+
strokeLinecap="round"
|
|
726
|
+
strokeLinejoin="round"
|
|
727
|
+
className={className}
|
|
728
|
+
{...props}
|
|
729
|
+
>
|
|
730
|
+
{children}
|
|
731
|
+
</svg>
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export function Check({ className, ...p }) {
|
|
736
|
+
return <SvgIcon className={className} {...p}><path d="M20 6 9 17l-5-5" /></SvgIcon>;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
export function X({ className, ...p }) {
|
|
740
|
+
return <SvgIcon className={className} {...p}><path d="M18 6 6 18" /><path d="m6 6 12 12" /></SvgIcon>;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export function Circle({ className, ...p }) {
|
|
744
|
+
return <SvgIcon className={className} {...p}><circle cx="12" cy="12" r="10" /></SvgIcon>;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export function CheckCircle({ className, ...p }) {
|
|
748
|
+
return <SvgIcon className={className} {...p}><circle cx="12" cy="12" r="10" /><path d="m9 12 2 2 4-4" /></SvgIcon>;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export function AlertCircle({ className, ...p }) {
|
|
752
|
+
return <SvgIcon className={className} {...p}><circle cx="12" cy="12" r="10" /><line x1="12" y1="8" x2="12" y2="12" /><line x1="12" y1="16" x2="12.01" y2="16" /></SvgIcon>;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export function Info({ className, ...p }) {
|
|
756
|
+
return <SvgIcon className={className} {...p}><circle cx="12" cy="12" r="10" /><path d="M12 16v-4" /><path d="M12 8h.01" /></SvgIcon>;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export function Menu({ className, ...p }) {
|
|
760
|
+
return <SvgIcon className={className} {...p}><line x1="4" x2="20" y1="6" y2="6" /><line x1="4" x2="20" y1="12" y2="12" /><line x1="4" x2="20" y1="18" y2="18" /></SvgIcon>;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export function Search({ className, ...p }) {
|
|
764
|
+
return <SvgIcon className={className} {...p}><circle cx="11" cy="11" r="8" /><path d="m21 21-4.3-4.3" /></SvgIcon>;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export function ChevronDown({ className, ...p }) {
|
|
768
|
+
return <SvgIcon className={className} {...p}><path d="m6 9 6 6 6-6" /></SvgIcon>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export function ChevronUp({ className, ...p }) {
|
|
772
|
+
return <SvgIcon className={className} {...p}><path d="m18 15-6-6-6 6" /></SvgIcon>;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export function ChevronRight({ className, ...p }) {
|
|
776
|
+
return <SvgIcon className={className} {...p}><path d="m9 18 6-6-6-6" /></SvgIcon>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export function ChevronLeft({ className, ...p }) {
|
|
780
|
+
return <SvgIcon className={className} {...p}><path d="m15 18-6-6 6-6" /></SvgIcon>;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export function ArrowRight({ className, ...p }) {
|
|
784
|
+
return <SvgIcon className={className} {...p}><path d="M5 12h14" /><path d="m12 5 7 7-7 7" /></SvgIcon>;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export function ArrowLeft({ className, ...p }) {
|
|
788
|
+
return <SvgIcon className={className} {...p}><path d="m12 19-7-7 7-7" /><path d="M19 12H5" /></SvgIcon>;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// Aliases
|
|
792
|
+
export const ChevronDownIcon = ChevronDown;
|
|
793
|
+
export const ChevronLeftIcon = ChevronLeft;
|
|
794
|
+
export const ChevronRightIcon = ChevronRight;
|
|
795
|
+
`);
|
|
796
|
+
|
|
714
797
|
write("src/pages/Home.jsx", `
|
|
715
798
|
import { useState } from "react";
|
|
716
799
|
import { useNavigate } from "react-router-dom";
|
|
@@ -733,7 +816,7 @@ import { Textarea } from "@/components/ui/textarea";
|
|
|
733
816
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
734
817
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
|
735
818
|
import { toast } from "sonner";
|
|
736
|
-
import { Menu, Info, CheckCircle } from "
|
|
819
|
+
import { Menu, Info, CheckCircle } from "@/components/ui/icons";
|
|
737
820
|
import { ApiClient } from "@/utils/api.js";
|
|
738
821
|
|
|
739
822
|
const enrollmentData = [
|
|
@@ -1266,7 +1349,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/comp
|
|
|
1266
1349
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
|
|
1267
1350
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
|
1268
1351
|
import { toast } from "sonner";
|
|
1269
|
-
import { CheckCircle, Info, AlertCircle } from "
|
|
1352
|
+
import { CheckCircle, Info, AlertCircle } from "@/components/ui/icons";
|
|
1270
1353
|
|
|
1271
1354
|
const sampleRows = [
|
|
1272
1355
|
{ id: 1, name: "Ada Lovelace", role: "Student", status: "Active" },
|
|
@@ -1716,6 +1799,37 @@ if (fs.existsSync(bdpaImagePath)) {
|
|
|
1716
1799
|
if (doInstall) {
|
|
1717
1800
|
installDependencies(packageManager, BASE_DIR);
|
|
1718
1801
|
installShadcn(BASE_DIR);
|
|
1802
|
+
// Override shadcn's sonner.jsx which imports lucide-react.
|
|
1803
|
+
// This version uses Sonner's built-in icons and CSS variable theming.
|
|
1804
|
+
write("src/components/ui/sonner.jsx", `
|
|
1805
|
+
import { Toaster as Sonner } from "sonner";
|
|
1806
|
+
|
|
1807
|
+
const Toaster = ({ ...props }) => {
|
|
1808
|
+
return (
|
|
1809
|
+
<Sonner
|
|
1810
|
+
className="toaster group"
|
|
1811
|
+
toastOptions={{
|
|
1812
|
+
classNames: {
|
|
1813
|
+
toast:
|
|
1814
|
+
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
1815
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
1816
|
+
actionButton:
|
|
1817
|
+
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",
|
|
1818
|
+
cancelButton:
|
|
1819
|
+
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
1820
|
+
error: "group-[.toaster]:!bg-destructive group-[.toaster]:!text-destructive-foreground",
|
|
1821
|
+
success: "group-[.toaster]:border-border",
|
|
1822
|
+
warning: "group-[.toaster]:border-border",
|
|
1823
|
+
info: "group-[.toaster]:border-border",
|
|
1824
|
+
},
|
|
1825
|
+
}}
|
|
1826
|
+
{...props}
|
|
1827
|
+
/>
|
|
1828
|
+
);
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
export { Toaster };
|
|
1832
|
+
`);
|
|
1719
1833
|
}
|
|
1720
1834
|
|
|
1721
1835
|
installVSCodeExtensions();
|