@moontra/moonui-pro 2.20.2 → 2.20.4

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 +191 -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,385 +0,0 @@
1
- "use client"
2
-
3
- import React, { useState } from "react"
4
- import { motion } from "framer-motion"
5
- import { Loader2, Check, X, Lock, Sparkles } from "lucide-react"
6
- import { cn } from "../../lib/utils"
7
- import { cva, type VariantProps } from "class-variance-authority"
8
- import { Card, CardContent } from "../ui/card"
9
- import { Button } from "../ui/button"
10
- import { useSubscription } from "../../hooks/use-subscription"
11
-
12
- const moonUIAnimatedButtonProVariants = cva(
13
- "relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 overflow-hidden min-w-fit",
14
- {
15
- variants: {
16
- variant: {
17
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
18
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
19
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
20
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
21
- ghost: "hover:bg-accent hover:text-accent-foreground",
22
- link: "text-primary underline-offset-4 hover:underline",
23
- gradient: "bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-700 hover:to-pink-700",
24
- glow: "bg-primary text-primary-foreground shadow-lg hover:shadow-xl hover:shadow-primary/25",
25
- },
26
- size: {
27
- default: "h-9 px-4 py-2",
28
- sm: "h-8 rounded-md px-3 text-xs",
29
- lg: "h-10 rounded-md px-8",
30
- xl: "h-11 rounded-md px-6 text-base font-medium",
31
- icon: "h-9 w-9",
32
- }
33
- },
34
- defaultVariants: {
35
- variant: "default",
36
- size: "default"
37
- },
38
- }
39
- )
40
-
41
- interface MoonUIAnimatedButtonProProps
42
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
43
- VariantProps<typeof moonUIAnimatedButtonProVariants> {
44
- state?: "idle" | "loading" | "success" | "error"
45
- onStateChange?: (state: "idle" | "loading" | "success" | "error") => void
46
- loadingText?: string
47
- successText?: string
48
- errorText?: string
49
- ripple?: boolean
50
- iconRotate?: boolean
51
- shimmerSpeed?: "slow" | "normal" | "fast"
52
- glowIntensity?: "low" | "medium" | "high"
53
- showProgressBar?: boolean
54
- autoResetDelay?: number
55
- animation?: "none" | "bounce" | "pulse" | "shimmer" | "slide" | "scale" | "rotate" | "shake"
56
- }
57
-
58
- const MoonUIAnimatedButtonProInternal = React.forwardRef<HTMLButtonElement, MoonUIAnimatedButtonProProps>(
59
- ({
60
- className,
61
- variant,
62
- size,
63
- animation = "none",
64
- state = "idle",
65
- onStateChange,
66
- children,
67
- onClick,
68
- loadingText = "Loading...",
69
- successText = "Success!",
70
- errorText = "Error!",
71
- ripple = false,
72
- iconRotate = false,
73
- shimmerSpeed = "normal",
74
- glowIntensity = "medium",
75
- showProgressBar = false,
76
- autoResetDelay = 2000,
77
- onDrag,
78
- onDragEnd,
79
- onDragStart,
80
- onAnimationStart,
81
- onAnimationEnd,
82
- ...props
83
- }, ref) => {
84
- const [internalState, setInternalState] = useState<"idle" | "loading" | "success" | "error">("idle")
85
- const [ripples, setRipples] = useState<Array<{x: number, y: number, id: number}>>([])
86
- const [progress, setProgress] = useState(0)
87
- const [isHovered, setIsHovered] = useState(false)
88
- const currentState = state !== "idle" ? state : internalState
89
-
90
- const handleClick = async (e: React.MouseEvent<HTMLButtonElement>) => {
91
- if (currentState === "loading") return
92
-
93
- // Ripple effect
94
- if (ripple) {
95
- const rect = e.currentTarget.getBoundingClientRect()
96
- const x = e.clientX - rect.left
97
- const y = e.clientY - rect.top
98
- const id = Date.now()
99
-
100
- setRipples([...ripples, { x, y, id }])
101
- setTimeout(() => {
102
- setRipples(prev => prev.filter(r => r.id !== id))
103
- }, 600)
104
- }
105
-
106
- setInternalState("loading")
107
- onStateChange?.("loading")
108
- setProgress(0)
109
-
110
- // Simulate progress
111
- if (showProgressBar) {
112
- const progressInterval = setInterval(() => {
113
- setProgress(prev => {
114
- if (prev >= 90) {
115
- clearInterval(progressInterval)
116
- return 90
117
- }
118
- return prev + 10
119
- })
120
- }, 200)
121
- }
122
-
123
- if (onClick) {
124
- try {
125
- await onClick(e)
126
- setProgress(100)
127
- setInternalState("success")
128
- onStateChange?.("success")
129
-
130
- setTimeout(() => {
131
- setInternalState("idle")
132
- onStateChange?.("idle")
133
- setProgress(0)
134
- }, autoResetDelay)
135
- } catch (error) {
136
- setProgress(0)
137
- setInternalState("error")
138
- onStateChange?.("error")
139
-
140
- setTimeout(() => {
141
- setInternalState("idle")
142
- onStateChange?.("idle")
143
- }, autoResetDelay)
144
- }
145
- }
146
- }
147
-
148
- const getIcon = () => {
149
- const iconClass = cn("h-4 w-4", {
150
- "animate-spin": currentState === "loading" || (iconRotate && currentState !== "idle"),
151
- })
152
-
153
- switch (currentState) {
154
- case "loading":
155
- return <Loader2 className={iconClass} />
156
- case "success":
157
- return <Check className={cn(iconClass, "animate-scale-in")} />
158
- case "error":
159
- return <X className={cn(iconClass, "animate-shake")} />
160
- default:
161
- return null
162
- }
163
- }
164
-
165
- const getBackgroundColor = () => {
166
- switch (currentState) {
167
- case "success":
168
- return "bg-green-600"
169
- case "error":
170
- return "bg-red-600"
171
- default:
172
- return ""
173
- }
174
- }
175
-
176
- const getShimmerSpeed = () => {
177
- switch (shimmerSpeed) {
178
- case "slow":
179
- return "duration-1500"
180
- case "fast":
181
- return "duration-500"
182
- default:
183
- return "duration-1000"
184
- }
185
- }
186
-
187
- const getGlowIntensity = () => {
188
- switch (glowIntensity) {
189
- case "low":
190
- return "shadow-lg"
191
- case "high":
192
- return "shadow-2xl"
193
- default:
194
- return "shadow-xl"
195
- }
196
- }
197
-
198
-
199
- // whileHover direkt olarak kullanılacak
200
- let whileHoverAnimation: any = undefined
201
- let whileTapAnimation: any = undefined
202
-
203
- // Animation specific hover states
204
- if (animation === "bounce") {
205
- whileHoverAnimation = {
206
- y: [0, -10, 0],
207
- transition: {
208
- duration: 0.6,
209
- repeat: Infinity,
210
- repeatType: "loop"
211
- }
212
- }
213
- } else if (animation === "pulse") {
214
- whileHoverAnimation = {
215
- scale: [1, 1.1, 1],
216
- transition: {
217
- duration: 1,
218
- repeat: Infinity,
219
- repeatType: "loop"
220
- }
221
- }
222
- } else if (animation === "shake") {
223
- // Shake için CSS animation kullanacağız
224
- whileHoverAnimation = undefined
225
- } else if (animation === "rotate") {
226
- whileHoverAnimation = {
227
- rotate: 10,
228
- transition: { type: "spring", stiffness: 300 }
229
- }
230
- } else if (animation === "scale") {
231
- whileHoverAnimation = { scale: 1.05 }
232
- whileTapAnimation = { scale: 0.95 }
233
- } else if (animation === "slide") {
234
- whileHoverAnimation = { y: -4 }
235
- }
236
-
237
- return (
238
- <motion.button
239
- {...props}
240
- className={cn(
241
- moonUIAnimatedButtonProVariants({ variant, size }),
242
- variant === "glow" && getGlowIntensity(),
243
- animation === "shake" && isHovered && "animate-shake",
244
- className
245
- )}
246
- ref={ref}
247
- onClick={handleClick}
248
- disabled={currentState === "loading" || props.disabled}
249
- onMouseEnter={() => setIsHovered(true)}
250
- onMouseLeave={() => setIsHovered(false)}
251
- whileHover={whileHoverAnimation}
252
- whileTap={whileTapAnimation}
253
- >
254
- {/* Progress Bar */}
255
- {showProgressBar && currentState === "loading" && (
256
- <motion.div
257
- className="absolute bottom-0 left-0 h-1 bg-primary-foreground/20 rounded-full"
258
- initial={{ width: 0 }}
259
- animate={{ width: `${progress}%` }}
260
- transition={{ duration: 0.3 }}
261
- />
262
- )}
263
-
264
- {/* Shimmer Effect */}
265
- {animation === "shimmer" && (
266
- <motion.div
267
- className="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent"
268
- initial={{ x: "-100%" }}
269
- animate={{ x: "100%" }}
270
- transition={{
271
- duration: shimmerSpeed === "slow" ? 1.5 : shimmerSpeed === "fast" ? 0.5 : 1,
272
- repeat: Infinity,
273
- repeatDelay: 1
274
- }}
275
- />
276
- )}
277
-
278
- {/* Content */}
279
- <div className="relative flex items-center justify-center gap-2 z-10">
280
- {/* Icon variant için özel düzenleme */}
281
- {size === "icon" ? (
282
- // Icon size için sadece icon göster
283
- currentState === "idle" ? (
284
- children
285
- ) : (
286
- getIcon()
287
- )
288
- ) : (
289
- // Diğer boyutlar için normal akış
290
- <>
291
- {currentState === "idle" ? (
292
- <>
293
- {React.isValidElement(children) && React.cloneElement(children as React.ReactElement)}
294
- {typeof children === 'string' && children}
295
- {React.isValidElement(children) || typeof children === 'string' ? null : children}
296
- </>
297
- ) : (
298
- <>
299
- {getIcon()}
300
- <span className="ml-2">
301
- {currentState === "loading" && loadingText}
302
- {currentState === "success" && successText}
303
- {currentState === "error" && errorText}
304
- </span>
305
- </>
306
- )}
307
- </>
308
- )}
309
- </div>
310
-
311
- {/* Background animation */}
312
- <motion.div
313
- className={cn(
314
- "absolute inset-0 rounded-md",
315
- getBackgroundColor()
316
- )}
317
- initial={{ scale: 0, opacity: 0 }}
318
- animate={{
319
- scale: currentState === "success" || currentState === "error" ? 1 : 0,
320
- opacity: currentState === "success" || currentState === "error" ? 0.2 : 0
321
- }}
322
- transition={{ duration: 0.3 }}
323
- style={{ zIndex: 0 }}
324
- />
325
-
326
- {/* Ripple Effect */}
327
- {ripples.map(ripple => (
328
- <span
329
- key={ripple.id}
330
- className="absolute bg-primary/20 rounded-full animate-ripple pointer-events-none"
331
- style={{
332
- left: ripple.x - 10,
333
- top: ripple.y - 10,
334
- width: 20,
335
- height: 20,
336
- }}
337
- />
338
- ))}
339
- </motion.button>
340
- )
341
- }
342
- )
343
-
344
- MoonUIAnimatedButtonProInternal.displayName = "MoonUIAnimatedButtonProInternal"
345
-
346
- export const MoonUIAnimatedButtonPro = React.forwardRef<HTMLButtonElement, MoonUIAnimatedButtonProProps>(
347
- (props, ref) => {
348
- // Pro package - always show component
349
- const { hasProAccess, isLoading } = useSubscription()
350
-
351
- // Show upgrade prompt if no pro access
352
- if (!isLoading && !hasProAccess) {
353
- return (
354
- <Card className={cn("w-fit", props.className)}>
355
- <CardContent className="py-6 text-center">
356
- <div className="space-y-4">
357
- <div className="rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto">
358
- <Lock className="h-6 w-6 text-purple-600 dark:text-purple-400" />
359
- </div>
360
- <div>
361
- <h3 className="font-semibold text-sm mb-2">Pro Feature</h3>
362
- <p className="text-muted-foreground text-xs mb-4">
363
- Animated Button is available exclusively to MoonUI Pro subscribers.
364
- </p>
365
- <a href="/pricing">
366
- <Button size="sm">
367
- <Sparkles className="mr-2 h-4 w-4" />
368
- Upgrade to Pro
369
- </Button>
370
- </a>
371
- </div>
372
- </div>
373
- </CardContent>
374
- </Card>
375
- )
376
- }
377
-
378
- return <MoonUIAnimatedButtonProInternal {...props} ref={ref} />
379
- }
380
- )
381
-
382
- MoonUIAnimatedButtonPro.displayName = "MoonUIAnimatedButtonPro"
383
-
384
- export { moonUIAnimatedButtonProVariants }
385
- export type { MoonUIAnimatedButtonProProps }