@moontra/moonui-pro 2.20.0 → 2.20.2

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 (76) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7419 -4935
  3. package/package.json +4 -3
  4. package/scripts/postbuild.js +27 -0
  5. package/src/components/advanced-chart/index.tsx +5 -1
  6. package/src/components/advanced-forms/index.tsx +175 -16
  7. package/src/components/calendar/event-dialog.tsx +18 -13
  8. package/src/components/calendar/index.tsx +197 -50
  9. package/src/components/dashboard/dashboard-grid.tsx +21 -3
  10. package/src/components/dashboard/types.ts +3 -0
  11. package/src/components/dashboard/widgets/activity-feed.tsx +6 -1
  12. package/src/components/dashboard/widgets/comparison-widget.tsx +177 -0
  13. package/src/components/dashboard/widgets/index.ts +5 -0
  14. package/src/components/dashboard/widgets/metric-card.tsx +21 -1
  15. package/src/components/dashboard/widgets/progress-widget.tsx +113 -0
  16. package/src/components/error-boundary/index.tsx +160 -37
  17. package/src/components/form-wizard/form-wizard-context.tsx +54 -26
  18. package/src/components/form-wizard/form-wizard-progress.tsx +33 -2
  19. package/src/components/form-wizard/types.ts +2 -1
  20. package/src/components/github-stars/hooks.ts +1 -0
  21. package/src/components/github-stars/variants.tsx +3 -1
  22. package/src/components/health-check/index.tsx +14 -14
  23. package/src/components/hover-card-3d/index.tsx +2 -3
  24. package/src/components/index.ts +5 -3
  25. package/src/components/kanban/kanban.tsx +23 -18
  26. package/src/components/license-error/index.tsx +2 -0
  27. package/src/components/magnetic-button/index.tsx +56 -7
  28. package/src/components/memory-efficient-data/index.tsx +117 -115
  29. package/src/components/navbar/index.tsx +781 -0
  30. package/src/components/performance-debugger/index.tsx +62 -38
  31. package/src/components/performance-monitor/index.tsx +47 -33
  32. package/src/components/phone-number-input/index.tsx +32 -27
  33. package/src/components/phone-number-input/phone-number-input-simple.tsx +167 -0
  34. package/src/components/rich-text-editor/index.tsx +26 -28
  35. package/src/components/rich-text-editor/slash-commands-extension.ts +15 -5
  36. package/src/components/sidebar/index.tsx +32 -13
  37. package/src/components/timeline/index.tsx +84 -49
  38. package/src/components/ui/accordion.tsx +550 -42
  39. package/src/components/ui/avatar.tsx +2 -0
  40. package/src/components/ui/badge.tsx +2 -0
  41. package/src/components/ui/breadcrumb.tsx +2 -0
  42. package/src/components/ui/button.tsx +39 -33
  43. package/src/components/ui/card.tsx +2 -0
  44. package/src/components/ui/collapsible.tsx +546 -50
  45. package/src/components/ui/command.tsx +790 -67
  46. package/src/components/ui/dialog.tsx +510 -92
  47. package/src/components/ui/dropdown-menu.tsx +540 -52
  48. package/src/components/ui/index.ts +37 -5
  49. package/src/components/ui/input.tsx +2 -0
  50. package/src/components/ui/magnetic-button.tsx +1 -1
  51. package/src/components/ui/media-gallery.tsx +1 -2
  52. package/src/components/ui/navigation-menu.tsx +130 -0
  53. package/src/components/ui/pagination.tsx +2 -0
  54. package/src/components/ui/select.tsx +6 -2
  55. package/src/components/ui/spotlight-card.tsx +1 -1
  56. package/src/components/ui/table.tsx +2 -0
  57. package/src/components/ui/tabs-pro.tsx +542 -0
  58. package/src/components/ui/tabs.tsx +23 -167
  59. package/src/components/ui/toggle.tsx +13 -13
  60. package/src/index.ts +11 -3
  61. package/src/styles/index.css +596 -0
  62. package/src/use-performance-optimizer.ts +1 -1
  63. package/src/utils/chart-helpers.ts +1 -1
  64. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  65. package/src/__tests__/use-local-storage.test.tsx +0 -174
  66. package/src/__tests__/use-pro-access.test.tsx +0 -183
  67. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  68. package/src/components/data-table/data-table.test.tsx +0 -187
  69. package/src/components/enhanced/badge.tsx +0 -191
  70. package/src/components/enhanced/button.tsx +0 -362
  71. package/src/components/enhanced/card.tsx +0 -266
  72. package/src/components/enhanced/dialog.tsx +0 -246
  73. package/src/components/enhanced/index.ts +0 -4
  74. package/src/components/file-upload/file-upload.test.tsx +0 -243
  75. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  76. package/src/types/moonui.d.ts +0 -22
