@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.
Files changed (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. package/src/utils/license-validator.tsx +0 -183
@@ -1,225 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Search } from "lucide-react"
5
- import { Command as CommandPrimitive } from "cmdk"
6
- import { cva, type VariantProps } from "class-variance-authority"
7
-
8
- import { cn } from "../../lib/utils"
9
- import { Dialog, DialogContent, DialogTitle } from "./dialog"
10
-
11
- /**
12
- * Command (Komut Paleti) Bileşeni
13
- *
14
- * Gerçek command palette işlevselliği ile klavye navigasyonu, arama ve filtreleme.
15
- * cmdk kütüphanesi üzerine inşa edilmiş, tam özellikli command interface.
16
- */
17
-
18
- const MoonUIcommandVariantsPro = cva(
19
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
20
- {
21
- variants: {
22
- variant: {
23
- default: "bg-popover text-popover-foreground",
24
- glass: "bg-background/80 text-foreground backdrop-blur-sm",
25
- bordered: "bg-popover text-popover-foreground border border-border",
26
- },
27
- size: {
28
- sm: "min-h-[200px]",
29
- default: "min-h-[300px]",
30
- lg: "min-h-[400px]",
31
- },
32
- },
33
- defaultVariants: {
34
- variant: "default",
35
- size: "default",
36
- },
37
- }
38
- )
39
-
40
- // Command bileşeni - cmdk primitive wrapper
41
- interface CommandProps
42
- extends React.ComponentProps<typeof CommandPrimitive>,
43
- VariantProps<typeof MoonUIcommandVariantsPro> {}
44
-
45
- const MoonUICommandPro = React.forwardRef<
46
- React.ElementRef<typeof CommandPrimitive>,
47
- CommandProps
48
- >(({ className, variant, size, ...props }, ref) => (
49
- <CommandPrimitive
50
- ref={ref}
51
- className={cn(MoonUIcommandVariantsPro({ variant, size }), className)}
52
- {...props}
53
- />
54
- ))
55
- MoonUICommandPro.displayName = CommandPrimitive.displayName
56
-
57
- // CommandDialog bileşeni
58
- interface CommandDialogProps extends React.ComponentProps<typeof Dialog> {
59
- commandClassName?: string
60
- children?: React.ReactNode
61
- }
62
-
63
- const MoonUICommandDialogPro = ({
64
- children,
65
- commandClassName,
66
- ...props
67
- }: CommandDialogProps) => {
68
- return (
69
- <Dialog {...props}>
70
- <DialogContent className="overflow-hidden p-0 shadow-lg" hideCloseButton>
71
- <DialogTitle className="sr-only">Command Menu</DialogTitle>
72
- <MoonUICommandPro className={cn(
73
- "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
74
- commandClassName
75
- )}>
76
- {children}
77
- </MoonUICommandPro>
78
- </DialogContent>
79
- </Dialog>
80
- )
81
- }
82
-
83
- // CommandInput bileşeni
84
- interface CommandInputProps
85
- extends React.ComponentProps<typeof CommandPrimitive.Input> {}
86
-
87
- const MoonUICommandInputPro = React.forwardRef<
88
- React.ElementRef<typeof CommandPrimitive.Input>,
89
- CommandInputProps
90
- >(({ className, ...props }, ref) => (
91
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
92
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
93
- <CommandPrimitive.Input
94
- ref={ref}
95
- className={cn(
96
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
97
- className
98
- )}
99
- {...props}
100
- />
101
- </div>
102
- ))
103
- MoonUICommandInputPro.displayName = CommandPrimitive.Input.displayName
104
-
105
- // CommandList bileşeni
106
- interface CommandListProps
107
- extends React.ComponentProps<typeof CommandPrimitive.List> {}
108
-
109
- const MoonUICommandListPro = React.forwardRef<
110
- React.ElementRef<typeof CommandPrimitive.List>,
111
- CommandListProps
112
- >(({ className, ...props }, ref) => (
113
- <CommandPrimitive.List
114
- ref={ref}
115
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
116
- {...props}
117
- />
118
- ))
119
- MoonUICommandListPro.displayName = CommandPrimitive.List.displayName
120
-
121
- // CommandEmpty bileşeni
122
- interface CommandEmptyProps
123
- extends React.ComponentProps<typeof CommandPrimitive.Empty> {}
124
-
125
- const MoonUICommandEmptyPro = React.forwardRef<
126
- React.ElementRef<typeof CommandPrimitive.Empty>,
127
- CommandEmptyProps
128
- >(({ className, ...props }, ref) => (
129
- <CommandPrimitive.Empty
130
- ref={ref}
131
- className={cn("py-6 text-center text-sm text-muted-foreground", className)}
132
- {...props}
133
- />
134
- ))
135
- MoonUICommandEmptyPro.displayName = CommandPrimitive.Empty.displayName
136
-
137
- // CommandGroup bileşeni
138
- interface CommandGroupProps
139
- extends React.ComponentProps<typeof CommandPrimitive.Group> {}
140
-
141
- const MoonUICommandGroupPro = React.forwardRef<
142
- React.ElementRef<typeof CommandPrimitive.Group>,
143
- CommandGroupProps
144
- >(({ className, ...props }, ref) => (
145
- <CommandPrimitive.Group
146
- ref={ref}
147
- className={cn(
148
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
149
- className
150
- )}
151
- {...props}
152
- />
153
- ))
154
- MoonUICommandGroupPro.displayName = CommandPrimitive.Group.displayName
155
-
156
- // CommandSeparator bileşeni
157
- interface CommandSeparatorProps
158
- extends React.ComponentProps<typeof CommandPrimitive.Separator> {}
159
-
160
- const MoonUICommandSeparatorPro = React.forwardRef<
161
- React.ElementRef<typeof CommandPrimitive.Separator>,
162
- CommandSeparatorProps
163
- >(({ className, ...props }, ref) => (
164
- <CommandPrimitive.Separator
165
- ref={ref}
166
- className={cn("-mx-1 h-px bg-border", className)}
167
- {...props}
168
- />
169
- ))
170
- MoonUICommandSeparatorPro.displayName = CommandPrimitive.Separator.displayName
171
-
172
- // CommandItem bileşeni
173
- interface CommandItemProps
174
- extends React.ComponentProps<typeof CommandPrimitive.Item> {}
175
-
176
- const MoonUICommandItemPro = React.forwardRef<
177
- React.ElementRef<typeof CommandPrimitive.Item>,
178
- CommandItemProps
179
- >(({ className, ...props }, ref) => (
180
- <CommandPrimitive.Item
181
- ref={ref}
182
- className={cn(
183
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
184
- className
185
- )}
186
- {...props}
187
- />
188
- ))
189
- MoonUICommandItemPro.displayName = CommandPrimitive.Item.displayName
190
-
191
- // CommandShortcut bileşeni - utility component
192
- const MoonUICommandShortcutPro = ({
193
- className,
194
- ...props
195
- }: React.HTMLAttributes<HTMLSpanElement>) => {
196
- return (
197
- <span
198
- className={cn(
199
- "ml-auto text-xs tracking-widest text-muted-foreground",
200
- className
201
- )}
202
- {...props}
203
- />
204
- )
205
- }
206
- MoonUICommandShortcutPro.displayName = "CommandShortcutPro"
207
-
208
-
209
- // Internal aliases for Pro component usage
210
- export const commandVariantsInternal = MoonUIcommandVariantsPro
211
- export const CommandInternal = MoonUICommandPro
212
- export const CommandDialogInternal = MoonUICommandDialogPro
213
- export const CommandInputInternal = MoonUICommandInputPro
214
- export const CommandListInternal = MoonUICommandListPro
215
- export const CommandEmptyInternal = MoonUICommandEmptyPro
216
- export const CommandGroupInternal = MoonUICommandGroupPro
217
- export const CommandSeparatorInternal = MoonUICommandSeparatorPro
218
- export const CommandItemInternal = MoonUICommandItemPro
219
- export const CommandShortcutInternal = MoonUICommandShortcutPro
220
-
221
- // Pro exports
222
- export { MoonUIcommandVariantsPro, MoonUICommandPro, MoonUICommandDialogPro, MoonUICommandInputPro, MoonUICommandListPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandSeparatorPro, MoonUICommandItemPro, MoonUICommandShortcutPro }
223
-
224
- // Clean exports (without MoonUI prefix for easier usage)
225
- export { MoonUIcommandVariantsPro as commandVariants, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandInputPro as CommandInput, MoonUICommandListPro as CommandList, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandItemPro as CommandItem, MoonUICommandShortcutPro as CommandShortcut }
@@ -1,334 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
- import { cva, type VariantProps } from "class-variance-authority";
6
- import { Check, Loader2, X } from "lucide-react";
7
-
8
- import { cn } from "../../lib/utils";
9
-
10
- /**
11
- * Premium Dialog Component
12
- *
13
- * Modern, accessible and customizable modal dialog component.
14
- * Enhances user experience with variants, sizes and rich features.
15
- * Provides a premium appearance with dark and light mode compatibility and fluid animations.
16
- */
17
-
18
- const MoonUIDialogPro = DialogPrimitive.Root;
19
- const MoonUIDialogTriggerPro = DialogPrimitive.Trigger;
20
- const MoonUIDialogPortal = DialogPrimitive.Portal;
21
- const MoonUIDialogClosePro = DialogPrimitive.Close;
22
-
23
- const overlayVariants = cva(
24
- "fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
25
- {
26
- variants: {
27
- variant: {
28
- default: "bg-black/80",
29
- subtle: "bg-black/60",
30
- blur: "bg-black/40 backdrop-blur-md",
31
- minimal: "bg-black/20 backdrop-blur-sm",
32
- },
33
- animation: {
34
- default: "duration-200",
35
- slow: "duration-300",
36
- fast: "duration-100",
37
- },
38
- },
39
- defaultVariants: {
40
- variant: "default",
41
- animation: "default",
42
- },
43
- }
44
- );
45
-
46
- interface DialogOverlayProps
47
- extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>,
48
- VariantProps<typeof overlayVariants> {}
49
-
50
- const MoonUIDialogOverlayPro = React.forwardRef<
51
- React.ElementRef<typeof DialogPrimitive.Overlay>,
52
- DialogOverlayProps
53
- >(({ className, variant, animation, ...props }, ref) => (
54
- <DialogPrimitive.Overlay
55
- ref={ref}
56
- className={cn(overlayVariants({ variant, animation }), className)}
57
- {...props}
58
- />
59
- ));
60
- MoonUIDialogOverlayPro.displayName = DialogPrimitive.Overlay.displayName;
61
-
62
- const dialogContentVariants = cva(
63
- "fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg",
64
- {
65
- variants: {
66
- variant: {
67
- default: "border-gray-200 dark:border-gray-700",
68
- primary: "border-primary/20 dark:border-primary/30",
69
- secondary: "border-gray-300 dark:border-gray-600",
70
- ghost: "border-transparent shadow-xl",
71
- destructive: "border-error/20 dark:border-error/30",
72
- },
73
- size: {
74
- xs: "max-w-xs p-4",
75
- sm: "max-w-sm p-5",
76
- default: "max-w-lg p-6",
77
- md: "max-w-md p-6",
78
- lg: "max-w-2xl p-7",
79
- xl: "max-w-4xl p-8",
80
- full: "max-w-[95vw] max-h-[95vh] p-6",
81
- },
82
- radius: {
83
- none: "rounded-none",
84
- sm: "rounded-md",
85
- default: "rounded-lg",
86
- lg: "rounded-xl",
87
- xl: "rounded-2xl",
88
- full: "rounded-3xl",
89
- },
90
- animation: {
91
- default:
92
- "duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
93
- fade: "duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
94
- zoom: "duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
95
- slide: "duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
96
- none: "",
97
- },
98
- position: {
99
- default: "top-[50%]",
100
- top: "top-[5%]",
101
- bottom: "bottom-[5%] top-auto translate-y-0",
102
- },
103
- },
104
- defaultVariants: {
105
- variant: "default",
106
- size: "default",
107
- radius: "default",
108
- animation: "default",
109
- position: "default",
110
- },
111
- }
112
- );
113
-
114
- interface MoonUIDialogContentProProps
115
- extends Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, 'title'>,
116
- VariantProps<typeof dialogContentVariants> {
117
- /** X butonunu gizle */
118
- hideCloseButton?: boolean;
119
- /** Overlay varyantı */
120
- overlayVariant?: VariantProps<typeof overlayVariants>["variant"];
121
- /** Overlay animasyonu */
122
- overlayAnimation?: VariantProps<typeof overlayVariants>["animation"];
123
- /** İçerik başlığı (hızlı kullanım için) */
124
- title?: React.ReactNode;
125
- /** İçerik açıklaması (hızlı kullanım için) */
126
- description?: React.ReactNode;
127
- /** Başlık ikonu */
128
- icon?: React.ReactNode;
129
- /** Yükleniyor durumu */
130
- loading?: boolean;
131
- /** Success durumu */
132
- success?: boolean;
133
- /** Özel onClose handler */
134
- onClose?: () => void;
135
- }
136
-
137
- const MoonUIDialogContentPro = React.forwardRef<
138
- React.ElementRef<typeof DialogPrimitive.Content>,
139
- MoonUIDialogContentProProps
140
- >(
141
- (
142
- {
143
- className,
144
- children,
145
- variant,
146
- size,
147
- radius,
148
- animation,
149
- position,
150
- overlayVariant = "default",
151
- overlayAnimation = "default",
152
- hideCloseButton = false,
153
- title,
154
- description,
155
- icon,
156
- loading = false,
157
- success = false,
158
- onClose,
159
- ...props
160
- },
161
- ref
162
- ) => {
163
- // Capturing the close function through the Radix Dialog API
164
- const handleClose = () => {
165
- if (onClose) {
166
- onClose();
167
- }
168
- };
169
-
170
- return (
171
- <MoonUIDialogPortal>
172
- <MoonUIDialogOverlayPro
173
- variant={overlayVariant}
174
- animation={overlayAnimation}
175
- onClick={hideCloseButton ? undefined : handleClose}
176
- />
177
- <DialogPrimitive.Content
178
- ref={ref}
179
- onEscapeKeyDown={hideCloseButton ? undefined : handleClose}
180
- onInteractOutside={
181
- hideCloseButton ? undefined : handleClose
182
- }
183
- className={cn(
184
- dialogContentVariants({
185
- variant,
186
- size,
187
- radius,
188
- animation,
189
- position,
190
- }),
191
- "outline-none",
192
- loading && "pointer-events-none",
193
- success && "border-success/40",
194
- className
195
- )}
196
- {...props}
197
- >
198
- {/* Başlık ve açıklama varsa otomatik olarak DialogHeader oluştur */}
199
- {(title || description || icon) && (
200
- <MoonUIDialogHeaderPro className="flex gap-4">
201
- {/* İkon veya loading/success durumları */}
202
- {(icon || loading || success) && (
203
- <div className="flex shrink-0 items-center justify-center">
204
- {loading && (
205
- <Loader2 className="h-5 w-5 animate-spin text-primary" />
206
- )}
207
- {success && (
208
- <Check className="h-5 w-5 text-success" />
209
- )}
210
- {!loading && !success && icon && (
211
- <span className="text-primary">
212
- {icon}
213
- </span>
214
- )}
215
- </div>
216
- )}
217
- <div className="flex-1">
218
- {title && <MoonUIDialogTitlePro>{title}</MoonUIDialogTitlePro>}
219
- {description && (
220
- <MoonUIDialogDescriptionPro>
221
- {description}
222
- </MoonUIDialogDescriptionPro>
223
- )}
224
- </div>
225
- </MoonUIDialogHeaderPro>
226
- )}
227
-
228
- {/* Main content */}
229
- {children}
230
-
231
- {/* Close button */}
232
- {!hideCloseButton && (
233
- <DialogPrimitive.Close
234
- onClick={handleClose}
235
- className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:ring-offset-2 disabled:pointer-events-none dark:text-gray-300 dark:hover:text-white"
236
- >
237
- <X className="h-4 w-4" />
238
- <span className="sr-only">Close</span>
239
- </DialogPrimitive.Close>
240
- )}
241
- </DialogPrimitive.Content>
242
- </MoonUIDialogPortal>
243
- );
244
- }
245
- );
246
- MoonUIDialogContentPro.displayName = DialogPrimitive.Content.displayName;
247
-
248
- const MoonUIDialogHeaderPro = ({
249
- className,
250
- ...props
251
- }: React.HTMLAttributes<HTMLDivElement>) => (
252
- <div
253
- className={cn(
254
- "flex flex-col space-y-2 text-center sm:text-left",
255
- className
256
- )}
257
- {...props}
258
- />
259
- );
260
- MoonUIDialogHeaderPro.displayName = "MoonUIDialogHeaderPro";
261
-
262
- const MoonUIDialogFooterPro = ({
263
- className,
264
- ...props
265
- }: React.HTMLAttributes<HTMLDivElement>) => (
266
- <div
267
- className={cn(
268
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 mt-6",
269
- className
270
- )}
271
- {...props}
272
- />
273
- );
274
- MoonUIDialogFooterPro.displayName = "MoonUIDialogFooterPro";
275
-
276
- const MoonUIDialogTitlePro = React.forwardRef<
277
- React.ElementRef<typeof DialogPrimitive.Title>,
278
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
279
- >(({ className, ...props }, ref) => (
280
- <DialogPrimitive.Title
281
- ref={ref}
282
- className={cn(
283
- "text-xl font-semibold leading-snug tracking-tight dark:text-white",
284
- className
285
- )}
286
- {...props}
287
- />
288
- ));
289
- MoonUIDialogTitlePro.displayName = DialogPrimitive.Title.displayName;
290
-
291
- const MoonUIDialogDescriptionPro = React.forwardRef<
292
- React.ElementRef<typeof DialogPrimitive.Description>,
293
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
294
- >(({ className, ...props }, ref) => (
295
- <DialogPrimitive.Description
296
- ref={ref}
297
- className={cn(
298
- "text-sm text-muted-foreground leading-normal dark:text-gray-400",
299
- className
300
- )}
301
- {...props}
302
- />
303
- ));
304
- MoonUIDialogDescriptionPro.displayName = DialogPrimitive.Description.displayName;
305
-
306
- /**
307
- * Dialog-Form integration for use with form support
308
- * Used to integrate form submission processes into the modal
309
- */
310
- const MoonUIDialogFormPro = React.forwardRef<
311
- HTMLFormElement,
312
- React.HTMLAttributes<HTMLFormElement>
313
- >(({ className, ...props }, ref) => (
314
- <form
315
- ref={ref}
316
- className={cn("flex flex-col gap-4", className)}
317
- {...props}
318
- />
319
- ));
320
- MoonUIDialogFormPro.displayName = "DialogForm";
321
-
322
- export { MoonUIDialogPro,
323
- MoonUIDialogTriggerPro,
324
- MoonUIDialogContentPro,
325
- MoonUIDialogHeaderPro,
326
- MoonUIDialogFooterPro,
327
- MoonUIDialogTitlePro,
328
- MoonUIDialogDescriptionPro,
329
- MoonUIDialogClosePro,
330
- MoonUIDialogFormPro,
331
- };
332
-
333
- // Backward compatibility exports
334
- export { MoonUIDialogPro as Dialog, MoonUIDialogContentPro as DialogContent, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogTriggerPro as DialogTrigger, MoonUIDialogClosePro as DialogClose };