@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,480 +0,0 @@
1
- "use client"
2
-
3
- import React from 'react'
4
- import { motion, AnimatePresence } from 'framer-motion'
5
- import { cn } from '../../lib/utils'
6
- import { Widget } from './types'
7
- import { MetricCard } from './widgets/metric-card'
8
- import { ChartWidget } from './widgets/chart-widget'
9
- import { ActivityFeed } from './widgets/activity-feed'
10
- import { ProgressWidget } from './widgets/progress-widget'
11
- import { ComparisonWidget } from './widgets/comparison-widget'
12
- import { Responsive, WidthProvider, Layout, Layouts } from 'react-grid-layout'
13
- const ResponsiveGridLayout = WidthProvider(Responsive)
14
- import 'react-grid-layout/css/styles.css'
15
- import 'react-resizable/css/styles.css'
16
- import {
17
- Grip,
18
- X,
19
- Maximize2,
20
- Minimize2,
21
- Lock,
22
- Unlock,
23
- Settings
24
- } from 'lucide-react'
25
- import { Button } from '../ui/button'
26
-
27
- interface DashboardGridProps {
28
- widgets: Widget[]
29
- onLayoutChange?: (layout: Layout[]) => void
30
- onWidgetRemove?: (widgetId: string) => void
31
- onWidgetAction?: (widgetId: string, action: string, data?: any) => void
32
- editMode?: boolean
33
- className?: string
34
- glassmorphism?: boolean
35
- breakpoints?: { lg: number; md: number; sm: number; xs: number; xxs: number }
36
- cols?: { lg: number; md: number; sm: number; xs: number; xxs: number }
37
- rowHeight?: number
38
- margin?: [number, number]
39
- containerPadding?: [number, number]
40
- }
41
-
42
- export function DashboardGrid({
43
- widgets,
44
- onLayoutChange,
45
- onWidgetRemove,
46
- onWidgetAction,
47
- editMode = false,
48
- className,
49
- glassmorphism = false,
50
- breakpoints = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },
51
- cols = { lg: 12, md: 8, sm: 4, xs: 2, xxs: 1 },
52
- rowHeight = 80,
53
- margin = [16, 24],
54
- containerPadding = [0, 0]
55
- }: DashboardGridProps) {
56
- const [layouts, setLayouts] = React.useState<Layouts>({})
57
- const [currentBreakpoint, setCurrentBreakpoint] = React.useState('lg')
58
- const [lockedWidgets, setLockedWidgets] = React.useState<Set<string>>(new Set())
59
- const [fullscreenWidget, setFullscreenWidget] = React.useState<string | null>(null)
60
- const [containerWidth, setContainerWidth] = React.useState(1200)
61
- const containerRef = React.useRef<HTMLDivElement>(null)
62
- const [compactType, setCompactType] = React.useState<'vertical' | 'horizontal' | null>('vertical')
63
-
64
- // Container genişliğini ölç ve breakpoint'i güncelle
65
- React.useEffect(() => {
66
- const updateWidth = () => {
67
- if (containerRef.current) {
68
- const width = containerRef.current.offsetWidth
69
- setContainerWidth(width)
70
-
71
- // Breakpoint'i manuel olarak belirle
72
- if (width < 480) {
73
- setCurrentBreakpoint('xxs')
74
- } else if (width < 768) {
75
- setCurrentBreakpoint('xs')
76
- } else if (width < 996) {
77
- setCurrentBreakpoint('sm')
78
- } else if (width < 1200) {
79
- setCurrentBreakpoint('md')
80
- } else {
81
- setCurrentBreakpoint('lg')
82
- }
83
- }
84
- }
85
-
86
- updateWidth()
87
- window.addEventListener('resize', updateWidth)
88
- return () => window.removeEventListener('resize', updateWidth)
89
- }, [])
90
-
91
- // Responsive layout oluştur
92
- const generateResponsiveLayouts = (): Layouts => {
93
- const baseLayout = widgets.map((widget, index) => ({
94
- i: widget.id,
95
- x: widget.position?.x ?? (index * 3) % 12,
96
- y: widget.position?.y ?? Math.floor((index * 3) / 12) * 3,
97
- w: widget.size?.w ?? 3,
98
- h: widget.size?.h ?? 3,
99
- minW: widget.size?.minW || 2,
100
- maxW: widget.size?.maxW || 12,
101
- minH: widget.size?.minH || 2,
102
- maxH: widget.size?.maxH || 8,
103
- isDraggable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canMove !== false,
104
- isResizable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canResize !== false,
105
- }))
106
-
107
- // Farklı breakpoint'ler için layout'ları ayarla
108
- const sortedLayout = [...baseLayout].sort((a, b) => {
109
- if (a.y === b.y) return a.x - b.x;
110
- return a.y - b.y;
111
- });
112
-
113
- return {
114
- lg: baseLayout,
115
- md: sortedLayout.map((item, index) => {
116
- const cols = 8;
117
- const maxW = Math.min(item.w, 4);
118
- const row = Math.floor(index / 2);
119
- const col = (index % 2) * 4;
120
- return {
121
- ...item,
122
- w: maxW,
123
- x: col,
124
- y: row * 3,
125
- h: Math.min(item.h, 3)
126
- };
127
- }),
128
- sm: sortedLayout.map((item, index) => {
129
- const maxW = Math.min(item.w, 4);
130
- return {
131
- ...item,
132
- w: maxW,
133
- x: 0,
134
- y: index * 3,
135
- h: Math.min(item.h, 3)
136
- };
137
- }),
138
- xs: sortedLayout.map((item, index) => ({
139
- ...item,
140
- w: 2, // Full width on mobile
141
- x: 0,
142
- y: index * 2,
143
- h: Math.min(item.h, 2)
144
- })),
145
- xxs: sortedLayout.map((item, index) => ({
146
- ...item,
147
- w: 1, // Full width on extra small
148
- x: 0,
149
- y: index * 2,
150
- h: Math.min(item.h, 2)
151
- }))
152
- }
153
- }
154
-
155
- // Layout oluştur (geriye uyumluluk için)
156
- const generateLayout = (): Layout[] => {
157
- const responsiveLayouts = generateResponsiveLayouts()
158
- return responsiveLayouts[currentBreakpoint as keyof Layouts] || responsiveLayouts.lg
159
- }
160
-
161
- // Widget kilit durumunu değiştir
162
- const toggleWidgetLock = (widgetId: string) => {
163
- setLockedWidgets(prev => {
164
- const newSet = new Set(prev)
165
- if (newSet.has(widgetId)) {
166
- newSet.delete(widgetId)
167
- } else {
168
- newSet.add(widgetId)
169
- }
170
- return newSet
171
- })
172
- }
173
-
174
- // Widget'ı tam ekran yap
175
- const toggleFullscreen = (widgetId: string) => {
176
- if (fullscreenWidget === widgetId) {
177
- setFullscreenWidget(null)
178
- } else {
179
- setFullscreenWidget(widgetId)
180
- }
181
- }
182
-
183
- // Widget render
184
- const renderWidget = (widget: Widget) => {
185
- const isLocked = lockedWidgets.has(widget.id)
186
- const isFullscreen = fullscreenWidget === widget.id
187
-
188
- const widgetContent = () => {
189
- switch (widget.type) {
190
- case 'metric':
191
- return (
192
- <MetricCard
193
- data={widget.data}
194
- onAction={(action) => onWidgetAction?.(widget.id, action)}
195
- glassmorphism={glassmorphism}
196
- />
197
- )
198
-
199
- case 'chart':
200
- return (
201
- <ChartWidget
202
- id={widget.id}
203
- title={widget.title}
204
- description={widget.description}
205
- data={widget.data}
206
- loading={widget.loading}
207
- glassmorphism={glassmorphism}
208
- onAction={(action, data) => onWidgetAction?.(widget.id, action, data)}
209
- />
210
- )
211
-
212
- case 'activity':
213
- return (
214
- <ActivityFeed
215
- items={widget.data?.items || []}
216
- title={widget.title}
217
- loading={widget.loading}
218
- glassmorphism={glassmorphism}
219
- realtime={widget.data?.realtime}
220
- onAction={(action, data) => onWidgetAction?.(widget.id, action, data)}
221
- />
222
- )
223
-
224
- case 'progress':
225
- return (
226
- <ProgressWidget
227
- data={widget.data}
228
- title={widget.title}
229
- glassmorphism={glassmorphism}
230
- />
231
- )
232
-
233
- case 'comparison':
234
- return (
235
- <ComparisonWidget
236
- data={widget.data}
237
- title={widget.title}
238
- glassmorphism={glassmorphism}
239
- />
240
- )
241
-
242
- case 'table':
243
- case 'map':
244
- case 'calendar':
245
- // Bu widget tipleri için geçici olarak basit bir görünüm
246
- return (
247
- <div className={cn(
248
- "h-full p-4 rounded-lg border",
249
- glassmorphism ? "bg-background/60 backdrop-blur-md border-white/10" : "bg-card"
250
- )}>
251
- <h3 className="font-semibold mb-2">{widget.title}</h3>
252
- {widget.description && (
253
- <p className="text-sm text-muted-foreground mb-4">{widget.description}</p>
254
- )}
255
- <div className="flex items-center justify-center h-32 text-muted-foreground">
256
- <span className="text-sm">{widget.type} widget content</span>
257
- </div>
258
- </div>
259
- )
260
-
261
- default:
262
- return (
263
- <div className="flex items-center justify-center h-full text-muted-foreground">
264
- Widget type not supported: {widget.type}
265
- </div>
266
- )
267
- }
268
- }
269
-
270
- return (
271
- <motion.div
272
- key={widget.id}
273
- className={cn(
274
- "relative group h-full",
275
- isFullscreen && "!fixed !inset-4 !z-50 !h-auto !w-auto"
276
- )}
277
- layout={!isFullscreen}
278
- transition={{ duration: 0.2 }}
279
- >
280
- {/* Widget içeriği */}
281
- <div className="h-full dashboard-widget-container">
282
- {widgetContent()}
283
- </div>
284
-
285
- {/* Edit mode kontrolleri */}
286
- {editMode && !isFullscreen && (
287
- <motion.div
288
- initial={{ opacity: 0 }}
289
- animate={{ opacity: 1 }}
290
- className="absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity"
291
- >
292
- <div className={cn(
293
- "flex items-center gap-1 p-1 rounded-lg",
294
- glassmorphism ? "bg-background/80 backdrop-blur-sm" : "bg-background/95",
295
- "border shadow-sm"
296
- )}>
297
- {/* Drag handle */}
298
- {!isLocked && (
299
- <div className="drag-handle cursor-move p-1 hover:bg-muted rounded">
300
- <Grip className="h-4 w-4" />
301
- </div>
302
- )}
303
-
304
- {/* Lock/Unlock */}
305
- <Button
306
- variant="ghost"
307
- size="sm"
308
- className="h-6 w-6 p-0"
309
- onClick={() => toggleWidgetLock(widget.id)}
310
- >
311
- {isLocked ? (
312
- <Lock className="h-3 w-3" />
313
- ) : (
314
- <Unlock className="h-3 w-3" />
315
- )}
316
- </Button>
317
-
318
- {/* Fullscreen */}
319
- <Button
320
- variant="ghost"
321
- size="sm"
322
- className="h-6 w-6 p-0"
323
- onClick={() => toggleFullscreen(widget.id)}
324
- >
325
- <Maximize2 className="h-3 w-3" />
326
- </Button>
327
-
328
- {/* Settings */}
329
- <Button
330
- variant="ghost"
331
- size="sm"
332
- className="h-6 w-6 p-0"
333
- onClick={() => onWidgetAction?.(widget.id, 'settings')}
334
- >
335
- <Settings className="h-3 w-3" />
336
- </Button>
337
-
338
- {/* Remove */}
339
- {widget.permissions?.canDelete !== false && (
340
- <Button
341
- variant="ghost"
342
- size="sm"
343
- className="h-6 w-6 p-0 text-destructive hover:text-destructive"
344
- onClick={() => onWidgetRemove?.(widget.id)}
345
- >
346
- <X className="h-3 w-3" />
347
- </Button>
348
- )}
349
- </div>
350
- </motion.div>
351
- )}
352
-
353
- {/* Fullscreen kontrolleri */}
354
- {isFullscreen && (
355
- <motion.div
356
- initial={{ opacity: 0, y: -10 }}
357
- animate={{ opacity: 1, y: 0 }}
358
- className="absolute top-4 right-4 z-10"
359
- >
360
- <Button
361
- variant="outline"
362
- size="sm"
363
- onClick={() => toggleFullscreen(widget.id)}
364
- >
365
- <Minimize2 className="h-4 w-4 mr-2" />
366
- Exit Fullscreen
367
- </Button>
368
- </motion.div>
369
- )}
370
- </motion.div>
371
- )
372
- }
373
-
374
- // Mobile kontrolü
375
- const isMobile = currentBreakpoint === 'xs' || currentBreakpoint === 'xxs' || currentBreakpoint === 'sm';
376
-
377
- return (
378
- <div ref={containerRef} className={cn("w-full relative", className)}>
379
- <AnimatePresence>
380
- {fullscreenWidget ? (
381
- // Fullscreen widget
382
- <motion.div
383
- initial={{ opacity: 0 }}
384
- animate={{ opacity: 1 }}
385
- exit={{ opacity: 0 }}
386
- className="fixed inset-0 z-40 bg-background"
387
- >
388
- {widgets
389
- .filter(w => w.id === fullscreenWidget)
390
- .map(renderWidget)}
391
- </motion.div>
392
- ) : isMobile ? (
393
- // Mobile layout - Grid Layout yerine normal flex kullan
394
- <div className="space-y-6">
395
- {widgets.map(widget => (
396
- <motion.div
397
- key={widget.id}
398
- initial={{ opacity: 0, y: 20 }}
399
- animate={{ opacity: 1, y: 0 }}
400
- transition={{ duration: 0.3 }}
401
- className="w-full"
402
- >
403
- {renderWidget(widget)}
404
- </motion.div>
405
- ))}
406
- </div>
407
- ) : (
408
- // Desktop Grid layout
409
- <ResponsiveGridLayout
410
- className="layout"
411
- layouts={layouts.lg ? layouts : generateResponsiveLayouts()}
412
- breakpoints={breakpoints}
413
- cols={cols}
414
- rowHeight={currentBreakpoint === 'xs' || currentBreakpoint === 'xxs' ? 60 : currentBreakpoint === 'sm' ? 70 : rowHeight}
415
- margin={currentBreakpoint === 'xs' || currentBreakpoint === 'xxs' ? [12, 20] : margin}
416
- containerPadding={currentBreakpoint === 'xs' || currentBreakpoint === 'xxs' ? [8, 8] : containerPadding}
417
- onLayoutChange={(layout, allLayouts) => {
418
- setLayouts(allLayouts)
419
- onLayoutChange?.(layout)
420
- }}
421
- onBreakpointChange={(breakpoint) => {
422
- setCurrentBreakpoint(breakpoint)
423
- // Dar alanlarda compact type'ı değiştir
424
- if (breakpoint === 'xs' || breakpoint === 'xxs' || breakpoint === 'sm') {
425
- setCompactType('vertical')
426
- } else {
427
- setCompactType('vertical')
428
- }
429
- }}
430
- draggableHandle=".drag-handle"
431
- isDraggable={editMode}
432
- isResizable={editMode}
433
- compactType={compactType}
434
- preventCollision={false}
435
- useCSSTransforms={true}
436
- transformScale={1}
437
- isDroppable={true}
438
- autoSize={true}
439
- verticalCompact={true}
440
- >
441
- {widgets.map(widget => (
442
- <div key={widget.id}>
443
- {renderWidget(widget)}
444
- </div>
445
- ))}
446
- </ResponsiveGridLayout>
447
- )}
448
- </AnimatePresence>
449
-
450
- {/* Grid çizgileri (edit mode) */}
451
- {editMode && !fullscreenWidget && (
452
- <motion.div
453
- initial={{ opacity: 0 }}
454
- animate={{ opacity: 0.1 }}
455
- className="absolute inset-0 pointer-events-none"
456
- style={{
457
- backgroundImage: `
458
- repeating-linear-gradient(
459
- 0deg,
460
- var(--border) 0px,
461
- transparent 1px,
462
- transparent ${rowHeight + margin[1]}px,
463
- var(--border) ${rowHeight + margin[1]}px
464
- ),
465
- repeating-linear-gradient(
466
- 90deg,
467
- var(--border) 0px,
468
- transparent 1px,
469
- transparent ${100 / cols[currentBreakpoint as keyof typeof cols]}%,
470
- var(--border) ${100 / cols[currentBreakpoint as keyof typeof cols]}%
471
- )
472
- `
473
- }}
474
- />
475
- )}
476
- </div>
477
- )
478
- }
479
-
480
- export default DashboardGrid