@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.
- package/package.json +8 -3
- package/plugin/index.d.ts +86 -0
- package/plugin/index.js +308 -0
- package/scripts/postinstall.js +191 -23
- package/src/components/advanced-chart/index.tsx +0 -1246
- package/src/components/advanced-forms/index.tsx +0 -585
- package/src/components/animated-button/index.tsx +0 -385
- package/src/components/calendar/event-dialog.tsx +0 -377
- package/src/components/calendar/index.tsx +0 -1220
- package/src/components/calendar-pro/index.tsx +0 -1697
- package/src/components/color-picker/index.tsx +0 -432
- package/src/components/credit-card-input/index.tsx +0 -406
- package/src/components/dashboard/dashboard-grid.tsx +0 -480
- package/src/components/dashboard/demo.tsx +0 -425
- package/src/components/dashboard/index.tsx +0 -1046
- package/src/components/dashboard/time-range-picker.tsx +0 -336
- package/src/components/dashboard/types.ts +0 -225
- package/src/components/dashboard/widgets/activity-feed.tsx +0 -349
- package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
- package/src/components/dashboard/widgets/comparison-widget.tsx +0 -177
- package/src/components/dashboard/widgets/index.ts +0 -5
- package/src/components/dashboard/widgets/metric-card.tsx +0 -363
- package/src/components/dashboard/widgets/progress-widget.tsx +0 -113
- package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
- package/src/components/data-table/data-table-column-toggle.tsx +0 -169
- package/src/components/data-table/data-table-export.ts +0 -156
- package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
- package/src/components/data-table/index.tsx +0 -845
- package/src/components/draggable-list/index.tsx +0 -100
- package/src/components/error-boundary/index.tsx +0 -232
- package/src/components/file-upload/index.tsx +0 -1660
- package/src/components/floating-action-button/index.tsx +0 -206
- package/src/components/form-wizard/form-wizard-context.tsx +0 -335
- package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
- package/src/components/form-wizard/form-wizard-progress.tsx +0 -329
- package/src/components/form-wizard/form-wizard-step.tsx +0 -111
- package/src/components/form-wizard/index.tsx +0 -102
- package/src/components/form-wizard/types.ts +0 -77
- package/src/components/gesture-drawer/index.tsx +0 -551
- package/src/components/github-stars/github-api.ts +0 -426
- package/src/components/github-stars/hooks.ts +0 -517
- package/src/components/github-stars/index.tsx +0 -375
- package/src/components/github-stars/types.ts +0 -148
- package/src/components/github-stars/variants.tsx +0 -515
- package/src/components/health-check/index.tsx +0 -439
- package/src/components/hover-card-3d/index.tsx +0 -529
- package/src/components/index.ts +0 -130
- package/src/components/internal/index.ts +0 -78
- package/src/components/kanban/add-card-modal.tsx +0 -502
- package/src/components/kanban/card-detail-modal.tsx +0 -761
- package/src/components/kanban/index.ts +0 -13
- package/src/components/kanban/kanban.tsx +0 -1689
- package/src/components/kanban/types.ts +0 -168
- package/src/components/lazy-component/index.tsx +0 -823
- package/src/components/license-error/index.tsx +0 -31
- package/src/components/magnetic-button/index.tsx +0 -216
- package/src/components/memory-efficient-data/index.tsx +0 -1018
- package/src/components/moonui-quiz-form/index.tsx +0 -817
- package/src/components/navbar/index.tsx +0 -781
- package/src/components/optimized-image/index.tsx +0 -425
- package/src/components/performance-debugger/index.tsx +0 -613
- package/src/components/performance-monitor/index.tsx +0 -808
- package/src/components/phone-number-input/index.tsx +0 -343
- package/src/components/phone-number-input/phone-number-input-simple.tsx +0 -167
- package/src/components/pinch-zoom/index.tsx +0 -566
- package/src/components/quiz-form/index.tsx +0 -479
- package/src/components/rich-text-editor/index.tsx +0 -2322
- package/src/components/rich-text-editor/slash-commands-extension.ts +0 -230
- package/src/components/rich-text-editor/slash-commands.css +0 -35
- package/src/components/rich-text-editor/table-styles.css +0 -65
- package/src/components/sidebar/index.tsx +0 -884
- package/src/components/spotlight-card/index.tsx +0 -191
- package/src/components/swipeable-card/index.tsx +0 -100
- package/src/components/timeline/index.tsx +0 -1183
- package/src/components/ui/accordion.tsx +0 -581
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -141
- package/src/components/ui/aspect-ratio.tsx +0 -245
- package/src/components/ui/avatar.tsx +0 -155
- package/src/components/ui/badge.tsx +0 -230
- package/src/components/ui/breadcrumb.tsx +0 -216
- package/src/components/ui/button.tsx +0 -228
- package/src/components/ui/calendar.tsx +0 -387
- package/src/components/ui/card.tsx +0 -216
- package/src/components/ui/checkbox.tsx +0 -259
- package/src/components/ui/collapsible.tsx +0 -631
- package/src/components/ui/color-picker.tsx +0 -97
- package/src/components/ui/command.tsx +0 -948
- package/src/components/ui/dialog.tsx +0 -752
- package/src/components/ui/dropdown-menu.tsx +0 -706
- package/src/components/ui/gesture-drawer.tsx +0 -11
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/index.ts +0 -222
- package/src/components/ui/input.tsx +0 -224
- package/src/components/ui/label.tsx +0 -29
- package/src/components/ui/lightbox.tsx +0 -606
- package/src/components/ui/magnetic-button.tsx +0 -129
- package/src/components/ui/media-gallery.tsx +0 -611
- package/src/components/ui/navigation-menu.tsx +0 -130
- package/src/components/ui/pagination.tsx +0 -125
- package/src/components/ui/popover.tsx +0 -185
- package/src/components/ui/progress.tsx +0 -30
- package/src/components/ui/radio-group.tsx +0 -257
- package/src/components/ui/scroll-area.tsx +0 -47
- package/src/components/ui/select.tsx +0 -378
- package/src/components/ui/separator.tsx +0 -145
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/skeleton.tsx +0 -20
- package/src/components/ui/slider.tsx +0 -354
- package/src/components/ui/spotlight-card.tsx +0 -119
- package/src/components/ui/switch.tsx +0 -86
- package/src/components/ui/table.tsx +0 -331
- package/src/components/ui/tabs-pro.tsx +0 -542
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/textarea.tsx +0 -28
- package/src/components/ui/toast.tsx +0 -317
- package/src/components/ui/toggle.tsx +0 -119
- package/src/components/ui/tooltip.tsx +0 -151
- package/src/components/virtual-list/index.tsx +0 -668
- package/src/hooks/use-chart.ts +0 -205
- package/src/hooks/use-data-table.ts +0 -182
- package/src/hooks/use-docs-pro-access.ts +0 -13
- package/src/hooks/use-license-check.ts +0 -65
- package/src/hooks/use-subscription.ts +0 -19
- package/src/hooks/use-toast.ts +0 -15
- package/src/index.ts +0 -22
- package/src/lib/ai-providers.ts +0 -377
- package/src/lib/component-metadata.ts +0 -18
- package/src/lib/micro-interactions.ts +0 -255
- package/src/lib/paddle.ts +0 -17
- package/src/lib/utils.ts +0 -6
- package/src/patterns/login-form/index.tsx +0 -276
- package/src/patterns/login-form/types.ts +0 -67
- package/src/setupTests.ts +0 -41
- package/src/styles/advanced-chart.css +0 -239
- package/src/styles/calendar.css +0 -35
- package/src/styles/design-system.css +0 -363
- package/src/styles/index.css +0 -681
- package/src/styles/tailwind.css +0 -7
- package/src/styles/tokens.css +0 -455
- package/src/types/next-auth.d.ts +0 -21
- package/src/use-intersection-observer.tsx +0 -154
- package/src/use-local-storage.tsx +0 -71
- package/src/use-paddle.ts +0 -138
- package/src/use-performance-optimizer.ts +0 -389
- package/src/use-pro-access.ts +0 -141
- package/src/use-scroll-animation.ts +0 -219
- package/src/use-subscription.ts +0 -37
- package/src/use-toast.ts +0 -32
- package/src/utils/chart-helpers.ts +0 -357
- package/src/utils/cn.ts +0 -6
- package/src/utils/data-processing.ts +0 -151
- package/src/utils/license-validator.tsx +0 -183
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useState, useCallback, useEffect, useMemo } from "react"
|
|
4
|
-
import { motion, useMotionValue, useSpring, useTransform } from "framer-motion"
|
|
5
|
-
import { cn } from "../../lib/utils"
|
|
6
|
-
import { Card, CardContent } from "../ui/card"
|
|
7
|
-
import { Button } from "../ui/button"
|
|
8
|
-
import { Lock, Sparkles } from "lucide-react"
|
|
9
|
-
import { useSubscription } from "../../hooks/use-subscription"
|
|
10
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
11
|
-
|
|
12
|
-
const hoverCard3DVariants = cva(
|
|
13
|
-
"relative rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 isolate",
|
|
14
|
-
{
|
|
15
|
-
variants: {
|
|
16
|
-
variant: {
|
|
17
|
-
subtle: "hover:bg-card/95",
|
|
18
|
-
dramatic: "hover:bg-gradient-to-br hover:from-card hover:to-card/80",
|
|
19
|
-
gaming: "hover:border-primary/50 hover:shadow-lg hover:shadow-primary/25",
|
|
20
|
-
elegant: "hover:border-border/50 hover:bg-gradient-to-br hover:from-card hover:via-card/95 hover:to-card/90",
|
|
21
|
-
neon: "hover:border-primary hover:shadow-[0_0_30px_rgba(var(--primary),0.3)]"
|
|
22
|
-
},
|
|
23
|
-
shadowIntensity: {
|
|
24
|
-
none: "",
|
|
25
|
-
light: "hover:shadow-md",
|
|
26
|
-
medium: "hover:shadow-lg",
|
|
27
|
-
heavy: "hover:shadow-xl",
|
|
28
|
-
extreme: "hover:shadow-2xl"
|
|
29
|
-
},
|
|
30
|
-
glowEffect: {
|
|
31
|
-
none: "",
|
|
32
|
-
subtle: "",
|
|
33
|
-
vibrant: "",
|
|
34
|
-
neon: ""
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
variant: "subtle",
|
|
39
|
-
shadowIntensity: "medium",
|
|
40
|
-
glowEffect: "none"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
export interface SpringConfig {
|
|
46
|
-
stiffness?: number
|
|
47
|
-
damping?: number
|
|
48
|
-
mass?: number
|
|
49
|
-
velocity?: number
|
|
50
|
-
restSpeed?: number
|
|
51
|
-
restDelta?: number
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type OverlayRenderProp = (props: {
|
|
55
|
-
isHovered: boolean
|
|
56
|
-
rotateX: number
|
|
57
|
-
rotateY: number
|
|
58
|
-
}) => React.ReactNode
|
|
59
|
-
|
|
60
|
-
export interface HoverCard3DProps
|
|
61
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
62
|
-
VariantProps<typeof hoverCard3DVariants> {
|
|
63
|
-
/**
|
|
64
|
-
* The perspective value for 3D transformation
|
|
65
|
-
* @default 1000
|
|
66
|
-
*/
|
|
67
|
-
perspective?: number
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Maximum rotation angle in degrees
|
|
71
|
-
* @default 15
|
|
72
|
-
*/
|
|
73
|
-
maxRotation?: number
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated Use maxRotation instead
|
|
77
|
-
*/
|
|
78
|
-
rotationIntensity?: number
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Scale factor when hovered
|
|
82
|
-
* @default 1.05
|
|
83
|
-
*/
|
|
84
|
-
scale?: number
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Spring animation configuration
|
|
88
|
-
*/
|
|
89
|
-
springConfig?: SpringConfig
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Animation speed multiplier (0-1)
|
|
93
|
-
* @default 1
|
|
94
|
-
*/
|
|
95
|
-
animationSpeed?: number
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Static or dynamic overlay content
|
|
99
|
-
*/
|
|
100
|
-
overlay?: React.ReactNode | OverlayRenderProp
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Show overlay even when not hovered
|
|
104
|
-
* @default false
|
|
105
|
-
*/
|
|
106
|
-
overlayAlwaysVisible?: boolean
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Glow color (CSS color value)
|
|
110
|
-
*/
|
|
111
|
-
glowColor?: string
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Glow blur amount in pixels
|
|
115
|
-
* @default 20
|
|
116
|
-
*/
|
|
117
|
-
glowBlur?: number
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Glow spread amount
|
|
121
|
-
* @default 1.2
|
|
122
|
-
*/
|
|
123
|
-
glowSpread?: number
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Enable touch support for mobile devices
|
|
127
|
-
* @default true
|
|
128
|
-
*/
|
|
129
|
-
enableTouch?: boolean
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Enable keyboard navigation
|
|
133
|
-
* @default true
|
|
134
|
-
*/
|
|
135
|
-
enableKeyboard?: boolean
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Callback when hover starts
|
|
139
|
-
*/
|
|
140
|
-
onHoverStart?: () => void
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Callback when hover ends
|
|
144
|
-
*/
|
|
145
|
-
onHoverEnd?: () => void
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Callback when rotation changes
|
|
149
|
-
*/
|
|
150
|
-
onRotationChange?: (rotateX: number, rotateY: number) => void
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Animation delay in ms
|
|
154
|
-
* @default 0
|
|
155
|
-
*/
|
|
156
|
-
animationDelay?: number
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* ARIA label for accessibility
|
|
160
|
-
*/
|
|
161
|
-
ariaLabel?: string
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Auto focus on mount
|
|
165
|
-
* @default false
|
|
166
|
-
*/
|
|
167
|
-
autoFocus?: boolean
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Control which axes can rotate
|
|
171
|
-
* @default { x: true, y: true }
|
|
172
|
-
*/
|
|
173
|
-
rotateAxes?: {
|
|
174
|
-
x?: boolean
|
|
175
|
-
y?: boolean
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const HoverCard3DInternal = React.forwardRef<HTMLDivElement, HoverCard3DProps>(
|
|
180
|
-
({
|
|
181
|
-
children,
|
|
182
|
-
className,
|
|
183
|
-
variant,
|
|
184
|
-
shadowIntensity,
|
|
185
|
-
glowEffect,
|
|
186
|
-
perspective = 1000,
|
|
187
|
-
maxRotation = 15,
|
|
188
|
-
rotationIntensity,
|
|
189
|
-
scale = 1.05,
|
|
190
|
-
springConfig = {
|
|
191
|
-
stiffness: 200,
|
|
192
|
-
damping: 15,
|
|
193
|
-
mass: 1,
|
|
194
|
-
velocity: 0
|
|
195
|
-
},
|
|
196
|
-
animationSpeed = 1,
|
|
197
|
-
overlay,
|
|
198
|
-
overlayAlwaysVisible = false,
|
|
199
|
-
glowColor = "rgb(var(--primary))",
|
|
200
|
-
glowBlur = 20,
|
|
201
|
-
glowSpread = 1.2,
|
|
202
|
-
enableTouch = true,
|
|
203
|
-
enableKeyboard = true,
|
|
204
|
-
onHoverStart,
|
|
205
|
-
onHoverEnd,
|
|
206
|
-
onRotationChange,
|
|
207
|
-
animationDelay = 0,
|
|
208
|
-
ariaLabel,
|
|
209
|
-
autoFocus = false,
|
|
210
|
-
rotateAxes = { x: true, y: true },
|
|
211
|
-
...restProps
|
|
212
|
-
}, ref) => {
|
|
213
|
-
// Filter out drag and animation event handlers to avoid conflicts with Framer Motion
|
|
214
|
-
const { onDrag, onDragStart, onDragEnd, onDragOver, onDrop, onAnimationStart, onAnimationEnd, onAnimationIteration, ...props } = restProps
|
|
215
|
-
const cardRef = useRef<HTMLDivElement>(null)
|
|
216
|
-
const [isHovered, setIsHovered] = useState(false)
|
|
217
|
-
const [isFocused, setIsFocused] = useState(false)
|
|
218
|
-
|
|
219
|
-
// Use maxRotation, fallback to rotationIntensity for backwards compatibility
|
|
220
|
-
const rotation = maxRotation || rotationIntensity || 15
|
|
221
|
-
|
|
222
|
-
const x = useMotionValue(0)
|
|
223
|
-
const y = useMotionValue(0)
|
|
224
|
-
|
|
225
|
-
const springX = useSpring(x, {
|
|
226
|
-
...springConfig,
|
|
227
|
-
stiffness: springConfig.stiffness! * animationSpeed,
|
|
228
|
-
damping: springConfig.damping! / animationSpeed
|
|
229
|
-
})
|
|
230
|
-
const springY = useSpring(y, {
|
|
231
|
-
...springConfig,
|
|
232
|
-
stiffness: springConfig.stiffness! * animationSpeed,
|
|
233
|
-
damping: springConfig.damping! / animationSpeed
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
const rotateX = useTransform(
|
|
237
|
-
springY,
|
|
238
|
-
[-1, 1],
|
|
239
|
-
rotateAxes.x ? [rotation, -rotation] : [0, 0]
|
|
240
|
-
)
|
|
241
|
-
const rotateY = useTransform(
|
|
242
|
-
springX,
|
|
243
|
-
[-1, 1],
|
|
244
|
-
rotateAxes.y ? [-rotation, rotation] : [0, 0]
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
const handleMouseMove = useCallback((e: React.MouseEvent | React.TouchEvent) => {
|
|
248
|
-
if (!cardRef.current) return
|
|
249
|
-
|
|
250
|
-
const rect = cardRef.current.getBoundingClientRect()
|
|
251
|
-
const centerX = rect.left + rect.width / 2
|
|
252
|
-
const centerY = rect.top + rect.height / 2
|
|
253
|
-
|
|
254
|
-
let clientX: number, clientY: number
|
|
255
|
-
|
|
256
|
-
if ('touches' in e && enableTouch) {
|
|
257
|
-
clientX = e.touches[0].clientX
|
|
258
|
-
clientY = e.touches[0].clientY
|
|
259
|
-
} else if ('clientX' in e) {
|
|
260
|
-
clientX = e.clientX
|
|
261
|
-
clientY = e.clientY
|
|
262
|
-
} else {
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const rotateXValue = (clientY - centerY) / (rect.height / 2)
|
|
267
|
-
const rotateYValue = (clientX - centerX) / (rect.width / 2)
|
|
268
|
-
|
|
269
|
-
x.set(rotateYValue)
|
|
270
|
-
y.set(rotateXValue)
|
|
271
|
-
|
|
272
|
-
if (onRotationChange) {
|
|
273
|
-
onRotationChange(rotateX.get(), rotateY.get())
|
|
274
|
-
}
|
|
275
|
-
}, [enableTouch, x, y, rotateX, rotateY, onRotationChange])
|
|
276
|
-
|
|
277
|
-
const handleMouseEnter = useCallback(() => {
|
|
278
|
-
setIsHovered(true)
|
|
279
|
-
onHoverStart?.()
|
|
280
|
-
}, [onHoverStart])
|
|
281
|
-
|
|
282
|
-
const handleMouseLeave = useCallback(() => {
|
|
283
|
-
setIsHovered(false)
|
|
284
|
-
x.set(0)
|
|
285
|
-
y.set(0)
|
|
286
|
-
onHoverEnd?.()
|
|
287
|
-
}, [x, y, onHoverEnd])
|
|
288
|
-
|
|
289
|
-
const handleKeyDown = useCallback((e: React.KeyboardEvent) => {
|
|
290
|
-
if (!enableKeyboard || !isFocused) return
|
|
291
|
-
|
|
292
|
-
const step = 0.1
|
|
293
|
-
let newX = x.get()
|
|
294
|
-
let newY = y.get()
|
|
295
|
-
|
|
296
|
-
switch (e.key) {
|
|
297
|
-
case 'ArrowUp':
|
|
298
|
-
newY = Math.max(-0.5, newY - step)
|
|
299
|
-
y.set(newY)
|
|
300
|
-
e.preventDefault()
|
|
301
|
-
break
|
|
302
|
-
case 'ArrowDown':
|
|
303
|
-
newY = Math.min(0.5, newY + step)
|
|
304
|
-
y.set(newY)
|
|
305
|
-
e.preventDefault()
|
|
306
|
-
break
|
|
307
|
-
case 'ArrowLeft':
|
|
308
|
-
newX = Math.max(-0.5, newX - step)
|
|
309
|
-
x.set(newX)
|
|
310
|
-
e.preventDefault()
|
|
311
|
-
break
|
|
312
|
-
case 'ArrowRight':
|
|
313
|
-
newX = Math.min(0.5, newX + step)
|
|
314
|
-
x.set(newX)
|
|
315
|
-
e.preventDefault()
|
|
316
|
-
break
|
|
317
|
-
case 'Enter':
|
|
318
|
-
case ' ':
|
|
319
|
-
setIsHovered(!isHovered)
|
|
320
|
-
if (!isHovered) {
|
|
321
|
-
onHoverStart?.()
|
|
322
|
-
} else {
|
|
323
|
-
onHoverEnd?.()
|
|
324
|
-
}
|
|
325
|
-
e.preventDefault()
|
|
326
|
-
break
|
|
327
|
-
case 'Escape':
|
|
328
|
-
x.set(0)
|
|
329
|
-
y.set(0)
|
|
330
|
-
setIsHovered(false)
|
|
331
|
-
onHoverEnd?.()
|
|
332
|
-
e.preventDefault()
|
|
333
|
-
break
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (onRotationChange) {
|
|
337
|
-
onRotationChange(rotateX.get(), rotateY.get())
|
|
338
|
-
}
|
|
339
|
-
}, [enableKeyboard, isFocused, x, y, isHovered, onHoverStart, onHoverEnd, rotateX, rotateY, onRotationChange])
|
|
340
|
-
|
|
341
|
-
useEffect(() => {
|
|
342
|
-
if (autoFocus && cardRef.current) {
|
|
343
|
-
cardRef.current.focus()
|
|
344
|
-
}
|
|
345
|
-
}, [autoFocus])
|
|
346
|
-
|
|
347
|
-
const overlayContent = useMemo(() => {
|
|
348
|
-
if (!overlay) return null
|
|
349
|
-
|
|
350
|
-
if (typeof overlay === 'function') {
|
|
351
|
-
return overlay({
|
|
352
|
-
isHovered,
|
|
353
|
-
rotateX: rotateX.get(),
|
|
354
|
-
rotateY: rotateY.get()
|
|
355
|
-
})
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return overlay
|
|
359
|
-
}, [overlay, isHovered, rotateX, rotateY])
|
|
360
|
-
|
|
361
|
-
const glowStyle = useMemo(() => {
|
|
362
|
-
if (glowEffect === 'none') return {}
|
|
363
|
-
|
|
364
|
-
let opacity = 0
|
|
365
|
-
let blur = glowBlur
|
|
366
|
-
let spread = glowSpread
|
|
367
|
-
|
|
368
|
-
switch (glowEffect) {
|
|
369
|
-
case 'subtle':
|
|
370
|
-
opacity = isHovered ? 0.3 : 0
|
|
371
|
-
break
|
|
372
|
-
case 'vibrant':
|
|
373
|
-
opacity = isHovered ? 0.6 : 0
|
|
374
|
-
blur = glowBlur * 1.5
|
|
375
|
-
break
|
|
376
|
-
case 'neon':
|
|
377
|
-
opacity = isHovered ? 0.8 : 0
|
|
378
|
-
blur = glowBlur * 2
|
|
379
|
-
spread = glowSpread * 1.3
|
|
380
|
-
break
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
return {
|
|
384
|
-
opacity,
|
|
385
|
-
filter: `blur(${blur}px)`,
|
|
386
|
-
scale: spread,
|
|
387
|
-
backgroundColor: glowColor
|
|
388
|
-
}
|
|
389
|
-
}, [glowEffect, isHovered, glowBlur, glowSpread, glowColor])
|
|
390
|
-
|
|
391
|
-
return (
|
|
392
|
-
<div style={{ perspective: `${perspective}px` }}>
|
|
393
|
-
<motion.div
|
|
394
|
-
ref={(node) => {
|
|
395
|
-
cardRef.current = node
|
|
396
|
-
if (typeof ref === "function") {
|
|
397
|
-
ref(node)
|
|
398
|
-
} else if (ref) {
|
|
399
|
-
ref.current = node
|
|
400
|
-
}
|
|
401
|
-
}}
|
|
402
|
-
className={cn(
|
|
403
|
-
hoverCard3DVariants({ variant, shadowIntensity, glowEffect }),
|
|
404
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
405
|
-
className
|
|
406
|
-
)}
|
|
407
|
-
onMouseMove={handleMouseMove}
|
|
408
|
-
onMouseEnter={handleMouseEnter}
|
|
409
|
-
onMouseLeave={handleMouseLeave}
|
|
410
|
-
onTouchMove={enableTouch ? handleMouseMove : undefined}
|
|
411
|
-
onTouchStart={enableTouch ? handleMouseEnter : undefined}
|
|
412
|
-
onTouchEnd={enableTouch ? handleMouseLeave : undefined}
|
|
413
|
-
onKeyDown={handleKeyDown}
|
|
414
|
-
onFocus={() => setIsFocused(true)}
|
|
415
|
-
onBlur={() => setIsFocused(false)}
|
|
416
|
-
style={{
|
|
417
|
-
transformStyle: "preserve-3d",
|
|
418
|
-
transformOrigin: "center center",
|
|
419
|
-
rotateX: isHovered || isFocused ? rotateX : 0,
|
|
420
|
-
rotateY: isHovered || isFocused ? rotateY : 0,
|
|
421
|
-
scale: isHovered || isFocused ? scale : 1,
|
|
422
|
-
}}
|
|
423
|
-
transition={{
|
|
424
|
-
type: "spring",
|
|
425
|
-
stiffness: springConfig.stiffness,
|
|
426
|
-
damping: springConfig.damping,
|
|
427
|
-
duration: 0.15 * (1 / animationSpeed),
|
|
428
|
-
delay: animationDelay / 1000
|
|
429
|
-
}}
|
|
430
|
-
tabIndex={enableKeyboard ? 0 : undefined}
|
|
431
|
-
role={enableKeyboard ? "button" : undefined}
|
|
432
|
-
aria-label={ariaLabel}
|
|
433
|
-
{...props}
|
|
434
|
-
>
|
|
435
|
-
<motion.div
|
|
436
|
-
className="relative z-10"
|
|
437
|
-
animate={{
|
|
438
|
-
z: isHovered || isFocused ? 20 : 0,
|
|
439
|
-
}}
|
|
440
|
-
transition={{ duration: 0.2 * (1 / animationSpeed) }}
|
|
441
|
-
>
|
|
442
|
-
{children}
|
|
443
|
-
</motion.div>
|
|
444
|
-
|
|
445
|
-
{/* Overlay */}
|
|
446
|
-
{overlayContent && (
|
|
447
|
-
<motion.div
|
|
448
|
-
className="absolute inset-0 rounded-lg pointer-events-none z-20"
|
|
449
|
-
animate={{
|
|
450
|
-
opacity: overlayAlwaysVisible ? 1 : (isHovered || isFocused ? 1 : 0),
|
|
451
|
-
}}
|
|
452
|
-
transition={{ duration: 0.3 * (1 / animationSpeed) }}
|
|
453
|
-
>
|
|
454
|
-
{overlayContent}
|
|
455
|
-
</motion.div>
|
|
456
|
-
)}
|
|
457
|
-
|
|
458
|
-
{/* Gradient overlay */}
|
|
459
|
-
{variant !== 'subtle' && (
|
|
460
|
-
<motion.div
|
|
461
|
-
className={cn(
|
|
462
|
-
"absolute inset-0 rounded-lg pointer-events-none",
|
|
463
|
-
variant === 'dramatic' && "bg-gradient-to-br from-white/10 via-transparent to-black/10",
|
|
464
|
-
variant === 'gaming' && "bg-gradient-to-br from-primary/10 via-transparent to-primary/5",
|
|
465
|
-
variant === 'elegant' && "bg-gradient-to-br from-white/5 via-transparent to-black/5",
|
|
466
|
-
variant === 'neon' && "bg-gradient-to-br from-primary/20 via-transparent to-primary/10"
|
|
467
|
-
)}
|
|
468
|
-
animate={{
|
|
469
|
-
opacity: isHovered || isFocused ? 1 : 0,
|
|
470
|
-
}}
|
|
471
|
-
transition={{ duration: 0.3 * (1 / animationSpeed) }}
|
|
472
|
-
/>
|
|
473
|
-
)}
|
|
474
|
-
|
|
475
|
-
{/* Glow effect */}
|
|
476
|
-
{glowEffect !== 'none' && (
|
|
477
|
-
<motion.div
|
|
478
|
-
className="absolute inset-0 rounded-lg pointer-events-none -z-10"
|
|
479
|
-
animate={glowStyle}
|
|
480
|
-
transition={{ duration: 0.3 * (1 / animationSpeed) }}
|
|
481
|
-
/>
|
|
482
|
-
)}
|
|
483
|
-
</motion.div>
|
|
484
|
-
</div>
|
|
485
|
-
)
|
|
486
|
-
}
|
|
487
|
-
)
|
|
488
|
-
|
|
489
|
-
HoverCard3DInternal.displayName = "HoverCard3DInternal"
|
|
490
|
-
|
|
491
|
-
export const HoverCard3D = React.forwardRef<HTMLDivElement, HoverCard3DProps>(
|
|
492
|
-
(props, ref) => {
|
|
493
|
-
// Pro package - always show component
|
|
494
|
-
const { hasProAccess, isLoading } = useSubscription()
|
|
495
|
-
|
|
496
|
-
// Show upgrade prompt if no pro access
|
|
497
|
-
if (!isLoading && !hasProAccess) {
|
|
498
|
-
return (
|
|
499
|
-
<Card className={cn("w-fit", props.className)}>
|
|
500
|
-
<CardContent className="py-6 text-center">
|
|
501
|
-
<div className="space-y-4">
|
|
502
|
-
<div className="rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto">
|
|
503
|
-
<Lock className="h-6 w-6 text-purple-600 dark:text-purple-400" />
|
|
504
|
-
</div>
|
|
505
|
-
<div>
|
|
506
|
-
<h3 className="font-semibold text-sm mb-2">Pro Feature</h3>
|
|
507
|
-
<p className="text-muted-foreground text-xs mb-4">
|
|
508
|
-
3D Hover Card is available exclusively to MoonUI Pro subscribers.
|
|
509
|
-
</p>
|
|
510
|
-
<a href="/pricing">
|
|
511
|
-
<Button size="sm">
|
|
512
|
-
<Sparkles className="mr-2 h-4 w-4" />
|
|
513
|
-
Upgrade to Pro
|
|
514
|
-
</Button>
|
|
515
|
-
</a>
|
|
516
|
-
</div>
|
|
517
|
-
</div>
|
|
518
|
-
</CardContent>
|
|
519
|
-
</Card>
|
|
520
|
-
)
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
return <HoverCard3DInternal {...props} ref={ref} />
|
|
524
|
-
}
|
|
525
|
-
)
|
|
526
|
-
|
|
527
|
-
HoverCard3D.displayName = "HoverCard3D"
|
|
528
|
-
|
|
529
|
-
export { hoverCard3DVariants }
|
package/src/components/index.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// Pro Components Export - Source of Truth: packages/moonui-pro
|
|
2
|
-
|
|
3
|
-
// UI Components (Enhanced versions with Pro suffix)
|
|
4
|
-
export * from "./ui"
|
|
5
|
-
|
|
6
|
-
// Animated Button
|
|
7
|
-
export {
|
|
8
|
-
MoonUIAnimatedButtonPro,
|
|
9
|
-
moonUIAnimatedButtonProVariants,
|
|
10
|
-
type MoonUIAnimatedButtonProProps
|
|
11
|
-
} from "./animated-button"
|
|
12
|
-
|
|
13
|
-
// Error Boundary
|
|
14
|
-
export * from "./error-boundary"
|
|
15
|
-
|
|
16
|
-
// Floating Action Button
|
|
17
|
-
export * from "./floating-action-button"
|
|
18
|
-
|
|
19
|
-
// Hover Card 3D
|
|
20
|
-
export * from "./hover-card-3d"
|
|
21
|
-
|
|
22
|
-
// Magnetic Button
|
|
23
|
-
export * from "./magnetic-button"
|
|
24
|
-
|
|
25
|
-
// Pinch Zoom
|
|
26
|
-
export * from "./pinch-zoom"
|
|
27
|
-
|
|
28
|
-
// Spotlight Card
|
|
29
|
-
export * from "./spotlight-card"
|
|
30
|
-
|
|
31
|
-
// Calendar component (Advanced version with events)
|
|
32
|
-
export { Calendar as AdvancedCalendar } from "./calendar"
|
|
33
|
-
export { Calendar as CalendarPro } from "./calendar"
|
|
34
|
-
export type { CalendarEvent } from "./calendar"
|
|
35
|
-
|
|
36
|
-
// Kanban
|
|
37
|
-
export { Kanban } from "./kanban"
|
|
38
|
-
export type { KanbanCard, KanbanColumn, KanbanProps, KanbanAssignee, KanbanLabel } from "./kanban"
|
|
39
|
-
|
|
40
|
-
// Rich Text Editor
|
|
41
|
-
export * from "./rich-text-editor"
|
|
42
|
-
|
|
43
|
-
// Memory Efficient Data
|
|
44
|
-
export * from "./memory-efficient-data"
|
|
45
|
-
|
|
46
|
-
// Virtual List
|
|
47
|
-
export * from "./virtual-list"
|
|
48
|
-
|
|
49
|
-
// Swipeable Card
|
|
50
|
-
export * from "./swipeable-card"
|
|
51
|
-
|
|
52
|
-
// Timeline
|
|
53
|
-
export * from "./timeline"
|
|
54
|
-
|
|
55
|
-
// Advanced Chart
|
|
56
|
-
export * from "./advanced-chart"
|
|
57
|
-
|
|
58
|
-
// Dashboard
|
|
59
|
-
export * from "./dashboard"
|
|
60
|
-
|
|
61
|
-
// Draggable List
|
|
62
|
-
export * from "./draggable-list"
|
|
63
|
-
|
|
64
|
-
// Advanced Forms
|
|
65
|
-
export * from "./advanced-forms"
|
|
66
|
-
|
|
67
|
-
// Note: ColorPicker is available in UI components
|
|
68
|
-
|
|
69
|
-
// GitHub Stars
|
|
70
|
-
export * from "./github-stars"
|
|
71
|
-
|
|
72
|
-
// Health Check
|
|
73
|
-
export * from "./health-check"
|
|
74
|
-
|
|
75
|
-
// Lazy Component
|
|
76
|
-
export * from "./lazy-component"
|
|
77
|
-
|
|
78
|
-
// Optimized Image
|
|
79
|
-
export * from "./optimized-image"
|
|
80
|
-
|
|
81
|
-
// Performance Debugger
|
|
82
|
-
export * from "./performance-debugger"
|
|
83
|
-
|
|
84
|
-
// Performance Monitor
|
|
85
|
-
export * from "./performance-monitor"
|
|
86
|
-
|
|
87
|
-
// File Upload
|
|
88
|
-
export * from "./file-upload"
|
|
89
|
-
|
|
90
|
-
// Data Table
|
|
91
|
-
export * from "./data-table"
|
|
92
|
-
|
|
93
|
-
// Sidebar
|
|
94
|
-
export * from "./sidebar"
|
|
95
|
-
|
|
96
|
-
// Navbar
|
|
97
|
-
export * from "./navbar"
|
|
98
|
-
|
|
99
|
-
// Form Wizard
|
|
100
|
-
export * from "./form-wizard"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// Quiz Form
|
|
104
|
-
export * from "./quiz-form"
|
|
105
|
-
|
|
106
|
-
// Credit Card Input
|
|
107
|
-
export * from "./credit-card-input"
|
|
108
|
-
|
|
109
|
-
// Phone Number Input
|
|
110
|
-
export * from "./phone-number-input"
|
|
111
|
-
|
|
112
|
-
// MoonUI Quiz Form (Advanced)
|
|
113
|
-
export {
|
|
114
|
-
MoonUIQuizFormPro,
|
|
115
|
-
type MoonUIQuizFormProProps,
|
|
116
|
-
type Question as MoonUIQuestion,
|
|
117
|
-
type QuestionType as MoonUIQuestionType,
|
|
118
|
-
type QuizSettings as MoonUIQuizSettings,
|
|
119
|
-
type UserAnswer as MoonUIUserAnswer,
|
|
120
|
-
type QuizResult as MoonUIQuizResult
|
|
121
|
-
} from "./moonui-quiz-form"
|
|
122
|
-
|
|
123
|
-
// Gesture Drawer
|
|
124
|
-
export {
|
|
125
|
-
MoonUIGestureDrawerPro,
|
|
126
|
-
GestureDrawer,
|
|
127
|
-
type MoonUIGestureDrawerProProps,
|
|
128
|
-
type GestureDrawerProps,
|
|
129
|
-
moonUIGestureDrawerProVariants
|
|
130
|
-
} from "./gesture-drawer"
|