@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,375 +0,0 @@
1
- "use client"
2
-
3
- import React, { useMemo } from "react"
4
- import { Card, CardContent } from "../ui/card"
5
- import { Button } from "../ui/button"
6
- import { MoonUISkeletonPro as Skeleton } from "../ui/skeleton"
7
- import { cn } from "../../lib/utils"
8
- import { Lock, Sparkles, RefreshCw, Github, Download, FileJson, FileSpreadsheet } from "lucide-react"
9
- import { useSubscription } from "../../hooks/use-subscription"
10
- import { useGitHubData, useGitHubNotifications } from "./hooks"
11
- import { exportData, exportAsCSV } from "./github-api"
12
- import {
13
- MinimalVariant,
14
- CompactVariant,
15
- CardVariant,
16
- DetailedVariant,
17
- } from "./variants"
18
- import type { GitHubStarsProps } from "./types"
19
- import { motion, AnimatePresence } from "framer-motion"
20
- import confetti from "canvas-confetti"
21
-
22
- const GitHubStarsInternal: React.FC<GitHubStarsProps> = ({
23
- username = "",
24
- repository,
25
- repositories,
26
- token,
27
- useMockData = false,
28
- variant = "card",
29
- layout = "grid",
30
- showDescription = true,
31
- showTopics = true,
32
- showStats = true,
33
- showOwner = true,
34
- showLanguage = true,
35
- showActivity = false,
36
- showTrending = false,
37
- showMilestones = false,
38
- showComparison = false,
39
- showHistory = false,
40
- sortBy = "stars",
41
- maxItems = 6,
42
- autoRefresh = false,
43
- refreshInterval = 300000,
44
- enableNotifications = false,
45
- enableExport = true,
46
- enableAnalytics = false,
47
- cacheEnabled = true,
48
- cacheDuration = 300000,
49
- animation = "fade",
50
- animationDuration = 0.3,
51
- staggerDelay = 0.05,
52
- milestones = [10, 50, 100, 500, 1000, 5000, 10000],
53
- celebrateAt = [100, 1000, 10000],
54
- onRepositoryClick,
55
- onStarClick,
56
- onMilestoneReached,
57
- onDataUpdate,
58
- onError,
59
- className,
60
- theme = "auto",
61
- size = "md",
62
- customColors,
63
- }) => {
64
- // Docs mode tespiti
65
- // Check if component has valid props to render
66
- const hasValidProps = useMockData || username || (repositories && repositories.length > 0)
67
-
68
- // If useMockData is false and no valid data props, don't render
69
- if (!useMockData && !hasValidProps) {
70
- return null
71
- }
72
-
73
- const isDocsMode = typeof window !== "undefined" &&
74
- (window.location.pathname.includes("/docs/") ||
75
- window.location.pathname.includes("/components/"))
76
-
77
- // Override some features in docs mode
78
- const effectiveAutoRefresh = isDocsMode ? false : autoRefresh
79
- const effectiveNotifications = isDocsMode ? false : enableNotifications
80
- const effectiveRefreshInterval = isDocsMode ? 3600000 : refreshInterval // 1 hour in docs mode
81
- const { notify } = useGitHubNotifications(effectiveNotifications)
82
-
83
- // onMilestoneReached callback'ini memoize et
84
- const handleMilestoneReached = React.useCallback((milestone: any) => {
85
- // Handle milestone reached
86
- if (celebrateAt?.includes(milestone.count)) {
87
- // Trigger celebration animation
88
- confetti({
89
- particleCount: 100,
90
- spread: 70,
91
- origin: { y: 0.6 },
92
- })
93
-
94
- // Show notification
95
- notify(`🎉 Milestone Reached!`, {
96
- body: `${milestone.count} stars achieved!`,
97
- tag: `milestone-${milestone.count}`,
98
- })
99
- }
100
-
101
- onMilestoneReached?.(milestone)
102
- }, [celebrateAt, notify, onMilestoneReached])
103
-
104
- const {
105
- repos,
106
- stats,
107
- loading,
108
- error,
109
- rateLimitInfo,
110
- lastUpdated,
111
- refresh,
112
- } = useGitHubData({
113
- username,
114
- repository,
115
- repositories,
116
- token,
117
- autoRefresh: effectiveAutoRefresh,
118
- refreshInterval: effectiveRefreshInterval,
119
- sortBy,
120
- maxItems,
121
- onError,
122
- onDataUpdate,
123
- onMilestoneReached: handleMilestoneReached,
124
- milestones,
125
- docsMode: isDocsMode, // Docs mode flag'ini gönder
126
- mockDataFallback: true, // Use mock data in docs mode
127
- forceMockData: useMockData, // Force mock data if true
128
- })
129
-
130
- const handleExport = React.useCallback((format: "json" | "csv") => {
131
- if (!enableExport) return
132
-
133
- const timestamp = new Date().toISOString().split("T")[0]
134
-
135
- if (format === "json") {
136
- exportData(
137
- { repositories: repos, statistics: stats, exportDate: new Date() },
138
- `github-stars-${username}-${timestamp}.json`
139
- )
140
- } else {
141
- exportAsCSV(repos, `github-stars-${username}-${timestamp}.csv`)
142
- }
143
- }, [enableExport, repos, stats, username])
144
-
145
- // handleDetailedExport fonksiyonunu memoize et
146
- const handleDetailedExport = React.useCallback((e: React.MouseEvent) => {
147
- if (!enableExport) return
148
-
149
- // Show export dropdown
150
- const dropdown = document.createElement("div")
151
- dropdown.className = "absolute z-50 mt-2 w-48 rounded-md shadow-lg bg-popover border"
152
- dropdown.innerHTML = `
153
- <div class="py-1">
154
- <button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="json">
155
- Export as JSON
156
- </button>
157
- <button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="csv">
158
- Export as CSV
159
- </button>
160
- </div>
161
- `
162
-
163
- dropdown.addEventListener("click", (e) => {
164
- const target = e.target as HTMLElement
165
- const format = target.getAttribute("data-format")
166
- if (format === "json" || format === "csv") {
167
- handleExport(format)
168
- dropdown.remove()
169
- }
170
- })
171
-
172
- document.body.appendChild(dropdown)
173
-
174
- // Position dropdown
175
- const rect = (e.target as HTMLElement).getBoundingClientRect()
176
- dropdown.style.top = `${rect.bottom + window.scrollY}px`
177
- dropdown.style.left = `${rect.left + window.scrollX}px`
178
-
179
- // Remove on outside click
180
- setTimeout(() => {
181
- document.addEventListener("click", () => dropdown.remove(), { once: true })
182
- }, 0)
183
- }, [enableExport, handleExport])
184
-
185
- // Loading state
186
- if (loading) {
187
- return (
188
- <Card className={cn("w-full", className)}>
189
- <CardContent className="p-6">
190
- <div className="space-y-4">
191
- <div className="flex items-center justify-between">
192
- <Skeleton className="h-6 w-48" />
193
- <Skeleton className="h-8 w-20" />
194
- </div>
195
- <div className={cn(
196
- layout === "grid"
197
- ? "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
198
- : "space-y-4"
199
- )}>
200
- {Array.from({ length: maxItems || 6 }).map((_, index) => (
201
- <Card key={index}>
202
- <CardContent className="p-4">
203
- <div className="space-y-3">
204
- <Skeleton className="h-5 w-3/4" />
205
- <Skeleton className="h-4 w-full" />
206
- <Skeleton className="h-4 w-2/3" />
207
- <div className="flex gap-2">
208
- <Skeleton className="h-6 w-16" />
209
- <Skeleton className="h-6 w-16" />
210
- <Skeleton className="h-6 w-16" />
211
- </div>
212
- </div>
213
- </CardContent>
214
- </Card>
215
- ))}
216
- </div>
217
- </div>
218
- </CardContent>
219
- </Card>
220
- )
221
- }
222
-
223
- // Error state
224
- if (error) {
225
- return (
226
- <Card className={cn("w-full", className)}>
227
- <CardContent className="p-6 text-center">
228
- <div className="space-y-4">
229
- <div className="text-destructive">
230
- <Github className="h-12 w-12 mx-auto mb-2" />
231
- <h3 className="font-semibold">Failed to load repositories</h3>
232
- <p className="text-sm text-muted-foreground">{error}</p>
233
- {rateLimitInfo && rateLimitInfo.remaining === 0 && (
234
- <p className="text-xs text-muted-foreground mt-2">
235
- Rate limit will reset at {new Date(rateLimitInfo.reset).toLocaleTimeString()}
236
- </p>
237
- )}
238
- </div>
239
- <Button onClick={refresh} variant="outline">
240
- <RefreshCw className="h-4 w-4 mr-2" />
241
- Try Again
242
- </Button>
243
- </div>
244
- </CardContent>
245
- </Card>
246
- )
247
- }
248
-
249
- // Render based on variant
250
- const renderVariant = () => {
251
- const baseProps = {
252
- repos,
253
- stats,
254
- loading,
255
- className,
256
- onRepositoryClick,
257
- }
258
-
259
- switch (variant) {
260
- case "minimal":
261
- return <MinimalVariant {...baseProps} />
262
- case "compact":
263
- return <CompactVariant {...baseProps} />
264
- case "detailed":
265
- return (
266
- <DetailedVariant
267
- {...baseProps}
268
- onExport={() => handleDetailedExport({} as React.MouseEvent)}
269
- />
270
- )
271
- case "card":
272
- default:
273
- return <CardVariant {...baseProps} />
274
- }
275
- }
276
-
277
- // Apply animation wrapper
278
- const animationVariants = {
279
- bounce: {
280
- initial: { scale: 0.9, opacity: 0 },
281
- animate: { scale: 1, opacity: 1 },
282
- transition: { type: "spring", stiffness: 300, damping: 20 },
283
- },
284
- pulse: {
285
- initial: { scale: 0.95, opacity: 0 },
286
- animate: { scale: 1, opacity: 1 },
287
- transition: { duration: animationDuration },
288
- },
289
- fade: {
290
- initial: { opacity: 0 },
291
- animate: { opacity: 1 },
292
- transition: { duration: animationDuration },
293
- },
294
- scale: {
295
- initial: { scale: 0, opacity: 0 },
296
- animate: { scale: 1, opacity: 1 },
297
- transition: { duration: animationDuration },
298
- },
299
- slide: {
300
- initial: { x: -20, opacity: 0 },
301
- animate: { x: 0, opacity: 1 },
302
- transition: { duration: animationDuration },
303
- },
304
- none: {
305
- initial: {},
306
- animate: {},
307
- transition: {},
308
- },
309
- }
310
-
311
- const selectedAnimation = animationVariants[animation]
312
-
313
- return (
314
- <motion.div
315
- {...selectedAnimation}
316
- className={cn("w-full", className)}
317
- >
318
- {renderVariant()}
319
-
320
- {/* Rate limit warning - Don't show in docs mode */}
321
- {!isDocsMode && rateLimitInfo && rateLimitInfo.remaining < 10 && (
322
- <div className="mt-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md text-sm">
323
- <p className="text-yellow-800 dark:text-yellow-200">
324
- ⚠️ Low API rate limit: {rateLimitInfo.remaining} requests remaining.
325
- {token ? "" : " Consider adding a GitHub token for higher limits."}
326
- </p>
327
- </div>
328
- )}
329
-
330
- {/* Docs mode indicator - only show in development mode */}
331
- {isDocsMode && process.env.NODE_ENV === "development" && (
332
- <div className="mt-2 text-xs text-muted-foreground text-center">
333
- 📚 Docs Mode: API requests optimized
334
- </div>
335
- )}
336
- </motion.div>
337
- )
338
- }
339
-
340
- export const GitHubStars: React.FC<GitHubStarsProps> = ({ className, ...props }) => {
341
- // Check if we're in docs mode or have pro access
342
- const { hasProAccess, isLoading } = useSubscription()
343
-
344
- // If not in docs mode and no pro access, show upgrade prompt
345
- if (!isLoading && !hasProAccess) {
346
- return (
347
- <Card className={cn("w-fit", className)}>
348
- <CardContent className="py-6 text-center">
349
- <div className="space-y-4">
350
- <div className="rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto">
351
- <Lock className="h-6 w-6 text-purple-600 dark:text-purple-400" />
352
- </div>
353
- <div>
354
- <h3 className="font-semibold text-sm mb-2">Pro Feature</h3>
355
- <p className="text-muted-foreground text-xs mb-4">
356
- GitHub Stars is available exclusively to MoonUI Pro subscribers.
357
- </p>
358
- <a href="/pricing">
359
- <Button size="sm">
360
- <Sparkles className="mr-2 h-4 w-4" />
361
- Upgrade to Pro
362
- </Button>
363
- </a>
364
- </div>
365
- </div>
366
- </CardContent>
367
- </Card>
368
- )
369
- }
370
-
371
- return <GitHubStarsInternal className={className} {...props} />
372
- }
373
-
374
- export type { GitHubRepository, GitHubStarsProps } from "./types"
375
- export { LANGUAGE_COLORS } from "./github-api"
@@ -1,148 +0,0 @@
1
- export interface GitHubRepository {
2
- id: number
3
- name: string
4
- full_name: string
5
- description: string | null
6
- html_url: string
7
- homepage: string | null
8
- stargazers_count: number
9
- watchers_count: number
10
- forks_count: number
11
- language: string | null
12
- topics: string[]
13
- created_at: string
14
- updated_at: string
15
- pushed_at: string
16
- size: number
17
- open_issues_count: number
18
- license: {
19
- key: string
20
- name: string
21
- spdx_id: string
22
- url: string
23
- } | null
24
- owner: {
25
- login: string
26
- avatar_url: string
27
- html_url: string
28
- type: string
29
- }
30
- private: boolean
31
- // Extended properties
32
- contributors_count?: number
33
- commits_count?: number
34
- releases_count?: number
35
- }
36
-
37
- export interface GitHubStats {
38
- totalStars: number
39
- totalForks: number
40
- totalWatchers: number
41
- totalIssues: number
42
- avgStarsPerRepo: number
43
- mostStarredRepo: GitHubRepository | null
44
- recentActivity: GitHubActivity[]
45
- languages: LanguageStats[]
46
- }
47
-
48
- export interface GitHubActivity {
49
- type: "star" | "fork" | "issue" | "pr" | "release"
50
- repository: string
51
- timestamp: string
52
- actor?: string
53
- description?: string
54
- }
55
-
56
- export interface LanguageStats {
57
- language: string
58
- count: number
59
- percentage: number
60
- color: string
61
- }
62
-
63
- export interface StarHistory {
64
- date: string
65
- count: number
66
- repository?: string
67
- }
68
-
69
- export interface Milestone {
70
- count: number
71
- reached: boolean
72
- date?: string
73
- celebration?: boolean
74
- }
75
-
76
- export type DisplayVariant = "compact" | "full" | "minimal" | "detailed" | "card"
77
- export type AnimationOption = "bounce" | "pulse" | "fade" | "scale" | "slide" | "none"
78
- export type SortOption = "stars" | "forks" | "updated" | "created" | "name" | "issues"
79
- export type LayoutOption = "grid" | "list" | "masonry" | "carousel"
80
-
81
- export interface GitHubStarsProps {
82
- // Basic props
83
- username?: string
84
- repository?: string // For single repo mode
85
- repositories?: string[] // For multiple repos
86
- token?: string // GitHub token for higher rate limits
87
- useMockData?: boolean // Force mock data instead of API requests
88
-
89
- // Display options
90
- variant?: DisplayVariant
91
- layout?: LayoutOption
92
- showDescription?: boolean
93
- showTopics?: boolean
94
- showStats?: boolean
95
- showOwner?: boolean
96
- showLanguage?: boolean
97
- showActivity?: boolean
98
- showTrending?: boolean
99
- showMilestones?: boolean
100
- showComparison?: boolean
101
- showHistory?: boolean
102
-
103
- // Behavior options
104
- sortBy?: SortOption
105
- maxItems?: number
106
- autoRefresh?: boolean
107
- refreshInterval?: number
108
- enableNotifications?: boolean
109
- enableExport?: boolean
110
- enableAnalytics?: boolean
111
- cacheEnabled?: boolean
112
- cacheDuration?: number
113
-
114
- // Animation options
115
- animation?: AnimationOption
116
- animationDuration?: number
117
- staggerDelay?: number
118
-
119
- // Milestone configuration
120
- milestones?: number[]
121
- celebrateAt?: number[]
122
-
123
- // Callbacks
124
- onRepositoryClick?: (repo: GitHubRepository) => void
125
- onStarClick?: (repo: GitHubRepository) => void
126
- onMilestoneReached?: (milestone: Milestone) => void
127
- onDataUpdate?: (stats: GitHubStats) => void
128
- onError?: (error: Error) => void
129
-
130
- // Styling
131
- className?: string
132
- theme?: "light" | "dark" | "auto"
133
- size?: "sm" | "md" | "lg" | "xl"
134
- customColors?: Record<string, string>
135
- }
136
-
137
- export interface CacheEntry {
138
- data: any
139
- timestamp: number
140
- expiresAt: number
141
- }
142
-
143
- export interface RateLimitInfo {
144
- limit: number
145
- remaining: number
146
- reset: number
147
- used: number
148
- }