@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
|
@@ -6,19 +6,19 @@ import { Check, ChevronRight, Circle } from "lucide-react"
|
|
|
6
6
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const DropdownMenu = DropdownMenuPrimitive.Root
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const DropdownMenuSubTrigger = React.forwardRef<
|
|
22
22
|
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
23
23
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
24
24
|
inset?: boolean
|
|
@@ -40,7 +40,7 @@ const MoonUIDropdownMenuSubTrigger = React.forwardRef<
|
|
|
40
40
|
DropdownMenuSubTrigger.displayName =
|
|
41
41
|
DropdownMenuPrimitive.SubTrigger.displayName
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const DropdownMenuSubContent = React.forwardRef<
|
|
44
44
|
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
45
45
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
46
46
|
>(({ className, ...props }, ref) => (
|
|
@@ -56,7 +56,7 @@ const MoonUIDropdownMenuSubContent = React.forwardRef<
|
|
|
56
56
|
DropdownMenuSubContent.displayName =
|
|
57
57
|
DropdownMenuPrimitive.SubContent.displayName
|
|
58
58
|
|
|
59
|
-
const
|
|
59
|
+
const DropdownMenuContent = React.forwardRef<
|
|
60
60
|
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
61
61
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
62
62
|
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
@@ -74,7 +74,7 @@ const MoonUIDropdownMenuContent = React.forwardRef<
|
|
|
74
74
|
))
|
|
75
75
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const DropdownMenuItem = React.forwardRef<
|
|
78
78
|
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
79
79
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
80
80
|
inset?: boolean
|
|
@@ -92,7 +92,7 @@ const MoonUIDropdownMenuItem = React.forwardRef<
|
|
|
92
92
|
))
|
|
93
93
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
|
|
94
94
|
|
|
95
|
-
const
|
|
95
|
+
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
96
96
|
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
97
97
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
98
98
|
>(({ className, children, checked, ...props }, ref) => (
|
|
@@ -116,7 +116,7 @@ const MoonUIDropdownMenuCheckboxItem = React.forwardRef<
|
|
|
116
116
|
DropdownMenuCheckboxItem.displayName =
|
|
117
117
|
DropdownMenuPrimitive.CheckboxItem.displayName
|
|
118
118
|
|
|
119
|
-
const
|
|
119
|
+
const DropdownMenuRadioItem = React.forwardRef<
|
|
120
120
|
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
121
121
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
122
122
|
>(({ className, children, ...props }, ref) => (
|
|
@@ -138,7 +138,7 @@ const MoonUIDropdownMenuRadioItem = React.forwardRef<
|
|
|
138
138
|
))
|
|
139
139
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
|
|
140
140
|
|
|
141
|
-
const
|
|
141
|
+
const DropdownMenuLabel = React.forwardRef<
|
|
142
142
|
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
143
143
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
144
144
|
inset?: boolean
|
|
@@ -156,7 +156,7 @@ const MoonUIDropdownMenuLabel = React.forwardRef<
|
|
|
156
156
|
))
|
|
157
157
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
|
|
158
158
|
|
|
159
|
-
const
|
|
159
|
+
const DropdownMenuSeparator = React.forwardRef<
|
|
160
160
|
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
161
161
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
162
162
|
>(({ className, ...props }, ref) => (
|
|
@@ -168,7 +168,7 @@ const MoonUIDropdownMenuSeparator = React.forwardRef<
|
|
|
168
168
|
))
|
|
169
169
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
|
170
170
|
|
|
171
|
-
const
|
|
171
|
+
const DropdownMenuShortcut = ({
|
|
172
172
|
className,
|
|
173
173
|
...props
|
|
174
174
|
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
@@ -179,24 +179,22 @@ const MoonUIDropdownMenuShortcut = ({
|
|
|
179
179
|
/>
|
|
180
180
|
)
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
export {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
// Backward compatibility exports
|
|
202
|
-
export { MoonUICheckbox as Checkbox, MoonUIDropdownMenu as DropdownMenu, MoonUILabel as Label, MoonUIRadioGroup as RadioGroup, MoonUISeparator as Separator, MoonUIDropdownMenuTrigger as DropdownMenuTrigger, MoonUIDropdownMenuContent as DropdownMenuContent, MoonUIDropdownMenuItem as DropdownMenuItem, MoonUIDropdownMenuCheckboxItem as DropdownMenuCheckboxItem, MoonUIDropdownMenuRadioItem as DropdownMenuRadioItem, MoonUIDropdownMenuLabel as DropdownMenuLabel, MoonUIDropdownMenuSeparator as DropdownMenuSeparator, MoonUIDropdownMenuShortcut as DropdownMenuShortcut, MoonUIDropdownMenuGroup as DropdownMenuGroup, MoonUIDropdownMenuPortal as DropdownMenuPortal, MoonUIDropdownMenuSub as DropdownMenuSub, MoonUIDropdownMenuSubContent as DropdownMenuSubContent, MoonUIDropdownMenuSubTrigger as DropdownMenuSubTrigger, MoonUIDropdownMenuRadioGroup as DropdownMenuRadioGroup }
|
|
182
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
DropdownMenu,
|
|
186
|
+
DropdownMenuTrigger,
|
|
187
|
+
DropdownMenuContent,
|
|
188
|
+
DropdownMenuItem,
|
|
189
|
+
DropdownMenuCheckboxItem,
|
|
190
|
+
DropdownMenuRadioItem,
|
|
191
|
+
DropdownMenuLabel,
|
|
192
|
+
DropdownMenuSeparator,
|
|
193
|
+
DropdownMenuShortcut,
|
|
194
|
+
DropdownMenuGroup,
|
|
195
|
+
DropdownMenuPortal,
|
|
196
|
+
DropdownMenuSub,
|
|
197
|
+
DropdownMenuSubContent,
|
|
198
|
+
DropdownMenuSubTrigger,
|
|
199
|
+
DropdownMenuRadioGroup,
|
|
200
|
+
}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
Loader2
|
|
20
20
|
} from 'lucide-react'
|
|
21
21
|
|
|
22
|
-
export interface
|
|
22
|
+
export interface FileUploadProps {
|
|
23
23
|
accept?: string
|
|
24
24
|
multiple?: boolean
|
|
25
25
|
maxSize?: number // in bytes
|
|
@@ -135,7 +135,7 @@ const FileItem = ({
|
|
|
135
135
|
)
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
export const
|
|
138
|
+
export const FileUpload = React.forwardRef<HTMLDivElement, FileUploadProps>(
|
|
139
139
|
({
|
|
140
140
|
accept = "*",
|
|
141
141
|
multiple = true,
|
|
@@ -397,4 +397,4 @@ export const MoonUIFileUpload = React.forwardRef<HTMLDivElement, MoonUIFileUploa
|
|
|
397
397
|
}
|
|
398
398
|
)
|
|
399
399
|
|
|
400
|
-
|
|
400
|
+
FileUpload.displayName = "FileUpload"
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useState, useRef, useEffect } from "react"
|
|
4
|
+
import { motion, useMotionValue, useTransform, animate, PanInfo } from "framer-motion"
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
export interface GestureDrawerProps {
|
|
8
|
+
children: React.ReactNode
|
|
9
|
+
isOpen: boolean
|
|
10
|
+
onOpenChange: (open: boolean) => void
|
|
11
|
+
direction?: "up" | "down" | "left" | "right"
|
|
12
|
+
threshold?: number
|
|
13
|
+
className?: string
|
|
14
|
+
overlayClassName?: string
|
|
15
|
+
enableSwipeToClose?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const GestureDrawer = React.forwardRef<HTMLDivElement, GestureDrawerProps>(
|
|
19
|
+
({
|
|
20
|
+
children,
|
|
21
|
+
isOpen,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
direction = "up",
|
|
24
|
+
threshold = 50,
|
|
25
|
+
className,
|
|
26
|
+
overlayClassName,
|
|
27
|
+
enableSwipeToClose = true,
|
|
28
|
+
...props
|
|
29
|
+
}, ref) => {
|
|
30
|
+
const y = useMotionValue(0)
|
|
31
|
+
const x = useMotionValue(0)
|
|
32
|
+
|
|
33
|
+
const isVertical = direction === "up" || direction === "down"
|
|
34
|
+
const motionValue = isVertical ? y : x
|
|
35
|
+
|
|
36
|
+
const opacity = useTransform(motionValue, [0, threshold], [1, 0.5])
|
|
37
|
+
|
|
38
|
+
const handleDragEnd = (event: any, info: PanInfo) => {
|
|
39
|
+
if (!enableSwipeToClose) return
|
|
40
|
+
|
|
41
|
+
const offset = isVertical ? info.offset.y : info.offset.x
|
|
42
|
+
const velocity = isVertical ? info.velocity.y : info.velocity.x
|
|
43
|
+
|
|
44
|
+
let shouldClose = false
|
|
45
|
+
|
|
46
|
+
switch (direction) {
|
|
47
|
+
case "up":
|
|
48
|
+
shouldClose = offset > threshold || velocity > 500
|
|
49
|
+
break
|
|
50
|
+
case "down":
|
|
51
|
+
shouldClose = offset < -threshold || velocity < -500
|
|
52
|
+
break
|
|
53
|
+
case "left":
|
|
54
|
+
shouldClose = offset > threshold || velocity > 500
|
|
55
|
+
break
|
|
56
|
+
case "right":
|
|
57
|
+
shouldClose = offset < -threshold || velocity < -500
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (shouldClose) {
|
|
62
|
+
onOpenChange(false)
|
|
63
|
+
} else {
|
|
64
|
+
animate(motionValue, 0, { type: "spring", stiffness: 300, damping: 20 })
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const getInitialPosition = () => {
|
|
69
|
+
switch (direction) {
|
|
70
|
+
case "up":
|
|
71
|
+
return { y: "100%" }
|
|
72
|
+
case "down":
|
|
73
|
+
return { y: "-100%" }
|
|
74
|
+
case "left":
|
|
75
|
+
return { x: "100%" }
|
|
76
|
+
case "right":
|
|
77
|
+
return { x: "-100%" }
|
|
78
|
+
default:
|
|
79
|
+
return { y: "100%" }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const getAnimatePosition = () => {
|
|
84
|
+
return isVertical ? { y: 0 } : { x: 0 }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!isOpen) return null
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div className="fixed inset-0 z-50">
|
|
91
|
+
{/* Overlay */}
|
|
92
|
+
<motion.div
|
|
93
|
+
initial={{ opacity: 0 }}
|
|
94
|
+
animate={{ opacity: 1 }}
|
|
95
|
+
exit={{ opacity: 0 }}
|
|
96
|
+
onClick={() => onOpenChange(false)}
|
|
97
|
+
className={cn("absolute inset-0 bg-black/50", overlayClassName)}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
{/* Drawer */}
|
|
101
|
+
<motion.div
|
|
102
|
+
ref={ref}
|
|
103
|
+
drag={enableSwipeToClose ? (isVertical ? "y" : "x") : false}
|
|
104
|
+
dragConstraints={{
|
|
105
|
+
top: direction === "up" ? 0 : undefined,
|
|
106
|
+
bottom: direction === "down" ? 0 : undefined,
|
|
107
|
+
left: direction === "left" ? 0 : undefined,
|
|
108
|
+
right: direction === "right" ? 0 : undefined
|
|
109
|
+
}}
|
|
110
|
+
dragElastic={0.2}
|
|
111
|
+
onDragEnd={handleDragEnd}
|
|
112
|
+
style={{
|
|
113
|
+
[isVertical ? "y" : "x"]: motionValue,
|
|
114
|
+
opacity
|
|
115
|
+
}}
|
|
116
|
+
initial={getInitialPosition()}
|
|
117
|
+
animate={getAnimatePosition()}
|
|
118
|
+
exit={getInitialPosition()}
|
|
119
|
+
transition={{ type: "spring", damping: 30, stiffness: 300 }}
|
|
120
|
+
className={cn(
|
|
121
|
+
"absolute bg-background border shadow-lg",
|
|
122
|
+
{
|
|
123
|
+
"bottom-0 left-0 right-0 rounded-t-lg": direction === "up",
|
|
124
|
+
"top-0 left-0 right-0 rounded-b-lg": direction === "down",
|
|
125
|
+
"top-0 bottom-0 right-0 rounded-l-lg": direction === "left",
|
|
126
|
+
"top-0 bottom-0 left-0 rounded-r-lg": direction === "right"
|
|
127
|
+
},
|
|
128
|
+
className
|
|
129
|
+
)}
|
|
130
|
+
{...props}
|
|
131
|
+
>
|
|
132
|
+
{/* Drag Handle */}
|
|
133
|
+
{(direction === "up" || direction === "down") && (
|
|
134
|
+
<div className="flex justify-center p-2">
|
|
135
|
+
<div className="w-12 h-1 bg-muted rounded-full" />
|
|
136
|
+
</div>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
{children}
|
|
140
|
+
</motion.div>
|
|
141
|
+
</div>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
GestureDrawer.displayName = "GestureDrawer"
|
|
@@ -1,12 +1,46 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// Core UI Components Export
|
|
2
|
+
// Premium components with advanced features
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
export * from "
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export * from "./accordion"
|
|
5
|
+
export * from "./alert"
|
|
6
|
+
export * from "./aspect-ratio"
|
|
7
|
+
export * from "./avatar"
|
|
8
|
+
export * from "./badge"
|
|
9
|
+
export * from "./breadcrumb"
|
|
10
|
+
export * from "./button"
|
|
11
|
+
export * from "./calendar"
|
|
12
|
+
export * from "./card"
|
|
13
|
+
export * from "./checkbox"
|
|
14
|
+
export * from "./collapsible"
|
|
15
|
+
export * from "./color-picker"
|
|
16
|
+
export * from "./command"
|
|
17
|
+
export * from "./data-table"
|
|
18
|
+
export * from "./date-picker"
|
|
19
|
+
export * from "./dialog"
|
|
20
|
+
export * from "./draggable-list"
|
|
21
|
+
export * from "./dropdown-menu"
|
|
22
|
+
export * from "./file-upload"
|
|
23
|
+
export * from "./gesture-drawer"
|
|
24
|
+
export * from "./github-stars"
|
|
25
|
+
export * from "./input"
|
|
26
|
+
export * from "./label"
|
|
8
27
|
export * from "./locked-component"
|
|
9
28
|
export * from "./moon-logo"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
29
|
+
export * from "./pagination"
|
|
30
|
+
export * from "./popover"
|
|
31
|
+
export * from "./progress"
|
|
32
|
+
export * from "./radio-group"
|
|
33
|
+
export * from "./rich-text-editor"
|
|
34
|
+
export * from "./select"
|
|
35
|
+
export * from "./separator"
|
|
36
|
+
export * from "./simple-editor"
|
|
37
|
+
export * from "./skeleton"
|
|
38
|
+
export * from "./slider"
|
|
39
|
+
export * from "./swipeable-card"
|
|
40
|
+
export * from "./switch"
|
|
41
|
+
export * from "./table"
|
|
42
|
+
export * from "./tabs"
|
|
43
|
+
export * from "./textarea"
|
|
44
|
+
export * from "./toast"
|
|
45
|
+
export * from "./toggle"
|
|
46
|
+
export * from "./tooltip"
|
|
@@ -26,7 +26,7 @@ const inputWrapperVariants = cva(
|
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const inputVariants = cva(
|
|
30
30
|
[
|
|
31
31
|
"w-full bg-background transition-all duration-200",
|
|
32
32
|
"text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500",
|
|
@@ -85,9 +85,9 @@ const moonUIInputVariants = cva(
|
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
export interface
|
|
88
|
+
export interface InputProps
|
|
89
89
|
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">,
|
|
90
|
-
Omit<VariantProps<typeof
|
|
90
|
+
Omit<VariantProps<typeof inputVariants>, "isDisabled" | "hasLeftIcon" | "hasRightIcon" | "hasRightButton"> {
|
|
91
91
|
/** Hata mesajı */
|
|
92
92
|
error?: string;
|
|
93
93
|
/** Başarı mesajı */
|
|
@@ -122,7 +122,7 @@ export interface MoonUIInputProps
|
|
|
122
122
|
* @param props.rightButton - Sağ tarafta gösterilecek buton
|
|
123
123
|
* @param props.alwaysShowMessage - Mesajın her zaman görünür olması
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
126
126
|
({
|
|
127
127
|
className,
|
|
128
128
|
wrapperClassName,
|
|
@@ -214,9 +214,6 @@ const MoonUIInput = React.forwardRef<HTMLInputElement, MoonUIInputProps>(
|
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
|
-
|
|
217
|
+
Input.displayName = "Input";
|
|
218
218
|
|
|
219
|
-
export {
|
|
220
|
-
|
|
221
|
-
// Backward compatibility exports
|
|
222
|
-
export { MoonUIInput as Input };
|
|
219
|
+
export { Input };
|
|
@@ -6,14 +6,14 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
6
6
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const labelVariants = cva(
|
|
10
10
|
"text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const Label = React.forwardRef<
|
|
14
14
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
15
15
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
16
|
-
VariantProps<typeof
|
|
16
|
+
VariantProps<typeof labelVariants>
|
|
17
17
|
>(({ className, ...props }, ref) => (
|
|
18
18
|
<LabelPrimitive.Root
|
|
19
19
|
ref={ref}
|
|
@@ -23,7 +23,4 @@ const MoonUILabel = React.forwardRef<
|
|
|
23
23
|
))
|
|
24
24
|
Label.displayName = LabelPrimitive.Root.displayName
|
|
25
25
|
|
|
26
|
-
export {
|
|
27
|
-
|
|
28
|
-
// Backward compatibility exports
|
|
29
|
-
export { MoonUILabel as Label }
|
|
26
|
+
export { Label }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { cn } from "../../lib/utils"
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
interface MoonLogoProps extends React.SVGProps<SVGSVGElement> {
|
|
7
7
|
variant?: "default" | "monochrome" | "gradient"
|
|
8
8
|
showText?: boolean
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
|
|
3
3
|
import { cn } from "../../lib/utils"
|
|
4
4
|
import { ButtonProps, buttonVariants } from "./button"
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
|
7
7
|
<nav
|
|
8
8
|
role="navigation"
|
|
9
9
|
aria-label="pagination"
|
|
@@ -11,7 +11,7 @@ const MoonUIPagination = ({ className, ...props }: React.ComponentProps<"nav">)
|
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
13
|
)
|
|
14
|
-
|
|
14
|
+
Pagination.displayName = "Pagination"
|
|
15
15
|
|
|
16
16
|
const PaginationContent = React.forwardRef<
|
|
17
17
|
HTMLUListElement,
|
|
@@ -105,14 +105,12 @@ const PaginationEllipsis = ({
|
|
|
105
105
|
)
|
|
106
106
|
PaginationEllipsis.displayName = "PaginationEllipsis"
|
|
107
107
|
|
|
108
|
-
export {
|
|
108
|
+
export {
|
|
109
|
+
Pagination,
|
|
109
110
|
PaginationContent,
|
|
110
111
|
PaginationEllipsis,
|
|
111
112
|
PaginationItem,
|
|
112
113
|
PaginationLink,
|
|
113
114
|
PaginationNext,
|
|
114
115
|
PaginationPrevious,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// Backward compatibility exports
|
|
118
|
-
export { MoonUIPagination as Pagination }
|
|
116
|
+
}
|
|
@@ -63,11 +63,11 @@ const popoverContentVariants = cva(
|
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
const
|
|
67
|
-
const
|
|
66
|
+
const Popover = PopoverPrimitive.Root;
|
|
67
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
68
68
|
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
69
69
|
|
|
70
|
-
export interface
|
|
70
|
+
export interface PopoverContentProps
|
|
71
71
|
extends Omit<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, 'side'>,
|
|
72
72
|
VariantProps<typeof popoverContentVariants> {
|
|
73
73
|
/**
|
|
@@ -84,7 +84,7 @@ export interface MoonUIPopoverContentProps
|
|
|
84
84
|
overlayBackdrop?: boolean;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
const
|
|
87
|
+
const PopoverContent = React.forwardRef<
|
|
88
88
|
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
89
89
|
PopoverContentProps
|
|
90
90
|
>(({
|
|
@@ -170,16 +170,14 @@ const PopoverFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElem
|
|
|
170
170
|
);
|
|
171
171
|
PopoverFooter.displayName = "PopoverFooter";
|
|
172
172
|
|
|
173
|
-
export {
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
export {
|
|
174
|
+
Popover,
|
|
175
|
+
PopoverTrigger,
|
|
176
|
+
PopoverContent,
|
|
176
177
|
PopoverAnchor,
|
|
177
178
|
PopoverClose,
|
|
178
179
|
PopoverSeparator,
|
|
179
180
|
PopoverHeader,
|
|
180
181
|
PopoverFooter,
|
|
181
182
|
popoverContentVariants,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
// Backward compatibility exports
|
|
185
|
-
export { MoonUIPopover as Popover, MoonUISeparator as Separator, MoonUIPopoverTrigger as PopoverTrigger, MoonUIPopoverContent as PopoverContent };
|
|
183
|
+
};
|
|
@@ -12,7 +12,7 @@ import { cn } from "../../lib/utils";
|
|
|
12
12
|
* Yükleme işlemleri, form gönderimi ve diğer zaman alan işlemleri göstermek için kullanılır.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const progressVariants = cva(
|
|
16
16
|
"relative overflow-hidden bg-muted",
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
@@ -81,9 +81,9 @@ const progressIndicatorVariants = cva(
|
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
|
|
84
|
-
export interface
|
|
84
|
+
export interface ProgressProps
|
|
85
85
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
86
|
-
VariantProps<typeof
|
|
86
|
+
VariantProps<typeof progressVariants> {
|
|
87
87
|
/**
|
|
88
88
|
* İlerleme çubuğu değeri (0-100)
|
|
89
89
|
*/
|
|
@@ -114,7 +114,7 @@ export interface MoonUIProgressProps
|
|
|
114
114
|
max?: number;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const Progress = React.forwardRef<
|
|
118
118
|
HTMLDivElement,
|
|
119
119
|
ProgressProps
|
|
120
120
|
>(({
|
|
@@ -173,13 +173,10 @@ const MoonUIProgress = React.forwardRef<
|
|
|
173
173
|
</>
|
|
174
174
|
);
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
Progress.displayName = "Progress";
|
|
177
177
|
|
|
178
178
|
// Not: Belirsiz ilerleme animasyonu için CSS keyframe styles.css veya Tailwind config içinde tanımlanmalı
|
|
179
179
|
// @keyframes indeterminate-progress içeren bir tanımlama yapılmalıdır
|
|
180
180
|
// .animate-indeterminate-progress sınıfı da bu animasyonu kullanmalıdır
|
|
181
181
|
|
|
182
|
-
export {
|
|
183
|
-
|
|
184
|
-
// Backward compatibility exports
|
|
185
|
-
export { MoonUIProgress as Progress, moonUIProgressVariants as progressVariants };
|
|
182
|
+
export { Progress, progressVariants };
|
|
@@ -36,7 +36,7 @@ const radioGroupItemVariants = cva(
|
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
export interface
|
|
39
|
+
export interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
40
40
|
/**
|
|
41
41
|
* Radio group value
|
|
42
42
|
*/
|
|
@@ -62,7 +62,7 @@ const RadioGroupContext = React.createContext<{
|
|
|
62
62
|
name?: string;
|
|
63
63
|
}>({});
|
|
64
64
|
|
|
65
|
-
const
|
|
65
|
+
const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(
|
|
66
66
|
({ className, value, onValueChange, disabled, name, ...props }, ref) => {
|
|
67
67
|
return (
|
|
68
68
|
<RadioGroupContext.Provider value={{ value, onValueChange, disabled, name }}>
|
|
@@ -76,9 +76,9 @@ const MoonUIRadioGroup = React.forwardRef<HTMLDivElement, MoonUIRadioGroupProps>
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
|
|
79
|
+
RadioGroup.displayName = "RadioGroup";
|
|
80
80
|
|
|
81
|
-
export interface
|
|
81
|
+
export interface RadioGroupItemProps
|
|
82
82
|
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>,
|
|
83
83
|
VariantProps<typeof radioGroupItemVariants> {
|
|
84
84
|
/**
|
|
@@ -99,7 +99,7 @@ export interface MoonUIRadioGroupItemProps
|
|
|
99
99
|
disabled?: boolean;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const
|
|
102
|
+
const RadioGroupItem = React.forwardRef<
|
|
103
103
|
HTMLInputElement,
|
|
104
104
|
RadioGroupItemProps
|
|
105
105
|
>(({ className, variant, size, indicator, id, value, disabled, ...props }, ref) => {
|
|
@@ -155,7 +155,7 @@ const MoonUIRadioGroupItem = React.forwardRef<
|
|
|
155
155
|
</div>
|
|
156
156
|
);
|
|
157
157
|
});
|
|
158
|
-
|
|
158
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
159
159
|
|
|
160
160
|
// Radio Label Component
|
|
161
161
|
interface RadioLabelProps extends React.HTMLAttributes<HTMLLabelElement> {
|
|
@@ -240,7 +240,4 @@ const RadioItemWithLabel = React.forwardRef<
|
|
|
240
240
|
});
|
|
241
241
|
RadioItemWithLabel.displayName = "RadioItemWithLabel";
|
|
242
242
|
|
|
243
|
-
export {
|
|
244
|
-
|
|
245
|
-
// Backward compatibility exports
|
|
246
|
-
export { MoonUILabel as Label, MoonUIRadioGroup as RadioGroup, MoonUIRadioGroupItem as RadioGroupItem };
|
|
243
|
+
export { RadioGroup, RadioGroupItem, RadioLabel, RadioItemWithLabel };
|