@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.
Files changed (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. 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
- )