@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.
- package/dist/index.d.ts +691 -261
- package/dist/index.mjs +7418 -4934
- package/package.json +11 -5
- package/plugin/index.d.ts +86 -0
- package/plugin/index.js +308 -0
- package/scripts/postbuild.js +27 -0
- package/scripts/postinstall.js +176 -23
- package/src/__tests__/use-intersection-observer.test.tsx +0 -216
- package/src/__tests__/use-local-storage.test.tsx +0 -174
- package/src/__tests__/use-pro-access.test.tsx +0 -183
- package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
- package/src/components/advanced-chart/index.tsx +0 -1242
- package/src/components/advanced-forms/index.tsx +0 -426
- package/src/components/animated-button/index.tsx +0 -385
- package/src/components/calendar/event-dialog.tsx +0 -372
- package/src/components/calendar/index.tsx +0 -1073
- 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 -462
- 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 -222
- package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
- package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
- package/src/components/dashboard/widgets/metric-card.tsx +0 -343
- 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/data-table.test.tsx +0 -187
- package/src/components/data-table/index.tsx +0 -845
- package/src/components/draggable-list/index.tsx +0 -100
- package/src/components/enhanced/badge.tsx +0 -191
- package/src/components/enhanced/button.tsx +0 -362
- package/src/components/enhanced/card.tsx +0 -266
- package/src/components/enhanced/dialog.tsx +0 -246
- package/src/components/enhanced/index.ts +0 -4
- package/src/components/error-boundary/index.tsx +0 -109
- package/src/components/file-upload/file-upload.test.tsx +0 -243
- 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 -307
- package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
- package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
- 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 -76
- 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 -516
- 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 -513
- package/src/components/health-check/index.tsx +0 -439
- package/src/components/hover-card-3d/index.tsx +0 -530
- package/src/components/index.ts +0 -128
- 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 -1684
- 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 -29
- package/src/components/magnetic-button/index.tsx +0 -167
- package/src/components/memory-efficient-data/index.tsx +0 -1016
- package/src/components/moonui-quiz-form/index.tsx +0 -817
- package/src/components/optimized-image/index.tsx +0 -425
- package/src/components/performance-debugger/index.tsx +0 -589
- package/src/components/performance-monitor/index.tsx +0 -794
- package/src/components/phone-number-input/index.tsx +0 -338
- 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-old-backup.tsx +0 -437
- package/src/components/rich-text-editor/index.tsx +0 -2324
- package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
- 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 -865
- 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 -1148
- package/src/components/ui/accordion.tsx +0 -73
- 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 -153
- package/src/components/ui/badge.tsx +0 -228
- package/src/components/ui/breadcrumb.tsx +0 -214
- package/src/components/ui/button.tsx +0 -222
- package/src/components/ui/calendar.tsx +0 -387
- package/src/components/ui/card.tsx +0 -214
- package/src/components/ui/checkbox.tsx +0 -259
- package/src/components/ui/collapsible.tsx +0 -135
- package/src/components/ui/color-picker.tsx +0 -97
- package/src/components/ui/command.tsx +0 -225
- package/src/components/ui/dialog.tsx +0 -334
- package/src/components/ui/dropdown-menu.tsx +0 -218
- 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 -190
- package/src/components/ui/input.tsx +0 -222
- 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 -612
- package/src/components/ui/pagination.tsx +0 -123
- 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 -374
- 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 -329
- package/src/components/ui/tabs.tsx +0 -198
- 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 -14
- 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 -85
- package/src/styles/tailwind.css +0 -7
- package/src/styles/tokens.css +0 -455
- package/src/types/moonui.d.ts +0 -22
- 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,191 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useState } from "react"
|
|
4
|
-
import { motion } 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
|
-
|
|
11
|
-
export interface SpotlightCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
spotlightColor?: string
|
|
13
|
-
spotlightSize?: number
|
|
14
|
-
intensity?: number
|
|
15
|
-
borderGlow?: boolean
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const SpotlightCardInternal = React.forwardRef<HTMLDivElement, SpotlightCardProps>(
|
|
19
|
-
({
|
|
20
|
-
children,
|
|
21
|
-
className,
|
|
22
|
-
spotlightColor = "rgba(255, 255, 255, 0.25)",
|
|
23
|
-
spotlightSize = 300,
|
|
24
|
-
intensity = 0.8,
|
|
25
|
-
borderGlow = true,
|
|
26
|
-
...props
|
|
27
|
-
}, ref) => {
|
|
28
|
-
const cardRef = useRef<HTMLDivElement>(null)
|
|
29
|
-
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 })
|
|
30
|
-
const [isHovered, setIsHovered] = useState(false)
|
|
31
|
-
|
|
32
|
-
const handleMouseMove = (e: React.MouseEvent) => {
|
|
33
|
-
if (!cardRef.current) return
|
|
34
|
-
|
|
35
|
-
const rect = cardRef.current.getBoundingClientRect()
|
|
36
|
-
const x = e.clientX - rect.left
|
|
37
|
-
const y = e.clientY - rect.top
|
|
38
|
-
|
|
39
|
-
setMousePosition({ x, y })
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const handleMouseEnter = () => {
|
|
43
|
-
setIsHovered(true)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const handleMouseLeave = () => {
|
|
47
|
-
setIsHovered(false)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<motion.div
|
|
52
|
-
ref={(node) => {
|
|
53
|
-
cardRef.current = node
|
|
54
|
-
if (typeof ref === "function") {
|
|
55
|
-
ref(node)
|
|
56
|
-
} else if (ref) {
|
|
57
|
-
ref.current = node
|
|
58
|
-
}
|
|
59
|
-
}}
|
|
60
|
-
className={cn(
|
|
61
|
-
"relative overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
onMouseMove={handleMouseMove}
|
|
65
|
-
onMouseEnter={handleMouseEnter}
|
|
66
|
-
onMouseLeave={handleMouseLeave}
|
|
67
|
-
whileHover={{ scale: 1.02 }}
|
|
68
|
-
transition={{ duration: 0.2 }}
|
|
69
|
-
>
|
|
70
|
-
{/* Spotlight effect */}
|
|
71
|
-
<motion.div
|
|
72
|
-
className="absolute inset-0 pointer-events-none"
|
|
73
|
-
animate={{
|
|
74
|
-
opacity: isHovered ? intensity : 0,
|
|
75
|
-
}}
|
|
76
|
-
transition={{ duration: 0.3 }}
|
|
77
|
-
style={{
|
|
78
|
-
background: `radial-gradient(${spotlightSize}px circle at ${mousePosition.x}px ${mousePosition.y}px, ${spotlightColor}, transparent 70%)`,
|
|
79
|
-
}}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
{/* Secondary glow effect */}
|
|
83
|
-
<motion.div
|
|
84
|
-
className="absolute inset-0 pointer-events-none"
|
|
85
|
-
animate={{
|
|
86
|
-
opacity: isHovered ? intensity * 0.5 : 0,
|
|
87
|
-
}}
|
|
88
|
-
transition={{ duration: 0.4, delay: 0.1 }}
|
|
89
|
-
style={{
|
|
90
|
-
background: `radial-gradient(${spotlightSize * 1.5}px circle at ${mousePosition.x}px ${mousePosition.y}px, ${spotlightColor.replace('0.25', '0.1')}, transparent 80%)`,
|
|
91
|
-
}}
|
|
92
|
-
/>
|
|
93
|
-
|
|
94
|
-
{/* Border glow */}
|
|
95
|
-
{borderGlow && (
|
|
96
|
-
<motion.div
|
|
97
|
-
className="absolute inset-0 rounded-lg pointer-events-none"
|
|
98
|
-
animate={{
|
|
99
|
-
opacity: isHovered ? 0.6 : 0,
|
|
100
|
-
}}
|
|
101
|
-
transition={{ duration: 0.3 }}
|
|
102
|
-
style={{
|
|
103
|
-
background: `linear-gradient(135deg, transparent 30%, ${spotlightColor.replace('0.25', '0.4')} 50%, transparent 70%)`,
|
|
104
|
-
backgroundSize: '200% 200%',
|
|
105
|
-
backgroundPosition: `${(mousePosition.x / cardRef.current?.offsetWidth!) * 100}% ${(mousePosition.y / cardRef.current?.offsetHeight!) * 100}%`,
|
|
106
|
-
}}
|
|
107
|
-
/>
|
|
108
|
-
)}
|
|
109
|
-
|
|
110
|
-
{/* Content */}
|
|
111
|
-
<div className="relative z-10">
|
|
112
|
-
{children}
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
{/* Subtle animated particles */}
|
|
116
|
-
<motion.div
|
|
117
|
-
className="absolute inset-0 pointer-events-none"
|
|
118
|
-
animate={{
|
|
119
|
-
opacity: isHovered ? 0.3 : 0,
|
|
120
|
-
}}
|
|
121
|
-
transition={{ duration: 0.5 }}
|
|
122
|
-
>
|
|
123
|
-
{[...Array(3)].map((_, i) => (
|
|
124
|
-
<motion.div
|
|
125
|
-
key={i}
|
|
126
|
-
className="absolute w-1 h-1 bg-white rounded-full"
|
|
127
|
-
animate={isHovered ? {
|
|
128
|
-
x: [mousePosition.x, mousePosition.x + Math.random() * 100 - 50],
|
|
129
|
-
y: [mousePosition.y, mousePosition.y + Math.random() * 100 - 50],
|
|
130
|
-
opacity: [0, 1, 0],
|
|
131
|
-
scale: [0, 1, 0],
|
|
132
|
-
} : {}}
|
|
133
|
-
transition={{
|
|
134
|
-
duration: 2,
|
|
135
|
-
delay: i * 0.2,
|
|
136
|
-
repeat: isHovered ? Infinity : 0,
|
|
137
|
-
ease: "easeOut"
|
|
138
|
-
}}
|
|
139
|
-
style={{
|
|
140
|
-
left: mousePosition.x,
|
|
141
|
-
top: mousePosition.y,
|
|
142
|
-
}}
|
|
143
|
-
/>
|
|
144
|
-
))}
|
|
145
|
-
</motion.div>
|
|
146
|
-
</motion.div>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
SpotlightCardInternal.displayName = "SpotlightCardInternal"
|
|
152
|
-
|
|
153
|
-
export const SpotlightCard = React.forwardRef<HTMLDivElement, SpotlightCardProps>(
|
|
154
|
-
({ className, ...props }, ref) => {
|
|
155
|
-
// Check if we're in docs mode or have pro access
|
|
156
|
-
const { hasProAccess, isLoading } = useSubscription()
|
|
157
|
-
|
|
158
|
-
// In docs mode, always show the component
|
|
159
|
-
|
|
160
|
-
// If not in docs mode and no pro access, show upgrade prompt
|
|
161
|
-
if (!isLoading && !hasProAccess) {
|
|
162
|
-
return (
|
|
163
|
-
<Card className={cn("w-fit", className)}>
|
|
164
|
-
<CardContent className="py-6 text-center">
|
|
165
|
-
<div className="space-y-4">
|
|
166
|
-
<div className="rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto">
|
|
167
|
-
<Lock className="h-6 w-6 text-purple-600 dark:text-purple-400" />
|
|
168
|
-
</div>
|
|
169
|
-
<div>
|
|
170
|
-
<h3 className="font-semibold text-sm mb-2">Pro Feature</h3>
|
|
171
|
-
<p className="text-muted-foreground text-xs mb-4">
|
|
172
|
-
Spotlight Card is available exclusively to MoonUI Pro subscribers.
|
|
173
|
-
</p>
|
|
174
|
-
<a href="/pricing">
|
|
175
|
-
<Button size="sm">
|
|
176
|
-
<Sparkles className="mr-2 h-4 w-4" />
|
|
177
|
-
Upgrade to Pro
|
|
178
|
-
</Button>
|
|
179
|
-
</a>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</CardContent>
|
|
183
|
-
</Card>
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return <SpotlightCardInternal className={className} ref={ref} {...props} />
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
SpotlightCard.displayName = "SpotlightCard"
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { ReactNode } from "react"
|
|
4
|
-
import { motion, useMotionValue, useTransform, animate, PanInfo } from "framer-motion"
|
|
5
|
-
import { cn } from "../../lib/utils"
|
|
6
|
-
|
|
7
|
-
interface SwipeableCardProps {
|
|
8
|
-
children: ReactNode
|
|
9
|
-
onSwipeLeft?: () => void
|
|
10
|
-
onSwipeRight?: () => void
|
|
11
|
-
onSwipeStart?: () => void
|
|
12
|
-
onSwipeEnd?: () => void
|
|
13
|
-
threshold?: number
|
|
14
|
-
disabled?: boolean
|
|
15
|
-
className?: string
|
|
16
|
-
style?: React.CSSProperties
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const SwipeableCard = React.forwardRef<HTMLDivElement, SwipeableCardProps>(
|
|
20
|
-
({
|
|
21
|
-
children,
|
|
22
|
-
onSwipeLeft,
|
|
23
|
-
onSwipeRight,
|
|
24
|
-
onSwipeStart,
|
|
25
|
-
onSwipeEnd,
|
|
26
|
-
threshold = 100,
|
|
27
|
-
disabled = false,
|
|
28
|
-
className,
|
|
29
|
-
style,
|
|
30
|
-
...props
|
|
31
|
-
}, ref) => {
|
|
32
|
-
const x = useMotionValue(0)
|
|
33
|
-
const rotate = useTransform(x, [-200, 200], [-30, 30])
|
|
34
|
-
const likeOpacity = useTransform(x, [0, threshold], [0, 1])
|
|
35
|
-
const nopeOpacity = useTransform(x, [-threshold, 0], [1, 0])
|
|
36
|
-
|
|
37
|
-
const handleDragStart = () => {
|
|
38
|
-
if (disabled) return
|
|
39
|
-
onSwipeStart?.()
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const handleDragEnd = (event: any, info: PanInfo) => {
|
|
43
|
-
if (disabled) return
|
|
44
|
-
|
|
45
|
-
onSwipeEnd?.()
|
|
46
|
-
|
|
47
|
-
if (Math.abs(info.offset.x) > threshold) {
|
|
48
|
-
const direction = info.offset.x > 0 ? "right" : "left"
|
|
49
|
-
const exitX = info.offset.x > 0 ? 400 : -400
|
|
50
|
-
|
|
51
|
-
animate(x, exitX, { duration: 0.3 })
|
|
52
|
-
|
|
53
|
-
if (direction === "right" && onSwipeRight) {
|
|
54
|
-
onSwipeRight()
|
|
55
|
-
} else if (direction === "left" && onSwipeLeft) {
|
|
56
|
-
onSwipeLeft()
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
animate(x, 0, { type: "spring", stiffness: 300, damping: 20 })
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<motion.div
|
|
65
|
-
ref={ref}
|
|
66
|
-
drag={disabled ? false : "x"}
|
|
67
|
-
dragConstraints={{ left: -300, right: 300 }}
|
|
68
|
-
style={{ x, rotate, ...style }}
|
|
69
|
-
onDragStart={handleDragStart}
|
|
70
|
-
onDragEnd={handleDragEnd}
|
|
71
|
-
className={cn(
|
|
72
|
-
"relative cursor-grab active:cursor-grabbing select-none",
|
|
73
|
-
disabled && "cursor-default",
|
|
74
|
-
className
|
|
75
|
-
)}
|
|
76
|
-
{...props}
|
|
77
|
-
>
|
|
78
|
-
{/* Like indicator */}
|
|
79
|
-
<motion.div
|
|
80
|
-
style={{ opacity: likeOpacity }}
|
|
81
|
-
className="absolute top-4 right-4 bg-green-500 text-white px-3 py-1 rounded-lg font-bold text-lg rotate-[15deg] pointer-events-none z-10"
|
|
82
|
-
>
|
|
83
|
-
LIKE
|
|
84
|
-
</motion.div>
|
|
85
|
-
|
|
86
|
-
{/* Nope indicator */}
|
|
87
|
-
<motion.div
|
|
88
|
-
style={{ opacity: nopeOpacity }}
|
|
89
|
-
className="absolute top-4 left-4 bg-red-500 text-white px-3 py-1 rounded-lg font-bold text-lg rotate-[-15deg] pointer-events-none z-10"
|
|
90
|
-
>
|
|
91
|
-
NOPE
|
|
92
|
-
</motion.div>
|
|
93
|
-
|
|
94
|
-
{children}
|
|
95
|
-
</motion.div>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
SwipeableCard.displayName = "SwipeableCard"
|