@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,418 +0,0 @@
1
- "use client"
2
-
3
- import React from 'react'
4
- import { motion, AnimatePresence } from 'framer-motion'
5
- import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card'
6
- import { Button } from '../../ui/button'
7
- import { cn } from '../../../lib/utils'
8
- import {
9
- LineChart,
10
- Line,
11
- BarChart,
12
- Bar,
13
- AreaChart,
14
- Area,
15
- PieChart,
16
- Pie,
17
- RadarChart,
18
- PolarGrid,
19
- PolarAngleAxis,
20
- PolarRadiusAxis,
21
- Radar,
22
- XAxis,
23
- YAxis,
24
- CartesianGrid,
25
- Tooltip,
26
- Legend,
27
- ResponsiveContainer,
28
- Cell
29
- } from 'recharts'
30
- import {
31
- MoreVertical,
32
- Download,
33
- Maximize2,
34
- RefreshCw,
35
- Palette,
36
- Settings,
37
- Filter
38
- } from 'lucide-react'
39
- import {
40
- DropdownMenu,
41
- DropdownMenuContent,
42
- DropdownMenuItem,
43
- DropdownMenuSeparator,
44
- DropdownMenuTrigger,
45
- DropdownMenuSub,
46
- DropdownMenuSubContent,
47
- DropdownMenuSubTrigger,
48
- } from '../../ui/dropdown-menu'
49
- import { ChartData } from '../types'
50
-
51
- interface ChartWidgetProps {
52
- id: string
53
- title: string
54
- description?: string
55
- data: ChartData
56
- className?: string
57
- height?: number
58
- onAction?: (action: string, data?: any) => void
59
- loading?: boolean
60
- refreshing?: boolean
61
- glassmorphism?: boolean
62
- interactive?: boolean
63
- }
64
-
65
- // Renk paleti
66
- const CHART_COLORS = {
67
- default: ['#3b82f6', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899'],
68
- pastel: ['#93c5fd', '#86efac', '#fcd34d', '#fca5a5', '#c4b5fd', '#fbcfe8'],
69
- vibrant: ['#2563eb', '#059669', '#d97706', '#dc2626', '#7c3aed', '#db2777'],
70
- monochrome: ['#1f2937', '#374151', '#4b5563', '#6b7280', '#9ca3af', '#d1d5db']
71
- }
72
-
73
- export function ChartWidget({
74
- id,
75
- title,
76
- description,
77
- data,
78
- className,
79
- height = 300,
80
- onAction,
81
- loading = false,
82
- refreshing = false,
83
- glassmorphism = false,
84
- interactive = true
85
- }: ChartWidgetProps) {
86
- const [colorScheme, setColorScheme] = React.useState<keyof typeof CHART_COLORS>('default')
87
- const [isFullscreen, setIsFullscreen] = React.useState(false)
88
-
89
- const colors = CHART_COLORS[colorScheme]
90
-
91
- // Custom tooltip
92
- const CustomTooltip = ({ active, payload, label }: any) => {
93
- if (!active || !payload) return null
94
-
95
- return (
96
- <motion.div
97
- initial={{ opacity: 0, scale: 0.9 }}
98
- animate={{ opacity: 1, scale: 1 }}
99
- className={cn(
100
- "p-3 rounded-lg shadow-lg",
101
- glassmorphism
102
- ? "bg-background/80 backdrop-blur-md border border-white/10"
103
- : "bg-background border"
104
- )}
105
- >
106
- <p className="text-sm font-medium">{label}</p>
107
- {payload.map((entry: any, index: number) => (
108
- <p key={index} className="text-sm mt-1">
109
- <span
110
- className="inline-block w-3 h-3 rounded-full mr-2"
111
- style={{ backgroundColor: entry.color }}
112
- />
113
- {entry.name}: {entry.value}
114
- </p>
115
- ))}
116
- </motion.div>
117
- )
118
- }
119
-
120
- // Chart renderer
121
- const renderChart = () => {
122
- if (!data.data || data.data.length === 0) {
123
- return (
124
- <div className="flex items-center justify-center h-full text-muted-foreground">
125
- No data available
126
- </div>
127
- )
128
- }
129
-
130
- const chartProps = {
131
- data: data.data,
132
- margin: { top: 5, right: 30, left: 20, bottom: 5 }
133
- }
134
-
135
- switch (data.type) {
136
- case 'line':
137
- return (
138
- <ResponsiveContainer width="100%" height={height}>
139
- <LineChart {...chartProps}>
140
- <CartesianGrid strokeDasharray="3 3" className="opacity-30" />
141
- <XAxis dataKey="name" />
142
- <YAxis />
143
- <Tooltip content={<CustomTooltip />} />
144
- {interactive && <Legend />}
145
- {Object.keys(data.data[0])
146
- .filter(key => key !== 'name')
147
- .map((key, index) => (
148
- <Line
149
- key={key}
150
- type="monotone"
151
- dataKey={key}
152
- stroke={colors[index % colors.length]}
153
- strokeWidth={2}
154
- dot={{ r: 4 }}
155
- activeDot={{ r: 6 }}
156
- />
157
- ))}
158
- </LineChart>
159
- </ResponsiveContainer>
160
- )
161
-
162
- case 'bar':
163
- return (
164
- <ResponsiveContainer width="100%" height={height}>
165
- <BarChart {...chartProps}>
166
- <CartesianGrid strokeDasharray="3 3" className="opacity-30" />
167
- <XAxis dataKey="name" />
168
- <YAxis />
169
- <Tooltip content={<CustomTooltip />} />
170
- {interactive && <Legend />}
171
- {Object.keys(data.data[0])
172
- .filter(key => key !== 'name')
173
- .map((key, index) => (
174
- <Bar
175
- key={key}
176
- dataKey={key}
177
- fill={colors[index % colors.length]}
178
- radius={[4, 4, 0, 0]}
179
- />
180
- ))}
181
- </BarChart>
182
- </ResponsiveContainer>
183
- )
184
-
185
- case 'area':
186
- return (
187
- <ResponsiveContainer width="100%" height={height}>
188
- <AreaChart {...chartProps}>
189
- <CartesianGrid strokeDasharray="3 3" className="opacity-30" />
190
- <XAxis dataKey="name" />
191
- <YAxis />
192
- <Tooltip content={<CustomTooltip />} />
193
- {interactive && <Legend />}
194
- {Object.keys(data.data[0])
195
- .filter(key => key !== 'name')
196
- .map((key, index) => (
197
- <Area
198
- key={key}
199
- type="monotone"
200
- dataKey={key}
201
- stroke={colors[index % colors.length]}
202
- fill={colors[index % colors.length]}
203
- fillOpacity={0.2}
204
- />
205
- ))}
206
- </AreaChart>
207
- </ResponsiveContainer>
208
- )
209
-
210
- case 'pie':
211
- case 'donut':
212
- return (
213
- <ResponsiveContainer width="100%" height={height}>
214
- <PieChart>
215
- <Pie
216
- data={data.data}
217
- cx="50%"
218
- cy="50%"
219
- labelLine={false}
220
- label={interactive}
221
- outerRadius={data.type === 'donut' ? 80 : 100}
222
- innerRadius={data.type === 'donut' ? 50 : 0}
223
- fill="#8884d8"
224
- dataKey="value"
225
- >
226
- {data.data.map((entry: any, index: number) => (
227
- <Cell key={`cell-${index}`} fill={colors[index % colors.length]} />
228
- ))}
229
- </Pie>
230
- <Tooltip content={<CustomTooltip />} />
231
- {interactive && <Legend />}
232
- </PieChart>
233
- </ResponsiveContainer>
234
- )
235
-
236
- case 'radar':
237
- return (
238
- <ResponsiveContainer width="100%" height={height}>
239
- <RadarChart data={data.data}>
240
- <PolarGrid />
241
- <PolarAngleAxis dataKey="subject" />
242
- <PolarRadiusAxis />
243
- {Object.keys(data.data[0])
244
- .filter(key => key !== 'subject')
245
- .map((key, index) => (
246
- <Radar
247
- key={key}
248
- name={key}
249
- dataKey={key}
250
- stroke={colors[index % colors.length]}
251
- fill={colors[index % colors.length]}
252
- fillOpacity={0.3}
253
- />
254
- ))}
255
- <Tooltip content={<CustomTooltip />} />
256
- {interactive && <Legend />}
257
- </RadarChart>
258
- </ResponsiveContainer>
259
- )
260
-
261
- default:
262
- return null
263
- }
264
- }
265
-
266
- // Card variants
267
- const cardVariants = {
268
- initial: { opacity: 0, scale: 0.95 },
269
- animate: {
270
- opacity: 1,
271
- scale: 1,
272
- transition: { duration: 0.3, ease: "easeOut" }
273
- }
274
- }
275
-
276
- return (
277
- <motion.div
278
- variants={cardVariants}
279
- initial="initial"
280
- animate="animate"
281
- className={cn(isFullscreen && "fixed inset-4 z-50")}
282
- >
283
- <Card className={cn(
284
- "relative overflow-hidden transition-all duration-300",
285
- glassmorphism && "bg-background/60 backdrop-blur-md border-white/10",
286
- isFullscreen && "h-full",
287
- className
288
- )}>
289
- {/* Header */}
290
- <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
291
- <div>
292
- <CardTitle className="text-base font-semibold">{title}</CardTitle>
293
- {description && (
294
- <p className="text-sm text-muted-foreground mt-1">{description}</p>
295
- )}
296
- </div>
297
-
298
- {/* Actions */}
299
- <div className="flex items-center gap-2">
300
- {refreshing && (
301
- <motion.div
302
- animate={{ rotate: 360 }}
303
- transition={{ duration: 1, repeat: Infinity, ease: "linear" }}
304
- >
305
- <RefreshCw className="h-4 w-4 text-muted-foreground" />
306
- </motion.div>
307
- )}
308
-
309
- {interactive && (
310
- <DropdownMenu>
311
- <DropdownMenuTrigger asChild>
312
- <Button variant="ghost" size="sm" className="h-8 w-8 p-0">
313
- <MoreVertical className="h-4 w-4" />
314
- </Button>
315
- </DropdownMenuTrigger>
316
- <DropdownMenuContent align="end" className="w-48">
317
- <DropdownMenuItem onClick={() => {
318
- setIsFullscreen(!isFullscreen)
319
- onAction?.('fullscreen', { fullscreen: !isFullscreen })
320
- }}>
321
- <Maximize2 className="mr-2 h-4 w-4" />
322
- {isFullscreen ? 'Exit Fullscreen' : 'Fullscreen'}
323
- </DropdownMenuItem>
324
-
325
- <DropdownMenuSub>
326
- <DropdownMenuSubTrigger>
327
- <Palette className="mr-2 h-4 w-4" />
328
- Color Scheme
329
- </DropdownMenuSubTrigger>
330
- <DropdownMenuSubContent>
331
- {Object.keys(CHART_COLORS).map((scheme) => (
332
- <DropdownMenuItem
333
- key={scheme}
334
- onClick={() => setColorScheme(scheme as keyof typeof CHART_COLORS)}
335
- >
336
- <div className="flex items-center gap-2">
337
- <div className="flex gap-1">
338
- {CHART_COLORS[scheme as keyof typeof CHART_COLORS].slice(0, 3).map((color, i) => (
339
- <div
340
- key={i}
341
- className="w-3 h-3 rounded-full"
342
- style={{ backgroundColor: color }}
343
- />
344
- ))}
345
- </div>
346
- <span className="capitalize">{scheme}</span>
347
- </div>
348
- </DropdownMenuItem>
349
- ))}
350
- </DropdownMenuSubContent>
351
- </DropdownMenuSub>
352
-
353
- <DropdownMenuSeparator />
354
-
355
- <DropdownMenuItem onClick={() => onAction?.('export', { format: 'png' })}>
356
- <Download className="mr-2 h-4 w-4" />
357
- Export as PNG
358
- </DropdownMenuItem>
359
-
360
- <DropdownMenuItem onClick={() => onAction?.('export', { format: 'csv' })}>
361
- <Download className="mr-2 h-4 w-4" />
362
- Export Data
363
- </DropdownMenuItem>
364
-
365
- <DropdownMenuSeparator />
366
-
367
- <DropdownMenuItem onClick={() => onAction?.('filter')}>
368
- <Filter className="mr-2 h-4 w-4" />
369
- Filter Data
370
- </DropdownMenuItem>
371
-
372
- <DropdownMenuItem onClick={() => onAction?.('settings')}>
373
- <Settings className="mr-2 h-4 w-4" />
374
- Chart Settings
375
- </DropdownMenuItem>
376
- </DropdownMenuContent>
377
- </DropdownMenu>
378
- )}
379
- </div>
380
- </CardHeader>
381
-
382
- {/* Chart Content */}
383
- <CardContent className="p-0 px-4 pb-4">
384
- <AnimatePresence mode="wait">
385
- {loading ? (
386
- <motion.div
387
- key="loading"
388
- initial={{ opacity: 0 }}
389
- animate={{ opacity: 1 }}
390
- exit={{ opacity: 0 }}
391
- className="flex items-center justify-center"
392
- style={{ height }}
393
- >
394
- <div className="space-y-2">
395
- <div className="animate-pulse bg-muted h-4 w-32 rounded" />
396
- <div className="animate-pulse bg-muted h-4 w-24 rounded" />
397
- <div className="animate-pulse bg-muted h-4 w-28 rounded" />
398
- </div>
399
- </motion.div>
400
- ) : (
401
- <motion.div
402
- key="chart"
403
- initial={{ opacity: 0, y: 10 }}
404
- animate={{ opacity: 1, y: 0 }}
405
- exit={{ opacity: 0, y: -10 }}
406
- transition={{ duration: 0.3 }}
407
- >
408
- {renderChart()}
409
- </motion.div>
410
- )}
411
- </AnimatePresence>
412
- </CardContent>
413
- </Card>
414
- </motion.div>
415
- )
416
- }
417
-
418
- export default ChartWidget