create-bluecopa-react-app 1.0.4 → 1.0.6
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 +47 -10
- package/bin/create-bluecopa-react-app.js +257 -51
- package/package.json +6 -5
- package/templates/latest/Agent.md +254 -0
- package/templates/latest/Dockerfile +22 -0
- package/templates/latest/README.md +157 -221
- package/templates/latest/app/app.css +134 -0
- package/templates/latest/app/app.tsx +46 -0
- package/templates/latest/app/components/app-sidebar.tsx +174 -0
- package/templates/latest/app/components/chart-area-interactive.tsx +290 -0
- package/templates/latest/app/components/data-table.tsx +807 -0
- package/templates/latest/app/components/nav-documents.tsx +92 -0
- package/templates/latest/app/components/nav-main.tsx +56 -0
- package/templates/latest/app/components/nav-secondary.tsx +42 -0
- package/templates/latest/app/components/nav-user.tsx +112 -0
- package/templates/latest/app/components/section-cards.tsx +102 -0
- package/templates/latest/app/components/site-header.tsx +19 -0
- package/templates/latest/app/components/ui/avatar.tsx +53 -0
- package/templates/latest/app/components/ui/badge.tsx +46 -0
- package/templates/latest/app/components/ui/breadcrumb.tsx +109 -0
- package/templates/latest/app/components/ui/button.tsx +58 -0
- package/templates/latest/app/components/ui/card.tsx +92 -0
- package/templates/latest/app/components/ui/chart.tsx +352 -0
- package/templates/latest/app/components/ui/checkbox.tsx +30 -0
- package/templates/latest/app/components/ui/drawer.tsx +139 -0
- package/templates/latest/app/components/ui/dropdown-menu.tsx +258 -0
- package/templates/latest/app/components/ui/input.tsx +21 -0
- package/templates/latest/app/components/ui/label.tsx +24 -0
- package/templates/latest/app/components/ui/select.tsx +183 -0
- package/templates/latest/app/components/ui/separator.tsx +26 -0
- package/templates/latest/app/components/ui/sheet.tsx +139 -0
- package/templates/latest/app/components/ui/sidebar.tsx +731 -0
- package/templates/latest/app/components/ui/skeleton.tsx +13 -0
- package/templates/latest/app/components/ui/sonner.tsx +23 -0
- package/templates/latest/app/components/ui/table.tsx +117 -0
- package/templates/latest/app/components/ui/tabs.tsx +66 -0
- package/templates/latest/app/components/ui/toggle-group.tsx +73 -0
- package/templates/latest/app/components/ui/toggle.tsx +47 -0
- package/templates/latest/app/components/ui/tooltip.tsx +59 -0
- package/templates/latest/app/dashboard/data.json +614 -0
- package/templates/latest/app/hooks/use-bluecopa-user.ts +37 -0
- package/templates/latest/app/hooks/use-mobile.ts +19 -0
- package/templates/latest/{src → app}/lib/utils.ts +1 -1
- package/templates/latest/app/main.tsx +12 -0
- package/templates/latest/app/routes/home.tsx +40 -0
- package/templates/latest/app/routes.tsx +15 -0
- package/templates/latest/{src → app}/single-spa.tsx +38 -28
- package/templates/latest/components.json +22 -0
- package/templates/latest/dist/assets/__federation_expose_App-DRwKKpS2.js +91 -0
- package/templates/latest/dist/assets/__federation_fn_import-CzfA7kmP.js +438 -0
- package/templates/latest/dist/assets/__federation_shared_react-Bp6HVBS4.js +16 -0
- package/templates/latest/dist/assets/__federation_shared_react-dom-BCcRGiYp.js +17 -0
- package/templates/latest/dist/assets/client-DgSav55y.js +12658 -0
- package/templates/latest/dist/assets/home-DOL6GrYV.js +54951 -0
- package/templates/latest/dist/assets/index-BzNimew1.js +69 -0
- package/templates/latest/dist/assets/index-DMFtQdNS.js +412 -0
- package/templates/latest/dist/assets/index-DdYpcDMk.js +60 -0
- package/templates/latest/dist/assets/remoteEntry.js +88 -0
- package/templates/latest/dist/assets/style-36A39bNN.css +3683 -0
- package/templates/latest/dist/avatars/shadcn.svg +6 -0
- package/templates/latest/dist/favicon.ico +0 -0
- package/templates/latest/dist/index.html +19 -0
- package/templates/latest/index.html +1 -1
- package/templates/latest/package-lock.json +1227 -3353
- package/templates/latest/package.json +47 -43
- package/templates/latest/pnpm-lock.yaml +4767 -0
- package/templates/latest/preview/index.html +32 -2
- package/templates/latest/public/avatars/shadcn.svg +6 -0
- package/templates/latest/public/favicon.ico +0 -0
- package/templates/latest/tsconfig.json +18 -11
- package/templates/latest/vite.config.ts +41 -41
- package/templates/latest/.env.example +0 -14
- package/templates/latest/.eslintrc.cjs +0 -42
- package/templates/latest/AGENT.md +0 -284
- package/templates/latest/clean.sh +0 -39
- package/templates/latest/postcss.config.cjs +0 -6
- package/templates/latest/public/bluecopa-logo.svg +0 -30
- package/templates/latest/public/favicon-32x32.png +0 -0
- package/templates/latest/public/favicon-96x96.png +0 -0
- package/templates/latest/setup.sh +0 -55
- package/templates/latest/src/App.tsx +0 -15
- package/templates/latest/src/components/layout/dashboard-header.tsx +0 -139
- package/templates/latest/src/components/layout/dashboard-layout.tsx +0 -29
- package/templates/latest/src/components/layout/sidebar.tsx +0 -54
- package/templates/latest/src/components/page/dashboard.tsx +0 -1506
- package/templates/latest/src/components/page/navbar.tsx +0 -104
- package/templates/latest/src/components/tables/data-grid.tsx +0 -439
- package/templates/latest/src/components/ui/alert.tsx +0 -59
- package/templates/latest/src/components/ui/avatar.tsx +0 -50
- package/templates/latest/src/components/ui/badge.tsx +0 -36
- package/templates/latest/src/components/ui/bluecopa-logo.tsx +0 -54
- package/templates/latest/src/components/ui/button.tsx +0 -58
- package/templates/latest/src/components/ui/card.tsx +0 -79
- package/templates/latest/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/latest/src/components/ui/input.tsx +0 -24
- package/templates/latest/src/components/ui/label.tsx +0 -23
- package/templates/latest/src/components/ui/select.tsx +0 -29
- package/templates/latest/src/hooks/use-api.ts +0 -55
- package/templates/latest/src/index.css +0 -59
- package/templates/latest/src/main.tsx +0 -13
- package/templates/latest/src/pages/Dashboard.tsx +0 -13
- package/templates/latest/src/pages/Home.tsx +0 -622
- package/templates/latest/src/providers/query-provider.tsx +0 -48
- package/templates/latest/src/types/api.ts +0 -78
- package/templates/latest/src/vite-env.d.ts +0 -11
- package/templates/latest/tailwind.config.js +0 -88
- package/templates/latest/tsconfig.app.json +0 -26
- package/templates/latest/tsconfig.node.json +0 -10
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Routes, Route } from 'react-router-dom'
|
|
2
|
-
import QueryProvider from '@/providers/query-provider'
|
|
3
|
-
import Home from '@/pages/Home'
|
|
4
|
-
import Dashboard from '@/pages/Dashboard'
|
|
5
|
-
|
|
6
|
-
export default function App() {
|
|
7
|
-
return (
|
|
8
|
-
<QueryProvider>
|
|
9
|
-
<Routes>
|
|
10
|
-
<Route path="/" element={<Home />} />
|
|
11
|
-
<Route path="/dashboard" element={<Dashboard />} />
|
|
12
|
-
</Routes>
|
|
13
|
-
</QueryProvider>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { Bell, Search, User, Settings, LogOut, ChevronDown } from 'lucide-react'
|
|
2
|
-
import { Button } from '@/components/ui/button'
|
|
3
|
-
import {
|
|
4
|
-
DropdownMenu,
|
|
5
|
-
DropdownMenuContent,
|
|
6
|
-
DropdownMenuItem,
|
|
7
|
-
DropdownMenuLabel,
|
|
8
|
-
DropdownMenuSeparator,
|
|
9
|
-
DropdownMenuTrigger,
|
|
10
|
-
} from '@/components/ui/dropdown-menu'
|
|
11
|
-
import { Input } from '@/components/ui/input'
|
|
12
|
-
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
|
|
13
|
-
import { useUserData } from '@/hooks/use-api'
|
|
14
|
-
|
|
15
|
-
interface DashboardHeaderProps {
|
|
16
|
-
title?: string
|
|
17
|
-
subtitle?: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default function DashboardHeader({ title, subtitle }: DashboardHeaderProps) {
|
|
21
|
-
const { data: userData, isLoading } = useUserData()
|
|
22
|
-
|
|
23
|
-
// Extract user from the API response structure
|
|
24
|
-
const user = userData?.user
|
|
25
|
-
const organization = userData?.organization
|
|
26
|
-
|
|
27
|
-
// Create display values with proper fallbacks
|
|
28
|
-
const getDisplayName = () => {
|
|
29
|
-
if (!user) return 'Loading...'
|
|
30
|
-
|
|
31
|
-
// If firstName and lastName are the same as email, just use email
|
|
32
|
-
if (user.firstName === user.email && user.lastName === user.email) {
|
|
33
|
-
return user.email
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Try to construct name from firstName and lastName
|
|
37
|
-
const fullName = `${user.firstName || ''} ${user.lastName || ''}`.trim()
|
|
38
|
-
return fullName || user.email
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const displayName = getDisplayName()
|
|
42
|
-
const displayRole = organization?.name || 'User' // Use organization name as role
|
|
43
|
-
const displayEmail = user?.email || 'loading@example.com'
|
|
44
|
-
|
|
45
|
-
// Show loading state in user info
|
|
46
|
-
if (isLoading) {
|
|
47
|
-
return (
|
|
48
|
-
<header className="bg-white border-b border-gray-200 px-6 py-4">
|
|
49
|
-
<div className="flex items-center justify-between">
|
|
50
|
-
<div className="flex-1">
|
|
51
|
-
{title && (
|
|
52
|
-
<div>
|
|
53
|
-
<h1 className="text-2xl font-semibold text-gray-900">{title}</h1>
|
|
54
|
-
{subtitle && <p className="text-sm text-gray-500 mt-1">{subtitle}</p>}
|
|
55
|
-
</div>
|
|
56
|
-
)}
|
|
57
|
-
</div>
|
|
58
|
-
<div className="flex items-center space-x-4">
|
|
59
|
-
<div className="text-sm text-gray-500">Loading user...</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</header>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<header className="bg-white border-b border-gray-200 px-6 py-4">
|
|
68
|
-
<div className="flex items-center justify-between">
|
|
69
|
-
<div className="flex-1">
|
|
70
|
-
{title && (
|
|
71
|
-
<div>
|
|
72
|
-
<h1 className="text-2xl font-semibold text-gray-900">{title}</h1>
|
|
73
|
-
{subtitle && <p className="text-sm text-gray-500 mt-1">{subtitle}</p>}
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div className="flex items-center space-x-4">
|
|
79
|
-
{/* Search */}
|
|
80
|
-
<div className="relative hidden md:block">
|
|
81
|
-
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" />
|
|
82
|
-
<Input
|
|
83
|
-
type="search"
|
|
84
|
-
placeholder="Search..."
|
|
85
|
-
className="w-80 pl-10 pr-4"
|
|
86
|
-
/>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
{/* Notifications */}
|
|
90
|
-
<Button variant="ghost" size="sm" className="relative">
|
|
91
|
-
<Bell className="h-5 w-5" />
|
|
92
|
-
<span className="absolute -top-1 -right-1 h-4 w-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center">
|
|
93
|
-
3
|
|
94
|
-
</span>
|
|
95
|
-
</Button>
|
|
96
|
-
|
|
97
|
-
{/* User Menu */}
|
|
98
|
-
<DropdownMenu>
|
|
99
|
-
<DropdownMenuTrigger asChild>
|
|
100
|
-
<Button variant="ghost" className="flex items-center space-x-2 p-2">
|
|
101
|
-
<Avatar className="h-8 w-8">
|
|
102
|
-
<AvatarImage src={undefined} alt={displayName} />
|
|
103
|
-
<AvatarFallback>{displayName.split(' ').map((n: string) => n[0]).join('')}</AvatarFallback>
|
|
104
|
-
</Avatar>
|
|
105
|
-
<div className="hidden md:block text-left">
|
|
106
|
-
<p className="text-sm font-medium text-gray-900">{displayName}</p>
|
|
107
|
-
<p className="text-xs text-gray-500">{displayRole}</p>
|
|
108
|
-
</div>
|
|
109
|
-
<ChevronDown className="h-4 w-4 text-gray-400" />
|
|
110
|
-
</Button>
|
|
111
|
-
</DropdownMenuTrigger>
|
|
112
|
-
<DropdownMenuContent align="end" className="w-56">
|
|
113
|
-
<DropdownMenuLabel>
|
|
114
|
-
<div>
|
|
115
|
-
<p className="font-medium">{displayName}</p>
|
|
116
|
-
<p className="text-xs text-gray-500">{displayEmail}</p>
|
|
117
|
-
</div>
|
|
118
|
-
</DropdownMenuLabel>
|
|
119
|
-
<DropdownMenuSeparator />
|
|
120
|
-
<DropdownMenuItem>
|
|
121
|
-
<User className="mr-2 h-4 w-4" />
|
|
122
|
-
Profile
|
|
123
|
-
</DropdownMenuItem>
|
|
124
|
-
<DropdownMenuItem>
|
|
125
|
-
<Settings className="mr-2 h-4 w-4" />
|
|
126
|
-
Settings
|
|
127
|
-
</DropdownMenuItem>
|
|
128
|
-
<DropdownMenuSeparator />
|
|
129
|
-
<DropdownMenuItem className="text-red-600">
|
|
130
|
-
<LogOut className="mr-2 h-4 w-4" />
|
|
131
|
-
Sign out
|
|
132
|
-
</DropdownMenuItem>
|
|
133
|
-
</DropdownMenuContent>
|
|
134
|
-
</DropdownMenu>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</header>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react'
|
|
2
|
-
import Sidebar from './sidebar'
|
|
3
|
-
import DashboardHeader from './dashboard-header'
|
|
4
|
-
|
|
5
|
-
interface DashboardLayoutProps {
|
|
6
|
-
children: ReactNode
|
|
7
|
-
title?: string
|
|
8
|
-
subtitle?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function DashboardLayout({ children, title, subtitle }: DashboardLayoutProps) {
|
|
12
|
-
return (
|
|
13
|
-
<div className="flex h-screen bg-gray-50">
|
|
14
|
-
{/* Sidebar */}
|
|
15
|
-
<Sidebar />
|
|
16
|
-
|
|
17
|
-
{/* Main content area */}
|
|
18
|
-
<div className="flex-1 flex flex-col overflow-hidden">
|
|
19
|
-
{/* Header */}
|
|
20
|
-
<DashboardHeader title={title} subtitle={subtitle} />
|
|
21
|
-
|
|
22
|
-
{/* Main content */}
|
|
23
|
-
<main className="flex-1 overflow-y-auto p-6">
|
|
24
|
-
{children}
|
|
25
|
-
</main>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Link, useLocation } from "react-router-dom";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
import { Home, LayoutDashboard } from "lucide-react";
|
|
4
|
-
import { BluecopaLogo } from "../ui/bluecopa-logo";
|
|
5
|
-
|
|
6
|
-
const navigation = [
|
|
7
|
-
{ name: "Home", href: "/", icon: Home },
|
|
8
|
-
{ name: "Dashboard", href: "/dashboard", icon: LayoutDashboard },
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
export default function Sidebar() {
|
|
12
|
-
const location = useLocation();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div className="flex h-full w-64 flex-col bg-white border-r border-gray-200">
|
|
16
|
-
{/* Logo */}
|
|
17
|
-
<div className="flex h-16 items-center px-6 border-b border-gray-200">
|
|
18
|
-
<Link to="/" className="flex items-center space-x-2">
|
|
19
|
-
<BluecopaLogo className="h-6 w-6 text-white" />
|
|
20
|
-
<span className="text-xl font-bold text-gray-900">Bluecopa</span>
|
|
21
|
-
</Link>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
{/* Navigation */}
|
|
25
|
-
<nav className="flex-1 space-y-1 px-3 py-4">
|
|
26
|
-
{navigation.map((item) => {
|
|
27
|
-
const isActive = location.pathname === item.href;
|
|
28
|
-
return (
|
|
29
|
-
<Link
|
|
30
|
-
key={item.name}
|
|
31
|
-
to={item.href}
|
|
32
|
-
className={cn(
|
|
33
|
-
"group flex items-center px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
34
|
-
isActive
|
|
35
|
-
? "bg-blue-50 text-blue-700 border-r-2 border-blue-600"
|
|
36
|
-
: "text-gray-700 hover:bg-gray-50 hover:text-gray-900"
|
|
37
|
-
)}
|
|
38
|
-
>
|
|
39
|
-
<item.icon
|
|
40
|
-
className={cn(
|
|
41
|
-
"mr-3 h-5 w-5 flex-shrink-0",
|
|
42
|
-
isActive
|
|
43
|
-
? "text-blue-600"
|
|
44
|
-
: "text-gray-400 group-hover:text-gray-500"
|
|
45
|
-
)}
|
|
46
|
-
/>
|
|
47
|
-
{item.name}
|
|
48
|
-
</Link>
|
|
49
|
-
);
|
|
50
|
-
})}
|
|
51
|
-
</nav>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
}
|