@@ -1,7 +1,13 @@
1
1
  // Core UI Components - Only MoonUI*Pro exports to avoid conflicts
2
2
  export {
3
3
  MoonUIAccordionPro, MoonUIAccordionItemPro, MoonUIAccordionTriggerPro, MoonUIAccordionContentPro,
4
- Accordion, AccordionItem, AccordionTrigger, AccordionContent
4
+ Accordion, AccordionItem, AccordionTrigger, AccordionContent,
5
+ useAccordionAnalytics,
6
+ type AccordionSize, type AccordionVariant, type AnimationMode,
7
+ type MoonUIAccordionProProps, type MoonUIAccordionProBaseProps,
8
+ type MoonUIAccordionProSingleProps, type MoonUIAccordionProMultipleProps,
9
+ type MoonUIAccordionItemProProps, type MoonUIAccordionTriggerProProps,
10
+ type MoonUIAccordionContentProProps
5
11
  } from './accordion';
6
12
 
7
13
  export {
@@ -50,7 +56,10 @@ export {
50
56
 
51
57
  export {
52
58
  MoonUICollapsiblePro, MoonUIcollapsibleTriggerVariantsPro, MoonUICollapsibleTriggerPro, MoonUIcollapsibleContentVariantsPro, MoonUICollapsibleContentPro,
53
- Collapsible, collapsibleTriggerVariants, CollapsibleTrigger, collapsibleContentVariants, CollapsibleContent
59
+ Collapsible, collapsibleTriggerVariants, CollapsibleTrigger, collapsibleContentVariants, CollapsibleContent,
60
+ useCollapsibleAnalytics,
61
+ type MoonUICollapsibleProProps, type MoonUICollapsibleTriggerProProps, type MoonUICollapsibleContentProProps,
62
+ type CollapsibleSize, type CollapsibleVariant, type AnimationMode as CollapsibleAnimationMode, type BadgeVariant
54
63
  } from './collapsible';
55
64
 
56
65
  export {
@@ -59,10 +68,11 @@ export {
59
68
  } from './color-picker';
60
69
 
61
70
  export {
62
- MoonUIcommandVariantsPro, MoonUICommandPro, MoonUICommandDialogPro, MoonUICommandInputPro, MoonUICommandListPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandItemPro, MoonUICommandShortcutPro, MoonUICommandSeparatorPro,
63
- commandVariants, Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator
71
+ MoonUICommandPro, MoonUICommandDialogPro, MoonUICommandInputPro, MoonUICommandListPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandItemPro, MoonUICommandShortcutPro, MoonUICommandSeparatorPro,
72
+ commandVariantsPro, Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator
64
73
  } from './command';
65
74
 
75
+
66
76
  export {
67
77
  MoonUIDialogPro, MoonUIDialogContentPro, MoonUIDialogHeaderPro, MoonUIDialogFooterPro, MoonUIDialogTitlePro, MoonUIDialogDescriptionPro, MoonUIDialogTriggerPro, MoonUIDialogClosePro,
68
78
  Dialog, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogTrigger, DialogClose
@@ -142,10 +152,20 @@ export {
142
152
  } from './table';
143
153
 
144
154
  export {
145
- MoonUITabsPro, MoonUITabsListPro, MoonUITabsTriggerPro, MoonUITabsContentPro,
146
155
  Tabs, TabsList, TabsTrigger, TabsContent
147
156
  } from './tabs';
148
157
 
158
+ export {
159
+ MoonUITabsPro as MoonUITabsEnhanced, // Backward compatibility
160
+ MoonUITabsPro,
161
+ MoonUITabsListPro,
162
+ MoonUITabsTriggerPro,
163
+ MoonUITabsContentPro,
164
+ type TabItem,
165
+ type MoonUITabsProProps,
166
+ type MoonUITabsProProps as MoonUITabsEnhancedProps // Backward compatibility
167
+ } from './tabs-pro';
168
+
149
169
  export {
150
170
  MoonUITextareaPro,
151
171
  Textarea
@@ -170,6 +190,18 @@ export {
170
190
  HoverCard, HoverCardTrigger, HoverCardContent
171
191
  } from './hover-card';
172
192
 
193
+ export {
194
+ NavigationMenu,
195
+ NavigationMenuList,
196
+ NavigationMenuItem,
197
+ NavigationMenuContent,
198
+ NavigationMenuTrigger,
199
+ NavigationMenuLink,
200
+ NavigationMenuIndicator,
201
+ NavigationMenuViewport,
202
+ navigationMenuTriggerStyle
203
+ } from './navigation-menu';
204
+
173
205
  // HoverCard3D is exported from components/hover-card-3d/index.tsx
174
206
 
175
207
  // Note: Micro-interaction components are exported from their individual directories
@@ -1,3 +1,5 @@
1
+ "use client"
2
+
1
3
  import * as React from "react";
2
4
  import { cva, type VariantProps } from "class-variance-authority";
3
5
  import { cn } from "../../lib/utils";
@@ -110,7 +110,7 @@ const MagneticButton = React.forwardRef<HTMLButtonElement, MagneticButtonProps>(
110
110
  whileHover={{ scale: 1.05 }}
111
111
  whileTap={{ scale: 0.95 }}
112
112
  transition={{ type: "spring", stiffness: 400, damping: 17 }}
113
- {...props}
113
+ {...(props as any)}
114
114
  >
115
115
  <motion.span
116
116
  style={{ x: useTransform(x, (value) => value * 0.2), y: useTransform(y, (value) => value * 0.2) }}
@@ -241,7 +241,7 @@ const MoonUIMediaGalleryPro = React.forwardRef<
241
241
  }
242
242
 
243
243
  const renderGalleryItem = (item: MediaItem, index: number) => {
244
- const isLoaded = !lazyLoad || loadedImages.has(index)
244
+ const isLoaded = !lazyLoad || loadedImages.has(index) || (item.thumbnail && item.thumbnail.endsWith('.svg'))
245
245
 
246
246
  const itemContent = (
247
247
  <motion.div
@@ -450,7 +450,6 @@ const MoonUIMediaGalleryPro = React.forwardRef<
450
450
  className
451
451
  )}
452
452
  style={layout === "masonry" ? { columnGap: "1rem" } : undefined}
453
- {...props}
454
453
  >
455
454
  {loadingState ? (
456
455
  <>
@@ -0,0 +1,130 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
5
+ import { cva } from "class-variance-authority"
6
+ import { ChevronDown } from "lucide-react"
7
+
8
+ import { cn } from "../../lib/utils"
9
+
10
+ const NavigationMenu = React.forwardRef<
11
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
12
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
13
+ >(({ className, children, ...props }, ref) => (
14
+ <NavigationMenuPrimitive.Root
15
+ ref={ref}
16
+ className={cn(
17
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ {children}
23
+ <NavigationMenuViewport />
24
+ </NavigationMenuPrimitive.Root>
25
+ ))
26
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
27
+
28
+ const NavigationMenuList = React.forwardRef<
29
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
30
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
31
+ >(({ className, ...props }, ref) => (
32
+ <NavigationMenuPrimitive.List
33
+ ref={ref}
34
+ className={cn(
35
+ "group flex flex-1 list-none items-center justify-center space-x-1",
36
+ className
37
+ )}
38
+ {...props}
39
+ />
40
+ ))
41
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
42
+
43
+ const NavigationMenuItem = NavigationMenuPrimitive.Item
44
+
45
+ const navigationMenuTriggerStyle = cva(
46
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
47
+ )
48
+
49
+ const NavigationMenuTrigger = React.forwardRef<
50
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
51
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
52
+ >(({ className, children, ...props }, ref) => (
53
+ <NavigationMenuPrimitive.Trigger
54
+ ref={ref}
55
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
56
+ {...props}
57
+ >
58
+ {children}{" "}
59
+ <ChevronDown
60
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
61
+ aria-hidden="true"
62
+ />
63
+ </NavigationMenuPrimitive.Trigger>
64
+ ))
65
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
66
+
67
+ const NavigationMenuContent = React.forwardRef<
68
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
69
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
70
+ >(({ className, ...props }, ref) => (
71
+ <NavigationMenuPrimitive.Content
72
+ ref={ref}
73
+ className={cn(
74
+ "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
75
+ className
76
+ )}
77
+ {...props}
78
+ />
79
+ ))
80
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
81
+
82
+ const NavigationMenuLink = NavigationMenuPrimitive.Link
83
+
84
+ const NavigationMenuViewport = React.forwardRef<
85
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
86
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
87
+ >(({ className, ...props }, ref) => (
88
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
89
+ <NavigationMenuPrimitive.Viewport
90
+ className={cn(
91
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
92
+ className
93
+ )}
94
+ ref={ref}
95
+ {...props}
96
+ />
97
+ </div>
98
+ ))
99
+ NavigationMenuViewport.displayName =
100
+ NavigationMenuPrimitive.Viewport.displayName
101
+
102
+ const NavigationMenuIndicator = React.forwardRef<
103
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
104
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
105
+ >(({ className, ...props }, ref) => (
106
+ <NavigationMenuPrimitive.Indicator
107
+ ref={ref}
108
+ className={cn(
109
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
110
+ className
111
+ )}
112
+ {...props}
113
+ >
114
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
115
+ </NavigationMenuPrimitive.Indicator>
116
+ ))
117
+ NavigationMenuIndicator.displayName =
118
+ NavigationMenuPrimitive.Indicator.displayName
119
+
120
+ export {
121
+ navigationMenuTriggerStyle,
122
+ NavigationMenu,
123
+ NavigationMenuList,
124
+ NavigationMenuItem,
125
+ NavigationMenuContent,
126
+ NavigationMenuTrigger,
127
+ NavigationMenuLink,
128
+ NavigationMenuIndicator,
129
+ NavigationMenuViewport,
130
+ }
@@ -1,3 +1,5 @@
1
+ "use client"
2
+
1
3
  import * as React from "react"
2
4
  import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
5
  import { cn } from "../../lib/utils"
@@ -162,7 +162,7 @@ interface MoonUISelectContentProProps extends React.ComponentPropsWithoutRef<typ
162
162
  const MoonUISelectContentPro = React.forwardRef<
163
163
  React.ElementRef<typeof SelectPrimitive.Content>,
164
164
  MoonUISelectContentProProps
165
- >(({ className, children, position = "popper", enableSearch, searchPlaceholder = "Search...", noResultsText = "No results found", searchLoading, searchIcon, ...props }, ref) => {
165
+ >(({ className, children, position = "popper", side = "bottom", align = "start", enableSearch, searchPlaceholder = "Search...", noResultsText = "No results found", searchLoading, searchIcon, ...props }, ref) => {
166
166
  const [searchValue, setSearchValue] = React.useState("");
167
167
 
168
168
  // Filter children based on search
@@ -207,7 +207,11 @@ const MoonUISelectContentPro = React.forwardRef<
207
207
  className
208
208
  )}
209
209
  position={position}
210
- sideOffset={5}
210
+ side={side}
211
+ align={align}
212
+ sideOffset={4}
213
+ avoidCollisions={true}
214
+ collisionPadding={10}
211
215
  {...props}
212
216
  >
213
217
  {enableSearch && (
@@ -74,7 +74,7 @@ const SpotlightCard = React.forwardRef<HTMLDivElement, SpotlightCardProps>(
74
74
  onMouseLeave={handleMouseLeave}
75
75
  whileHover={{ scale: 1.02 }}
76
76
  transition={{ type: "spring", stiffness: 400, damping: 25 }}
77
- {...props}
77
+ {...(props as any)}
78
78
  >
79
79
  {/* Spotlight overlay */}
80
80
  <motion.div
@@ -1,3 +1,5 @@
1
+ "use client"
2
+
1
3
  import * as React from "react";
2
4
  import { cva, type VariantProps } from "class-variance-authority";
3
5