@moontra/moonui 2.1.0 → 2.1.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.
- package/dist/index.js +435 -2027
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +200 -1898
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/components/ui/accordion.tsx +11 -8
- package/src/components/ui/alert.tsx +13 -10
- package/src/components/ui/aspect-ratio.tsx +9 -6
- package/src/components/ui/avatar.tsx +10 -7
- package/src/components/ui/badge.tsx +7 -4
- package/src/components/ui/breadcrumb.tsx +31 -29
- package/src/components/ui/calendar.tsx +9 -6
- package/src/components/ui/card.tsx +21 -18
- package/src/components/ui/checkbox.tsx +8 -5
- package/src/components/ui/collapsible.tsx +12 -10
- package/src/components/ui/color-picker.tsx +2 -2
- package/src/components/ui/command.tsx +28 -26
- package/src/components/ui/data-table.tsx +2 -2
- package/src/components/ui/date-picker.tsx +8 -8
- package/src/components/ui/dialog.tsx +23 -21
- package/src/components/ui/dropdown-menu.tsx +36 -34
- package/src/components/ui/file-upload.tsx +3 -3
- package/src/components/ui/input.tsx +9 -6
- package/src/components/ui/label.tsx +7 -4
- package/src/components/ui/locked-component.tsx +1 -1
- package/src/components/ui/moon-logo.tsx +1 -1
- package/src/components/ui/pagination.tsx +7 -5
- package/src/components/ui/popover.tsx +11 -9
- package/src/components/ui/progress.tsx +9 -6
- package/src/components/ui/radio-group.tsx +10 -7
- package/src/components/ui/select.tsx +23 -21
- package/src/components/ui/separator.tsx +8 -5
- package/src/components/ui/simple-editor.tsx +4 -4
- package/src/components/ui/skeleton.tsx +10 -7
- package/src/components/ui/slider.tsx +8 -5
- package/src/components/ui/switch.tsx +6 -3
- package/src/components/ui/table.tsx +31 -29
- package/src/components/ui/tabs.tsx +12 -9
- package/src/components/ui/textarea.tsx +7 -4
- package/src/components/ui/toast.tsx +9 -7
- package/src/components/ui/toggle.tsx +7 -4
- package/src/components/ui/tooltip.tsx +13 -11
- package/src/use-performance-optimizer.ts +1 -1
|
@@ -36,7 +36,7 @@ const radioGroupItemVariants = cva(
|
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
export interface
|
|
39
|
+
export interface MoonUIRadioGroupProps 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 MoonUIRadioGroup = React.forwardRef<HTMLDivElement, MoonUIRadioGroupProps>(
|
|
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 RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
|
|
79
|
+
MoonUIRadioGroup.displayName = "MoonUIRadioGroup";
|
|
80
80
|
|
|
81
|
-
export interface
|
|
81
|
+
export interface MoonUIRadioGroupItemProps
|
|
82
82
|
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>,
|
|
83
83
|
VariantProps<typeof radioGroupItemVariants> {
|
|
84
84
|
/**
|
|
@@ -99,7 +99,7 @@ export interface RadioGroupItemProps
|
|
|
99
99
|
disabled?: boolean;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const
|
|
102
|
+
const MoonUIRadioGroupItem = React.forwardRef<
|
|
103
103
|
HTMLInputElement,
|
|
104
104
|
RadioGroupItemProps
|
|
105
105
|
>(({ className, variant, size, indicator, id, value, disabled, ...props }, ref) => {
|
|
@@ -155,7 +155,7 @@ const RadioGroupItem = React.forwardRef<
|
|
|
155
155
|
</div>
|
|
156
156
|
);
|
|
157
157
|
});
|
|
158
|
-
|
|
158
|
+
MoonUIRadioGroupItem.displayName = "MoonUIRadioGroupItem";
|
|
159
159
|
|
|
160
160
|
// Radio Label Component
|
|
161
161
|
interface RadioLabelProps extends React.HTMLAttributes<HTMLLabelElement> {
|
|
@@ -240,4 +240,7 @@ const RadioItemWithLabel = React.forwardRef<
|
|
|
240
240
|
});
|
|
241
241
|
RadioItemWithLabel.displayName = "RadioItemWithLabel";
|
|
242
242
|
|
|
243
|
-
export {
|
|
243
|
+
export { MoonUIRadioGroup, MoonUIRadioGroupItem, RadioLabel, RadioItemWithLabel };
|
|
244
|
+
|
|
245
|
+
// Backward compatibility exports
|
|
246
|
+
export { MoonUILabel as Label, MoonUIRadioGroup as RadioGroup, MoonUIRadioGroupItem as RadioGroupItem };
|
|
@@ -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 MoonUISelect = SelectPrimitive.Root
|
|
18
|
+
MoonUISelect.displayName = "MoonUISelect"
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const MoonUISelectGroup = SelectPrimitive.Group
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const MoonUISelectValue = 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 MoonUISelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
28
28
|
/** Visual variant */
|
|
29
29
|
variant?: SelectTriggerVariant;
|
|
30
30
|
/** Size */
|
|
@@ -41,7 +41,7 @@ interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof Selec
|
|
|
41
41
|
rightIcon?: React.ReactNode;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const MoonUISelectTrigger = 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 MoonUISelectContent = 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 SelectContent = React.forwardRef<
|
|
|
179
179
|
))
|
|
180
180
|
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
181
181
|
|
|
182
|
-
const
|
|
182
|
+
const MoonUISelectLabel = 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 MoonUISelectItemProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
198
198
|
/** Visual variant */
|
|
199
199
|
variant?: SelectItemVariant;
|
|
200
200
|
/** Size */
|
|
@@ -205,7 +205,7 @@ interface SelectItemProps extends React.ComponentPropsWithoutRef<typeof SelectPr
|
|
|
205
205
|
customIndicator?: React.ReactNode;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
const
|
|
208
|
+
const MoonUISelectItem = 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 SelectItem = React.forwardRef<
|
|
|
247
247
|
))
|
|
248
248
|
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
249
249
|
|
|
250
|
-
const
|
|
250
|
+
const MoonUISelectSeparator = React.forwardRef<
|
|
251
251
|
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
252
252
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
253
253
|
>(({ className, ...props }, ref) => (
|
|
@@ -259,15 +259,17 @@ const SelectSeparator = React.forwardRef<
|
|
|
259
259
|
))
|
|
260
260
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
261
261
|
|
|
262
|
-
export {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
SelectSeparator,
|
|
262
|
+
export { MoonUISelect,
|
|
263
|
+
MoonUISelectGroup,
|
|
264
|
+
MoonUISelectValue,
|
|
265
|
+
MoonUISelectTrigger,
|
|
266
|
+
MoonUISelectContent,
|
|
267
|
+
MoonUISelectLabel,
|
|
268
|
+
MoonUISelectItem,
|
|
269
|
+
MoonUISelectSeparator,
|
|
271
270
|
SelectScrollUpButton,
|
|
272
271
|
SelectScrollDownButton,
|
|
273
|
-
}
|
|
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 }
|
|
@@ -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 moonUISeparatorVariants = cva(
|
|
10
10
|
"shrink-0 bg-border",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
@@ -104,11 +104,11 @@ const separatorVariants = cva(
|
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
|
|
107
|
-
export interface
|
|
107
|
+
export interface MoonUISeparatorProps
|
|
108
108
|
extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>,
|
|
109
|
-
VariantProps<typeof
|
|
109
|
+
VariantProps<typeof moonUISeparatorVariants> {}
|
|
110
110
|
|
|
111
|
-
const
|
|
111
|
+
const MoonUISeparator = React.forwardRef<
|
|
112
112
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
113
113
|
SeparatorProps
|
|
114
114
|
>(
|
|
@@ -137,4 +137,7 @@ const Separator = React.forwardRef<
|
|
|
137
137
|
)
|
|
138
138
|
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
139
139
|
|
|
140
|
-
export {
|
|
140
|
+
export { MoonUISeparator, moonUISeparatorVariants };
|
|
141
|
+
|
|
142
|
+
// Backward compatibility exports
|
|
143
|
+
export { MoonUISeparator as Separator, moonUISeparatorVariants as separatorVariants }
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
Edit
|
|
33
33
|
} from 'lucide-react'
|
|
34
34
|
|
|
35
|
-
export interface
|
|
35
|
+
export interface MoonUISimpleEditorProps {
|
|
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 MoonUIColorPicker = ({ 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 ColorPicker = ({ onColorSelect }: { onColorSelect: (color: string) => void
|
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export const
|
|
94
|
+
export const MoonUISimpleEditor = React.forwardRef<HTMLDivElement, MoonUISimpleEditorProps>(
|
|
95
95
|
({
|
|
96
96
|
value = '',
|
|
97
97
|
onChange,
|
|
@@ -633,7 +633,7 @@ export const SimpleEditor = React.forwardRef<HTMLDivElement, SimpleEditorProps>(
|
|
|
633
633
|
}
|
|
634
634
|
)
|
|
635
635
|
|
|
636
|
-
|
|
636
|
+
MoonUISimpleEditor.displayName = "MoonUISimpleEditor"
|
|
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 moonUISkeletonVariants = cva(
|
|
17
17
|
"animate-pulse rounded-md",
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
@@ -48,9 +48,9 @@ const skeletonVariants = cva(
|
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
export interface
|
|
51
|
+
export interface MoonUISkeletonProps
|
|
52
52
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
53
|
-
VariantProps<typeof
|
|
53
|
+
VariantProps<typeof moonUISkeletonVariants> {
|
|
54
54
|
/**
|
|
55
55
|
* Height of the skeleton
|
|
56
56
|
*/
|
|
@@ -77,7 +77,7 @@ export interface SkeletonProps
|
|
|
77
77
|
motion?: boolean;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export const
|
|
80
|
+
export const MoonUISkeleton = React.forwardRef<HTMLDivElement, MoonUISkeletonProps>(
|
|
81
81
|
({
|
|
82
82
|
className,
|
|
83
83
|
variant,
|
|
@@ -153,7 +153,7 @@ export const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(
|
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
|
|
156
|
+
MoonUISkeleton.displayName = "MoonUISkeleton";
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* Text Skeleton Component
|
|
@@ -348,4 +348,7 @@ export const SkeletonCard = React.forwardRef<HTMLDivElement, SkeletonCardProps>(
|
|
|
348
348
|
);
|
|
349
349
|
SkeletonCard.displayName = "SkeletonCard";
|
|
350
350
|
|
|
351
|
-
export {
|
|
351
|
+
export { moonUISkeletonVariants };
|
|
352
|
+
|
|
353
|
+
// Backward compatibility exports
|
|
354
|
+
export { moonUISkeletonVariants as 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 moonUISliderVariants = 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 moonUISliderVariants>["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 MoonUISlider = React.forwardRef<
|
|
167
167
|
HTMLDivElement,
|
|
168
168
|
SliderProps
|
|
169
169
|
>(({
|
|
@@ -346,6 +346,9 @@ const Slider = React.forwardRef<
|
|
|
346
346
|
)
|
|
347
347
|
})
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
MoonUISlider.displayName = "MoonUISlider"
|
|
350
350
|
|
|
351
|
-
export {
|
|
351
|
+
export { MoonUISlider };
|
|
352
|
+
|
|
353
|
+
// Backward compatibility exports
|
|
354
|
+
export { MoonUISlider as Slider }
|
|
@@ -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 MoonUISwitchProps 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 SwitchProps extends React.ComponentPropsWithoutRef<typeof Switc
|
|
|
23
23
|
description?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const MoonUISwitch = 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,5 +79,8 @@ const Switch = React.forwardRef<
|
|
|
79
79
|
))
|
|
80
80
|
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
81
81
|
|
|
82
|
-
export {
|
|
82
|
+
export { MoonUISwitch };
|
|
83
|
+
|
|
84
|
+
// Backward compatibility exports
|
|
85
|
+
export { MoonUISwitch as Switch }
|
|
83
86
|
export type { SwitchSize, SwitchVariant }
|
|
@@ -37,7 +37,7 @@ export interface ColumnDefinition<T> {
|
|
|
37
37
|
sortable?: boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
interface
|
|
40
|
+
interface MoonUITableProps<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 TableProps<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 MoonUITable = React.forwardRef<
|
|
65
65
|
HTMLTableElement,
|
|
66
66
|
TableProps<unknown>
|
|
67
67
|
>(({
|
|
@@ -121,24 +121,24 @@ const Table = React.forwardRef<
|
|
|
121
121
|
</div>
|
|
122
122
|
);
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
MoonUITable.displayName = "MoonUITable";
|
|
125
125
|
|
|
126
|
-
const
|
|
126
|
+
const MoonUITableHeader = 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
|
+
MoonUITableHeader.displayName = "MoonUITableHeader";
|
|
133
133
|
|
|
134
|
-
interface
|
|
134
|
+
interface MoonUITableBodyProps 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 MoonUITableBody = React.forwardRef<
|
|
142
142
|
HTMLTableSectionElement,
|
|
143
143
|
TableBodyProps
|
|
144
144
|
>(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
|
|
@@ -169,9 +169,9 @@ const TableBody = React.forwardRef<
|
|
|
169
169
|
</tbody>
|
|
170
170
|
)
|
|
171
171
|
});
|
|
172
|
-
|
|
172
|
+
MoonUITableBody.displayName = "MoonUITableBody";
|
|
173
173
|
|
|
174
|
-
const
|
|
174
|
+
const MoonUITableFooter = React.forwardRef<
|
|
175
175
|
HTMLTableSectionElement,
|
|
176
176
|
React.HTMLAttributes<HTMLTableSectionElement>
|
|
177
177
|
>(({ className, ...props }, ref) => (
|
|
@@ -181,9 +181,9 @@ const TableFooter = React.forwardRef<
|
|
|
181
181
|
{...props}
|
|
182
182
|
/>
|
|
183
183
|
));
|
|
184
|
-
|
|
184
|
+
MoonUITableFooter.displayName = "MoonUITableFooter";
|
|
185
185
|
|
|
186
|
-
const
|
|
186
|
+
const MoonUITableRow = React.forwardRef<
|
|
187
187
|
HTMLTableRowElement,
|
|
188
188
|
React.HTMLAttributes<HTMLTableRowElement>
|
|
189
189
|
>(({ className, ...props }, ref) => (
|
|
@@ -196,9 +196,9 @@ const TableRow = React.forwardRef<
|
|
|
196
196
|
{...props}
|
|
197
197
|
/>
|
|
198
198
|
));
|
|
199
|
-
|
|
199
|
+
MoonUITableRow.displayName = "MoonUITableRow";
|
|
200
200
|
|
|
201
|
-
interface
|
|
201
|
+
interface MoonUITableHeadProps 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 TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
|
207
207
|
onSort?: () => void;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
const
|
|
210
|
+
const MoonUITableHead = React.forwardRef<HTMLTableCellElement, MoonUITableHeadProps>(
|
|
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 TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
|
|
|
282
282
|
);
|
|
283
283
|
}
|
|
284
284
|
);
|
|
285
|
-
|
|
285
|
+
MoonUITableHead.displayName = "MoonUITableHead";
|
|
286
286
|
|
|
287
|
-
const
|
|
287
|
+
const MoonUITableCell = React.forwardRef<
|
|
288
288
|
HTMLTableCellElement,
|
|
289
289
|
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
290
290
|
>(({ className, ...props }, ref) => (
|
|
@@ -294,9 +294,9 @@ const TableCell = React.forwardRef<
|
|
|
294
294
|
{...props}
|
|
295
295
|
/>
|
|
296
296
|
));
|
|
297
|
-
|
|
297
|
+
MoonUITableCell.displayName = "MoonUITableCell";
|
|
298
298
|
|
|
299
|
-
const
|
|
299
|
+
const MoonUITableCaption = React.forwardRef<
|
|
300
300
|
HTMLTableCaptionElement,
|
|
301
301
|
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
302
302
|
>(({ className, ...props }, ref) => (
|
|
@@ -306,17 +306,19 @@ const TableCaption = React.forwardRef<
|
|
|
306
306
|
{...props}
|
|
307
307
|
/>
|
|
308
308
|
));
|
|
309
|
-
|
|
309
|
+
MoonUITableCaption.displayName = "MoonUITableCaption";
|
|
310
310
|
|
|
311
|
-
export {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
311
|
+
export { MoonUITable,
|
|
312
|
+
MoonUITableHeader,
|
|
313
|
+
MoonUITableBody,
|
|
314
|
+
MoonUITableFooter,
|
|
315
|
+
MoonUITableHead,
|
|
316
|
+
MoonUITableRow,
|
|
317
|
+
MoonUITableCell,
|
|
318
|
+
MoonUITableCaption,
|
|
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 };
|
|
321
323
|
|
|
322
324
|
export type { TableBodyProps };
|
|
@@ -7,12 +7,12 @@ import { cn } from "../../lib/utils";
|
|
|
7
7
|
/* -------------------------------------------------------------------------------------------------
|
|
8
8
|
* Tabs Root
|
|
9
9
|
* -----------------------------------------------------------------------------------------------*/
|
|
10
|
-
interface
|
|
10
|
+
interface MoonUITabsProps 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 MoonUITabs = 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 MoonUITabsListProps
|
|
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 MoonUITabsList = 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 MoonUITabsTriggerProps
|
|
115
115
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,
|
|
116
116
|
VariantProps<typeof tabsTriggerVariants> {
|
|
117
117
|
/** İkon konumu */
|
|
@@ -126,7 +126,7 @@ interface TabsTriggerProps
|
|
|
126
126
|
orientation?: "horizontal" | "vertical";
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const
|
|
129
|
+
const MoonUITabsTrigger = 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 MoonUITabsContentProps
|
|
173
173
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
|
|
174
174
|
/** İçerik animasyonu */
|
|
175
175
|
animated?: boolean;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
const
|
|
178
|
+
const MoonUITabsContent = React.forwardRef<
|
|
179
179
|
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
180
180
|
TabsContentProps
|
|
181
181
|
>(({ className, animated = false, ...props }, ref) => (
|
|
@@ -192,4 +192,7 @@ const TabsContent = React.forwardRef<
|
|
|
192
192
|
|
|
193
193
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
194
194
|
|
|
195
|
-
export {
|
|
195
|
+
export { MoonUITabs, MoonUITabsList, MoonUITabsTrigger, MoonUITabsContent };
|
|
196
|
+
|
|
197
|
+
// Backward compatibility exports
|
|
198
|
+
export { MoonUITabs as Tabs, MoonUITabsList as TabsList, MoonUITabsTrigger as TabsTrigger, MoonUITabsContent as TabsContent };
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../lib/utils"
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface MoonUITextareaProps
|
|
6
6
|
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
7
7
|
// Enhanced props that shouldn't be passed to DOM
|
|
8
8
|
variant?: "default" | "outline" | "ghost" | "underline"
|
|
@@ -15,7 +15,7 @@ export interface TextareaProps
|
|
|
15
15
|
characterCount?: boolean
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const MoonUITextarea = React.forwardRef<HTMLTextAreaElement, MoonUITextareaProps>(
|
|
19
19
|
({
|
|
20
20
|
className,
|
|
21
21
|
// Extract enhanced props to prevent them from being passed to DOM
|
|
@@ -41,6 +41,9 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
)
|
|
44
|
-
|
|
44
|
+
MoonUITextarea.displayName = "MoonUITextarea"
|
|
45
45
|
|
|
46
|
-
export {
|
|
46
|
+
export { MoonUITextarea };
|
|
47
|
+
|
|
48
|
+
// Backward compatibility exports
|
|
49
|
+
export { MoonUITextarea as Textarea }
|
|
@@ -23,7 +23,7 @@ const ToastViewport = React.forwardRef<
|
|
|
23
23
|
));
|
|
24
24
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const moonUIToastVariants = cva(
|
|
27
27
|
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
28
28
|
{
|
|
29
29
|
variants: {
|
|
@@ -46,11 +46,11 @@ const toastVariants = cva(
|
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
type ToastProps = React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
49
|
-
VariantProps<typeof
|
|
49
|
+
VariantProps<typeof moonUIToastVariants>;
|
|
50
50
|
|
|
51
51
|
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const MoonUIToast = React.forwardRef<
|
|
54
54
|
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
55
55
|
ToastProps
|
|
56
56
|
>(({ className, variant, ...props }, ref) => {
|
|
@@ -297,12 +297,11 @@ function Toaster() {
|
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
export {
|
|
301
|
-
type ToastProps,
|
|
300
|
+
export { type ToastProps,
|
|
302
301
|
type ToastActionElement,
|
|
303
302
|
ToastProvider,
|
|
304
303
|
ToastViewport,
|
|
305
|
-
|
|
304
|
+
MoonUIToast,
|
|
306
305
|
ToastTitle,
|
|
307
306
|
ToastDescription,
|
|
308
307
|
ToastAction,
|
|
@@ -310,4 +309,7 @@ export {
|
|
|
310
309
|
Toaster,
|
|
311
310
|
toast,
|
|
312
311
|
useToast,
|
|
313
|
-
};
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// Backward compatibility exports
|
|
315
|
+
export { MoonUIToast as Toast };
|