create-bluecopa-react-app 1.0.5 → 1.0.7
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 +5 -5
- package/templates/latest/components.json +22 -0
- package/templates/latest/dist/assets/__federation_expose_App-DsPovvoo.js +147 -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-BZh_TW_6.js +12662 -0
- package/templates/latest/dist/assets/home-CAuoIW4B.js +54951 -0
- package/templates/latest/dist/assets/index-BzNimew1.js +69 -0
- package/templates/latest/dist/assets/index-Clg7n7gy.js +60 -0
- package/templates/latest/dist/assets/index-DMFtQdNS.js +412 -0
- package/templates/latest/dist/assets/remoteEntry.css +3688 -0
- package/templates/latest/dist/assets/remoteEntry.js +88 -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 +19 -12
- package/templates/latest/vite.config.ts +47 -40
- package/templates/latest/.env.example +0 -14
- package/templates/latest/.eslintrc.cjs +0 -42
- package/templates/latest/AGENT.md +0 -282
- package/templates/latest/clean.sh +0 -40
- 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 -56
- package/templates/latest/src/App.tsx +0 -19
- package/templates/latest/src/components/charts/AreaChart.tsx +0 -80
- package/templates/latest/src/components/charts/DonutChart.tsx +0 -73
- package/templates/latest/src/components/charts/SparkAreaChart.tsx +0 -52
- package/templates/latest/src/components/layout/dashboard-header.tsx +0 -139
- package/templates/latest/src/components/layout/dashboard-layout.tsx +0 -37
- package/templates/latest/src/components/layout/navbar.tsx +0 -106
- package/templates/latest/src/components/layout/sidebar.tsx +0 -55
- package/templates/latest/src/components/page/dashboard/DashboardMetrics.tsx +0 -97
- package/templates/latest/src/components/page/dashboard/PaymentMethodsAnalysis.tsx +0 -182
- package/templates/latest/src/components/page/dashboard/RevenueAnalytics.tsx +0 -505
- package/templates/latest/src/components/page/dashboard/SalesAnalytics.tsx +0 -313
- package/templates/latest/src/components/page/dashboard/TransactionsTable.tsx +0 -256
- package/templates/latest/src/components/page/dashboard/dashboard-utils.ts +0 -147
- package/templates/latest/src/components/page/dashboard/dashboard.tsx +0 -185
- 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 -57
- 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 -21
- package/templates/latest/src/components/ui/select.tsx +0 -27
- 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 -87
- package/templates/latest/tsconfig.app.json +0 -32
- package/templates/latest/tsconfig.node.json +0 -14
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useState, useMemo } from 'react'
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
5
|
-
import { Button } from '@/components/ui/button'
|
|
6
|
-
import { Badge } from '@/components/ui/badge'
|
|
7
|
-
import { Input } from '@/components/ui/input'
|
|
8
|
-
import {
|
|
9
|
-
ArrowUpDown,
|
|
10
|
-
ChevronLeft,
|
|
11
|
-
ChevronRight,
|
|
12
|
-
Search,
|
|
13
|
-
Download,
|
|
14
|
-
Filter,
|
|
15
|
-
MoreVertical
|
|
16
|
-
} from 'lucide-react'
|
|
17
|
-
|
|
18
|
-
interface DataGridColumn {
|
|
19
|
-
key: string
|
|
20
|
-
title: string
|
|
21
|
-
sortable?: boolean
|
|
22
|
-
filterable?: boolean
|
|
23
|
-
formatter?: (value: any) => React.ReactNode
|
|
24
|
-
align?: 'left' | 'center' | 'right'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface DataGridProps {
|
|
28
|
-
data: any[]
|
|
29
|
-
columns: DataGridColumn[]
|
|
30
|
-
pageSize?: number
|
|
31
|
-
title?: string
|
|
32
|
-
description?: string
|
|
33
|
-
searchable?: boolean
|
|
34
|
-
exportable?: boolean
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Sample data for demonstration
|
|
38
|
-
const sampleData = [
|
|
39
|
-
{
|
|
40
|
-
id: 'TXN-001',
|
|
41
|
-
customer: 'John Doe',
|
|
42
|
-
amount: 1250.00,
|
|
43
|
-
category: 'Electronics',
|
|
44
|
-
payment_method: 'Credit Card',
|
|
45
|
-
status: 'Completed',
|
|
46
|
-
date: '2024-01-15'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: 'TXN-002',
|
|
50
|
-
customer: 'Jane Smith',
|
|
51
|
-
amount: 890.50,
|
|
52
|
-
category: 'Clothing',
|
|
53
|
-
payment_method: 'PayPal',
|
|
54
|
-
status: 'Pending',
|
|
55
|
-
date: '2024-01-14'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'TXN-003',
|
|
59
|
-
customer: 'Bob Johnson',
|
|
60
|
-
amount: 2100.75,
|
|
61
|
-
category: 'Home & Garden',
|
|
62
|
-
payment_method: 'Bank Transfer',
|
|
63
|
-
status: 'Completed',
|
|
64
|
-
date: '2024-01-13'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'TXN-004',
|
|
68
|
-
customer: 'Alice Brown',
|
|
69
|
-
amount: 675.25,
|
|
70
|
-
category: 'Books',
|
|
71
|
-
payment_method: 'Credit Card',
|
|
72
|
-
status: 'Failed',
|
|
73
|
-
date: '2024-01-12'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 'TXN-005',
|
|
77
|
-
customer: 'Charlie Wilson',
|
|
78
|
-
amount: 1450.00,
|
|
79
|
-
category: 'Sports',
|
|
80
|
-
payment_method: 'Cash',
|
|
81
|
-
status: 'Completed',
|
|
82
|
-
date: '2024-01-11'
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'TXN-006',
|
|
86
|
-
customer: 'Diana Davis',
|
|
87
|
-
amount: 320.80,
|
|
88
|
-
category: 'Beauty',
|
|
89
|
-
payment_method: 'Credit Card',
|
|
90
|
-
status: 'Completed',
|
|
91
|
-
date: '2024-01-10'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: 'TXN-007',
|
|
95
|
-
customer: 'Eve Martinez',
|
|
96
|
-
amount: 1875.90,
|
|
97
|
-
category: 'Electronics',
|
|
98
|
-
payment_method: 'PayPal',
|
|
99
|
-
status: 'Pending',
|
|
100
|
-
date: '2024-01-09'
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: 'TXN-008',
|
|
104
|
-
customer: 'Frank Garcia',
|
|
105
|
-
amount: 540.25,
|
|
106
|
-
category: 'Clothing',
|
|
107
|
-
payment_method: 'Bank Transfer',
|
|
108
|
-
status: 'Completed',
|
|
109
|
-
date: '2024-01-08'
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
|
|
113
|
-
const sampleColumns: DataGridColumn[] = [
|
|
114
|
-
{
|
|
115
|
-
key: 'id',
|
|
116
|
-
title: 'Transaction ID',
|
|
117
|
-
sortable: true,
|
|
118
|
-
filterable: true,
|
|
119
|
-
formatter: (value) => <span className="font-mono text-sm">{value}</span>
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
key: 'customer',
|
|
123
|
-
title: 'Customer',
|
|
124
|
-
sortable: true,
|
|
125
|
-
filterable: true,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
key: 'amount',
|
|
129
|
-
title: 'Amount',
|
|
130
|
-
sortable: true,
|
|
131
|
-
align: 'right',
|
|
132
|
-
formatter: (value) => <span className="font-semibold">${value.toLocaleString()}</span>
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
key: 'category',
|
|
136
|
-
title: 'Category',
|
|
137
|
-
sortable: true,
|
|
138
|
-
filterable: true,
|
|
139
|
-
formatter: (value) => <Badge variant="outline">{value}</Badge>
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
key: 'payment_method',
|
|
143
|
-
title: 'Payment Method',
|
|
144
|
-
sortable: true,
|
|
145
|
-
filterable: true,
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
key: 'status',
|
|
149
|
-
title: 'Status',
|
|
150
|
-
sortable: true,
|
|
151
|
-
filterable: true,
|
|
152
|
-
formatter: (value) => (
|
|
153
|
-
<Badge
|
|
154
|
-
variant={value === 'Completed' ? 'default' : value === 'Pending' ? 'secondary' : 'destructive'}
|
|
155
|
-
>
|
|
156
|
-
{value}
|
|
157
|
-
</Badge>
|
|
158
|
-
)
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
key: 'date',
|
|
162
|
-
title: 'Date',
|
|
163
|
-
sortable: true,
|
|
164
|
-
formatter: (value) => new Date(value).toLocaleDateString()
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
|
|
168
|
-
export function DataGrid({
|
|
169
|
-
data = sampleData,
|
|
170
|
-
columns = sampleColumns,
|
|
171
|
-
pageSize = 10,
|
|
172
|
-
title = "Data Table",
|
|
173
|
-
description = "Advanced data table with sorting, filtering, and pagination",
|
|
174
|
-
searchable = true,
|
|
175
|
-
exportable = true
|
|
176
|
-
}: DataGridProps) {
|
|
177
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
178
|
-
const [sortColumn, setSortColumn] = useState<string | null>(null)
|
|
179
|
-
const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc')
|
|
180
|
-
const [searchTerm, setSearchTerm] = useState('')
|
|
181
|
-
const [filters, setFilters] = useState<Record<string, string>>({})
|
|
182
|
-
|
|
183
|
-
// Filter and search data
|
|
184
|
-
const filteredData = useMemo(() => {
|
|
185
|
-
let result = data
|
|
186
|
-
|
|
187
|
-
// Apply search
|
|
188
|
-
if (searchTerm) {
|
|
189
|
-
result = result.filter(row =>
|
|
190
|
-
Object.values(row).some(value =>
|
|
191
|
-
String(value).toLowerCase().includes(searchTerm.toLowerCase())
|
|
192
|
-
)
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Apply column filters
|
|
197
|
-
Object.entries(filters).forEach(([column, filterValue]) => {
|
|
198
|
-
if (filterValue) {
|
|
199
|
-
result = result.filter(row =>
|
|
200
|
-
String(row[column]).toLowerCase().includes(filterValue.toLowerCase())
|
|
201
|
-
)
|
|
202
|
-
}
|
|
203
|
-
})
|
|
204
|
-
|
|
205
|
-
return result
|
|
206
|
-
}, [data, searchTerm, filters])
|
|
207
|
-
|
|
208
|
-
// Sort data
|
|
209
|
-
const sortedData = useMemo(() => {
|
|
210
|
-
if (!sortColumn) return filteredData
|
|
211
|
-
|
|
212
|
-
return [...filteredData].sort((a, b) => {
|
|
213
|
-
const aValue = a[sortColumn]
|
|
214
|
-
const bValue = b[sortColumn]
|
|
215
|
-
|
|
216
|
-
let comparison = 0
|
|
217
|
-
if (aValue < bValue) comparison = -1
|
|
218
|
-
if (aValue > bValue) comparison = 1
|
|
219
|
-
|
|
220
|
-
return sortDirection === 'desc' ? comparison * -1 : comparison
|
|
221
|
-
})
|
|
222
|
-
}, [filteredData, sortColumn, sortDirection])
|
|
223
|
-
|
|
224
|
-
// Paginate data
|
|
225
|
-
const paginatedData = useMemo(() => {
|
|
226
|
-
const startIndex = (currentPage - 1) * pageSize
|
|
227
|
-
return sortedData.slice(startIndex, startIndex + pageSize)
|
|
228
|
-
}, [sortedData, currentPage, pageSize])
|
|
229
|
-
|
|
230
|
-
const totalPages = Math.ceil(sortedData.length / pageSize)
|
|
231
|
-
|
|
232
|
-
const handleSort = (column: string) => {
|
|
233
|
-
if (sortColumn === column) {
|
|
234
|
-
setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc')
|
|
235
|
-
} else {
|
|
236
|
-
setSortColumn(column)
|
|
237
|
-
setSortDirection('asc')
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const handleColumnFilter = (column: string, value: string) => {
|
|
242
|
-
setFilters(prev => ({ ...prev, [column]: value }))
|
|
243
|
-
setCurrentPage(1) // Reset to first page when filtering
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
const exportToCSV = () => {
|
|
247
|
-
const headers = columns.map(col => col.title)
|
|
248
|
-
const csvContent = [
|
|
249
|
-
headers.join(','),
|
|
250
|
-
...sortedData.map(row =>
|
|
251
|
-
columns.map(col => row[col.key]).join(',')
|
|
252
|
-
)
|
|
253
|
-
].join('\n')
|
|
254
|
-
|
|
255
|
-
const blob = new Blob([csvContent], { type: 'text/csv' })
|
|
256
|
-
const url = window.URL.createObjectURL(blob)
|
|
257
|
-
const a = document.createElement('a')
|
|
258
|
-
a.href = url
|
|
259
|
-
a.download = 'data-export.csv'
|
|
260
|
-
a.click()
|
|
261
|
-
window.URL.revokeObjectURL(url)
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return (
|
|
265
|
-
<Card>
|
|
266
|
-
<CardHeader>
|
|
267
|
-
<div className="flex items-center justify-between">
|
|
268
|
-
<div>
|
|
269
|
-
<CardTitle>{title}</CardTitle>
|
|
270
|
-
<CardDescription>{description}</CardDescription>
|
|
271
|
-
</div>
|
|
272
|
-
<div className="flex items-center space-x-2">
|
|
273
|
-
{exportable && (
|
|
274
|
-
<Button variant="outline" size="sm" onClick={exportToCSV}>
|
|
275
|
-
<Download className="h-4 w-4 mr-2" />
|
|
276
|
-
Export
|
|
277
|
-
</Button>
|
|
278
|
-
)}
|
|
279
|
-
<Button variant="outline" size="sm">
|
|
280
|
-
<Filter className="h-4 w-4 mr-2" />
|
|
281
|
-
Filters
|
|
282
|
-
</Button>
|
|
283
|
-
<Button variant="outline" size="sm">
|
|
284
|
-
<MoreVertical className="h-4 w-4" />
|
|
285
|
-
</Button>
|
|
286
|
-
</div>
|
|
287
|
-
</div>
|
|
288
|
-
|
|
289
|
-
{searchable && (
|
|
290
|
-
<div className="flex items-center space-x-2 mt-4">
|
|
291
|
-
<div className="relative flex-1 max-w-sm">
|
|
292
|
-
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" />
|
|
293
|
-
<Input
|
|
294
|
-
placeholder="Search all columns..."
|
|
295
|
-
value={searchTerm}
|
|
296
|
-
onChange={(e) => setSearchTerm(e.target.value)}
|
|
297
|
-
className="pl-10"
|
|
298
|
-
/>
|
|
299
|
-
</div>
|
|
300
|
-
<div className="text-sm text-gray-500">
|
|
301
|
-
Showing {sortedData.length} of {data.length} results
|
|
302
|
-
</div>
|
|
303
|
-
</div>
|
|
304
|
-
)}
|
|
305
|
-
</CardHeader>
|
|
306
|
-
|
|
307
|
-
<CardContent>
|
|
308
|
-
<div className="overflow-x-auto">
|
|
309
|
-
<table className="w-full border-collapse">
|
|
310
|
-
<thead>
|
|
311
|
-
<tr className="border-b">
|
|
312
|
-
{columns.map((column) => (
|
|
313
|
-
<th
|
|
314
|
-
key={column.key}
|
|
315
|
-
className={`px-4 py-3 text-left font-medium text-gray-900 ${
|
|
316
|
-
column.align === 'right' ? 'text-right' :
|
|
317
|
-
column.align === 'center' ? 'text-center' : 'text-left'
|
|
318
|
-
}`}
|
|
319
|
-
>
|
|
320
|
-
<div className="flex items-center space-x-2">
|
|
321
|
-
<span>{column.title}</span>
|
|
322
|
-
{column.sortable && (
|
|
323
|
-
<Button
|
|
324
|
-
variant="ghost"
|
|
325
|
-
size="sm"
|
|
326
|
-
className="h-6 w-6 p-0"
|
|
327
|
-
onClick={() => handleSort(column.key)}
|
|
328
|
-
>
|
|
329
|
-
<ArrowUpDown className="h-3 w-3" />
|
|
330
|
-
</Button>
|
|
331
|
-
)}
|
|
332
|
-
</div>
|
|
333
|
-
{column.filterable && (
|
|
334
|
-
<Input
|
|
335
|
-
placeholder="Filter..."
|
|
336
|
-
size={10}
|
|
337
|
-
className="mt-1 h-7 text-xs"
|
|
338
|
-
onChange={(e) => handleColumnFilter(column.key, e.target.value)}
|
|
339
|
-
/>
|
|
340
|
-
)}
|
|
341
|
-
</th>
|
|
342
|
-
))}
|
|
343
|
-
</tr>
|
|
344
|
-
</thead>
|
|
345
|
-
<tbody>
|
|
346
|
-
{paginatedData.map((row, index) => (
|
|
347
|
-
<tr
|
|
348
|
-
key={index}
|
|
349
|
-
className="border-b hover:bg-gray-50 transition-colors"
|
|
350
|
-
>
|
|
351
|
-
{columns.map((column) => (
|
|
352
|
-
<td
|
|
353
|
-
key={column.key}
|
|
354
|
-
className={`px-4 py-3 ${
|
|
355
|
-
column.align === 'right' ? 'text-right' :
|
|
356
|
-
column.align === 'center' ? 'text-center' : 'text-left'
|
|
357
|
-
}`}
|
|
358
|
-
>
|
|
359
|
-
{column.formatter ? column.formatter(row[column.key]) : row[column.key]}
|
|
360
|
-
</td>
|
|
361
|
-
))}
|
|
362
|
-
</tr>
|
|
363
|
-
))}
|
|
364
|
-
</tbody>
|
|
365
|
-
</table>
|
|
366
|
-
</div>
|
|
367
|
-
|
|
368
|
-
{/* Pagination */}
|
|
369
|
-
<div className="flex items-center justify-between mt-4">
|
|
370
|
-
<div className="text-sm text-gray-500">
|
|
371
|
-
Page {currentPage} of {totalPages} ({sortedData.length} total items)
|
|
372
|
-
</div>
|
|
373
|
-
<div className="flex items-center space-x-2">
|
|
374
|
-
<Button
|
|
375
|
-
variant="outline"
|
|
376
|
-
size="sm"
|
|
377
|
-
onClick={() => setCurrentPage(Math.max(1, currentPage - 1))}
|
|
378
|
-
disabled={currentPage === 1}
|
|
379
|
-
>
|
|
380
|
-
<ChevronLeft className="h-4 w-4" />
|
|
381
|
-
</Button>
|
|
382
|
-
|
|
383
|
-
{/* Page numbers */}
|
|
384
|
-
{Array.from({ length: Math.min(5, totalPages) }, (_, i) => {
|
|
385
|
-
const pageNum = Math.max(1, currentPage - 2) + i
|
|
386
|
-
if (pageNum > totalPages) return null
|
|
387
|
-
|
|
388
|
-
return (
|
|
389
|
-
<Button
|
|
390
|
-
key={pageNum}
|
|
391
|
-
variant={pageNum === currentPage ? "default" : "outline"}
|
|
392
|
-
size="sm"
|
|
393
|
-
onClick={() => setCurrentPage(pageNum)}
|
|
394
|
-
>
|
|
395
|
-
{pageNum}
|
|
396
|
-
</Button>
|
|
397
|
-
)
|
|
398
|
-
})}
|
|
399
|
-
|
|
400
|
-
<Button
|
|
401
|
-
variant="outline"
|
|
402
|
-
size="sm"
|
|
403
|
-
onClick={() => setCurrentPage(Math.min(totalPages, currentPage + 1))}
|
|
404
|
-
disabled={currentPage === totalPages}
|
|
405
|
-
>
|
|
406
|
-
<ChevronRight className="h-4 w-4" />
|
|
407
|
-
</Button>
|
|
408
|
-
</div>
|
|
409
|
-
</div>
|
|
410
|
-
</CardContent>
|
|
411
|
-
</Card>
|
|
412
|
-
)
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// Example usage component
|
|
416
|
-
export function TableExamples() {
|
|
417
|
-
return (
|
|
418
|
-
<div className="space-y-8">
|
|
419
|
-
<DataGrid
|
|
420
|
-
data={sampleData}
|
|
421
|
-
columns={sampleColumns}
|
|
422
|
-
title="Transaction Records"
|
|
423
|
-
description="Complete transaction history with advanced filtering and sorting"
|
|
424
|
-
pageSize={5}
|
|
425
|
-
/>
|
|
426
|
-
|
|
427
|
-
{/* Compact version */}
|
|
428
|
-
<DataGrid
|
|
429
|
-
data={sampleData.slice(0, 4)}
|
|
430
|
-
columns={sampleColumns.slice(0, 4)}
|
|
431
|
-
title="Quick Overview"
|
|
432
|
-
description="Simplified view of recent transactions"
|
|
433
|
-
pageSize={10}
|
|
434
|
-
searchable={false}
|
|
435
|
-
exportable={false}
|
|
436
|
-
/>
|
|
437
|
-
</div>
|
|
438
|
-
)
|
|
439
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-background text-foreground",
|
|
12
|
-
destructive:
|
|
13
|
-
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: "default",
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
const Alert = React.forwardRef<
|
|
23
|
-
HTMLDivElement,
|
|
24
|
-
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
25
|
-
>(({ className, variant, ...props }, ref) => (
|
|
26
|
-
<div
|
|
27
|
-
ref={ref}
|
|
28
|
-
role="alert"
|
|
29
|
-
className={cn(alertVariants({ variant }), className)}
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
))
|
|
33
|
-
Alert.displayName = "Alert"
|
|
34
|
-
|
|
35
|
-
const AlertTitle = React.forwardRef<
|
|
36
|
-
HTMLParagraphElement,
|
|
37
|
-
React.HTMLAttributes<HTMLHeadingElement>
|
|
38
|
-
>(({ className, ...props }, ref) => (
|
|
39
|
-
<h5
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
))
|
|
45
|
-
AlertTitle.displayName = "AlertTitle"
|
|
46
|
-
|
|
47
|
-
const AlertDescription = React.forwardRef<
|
|
48
|
-
HTMLParagraphElement,
|
|
49
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<div
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
))
|
|
57
|
-
AlertDescription.displayName = "AlertDescription"
|
|
58
|
-
|
|
59
|
-
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
const Avatar = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<AvatarPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
))
|
|
21
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
22
|
-
|
|
23
|
-
const AvatarImage = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<AvatarPrimitive.Image
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn("aspect-square h-full w-full", className)}
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
))
|
|
33
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
34
|
-
|
|
35
|
-
const AvatarFallback = React.forwardRef<
|
|
36
|
-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
37
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
38
|
-
>(({ className, ...props }, ref) => (
|
|
39
|
-
<AvatarPrimitive.Fallback
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn(
|
|
42
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
43
|
-
className
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
))
|
|
48
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
49
|
-
|
|
50
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
const badgeVariants = cva(
|
|
7
|
-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default:
|
|
12
|
-
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
|
-
secondary:
|
|
14
|
-
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
-
destructive:
|
|
16
|
-
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
17
|
-
outline: "text-foreground",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
variant: "default",
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
export interface BadgeProps
|
|
27
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
-
VariantProps<typeof badgeVariants> {}
|
|
29
|
-
|
|
30
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
-
return (
|
|
32
|
-
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { Badge, badgeVariants }
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
interface BluecopaLogoProps {
|
|
4
|
-
className?: string
|
|
5
|
-
width?: number
|
|
6
|
-
height?: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const BluecopaLogo: React.FC<BluecopaLogoProps> = ({
|
|
10
|
-
className = "",
|
|
11
|
-
width = 24,
|
|
12
|
-
height = 24
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<svg
|
|
16
|
-
id="Layer_2"
|
|
17
|
-
data-name="Layer 2"
|
|
18
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
-
viewBox="0 0 1820 1774.9"
|
|
20
|
-
width={width}
|
|
21
|
-
height={height}
|
|
22
|
-
className={className}
|
|
23
|
-
role="img"
|
|
24
|
-
aria-hidden="true"
|
|
25
|
-
focusable="false"
|
|
26
|
-
>
|
|
27
|
-
<defs>
|
|
28
|
-
<style>
|
|
29
|
-
{`.cls-1, .cls-2 {
|
|
30
|
-
fill: #fff;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.cls-3 {
|
|
34
|
-
fill: #3548ff;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.cls-3, .cls-4, .cls-2 {
|
|
38
|
-
isolation: isolate;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.cls-4 {
|
|
42
|
-
fill: #8ac2ff;
|
|
43
|
-
}`}
|
|
44
|
-
</style>
|
|
45
|
-
</defs>
|
|
46
|
-
<g id="Layer_1-2" data-name="Layer 1">
|
|
47
|
-
<circle className="cls-1" cx="1054.53" cy="779.52" r="386.21"/>
|
|
48
|
-
<g>
|
|
49
|
-
<path className="cls-4" d="M5.91,1004.47L0,1768.96l764.5,5.91c422.08,3.27,767.15-336.52,770.42-758.58,3.26-422.06-336.51-767.14-758.59-770.41C350.68,242.59,9.18,582.4,5.91,1004.47Z"/>
|
|
50
|
-
<path className="cls-3" d="M1820,764.52V0h-764.52C633.38,0,290.95,342.44,290.95,764.52s342.43,764.52,764.52,764.52,764.52-342.44,764.52-764.52Z"/>
|
|
51
|
-
<circle className="cls-2" cx="1055.48" cy="780.55" r="382.26"/>
|
|
52
|
-
</g>
|
|
53
|
-
</g>
|
|
54
|
-
</svg>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
const buttonVariants = cva(
|
|
10
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
15
|
-
destructive:
|
|
16
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
17
|
-
outline:
|
|
18
|
-
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
19
|
-
secondary:
|
|
20
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
22
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
default: "h-10 px-4 py-2",
|
|
26
|
-
sm: "h-9 rounded-md px-3",
|
|
27
|
-
lg: "h-11 rounded-md px-8",
|
|
28
|
-
icon: "h-10 w-10",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
variant: "default",
|
|
33
|
-
size: "default",
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
export interface ButtonProps
|
|
39
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
40
|
-
VariantProps<typeof buttonVariants> {
|
|
41
|
-
asChild?: boolean
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
45
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
46
|
-
const Comp = asChild ? Slot : "button"
|
|
47
|
-
return (
|
|
48
|
-
<Comp
|
|
49
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
50
|
-
ref={ref}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
Button.displayName = "Button"
|
|
57
|
-
|
|
58
|
-
export { Button, buttonVariants }
|