@moontra/moonui 2.1.4 → 2.1.7
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.js +8174 -2834
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8074 -2645
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/accordion.tsx +8 -11
- package/src/components/ui/alert.tsx +10 -13
- package/src/components/ui/analyze-components.txt +4 -0
- package/src/components/ui/aspect-ratio.tsx +6 -9
- package/src/components/ui/avatar.tsx +7 -10
- package/src/components/ui/badge.tsx +4 -7
- package/src/components/ui/breadcrumb.tsx +29 -31
- package/src/components/ui/button.tsx +11 -15
- package/src/components/ui/calendar.tsx +6 -9
- package/src/components/ui/card.tsx +19 -22
- package/src/components/ui/checkbox.tsx +5 -8
- package/src/components/ui/collapsible.tsx +10 -12
- package/src/components/ui/color-picker.tsx +2 -2
- package/src/components/ui/command.tsx +26 -28
- package/src/components/ui/component-analysis-report.md +118 -0
- package/src/components/ui/data-table.tsx +2 -2
- package/src/components/ui/date-picker.tsx +9 -9
- package/src/components/ui/dialog.tsx +21 -23
- package/src/components/ui/draggable-list.tsx +81 -0
- package/src/components/ui/dropdown-menu.tsx +34 -36
- package/src/components/ui/file-upload.tsx +3 -3
- package/src/components/ui/gesture-drawer.tsx +146 -0
- package/src/components/ui/index.ts +43 -9
- package/src/components/ui/input.tsx +6 -9
- package/src/components/ui/label.tsx +4 -7
- package/src/components/ui/moon-logo.tsx +1 -1
- package/src/components/ui/pagination.tsx +5 -7
- package/src/components/ui/popover.tsx +9 -11
- package/src/components/ui/progress.tsx +6 -9
- package/src/components/ui/radio-group.tsx +7 -10
- package/src/components/ui/rich-text-editor/index.tsx +71 -0
- package/src/components/ui/select.tsx +21 -23
- package/src/components/ui/separator.tsx +5 -8
- package/src/components/ui/simple-editor.tsx +4 -4
- package/src/components/ui/skeleton.tsx +7 -10
- package/src/components/ui/slider.tsx +5 -8
- package/src/components/ui/swipeable-card.tsx +69 -0
- package/src/components/ui/switch.tsx +3 -6
- package/src/components/ui/table.tsx +29 -31
- package/src/components/ui/tabs.tsx +9 -12
- package/src/components/ui/textarea.tsx +4 -7
- package/src/components/ui/toast.tsx +7 -9
- package/src/components/ui/toggle.tsx +4 -7
- package/src/components/ui/tooltip.tsx +11 -13
- package/src/index.tsx +13 -7
- package/src/lib/utils.ts +2 -65
- package/src/components/ui/locked-component.tsx +0 -215
- package/src/use-pro-access.ts +0 -141
|
@@ -14,7 +14,7 @@ import { cn } from "../../lib/utils"
|
|
|
14
14
|
* Tema sistemiyle tam entegre, erişilebilir ve özelleştirilebilir.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const Collapsible = CollapsiblePrimitive.Root
|
|
18
18
|
|
|
19
19
|
const collapsibleTriggerVariants = cva(
|
|
20
20
|
"flex w-full items-center justify-between transition-all",
|
|
@@ -39,11 +39,11 @@ const collapsibleTriggerVariants = cva(
|
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
|
|
42
|
-
interface
|
|
42
|
+
interface CollapsibleTriggerProps
|
|
43
43
|
extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>,
|
|
44
44
|
VariantProps<typeof collapsibleTriggerVariants> {}
|
|
45
45
|
|
|
46
|
-
const
|
|
46
|
+
const CollapsibleTrigger = React.forwardRef<
|
|
47
47
|
React.ElementRef<typeof CollapsiblePrimitive.Trigger>,
|
|
48
48
|
CollapsibleTriggerProps
|
|
49
49
|
>(({ className, children, variant, size, asChild, ...props }, ref) => {
|
|
@@ -97,11 +97,11 @@ const collapsibleContentVariants = cva(
|
|
|
97
97
|
}
|
|
98
98
|
)
|
|
99
99
|
|
|
100
|
-
interface
|
|
100
|
+
interface CollapsibleContentProps
|
|
101
101
|
extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>,
|
|
102
102
|
VariantProps<typeof collapsibleContentVariants> {}
|
|
103
103
|
|
|
104
|
-
const
|
|
104
|
+
const CollapsibleContent = React.forwardRef<
|
|
105
105
|
React.ElementRef<typeof CollapsiblePrimitive.Content>,
|
|
106
106
|
CollapsibleContentProps
|
|
107
107
|
>(({ className, children, variant, size, ...props }, ref) => (
|
|
@@ -115,15 +115,13 @@ const MoonUICollapsibleContent = React.forwardRef<
|
|
|
115
115
|
))
|
|
116
116
|
CollapsibleContent.displayName = CollapsiblePrimitive.Content.displayName
|
|
117
117
|
|
|
118
|
-
export {
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
export {
|
|
119
|
+
Collapsible,
|
|
120
|
+
CollapsibleTrigger,
|
|
121
|
+
CollapsibleContent,
|
|
121
122
|
collapsibleTriggerVariants,
|
|
122
123
|
collapsibleContentVariants,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// Backward compatibility exports
|
|
126
|
-
export { MoonUICollapsible as Collapsible, MoonUICollapsibleTrigger as CollapsibleTrigger, MoonUICollapsibleContent as CollapsibleContent }
|
|
124
|
+
}
|
|
127
125
|
|
|
128
126
|
export type {
|
|
129
127
|
CollapsibleTriggerProps,
|
|
@@ -131,7 +131,7 @@ function hslToHex(h: number, s: number, l: number): string {
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
export interface
|
|
134
|
+
export interface ColorPickerProps
|
|
135
135
|
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value">,
|
|
136
136
|
VariantProps<typeof colorPickerVariants> {
|
|
137
137
|
/**
|
|
@@ -661,4 +661,4 @@ export function GradientPicker({
|
|
|
661
661
|
}
|
|
662
662
|
|
|
663
663
|
// Re-export icons used
|
|
664
|
-
export { Palette, Pipette
|
|
664
|
+
export { Palette, Pipette } from "lucide-react";
|
|
@@ -38,11 +38,11 @@ const commandVariants = cva(
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
// Command bileşeni - cmdk primitive wrapper
|
|
41
|
-
interface
|
|
41
|
+
interface CommandProps
|
|
42
42
|
extends React.ComponentProps<typeof CommandPrimitive>,
|
|
43
43
|
VariantProps<typeof commandVariants> {}
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const Command = React.forwardRef<
|
|
46
46
|
React.ElementRef<typeof CommandPrimitive>,
|
|
47
47
|
CommandProps
|
|
48
48
|
>(({ className, variant, size, ...props }, ref) => (
|
|
@@ -81,10 +81,10 @@ const CommandDialog = ({
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// CommandInput bileşeni
|
|
84
|
-
interface
|
|
84
|
+
interface CommandInputProps
|
|
85
85
|
extends React.ComponentProps<typeof CommandPrimitive.Input> {}
|
|
86
86
|
|
|
87
|
-
const
|
|
87
|
+
const CommandInput = React.forwardRef<
|
|
88
88
|
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
89
89
|
CommandInputProps
|
|
90
90
|
>(({ className, ...props }, ref) => (
|
|
@@ -103,10 +103,10 @@ const MoonUICommandInput = React.forwardRef<
|
|
|
103
103
|
CommandInput.displayName = CommandPrimitive.Input.displayName
|
|
104
104
|
|
|
105
105
|
// CommandList bileşeni
|
|
106
|
-
interface
|
|
106
|
+
interface CommandListProps
|
|
107
107
|
extends React.ComponentProps<typeof CommandPrimitive.List> {}
|
|
108
108
|
|
|
109
|
-
const
|
|
109
|
+
const CommandList = React.forwardRef<
|
|
110
110
|
React.ElementRef<typeof CommandPrimitive.List>,
|
|
111
111
|
CommandListProps
|
|
112
112
|
>(({ className, ...props }, ref) => (
|
|
@@ -119,10 +119,10 @@ const MoonUICommandList = React.forwardRef<
|
|
|
119
119
|
CommandList.displayName = CommandPrimitive.List.displayName
|
|
120
120
|
|
|
121
121
|
// CommandEmpty bileşeni
|
|
122
|
-
interface
|
|
122
|
+
interface CommandEmptyProps
|
|
123
123
|
extends React.ComponentProps<typeof CommandPrimitive.Empty> {}
|
|
124
124
|
|
|
125
|
-
const
|
|
125
|
+
const CommandEmpty = React.forwardRef<
|
|
126
126
|
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
127
127
|
CommandEmptyProps
|
|
128
128
|
>(({ className, ...props }, ref) => (
|
|
@@ -135,10 +135,10 @@ const MoonUICommandEmpty = React.forwardRef<
|
|
|
135
135
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName
|
|
136
136
|
|
|
137
137
|
// CommandGroup bileşeni
|
|
138
|
-
interface
|
|
138
|
+
interface CommandGroupProps
|
|
139
139
|
extends React.ComponentProps<typeof CommandPrimitive.Group> {}
|
|
140
140
|
|
|
141
|
-
const
|
|
141
|
+
const CommandGroup = React.forwardRef<
|
|
142
142
|
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
143
143
|
CommandGroupProps
|
|
144
144
|
>(({ className, ...props }, ref) => (
|
|
@@ -154,10 +154,10 @@ const MoonUICommandGroup = React.forwardRef<
|
|
|
154
154
|
CommandGroup.displayName = CommandPrimitive.Group.displayName
|
|
155
155
|
|
|
156
156
|
// CommandSeparator bileşeni
|
|
157
|
-
interface
|
|
157
|
+
interface CommandSeparatorProps
|
|
158
158
|
extends React.ComponentProps<typeof CommandPrimitive.Separator> {}
|
|
159
159
|
|
|
160
|
-
const
|
|
160
|
+
const CommandSeparator = React.forwardRef<
|
|
161
161
|
React.ElementRef<typeof CommandPrimitive.Separator>,
|
|
162
162
|
CommandSeparatorProps
|
|
163
163
|
>(({ className, ...props }, ref) => (
|
|
@@ -170,10 +170,10 @@ const MoonUICommandSeparator = React.forwardRef<
|
|
|
170
170
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName
|
|
171
171
|
|
|
172
172
|
// CommandItem bileşeni
|
|
173
|
-
interface
|
|
173
|
+
interface CommandItemProps
|
|
174
174
|
extends React.ComponentProps<typeof CommandPrimitive.Item> {}
|
|
175
175
|
|
|
176
|
-
const
|
|
176
|
+
const CommandItem = React.forwardRef<
|
|
177
177
|
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
178
178
|
CommandItemProps
|
|
179
179
|
>(({ className, ...props }, ref) => (
|
|
@@ -189,7 +189,7 @@ const MoonUICommandItem = React.forwardRef<
|
|
|
189
189
|
CommandItem.displayName = CommandPrimitive.Item.displayName
|
|
190
190
|
|
|
191
191
|
// CommandShortcut bileşeni - utility component
|
|
192
|
-
const
|
|
192
|
+
const CommandShortcut = ({
|
|
193
193
|
className,
|
|
194
194
|
...props
|
|
195
195
|
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
@@ -203,18 +203,16 @@ const MoonUICommandShortcut = ({
|
|
|
203
203
|
/>
|
|
204
204
|
)
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
CommandShortcut.displayName = "CommandShortcut"
|
|
207
207
|
|
|
208
|
-
export {
|
|
208
|
+
export {
|
|
209
|
+
Command,
|
|
209
210
|
CommandDialog,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// Backward compatibility exports
|
|
220
|
-
export { MoonUICommand as Command, MoonUIDialog as Dialog, MoonUIInput as Input, MoonUISeparator as Separator, MoonUICommandInput as CommandInput, MoonUICommandEmpty as CommandEmpty, MoonUICommandGroup as CommandGroup, MoonUICommandItem as CommandItem, MoonUICommandList as CommandList, MoonUICommandSeparator as CommandSeparator, MoonUICommandShortcut as CommandShortcut }
|
|
211
|
+
CommandInput,
|
|
212
|
+
CommandList,
|
|
213
|
+
CommandEmpty,
|
|
214
|
+
CommandGroup,
|
|
215
|
+
CommandItem,
|
|
216
|
+
CommandShortcut,
|
|
217
|
+
CommandSeparator,
|
|
218
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# MoonUI Component Analysis Report
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Total components in `/src/components/ui/`: **55 files**
|
|
6
|
+
|
|
7
|
+
### Component Categories
|
|
8
|
+
|
|
9
|
+
#### 🎯 Pro Components (24 components)
|
|
10
|
+
These are wrapper components that require the `@moontra/moonui-pro` package:
|
|
11
|
+
|
|
12
|
+
1. **advanced-chart.tsx** - Advanced charting component (wrapper)
|
|
13
|
+
2. **animated-button.tsx** - Button with animations (wrapper)
|
|
14
|
+
3. **calendar.tsx** - Calendar component (wrapper)
|
|
15
|
+
4. **dashboard.tsx** - Dashboard layout component (wrapper)
|
|
16
|
+
5. **draggable-list.tsx** - Draggable list component (wrapper)
|
|
17
|
+
6. **error-boundary.tsx** - Error boundary component (wrapper)
|
|
18
|
+
7. **file-upload.tsx** - File upload component (wrapper)
|
|
19
|
+
8. **floating-action-button.tsx** - FAB component (wrapper)
|
|
20
|
+
9. **github-stars.tsx** - GitHub stars display (wrapper)
|
|
21
|
+
10. **health-check.tsx** - Health check monitoring (wrapper)
|
|
22
|
+
11. **hover-card-3d.tsx** - 3D hover effect card (wrapper)
|
|
23
|
+
12. **kanban.tsx** - Kanban board component (wrapper)
|
|
24
|
+
13. **lazy-component.tsx** - Lazy loading component (wrapper)
|
|
25
|
+
14. **magnetic-button.tsx** - Magnetic effect button (wrapper)
|
|
26
|
+
15. **memory-efficient-data.tsx** - Memory optimized data display (wrapper)
|
|
27
|
+
16. **optimized-image.tsx** - Optimized image component (wrapper)
|
|
28
|
+
17. **performance-debugger.tsx** - Performance debugging tool (wrapper)
|
|
29
|
+
18. **performance-monitor.tsx** - Performance monitoring tool (wrapper)
|
|
30
|
+
19. **pinch-zoom.tsx** - Pinch zoom component (wrapper)
|
|
31
|
+
20. **rich-text-editor.tsx** - Rich text editor (wrapper)
|
|
32
|
+
21. **spotlight-card.tsx** - Spotlight effect card (wrapper)
|
|
33
|
+
22. **swipeable-card.tsx** - Swipeable card component (wrapper)
|
|
34
|
+
23. **timeline.tsx** - Timeline component (wrapper)
|
|
35
|
+
24. **virtual-list.tsx** - Virtual scrolling list (wrapper)
|
|
36
|
+
|
|
37
|
+
#### ✅ Free Components - Fully Implemented (23 components)
|
|
38
|
+
These components have complete implementations:
|
|
39
|
+
|
|
40
|
+
1. **aspect-ratio.tsx** - Aspect ratio container
|
|
41
|
+
2. **avatar.tsx** - Avatar component with variants
|
|
42
|
+
3. **badge.tsx** - Badge component with variants
|
|
43
|
+
4. **breadcrumb.tsx** - Breadcrumb navigation
|
|
44
|
+
5. **button.tsx** - Button component with 12 variants (primary, secondary, outline, ghost, destructive, success, link, gradient, glow, soft, glass, neon)
|
|
45
|
+
6. **card.tsx** - Card container components
|
|
46
|
+
7. **checkbox.tsx** - Checkbox with variants
|
|
47
|
+
8. **collapsible.tsx** - Collapsible content component
|
|
48
|
+
9. **color-picker.tsx** - Color picker component
|
|
49
|
+
10. **command.tsx** - Command palette component
|
|
50
|
+
11. **date-picker.tsx** - Date picker with calendar
|
|
51
|
+
12. **dialog.tsx** - Dialog/Modal component
|
|
52
|
+
13. **gesture-drawer.tsx** - Gesture-enabled drawer
|
|
53
|
+
14. **input.tsx** - Input field with variants
|
|
54
|
+
15. **label.tsx** - Label component
|
|
55
|
+
16. **pagination.tsx** - Pagination component
|
|
56
|
+
17. **popover.tsx** - Popover component
|
|
57
|
+
18. **radio-group.tsx** - Radio group component
|
|
58
|
+
19. **select.tsx** - Select dropdown component
|
|
59
|
+
20. **simple-editor.tsx** - Simple text editor
|
|
60
|
+
21. **slider.tsx** - Slider component
|
|
61
|
+
22. **switch.tsx** - Toggle switch component
|
|
62
|
+
23. **table.tsx** - Table component with sorting
|
|
63
|
+
24. **tabs.tsx** - Tabs component
|
|
64
|
+
25. **toggle.tsx** - Toggle button component
|
|
65
|
+
26. **tooltip.tsx** - Tooltip component
|
|
66
|
+
|
|
67
|
+
#### ❌ Empty/Placeholder Components (8 components)
|
|
68
|
+
These files exist but are empty or contain only comments:
|
|
69
|
+
|
|
70
|
+
1. **accordion.tsx** - Empty file (21 bytes)
|
|
71
|
+
2. **alert.tsx** - Empty file (21 bytes)
|
|
72
|
+
3. **dropdown-menu.tsx** - Empty file (21 bytes)
|
|
73
|
+
4. **progress.tsx** - Empty file (21 bytes)
|
|
74
|
+
5. **separator.tsx** - Empty file (21 bytes)
|
|
75
|
+
6. **skeleton.tsx** - Empty file (21 bytes)
|
|
76
|
+
7. **textarea.tsx** - Empty file (21 bytes)
|
|
77
|
+
8. **toast.tsx** - Empty file (21 bytes)
|
|
78
|
+
|
|
79
|
+
## Component Status Summary
|
|
80
|
+
|
|
81
|
+
| Status | Count | Percentage |
|
|
82
|
+
|--------|-------|------------|
|
|
83
|
+
| ✅ Free (Implemented) | 23 | 42% |
|
|
84
|
+
| 🎯 Pro (Wrapper) | 24 | 44% |
|
|
85
|
+
| ❌ Empty/Placeholder | 8 | 14% |
|
|
86
|
+
| **Total** | **55** | **100%** |
|
|
87
|
+
|
|
88
|
+
## Implementation Quality
|
|
89
|
+
|
|
90
|
+
### Pro Component Wrappers
|
|
91
|
+
All pro component wrappers follow a consistent pattern:
|
|
92
|
+
- Proper TypeScript interfaces defined
|
|
93
|
+
- Try-catch block to import from `@moontra/moonui-pro`
|
|
94
|
+
- Fallback UI showing the component requires pro package
|
|
95
|
+
- Proper exports for component and types
|
|
96
|
+
|
|
97
|
+
### Free Components
|
|
98
|
+
Free components show good implementation quality:
|
|
99
|
+
- Built on Radix UI primitives where applicable
|
|
100
|
+
- Use CVA (class-variance-authority) for variant management
|
|
101
|
+
- Proper TypeScript typing
|
|
102
|
+
- Forward ref pattern for DOM access
|
|
103
|
+
- Consistent styling with Tailwind CSS
|
|
104
|
+
- Dark mode support
|
|
105
|
+
|
|
106
|
+
## Recommendations
|
|
107
|
+
|
|
108
|
+
1. **Complete Empty Components**: The 8 empty components (accordion, alert, dropdown-menu, progress, separator, skeleton, textarea, toast) need to be implemented or removed.
|
|
109
|
+
|
|
110
|
+
2. **Documentation**: All implemented components appear to be working correctly but would benefit from usage documentation.
|
|
111
|
+
|
|
112
|
+
3. **Testing**: Consider adding tests for both free and pro components to ensure wrapper behavior works correctly.
|
|
113
|
+
|
|
114
|
+
4. **Component Showcase**: The component showcase page should clearly distinguish between free and pro components for users.
|
|
115
|
+
|
|
116
|
+
## Conclusion
|
|
117
|
+
|
|
118
|
+
The MoonUI component library has a good foundation with 47 active components (23 free + 24 pro). The pro component wrapper pattern is well-implemented and consistent. The main area needing attention is the 8 empty placeholder files that should either be implemented or removed to avoid confusion.
|
|
@@ -99,7 +99,7 @@ const dataTableVariants = cva(
|
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
|
|
102
|
-
interface
|
|
102
|
+
interface DataTableProps<TData, TValue>
|
|
103
103
|
extends VariantProps<typeof dataTableVariants> {
|
|
104
104
|
/**
|
|
105
105
|
* The table columns definition
|
|
@@ -620,4 +620,4 @@ export function createFilterableColumn<TData, TValue>(
|
|
|
620
620
|
}
|
|
621
621
|
|
|
622
622
|
// Export utilities
|
|
623
|
-
export { type ColumnDef
|
|
623
|
+
export { type ColumnDef } from "@tanstack/react-table";
|
|
@@ -4,16 +4,16 @@ import * as React from "react";
|
|
|
4
4
|
import { format, isValid } from "date-fns";
|
|
5
5
|
import { Calendar as CalendarIcon, Clock } from "lucide-react";
|
|
6
6
|
import { cn } from "../../lib/utils";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Button } from "./button";
|
|
8
|
+
import { Calendar } from "./calendar";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Popover,
|
|
11
|
+
PopoverContent,
|
|
12
|
+
PopoverTrigger,
|
|
13
13
|
} from "./popover";
|
|
14
14
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
15
15
|
import { motion, AnimatePresence } from "framer-motion";
|
|
16
|
-
import { microInteractionVariants } from "
|
|
16
|
+
import { microInteractionVariants } from "@/lib/micro-interactions";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* DatePicker Component
|
|
@@ -52,8 +52,8 @@ const datePickerVariants = cva(
|
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
export interface
|
|
56
|
-
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">,
|
|
55
|
+
export interface DatePickerProps
|
|
56
|
+
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value">,
|
|
57
57
|
VariantProps<typeof datePickerVariants> {
|
|
58
58
|
/**
|
|
59
59
|
* Selected date value
|
|
@@ -597,7 +597,7 @@ export function MonthPicker({
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
// Re-export utilities
|
|
600
|
-
export { format
|
|
600
|
+
export { format } from "date-fns";
|
|
601
601
|
|
|
602
602
|
// Import ChevronLeft and ChevronRight for MonthPicker
|
|
603
603
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
@@ -15,10 +15,10 @@ import { cn } from "../../lib/utils";
|
|
|
15
15
|
* Provides a premium appearance with dark and light mode compatibility and fluid animations.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const Dialog = DialogPrimitive.Root;
|
|
19
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
20
20
|
const DialogPortal = DialogPrimitive.Portal;
|
|
21
|
-
const
|
|
21
|
+
const DialogClose = DialogPrimitive.Close;
|
|
22
22
|
|
|
23
23
|
const overlayVariants = cva(
|
|
24
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",
|
|
@@ -111,7 +111,7 @@ const dialogContentVariants = cva(
|
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
-
interface
|
|
114
|
+
interface DialogContentProps
|
|
115
115
|
extends Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, 'title'>,
|
|
116
116
|
VariantProps<typeof dialogContentVariants> {
|
|
117
117
|
/** X butonunu gizle */
|
|
@@ -134,7 +134,7 @@ interface MoonUIDialogContentProps
|
|
|
134
134
|
onClose?: () => void;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
const
|
|
137
|
+
const DialogContent = React.forwardRef<
|
|
138
138
|
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
139
139
|
DialogContentProps
|
|
140
140
|
>(
|
|
@@ -245,7 +245,7 @@ const MoonUIDialogContent = React.forwardRef<
|
|
|
245
245
|
);
|
|
246
246
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
247
247
|
|
|
248
|
-
const
|
|
248
|
+
const DialogHeader = ({
|
|
249
249
|
className,
|
|
250
250
|
...props
|
|
251
251
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
@@ -257,9 +257,9 @@ const MoonUIDialogHeader = ({
|
|
|
257
257
|
{...props}
|
|
258
258
|
/>
|
|
259
259
|
);
|
|
260
|
-
|
|
260
|
+
DialogHeader.displayName = "DialogHeader";
|
|
261
261
|
|
|
262
|
-
const
|
|
262
|
+
const DialogFooter = ({
|
|
263
263
|
className,
|
|
264
264
|
...props
|
|
265
265
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
@@ -271,9 +271,9 @@ const MoonUIDialogFooter = ({
|
|
|
271
271
|
{...props}
|
|
272
272
|
/>
|
|
273
273
|
);
|
|
274
|
-
|
|
274
|
+
DialogFooter.displayName = "DialogFooter";
|
|
275
275
|
|
|
276
|
-
const
|
|
276
|
+
const DialogTitle = React.forwardRef<
|
|
277
277
|
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
278
278
|
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
279
279
|
>(({ className, ...props }, ref) => (
|
|
@@ -288,7 +288,7 @@ const MoonUIDialogTitle = React.forwardRef<
|
|
|
288
288
|
));
|
|
289
289
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
290
290
|
|
|
291
|
-
const
|
|
291
|
+
const DialogDescription = React.forwardRef<
|
|
292
292
|
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
293
293
|
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
294
294
|
>(({ className, ...props }, ref) => (
|
|
@@ -319,16 +319,14 @@ const DialogForm = React.forwardRef<
|
|
|
319
319
|
));
|
|
320
320
|
DialogForm.displayName = "DialogForm";
|
|
321
321
|
|
|
322
|
-
export {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
322
|
+
export {
|
|
323
|
+
Dialog,
|
|
324
|
+
DialogTrigger,
|
|
325
|
+
DialogContent,
|
|
326
|
+
DialogHeader,
|
|
327
|
+
DialogFooter,
|
|
328
|
+
DialogTitle,
|
|
329
|
+
DialogDescription,
|
|
330
|
+
DialogClose,
|
|
330
331
|
DialogForm,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
// Backward compatibility exports
|
|
334
|
-
export { MoonUIDialog as Dialog, MoonUIDialogContent as DialogContent, MoonUIDialogHeader as DialogHeader, MoonUIDialogFooter as DialogFooter, MoonUIDialogTitle as DialogTitle, MoonUIDialogDescription as DialogDescription, MoonUIDialogTrigger as DialogTrigger, MoonUIDialogClose as DialogClose };
|
|
332
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Basic Draggable List - Free Version
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
export interface DraggableListProps<T> {
|
|
8
|
+
items: T[]
|
|
9
|
+
onReorder: (items: T[]) => void
|
|
10
|
+
renderItem: (item: T, index: number) => React.ReactNode
|
|
11
|
+
keyExtractor: (item: T) => string
|
|
12
|
+
className?: string
|
|
13
|
+
disabled?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function DraggableList<T>({
|
|
17
|
+
items,
|
|
18
|
+
onReorder,
|
|
19
|
+
renderItem,
|
|
20
|
+
keyExtractor,
|
|
21
|
+
className,
|
|
22
|
+
disabled = false
|
|
23
|
+
}: DraggableListProps<T>) {
|
|
24
|
+
const [draggedIndex, setDraggedIndex] = React.useState<number | null>(null)
|
|
25
|
+
|
|
26
|
+
const handleDragStart = (e: React.DragEvent, index: number) => {
|
|
27
|
+
if (disabled) return
|
|
28
|
+
setDraggedIndex(index)
|
|
29
|
+
e.dataTransfer.effectAllowed = "move"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const handleDragOver = (e: React.DragEvent) => {
|
|
33
|
+
e.preventDefault()
|
|
34
|
+
e.dataTransfer.dropEffect = "move"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const handleDrop = (e: React.DragEvent, dropIndex: number) => {
|
|
38
|
+
e.preventDefault()
|
|
39
|
+
|
|
40
|
+
if (disabled || draggedIndex === null || draggedIndex === dropIndex) {
|
|
41
|
+
setDraggedIndex(null)
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const newItems = [...items]
|
|
46
|
+
const draggedItem = newItems[draggedIndex]
|
|
47
|
+
|
|
48
|
+
newItems.splice(draggedIndex, 1)
|
|
49
|
+
newItems.splice(dropIndex, 0, draggedItem)
|
|
50
|
+
|
|
51
|
+
onReorder(newItems)
|
|
52
|
+
setDraggedIndex(null)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const handleDragEnd = () => {
|
|
56
|
+
setDraggedIndex(null)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div className={cn("space-y-2", className)}>
|
|
61
|
+
{items.map((item, index) => (
|
|
62
|
+
<div
|
|
63
|
+
key={keyExtractor(item)}
|
|
64
|
+
draggable={!disabled}
|
|
65
|
+
onDragStart={(e) => handleDragStart(e, index)}
|
|
66
|
+
onDragOver={handleDragOver}
|
|
67
|
+
onDrop={(e) => handleDrop(e, index)}
|
|
68
|
+
onDragEnd={handleDragEnd}
|
|
69
|
+
className={cn(
|
|
70
|
+
"transition-opacity duration-200",
|
|
71
|
+
!disabled && "cursor-move hover:opacity-80",
|
|
72
|
+
draggedIndex === index && "opacity-50",
|
|
73
|
+
disabled && "cursor-not-allowed"
|
|
74
|
+
)}
|
|
75
|
+
>
|
|
76
|
+
{renderItem(item, index)}
|
|
77
|
+
</div>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|