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