@moontra/moonui-pro 2.20.1 → 2.20.3
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/dist/index.d.ts +691 -261
- package/dist/index.mjs +7418 -4934
- package/package.json +11 -5
- package/plugin/index.d.ts +86 -0
- package/plugin/index.js +308 -0
- package/scripts/postbuild.js +27 -0
- package/scripts/postinstall.js +176 -23
- package/src/__tests__/use-intersection-observer.test.tsx +0 -216
- package/src/__tests__/use-local-storage.test.tsx +0 -174
- package/src/__tests__/use-pro-access.test.tsx +0 -183
- package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
- package/src/components/advanced-chart/index.tsx +0 -1242
- package/src/components/advanced-forms/index.tsx +0 -426
- package/src/components/animated-button/index.tsx +0 -385
- package/src/components/calendar/event-dialog.tsx +0 -372
- package/src/components/calendar/index.tsx +0 -1073
- package/src/components/calendar-pro/index.tsx +0 -1697
- package/src/components/color-picker/index.tsx +0 -432
- package/src/components/credit-card-input/index.tsx +0 -406
- package/src/components/dashboard/dashboard-grid.tsx +0 -462
- package/src/components/dashboard/demo.tsx +0 -425
- package/src/components/dashboard/index.tsx +0 -1046
- package/src/components/dashboard/time-range-picker.tsx +0 -336
- package/src/components/dashboard/types.ts +0 -222
- package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
- package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
- package/src/components/dashboard/widgets/metric-card.tsx +0 -343
- package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
- package/src/components/data-table/data-table-column-toggle.tsx +0 -169
- package/src/components/data-table/data-table-export.ts +0 -156
- package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
- package/src/components/data-table/data-table.test.tsx +0 -187
- package/src/components/data-table/index.tsx +0 -845
- package/src/components/draggable-list/index.tsx +0 -100
- package/src/components/enhanced/badge.tsx +0 -191
- package/src/components/enhanced/button.tsx +0 -362
- package/src/components/enhanced/card.tsx +0 -266
- package/src/components/enhanced/dialog.tsx +0 -246
- package/src/components/enhanced/index.ts +0 -4
- package/src/components/error-boundary/index.tsx +0 -109
- package/src/components/file-upload/file-upload.test.tsx +0 -243
- package/src/components/file-upload/index.tsx +0 -1660
- package/src/components/floating-action-button/index.tsx +0 -206
- package/src/components/form-wizard/form-wizard-context.tsx +0 -307
- package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
- package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
- package/src/components/form-wizard/form-wizard-step.tsx +0 -111
- package/src/components/form-wizard/index.tsx +0 -102
- package/src/components/form-wizard/types.ts +0 -76
- package/src/components/gesture-drawer/index.tsx +0 -551
- package/src/components/github-stars/github-api.ts +0 -426
- package/src/components/github-stars/hooks.ts +0 -516
- package/src/components/github-stars/index.tsx +0 -375
- package/src/components/github-stars/types.ts +0 -148
- package/src/components/github-stars/variants.tsx +0 -513
- package/src/components/health-check/index.tsx +0 -439
- package/src/components/hover-card-3d/index.tsx +0 -530
- package/src/components/index.ts +0 -128
- package/src/components/internal/index.ts +0 -78
- package/src/components/kanban/add-card-modal.tsx +0 -502
- package/src/components/kanban/card-detail-modal.tsx +0 -761
- package/src/components/kanban/index.ts +0 -13
- package/src/components/kanban/kanban.tsx +0 -1684
- package/src/components/kanban/types.ts +0 -168
- package/src/components/lazy-component/index.tsx +0 -823
- package/src/components/license-error/index.tsx +0 -29
- package/src/components/magnetic-button/index.tsx +0 -167
- package/src/components/memory-efficient-data/index.tsx +0 -1016
- package/src/components/moonui-quiz-form/index.tsx +0 -817
- package/src/components/optimized-image/index.tsx +0 -425
- package/src/components/performance-debugger/index.tsx +0 -589
- package/src/components/performance-monitor/index.tsx +0 -794
- package/src/components/phone-number-input/index.tsx +0 -338
- package/src/components/pinch-zoom/index.tsx +0 -566
- package/src/components/quiz-form/index.tsx +0 -479
- package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
- package/src/components/rich-text-editor/index.tsx +0 -2324
- package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
- package/src/components/rich-text-editor/slash-commands.css +0 -35
- package/src/components/rich-text-editor/table-styles.css +0 -65
- package/src/components/sidebar/index.tsx +0 -865
- package/src/components/spotlight-card/index.tsx +0 -191
- package/src/components/swipeable-card/index.tsx +0 -100
- package/src/components/timeline/index.tsx +0 -1148
- package/src/components/ui/accordion.tsx +0 -73
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -141
- package/src/components/ui/aspect-ratio.tsx +0 -245
- package/src/components/ui/avatar.tsx +0 -153
- package/src/components/ui/badge.tsx +0 -228
- package/src/components/ui/breadcrumb.tsx +0 -214
- package/src/components/ui/button.tsx +0 -222
- package/src/components/ui/calendar.tsx +0 -387
- package/src/components/ui/card.tsx +0 -214
- package/src/components/ui/checkbox.tsx +0 -259
- package/src/components/ui/collapsible.tsx +0 -135
- package/src/components/ui/color-picker.tsx +0 -97
- package/src/components/ui/command.tsx +0 -225
- package/src/components/ui/dialog.tsx +0 -334
- package/src/components/ui/dropdown-menu.tsx +0 -218
- package/src/components/ui/gesture-drawer.tsx +0 -11
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/index.ts +0 -190
- package/src/components/ui/input.tsx +0 -222
- package/src/components/ui/label.tsx +0 -29
- package/src/components/ui/lightbox.tsx +0 -606
- package/src/components/ui/magnetic-button.tsx +0 -129
- package/src/components/ui/media-gallery.tsx +0 -612
- package/src/components/ui/pagination.tsx +0 -123
- package/src/components/ui/popover.tsx +0 -185
- package/src/components/ui/progress.tsx +0 -30
- package/src/components/ui/radio-group.tsx +0 -257
- package/src/components/ui/scroll-area.tsx +0 -47
- package/src/components/ui/select.tsx +0 -374
- package/src/components/ui/separator.tsx +0 -145
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/skeleton.tsx +0 -20
- package/src/components/ui/slider.tsx +0 -354
- package/src/components/ui/spotlight-card.tsx +0 -119
- package/src/components/ui/switch.tsx +0 -86
- package/src/components/ui/table.tsx +0 -329
- package/src/components/ui/tabs.tsx +0 -198
- package/src/components/ui/textarea.tsx +0 -28
- package/src/components/ui/toast.tsx +0 -317
- package/src/components/ui/toggle.tsx +0 -119
- package/src/components/ui/tooltip.tsx +0 -151
- package/src/components/virtual-list/index.tsx +0 -668
- package/src/hooks/use-chart.ts +0 -205
- package/src/hooks/use-data-table.ts +0 -182
- package/src/hooks/use-docs-pro-access.ts +0 -13
- package/src/hooks/use-license-check.ts +0 -65
- package/src/hooks/use-subscription.ts +0 -19
- package/src/hooks/use-toast.ts +0 -15
- package/src/index.ts +0 -14
- package/src/lib/ai-providers.ts +0 -377
- package/src/lib/component-metadata.ts +0 -18
- package/src/lib/micro-interactions.ts +0 -255
- package/src/lib/paddle.ts +0 -17
- package/src/lib/utils.ts +0 -6
- package/src/patterns/login-form/index.tsx +0 -276
- package/src/patterns/login-form/types.ts +0 -67
- package/src/setupTests.ts +0 -41
- package/src/styles/advanced-chart.css +0 -239
- package/src/styles/calendar.css +0 -35
- package/src/styles/design-system.css +0 -363
- package/src/styles/index.css +0 -85
- package/src/styles/tailwind.css +0 -7
- package/src/styles/tokens.css +0 -455
- package/src/types/moonui.d.ts +0 -22
- package/src/types/next-auth.d.ts +0 -21
- package/src/use-intersection-observer.tsx +0 -154
- package/src/use-local-storage.tsx +0 -71
- package/src/use-paddle.ts +0 -138
- package/src/use-performance-optimizer.ts +0 -389
- package/src/use-pro-access.ts +0 -141
- package/src/use-scroll-animation.ts +0 -219
- package/src/use-subscription.ts +0 -37
- package/src/use-toast.ts +0 -32
- package/src/utils/chart-helpers.ts +0 -357
- package/src/utils/cn.ts +0 -6
- package/src/utils/data-processing.ts +0 -151
- package/src/utils/license-validator.tsx +0 -183
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { motion } from "framer-motion"
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card"
|
|
4
|
-
import { Badge } from "../ui/badge"
|
|
5
|
-
import { Button } from "../ui/button"
|
|
6
|
-
import { Progress } from "../ui/progress"
|
|
7
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"
|
|
8
|
-
import {
|
|
9
|
-
Star,
|
|
10
|
-
GitFork,
|
|
11
|
-
Eye,
|
|
12
|
-
Users,
|
|
13
|
-
ExternalLink,
|
|
14
|
-
Github,
|
|
15
|
-
TrendingUp,
|
|
16
|
-
BarChart3,
|
|
17
|
-
Activity,
|
|
18
|
-
Code2,
|
|
19
|
-
Calendar,
|
|
20
|
-
Package,
|
|
21
|
-
Download,
|
|
22
|
-
} from "lucide-react"
|
|
23
|
-
import { GitHubRepository, GitHubStats, LanguageStats } from "./types"
|
|
24
|
-
import { formatNumber, formatDate, LANGUAGE_COLORS } from "./github-api"
|
|
25
|
-
import { cn } from "../../lib/utils"
|
|
26
|
-
|
|
27
|
-
interface BaseVariantProps {
|
|
28
|
-
repos: GitHubRepository[]
|
|
29
|
-
stats: GitHubStats | null
|
|
30
|
-
loading?: boolean
|
|
31
|
-
className?: string
|
|
32
|
-
onRepositoryClick?: (repo: GitHubRepository) => void
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Minimal variant - Single line with key stats
|
|
36
|
-
export const MinimalVariant: React.FC<BaseVariantProps> = ({ repos, stats, className }) => {
|
|
37
|
-
if (!stats) return null
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className={cn("flex items-center gap-4 text-sm", className)}>
|
|
41
|
-
<button
|
|
42
|
-
className="flex items-center gap-2 hover:text-primary transition-colors"
|
|
43
|
-
onClick={() => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}`, '_blank')}
|
|
44
|
-
>
|
|
45
|
-
<Github className="h-4 w-4" />
|
|
46
|
-
<span className="font-medium">{repos.length} repositories</span>
|
|
47
|
-
</button>
|
|
48
|
-
<button
|
|
49
|
-
className="flex items-center gap-2 hover:text-yellow-600 transition-colors"
|
|
50
|
-
onClick={() => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, '_blank')}
|
|
51
|
-
>
|
|
52
|
-
<Star className="h-4 w-4 text-yellow-500" />
|
|
53
|
-
<span>{formatNumber(stats.totalStars)} stars</span>
|
|
54
|
-
</button>
|
|
55
|
-
<button
|
|
56
|
-
className="flex items-center gap-2 hover:text-blue-600 transition-colors"
|
|
57
|
-
onClick={() => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=fork&language=&sort=`, '_blank')}
|
|
58
|
-
>
|
|
59
|
-
<GitFork className="h-4 w-4 text-blue-500" />
|
|
60
|
-
<span>{formatNumber(stats.totalForks)} forks</span>
|
|
61
|
-
</button>
|
|
62
|
-
</div>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Compact variant - Small card with essential info
|
|
67
|
-
export const CompactVariant: React.FC<BaseVariantProps> = ({
|
|
68
|
-
repos,
|
|
69
|
-
stats,
|
|
70
|
-
className,
|
|
71
|
-
onRepositoryClick,
|
|
72
|
-
}) => {
|
|
73
|
-
if (!stats) return null
|
|
74
|
-
|
|
75
|
-
const topRepos = repos.slice(0, 3)
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<Card className={cn("w-full max-w-sm", className)}>
|
|
79
|
-
<CardContent className="p-4">
|
|
80
|
-
<div className="space-y-4">
|
|
81
|
-
<div className="flex items-center justify-between">
|
|
82
|
-
<div className="flex items-center gap-2">
|
|
83
|
-
<Github className="h-5 w-5" />
|
|
84
|
-
<span className="font-semibold">{repos.length} Repos</span>
|
|
85
|
-
</div>
|
|
86
|
-
<div className="flex items-center gap-3 text-sm">
|
|
87
|
-
<button
|
|
88
|
-
className="flex items-center gap-1 hover:text-yellow-600 transition-colors cursor-pointer"
|
|
89
|
-
onClick={() => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/stargazers`, '_blank')}
|
|
90
|
-
>
|
|
91
|
-
<Star className="h-4 w-4 text-yellow-500" />
|
|
92
|
-
<span>{formatNumber(stats.totalStars)}</span>
|
|
93
|
-
</button>
|
|
94
|
-
<button
|
|
95
|
-
className="flex items-center gap-1 hover:text-blue-600 transition-colors cursor-pointer"
|
|
96
|
-
onClick={() => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/forks`, '_blank')}
|
|
97
|
-
>
|
|
98
|
-
<GitFork className="h-4 w-4 text-blue-500" />
|
|
99
|
-
<span>{formatNumber(stats.totalForks)}</span>
|
|
100
|
-
</button>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div className="space-y-2">
|
|
105
|
-
{topRepos.map((repo) => (
|
|
106
|
-
<div
|
|
107
|
-
key={repo.id}
|
|
108
|
-
className="flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors"
|
|
109
|
-
onClick={() => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, '_blank')}
|
|
110
|
-
>
|
|
111
|
-
<div className="flex-1 min-w-0">
|
|
112
|
-
<p className="text-sm font-medium truncate">{repo.name}</p>
|
|
113
|
-
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
|
114
|
-
{repo.language && (
|
|
115
|
-
<div className="flex items-center gap-1">
|
|
116
|
-
<div
|
|
117
|
-
className="w-2 h-2 rounded-full"
|
|
118
|
-
style={{ backgroundColor: LANGUAGE_COLORS[repo.language] || "#6b7280" }}
|
|
119
|
-
/>
|
|
120
|
-
<span>{repo.language}</span>
|
|
121
|
-
</div>
|
|
122
|
-
)}
|
|
123
|
-
<div className="flex items-center gap-1">
|
|
124
|
-
<Star className="h-3 w-3" />
|
|
125
|
-
<span>{formatNumber(repo.stargazers_count)}</span>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
<ExternalLink className="h-3 w-3 text-muted-foreground" />
|
|
130
|
-
</div>
|
|
131
|
-
))}
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</CardContent>
|
|
135
|
-
</Card>
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Card variant - Medium-sized cards in a grid
|
|
140
|
-
export const CardVariant: React.FC<BaseVariantProps> = ({
|
|
141
|
-
repos,
|
|
142
|
-
className,
|
|
143
|
-
onRepositoryClick,
|
|
144
|
-
}) => {
|
|
145
|
-
return (
|
|
146
|
-
<div className={cn("grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", className)}>
|
|
147
|
-
{repos.map((repo, index) => (
|
|
148
|
-
<motion.div
|
|
149
|
-
key={repo.id}
|
|
150
|
-
initial={{ opacity: 0, y: 20 }}
|
|
151
|
-
animate={{ opacity: 1, y: 0 }}
|
|
152
|
-
transition={{ delay: index * 0.05 }}
|
|
153
|
-
>
|
|
154
|
-
<Card
|
|
155
|
-
className="h-full hover:shadow-lg transition-shadow cursor-pointer group"
|
|
156
|
-
onClick={() => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, '_blank')}
|
|
157
|
-
>
|
|
158
|
-
<CardContent className="p-6">
|
|
159
|
-
<div className="space-y-4">
|
|
160
|
-
<div className="flex items-start justify-between">
|
|
161
|
-
<div className="flex-1">
|
|
162
|
-
<h3 className="font-semibold text-lg mb-1">{repo.name}</h3>
|
|
163
|
-
<p className="text-sm text-muted-foreground line-clamp-2">
|
|
164
|
-
{repo.description || "No description available"}
|
|
165
|
-
</p>
|
|
166
|
-
</div>
|
|
167
|
-
<ExternalLink className="h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
{repo.topics.length > 0 && (
|
|
171
|
-
<div className="flex flex-wrap gap-1">
|
|
172
|
-
{repo.topics.slice(0, 3).map((topic) => (
|
|
173
|
-
<Badge key={topic} variant="secondary" className="text-xs">
|
|
174
|
-
{topic}
|
|
175
|
-
</Badge>
|
|
176
|
-
))}
|
|
177
|
-
</div>
|
|
178
|
-
)}
|
|
179
|
-
|
|
180
|
-
<div className="flex items-center justify-between text-sm">
|
|
181
|
-
<div className="flex items-center gap-3">
|
|
182
|
-
{repo.language && (
|
|
183
|
-
<div className="flex items-center gap-1">
|
|
184
|
-
<div
|
|
185
|
-
className="w-3 h-3 rounded-full"
|
|
186
|
-
style={{ backgroundColor: LANGUAGE_COLORS[repo.language] || "#6b7280" }}
|
|
187
|
-
/>
|
|
188
|
-
<span>{repo.language}</span>
|
|
189
|
-
</div>
|
|
190
|
-
)}
|
|
191
|
-
</div>
|
|
192
|
-
<div className="flex items-center gap-3">
|
|
193
|
-
<button
|
|
194
|
-
className="flex items-center gap-1 hover:text-yellow-600 transition-colors"
|
|
195
|
-
onClick={(e) => {
|
|
196
|
-
e.stopPropagation()
|
|
197
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, '_blank')
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
<Star className="h-4 w-4 text-yellow-500" />
|
|
201
|
-
<span>{formatNumber(repo.stargazers_count)}</span>
|
|
202
|
-
</button>
|
|
203
|
-
<button
|
|
204
|
-
className="flex items-center gap-1 hover:text-blue-600 transition-colors"
|
|
205
|
-
onClick={(e) => {
|
|
206
|
-
e.stopPropagation()
|
|
207
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, '_blank')
|
|
208
|
-
}}
|
|
209
|
-
>
|
|
210
|
-
<GitFork className="h-4 w-4 text-blue-500" />
|
|
211
|
-
<span>{formatNumber(repo.forks_count)}</span>
|
|
212
|
-
</button>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
</CardContent>
|
|
217
|
-
</Card>
|
|
218
|
-
</motion.div>
|
|
219
|
-
))}
|
|
220
|
-
</div>
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Detailed variant - Full information with tabs
|
|
225
|
-
export const DetailedVariant: React.FC<BaseVariantProps & { onExport?: () => void }> = ({
|
|
226
|
-
repos,
|
|
227
|
-
stats,
|
|
228
|
-
className,
|
|
229
|
-
onRepositoryClick,
|
|
230
|
-
onExport,
|
|
231
|
-
}) => {
|
|
232
|
-
if (!stats) return null
|
|
233
|
-
|
|
234
|
-
return (
|
|
235
|
-
<Card className={cn("w-full", className)}>
|
|
236
|
-
<CardHeader className="pb-4">
|
|
237
|
-
<div className="flex items-center justify-between">
|
|
238
|
-
<CardTitle className="flex items-center gap-2">
|
|
239
|
-
<Github className="h-6 w-6" />
|
|
240
|
-
GitHub Repository Analytics
|
|
241
|
-
</CardTitle>
|
|
242
|
-
<div className="flex items-center gap-2">
|
|
243
|
-
{repos[0] && (
|
|
244
|
-
<Button
|
|
245
|
-
onClick={() => window.open(`https://github.com/${repos[0].owner?.login}`, '_blank')}
|
|
246
|
-
variant="outline"
|
|
247
|
-
size="sm"
|
|
248
|
-
>
|
|
249
|
-
<Github className="h-4 w-4 mr-2" />
|
|
250
|
-
View Profile
|
|
251
|
-
</Button>
|
|
252
|
-
)}
|
|
253
|
-
{onExport && (
|
|
254
|
-
<Button onClick={onExport} variant="outline" size="sm">
|
|
255
|
-
<Download className="h-4 w-4 mr-2" />
|
|
256
|
-
Export
|
|
257
|
-
</Button>
|
|
258
|
-
)}
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
</CardHeader>
|
|
262
|
-
<CardContent className="pt-0">
|
|
263
|
-
<Tabs defaultValue="overview" className="w-full mt-4">
|
|
264
|
-
<TabsList className="grid w-full grid-cols-4 mb-6">
|
|
265
|
-
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
266
|
-
<TabsTrigger value="repositories">Repositories</TabsTrigger>
|
|
267
|
-
<TabsTrigger value="languages">Languages</TabsTrigger>
|
|
268
|
-
<TabsTrigger value="activity">Activity</TabsTrigger>
|
|
269
|
-
</TabsList>
|
|
270
|
-
|
|
271
|
-
<TabsContent value="overview" className="space-y-6 mt-6">
|
|
272
|
-
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
273
|
-
<StatCard
|
|
274
|
-
icon={<Package className="h-4 w-4" />}
|
|
275
|
-
label="Total Repos"
|
|
276
|
-
value={repos.length}
|
|
277
|
-
/>
|
|
278
|
-
<StatCard
|
|
279
|
-
icon={<Star className="h-4 w-4 text-yellow-500" />}
|
|
280
|
-
label="Total Stars"
|
|
281
|
-
value={formatNumber(stats.totalStars)}
|
|
282
|
-
onClick={() => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, '_blank')}
|
|
283
|
-
/>
|
|
284
|
-
<StatCard
|
|
285
|
-
icon={<GitFork className="h-4 w-4 text-blue-500" />}
|
|
286
|
-
label="Total Forks"
|
|
287
|
-
value={formatNumber(stats.totalForks)}
|
|
288
|
-
/>
|
|
289
|
-
<StatCard
|
|
290
|
-
icon={<Eye className="h-4 w-4 text-green-500" />}
|
|
291
|
-
label="Total Watchers"
|
|
292
|
-
value={formatNumber(stats.totalWatchers)}
|
|
293
|
-
/>
|
|
294
|
-
</div>
|
|
295
|
-
|
|
296
|
-
{stats.mostStarredRepo && (
|
|
297
|
-
<Card
|
|
298
|
-
className="hover:shadow-md transition-shadow cursor-pointer"
|
|
299
|
-
onClick={() => window.open(`https://github.com/${stats.mostStarredRepo.owner?.login}/${stats.mostStarredRepo.name}`, '_blank')}
|
|
300
|
-
>
|
|
301
|
-
<CardContent className="p-6">
|
|
302
|
-
<div className="flex items-center justify-between">
|
|
303
|
-
<div>
|
|
304
|
-
<p className="text-sm text-muted-foreground mb-2">Most Starred Repository</p>
|
|
305
|
-
<h4 className="font-semibold text-lg mb-1">{stats.mostStarredRepo.name}</h4>
|
|
306
|
-
<p className="text-sm text-muted-foreground">
|
|
307
|
-
{formatNumber(stats.mostStarredRepo.stargazers_count)} stars
|
|
308
|
-
</p>
|
|
309
|
-
</div>
|
|
310
|
-
<div className="flex flex-col items-center gap-2">
|
|
311
|
-
<TrendingUp className="h-8 w-8 text-muted-foreground" />
|
|
312
|
-
<ExternalLink className="h-4 w-4 text-muted-foreground" />
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
</CardContent>
|
|
316
|
-
</Card>
|
|
317
|
-
)}
|
|
318
|
-
</TabsContent>
|
|
319
|
-
|
|
320
|
-
<TabsContent value="repositories" className="space-y-4 mt-6">
|
|
321
|
-
<div className="space-y-3">
|
|
322
|
-
{repos.map((repo) => (
|
|
323
|
-
<Card
|
|
324
|
-
key={repo.id}
|
|
325
|
-
className="hover:shadow-md transition-shadow cursor-pointer group"
|
|
326
|
-
onClick={() => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, '_blank')}
|
|
327
|
-
>
|
|
328
|
-
<CardContent className="p-5">
|
|
329
|
-
<div className="flex items-start justify-between">
|
|
330
|
-
<div className="flex-1">
|
|
331
|
-
<div className="flex items-center gap-2 mb-2">
|
|
332
|
-
<h4 className="font-semibold text-base">{repo.name}</h4>
|
|
333
|
-
{repo.private && (
|
|
334
|
-
<Badge variant="secondary" className="text-xs">Private</Badge>
|
|
335
|
-
)}
|
|
336
|
-
</div>
|
|
337
|
-
<p className="text-sm text-muted-foreground mb-3">
|
|
338
|
-
{repo.description || "No description"}
|
|
339
|
-
</p>
|
|
340
|
-
<div className="flex items-center gap-4 text-sm">
|
|
341
|
-
{repo.language && (
|
|
342
|
-
<div className="flex items-center gap-1">
|
|
343
|
-
<div
|
|
344
|
-
className="w-3 h-3 rounded-full"
|
|
345
|
-
style={{
|
|
346
|
-
backgroundColor: LANGUAGE_COLORS[repo.language] || "#6b7280",
|
|
347
|
-
}}
|
|
348
|
-
/>
|
|
349
|
-
<span>{repo.language}</span>
|
|
350
|
-
</div>
|
|
351
|
-
)}
|
|
352
|
-
<button
|
|
353
|
-
className="flex items-center gap-1 hover:text-yellow-600 transition-colors"
|
|
354
|
-
onClick={(e) => {
|
|
355
|
-
e.stopPropagation()
|
|
356
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, '_blank')
|
|
357
|
-
}}
|
|
358
|
-
>
|
|
359
|
-
<Star className="h-3 w-3" />
|
|
360
|
-
<span>{formatNumber(repo.stargazers_count)}</span>
|
|
361
|
-
</button>
|
|
362
|
-
<button
|
|
363
|
-
className="flex items-center gap-1 hover:text-blue-600 transition-colors"
|
|
364
|
-
onClick={(e) => {
|
|
365
|
-
e.stopPropagation()
|
|
366
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, '_blank')
|
|
367
|
-
}}
|
|
368
|
-
>
|
|
369
|
-
<GitFork className="h-3 w-3" />
|
|
370
|
-
<span>{formatNumber(repo.forks_count)}</span>
|
|
371
|
-
</button>
|
|
372
|
-
<button
|
|
373
|
-
className="flex items-center gap-1 hover:text-purple-600 transition-colors"
|
|
374
|
-
onClick={(e) => {
|
|
375
|
-
e.stopPropagation()
|
|
376
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/issues`, '_blank')
|
|
377
|
-
}}
|
|
378
|
-
>
|
|
379
|
-
<Users className="h-3 w-3" />
|
|
380
|
-
<span>{repo.open_issues_count} issues</span>
|
|
381
|
-
</button>
|
|
382
|
-
<div className="flex items-center gap-1">
|
|
383
|
-
<Calendar className="h-3 w-3" />
|
|
384
|
-
<span>{formatDate(repo.updated_at)}</span>
|
|
385
|
-
</div>
|
|
386
|
-
</div>
|
|
387
|
-
</div>
|
|
388
|
-
<div className="flex items-center gap-2">
|
|
389
|
-
<Button
|
|
390
|
-
size="sm"
|
|
391
|
-
variant="ghost"
|
|
392
|
-
className="opacity-0 group-hover:opacity-100 transition-opacity"
|
|
393
|
-
onClick={(e) => {
|
|
394
|
-
e.stopPropagation()
|
|
395
|
-
window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, '_blank')
|
|
396
|
-
}}
|
|
397
|
-
>
|
|
398
|
-
<ExternalLink className="h-4 w-4" />
|
|
399
|
-
</Button>
|
|
400
|
-
</div>
|
|
401
|
-
</div>
|
|
402
|
-
</CardContent>
|
|
403
|
-
</Card>
|
|
404
|
-
))}
|
|
405
|
-
</div>
|
|
406
|
-
</TabsContent>
|
|
407
|
-
|
|
408
|
-
<TabsContent value="languages" className="space-y-6 mt-6">
|
|
409
|
-
<div className="space-y-4">
|
|
410
|
-
{stats.languages.map((lang) => (
|
|
411
|
-
<div key={lang.language} className="space-y-2">
|
|
412
|
-
<div className="flex items-center justify-between text-sm">
|
|
413
|
-
<div className="flex items-center gap-2">
|
|
414
|
-
<div
|
|
415
|
-
className="w-3 h-3 rounded-full shadow-sm"
|
|
416
|
-
style={{ backgroundColor: lang.color }}
|
|
417
|
-
/>
|
|
418
|
-
<span className="font-medium">{lang.language}</span>
|
|
419
|
-
</div>
|
|
420
|
-
<span className="text-muted-foreground">
|
|
421
|
-
{lang.count} repos ({lang.percentage.toFixed(1)}%)
|
|
422
|
-
</span>
|
|
423
|
-
</div>
|
|
424
|
-
<div className="px-1">
|
|
425
|
-
<Progress value={lang.percentage} className="h-2" />
|
|
426
|
-
</div>
|
|
427
|
-
</div>
|
|
428
|
-
))}
|
|
429
|
-
</div>
|
|
430
|
-
|
|
431
|
-
{repos[0] && (
|
|
432
|
-
<div className="pt-4 border-t">
|
|
433
|
-
<Button
|
|
434
|
-
variant="outline"
|
|
435
|
-
className="w-full"
|
|
436
|
-
onClick={() => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=`, '_blank')}
|
|
437
|
-
>
|
|
438
|
-
<BarChart3 className="h-4 w-4 mr-2" />
|
|
439
|
-
View Language Statistics on GitHub
|
|
440
|
-
</Button>
|
|
441
|
-
</div>
|
|
442
|
-
)}
|
|
443
|
-
</TabsContent>
|
|
444
|
-
|
|
445
|
-
<TabsContent value="activity" className="space-y-4 mt-6">
|
|
446
|
-
<div className="space-y-3">
|
|
447
|
-
{stats.recentActivity.map((activity, index) => {
|
|
448
|
-
const repo = repos.find(r => r.name === activity.repository)
|
|
449
|
-
return (
|
|
450
|
-
<div
|
|
451
|
-
key={index}
|
|
452
|
-
className="flex items-center gap-4 p-4 rounded-lg bg-accent/30 hover:bg-accent/50 transition-colors cursor-pointer"
|
|
453
|
-
onClick={() => repo && window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, '_blank')}
|
|
454
|
-
>
|
|
455
|
-
<Activity className="h-4 w-4 text-muted-foreground flex-shrink-0" />
|
|
456
|
-
<div className="flex-1 min-w-0">
|
|
457
|
-
<p className="text-sm font-medium">{activity.description}</p>
|
|
458
|
-
<p className="text-xs text-muted-foreground mt-1">
|
|
459
|
-
{activity.repository} • {formatDate(activity.timestamp)}
|
|
460
|
-
</p>
|
|
461
|
-
</div>
|
|
462
|
-
<ExternalLink className="h-3 w-3 text-muted-foreground flex-shrink-0" />
|
|
463
|
-
</div>
|
|
464
|
-
)
|
|
465
|
-
})}
|
|
466
|
-
</div>
|
|
467
|
-
|
|
468
|
-
{repos[0] && (
|
|
469
|
-
<div className="pt-4 border-t">
|
|
470
|
-
<Button
|
|
471
|
-
variant="outline"
|
|
472
|
-
className="w-full"
|
|
473
|
-
onClick={() => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=updated`, '_blank')}
|
|
474
|
-
>
|
|
475
|
-
<Activity className="h-4 w-4 mr-2" />
|
|
476
|
-
View All Activity on GitHub
|
|
477
|
-
</Button>
|
|
478
|
-
</div>
|
|
479
|
-
)}
|
|
480
|
-
</TabsContent>
|
|
481
|
-
</Tabs>
|
|
482
|
-
</CardContent>
|
|
483
|
-
</Card>
|
|
484
|
-
)
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
// Helper component for stat cards
|
|
488
|
-
const StatCard: React.FC<{
|
|
489
|
-
icon: React.ReactNode
|
|
490
|
-
label: string
|
|
491
|
-
value: string | number
|
|
492
|
-
onClick?: () => void
|
|
493
|
-
}> = ({ icon, label, value, onClick }) => (
|
|
494
|
-
<Card
|
|
495
|
-
className={cn(
|
|
496
|
-
"transition-all",
|
|
497
|
-
onClick && "hover:shadow-md cursor-pointer hover:scale-105"
|
|
498
|
-
)}
|
|
499
|
-
onClick={onClick}
|
|
500
|
-
>
|
|
501
|
-
<CardContent className="p-5">
|
|
502
|
-
<div className="flex items-center justify-between">
|
|
503
|
-
<div>
|
|
504
|
-
<p className="text-sm text-muted-foreground mb-1">{label}</p>
|
|
505
|
-
<p className="text-2xl font-bold">{value}</p>
|
|
506
|
-
</div>
|
|
507
|
-
<div className="text-muted-foreground">
|
|
508
|
-
{icon}
|
|
509
|
-
</div>
|
|
510
|
-
</div>
|
|
511
|
-
</CardContent>
|
|
512
|
-
</Card>
|
|
513
|
-
)
|