@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
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Basic Rich Text Editor - Free Version
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { cn } from "../../../lib/utils"
|
|
6
|
+
|
|
7
|
+
export interface RichTextEditorProps {
|
|
8
|
+
value?: string
|
|
9
|
+
onChange?: (value: string) => void
|
|
10
|
+
placeholder?: string
|
|
11
|
+
className?: string
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function RichTextEditor({
|
|
16
|
+
value = "",
|
|
17
|
+
onChange,
|
|
18
|
+
placeholder = "Start typing...",
|
|
19
|
+
className,
|
|
20
|
+
disabled = false
|
|
21
|
+
}: RichTextEditorProps) {
|
|
22
|
+
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
23
|
+
if (!disabled && onChange) {
|
|
24
|
+
onChange(e.target.value)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={cn("border border-input rounded-md", className)}>
|
|
30
|
+
<div className="border-b border-border p-2 bg-muted/50">
|
|
31
|
+
<div className="flex gap-1">
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
className="px-2 py-1 text-sm rounded hover:bg-background disabled:opacity-50"
|
|
35
|
+
disabled={disabled}
|
|
36
|
+
title="Bold (Pro feature)"
|
|
37
|
+
>
|
|
38
|
+
B
|
|
39
|
+
</button>
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
className="px-2 py-1 text-sm rounded hover:bg-background disabled:opacity-50"
|
|
43
|
+
disabled={disabled}
|
|
44
|
+
title="Italic (Pro feature)"
|
|
45
|
+
>
|
|
46
|
+
I
|
|
47
|
+
</button>
|
|
48
|
+
<button
|
|
49
|
+
type="button"
|
|
50
|
+
className="px-2 py-1 text-sm rounded hover:bg-background disabled:opacity-50"
|
|
51
|
+
disabled={disabled}
|
|
52
|
+
title="Underline (Pro feature)"
|
|
53
|
+
>
|
|
54
|
+
U
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<textarea
|
|
59
|
+
value={value}
|
|
60
|
+
onChange={handleChange}
|
|
61
|
+
placeholder={placeholder}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
className={cn(
|
|
64
|
+
"w-full min-h-[200px] p-3 resize-none border-0 bg-transparent",
|
|
65
|
+
"focus:outline-none focus:ring-0",
|
|
66
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
67
|
+
)}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -14,17 +14,17 @@ import { cn } from "../../lib/utils"
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// Directly re-exporting the Root component
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const Select = SelectPrimitive.Root
|
|
18
|
+
Select.displayName = "Select"
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const SelectGroup = SelectPrimitive.Group
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const SelectValue = SelectPrimitive.Value
|
|
23
23
|
|
|
24
24
|
type SelectTriggerVariant = "standard" | "outline" | "ghost" | "underline";
|
|
25
25
|
type SelectTriggerSize = "sm" | "md" | "lg";
|
|
26
26
|
|
|
27
|
-
interface
|
|
27
|
+
interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
28
28
|
/** Visual variant */
|
|
29
29
|
variant?: SelectTriggerVariant;
|
|
30
30
|
/** Size */
|
|
@@ -41,7 +41,7 @@ interface MoonUISelectTriggerProps extends React.ComponentPropsWithoutRef<typeof
|
|
|
41
41
|
rightIcon?: React.ReactNode;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const SelectTrigger = React.forwardRef<
|
|
45
45
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
46
46
|
SelectTriggerProps
|
|
47
47
|
>(({ className, children, variant = "standard", size = "md", error, success, loading, leftIcon, rightIcon, ...props }, ref) => (
|
|
@@ -140,7 +140,7 @@ const SelectScrollDownButton = React.forwardRef<
|
|
|
140
140
|
SelectScrollDownButton.displayName =
|
|
141
141
|
SelectPrimitive.ScrollDownButton.displayName
|
|
142
142
|
|
|
143
|
-
const
|
|
143
|
+
const SelectContent = React.forwardRef<
|
|
144
144
|
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
145
145
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
146
146
|
>(({ className, children, position = "item-aligned", ...props }, ref) => (
|
|
@@ -179,7 +179,7 @@ const MoonUISelectContent = React.forwardRef<
|
|
|
179
179
|
))
|
|
180
180
|
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
181
181
|
|
|
182
|
-
const
|
|
182
|
+
const SelectLabel = React.forwardRef<
|
|
183
183
|
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
184
184
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
185
185
|
>(({ className, ...props }, ref) => (
|
|
@@ -194,7 +194,7 @@ SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
|
194
194
|
type SelectItemVariant = "default" | "subtle" | "destructive" | "success" | "warning";
|
|
195
195
|
type SelectItemSize = "sm" | "md" | "lg";
|
|
196
196
|
|
|
197
|
-
interface
|
|
197
|
+
interface SelectItemProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
198
198
|
/** Visual variant */
|
|
199
199
|
variant?: SelectItemVariant;
|
|
200
200
|
/** Size */
|
|
@@ -205,7 +205,7 @@ interface MoonUISelectItemProps extends React.ComponentPropsWithoutRef<typeof Se
|
|
|
205
205
|
customIndicator?: React.ReactNode;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
const
|
|
208
|
+
const SelectItem = React.forwardRef<
|
|
209
209
|
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
210
210
|
SelectItemProps
|
|
211
211
|
>(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => (
|
|
@@ -247,7 +247,7 @@ const MoonUISelectItem = React.forwardRef<
|
|
|
247
247
|
))
|
|
248
248
|
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
249
249
|
|
|
250
|
-
const
|
|
250
|
+
const SelectSeparator = React.forwardRef<
|
|
251
251
|
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
252
252
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
253
253
|
>(({ className, ...props }, ref) => (
|
|
@@ -259,17 +259,15 @@ const MoonUISelectSeparator = React.forwardRef<
|
|
|
259
259
|
))
|
|
260
260
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
261
261
|
|
|
262
|
-
export {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
262
|
+
export {
|
|
263
|
+
Select,
|
|
264
|
+
SelectGroup,
|
|
265
|
+
SelectValue,
|
|
266
|
+
SelectTrigger,
|
|
267
|
+
SelectContent,
|
|
268
|
+
SelectLabel,
|
|
269
|
+
SelectItem,
|
|
270
|
+
SelectSeparator,
|
|
270
271
|
SelectScrollUpButton,
|
|
271
272
|
SelectScrollDownButton,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
// Backward compatibility exports
|
|
275
|
-
export { MoonUIButton as Button, MoonUILabel as Label, MoonUISelect as Select, MoonUISeparator as Separator, MoonUISelectTrigger as SelectTrigger, MoonUISelectContent as SelectContent, MoonUISelectItem as SelectItem, MoonUISelectValue as SelectValue, MoonUISelectGroup as SelectGroup, MoonUISelectLabel as SelectLabel, MoonUISelectSeparator as SelectSeparator }
|
|
273
|
+
}
|
|
@@ -6,7 +6,7 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
6
6
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const separatorVariants = cva(
|
|
10
10
|
"shrink-0 bg-border",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
@@ -104,11 +104,11 @@ const moonUISeparatorVariants = cva(
|
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
|
|
107
|
-
export interface
|
|
107
|
+
export interface SeparatorProps
|
|
108
108
|
extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>,
|
|
109
|
-
VariantProps<typeof
|
|
109
|
+
VariantProps<typeof separatorVariants> {}
|
|
110
110
|
|
|
111
|
-
const
|
|
111
|
+
const Separator = React.forwardRef<
|
|
112
112
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
113
113
|
SeparatorProps
|
|
114
114
|
>(
|
|
@@ -137,7 +137,4 @@ const MoonUISeparator = React.forwardRef<
|
|
|
137
137
|
)
|
|
138
138
|
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
139
139
|
|
|
140
|
-
export {
|
|
141
|
-
|
|
142
|
-
// Backward compatibility exports
|
|
143
|
-
export { MoonUISeparator as Separator, moonUISeparatorVariants as separatorVariants }
|
|
140
|
+
export { Separator, separatorVariants }
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
Edit
|
|
33
33
|
} from 'lucide-react'
|
|
34
34
|
|
|
35
|
-
export interface
|
|
35
|
+
export interface SimpleEditorProps {
|
|
36
36
|
value?: string
|
|
37
37
|
onChange?: (value: string) => void
|
|
38
38
|
placeholder?: string
|
|
@@ -70,7 +70,7 @@ const ToolbarButton = ({ icon, tooltip, active, onClick, disabled }: ToolbarButt
|
|
|
70
70
|
</Tooltip>
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
const
|
|
73
|
+
const ColorPicker = ({ onColorSelect }: { onColorSelect: (color: string) => void }) => {
|
|
74
74
|
const colors = [
|
|
75
75
|
'#000000', '#374151', '#6B7280', '#9CA3AF',
|
|
76
76
|
'#EF4444', '#F59E0B', '#EAB308', '#22C55E',
|
|
@@ -91,7 +91,7 @@ const MoonUIColorPicker = ({ onColorSelect }: { onColorSelect: (color: string) =
|
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export const
|
|
94
|
+
export const SimpleEditor = React.forwardRef<HTMLDivElement, SimpleEditorProps>(
|
|
95
95
|
({
|
|
96
96
|
value = '',
|
|
97
97
|
onChange,
|
|
@@ -633,7 +633,7 @@ export const MoonUISimpleEditor = React.forwardRef<HTMLDivElement, MoonUISimpleE
|
|
|
633
633
|
}
|
|
634
634
|
)
|
|
635
635
|
|
|
636
|
-
|
|
636
|
+
SimpleEditor.displayName = "SimpleEditor"
|
|
637
637
|
|
|
638
638
|
// Character count component to avoid hydration issues
|
|
639
639
|
const CharacterCount = ({ content }: { content: string }) => {
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
6
6
|
import { motion } from "framer-motion";
|
|
7
|
-
import { skeletonAnimation } from "
|
|
7
|
+
import { skeletonAnimation } from "@/lib/micro-interactions";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Skeleton Component
|
|
@@ -13,7 +13,7 @@ import { skeletonAnimation } from "../../lib/micro-interactions";
|
|
|
13
13
|
* Fully integrated with the theme system and provides various shapes, sizes, and animations.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const skeletonVariants = cva(
|
|
17
17
|
"animate-pulse rounded-md",
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
@@ -48,9 +48,9 @@ const moonUISkeletonVariants = cva(
|
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
export interface
|
|
51
|
+
export interface SkeletonProps
|
|
52
52
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
53
|
-
VariantProps<typeof
|
|
53
|
+
VariantProps<typeof skeletonVariants> {
|
|
54
54
|
/**
|
|
55
55
|
* Height of the skeleton
|
|
56
56
|
*/
|
|
@@ -77,7 +77,7 @@ export interface MoonUISkeletonProps
|
|
|
77
77
|
motion?: boolean;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export const
|
|
80
|
+
export const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(
|
|
81
81
|
({
|
|
82
82
|
className,
|
|
83
83
|
variant,
|
|
@@ -153,7 +153,7 @@ export const MoonUISkeleton = React.forwardRef<HTMLDivElement, MoonUISkeletonPro
|
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
|
|
156
|
+
Skeleton.displayName = "Skeleton";
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* Text Skeleton Component
|
|
@@ -348,7 +348,4 @@ export const SkeletonCard = React.forwardRef<HTMLDivElement, SkeletonCardProps>(
|
|
|
348
348
|
);
|
|
349
349
|
SkeletonCard.displayName = "SkeletonCard";
|
|
350
350
|
|
|
351
|
-
export {
|
|
352
|
-
|
|
353
|
-
// Backward compatibility exports
|
|
354
|
-
export { moonUISkeletonVariants as skeletonVariants };
|
|
351
|
+
export { skeletonVariants };
|
|
@@ -12,7 +12,7 @@ import { cn } from "../../lib/utils"
|
|
|
12
12
|
* Used for value ranges like volume, brightness, price ranges.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const sliderVariants = cva(
|
|
16
16
|
"relative flex w-full touch-none select-none items-center",
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
@@ -153,7 +153,7 @@ type SliderBaseProps = {
|
|
|
153
153
|
/**
|
|
154
154
|
* Slider size
|
|
155
155
|
*/
|
|
156
|
-
size?: VariantProps<typeof
|
|
156
|
+
size?: VariantProps<typeof sliderVariants>["size"];
|
|
157
157
|
/**
|
|
158
158
|
* Disabled state
|
|
159
159
|
*/
|
|
@@ -163,7 +163,7 @@ type SliderBaseProps = {
|
|
|
163
163
|
// Merge HTML properties without defaultValue conflicts
|
|
164
164
|
type SliderProps = SliderBaseProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'>
|
|
165
165
|
|
|
166
|
-
const
|
|
166
|
+
const Slider = React.forwardRef<
|
|
167
167
|
HTMLDivElement,
|
|
168
168
|
SliderProps
|
|
169
169
|
>(({
|
|
@@ -346,9 +346,6 @@ const MoonUISlider = React.forwardRef<
|
|
|
346
346
|
)
|
|
347
347
|
})
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
Slider.displayName = "Slider"
|
|
350
350
|
|
|
351
|
-
export {
|
|
352
|
-
|
|
353
|
-
// Backward compatibility exports
|
|
354
|
-
export { MoonUISlider as Slider }
|
|
351
|
+
export { Slider }
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Basic Swipeable Card - Free Version
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
export interface SwipeableCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
children: React.ReactNode
|
|
9
|
+
onSwipeLeft?: () => void
|
|
10
|
+
onSwipeRight?: () => void
|
|
11
|
+
threshold?: number
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SwipeableCard = React.forwardRef<HTMLDivElement, SwipeableCardProps>(
|
|
16
|
+
({ className, children, onSwipeLeft, onSwipeRight, threshold = 100, disabled = false, ...props }, ref) => {
|
|
17
|
+
const [startX, setStartX] = React.useState(0)
|
|
18
|
+
const [currentX, setCurrentX] = React.useState(0)
|
|
19
|
+
const [isSwiping, setIsSwiping] = React.useState(false)
|
|
20
|
+
|
|
21
|
+
const handleTouchStart = (e: React.TouchEvent) => {
|
|
22
|
+
if (disabled) return
|
|
23
|
+
setStartX(e.touches[0].clientX)
|
|
24
|
+
setIsSwiping(true)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const handleTouchMove = (e: React.TouchEvent) => {
|
|
28
|
+
if (disabled || !isSwiping) return
|
|
29
|
+
setCurrentX(e.touches[0].clientX)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const handleTouchEnd = () => {
|
|
33
|
+
if (disabled || !isSwiping) return
|
|
34
|
+
|
|
35
|
+
const deltaX = currentX - startX
|
|
36
|
+
|
|
37
|
+
if (Math.abs(deltaX) > threshold) {
|
|
38
|
+
if (deltaX > 0 && onSwipeRight) {
|
|
39
|
+
onSwipeRight()
|
|
40
|
+
} else if (deltaX < 0 && onSwipeLeft) {
|
|
41
|
+
onSwipeLeft()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setIsSwiping(false)
|
|
46
|
+
setCurrentX(0)
|
|
47
|
+
setStartX(0)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn(
|
|
54
|
+
"touch-pan-y select-none transition-transform duration-200",
|
|
55
|
+
isSwiping && "cursor-grabbing",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
onTouchStart={handleTouchStart}
|
|
59
|
+
onTouchMove={handleTouchMove}
|
|
60
|
+
onTouchEnd={handleTouchEnd}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
SwipeableCard.displayName = "SwipeableCard"
|
|
@@ -8,7 +8,7 @@ import { cn } from "../../lib/utils"
|
|
|
8
8
|
type SwitchSize = "sm" | "md" | "lg";
|
|
9
9
|
type SwitchVariant = "primary" | "success" | "warning" | "danger" | "secondary";
|
|
10
10
|
|
|
11
|
-
export interface
|
|
11
|
+
export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
|
|
12
12
|
/** Switch boyutu */
|
|
13
13
|
size?: SwitchSize;
|
|
14
14
|
/** Switch renk varyantı */
|
|
@@ -23,7 +23,7 @@ export interface MoonUISwitchProps extends React.ComponentPropsWithoutRef<typeof
|
|
|
23
23
|
description?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const Switch = React.forwardRef<
|
|
27
27
|
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
28
28
|
SwitchProps
|
|
29
29
|
>(({ className, size = "md", variant = "primary", loading, leftIcon, rightIcon, description, ...props }, ref) => (
|
|
@@ -79,8 +79,5 @@ const MoonUISwitch = React.forwardRef<
|
|
|
79
79
|
))
|
|
80
80
|
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
81
81
|
|
|
82
|
-
export {
|
|
83
|
-
|
|
84
|
-
// Backward compatibility exports
|
|
85
|
-
export { MoonUISwitch as Switch }
|
|
82
|
+
export { Switch }
|
|
86
83
|
export type { SwitchSize, SwitchVariant }
|
|
@@ -37,7 +37,7 @@ export interface ColumnDefinition<T> {
|
|
|
37
37
|
sortable?: boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
interface
|
|
40
|
+
interface TableProps<T>
|
|
41
41
|
extends React.HTMLAttributes<HTMLTableElement>,
|
|
42
42
|
VariantProps<typeof tableVariants> {
|
|
43
43
|
/** Veri yükleniyor durumunu gösterir */
|
|
@@ -61,7 +61,7 @@ interface MoonUITableProps<T>
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// Tip parametresiz Table bileşeni için varsayılan tip, herhangi bir veri tipini kabul edebilmesi için
|
|
64
|
-
const
|
|
64
|
+
const Table = React.forwardRef<
|
|
65
65
|
HTMLTableElement,
|
|
66
66
|
TableProps<unknown>
|
|
67
67
|
>(({
|
|
@@ -121,24 +121,24 @@ const MoonUITable = React.forwardRef<
|
|
|
121
121
|
</div>
|
|
122
122
|
);
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
Table.displayName = "Table";
|
|
125
125
|
|
|
126
|
-
const
|
|
126
|
+
const TableHeader = React.forwardRef<
|
|
127
127
|
HTMLTableSectionElement,
|
|
128
128
|
React.HTMLAttributes<HTMLTableSectionElement>
|
|
129
129
|
>(({ className, ...props }, ref) => (
|
|
130
130
|
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
|
131
131
|
));
|
|
132
|
-
|
|
132
|
+
TableHeader.displayName = "TableHeader";
|
|
133
133
|
|
|
134
|
-
interface
|
|
134
|
+
interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
135
135
|
/** Veri yoksa gösterilecek boş durum içeriği */
|
|
136
136
|
emptyContent?: React.ReactNode;
|
|
137
137
|
/** Varsayılan boş durum mesajı */
|
|
138
138
|
emptyMessage?: string;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const
|
|
141
|
+
const TableBody = React.forwardRef<
|
|
142
142
|
HTMLTableSectionElement,
|
|
143
143
|
TableBodyProps
|
|
144
144
|
>(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
|
|
@@ -169,9 +169,9 @@ const MoonUITableBody = React.forwardRef<
|
|
|
169
169
|
</tbody>
|
|
170
170
|
)
|
|
171
171
|
});
|
|
172
|
-
|
|
172
|
+
TableBody.displayName = "TableBody";
|
|
173
173
|
|
|
174
|
-
const
|
|
174
|
+
const TableFooter = React.forwardRef<
|
|
175
175
|
HTMLTableSectionElement,
|
|
176
176
|
React.HTMLAttributes<HTMLTableSectionElement>
|
|
177
177
|
>(({ className, ...props }, ref) => (
|
|
@@ -181,9 +181,9 @@ const MoonUITableFooter = React.forwardRef<
|
|
|
181
181
|
{...props}
|
|
182
182
|
/>
|
|
183
183
|
));
|
|
184
|
-
|
|
184
|
+
TableFooter.displayName = "TableFooter";
|
|
185
185
|
|
|
186
|
-
const
|
|
186
|
+
const TableRow = React.forwardRef<
|
|
187
187
|
HTMLTableRowElement,
|
|
188
188
|
React.HTMLAttributes<HTMLTableRowElement>
|
|
189
189
|
>(({ className, ...props }, ref) => (
|
|
@@ -196,9 +196,9 @@ const MoonUITableRow = React.forwardRef<
|
|
|
196
196
|
{...props}
|
|
197
197
|
/>
|
|
198
198
|
));
|
|
199
|
-
|
|
199
|
+
TableRow.displayName = "TableRow";
|
|
200
200
|
|
|
201
|
-
interface
|
|
201
|
+
interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
202
202
|
/** Bu sütun için sıralama durumu */
|
|
203
203
|
sortable?: boolean;
|
|
204
204
|
/** Bu sütunun sıralanma durumu */
|
|
@@ -207,7 +207,7 @@ interface MoonUITableHeadProps extends React.ThHTMLAttributes<HTMLTableCellEleme
|
|
|
207
207
|
onSort?: () => void;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
const
|
|
210
|
+
const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
|
|
211
211
|
({ className, sortable, sorted, onSort, children, ...props }, ref) => {
|
|
212
212
|
// Sıralama için simgeler
|
|
213
213
|
const renderSortIcon = () => {
|
|
@@ -282,9 +282,9 @@ const MoonUITableHead = React.forwardRef<HTMLTableCellElement, MoonUITableHeadPr
|
|
|
282
282
|
);
|
|
283
283
|
}
|
|
284
284
|
);
|
|
285
|
-
|
|
285
|
+
TableHead.displayName = "TableHead";
|
|
286
286
|
|
|
287
|
-
const
|
|
287
|
+
const TableCell = React.forwardRef<
|
|
288
288
|
HTMLTableCellElement,
|
|
289
289
|
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
290
290
|
>(({ className, ...props }, ref) => (
|
|
@@ -294,9 +294,9 @@ const MoonUITableCell = React.forwardRef<
|
|
|
294
294
|
{...props}
|
|
295
295
|
/>
|
|
296
296
|
));
|
|
297
|
-
|
|
297
|
+
TableCell.displayName = "TableCell";
|
|
298
298
|
|
|
299
|
-
const
|
|
299
|
+
const TableCaption = React.forwardRef<
|
|
300
300
|
HTMLTableCaptionElement,
|
|
301
301
|
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
302
302
|
>(({ className, ...props }, ref) => (
|
|
@@ -306,19 +306,17 @@ const MoonUITableCaption = React.forwardRef<
|
|
|
306
306
|
{...props}
|
|
307
307
|
/>
|
|
308
308
|
));
|
|
309
|
-
|
|
309
|
+
TableCaption.displayName = "TableCaption";
|
|
310
310
|
|
|
311
|
-
export {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
// Backward compatibility exports
|
|
322
|
-
export { MoonUITable as Table, MoonUITableHeader as TableHeader, MoonUITableBody as TableBody, MoonUITableFooter as TableFooter, MoonUITableHead as TableHead, MoonUITableRow as TableRow, MoonUITableCell as TableCell, MoonUITableCaption as TableCaption };
|
|
311
|
+
export {
|
|
312
|
+
Table,
|
|
313
|
+
TableHeader,
|
|
314
|
+
TableBody,
|
|
315
|
+
TableFooter,
|
|
316
|
+
TableHead,
|
|
317
|
+
TableRow,
|
|
318
|
+
TableCell,
|
|
319
|
+
TableCaption,
|
|
320
|
+
};
|
|
323
321
|
|
|
324
322
|
export type { TableBodyProps };
|
|
@@ -7,12 +7,12 @@ import { cn } from "../../lib/utils";
|
|
|
7
7
|
/* -------------------------------------------------------------------------------------------------
|
|
8
8
|
* Tabs Root
|
|
9
9
|
* -----------------------------------------------------------------------------------------------*/
|
|
10
|
-
interface
|
|
10
|
+
interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {
|
|
11
11
|
/** Mobil görünümde dikey düzen için */
|
|
12
12
|
vertical?: boolean;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const Tabs = React.forwardRef<
|
|
16
16
|
React.ElementRef<typeof TabsPrimitive.Root>,
|
|
17
17
|
TabsProps
|
|
18
18
|
>(({ vertical = false, ...props }, ref) => (
|
|
@@ -55,14 +55,14 @@ const tabsListVariants = cva(
|
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
-
interface
|
|
58
|
+
interface TabsListProps
|
|
59
59
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>,
|
|
60
60
|
VariantProps<typeof tabsListVariants> {
|
|
61
61
|
/** Dikey düzende göster */
|
|
62
62
|
orientation?: "horizontal" | "vertical";
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const
|
|
65
|
+
const TabsList = React.forwardRef<
|
|
66
66
|
React.ElementRef<typeof TabsPrimitive.List>,
|
|
67
67
|
TabsListProps
|
|
68
68
|
>(({ className, variant, orientation, fullWidth, ...props }, ref) => (
|
|
@@ -111,7 +111,7 @@ const tabsTriggerVariants = cva(
|
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
-
interface
|
|
114
|
+
interface TabsTriggerProps
|
|
115
115
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,
|
|
116
116
|
VariantProps<typeof tabsTriggerVariants> {
|
|
117
117
|
/** İkon konumu */
|
|
@@ -126,7 +126,7 @@ interface MoonUITabsTriggerProps
|
|
|
126
126
|
orientation?: "horizontal" | "vertical";
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const
|
|
129
|
+
const TabsTrigger = React.forwardRef<
|
|
130
130
|
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
131
131
|
TabsTriggerProps
|
|
132
132
|
>(({
|
|
@@ -169,13 +169,13 @@ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
|
169
169
|
/* -------------------------------------------------------------------------------------------------
|
|
170
170
|
* TabsContent
|
|
171
171
|
* -----------------------------------------------------------------------------------------------*/
|
|
172
|
-
interface
|
|
172
|
+
interface TabsContentProps
|
|
173
173
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
|
|
174
174
|
/** İçerik animasyonu */
|
|
175
175
|
animated?: boolean;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
const
|
|
178
|
+
const TabsContent = React.forwardRef<
|
|
179
179
|
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
180
180
|
TabsContentProps
|
|
181
181
|
>(({ className, animated = false, ...props }, ref) => (
|
|
@@ -192,7 +192,4 @@ const MoonUITabsContent = React.forwardRef<
|
|
|
192
192
|
|
|
193
193
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
194
194
|
|
|
195
|
-
export {
|
|
196
|
-
|
|
197
|
-
// Backward compatibility exports
|
|
198
|
-
export { MoonUITabs as Tabs, MoonUITabsList as TabsList, MoonUITabsTrigger as TabsTrigger, MoonUITabsContent as TabsContent };
|
|
195
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|